]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
Merge with /home/m8/git/u-boot
authorWolfgang Denk <wd@pollux.denx.de>
Sat, 15 Oct 2005 16:23:43 +0000 (18:23 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Sat, 15 Oct 2005 16:23:43 +0000 (18:23 +0200)
225 files changed:
CHANGELOG
Makefile
README
board/LEOX/elpt860/elpt860.c
board/Marvell/common/flash.c
board/Marvell/common/i2c.c
board/Marvell/db64360/db64360.c
board/Marvell/db64360/mv_eth.c
board/Marvell/db64460/db64460.c
board/Marvell/db64460/mv_eth.c
board/RPXClassic/RPXClassic.c
board/RPXlite/RPXlite.c
board/RPXlite_dw/RPXlite_dw.c
board/RRvision/RRvision.c
board/amcc/bubinga/bubinga.c
board/amcc/ebony/ebony.c
board/amcc/ocotea/ocotea.c
board/amcc/walnut/walnut.c
board/atc/flash.c
board/barco/barco.c
board/c2mon/c2mon.c
board/cray/L1/L1.c
board/dave/PPChameleonEVB/PPChameleonEVB.c
board/eltec/bab7xx/misc.c
board/eltec/elppc/eepro100_srom.c
board/eltec/mhpc/mhpc.c
board/emk/common/flash.c
board/emk/common/vpd.c
board/eric/eric.c
board/esd/adciop/adciop.c
board/esd/ar405/ar405.c
board/esd/ash405/ash405.c
board/esd/canbt/canbt.c
board/esd/common/auto_update.c
board/esd/common/lcd.c
board/esd/cpci2dp/cpci2dp.c
board/esd/cpci405/cpci405.c
board/esd/cpci5200/cpci5200.c
board/esd/cpci750/cpci750.c
board/esd/cpci750/mv_eth.c
board/esd/cpciiser4/cpciiser4.c
board/esd/dasa_sim/cmd_dasa_sim.c
board/esd/dasa_sim/dasa_sim.c
board/esd/dp405/dp405.c
board/esd/du405/du405.c
board/esd/hub405/hub405.c
board/esd/ocrtc/ocrtc.c
board/esd/pci405/cmd_pci405.c
board/esd/pci405/pci405.c
board/esd/pf5200/flash.c
board/esd/pf5200/pf5200.c
board/esd/plu405/plu405.c
board/esd/pmc405/pmc405.c
board/esd/voh405/voh405.c
board/esd/wuh405/wuh405.c
board/esteem192e/esteem192e.c
board/etx094/etx094.c
board/evb64260/eth.c
board/evb64260/eth.h
board/evb64260/eth_addrtbl.c
board/evb64260/flash.c
board/evb64260/i2c.c
board/evb64260/zuma_pbb_mbox.c
board/g2000/g2000.c
board/gen860t/gen860t.c
board/genietv/flash.c
board/genietv/genietv.c
board/gth/flash.c
board/gth/gth.c
board/gw8260/gw8260.c
board/hermes/hermes.c
board/hymod/eeprom.c
board/hymod/env.c
board/icecube/flash.c
board/icecube/icecube.c
board/icu862/flash.c
board/icu862/icu862.c
board/ip860/ip860.c
board/iphase4539/iphase4539.c
board/ispan/ispan.c
board/ivm/ivm.c
board/kup/common/load_sernum_ethaddr.c
board/kup/kup4k/kup4k.c
board/lantec/lantec.c
board/lwmon/lwmon.c
board/ml2/flash.c
board/ml2/ml2.c
board/mpl/common/common_util.c
board/mpl/common/isa.c
board/mpl/mip405/mip405.c
board/mpl/pip405/pip405.c
board/mvs1/mvs1.c
board/nx823/nx823.c
board/o2dnt/flash.c
board/o2dnt/o2dnt.c
board/pcippc2/flash.c
board/pm520/pm520.c
board/pn62/pn62.c
board/ppmc8260/ppmc8260.c
board/quantum/quantum.c
board/r360mpi/r360mpi.c
board/rbc823/flash.c
board/rbc823/rbc823.c
board/rmu/rmu.c
board/sandburst/common/ppc440gx_i2c.c
board/sandburst/karef/karef.h
board/sandburst/metrobox/metrobox.h
board/sbc405/sbc405.c
board/siemens/CCM/ccm.c
board/siemens/IAD210/IAD210.c
board/siemens/SCM/scm.c
board/siemens/common/fpga.c
board/siemens/pcu_e/pcu_e.c
board/sixnet/flash.c
board/sixnet/sixnet.c
board/snmc/qs850/qs850.c
board/snmc/qs860t/qs860t.c
board/spd8xx/spd8xx.c
board/stxxtc/Makefile
board/stxxtc/oftree.dts [new file with mode: 0644]
board/svm_sc8xx/svm_sc8xx.c
board/total5200/sdram.c
board/tqm5200/cmd_stk52xx.c
board/tqm5200/tqm5200.c
board/tqm8260/tqm8260.c
board/tqm8xx/load_sernum_ethaddr.c
board/tqm8xx/tqm8xx.c
board/uc100/uc100.c
board/w7o/flash.c
board/w7o/fpga.c
board/w7o/vpd.c
board/w7o/w7o.c
board/xilinx/common/xdma_channel.c
board/xilinx/ml300/ml300.c
board/xilinx/xilinx_enet/emac_adapter.c
board/xilinx/xilinx_iic/iic_adapter.c
common/Makefile
common/cmd_autoscript.c
common/cmd_bmp.c
common/cmd_bootm.c
common/cmd_doc.c
common/cmd_ext2.c
common/cmd_fpga.c
common/cmd_i2c.c
common/cmd_ide.c
common/cmd_immap.c
common/cmd_load.c
common/cmd_log.c
common/cmd_mem.c
common/cmd_nand.c
common/cmd_nvedit.c
common/cmd_pcmcia.c
common/cmd_scsi.c
common/cmd_spi.c
common/cmd_usb.c
common/env_common.c
common/env_flash.c
common/flash.c
common/fpga.c
common/ft_build.c [new file with mode: 0644]
common/hush.c
common/kgdb.c
common/lcd.c
common/main.c
common/soft_i2c.c
common/usb_storage.c
common/xilinx.c
cpu/arm920t/at91rm9200/ether.c
cpu/mpc5xxx/fec.c
cpu/mpc5xxx/i2c.c
cpu/mpc8220/fec.c
cpu/mpc8220/i2c.c
cpu/mpc824x/drivers/i2c/i2c.c
cpu/mpc8260/i2c.c
cpu/mpc83xx/i2c.c
cpu/mpc85xx/i2c.c
cpu/mpc8xx/config.mk
cpu/mpc8xx/i2c.c
cpu/mpc8xx/spi.c
cpu/mpc8xx/video.c
cpu/ppc4xx/4xx_enet.c
cpu/ppc4xx/i2c.c
cpu/ppc4xx/spd_sdram.c
disk/part_dos.c
disk/part_iso.c
doc/README.OFT [new file with mode: 0644]
drivers/cfb_console.c
drivers/dc2114x.c
drivers/e1000.c
drivers/natsemi.c
drivers/ns8382x.c
drivers/pcnet.c
drivers/smiLynxEM.c
drivers/tsec.c
examples/eepro100_eeprom.c
examples/sched.c
fs/fat/fat.c
fs/jffs2/compr_rubin.c
fs/jffs2/jffs2_1pass.c
include/asm-ppc/byteorder.h
include/cmd_confdefs.h
include/common.h
include/configs/AP1000.h
include/configs/APC405.h
include/configs/HH405.h
include/configs/NC650.h
include/configs/PM854.h
include/configs/TOP860.h
include/configs/TQM5200.h
include/configs/TQM8560.h
include/configs/VOH405.h
include/configs/barco.h
include/configs/o2dnt.h
include/configs/stxxtc.h
include/flash.h
include/fpga.h
include/ft_build.h [new file with mode: 0644]
include/linux/byteorder/swab.h
include/net.h
lib_ppc/board.c
net/bootp.c
net/eth.c
net/net.c
net/tftp.c
post/memory.c

index ca73b1ec0ab95063c1c7a28bcf6ce6ec7f7fecc1..95ca866f192a02b823cb4bc765e6d571dbdfa856 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,28 @@
 Changes for U-Boot 1.1.4:
 ======================================================================
 
+* Cleanup for GCC-4.x
+
+* Add documentation for Open Firmware Flat Tree and usage.
+  Patch by Pantelis Antoniou, 13 Oct 2005
+
+* Add missing files for Pantelis Antoniou's patch
+  Patch by Pantelis Antoniou, 04 Sep 2005
+
+* Fix problem in ppc4xx eth-driver without ethaddr (only without
+  CONFIG_NET_MULTI set)
+  Patch by Stefan Roese, 10 Oct 2005
+
+* Fix gzip bmp support (test if malloc fails, warning when truncated).
+  Increase CFG_VIDEO_LOGO_MAX_SIZE on HH405 board.
+  Patch by Stefan Roese, 07 Oct 2005
+
+* Add support for OF flat tree for the STXtc board.
+  Patch by Pantelis Antoniou, 04 Sep 2005
+
+* Support passing of OF flat trees to the kernel.
+  Patch by Pantelis Antoniou, 04 Sep 2005
+
 * Cleanup
 
 * Add support for NetSilicon NS7520 processor.
index fa9b7874b9ed7f8231667bee7d5a43bb388922d0..b91d5b8875f09a26633245e83b2b5a6c62737173 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1601,6 +1601,9 @@ lubbock_config    :       unconfig
 logodl_config  :       unconfig
        @./mkconfig $(@:_config=) arm pxa logodl
 
+pxa255_idp_config:     unconfig
+       @./mkconfig $(@:_config=) arm pxa pxa255_idp
+
 wepep250_config        :       unconfig
        @./mkconfig $(@:_config=) arm pxa wepep250
 
diff --git a/README b/README
index a45ed6dc048879859e6d7bb6f33ecdae08e8cdfc..b0e1fb27c492dc477a6fc9a23dba3f0b86207a28 100644 (file)
--- a/README
+++ b/README
@@ -399,6 +399,20 @@ The following options need to be configured:
                expect it to be in bytes, others in MB.
                Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes.
 
+               CONFIG_OF_FLAT_TREE
+
+               New kernel versions are expecting firmware settings to be
+               passed using flat open firmware trees.
+               The environment variable "disable_of", when set, disables this
+               functionality.
+
+               CONFIG_OF_FLAT_TREE_MAX_SIZE
+
+               The maximum size of the constructed OF tree.
+
+               OF_CPU - The proper name of the cpus node.
+               OF_TBCLK - The timebase frequency.
+
 - Serial Ports:
                CFG_PL010_SERIAL
 
index 82a831f5245b296f47be7c68e2a3988cdd87e82e..775db738e6c3a7680900fd4096c302fa474a91ea 100644 (file)
@@ -169,7 +169,7 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        if (!s || strncmp (s, "ELPT860", 7))
                printf ("### No HW ID - assuming ELPT860\n");
@@ -253,7 +253,7 @@ long int initdram (int board_type)
         * try 8 column mode
         */
        size8 = dram_size (CFG_MAMR_8COL,
-                          (ulong *) SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
+                          SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
 
        udelay (1000);
 
@@ -261,7 +261,7 @@ long int initdram (int board_type)
         * try 9 column mode
         */
        size9 = dram_size (CFG_MAMR_9COL,
-                          (ulong *) SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
+                          SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
 
        if (size8 < size9) {    /* leave configuration at 9 columns       */
                size_b0 = size9;
index c2c5b765946e4f64b4078c0b1dc620a8f0e11fa9..a8add85672ca774384ed4c00b00a1763d30cadf2 100644 (file)
@@ -526,7 +526,7 @@ flash_get_size (int portwidth, vu_long * addr, flash_info_t * info)
 
 int flash_erase (flash_info_t * info, int s_first, int s_last)
 {
-       volatile unsigned char *addr = (char *) (info->start[0]);
+       volatile unsigned char *addr = (uchar *) (info->start[0]);
        int flag, prot, sect, l_sect;
        ulong start, now, last;
 
@@ -696,7 +696,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
                for (sect = s_first; sect <= s_last; sect++) {
                        int sector_size = info->size / info->sector_count;
 
-                       addr = (char *) (info->start[sect]);
+                       addr = (uchar *) (info->start[sect]);
                        memset ((void *) addr, 0, sector_size);
                }
                return 0;
@@ -752,7 +752,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
        /* Start erase on unprotected sectors */
        for (sect = s_first; sect <= s_last; sect++) {
                if (info->protect[sect] == 0) { /* not protected */
-                       addr = (char *) (info->start[sect]);
+                       addr = (uchar *) (info->start[sect]);
                        flash_cmd (info->portwidth, addr, 0, 0x30);
                        l_sect = sect;
                }
@@ -893,7 +893,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
 /* broken for 2x16: TODO */
 static int write_word (flash_info_t * info, ulong dest, ulong data)
 {
-       volatile unsigned char *addr = (char *) (info->start[0]);
+       volatile unsigned char *addr = (uchar *) (info->start[0]);
        ulong start;
        int flag, i;
        ulong mask;
@@ -926,7 +926,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
                                           CHIP_CMD_RST);
                                /* 1st cycle of word/byte program */
                                /* write 0x40 to the location to program */
-                               flash_cmd (info->portwidth, (char *) dest, 0,
+                               flash_cmd (info->portwidth, (uchar *) dest, 0,
                                           CHIP_CMD_PROG);
                                /* 2nd cycle of word/byte program */
                                /* write the data to the destination address */
index 624ee5cfbc70f98f74bb064e0a95e244036343f7..32b2b30a4a23af30d0bec002502bbf9632e66cfc 100644 (file)
@@ -168,7 +168,7 @@ static uchar i2c_select_device (uchar dev_addr, uchar read, int ten_bit)
 static uchar i2c_get_data (uchar * return_data, int len)
 {
 
-       unsigned int data, status;
+       unsigned int data, status = 0;
        int count = 0;
 
        DP (puts ("i2c_get_data\n"));
index 8e181d4e68cfc5ad71dd5e719463be25ef97e3d8..a2ab2d7818573449eba8d2f4f54f8481f7a2a8e9 100644 (file)
@@ -610,7 +610,7 @@ unsigned long long pattern[] = {
 int mem_test_data (void)
 {
        unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
        int i;
        unsigned int hi, lo;
@@ -717,7 +717,7 @@ int mem_march (volatile unsigned long long *base,
               unsigned long long wmask, short read, short write)
 {
        unsigned int i;
-       unsigned long long temp;
+       unsigned long long temp = 0;
        unsigned int hitemp, lotemp, himask, lomask;
 
        for (i = 0; i < size; i++) {
index e2719b99d1a50b450418205cd10f4b189004028a..2dd47bf501dfea3cd01de34edb3edb607c6c68bd 100644 (file)
@@ -267,8 +267,9 @@ void mv6436x_eth_initialize (bd_t * bis)
                dev->send = (void *) db64360_eth_transmit;
                dev->recv = (void *) db64360_eth_poll;
 
-               dev->priv = (void *) ethernet_private =
-                       calloc (sizeof (*ethernet_private), 1);
+               ethernet_private = calloc (sizeof (*ethernet_private), 1);
+               dev->priv = (void *) ethernet_private;
+
                if (!ethernet_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
@@ -281,8 +282,8 @@ void mv6436x_eth_initialize (bd_t * bis)
                memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
 
                /* set pointer to memory for stats data structure etc... */
-               ethernet_private->port_private = (void *) port_private =
-                       calloc (sizeof (*ethernet_private), 1);
+               port_private = calloc (sizeof (*ethernet_private), 1);
+               ethernet_private->port_private = (void *)port_private; 
                if (!port_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
index 75eb5e89be6f98e0ad47b1767e401d3e20ec8335..a4abf8d1fa9839eaaa6bf56de43a87ec7608a320 100644 (file)
@@ -610,7 +610,7 @@ unsigned long long pattern[] = {
 int mem_test_data (void)
 {
        unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
        int i;
        unsigned int hi, lo;
@@ -717,7 +717,7 @@ int mem_march (volatile unsigned long long *base,
               unsigned long long wmask, short read, short write)
 {
        unsigned int i;
-       unsigned long long temp;
+       unsigned long long temp = 0;
        unsigned int hitemp, lotemp, himask, lomask;
 
        for (i = 0; i < size; i++) {
index b78fda35c02dbc8ce0152284c51983f21fbc9c74..a50f174fa5396bf3895b16386f7890f9963cbff3 100644 (file)
@@ -267,8 +267,8 @@ void mv6446x_eth_initialize (bd_t * bis)
                dev->send = (void *) db64460_eth_transmit;
                dev->recv = (void *) db64460_eth_poll;
 
-               dev->priv = (void *) ethernet_private =
-                       calloc (sizeof (*ethernet_private), 1);
+               ethernet_private = calloc (sizeof (*ethernet_private), 1);
+               dev->priv = (void *)ethernet_private; 
                if (!ethernet_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
@@ -281,8 +281,8 @@ void mv6446x_eth_initialize (bd_t * bis)
                memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
 
                /* set pointer to memory for stats data structure etc... */
-               ethernet_private->port_private = (void *) port_private =
-                       calloc (sizeof (*ethernet_private), 1);
+               port_private = calloc (sizeof (*ethernet_private), 1);
+               ethernet_private->port_private = (void *)port_private; 
                if (!port_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
index 5b12a0c04c2abe84e192621f145784578baec10c..49cb8ad24f6df1efbd9b3fff353a7023c174b3cb 100644 (file)
@@ -114,8 +114,8 @@ void board_get_enetaddr (uchar * enet)
        i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
 
        /* Read 256 bytes in EEPROM                             */
-       i2c_read (0x54, 0, 1, buff, 128);
-       i2c_read (0x54, 128, 1, buff + 128, 128);
+       i2c_read (0x54, 0, 1, (uchar *)buff, 128);
+       i2c_read (0x54, 128, 1, (uchar *)buff + 128, 128);
 
        /* Retrieve MAC address in buffer (key EA)              */
        for (cp = buff;;) {
@@ -123,7 +123,7 @@ void board_get_enetaddr (uchar * enet)
                        cp += 3;
                        /* Read MAC address                     */
                        for (i = 0; i < 6; i++, cp += 2) {
-                               enet[i] = aschex_to_byte (cp);
+                               enet[i] = aschex_to_byte ((unsigned char *)cp);
                        }
                }
                /* Scan to the end of the record                */
@@ -200,7 +200,7 @@ long int initdram (int board_type)
         * try 10 column mode
         */
 
-       size10 = dram_size (CFG_MAMR_10COL, (ulong *) SDRAM_BASE_PRELIM,
+       size10 = dram_size (CFG_MAMR_10COL, SDRAM_BASE_PRELIM,
                                                SDRAM_MAX_SIZE);
 
        return (size10);
index d2c2116c12863e2d937d7d995eee540afd1b1b50..f37e07b9234eff7e441c0d2956a97e7bcf019315 100644 (file)
@@ -137,7 +137,7 @@ long int initdram (int board_type)
         * try 10 column mode
         */
 
-       size10 = dram_size (CFG_MAMR_10COL, (ulong *) SDRAM_BASE_PRELIM,
+       size10 = dram_size (CFG_MAMR_10COL, SDRAM_BASE_PRELIM,
                            SDRAM_MAX_SIZE);
 
        return (size10);
index 86cf6c1d4d1e13a23bbddb62cffe0c49d683f194..237c58af360b99054136f602dbff8388179a9906 100644 (file)
@@ -142,7 +142,7 @@ long int initdram (int board_type)
          * try 9 column mode
          */
 
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
+       size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
 
        /*
         * Final mapping:
index d12ea8268606408a07cfb26b4b234681ad48fac7..f46bb9e8e4891b4fb89292a1390f6af545c33c98 100644 (file)
@@ -93,7 +93,7 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        puts ("Board: RRvision ");
 
@@ -157,7 +157,7 @@ long int initdram (int board_type)
         * try 8 column mode
         */
        size8 = dram_size (CFG_MAMR_8COL,
-                          (ulong *)SDRAM_BASE2_PRELIM,
+                          SDRAM_BASE2_PRELIM,
                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -166,7 +166,7 @@ long int initdram (int board_type)
         * try 9 column mode
         */
        size9 = dram_size (CFG_MAMR_9COL,
-                          (ulong *) SDRAM_BASE2_PRELIM,
+                          SDRAM_BASE2_PRELIM,
                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
index b4e9349ad706b3e396286e40bcefe4dee87d4088..fe6ce8a6d13298052c25f6e8ac3a74c750a2c130 100644 (file)
@@ -42,7 +42,7 @@ int board_early_init_f(void)
  */
 int checkboard(void)
 {
-       unsigned char *s = getenv("serial#");
+       char *s = getenv("serial#");
 
        puts("Board: Bubinga - AMCC PPC405EP Evaluation Board");
 
index f6bb83713fd95934cd2524f7439fd65a0634cdca..9191f0f60f2e7c2f98a22d1db7133fa2645730d6 100644 (file)
@@ -91,7 +91,7 @@ int board_early_init_f(void)
 int checkboard(void)
 {
        sys_info_t sysinfo;
-       unsigned char *s = getenv("serial#");
+       char *s = getenv("serial#");
 
        get_sys_info(&sysinfo);
 
index 50981c2367465cd0507d397b973a1f6680629a00..5b28c3b1783041a8d3a629a4e1cae2df999a6527 100644 (file)
@@ -187,7 +187,7 @@ int board_early_init_f (void)
 int checkboard (void)
 {
        sys_info_t sysinfo;
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        get_sys_info (&sysinfo);
 
index 9fca0a60d0e88b76b0e089faef81b751859b2aa0..f1a96a6e7d23a9c90209ccb7caa66d32b74548ef 100644 (file)
@@ -67,7 +67,7 @@ int board_early_init_f(void)
  */
 int checkboard(void)
 {
-       unsigned char *s = getenv("serial#");
+       char *s = getenv("serial#");
        uint pvr = get_pvr();
 
        if (pvr == PVR_405GPR_RB) {
index 26b7c80d3526611bae108181b39e66a973d19db6..2ab60e866b2ff40c93a297956e2c06338bbeda2e 100644 (file)
@@ -181,7 +181,7 @@ void flash_print_info (flash_info_t *info)
        int i;
        uchar *boottype;
        uchar *bootletter;
-       uchar *fmt;
+       char *fmt;
        uchar botbootletter[] = "B";
        uchar topbootletter[] = "T";
        uchar botboottype[] = "bottom boot sector";
index 2fb370098a3191f34233350ba0c1e735e8f5277c..becbd0abda623cd85271acc8725cc80cc6d23f6f 100644 (file)
@@ -90,17 +90,17 @@ long int initdram (int board_type)
        long mear1;
        long emear1;
 
-       size = get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
+       size = get_ram_size (CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
 
        new_bank0_end = size - 1;
-       mear1 = mpc824x_mpc107_getreg(MEAR1);
-       emear1 = mpc824x_mpc107_getreg(EMEAR1);
+       mear1 = mpc824x_mpc107_getreg (MEAR1);
+       emear1 = mpc824x_mpc107_getreg (EMEAR1);
        mear1 = (mear1  & 0xFFFFFF00) |
                ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
        emear1 = (emear1 & 0xFFFFFF00) |
                ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
-       mpc824x_mpc107_setreg(MEAR1, mear1);
-       mpc824x_mpc107_setreg(EMEAR1, emear1);
+       mpc824x_mpc107_setreg (MEAR1, mear1);
+       mpc824x_mpc107_setreg (EMEAR1, emear1);
 
        return (size);
 }
@@ -113,11 +113,11 @@ static struct pci_config_table pci_barcohydra_config_table[] = {
        { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0f, PCI_ANY_ID,
          pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
                                       PCI_ENET0_MEMADDR,
-                                      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
+                                      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER } },
        { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x10, PCI_ANY_ID,
          pci_cfgfunc_config_device, { PCI_ENET1_IOADDR,
                                       PCI_ENET1_MEMADDR,
-                                      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
+                                      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER } },
        { }
 };
 #endif
@@ -128,68 +128,66 @@ struct pci_controller hose = {
 #endif
 };
 
-void pci_init_board(void)
+void pci_init_board (void)
 {
-       pci_mpc824x_init(&hose);
+       pci_mpc824x_init (&hose);
 }
 
-int write_flash(char *addr, char value)
+int write_flash (char *addr, char value)
 {
        char *adr = (char *)0xFF800000;
        int cnt = 0;
        char status,oldstatus;
-       *(adr+0x55) = 0xAA;
 
-       udelay(1);
-       *(adr+0xAA) = 0x55;
-       udelay(1);
-       *(adr+0x55) = 0xA0;
-       udelay(1);
+       *(adr+0x55) = 0xAA; udelay (1);
+       *(adr+0xAA) = 0x55; udelay (1);
+       *(adr+0x55) = 0xA0; udelay (1);
        *addr = value;
 
        status = *addr;
-       do{
-
+       do {
                oldstatus = status;
                status = *addr;
 
-               if ((oldstatus & 0x40) == (status & 0x40)){
+               if ((oldstatus & 0x40) == (status & 0x40)) {
                        return 4;
                }
                cnt++;
-               if (cnt > 10000){
+               if (cnt > 10000) {
                        return 2;
                }
-       }while( (status & 0x20) == 0 );
+       } while ( (status & 0x20) == 0 );
 
        oldstatus = *addr;
        status = *addr;
 
-       if ((oldstatus & 0x40) == (status & 0x40)) return 0;
-       else {
+       if ((oldstatus & 0x40) == (status & 0x40)) {
+               return 0;
+       } else {
                *(adr+0x55) = 0xF0;
                return 1;
        }
 }
 
-unsigned update_flash(unsigned char* buf){
-       switch((*buf) & 0x3){
-               case TRY_WORKING:
-                       printf("found 3 and converted it to 2\n");
-                       write_flash(buf, (*buf) & 0xFE);
-                       *((unsigned char *)0xFF800000) = 0xF0;
-                       udelay(100);
-                       printf("buf [%#010x] %#010x\n",buf,(*buf));
-               case BOOT_WORKING :
-                       return BOOT_WORKING;
+unsigned update_flash (unsigned char *buf)
+{
+       switch ((*buf) & 0x3) {
+       case TRY_WORKING:
+               printf ("found 3 and converted it to 2\n");
+               write_flash ((char *)buf, (*buf) & 0xFE);
+               *((unsigned char *)0xFF800000) = 0xF0;
+               udelay (100);
+               printf ("buf [%#010x] %#010x\n", buf, (*buf));
+               /* XXX - fall through??? */
+       case BOOT_WORKING :
+               return BOOT_WORKING;
        }
        return BOOT_DEFAULT;
 }
 
-unsigned scan_flash(void)
+unsigned scan_flash (void)
 {
        char section[] =  "kernel";
-       ulong   sp;
        int cfgFileLen  =  (CFG_FLASH_ERASE_SECTOR_LENGTH >> 1);
        int sectionPtr  = 0;
        int foundItem   = 0; /* 0: None, 1: section found, 2: "=" found */
@@ -198,57 +196,54 @@ unsigned scan_flash(void)
 
        buf = (unsigned char*)(CFG_FLASH_RANGE_BASE + CFG_FLASH_RANGE_SIZE \
                        - CFG_FLASH_ERASE_SECTOR_LENGTH);
-       for(bufPtr = 0; bufPtr < cfgFileLen; ++bufPtr){
+       for (bufPtr = 0; bufPtr < cfgFileLen; ++bufPtr) {
                if ((buf[bufPtr]==0xFF) && (*(int*)(buf+bufPtr)==0xFFFFFFFF)) {
                        return BOOT_DEFAULT;
                }
-               switch(foundItem)
-               {
-                       /* This is the scanning loop, we try to find a particular
-                        * quoted value
-                        */
-                       case 0:
-                               if((section[sectionPtr] == 0)){
-                                       ++foundItem;
-                               }
-                               else if(buf[bufPtr] == section[sectionPtr]){
-                                       ++sectionPtr;
-                               }
-                               else {
-                                       sectionPtr = 0;
-                               }
-                               break;
-                       case 1:
+               /* This is the scanning loop, we try to find a particular
+                * quoted value
+                */
+               switch (foundItem) {
+               case 0:
+                       if ((section[sectionPtr] == 0)) {
                                ++foundItem;
-                               break;
-                       case 2:
-                               ++foundItem;
-                               break;
-                       case 3:
-                       default:
-                               return update_flash(buf[bufPtr - 1]);
+                       } else if (buf[bufPtr] == section[sectionPtr]) {
+                               ++sectionPtr;
+                       } else {
+                               sectionPtr = 0;
+                       }
+                       break;
+               case 1:
+                       ++foundItem;
+                       break;
+               case 2:
+                       ++foundItem;
+                       break;
+               case 3:
+               default:
+                       return update_flash (&buf[bufPtr - 1]);
                }
        }
 
-       printf("Failed to read %s\n",section);
+       printf ("Failed to read %s\n",section);
        return BOOT_DEFAULT;
 }
 
-TSBootInfo* find_boot_info(void)
+TSBootInfo* find_boot_info (void)
 {
-       unsigned bootimage = scan_flash();
-       TSBootInfo* info = (TSBootInfo*)malloc(sizeof(TSBootInfo));
-
-       switch(bootimage){
-               case TRY_WORKING:
-                               info->address = CFG_WORKING_KERNEL_ADDRESS;
-                               break;
-               case BOOT_WORKING :
-                               info->address = CFG_WORKING_KERNEL_ADDRESS;
-                               break;
-               case BOOT_DEFAULT:
-               default:
-                               info->address= CFG_DEFAULT_KERNEL_ADDRESS;
+       unsigned bootimage = scan_flash ();
+       TSBootInfo* info = (TSBootInfo*)malloc (sizeof(TSBootInfo));
+
+       switch (bootimage) {
+       case TRY_WORKING:
+               info->address = CFG_WORKING_KERNEL_ADDRESS;
+               break;
+       case BOOT_WORKING :
+               info->address = CFG_WORKING_KERNEL_ADDRESS;
+               break;
+       case BOOT_DEFAULT:
+       default:
+               info->address= CFG_DEFAULT_KERNEL_ADDRESS;
 
        }
        info->size = *((unsigned int *)(info->address ));
@@ -256,43 +251,44 @@ TSBootInfo* find_boot_info(void)
        return info;
 }
 
-void barcobcd_boot(void)
+void barcobcd_boot (void)
 {
        TSBootInfo* start;
        char *bootm_args[2];
        char *buf;
        int cnt;
+       extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
        buf = (char *)(0x00800000);
        /* make certain there are enough chars to print the command line here!
         */
-       bootm_args[0]=(char *)malloc(16*sizeof(char));
-       bootm_args[1]=(char *)malloc(16*sizeof(char));
+       bootm_args[0] = (char *)malloc (16*sizeof(char));
+       bootm_args[1] = (char *)malloc (16*sizeof(char));
 
-       start = find_boot_info();
+       start = find_boot_info ();
 
-       printf("Booting kernel at address %#10x with size %#10x\n",
+       printf ("Booting kernel at address %#10x with size %#10x\n",
                        start->address, start->size);
 
        /* give length of the kernel image to bootm */
-       sprintf(bootm_args[0],"%x",start->size);
+       sprintf (bootm_args[0],"%x",start->size);
        /* give address of the kernel image to bootm */
-       sprintf(bootm_args[1],"%x",buf);
+       sprintf (bootm_args[1],"%x",buf);
 
-       printf("flash address: %#10x\n",start->address+8);
-       printf("buf address: %#10x\n",buf);
+       printf ("flash address: %#10x\n",start->address+8);
+       printf ("buf address: %#10x\n",buf);
 
        /* aha, we reserve 8 bytes here... */
-       for (cnt = 0; cnt < start->size ; cnt++){
+       for (cnt = 0; cnt < start->size ; cnt++) {
                buf[cnt] = ((char *)start->address)[cnt+8];
        }
 
        /* initialise RAM memory */
        *((unsigned int *)0xFEC00000) = 0x00141A98;
-       do_bootm(NULL,0,2,bootm_args);
+       do_bootm (NULL,0,2,bootm_args);
 }
 
-int barcobcd_boot_image(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int barcobcd_boot_image (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 #if 0
        if (argc > 1) {
@@ -300,7 +296,7 @@ int barcobcd_boot_image(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 #endif
-       barcobcd_boot();
+       barcobcd_boot ();
 
        return 0;
 }
@@ -308,19 +304,19 @@ int barcobcd_boot_image(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 /* Currently, boot_working and boot_default are the same command. This is
  * left in here to see what we'll do in the future */
 
-U_BOOT_CMD(
+U_BOOT_CMD (
                try_working, 1, 1, barcobcd_boot_image,
                " try_working - check flash value and boot the appropriate image\n",
                "\n"
          );
 
-U_BOOT_CMD(
+U_BOOT_CMD (
                boot_working, 1, 1, barcobcd_boot_image,
                " boot_working - check flash value and boot the appropriate image\n",
                "\n"
          );
 
-U_BOOT_CMD(
+U_BOOT_CMD (
                boot_default, 1, 1, barcobcd_boot_image,
                " boot_default - check flash value and boot the appropriate image\n",
                "\n"
@@ -328,13 +324,40 @@ U_BOOT_CMD(
 /*
  * We are not using serial communication, so just provide empty functions
  */
-int serial_init(void){return 0;}
-void serial_setbrg(void){}
-void serial_putc(const char c){}
-void serial_puts(const char *c){}
-void serial_addr(unsigned int i){}
-int serial_getc(void){return 0;}
-int serial_tstc(void){return 0;}
-
-unsigned long post_word_load(void){return 0l;};
-void post_word_store(unsigned long val){}
+int serial_init (void)
+{
+       return 0;
+}
+void serial_setbrg (void)
+{
+       return;
+}
+void serial_putc (const char c)
+{
+       return;
+}
+void serial_puts (const char *c)
+{
+       return;
+}
+void serial_addr (unsigned int i)
+{
+       return;
+}
+int serial_getc (void)
+{
+       return 0;
+}
+int serial_tstc (void)
+{
+       return 0;
+}
+
+unsigned long post_word_load (void)
+{
+       return 0l;
+}
+void post_word_store (unsigned long val)
+{
+       return;
+}
index 873ff8ccee20fdc6b72e4450863c01779b06eb05..ca8eb0cb02bbddec7839acf5eb511772fcbd6198 100644 (file)
@@ -91,7 +91,7 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
+       unsigned char *s = (unsigned char *)getenv ("serial#");
 
        puts ("Board: TTTech C2MON ");
 
@@ -155,7 +155,7 @@ long int initdram (int board_type)
         * try 8 column mode
         */
        size8 = dram_size (CFG_MAMR_8COL,
-                          (ulong *)SDRAM_BASE2_PRELIM,
+                          SDRAM_BASE2_PRELIM,
                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -164,7 +164,7 @@ long int initdram (int board_type)
         * try 9 column mode
         */
        size9 = dram_size (CFG_MAMR_9COL,
-                          (ulong *) SDRAM_BASE2_PRELIM,
+                          SDRAM_BASE2_PRELIM,
                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
index fb28c42a552cee43be19a59089ccd0786f23653e..a7114eb074ece8394a0c26c608f674b3904a8294 100644 (file)
@@ -133,7 +133,7 @@ int checkboard (void)
 /* ------------------------------------------------------------------------- */
 int misc_init_r (void)
 {
-       unsigned char *s, *e;
+       char *s, *e;
        image_header_t *hdr;
        time_t timestamp;
        struct rtc_time tm;
@@ -146,7 +146,7 @@ int misc_init_r (void)
 
 #define FACTORY_SETTINGS 0xFFFC0000
        if ((s = getenv ("ethaddr")) == NULL) {
-               e = (unsigned char *) (FACTORY_SETTINGS);
+               e = (char *) (FACTORY_SETTINGS);
                if (*(e + 0) != '0'
                        || *(e + 1) != '0'
                        || *(e + 2) != ':'
@@ -314,7 +314,7 @@ static u8 *dhcp_env_update (u8 thing, u8 * pop)
        {
                setenv (Things[thing].envname, Things[thing].dhcpvalue);
        }
-       return (Things[thing].dhcpvalue);
+       return ((u8 *)(Things[thing].dhcpvalue));
 }
 
 /* ------------------------------------------------------------------------- */
index b425d6396739e955895e7de7de65246e31ca427b..5f2c705f1230ab7b47580cacf8f0ac03b2e7ab01 100644 (file)
@@ -185,7 +185,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index b50d11b7518c0ae5396b80fe1c69c99bd0afbe11..6a2480741110ad2a9562967c21c2290316d70907 100644 (file)
@@ -58,7 +58,7 @@ unsigned char  scsi_sym53c8xx_ccf = 0x13;
 int misc_init_r (void)
 {
     revinfo eerev;
-    u_char *ptr;
+    char *ptr;
     u_int  i, l, initSrom, copyNv;
     char buf[256];
     char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
@@ -139,7 +139,7 @@ int misc_init_r (void)
     if (strcmp (eerev.magic, "ELTEC") != 0)
     {
        /* srom is not initialized -> create a default revision info */
-       for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
+       for (i = 0, ptr = (char *)&eerev; i < sizeof(revinfo); i++)
            *ptr++ = 0x00;
        strcpy(eerev.magic, "ELTEC");
        eerev.revrev[0] = 1;
index 9754c1d248e19ea50f4fde9e4a334948ed59186a..f021c50cd647090314617c23b3faca4a94ef6c6d 100644 (file)
@@ -57,7 +57,7 @@ int eepro100_srom_store (unsigned short *source)
 
     /* get onboard network iobase */
     pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-                &onboard_dev.iobase);
+                (unsigned int *)&onboard_dev.iobase);
     onboard_dev.iobase &= ~0xf;
 
     source[63] = eepro100_srom_checksum (source);
index bc3d9f4c6289f3dc9f5051033592cc54aee68f2d..0ffbdf0e575a765536c3d3b29811159b2b5ac28d 100644 (file)
@@ -160,7 +160,7 @@ int misc_init_r (void)
        int i;
 
        /* check revision data */
-       eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo, 32);
+       eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (uchar *) &mhpcRevInfo, 32);
 
        if (strncmp ((char *) &mhpcRevInfo.board[2], "MHPC", 4) != 0) {
                printf ("Enter revision number (0-9): %c  ",
@@ -228,7 +228,7 @@ int misc_init_r (void)
                }
 
                /* setup new revision data */
-               eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo,
+               eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (uchar *) &mhpcRevInfo,
                              32);
        }
 
@@ -422,8 +422,8 @@ void *video_hw_init (void)
        immap_t *immr = (immap_t *) CFG_IMMR;
 
        /* enable video only on CLUT value */
-       if ((penv = getenv ("clut")) != NULL)
-               clut = (u_int) simple_strtoul (penv, NULL, 10);
+       if ((penv = (uchar *)getenv ("clut")) != NULL)
+               clut = (u_int) simple_strtoul ((char *)penv, NULL, 10);
        else
                return NULL;
 
index 28fe29d6445bbac983c9a4f5da17904183309c00..d6161bf3586a5a158d7dbf5f05cef40b6ea6e5f2 100644 (file)
@@ -165,7 +165,7 @@ void flash_print_info (flash_info_t *info)
        int i;
        uchar *boottype;
        uchar *bootletter;
-       uchar *fmt;
+       char *fmt;
        uchar botbootletter[] = "B";
        uchar topbootletter[] = "T";
        uchar botboottype[] = "bottom boot sector";
index cbb7f8f376f63127a4b93afbbdf8dad33385cf66..8a3a12b047f99f1d635aef2a36e8d253852b3c73 100644 (file)
@@ -69,11 +69,11 @@ void read_factory_r (void)
                /*printf ("%s\n", buf); */
                /* search for our specific entry */
                if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
-                       setenv ("ethaddr", buf + 19);
+                       setenv ("ethaddr", (char *)(buf + 19));
                } else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
-                       setenv ("serial#", buf + 15);
+                       setenv ("serial#", (char *)(buf + 15));
                } else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
-                       setenv ("board_id", buf + 13);
+                       setenv ("board_id", (char *)(buf + 13));
                }
        }
 }
index 02fe8dcfbdeccc886330f0d3070748d7ac79b560..5413ae15c75e24d12b6fd78d3eade2ab4f235c82 100644 (file)
@@ -85,8 +85,8 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
-       unsigned char *e;
+       char *s = getenv ("serial#");
+       char *e;
 
        puts ("Board: ");
 
index 93bc8431bf95935d73dcc8a4885bd6e7de823932..7a11a12cefbb5035e4912096ef167bd42e126a80 100644 (file)
@@ -60,7 +60,7 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index 14b0e42890f7ea88be1c17bd7e5182fc3e27aca9..3aac3c6732936ce5a12807d83ee25db2c542ef67 100644 (file)
@@ -155,7 +155,7 @@ int checkboard (void)
 
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
        const unsigned char *fpga;
 
index 012505e4e6c92d05ad5defd0a539300d7e660641..03ae7fda4bfd3bd0dddb49dd316159c26a0029c5 100644 (file)
@@ -193,7 +193,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index ab4924970256ac4e44be432008f18ac6e9f173b4..2ced6cb17f282767fbf8aad2a658a165da19f2aa 100644 (file)
@@ -156,7 +156,7 @@ int checkboard (void)
 {
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index 0604a4e6fed55cf842ce2e4321f66e6cbf131e7b..1dceb3affbb2fe0d0232d258dd1634203ea370c3 100644 (file)
@@ -103,7 +103,7 @@ int au_check_cksum_valid(int i, long nbytes)
        /* check the data CRC */
        checksum = ntohl(hdr->ih_dcrc);
 
-       if (crc32 (0, (char *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
+       if (crc32 (0, (uchar *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
                != checksum) {
                printf ("Image %s bad data checksum\n", au_image[i].name);
                return -1;
@@ -140,7 +140,7 @@ int au_check_header_valid(int i, long nbytes)
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)hdr, sizeof(*hdr)) != checksum) {
+       if (crc32 (0, (uchar *)hdr, sizeof(*hdr)) != checksum) {
                printf ("Image %s bad header checksum\n", au_image[i].name);
                return -1;
        }
@@ -283,12 +283,12 @@ int au_do_update(int i, long sz)
                 */
                if (au_image[i].type != AU_NAND) {
                        debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes);
-                       rc = flash_write(addr, start, nbytes);
+                       rc = flash_write((uchar *)addr, start, nbytes);
                } else {
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
                        debug ("nand_rw(%p, %lx %x)\n", addr, start, nbytes);
                        rc = nand_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
-                                    start, nbytes, &total, addr);
+                                    start, nbytes, (size_t *)&total, (uchar *)addr);
                        debug ("nand_rw: ret=%x total=%d nbytes=%d\n", rc, total, nbytes);
 #endif
                }
@@ -301,12 +301,12 @@ int au_do_update(int i, long sz)
                 * check the dcrc of the copy
                 */
                if (au_image[i].type != AU_NAND) {
-                       rc = crc32 (0, (char *)(start + off), ntohl(hdr->ih_size));
+                       rc = crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size));
                } else {
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
                        rc = nand_rw(nand_dev_desc, NANDRW_READ | NANDRW_JFFS2 | NANDRW_JFFS2_SKIP,
-                                    start, nbytes, &total, addr);
-                       rc = crc32 (0, (char *)(addr + off), ntohl(hdr->ih_size));
+                                    start, nbytes, (size_t *)&total, (uchar *)addr);
+                       rc = crc32 (0, (uchar *)(addr + off), ntohl(hdr->ih_size));
 #endif
                }
                if (rc != ntohl(hdr->ih_dcrc)) {
index 05c76ff09880749512a153133501a75787dc680c..0edc08308a1320d0bc7db82e54d5443988ee7d34 100644 (file)
@@ -81,7 +81,7 @@ void lcd_bmp(uchar *logo_bmp)
        uchar *ptr;
        ushort *ptr2;
        ushort val;
-       unsigned char *dst;
+       unsigned char *dst = NULL;
        int x, y;
        int width, height, bpp, colors, line_size;
        int header_size;
@@ -89,7 +89,6 @@ void lcd_bmp(uchar *logo_bmp)
        unsigned char r, g, b;
        BITMAPINFOHEADER *bm_info;
        ulong len;
-       int do_free = 0;
 
        /*
         * Check for bmp mark 'BM'
@@ -99,12 +98,18 @@ void lcd_bmp(uchar *logo_bmp)
                /*
                 * Decompress bmp image
                 */
-               len = CFG_LCD_LOGO_MAX_SIZE;
-               dst = malloc(CFG_LCD_LOGO_MAX_SIZE);
-               do_free = 1;
-               if (gunzip(dst, CFG_LCD_LOGO_MAX_SIZE, (uchar *)logo_bmp, &len) != 0) {
+               len = CFG_VIDEO_LOGO_MAX_SIZE;
+               dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+               if (dst == NULL) {
+                       printf("Error: malloc in gunzip failed!\n");
                        return;
                }
+               if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)logo_bmp, &len) != 0) {
+                       return;
+               }
+               if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
+                       printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
+               }
 
                /*
                 * Check for bmp mark 'BM'
@@ -147,7 +152,9 @@ void lcd_bmp(uchar *logo_bmp)
                break;
        default:
                printf("LCD: Unknown bpp (%d) im image!\n", bpp);
-               free(dst);
+               if ((dst != NULL) && (dst != (uchar *)logo_bmp)) {
+                       free(dst);
+               }
                return;
        }
        printf(" (%d*%d, %dbpp)\n", width, height, bpp);
@@ -205,7 +212,7 @@ void lcd_bmp(uchar *logo_bmp)
                }
        }
 
-       if (do_free) {
+       if ((dst != NULL) && (dst != (uchar *)logo_bmp)) {
                free(dst);
        }
 }
index 0949a7d634fa1615270f97ed03f94046506a349b..727640e9b514ff9b828ccf33a6aa17565da198b3 100644 (file)
@@ -95,7 +95,7 @@ int misc_init_r (void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index f27668d142752845bea368efb02abc8415477ac4..2ab96731e04138181ede471b992e36c5ead969d2 100644 (file)
@@ -440,7 +440,7 @@ int checkboard (void)
        int index;
        int len;
 #endif
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
        unsigned short ver;
 
@@ -468,7 +468,7 @@ int checkboard (void)
 #endif
 
        if (ctermm2()) {
-               unsigned char str[4];
+               char str[4];
 
                /*
                 * Read board-id and save in env-variable
@@ -664,7 +664,7 @@ int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        int result;
        int i;
        unsigned char ow_id[6];
-       unsigned char str[32];
+       char str[32];
        unsigned char ow_crc;
 
        /*
@@ -717,10 +717,10 @@ int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        IPaddr_t ipaddr;
 
        buf = malloc(CFG_ENV_SIZE_2);
-       if (eeprom_read(CFG_I2C_EEPROM_ADDR_2, 0, buf, CFG_ENV_SIZE_2)) {
+       if (eeprom_read(CFG_I2C_EEPROM_ADDR_2, 0, (uchar *)buf, CFG_ENV_SIZE_2)) {
                puts("\nError reading backplane EEPROM!\n");
        } else {
-               crc = crc32(0, buf+4, CFG_ENV_SIZE_2-4);
+               crc = crc32(0, (uchar *)(buf+4), CFG_ENV_SIZE_2-4);
                if (crc != *(ulong *)buf) {
                        printf("ERROR: crc mismatch %08lx %08lx\n", crc, *(ulong *)buf);
                        return -1;
@@ -766,7 +766,7 @@ U_BOOT_CMD(
 int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        char *buf;
-       unsigned char str[32];
+       char str[32];
        ulong crc;
 
        if (argc < 2) {
@@ -779,10 +779,10 @@ int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        memset(buf, 0, CFG_ENV_SIZE_2);
        sprintf(str, "bp_ip=%s", argv[1]);
        strcpy(buf+4, str);
-       crc = crc32(0, buf+4, CFG_ENV_SIZE_2-4);
+       crc = crc32(0, (uchar *)(buf+4), CFG_ENV_SIZE_2-4);
        *(ulong *)buf = crc;
 
-       if (eeprom_write(CFG_I2C_EEPROM_ADDR_2, 0, buf, CFG_ENV_SIZE_2)) {
+       if (eeprom_write(CFG_I2C_EEPROM_ADDR_2, 0, (uchar *)buf, CFG_ENV_SIZE_2)) {
                puts("\nError writing backplane EEPROM!\n");
        }
 
index 01c4171ca6dfd982a49c385b1e6acbe99bc74d1d..6c98f13fb6a329a386ca3ee156f7c2789baf51b1 100644 (file)
@@ -105,9 +105,9 @@ long int initdram(int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
 
        if (test1 > test2) {
                sdram_start(0);
index 68f121d6bfc6962cfa3f30c40d63c09ccd8d9009..e4b062bdd04f206b367af9f4e24d94519c7dfd92 100644 (file)
@@ -555,7 +555,7 @@ unsigned long long pattern[] = {
 int mem_test_data (void)
 {
        unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
        int i;
        unsigned int hi, lo;
@@ -662,7 +662,7 @@ int mem_march (volatile unsigned long long *base,
               unsigned long long wmask, short read, short write)
 {
        unsigned int i;
-       unsigned long long temp;
+       unsigned long long temp = 0;
        unsigned int hitemp, lotemp, himask, lomask;
 
        for (i = 0; i < size; i++) {
index e2719b99d1a50b450418205cd10f4b189004028a..880528f84aef45f4d739dd9c5534b3f3d2f3cead 100644 (file)
@@ -267,8 +267,9 @@ void mv6436x_eth_initialize (bd_t * bis)
                dev->send = (void *) db64360_eth_transmit;
                dev->recv = (void *) db64360_eth_poll;
 
-               dev->priv = (void *) ethernet_private =
+               ethernet_private =
                        calloc (sizeof (*ethernet_private), 1);
+               dev->priv = (void *) ethernet_private;
                if (!ethernet_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
@@ -281,8 +282,9 @@ void mv6436x_eth_initialize (bd_t * bis)
                memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
 
                /* set pointer to memory for stats data structure etc... */
-               ethernet_private->port_private = (void *) port_private =
+               port_private =
                        calloc (sizeof (*ethernet_private), 1);
+               ethernet_private->port_private = (void *)port_private; 
                if (!port_private) {
                        printf ("%s: %s allocation failure, %s\n",
                                __FUNCTION__, dev->name,
index 3d1f1fa09726428d7120481c4e8ccf2721c8ee9e..7bf7bb5a5e5490309e68fbfe1567ebc0b411bfc9 100644 (file)
@@ -153,7 +153,7 @@ int checkboard (void)
 {
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index 9edb3afaa5f25d7f28666da0ef073f7857d56b02..89a4aaf80a5d339d94c8ac8a7e0f71b976861a9b 100644 (file)
@@ -111,7 +111,7 @@ static void showPci9054 (void)
                for (i = 0; i < 4; i++) {
                        pci_read_config_dword (CFG_PCI9054_DEV_FN,
                                                l * 16 + i * 4,
-                                               &val);
+                                               (unsigned int *)&val);
                        printf ("%08x ", val);
                }
                printf ("\n");
index 57a971f433c2da3ae7fd5322155e58a506efa0fc..2f8ab1a47873e1dfb28c8f24d7e34393a3f8456e 100644 (file)
@@ -162,7 +162,7 @@ int checkboard (void)
 {
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
        int fpga;
        unsigned short val;
index 056063e6dacd429fa8749e0cab54471f7d26c02a..fd51f7f343e8fcd5af4356608201b63565b4a4a1 100644 (file)
@@ -100,7 +100,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
        unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe,
                                   0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf};
index 7db2a609789a80dd016455bcfb0693c1108831bc..26e834196bd923f2b2051d8fc9c0e12a8b981b02 100644 (file)
@@ -162,7 +162,7 @@ int checkboard (void)
 {
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index bbd8555ead441f6e5d8e9ea5c81deca2dc16aa3c..e77dba8a869c1ac9d4961fcafec20fe8f6c1e696 100644 (file)
@@ -210,7 +210,7 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index ac032ef0ad2125fb670c96637f1b018fd366ee85..261b8a54d022bbe55c0c108b7683d124d96b114c 100644 (file)
@@ -74,7 +74,7 @@ int misc_init_f (void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index e1ca5839692e3f6c4fd087f60008b4f308c31a7a..0315c3d97bac2a6e0c2932168d4247a70afb8552 100644 (file)
@@ -91,7 +91,7 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        pci_read_config_dword(PCIDEVID_405GP, i, ptr++);
                }
                ptr = (unsigned int *)PCI_REGS_ADDR;
-               *ptr = crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
+               *ptr = crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
 
                printf("\nStoring PCI Configuration Regs...\n");
        } else {
@@ -874,7 +874,7 @@ int do_savepci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                pci_read_config_dword(PCIDEVID_405GP, i, ptr++);
        }
        ptr = (unsigned int *)PCI_REGS_ADDR;
-       *ptr = crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
+       *ptr = crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
 
        printf("\nStoring PCI Configuration Regs...\n");
 
@@ -896,7 +896,7 @@ int do_restorepci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
         * Rewrite pci config regs (only after soft-reset with magic set)
         */
        ptr = (unsigned int *)PCI_REGS_ADDR;
-       if (crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
+       if (crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
                puts("Restoring PCI Configurations Regs!\n");
                ptr = (unsigned int *)PCI_REGS_ADDR + 1;
                for (i=0; i<0x40; i+=4) {
index d1b680768cbaecd19599429f6ca89f4e6c868303..4be4d7e7d9eb352b97ea4e0a05fe37cbee7546c7 100644 (file)
@@ -275,7 +275,7 @@ int misc_init_r (void)
                 * Rewrite pci config regs (only after soft-reset with magic set)
                 */
                ptr = (unsigned int *)PCI_REGS_ADDR;
-               if (crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
+               if (crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
                        puts("Restoring PCI Configurations Regs!\n");
                        ptr = (unsigned int *)PCI_REGS_ADDR + 1;
                        for (i=0; i<0x40; i+=4) {
@@ -322,7 +322,7 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index bfbd0907cf1909de2b95a778f10b33591d0c7ffe..53afbc0b920634adcae2bf62738127d5352ce33c 100644 (file)
@@ -122,7 +122,7 @@ static flash_info_t *flash_get_info(ulong base) {
 
 void flash_print_info(flash_info_t * info) {
        int i;
-       uchar *fmt;
+       char *fmt;
 
        if (info->flash_id == FLASH_UNKNOWN) {
                printf("missing or unknown FLASH type\n");
index fa71c79425232a0eca8285d7143ab31c119814b7..2b47012cfafd2de7c24f0dfb7803cfd8a95e01ab 100644 (file)
@@ -105,9 +105,9 @@ long int initdram(int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
 
        if (test1 > test2) {
                sdram_start(0);
index e3eff31fb7087b8a977add9b236e9367513028d7..16f2360dccd77c9d60eb14c13ca6be786897b04d 100644 (file)
@@ -203,7 +203,7 @@ int misc_init_r (void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index a72547d5ceff4dcbe561a56563a1183190979a91..33b5f774d572385d584cd856159be6a0227fc03d 100644 (file)
@@ -107,7 +107,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index 9cea69f18c2a0f529d7ca0b44c98653527f63393..eda3fd9d9d8639d503a332281a1801d98a8e8c4b 100644 (file)
@@ -268,7 +268,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index 09c4d36a951e3a81556d5569e514658c1c45ded8..db24122c5ea7efb2860e4f35002cc55906226322 100644 (file)
@@ -193,7 +193,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index 5c3e9b42657b1a72e3c7aefc24c1cdbe15e9ffff..3959eead27205bfe37105464e561ef3cb65d80e7 100644 (file)
@@ -147,8 +147,8 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         *
         */
-       size_b0 = get_ram_size ((ulong *) SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
-       size_b1 = get_ram_size ((ulong *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+       size_b0 = get_ram_size ( (long *)SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
+       size_b1 = get_ram_size ( (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
 
        printf ("\nbank 0 size %lu\nbank 1 size %lu\n", size_b0, size_b1);
 
index efe7cb21512dc74cf1631f664aee14dc13bcb8b6..dba3c1181e641d231b1be6d9467485b70fc40bac 100644 (file)
@@ -92,8 +92,8 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char *s = getenv ("serial#");
-       unsigned char *e;
+       char *s = getenv ("serial#");
+       char *e;
 
        puts ("Board: ");
 
@@ -186,7 +186,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -194,7 +194,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
@@ -215,7 +215,7 @@ long int initdram (int board_type)
                 *  but then only half the real size will be used.]
                 */
                size_b1 =
-                               dram_size (memctl->memc_mamr, (ulong *) SDRAM_BASE3_PRELIM,
+                               dram_size (memctl->memc_mamr, (long *) SDRAM_BASE3_PRELIM,
                                                   SDRAM_MAX_SIZE);
 /*     debug ("SDRAM Bank 1: %ld MB\n", size8 >> 20);  */
        } else {
index f0743fa292e23a56fdb5701090ac0cd81c7027f5..a248cadf73c7a87db9ba8d732011451960e71f97 100644 (file)
@@ -182,7 +182,7 @@ gt6426x_eth_receive(struct eth_dev_s *p,unsigned int icr)
         */
 
        /* let the upper layer handle the packet */
-       NetReceive (eth_data, eth_len);
+       NetReceive ((uchar *)eth_data, eth_len);
 
        rx->buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
 
@@ -266,7 +266,7 @@ gt6426x_eth_transmit(void *v, volatile char *p, unsigned int s)
 #endif
        memcpy(dev->eth_tx_buffer, (char *) p, s);
 
-       tx->buff_pointer = dev->eth_tx_buffer;
+       tx->buff_pointer = (uchar *)dev->eth_tx_buffer;
        tx->bytecount_reserved = ((__u16)s) << 16;
 
        /*    31 - own
@@ -583,7 +583,7 @@ gt6426x_eth_probe(void *v, bd_t *bis)
 
        /* Initialize Rx Side */
        for (temp = 0; temp < NR; temp++) {
-               p->eth_rx_desc[temp].buff_pointer = p->eth_rx_buffer[temp];
+               p->eth_rx_desc[temp].buff_pointer = (uchar *)p->eth_rx_buffer[temp];
                p->eth_rx_desc[temp].buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
 
                /* GT96100 Owner */
@@ -719,7 +719,8 @@ gt6426x_eth_initialize(bd_t *bis)
                dev->send = (void*)gt6426x_eth_transmit;
                dev->recv = (void*)gt6426x_eth_poll;
 
-               dev->priv = (void*)p = calloc( sizeof(*p), 1 );
+               p = calloc( sizeof(*p), 1 );
+               dev->priv = (void*)p;
                if (!p)
                {
                        printf( "%s: %s allocation failure, %s\n",
index ecc376213a55c82781b5e5be24df75db09c4f2d5..beb6db16dfb93b3ee61ac27fb69fdaa2301d1499 100644 (file)
@@ -39,14 +39,14 @@ typedef struct eth0_tx_desc_struct {
        volatile struct eth0_tx_desc_struct * next_desc;
        /* Note - the following will not work for 64 bit addressing */
        volatile unsigned char * buff_pointer;
-} eth0_tx_desc_single __attribute__ ((packed));
+} __attribute__ ((packed)) eth0_tx_desc_single;
 
 typedef struct eth0_rx_desc_struct {
   volatile __u32 buff_size_byte_count;
   volatile __u32 command_status;
   volatile struct eth0_rx_desc_struct * next_desc;
   volatile unsigned char * buff_pointer;
-} eth0_rx_desc_single __attribute__ ((packed));
+} __attribute__ ((packed)) eth0_rx_desc_single;
 
 #define NT 20 /* Number of Transmit buffers */
 #define NR 20 /* Number of Receive buffers */
index 0abc7d453693b21067a38a0286107a5da5e38e4b..69882f53022b396359d648d248b1e795e45a0d99 100644 (file)
@@ -55,8 +55,9 @@ unsigned int initAddressTable (u32 port, u32 hashMode, u32 hashSizeSelector)
                int bytes =
                        hashLength[hashSizeSelector] * sizeof (addrTblEntry);
 
-               tableBase = (unsigned int) realAddrTableBase[port] =
+               realAddrTableBase[port] =
                        malloc (bytes + 64);
+               tableBase = (unsigned int)realAddrTableBase; 
 
                if (!tableBase) {
                        printf ("%s: alloc memory failed \n", __FUNCTION__);
index 7ca6f0ae73d53127d35f34649211fbd8870b86a4..6ab23dce2f7be486a185e77c0d5934e02b632f92 100644 (file)
@@ -589,7 +589,7 @@ flash_get_size (int portwidth, vu_long *addr, flash_info_t *info)
 int
 flash_erase (flash_info_t *info, int s_first, int s_last)
 {
-       volatile unsigned char *addr = (char *)(info->start[0]);
+       volatile unsigned char *addr = (uchar *)(info->start[0]);
        int flag, prot, sect, l_sect;
        ulong start, now, last;
 
@@ -600,7 +600,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
        if((info->flash_id & FLASH_TYPEMASK) == FLASH_RAM) {
            for (sect = s_first; sect<=s_last; sect++) {
                int sector_size=info->size/info->sector_count;
-               addr = (char *)(info->start[sect]);
+               addr = (uchar *)(info->start[sect]);
                memset((void *)addr, 0, sector_size);
            }
            return 0;
@@ -658,7 +658,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
        /* Start erase on unprotected sectors */
        for (sect = s_first; sect<=s_last; sect++) {
                if (info->protect[sect] == 0) { /* not protected */
-                       addr = (char *)(info->start[sect]);
+                       addr = (uchar *)(info->start[sect]);
                        flash_cmd(info->portwidth,addr,0,0x30);
                        l_sect = sect;
                }
@@ -794,7 +794,7 @@ write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
 static int
 write_word (flash_info_t *info, ulong dest, ulong data)
 {
-       volatile unsigned char *addr = (char *)(info->start[0]);
+       volatile unsigned char *addr = (uchar *)(info->start[0]);
        ulong start;
        int flag, i;
 
index 22cb8096c831c7a9d0de0c3edd0726e3e8cad062..c62b64729c12929167d2cf6e3befe34f77f396b5 100644 (file)
@@ -146,7 +146,7 @@ i2c_select_device(uchar dev_addr, uchar read, int ten_bit)
 static uchar
 i2c_get_data(uchar* return_data, int len) {
 
-       unsigned int data, status;
+       unsigned int data, status = 0;
        int count = 0;
 
        DP(puts("i2c_get_data\n"));
index 5131339a6c90e415ebf26ce86efa05118eb52413..2b9a469f8d16e57a545f2113dd953e61cdf28469 100644 (file)
@@ -116,7 +116,7 @@ zuma_mbox_dump(void)
 static void
 zuma_mbox_setenv(void)
 {
-  unsigned char *data, buf[32];
+  char *data, buf[32];
   unsigned char save = 0;
 
   data = getenv("baudrate");
index 5967e90e1ecd3fd97163ea6debbc952877e6b3d2..3f7875334defc0b6a7ec69eb13ab241ad63e3f36 100644 (file)
@@ -90,7 +90,7 @@ int misc_init_r (void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index f1d173ebc97729c68790c1d186a3547f3757ebe2..b7a1b56437aba5e19c6b13d71803c6962e5f0260 100644 (file)
@@ -128,8 +128,8 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char *s;
-       unsigned char buf[64];
+       char *s;
+       char buf[64];
        int i;
 
        i = getenv_r ("board_id", buf, sizeof (buf));
@@ -266,7 +266,7 @@ int misc_init_r (void)
 int last_stage_init (void)
 {
 #if !defined(CONFIG_SC)
-       unsigned char buf[256];
+       char buf[256];
        int i;
 
        /*
index f12d0be552598830523578de19d280ccc9ab9763..1c1728bb4986f7fb2493e609b05881b7ada6da04 100644 (file)
@@ -188,12 +188,11 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
 #endif
        switch (value)
        {
-               case 0x01:
-               case AMD_MANUFACT:
+               case 0x1: /* AMD_MANUFACT */
                        info->flash_id = FLASH_MAN_AMD;
                break;
 
-               case FUJ_MANUFACT:
+               case 0x4: /* FUJ_MANUFACT */
                        info->flash_id = FLASH_MAN_FUJ;
                break;
 
index c19841ae792a76601ca4738a43a200a5a37937e8..5f8c8997e51dd7ddc9f946b135bf8a81529641d8 100644 (file)
@@ -187,14 +187,14 @@ long int initdram (int board_type)
        PrintState ();
 #endif
 /*    printf ("\nChecking bank1..."); */
-       size8 = dram_size (CFG_MBMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
+       size8 = dram_size (CFG_MBMR_8COL, (long *) SDRAM_BASE1_PRELIM,
                           SDRAM_MAX_SIZE);
 
        size_b0 = size8;
 
 /*    printf ("\nChecking bank2..."); */
        size_b1 =
-               dram_size (memctl->memc_mbmr, (ulong *) SDRAM_BASE2_PRELIM,
+               dram_size (memctl->memc_mbmr, (long *) SDRAM_BASE2_PRELIM,
                           SDRAM_MAX_SIZE);
 
        /*
index c8b56fb96b24a0585e543402af50078075cf5a58..41a5c50b0fac45e5bcb988e6189bcb054443e299 100644 (file)
@@ -261,7 +261,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
 #if 0
        ulong base = (ulong)addr;
 #endif
-       uchar value;
+       ulong value;
 
        /* Write auto select command: read Manufacturer ID */
 #if 0
@@ -278,7 +278,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
 
        switch (value)
        {
-               case AMD_MANUFACT:case 0x01:
+               case AMD_MANUFACT:
                        info->flash_id = FLASH_MAN_AMD;
                break;
 
index 6f972ce8908785a72fe6f4d45681d0474d23b7e9..b1fcbf5cc36a2f49239aaf549ee4e24506a2d9b9 100644 (file)
@@ -589,7 +589,7 @@ int misc_init_r (void)
                (Rx[8] != ':') | (Rx[11] != ':') | (Rx[14] != ':')) {
                printf ("*** ethernet addr invalid, using default ***\n");
        } else {
-               setenv ("ethaddr", Rx);
+               setenv ("ethaddr", (char *)Rx);
        }
        return (0);
 }
index 163d58ccf536425f9be2486cc00cc44a4c0d64e2..2719a9585faa7e03006c1784f9662e197a5c23da 100644 (file)
@@ -320,7 +320,7 @@ unsigned long long pattern[] = {
 int mem_test_data (void)
 {
        unsigned long long *pmem = (unsigned long long *) CFG_SDRAM_BASE;
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
        int i;
        unsigned int hi, lo;
@@ -427,7 +427,7 @@ int mem_march (volatile unsigned long long *base,
               unsigned long long wmask, short read, short write)
 {
        unsigned int i;
-       unsigned long long temp;
+       unsigned long long temp = 0;
        unsigned int hitemp, lotemp, himask, lomask;
 
        for (i = 0; i < size; i++) {
index 7490324cb0e7a5c86e2d57c5935b7cf1b96bf35a..e95d9ee3324d76c0773177617939f0b8a3a885a7 100644 (file)
@@ -107,8 +107,8 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char *s = getenv ("serial#");
-       unsigned char *e;
+       char *s = getenv ("serial#");
+       char *e;
 
        puts ("Board: ");
 
@@ -179,7 +179,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -187,7 +187,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
index 15eb48e103899c4c7e55da867c52d50471052d81..c9b9b181105b2ac49b210bbd792220e08281ce3d 100644 (file)
@@ -58,7 +58,7 @@ hymod_eeprom_load (int which, hymod_eeprom_t *ep)
        eeprom_read (dev_addr, offset, (uchar *)&crc, sizeof (ulong));
        offset += sizeof (ulong);
 
-       if (crc32 (crc32 (0, (char *)&hdr, sizeof hdr), data, len) != crc)
+       if (crc32 (crc32 (0, (uchar *)&hdr, sizeof hdr), data, len) != crc)
                return (0);
 
        ep->ver = hdr.ver;
@@ -260,7 +260,7 @@ uint_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
        char *eval;
        ulong lval;
 
-       lval = simple_strtol (val, &eval, 10);
+       lval = simple_strtol ((char *)val, &eval, 10);
 
        if ((uchar *)eval == val || *eval != '\0') {
                printf ("%s rec (%s) is not a valid uint\n", rp->name, val);
@@ -315,12 +315,12 @@ static uchar *
 date_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
 {
        hymod_date_t date;
-       uchar *p = val;
+       char *p = (char *)val;
        char *ep;
        ulong lval;
 
        lval = simple_strtol (p, &ep, 10);
-       if ((uchar *)ep == p || *ep++ != '-') {
+       if (ep == p || *ep++ != '-') {
 bad_date:
                printf ("%s rec (%s) is not a valid date\n", rp->name, val);
                return (NULL);
@@ -330,12 +330,12 @@ bad_date:
        date.year = lval;
 
        lval = simple_strtol (p = ep, &ep, 10);
-       if ((uchar *)ep == p || *ep++ != '-' || lval == 0 || lval > 12)
+       if (ep == p || *ep++ != '-' || lval == 0 || lval > 12)
                goto bad_date;
        date.month = lval;
 
        lval = simple_strtol (p = ep, &ep, 10);
-       if ((uchar *)ep == p || *ep != '\0' || lval == 0 || lval > 31)
+       if (ep == p || *ep != '\0' || lval == 0 || lval > 31)
                goto bad_date;
        date.day = lval;
 
@@ -359,7 +359,7 @@ string_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
 {
        uint len;
 
-       if ((len = strlen (val)) > rp->maxlen) {
+       if ((len = strlen ((char *)val)) > rp->maxlen) {
                printf ("%s rec (%s) string is too long (%d>%d)\n",
                        rp->name, val, len, rp->maxlen);
                return (NULL);
@@ -387,7 +387,7 @@ bytes_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
        for (nbytes = 0, p = val; *p != '\0'; p = (uchar *)ep) {
                ulong lval;
 
-               lval = simple_strtol (p, &ep, 10);
+               lval = simple_strtol ((char *)p, &ep, 10);
                if ((uchar *)ep == p || (*ep != '\0' && *ep != ',') || \
                    lval >= 256) {
                        printf ("%s rec (%s) byte array has invalid uint\n",
@@ -451,7 +451,7 @@ eerec_callback (uchar *name, uchar *val)
        eerec_map_t *rp;
 
        for (rp = eerec_map; rp < &eerec_map[neerecs]; rp++)
-               if (strcmp (name, rp->name) == 0)
+               if (strcmp ((char *)name, rp->name) == 0)
                        break;
 
        if (rp >= &eerec_map[neerecs])
index f58aec25709230209b6b291ed329f70adc229624..f9e14213ceb91b4826d3df3ec5ffd2fb6fcb983f 100644 (file)
@@ -38,7 +38,7 @@ env_callback (uchar *name, uchar *value)
        char ov[CFG_CBSIZE], nv[CFG_CBSIZE], *p, *q, *nn, c, *curver, *newver;
        int override = 1, append = 0, remove = 0, nnl, ovl, nvl;
 
-       nn = name;
+       nn = (char *)name;
 
        if (*nn == '-') {
                override = 0;
@@ -68,7 +68,7 @@ env_callback (uchar *name, uchar *value)
                return (0);
        }
 
-       p = value;
+       p = (char *)value;
        q = nv;
 
        while ((c = *p) == ' ' || c == '\t')
index 4ae71e661ccb461dca65d7e42c97b5a5ba92e7e7..713011c972aa22fb299a7aa3b3813198a55261f7 100644 (file)
@@ -139,7 +139,7 @@ void flash_print_info (flash_info_t *info)
        int i;
        uchar *boottype;
        uchar *bootletter;
-       uchar *fmt;
+       char *fmt;
        uchar botbootletter[] = "B";
        uchar topbootletter[] = "T";
        uchar botboottype[] = "bottom boot sector";
index 7c9a92a913f6e4926b8ceaf045cc1faa7c5c6460..1f1a74ce33978a52451fc5a73b3bae87d9ab639d 100644 (file)
@@ -107,9 +107,9 @@ long int initdram (int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize = test1;
@@ -135,10 +135,10 @@ long int initdram (int board_type)
        /* find RAM size using SDRAM CS1 only */
        if (!dramsize)
                sdram_start(0);
-       test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+       test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        if (!dramsize) {
                sdram_start(1);
-               test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+               test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        }
        if (test1 > test2) {
                sdram_start(0);
@@ -207,9 +207,9 @@ long int initdram (int board_type)
 
        /* find RAM size */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize = test1;
index 6315bd95b1193a6a9317203c4e2b0d724271b03f..ca5bcf31af5c01607c69221f82c27a29765f0f88 100644 (file)
@@ -251,7 +251,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
 
        value = addr[1];                        /* device ID            */
 
-       switch (value) {
+       switch ((unsigned long)value) {
        case AMD_ID_F040B:
                info->flash_id += FLASH_AM040;
                info->sector_count = 8;
index b41ebae28b304b8db1e37b6ce9c86d7533573ea9..8da9d1c9a49f70882781c0b198c7e9c9a114573a 100644 (file)
@@ -143,7 +143,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE1_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -151,7 +151,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE1_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE1_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
index 5b634e459f525b5f93acd09fa78df108cf435e2b..9dd809b67823784a80df0c171ae6b91e26f106b6 100644 (file)
@@ -114,10 +114,10 @@ int checkboard (void)
 
        puts ("Board: ");
 
-       i = getenv_r ("serial#", buf, sizeof (buf));
+       i = getenv_r ("serial#", (char *)buf, sizeof (buf));
        s = (i > 0) ? buf : NULL;
 
-       if (!s || strncmp (s, "IP860", 5)) {
+       if (!s || strncmp ((char *)s, "IP860", 5)) {
                puts ("### No HW ID - assuming IP860");
        } else {
                for (e = s; *e; ++e) {
@@ -190,9 +190,9 @@ long int initdram (int board_type)
         * Check SDRAM Memory Size
         */
        if (ip860_get_dram_size() == 16)
-               size = dram_size (refresh_val | 0x00804114, (ulong *)SDRAM_BASE, SDRAM_MAX_SIZE);
+               size = dram_size (refresh_val | 0x00804114, SDRAM_BASE, SDRAM_MAX_SIZE);
        else
-               size = dram_size (refresh_val | 0x00906114, (ulong *)SDRAM_BASE, SDRAM_MAX_SIZE);
+               size = dram_size (refresh_val | 0x00906114, SDRAM_BASE, SDRAM_MAX_SIZE);
 
        udelay (1000);
 
index e50250e4567799db43b8579781e25f31036a7f80..0ca9cf5137eac4e1c0a91736f12273fb4c6c8bdc 100644 (file)
@@ -342,7 +342,7 @@ int hwc_serial_number (void)
 {
        int sn = -1;
 
-       if (!seeprom_read (0xa0, (char *) &sn, sizeof (sn))) {
+       if (!seeprom_read (0xa0, (uchar *) &sn, sizeof (sn))) {
                sn = cpu_to_le32 (sn);
        }
        return sn;
@@ -351,7 +351,7 @@ int hwc_mac_address (char *str)
 {
        char mac[6];
 
-       if (!seeprom_read (0xb0, mac, sizeof (mac))) {
+       if (!seeprom_read (0xb0, (uchar *)mac, sizeof (mac))) {
                sprintf (str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
                                 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
        } else {
index fd3489962124ec43c2a18fe33dc558197887a250..d39b8cd53359fd54e375f89208ae358cf627e5c9 100644 (file)
@@ -290,7 +290,7 @@ static int hwc_serial_number (void)
 {
        int sn = -1;
 
-       if (!seeprom_read (0xa0, (char *) &sn, sizeof (sn))) {
+       if (!seeprom_read (0xa0, (uchar *) &sn, sizeof (sn))) {
                sn = cpu_to_le32 (sn);
        }
        return sn;
@@ -300,7 +300,7 @@ static int hwc_mac_address (char *str)
 {
        char mac[6];
 
-       if (!seeprom_read (0xb0, mac, sizeof (mac))) {
+       if (!seeprom_read (0xb0, (uchar *)mac, sizeof (mac))) {
                sprintf (str, "%02X:%02X:%02X:%02X:%02X:%02X",
                                 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
        } else {
index cb661c9d28d9c712cc150a8668f54806d0f606fd..7927ea9a50289e16486071a73333f45bbb1f2395 100644 (file)
@@ -251,7 +251,7 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         */
        size_b0 =
-               dram_size (CFG_MBMR_8COL, (ulong *) SDRAM_BASE3_PRELIM,
+               dram_size (CFG_MBMR_8COL, (long *) SDRAM_BASE3_PRELIM,
                           SDRAM_MAX_SIZE);
 
        memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;
index 39ee124ebc42ccd71a05ac31c85a28fb9a87f4c1..b7b74998578f3a992781e8c8be45f7f2ec39c917 100644 (file)
@@ -54,9 +54,9 @@
 void load_sernum_ethaddr (void)
 {
        unsigned char *hwi;
-       unsigned char *var;
+       char *var;
        unsigned char hwi_stack[CFG_HWINFO_SIZE];
-       unsigned char *p;
+       char *p;
 
        hwi = (unsigned char *) (CFG_FLASH_BASE + CFG_HWINFO_OFFSET);
        if (*((unsigned long *) hwi) != (unsigned long) CFG_HWINFO_MAGIC) {
@@ -68,11 +68,11 @@ void load_sernum_ethaddr (void)
        /*
         ** ethaddr
         */
-       var = strstr (hwi_stack, ETHADDR_TOKEN);
+       var = strstr ((char *)hwi_stack, ETHADDR_TOKEN);
        if (var) {
                var += sizeof (ETHADDR_TOKEN) - 1;
                p = strchr (var, '\r');
-               if (p < hwi + CFG_HWINFO_SIZE) {
+               if ((unsigned char *)p < hwi + CFG_HWINFO_SIZE) {
                        *p = '\0';
                        setenv ("ethaddr", var);
                        *p = '\r';
@@ -81,11 +81,11 @@ void load_sernum_ethaddr (void)
        /*
         ** lcd
         */
-       var = strstr (hwi_stack, LCD_TOKEN);
+       var = strstr ((char *)hwi_stack, LCD_TOKEN);
        if (var) {
                var += sizeof (LCD_TOKEN) - 1;
                p = strchr (var, '\r');
-               if (p < hwi + CFG_HWINFO_SIZE) {
+               if ((unsigned char *)p < hwi + CFG_HWINFO_SIZE) {
                        *p = '\0';
                        setenv ("lcd", var);
                        *p = '\r';
index c352c8b67172aca871cfdba13af60ea5f464ec81..e621c436ffd25837d4cd8332a7ea5c597cd13d22 100644 (file)
@@ -327,7 +327,7 @@ void lcd_logo (bd_t * bd)
        int r = 8, g = 8, b = 4;
        int r1, g1, b1;
        int n;
-       uchar tmp[64];          /* long enough for environment variables */
+       char tmp[64];           /* long enough for environment variables */
        int tft = 0;
 
        immr->im_cpm.cp_pbpar &= ~(PB_LCD_PWM);
@@ -453,7 +453,7 @@ void lcd_logo (bd_t * bd)
        }
 
        /* copy bitmap */
-       fb = (char *) (fb_info.VmemAddr);
+       fb = (uchar *) (fb_info.VmemAddr);
        memcpy (fb, (uchar *) CONFIG_KUP4K_LOGO, 320 * 240);
 }
 #endif /* CONFIG_KUP4K_LOGO */
index aa96a16c5156c929b6b56b088646a30276b4f6c5..417dbbb05b0a669f4150e9a4e633fc5334866e15 100644 (file)
@@ -171,7 +171,7 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         */
        size_b0 = dram_size (CFG_MAMR_8COL,
-                            (ulong *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+                            (long *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
 
        memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
 
index 7cf57788b8b311eb5162a2fe88ff773f7ac41b04..a174b57b70edf09f81a1c3d710f6f3a607a8387d 100644 (file)
@@ -266,14 +266,14 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+       size8 = dram_size (CFG_MAMR_8COL, (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
 
        udelay (1000);
 
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+       size9 = dram_size (CFG_MAMR_9COL, (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
                size_b0 = size9;
@@ -574,11 +574,11 @@ int misc_init_r (void)
        DECLARE_GLOBAL_DATA_PTR;
 
        uchar kbd_data[KEYBD_DATALEN];
-       uchar keybd_env[2 * KEYBD_DATALEN + 1];
+       char keybd_env[2 * KEYBD_DATALEN + 1];
        uchar kbd_init_status = gd->kbd_status >> 8;
        uchar kbd_status = gd->kbd_status;
        uchar val;
-       uchar *str;
+       char *str;
        int i;
 
        if (kbd_init_status) {
@@ -617,7 +617,7 @@ int misc_init_r (void)
        }
        setenv ("keybd", keybd_env);
 
-       str = strdup (key_match (kbd_data));    /* decode keys */
+       str = strdup ((char *)key_match (kbd_data));    /* decode keys */
 #ifdef KEYBD_SET_DEBUGMODE
        if (kbd_data[0] == KEYBD_SET_DEBUGMODE) {       /* set debug mode */
                if ((console_assign (stdout, "lcd") < 0) ||
@@ -649,11 +649,11 @@ static int compare_magic (uchar *kbd_data, uchar *str)
        /* Don't include modifier byte */
        memcpy (compare, kbd_data+1, KEYBD_DATALEN-1);
 
-       for (; str != NULL; str = (*nxt) ? nxt+1 : nxt) {
+       for (; str != NULL; str = (*nxt) ? (uchar *)(nxt+1) : (uchar *)nxt) {
                uchar c;
                int k;
 
-               c = (uchar) simple_strtoul (str, (char **) (&nxt), 16);
+               c = (uchar) simple_strtoul ((char *)str, (char **) (&nxt), 16);
 
                if (str == (uchar *)nxt) {      /* invalid character */
                        break;
@@ -719,9 +719,9 @@ V* Verification: dzu@denx.de
  ***********************************************************************/
 static uchar *key_match (uchar *kbd_data)
 {
-       uchar magic[sizeof (kbd_magic_prefix) + 1];
+       char magic[sizeof (kbd_magic_prefix) + 1];
        uchar *suffix;
-       uchar *kbd_magic_keys;
+       char *kbd_magic_keys;
 
        /*
         * The following string defines the characters that can pe appended
@@ -737,13 +737,13 @@ static uchar *key_match (uchar *kbd_data)
        /* loop over all magic keys;
         * use '\0' suffix in case of empty string
         */
-       for (suffix=kbd_magic_keys; *suffix || suffix==kbd_magic_keys; ++suffix) {
+       for (suffix=(uchar *)kbd_magic_keys; *suffix || suffix==(uchar *)kbd_magic_keys; ++suffix) {
                sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
 #if 0
                printf ("### Check magic \"%s\"\n", magic);
 #endif
-               if (compare_magic(kbd_data, getenv(magic)) == 0) {
-                       uchar cmd_name[sizeof (kbd_command_prefix) + 1];
+               if (compare_magic(kbd_data, (uchar *)getenv(magic)) == 0) {
+                       char cmd_name[sizeof (kbd_command_prefix) + 1];
                        char *cmd;
 
                        sprintf (cmd_name, "%s%c", kbd_command_prefix, *suffix);
@@ -754,7 +754,7 @@ static uchar *key_match (uchar *kbd_data)
                                        cmd_name, cmd ? cmd : "<<NULL>>");
 #endif
                        *kbd_data = *suffix;
-                       return (cmd);
+                       return ((uchar *)cmd);
                }
        }
 #if 0
@@ -863,7 +863,7 @@ V* Verification: dzu@denx.de
 int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        uchar kbd_data[KEYBD_DATALEN];
-       uchar keybd_env[2 * KEYBD_DATALEN + 1];
+       char keybd_env[2 * KEYBD_DATALEN + 1];
        uchar val;
        int i;
 
@@ -1044,7 +1044,7 @@ static int key_pressed(void)
        i2c_write (kbd_addr, 0, 0, &val, 1);
        i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
 
-       return (compare_magic(kbd_data, CONFIG_MODEM_KEY_MAGIC) == 0);
+       return (compare_magic(kbd_data, (uchar *)CONFIG_MODEM_KEY_MAGIC) == 0);
 }
 #endif /* CONFIG_MODEM_SUPPORT */
 
@@ -1063,6 +1063,6 @@ int post_hotkeys_pressed(void)
        i2c_write (kbd_addr, 0, 0, &val, 1);
        i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
 
-       return (compare_magic(kbd_data, CONFIG_POST_KEY_MAGIC) == 0);
+       return (compare_magic(kbd_data, (uchar *)CONFIG_POST_KEY_MAGIC) == 0);
 }
 #endif
index 4f805a663b1e4d6504fbf54be52b05b3fc87c63e..87cb1ff18e1f76a4389c826bbe446442b526da86 100644 (file)
@@ -216,7 +216,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) {
        return rc;
 }
 
-volatile static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
+static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
 
        volatile unsigned long long *addr=(unsigned long long *)dest;
        unsigned long long result;
index ff5f816796204388bba6a784bde765c515fefda5..f32e512d4f35ae6dbedb2dc5d11d57d1b41665d0 100644 (file)
@@ -30,8 +30,8 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
-       unsigned char *e;
+       char *s = getenv ("serial#");
+       char *e;
 
        if (!s || strncmp (s, "ML2", 9)) {
                printf ("### No HW ID - assuming ML2");
index e14bccaced18fd639a5724a33fc3b1d8ef384c65..b331d6ec474234b1cedf7674e5d43e4cfa429d17 100644 (file)
@@ -163,7 +163,7 @@ mpl_prg(uchar *src, ulong size)
 #endif
        printf("flash erased, programming from 0x%lx 0x%lx Bytes\n",
                (ulong)src, size);
-       if ((rc = flash_write (src, start, size)) != 0) {
+       if ((rc = flash_write ((char *)src, start, size)) != 0) {
                puts("ERROR ");
                flash_perror(rc);
                return (1);
@@ -200,14 +200,14 @@ mpl_prg_image(uchar *ld_addr)
        len  = sizeof(image_header_t);
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
-       if (crc32 (0, (char *)data, len) != checksum) {
+       if (crc32 (0, (uchar *)data, len) != checksum) {
                puts("Bad Header Checksum\n");
                return 1;
        }
        data = ld_addr + sizeof(image_header_t);
        len  = ntohl(hdr->ih_size);
        puts("Verifying Checksum ... ");
-       if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
+       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
                puts("Bad Data CRC\n");
                return 1;
        }
@@ -376,8 +376,8 @@ void copy_old_env(ulong size)
                        } while(len > off);
                        name=&name_buf[0];
                        value=&value_buf[0];
-                       if(strncmp(name,"baudrate",8)!=0) {
-                               setenv(name,value);
+                       if(strncmp((char *)name,"baudrate",8)!=0) {
+                               setenv((char *)name,(char *)value);
                        }
 
                }
@@ -387,7 +387,7 @@ void copy_old_env(ulong size)
 
 void check_env(void)
 {
-       unsigned char *s;
+       char *s;
        int i=0;
        char buf[32];
        backup_t back;
@@ -592,7 +592,7 @@ void video_get_info_str (int line_number, char *info)
        char buf[64];
        char tmp[16];
        char cpustr[16];
-       unsigned char *s, *e, bc;
+       char *s, *e, bc;
        switch (line_number)
        {
        case 2:
index 793c34fe2fe1fba3762746e65ef0aa6263a4db97..51b2773c71a9ed19c76c3cc88cee384a134995e7 100644 (file)
@@ -155,7 +155,7 @@ void isa_write_table(SIO_LOGDEV_TABLE *ldt,unsigned char ldev)
 
 void isa_sio_loadtable(void)
 {
-       unsigned char *s = getenv("floppy");
+       char *s = getenv("floppy");
        /* setup Floppy device 0*/
        isa_write_table((SIO_LOGDEV_TABLE *)&sio_fdc,0);
        /* setup parallel port device 3 */
index b1adde617cbbf8dad17d9d68c0bcbbfdea4bb2da..84d3e1ed5c15db785719e0be3531437a920c580c 100644 (file)
@@ -585,15 +585,15 @@ void get_pcbrev_var(unsigned char *pcbrev, unsigned char *var)
 
 int checkboard (void)
 {
-       unsigned char s[50];
+       char s[50];
        unsigned char bc, var;
        int i;
        backup_t *b = (backup_t *) s;
 
        puts ("Board: ");
        get_pcbrev_var(&bc,&var);
-       i = getenv_r ("serial#", s, 32);
-       if ((i == 0) || strncmp (s, BOARD_NAME,sizeof(BOARD_NAME))) {
+       i = getenv_r ("serial#", (char *)s, 32);
+       if ((i == 0) || strncmp ((char *)s, BOARD_NAME,sizeof(BOARD_NAME))) {
                get_backup_values (b);
                if (strncmp (b->signature, "MPL\0", 4) != 0) {
                        puts ("### No HW ID - assuming " BOARD_NAME);
@@ -728,7 +728,7 @@ int last_stage_init (void)
 {
        unsigned long stop;
        struct rtc_time newtm;
-       unsigned char *s;
+       char *s;
        mem_test_reloc();
        /* write correct LED configuration */
        if (miiphy_write (0x1, 0x14, 0x2402) != 0) {
index 590bd20ff0f820cf191d9f513a04ab424550bd78..a398362f96aef4fad6eab5f3f77e22681ba831f0 100644 (file)
@@ -180,7 +180,7 @@ int board_early_init_f (void)
 {
        unsigned char dataout[1];
        unsigned char datain[128];
-       unsigned long sdram_size;
+       unsigned long sdram_size = 0;
        SDRAM_SETUP *t = (SDRAM_SETUP *) sdram_setup_table;
        unsigned long memclk;
        unsigned long tmemclk = 0;
@@ -574,15 +574,15 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       unsigned char s[50];
+       char s[50];
        unsigned char bc;
        int i;
        backup_t *b = (backup_t *) s;
 
        puts ("Board: ");
 
-       i = getenv_r ("serial#", s, 32);
-       if ((i == 0) || strncmp (s, "PIP405", 6)) {
+       i = getenv_r ("serial#", (char *)s, 32);
+       if ((i == 0) || strncmp ((char *)s, "PIP405", 6)) {
                get_backup_values (b);
                if (strncmp (b->signature, "MPL\0", 4) != 0) {
                        puts ("### No HW ID - assuming PIP405");
index fb7547f349e73f2a9e5b1be450f605ef8937d541..f8a8cb7578b42ed8380c757f2a4d68e266907b29 100644 (file)
@@ -197,14 +197,14 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        udelay (1000);
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
index cbcbab8945a87b70c9ebf33de4b9e2c0f2fd55ea..65d45c197f0053cc6ad9c4c1d4ca036a818f9167 100644 (file)
@@ -221,7 +221,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE1_PRELIM,
                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -229,7 +229,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE1_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE1_PRELIM,
                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {    /* leave configuration at 9 columns     */
@@ -248,7 +248,7 @@ long int initdram (int board_type)
         * [9 column SDRAM may also be used in 8 column mode,
         *  but then only half the real size will be used.]
         */
-       size_b1 = dram_size (memctl->memc_mamr, (ulong *) SDRAM_BASE2_PRELIM,
+       size_b1 = dram_size (memctl->memc_mamr, (long *) SDRAM_BASE2_PRELIM,
                             SDRAM_MAX_SIZE);
 /*     debug ("SDRAM Bank 1: %ld MB\n", size8 >> 20);  */
 
index dbb49f75ef40514d59f1710e30678ac33550f706..037d28732d8066a76f783232201f6afb2b11c267 100644 (file)
@@ -154,7 +154,7 @@ void flash_print_info (flash_info_t *info)
        int i;
        uchar *boottype;
        uchar *bootletter;
-       uchar *fmt;
+       char *fmt;
        uchar botbootletter[] = "B";
        uchar topbootletter[] = "T";
        uchar botboottype[] = "bottom boot sector";
index 8c6f5db9f0a21f39da819d972871e38d5143d6ac..81a27002f43efc46f8ddaac6dd9224fb8e288edf 100644 (file)
@@ -85,9 +85,9 @@ long int initdram (int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize = test1;
@@ -113,11 +113,11 @@ long int initdram (int board_type)
        if (!dramsize)
                sdram_start(0);
 
-       test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+       test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
 
        if (!dramsize) {
                sdram_start(1);
-               test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+               test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        }
 
        if (test1 > test2) {
index 6e9e3395c1b22c9154c9afb62f95dfb862b5f2e4..8c01415faed614cae2e74daf075303a5361fc999 100644 (file)
@@ -136,7 +136,7 @@ static ulong flash_get_size (ulong addr, flash_info_t *info)
 
        DEBUGF("Device ID @ 0x%08lx: 0x%08x\n", addr+1, value);
 
-       switch (value) {
+       switch ((ulong)value) {
                case AMD_ID_F040B:
                        DEBUGF("Am29F040B\n");
                        info->flash_id += FLASH_AM040;
index 619df59c90dd9d3fd593b07a4a97ca249c937b0a..d4cc5cb56170131aa137a8b300c6bda3b71d597d 100644 (file)
@@ -107,9 +107,9 @@ long int initdram (int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize = test1;
@@ -135,10 +135,10 @@ long int initdram (int board_type)
        /* find RAM size using SDRAM CS1 only */
        if (!dramsize)
                sdram_start(0);
-       test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+       test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        if (!dramsize) {
                sdram_start(1);
-               test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+               test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        }
        if (test1 > test2) {
                sdram_start(0);
index 025224027e8edc2fc997c076230dd13ecd1bfe05..377aaa8bca3a48dda99a4a98413ba35931e1df66 100644 (file)
@@ -167,7 +167,7 @@ static int get_serial_number (char *string, int size)
        if (size < I2155X_VPD_SN_SIZE)
                size = I2155X_VPD_SN_SIZE;
        for (i = 0; i < (size - 1); i++) {
-               i2155x_read_vpd (I2155X_VPD_SN_START + i, 1, &c);
+               i2155x_read_vpd (I2155X_VPD_SN_START + i, 1, (uchar *)&c);
                if (c == '\0')
                        break;
                string[i] = c;
index e92ad8f96ba7bed929d9714e1b4a8d7cc0d2627a..2b20c26f17478a43e56e108bf95df67b57865813 100644 (file)
@@ -285,7 +285,7 @@ int misc_init_r (void)
        int res;
 
        if ((ds != 0) && (ds != 0xff)) {
-               res = getenv_r ("ethaddr", tmp, sizeof (tmp));
+               res = getenv_r ("ethaddr", (char *)tmp, sizeof (tmp));
                if (res > 0) {
                        ss = ((ds >> 4) & 0x0f);
                        ss += ss < 0x0a ? '0' : ('a' - 10);
@@ -296,7 +296,7 @@ int misc_init_r (void)
                        tmp[16] = ss;
 
                        tmp[17] = '\0';
-                       setenv ("ethaddr", tmp);
+                       setenv ("ethaddr", (char *)tmp);
                        /* set the led to show the address */
                        *((unsigned char *) (CFG_LED_BASE + 1)) = ds;
                }
index 8a73448dc7ce7e320eee0970621278cab0b40303..2861bc3b166325274d121054e561e6e78ac28d11 100644 (file)
@@ -87,7 +87,7 @@ const uint sdram_table[] = {
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        puts ("Board QUANTUM, Serial No: ");
 
@@ -136,7 +136,7 @@ long int initdram (int board_type)
        /* Check Bank 0 Memory Size,
         * 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE_PRELIM,
                           SDRAM_MAX_SIZE);
        /*
         * Final mapping:
@@ -162,7 +162,7 @@ static long int dram_size (long int mamr_value, long int *base,
 {
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        volatile memctl8xx_t *memctl = &immap->im_memctl;
-       volatile long int *addr;
+       volatile ulong *addr;
        ulong cnt, val, size;
        ulong save[32];         /* to make test non-destructive */
        unsigned char i = 0;
index 8ca08e25d1cb28db4efa43e5023e0e1068f7e652..ffb4c0ecf9f188d251bb5ad3bafd17ff96112114 100644 (file)
@@ -152,7 +152,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        udelay (1000);
@@ -160,7 +160,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
@@ -287,21 +287,21 @@ static uchar *key_match (uchar *);
 
 int misc_init_r (void)
 {
-       uchar kbd_data[KEYBD_DATALEN];
-       uchar keybd_env[2 * KEYBD_DATALEN + 1];
-       uchar *str;
+       char kbd_data[KEYBD_DATALEN];
+       char keybd_env[2 * KEYBD_DATALEN + 1];
+       char *str;
        int i;
 
        i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
 
-       i2c_read (CFG_I2C_KEY_ADDR, 0, 0, kbd_data, KEYBD_DATALEN);
+       i2c_read (CFG_I2C_KEY_ADDR, 0, 0, (uchar *)kbd_data, KEYBD_DATALEN);
 
        for (i = 0; i < KEYBD_DATALEN; ++i) {
                sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
        }
        setenv ("keybd", keybd_env);
 
-       str = strdup (key_match (keybd_env));   /* decode keys */
+       str = strdup ((char *)key_match ((uchar *)keybd_env));  /* decode keys */
 
 #ifdef CONFIG_PREBOOT  /* automatically configure "preboot" command on key match */
        setenv ("preboot", str);        /* set or delete definition */
@@ -347,36 +347,36 @@ static uchar *key_match (uchar * kbd_str)
         * "key_magic" is checked (old behaviour); the string "125" causes
         * checks for "key_magic1", "key_magic2" and "key_magic5", etc.
         */
-       if ((kbd_magic_keys = getenv ("magic_keys")) != NULL) {
+       if ((kbd_magic_keys = (uchar *)getenv ("magic_keys")) != NULL) {
                /* loop over all magic keys;
                 * use '\0' suffix in case of empty string
                 */
                for (suffix = kbd_magic_keys;
                     *suffix || suffix == kbd_magic_keys;
                     ++suffix) {
-                       sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
+                       sprintf ((char *)magic, "%s%c", kbd_magic_prefix, *suffix);
 
 #if 0
                        printf ("### Check magic \"%s\"\n", magic);
 #endif
 
-                       if ((str = getenv (magic)) != 0) {
+                       if ((str = (uchar *)getenv ((char *)magic)) != 0) {
 
 #if 0
                                printf ("### Compare \"%s\" \"%s\"\n",
                                        kbd_str, str);
 #endif
-                               if (strcmp (kbd_str, str) == 0) {
-                                       sprintf (cmd_name, "%s%c",
+                               if (strcmp ((char *)kbd_str, (char *)str) == 0) {
+                                       sprintf ((char *)cmd_name, "%s%c",
                                                 kbd_command_prefix,
                                                 *suffix);
 
-                                       if ((cmd = getenv (cmd_name)) != 0) {
+                                       if ((cmd = getenv ((char *)cmd_name)) != 0) {
 #if 0
                                                printf ("### Set PREBOOT to $(%s): \"%s\"\n",
                                                        cmd_name, cmd);
 #endif
-                                               return (cmd);
+                                               return ((uchar *)cmd);
                                        }
                                }
                        }
@@ -404,11 +404,11 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
        puts ("Keys:");
        for (i = 0; i < KEYBD_DATALEN; ++i) {
-               sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
+               sprintf ((char *)(keybd_env + i + i), "%02X", kbd_data[i]);
                printf (" %02x", kbd_data[i]);
        }
        putc ('\n');
-       setenv ("keybd", keybd_env);
+       setenv ("keybd", (char *)keybd_env);
        return 0;
 }
 
index f12d0be552598830523578de19d280ccc9ab9763..84ae5c1b5d633a45189ebe6622ddc4fe37a4851b 100644 (file)
@@ -188,12 +188,11 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
 #endif
        switch (value)
        {
-               case 0x01:
-               case AMD_MANUFACT:
+               case 0x01: /*AMD_MANUFACT*/
                        info->flash_id = FLASH_MAN_AMD;
                break;
 
-               case FUJ_MANUFACT:
+               case 0x04: /*FUJ_MANUFACT*/
                        info->flash_id = FLASH_MAN_FUJ;
                break;
 
index d0ceb4a7d5c29a23296b2ce94504d69536624d61..9e60c2b646978beb3193740a2bc537f4e0610aa9 100644 (file)
@@ -127,7 +127,7 @@ const uint static_table[] =
 
 int checkboard (void)
 {
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        if (!s || strncmp (s, "TQM8", 4)) {
                printf ("### No HW ID - assuming RBC823\n");
@@ -193,14 +193,14 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE4_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE4_PRELIM,
                           SDRAM_MAX_SIZE);
        udelay (1000);
 
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE4_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE4_PRELIM,
                           SDRAM_MAX_SIZE);
 
        if (size8 < size9) {    /* leave configuration at 9 columns     */
index cf00efc78b031dfcb06db59e752e9d2996ecb819..8cb03c7f8495ab05464e2fc753e5766207e49810 100644 (file)
@@ -127,7 +127,7 @@ long int initdram (int board_type)
         * 9 column mode
         */
 
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE_PRELIM,
                           SDRAM_MAX_SIZE);
 
        /*
index 858b38ceccd2e714b43b73a01be573f4b6bab80b..859dd7afe56bb1afbb7aa1b8341984098de5571f 100644 (file)
@@ -451,9 +451,9 @@ int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len)
  */
 uchar i2c_reg_read1(uchar i2c_addr, uchar reg)
 {
-       char buf;
+       uchar buf;
 
-       i2c_read1(i2c_addr, reg, 1, &buf, 1);
+       i2c_read1(i2c_addr, reg, 1, &buf, (uchar)1);
 
        return(buf);
 }
index 779081950a1f98635470efa1dd5374a747c393b0..5de7cb51302f0fd331f3f40e51d2e40034033044 100644 (file)
@@ -57,7 +57,7 @@ typedef struct karef_fpga_regs_s
     volatile unsigned long brdout_enable_ul;  /* Read/Write */
     volatile unsigned long brdin_data_ul;     /* Read Only  */
     volatile unsigned long misc_ul;           /* Read/Write */
-} KAREF_FPGA_REGS_ST __attribute__((packed)), * KAREF_FPGA_REGS_PST;
+} __attribute__((packed)) KAREF_FPGA_REGS_ST , * KAREF_FPGA_REGS_PST;
 
 /* OFEM FPGA */
 typedef struct ofem_fpga_regs_s
@@ -70,7 +70,7 @@ typedef struct ofem_fpga_regs_s
     volatile unsigned long scrmask_ul;        /* Read/Write */
     volatile unsigned long control_ul;        /* Read/Write */
     volatile unsigned long mac_flow_ctrl_ul;  /* Read/Write */
-} OFEM_FPGA_REGS_ST __attribute__((packed)), * OFEM_FPGA_REGS_PST;
+} __attribute__((packed)) OFEM_FPGA_REGS_ST , * OFEM_FPGA_REGS_PST;
 
 
 #endif /* __KAREF_H__ */
index cb7a83ce32910763a0725367c415239e22bb3ca9..3f28f004423cdcaef20cc8d4b4943ccfbdbaa934 100644 (file)
@@ -40,6 +40,6 @@ typedef struct opto_fpga_regs_s {
        volatile unsigned long scrmask_ul;      /* Read/Write */
        volatile unsigned long control_ul;      /* Read/Write */
        volatile unsigned long boardinfo_ul;    /* Read Only  */
-} OPTO_FPGA_REGS_ST __attribute__ ((packed)), *OPTO_FPGA_REGS_PST;
+} __attribute__ ((packed)) OPTO_FPGA_REGS_ST , *OPTO_FPGA_REGS_PST;
 
 #endif /* __METROBOX_H__ */
index ef9bce18e0c01a980f38259bea1d1989bb44ee24..cad58731d3e812ee02495c1a767c7b9fedfb049c 100644 (file)
@@ -78,7 +78,7 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index 3ed1b754ca99491eff1dc6b61c3e7ed6d38ed154..5a32e45e289049fac4b92aa82231255404d234df 100644 (file)
@@ -102,7 +102,7 @@ int checkboard (void)
     unsigned char *s;
     unsigned char buf[64];
 
-    s = (getenv_r ("serial#", buf, sizeof(buf)) > 0) ? buf : NULL;
+    s = (getenv_r ("serial#", (char *)&buf, sizeof(buf)) > 0) ? buf : NULL;
 
     puts ("Board: Siemens CCM");
 
@@ -203,14 +203,14 @@ long int initdram (int board_type)
      *
      * try 8 column mode
      */
-    size8 = dram_size (CFG_MAMR_8COL, (ulong *)SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
+    size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
 
     udelay (1000);
 
     /*
      * try 9 column mode
      */
-    size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
+    size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
 
     if (size8 < size9) {               /* leave configuration at 9 columns     */
        size = size9;
index 52cd4e6fa75904ce4ab0ae26aba5984f7306b9b2..e498937b65f8b85e468cd3ac3285a94bce9941c8 100644 (file)
@@ -155,7 +155,7 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         *
         */
-       size = dram_size (CFG_MAMR, (ulong *) SDRAM_BASE_PRELIM,
+       size = dram_size (CFG_MAMR, (long *) SDRAM_BASE_PRELIM,
                          SDRAM_MAX_SIZE);
 
        udelay (1000);
index d832edf8255b2b44405e89d03070ff34f073658b..d20688d5687133d8677c784f0e95070eebb96a92 100644 (file)
@@ -206,7 +206,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index 169048e42fe6013e059432eb85e065a617df1dc7..e9941cda615b9236512cd764dea80d673f50cb81 100644 (file)
@@ -169,7 +169,7 @@ static int fpga_load (fpga_t* fpga, ulong addr, int checkall)
        }
     }
 
-    if (checkall && fpga_get_version(fpga, hdr.ih_name) < 0)
+    if (checkall && fpga_get_version(fpga, (char *)(hdr.ih_name)) < 0)
        return 1;
 
     /* align length */
@@ -341,7 +341,7 @@ int fpga_init (void)
        }
 
        hdr = (image_header_t *)addr;
-       if ((new_id = fpga_get_version(fpga, hdr->ih_name)) == -1)
+       if ((new_id = fpga_get_version(fpga, (char *)(hdr->ih_name))) == -1)
            return 1;
 
        do_load = 1;
index 6374513feccb41991fa77dc6d6e06d44250fa23d..3f05e4a6abc96fc392a508209837e32cadf76633 100644 (file)
@@ -241,9 +241,9 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         */
 #if PCU_E_WITH_SWAPPED_CS      /* XXX */
-       size_b0 = dram_size (CFG_MAMR, (ulong *) SDRAM_BASE5_PRELIM, SDRAM_MAX_SIZE);
+       size_b0 = dram_size (CFG_MAMR, (long *) SDRAM_BASE5_PRELIM, SDRAM_MAX_SIZE);
 #else  /* XXX */
-       size_b0 = dram_size (CFG_MAMR, (ulong *) SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
+       size_b0 = dram_size (CFG_MAMR, (long *) SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
 #endif /* XXX */
 
        memctl->memc_mamr = CFG_MAMR | MAMR_PTAE;
index 4ab6c1bdc42538dda6d54643e6bdf2412de463c1..61d758085c238f3309ad1e0f92d2e5c0325f0d37 100644 (file)
@@ -196,7 +196,7 @@ void flash_print_info (flash_info_t *info)
        int i;
        uchar *boottype;
        uchar *bootletter;
-       uchar *fmt;
+       char *fmt;
        uchar botbootletter[] = "B";
        uchar topbootletter[] = "T";
        uchar botboottype[] = "bottom boot sector";
index c31ea539e2b0886861c24c50a7ffd4158c60c570..867589f918e36da26cd8bd7b81ac89d1689e744c 100644 (file)
@@ -356,7 +356,7 @@ void nand_init(void)
 static long ram_size(ulong *base, long maxsize)
 {
     volatile long      *test_addr;
-    volatile long      *base_addr = base;
+    volatile ulong     *base_addr = base;
     ulong              ofs;            /* byte offset from base_addr */
     ulong              save;           /* to make test non-destructive */
     ulong              save2;          /* to make test non-destructive */
index 105eeb8eb838b48bb4d343c5e80a1af3908bbf05..637f1250e90243f2cca004288d993c18327c1299 100644 (file)
@@ -89,8 +89,8 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       unsigned char *s, *e;
-       unsigned char buf[64];
+       char *s, *e;
+       char buf[64];
        int i;
 
        i = getenv_r("serial#", buf, sizeof(buf));
@@ -192,7 +192,7 @@ long int initdram (int board_type)
        * Check for 32M SDRAM Memory Size
        */
        size = dram_size(CFG_32M_MAMR|MAMR_PTAE,
-       (ulong *)SDRAM_BASE, SDRAM_32M_MAX_SIZE);
+       (long *)SDRAM_BASE, SDRAM_32M_MAX_SIZE);
        udelay (1000);
 
        /*
@@ -200,7 +200,7 @@ long int initdram (int board_type)
        */
        if (size != SDRAM_32M_MAX_SIZE) {
        size = dram_size(CFG_16M_MAMR|MAMR_PTAE,
-       (ulong *)SDRAM_BASE, SDRAM_16M_MAX_SIZE);
+       (long *)SDRAM_BASE, SDRAM_16M_MAX_SIZE);
        udelay (1000);
        }
 
index 2a55157813bade2246d1c95dec2b1f24ba7054e3..a11d8630102cda1363b1a4cd486d753305d17be8 100644 (file)
@@ -89,8 +89,8 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       unsigned char *s, *e;
-       unsigned char buf[64];
+       char *s, *e;
+       char buf[64];
        int i;
 
        i = getenv_r("serial#", buf, sizeof(buf));
@@ -163,7 +163,7 @@ long int initdram (int board_type)
        */
        if (size != SDRAM_64M_MAX_SIZE) {
 #endif
-       size = dram_size (CFG_16M_MBMR, (ulong *)SDRAM_BASE, SDRAM_16M_MAX_SIZE);
+       size = dram_size (CFG_16M_MBMR, (long *)SDRAM_BASE, SDRAM_16M_MAX_SIZE);
        udelay (1000);
 #if 0
        }
index 9f52e339bab3a23472be66c1858f1ceee68cbec4..c79b9b0dd5ea65c05bede3f171c556616d8a7359 100644 (file)
@@ -205,7 +205,7 @@ long int initdram (int board_type)
         * Check Bank 0 Memory Size for re-configuration
         */
        size_b0 =
-               dram_size (CFG_MBMR_8COL, (ulong *) SDRAM_BASE3_PRELIM,
+               dram_size (CFG_MBMR_8COL, SDRAM_BASE3_PRELIM,
                           SDRAM_MAX_SIZE);
 
        memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;
index 8c529a0611d101d868c380548d562a17edaecc23..11065cfd2c4e04ee7935dbdeb1f7d0bcbb6108a1 100644 (file)
@@ -25,11 +25,19 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+OBJS   = $(BOARD).o oftree.o
 
 $(LIB):        .depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
+%.dtb: %.dts
+       dtc -f -V 0x10 -I dts -O dtb $< >$@
+
+%.c: %.dtb
+       xxd -i $< \
+          | sed -e "s/^unsigned char/const unsigned char/g" \
+          | sed -e "s/^unsigned int/const unsigned int/g" > $@
+
 #########################################################################
 
 .depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
diff --git a/board/stxxtc/oftree.dts b/board/stxxtc/oftree.dts
new file mode 100644 (file)
index 0000000..e3f3017
--- /dev/null
@@ -0,0 +1,52 @@
+/ {
+       model = "STXXTC V1";
+       compatible = "STXXTC";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               linux,phandle = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               PowerPC,MPC870@0 {
+                       linux,phandle = <3>;
+                       name = "PowerPC,MPC870";
+                       device_type = "cpu";
+                       reg = <0>;
+                       clock-frequency = <0>;          /* place-holder for runtime fillup */
+                       timebase-frequency = <0>;       /* dido */
+                       linux,boot-cpu;
+                       i-cache-size = <2000>;
+                       d-cache-size = <2000>;
+                       32-bit;
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <00000000 00000000 00000000 20000000>;
+       };
+
+       /* copy of the bd_t information (place-holders) */
+       bd_t {
+               memstart        = <0>;
+               memsize         = <0>;
+               flashstart      = <0>;
+               flashsize       = <0>;
+               flashoffset     = <0>;
+               sramstart       = <0>;
+               sramsize        = <0>;
+
+               immr_base       = <0>;
+
+               bootflags       = <0>;
+               ip_addr         = <0>;
+               enetaddr        = [ 00 00 00 00 00 00 ];
+               ethspeed        = <0>;
+               intfreq         = <0>;
+               busfreq         = <0>;
+
+               baudrate        = <0>;
+       };
+
+};
index 1311ea9aaa5c5c0725f29174ba3e23e6a77be9f3..9bb9fd019f76f3b9c84a1c211426894979effd99 100644 (file)
@@ -77,7 +77,7 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-    unsigned char *s = getenv("serial#");
+    char *s = getenv("serial#");
     int board_type;
 
     if (!s || strncmp(s, "SVM8", 4)) {
index 367c826b8a3cad81e162602a4a7c601301fd511e..a1601f274d25e5e3c13c99a9ccd0f626749989f7 100644 (file)
@@ -102,9 +102,9 @@ long int mpc5xxx_sdram_init (sdram_conf_t *sdram_conf)
 
        /* find RAM size using SDRAM CS0 only */
        mpc5xxx_sdram_start(sdram_conf, 0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        mpc5xxx_sdram_start(sdram_conf, 1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                mpc5xxx_sdram_start(sdram_conf, 0);
                dramsize = test1;
@@ -129,9 +129,9 @@ long int mpc5xxx_sdram_init (sdram_conf_t *sdram_conf)
 
        /* find RAM size using SDRAM CS1 only */
        mpc5xxx_sdram_start(sdram_conf, 0);
-       test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+       test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        mpc5xxx_sdram_start(sdram_conf, 1);
-       test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
+       test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
        if (test1 > test2) {
                mpc5xxx_sdram_start(sdram_conf, 0);
                dramsize2 = test1;
@@ -199,9 +199,9 @@ long int mpc5xxx_sdram_init (sdram_conf_t *sdram_conf)
 
        /* find RAM size */
        mpc5xxx_sdram_start(sdram_conf, 0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        mpc5xxx_sdram_start(sdram_conf, 1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
        if (test1 > test2) {
                mpc5xxx_sdram_start(sdram_conf, 0);
                dramsize = test1;
index c30e9dfdfdd8effa96fb783ea22bda7074db78de..8b9057f503afeffe05e1db7493de29a2371a6761 100755 (executable)
@@ -181,7 +181,7 @@ static void i2s_init(void)
 static int i2s_play_wave(unsigned long addr, unsigned long len)
 {
        unsigned long i;
-       unsigned char *wave_file = (char *)addr + 44;   /* quick'n dirty: skip
+       unsigned char *wave_file = (uchar *)addr + 44;  /* quick'n dirty: skip
                                                         * wav header*/
        unsigned char swapped[4];
        struct mpc5xxx_psc *psc = (struct mpc5xxx_psc*)MPC5XXX_PSC2;
@@ -304,7 +304,7 @@ static int i2s_squarewave(unsigned long duration, unsigned int freq,
 static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        unsigned long reg, val, duration;
-       unsigned char *tmp;
+       char *tmp;
        unsigned int freq, channel;
        unsigned char volume;
        int rcode = 1;
index dbd78d5e3a20f3fa8ac42f584aa829c14d92761f..6aad920edaad98adec418da0cfe9ee5803cbc144 100644 (file)
@@ -122,9 +122,9 @@ long int initdram (int board_type)
 
        /* find RAM size using SDRAM CS0 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x20000000);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x20000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x20000000);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x20000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize = test1;
@@ -150,9 +150,9 @@ long int initdram (int board_type)
 
        /* find RAM size using SDRAM CS1 only */
        sdram_start(0);
-       test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
+       test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
        sdram_start(1);
-       test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
+       test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x20000000);
        if (test1 > test2) {
                sdram_start(0);
                dramsize2 = test1;
index 22919873d1e9a11105ba5b23871559b29225b1c4..029863b7d9f80a5b8421d0ddb991a633b1fd22ff 100644 (file)
@@ -195,7 +195,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
index 98baf7f67db37a76b0fdbe79783a58a6d4c69037..143f36801d2c4ad71ff1266113f34b9333ddd0db 100644 (file)
@@ -96,10 +96,10 @@ void load_sernum_ethaddr (void)
 
        /* set serial# and ethaddr if not yet defined */
        if (getenv("serial#") == NULL) {
-               setenv ("serial#", serial);
+               setenv ((char *)"serial#", (char *)serial);
        }
 
        if (getenv("ethaddr") == NULL) {
-               setenv ("ethaddr", ethaddr);
+               setenv ((char *)"ethaddr", (char *)ethaddr);
        }
 }
index a7a6f2a2fa78d9036b4ac4c13e665c0ade10d623..017bdf9442a8871ebfa737ff0faa9445c33c5e74 100644 (file)
@@ -106,7 +106,7 @@ int checkboard (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
-       unsigned char *s = getenv ("serial#");
+       char *s = getenv ("serial#");
 
        puts ("Board: ");
 
@@ -215,7 +215,7 @@ long int initdram (int board_type)
         *
         * try 8 column mode
         */
-       size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
        debug ("SDRAM Bank 0 in 8 column mode: %ld MB\n", size8 >> 20);
 
@@ -224,7 +224,7 @@ long int initdram (int board_type)
        /*
         * try 9 column mode
         */
-       size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
+       size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE2_PRELIM,
                                           SDRAM_MAX_SIZE);
        debug ("SDRAM Bank 0 in 9 column mode: %ld MB\n", size9 >> 20);
 
@@ -263,7 +263,7 @@ long int initdram (int board_type)
                 * [9 column SDRAM may also be used in 8 column mode,
                 *  but then only half the real size will be used.]
                 */
-               size_b1 = dram_size (memctl->memc_mamr, (ulong *) SDRAM_BASE3_PRELIM,
+               size_b1 = dram_size (memctl->memc_mamr, (long int *)SDRAM_BASE3_PRELIM,
                                     SDRAM_MAX_SIZE);
                debug ("SDRAM Bank 1: %ld MB\n", size_b1 >> 20);
        } else {
index 6fc68e5cc3c4f3d8715ccbeadb354ae2e493be3f..1387b93ffcb83acd47afe9332bb19042c6e7317a 100644 (file)
@@ -147,7 +147,7 @@ int board_switch(void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
index d6ea63530c67a7b2566cfeca0f6cbc78849236bd..32815fb63e0833e88bdf865189604ae03299ae82 100644 (file)
@@ -805,7 +805,7 @@ static int _flash_protect(flash_info_t *info, long sector)
     int flag;
     ulong status;
     int rcode = 0;
-    volatile long *addr = (unsigned long *)sector;
+    volatile long *addr = (long *)sector;
 
     switch(info->flash_id & FLASH_TYPEMASK) {
        case FLASH_28F320J3A:
@@ -863,7 +863,7 @@ static int _flash_unprotect(flash_info_t *info, long sector)
     int flag;
     ulong status;
     int rcode = 0;
-    volatile long *addr = (unsigned long *)sector;
+    volatile long *addr = (long *)sector;
 
     switch(info->flash_id & FLASH_TYPEMASK) {
        case FLASH_28F320J3A:
index 336bfbaccc6cf185a235faeec4fcce2fdd2a1c64..100bce4722ecf321ee547adb860c4f7b1301a642 100644 (file)
@@ -252,7 +252,7 @@ int init_fpga(void)
     xcv_len = len - 14 - fn_len;               /* fpga image length */
 
     /* Check for uninitialized FLASH */
-    if ((strncmp(buf, "w7o", 3)!=0) || (len > 0x0007ffffL) || (len == 0))
+    if ((strncmp((char *)buf, "w7o", 3)!=0) || (len > 0x0007ffffL) || (len == 0))
        goto bad_image;
 
     /*
index fc2cd98321528ab29491525720ad18735cf49b21..2ce15680e1535f6a6907980770402754ee2fda5c 100644 (file)
@@ -125,7 +125,7 @@ static int vpd_is_valid(unsigned dev_addr, unsigned char *buf)
     unsigned short  stored_crc16, calc_crc16 = 0xffff;
 
     /* Check Eyecatcher */
-    if (strncmp(vpd->header.eyecatcher, VPD_EYECATCHER, VPD_EYE_SIZE) != 0) {
+    if (strncmp((char *)(vpd->header.eyecatcher), VPD_EYECATCHER, VPD_EYE_SIZE) != 0) {
        unsigned offset = 0;
        if (dev_addr == CFG_DEF_EEPROM_ADDR)
            offset += SDRAM_SPD_DATA_SIZE;
@@ -259,7 +259,7 @@ int vpd_get_data(unsigned char dev_addr, VPD *vpdInfo)
            case VPD_PID_PID:
                if (strlen_ok(packet, MAX_PROD_ID)) {
                    strncpy(vpdInfo->productId,
-                           packet->data, packet->size);
+                           (char *)(packet->data), packet->size);
                }
                break;
            case VPD_PID_REV:
index daf7f53fcd97d0f84c8ac2f2d4120fdc150e349a..c56c269daecc0418412354ec978b4b2967cbe347 100644 (file)
@@ -207,8 +207,8 @@ static void w7o_env_init (VPD * vpd)
             (strncmp (vpd->productId, "CMM", 3) == 0))) {
                char buf[30];
                char *eth;
-               unsigned char *serial = getenv ("serial#");
-               unsigned char *ethaddr = getenv ("ethaddr");
+               char *serial = getenv ("serial#");
+               char *ethaddr = getenv ("ethaddr");
 
                /* Set 'serial#' envvar if serial# isn't set */
                if (!serial) {
@@ -218,7 +218,7 @@ static void w7o_env_init (VPD * vpd)
                }
 
                /* Set 'ethaddr' envvar if 'ethaddr' envvar is the default */
-               eth = vpd->ethAddrs[0];
+               eth = (char *)(vpd->ethAddrs[0]);
                if (ethaddr
                    && (strcmp (ethaddr, MK_STR (CONFIG_ETHADDR)) == 0)) {
                        /* Now setup ethaddr */
index 25f1e260287753373c143d5a4047b55fae72178d..3d5fc75e3659adf0a5526c112a4fdf7fd5291a74 100644 (file)
@@ -123,7 +123,7 @@ XDmaChannel_Initialize(XDmaChannel * InstancePtr, u32 BaseAddress)
 
        /* initialize the version of the component
         */
-       XVersion_FromString(&InstancePtr->Version, "1.00a");
+       XVersion_FromString(&InstancePtr->Version, (s8 *)"1.00a");
 
        /* reset the DMA channel such that it's in a known state and ready
         * and indicate the initialization occured with no errors, note that
index f335fc1ba6dfcaf10263070afd84f504cd5a3c29..dad562f1c7761d0d2d47fb867e18bea8838444ca 100644 (file)
@@ -55,8 +55,8 @@ board_pre_init(void)
 int
 checkboard(void)
 {
-       uchar tmp[64];          /* long enough for environment variables */
-       uchar *s, *e;
+       char tmp[64];           /* long enough for environment variables */
+       char *s, *e;
        int i = getenv_r("L", tmp, sizeof (tmp));
 
        if (i < 0) {
index bf8cf0bccb4a98f7579661a2d05fa2d31f030a33..1076345752f3e2f5ae91b7bf01c4e9213ed87ff7 100644 (file)
@@ -148,7 +148,7 @@ eth_rx(void)
        RecvFrameLength = PKTSIZE;
        Result = XEmac_PollRecv(&Emac, (u8 *) etherrxbuff, &RecvFrameLength);
        if (Result == XST_SUCCESS) {
-               NetReceive(etherrxbuff, RecvFrameLength);
+               NetReceive((uchar)etherrxbuff, RecvFrameLength);
                return (1);
        } else {
                return (0);
index 5ad4a0c11945cd78a0cff1df9379c297b9295218..f3ecba72dc88095ba9837f7fe01e14544cc6efdf 100644 (file)
@@ -291,15 +291,15 @@ read_crc(uchar * buffer, int len)
 static void
 ip_ml300(uchar * s, uchar * res)
 {
-       uchar temp[2];
+       char temp[2];
        u8 i;
 
        res[0] = 0x00;
 
        for (i = 0; i < 4; i++) {
                sprintf(temp, "%02x", atoi(s));
-               s = strchr(s, '.') + 1;
-               strcat(res, temp);
+               s = (uchar *)strchr((char *)s, '.') + 1;
+               strcat((char *)res, temp);
        }
 }
 
@@ -310,8 +310,8 @@ static void
 change_null(uchar * s)
 {
        if (s != NULL) {
-               change_null(strchr(s + 1, 255));
-               *(strchr(s, 255)) = '\0';
+               change_null((uchar *)strchr((char *)s + 1, 255));
+               *(strchr((char *)s, 255)) = '\0';
        }
 }
 
@@ -321,8 +321,8 @@ change_null(uchar * s)
 void
 convert_env(void)
 {
-       uchar *s;               /* pointer to env value */
-       uchar temp[20];         /* temp storage for addresses */
+       char *s;                /* pointer to env value */
+       char temp[20];          /* temp storage for addresses */
 
        /* E -> ethaddr */
        s = getenv("E");
@@ -345,8 +345,8 @@ convert_env(void)
        /* I -> ipaddr */
        s = getenv("I");
        if (s != NULL) {
-               sprintf(temp, "%d.%d.%d.%d", axtoi(s), axtoi(s + 2),
-                       axtoi(s + 4), axtoi(s + 6));
+               sprintf(temp, "%d.%d.%d.%d", axtoi((u8 *)s), axtoi((u8 *)(s + 2)),
+                       axtoi((u8 *)(s + 4)), axtoi((u8 *)(s + 6)));
                setenv("ipaddr", temp);
                setenv("I", NULL);
        }
@@ -354,8 +354,8 @@ convert_env(void)
        /* S -> serverip */
        s = getenv("S");
        if (s != NULL) {
-               sprintf(temp, "%d.%d.%d.%d", axtoi(s), axtoi(s + 2),
-                       axtoi(s + 4), axtoi(s + 6));
+               sprintf(temp, "%d.%d.%d.%d", axtoi((u8 *)s), axtoi((u8 *)(s + 2)),
+                       axtoi((u8 *)(s + 4)), axtoi((u8 *)(s + 6)));
                setenv("serverip", temp);
                setenv("S", NULL);
        }
@@ -391,9 +391,9 @@ convert_env(void)
 static void
 save_env(void)
 {
-       uchar eprom[ENV_SIZE];  /* buffer to be written back to EEPROM */
-       uchar *s, temp[20];
-       uchar ff[] = { 0xff, 0x00 };    /* dummy null value */
+       char eprom[ENV_SIZE];   /* buffer to be written back to EEPROM */
+       char *s, temp[20];
+       char ff[] = { 0xff, 0x00 };     /* dummy null value */
        u32 len;                /* length of env to be written to EEPROM */
 
        eprom[0] = 0x00;
@@ -422,7 +422,7 @@ save_env(void)
        s = getenv("ipaddr");
        if (s != NULL) {
                strcat(eprom, "I=");
-               ip_ml300(s, temp);
+               ip_ml300((uchar *)s, (uchar *)temp);
                strcat(eprom, temp);
                strcat(eprom, ff);
        }
@@ -431,7 +431,7 @@ save_env(void)
        s = getenv("serverip");
        if (s != NULL) {
                strcat(eprom, "S=");
-               ip_ml300(s, temp);
+               ip_ml300((uchar *)s, (uchar *)temp);
                strcat(eprom, temp);
                strcat(eprom, ff);
        }
@@ -461,11 +461,11 @@ save_env(void)
        }
 
        len = strlen(eprom);    /* find env length without crc */
-       change_null(eprom);     /* change 0xff to 0x00 */
+       change_null((uchar *)eprom);    /* change 0xff to 0x00 */
 
        /* update EEPROM env values if there is enough space */
-       if (update_crc(len, eprom) == 0)
-               send(CFG_ENV_OFFSET, eprom, len + 6);
+       if (update_crc(len, (uchar *)eprom) == 0)
+               send(CFG_ENV_OFFSET, (uchar *)eprom, len + 6);
 }
 
 /************************************************************************
index 6366e0226a9810ab804ed140d62cf64a28d28a68..7dbf84a555ea9d3b54742f96785e8cf900056a83 100644 (file)
@@ -46,7 +46,7 @@ COBJS = main.o ACEX1K.o altera.o bedbug.o circbuf.o \
          env_nand.o env_dataflash.o env_flash.o env_eeprom.o \
          env_nvram.o env_nowhere.o \
          exports.o \
-         flash.o fpga.o \
+         flash.o fpga.o ft_build.o \
          hush.o kgdb.o lcd.o lists.o lynxkdi.o \
          memsize.o miiphybb.o miiphyutil.o \
          s_record.o serial.o soft_i2c.o soft_spi.o spartan2.o spartan3.o \
index 2d1f43143996a18596b8ce3b5433105f5d1f5755..e3253022dc92a08f8057af9d33472ff2ad1a0b92 100644 (file)
@@ -76,7 +76,7 @@ autoscript (ulong addr)
        hdr->ih_hcrc = 0;
        len = sizeof (image_header_t);
        data = (ulong)hdr;
-       if (crc32(0, (char *)data, len) != crc) {
+       if (crc32(0, (uchar *)data, len) != crc) {
                puts ("Bad header crc\n");
                return 1;
        }
@@ -85,7 +85,7 @@ autoscript (ulong addr)
        len = ntohl(hdr->ih_size);
 
        if (verify) {
-               if (crc32(0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
+               if (crc32(0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
                        puts ("Bad data crc\n");
                        return 1;
                }
index daa54e77692f2936047dde1612bee1a9cfc0a357..ad412c81eb8d39ee893ffa166af533156922eeda 100644 (file)
 #include <bmp_layout.h>
 #include <command.h>
 #include <asm/byteorder.h>
+#include <malloc.h>
 
 #if (CONFIG_COMMANDS & CFG_CMD_BMP)
 
 static int bmp_info (ulong addr);
 static int bmp_display (ulong addr, int x, int y);
 
+int gunzip(void *, int, unsigned char *, unsigned long *);
+
 /*
  * Subroutine:  do_bmp
  *
@@ -100,15 +103,64 @@ U_BOOT_CMD(
 static int bmp_info(ulong addr)
 {
        bmp_image_t *bmp=(bmp_image_t *)addr;
+#ifdef CONFIG_VIDEO_BMP_GZIP
+       unsigned char *dst = NULL;
+       ulong len;
+#endif /* CONFIG_VIDEO_BMP_GZIP */
+
        if (!((bmp->header.signature[0]=='B') &&
              (bmp->header.signature[1]=='M'))) {
+
+#ifdef CONFIG_VIDEO_BMP_GZIP
+               /*
+                * Decompress bmp image
+                */
+               len = CFG_VIDEO_LOGO_MAX_SIZE;
+               dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+               if (dst == NULL) {
+                       printf("Error: malloc in gunzip failed!\n");
+                       return(1);
+               }
+               if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)addr, &len) != 0) {
+                       printf("There is no valid bmp file at the given address\n");
+                       return(1);
+               }
+               if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
+                       printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
+               }
+
+               /*
+                * Set addr to decompressed image
+                */
+               bmp = (bmp_image_t *)dst;
+
+               /*
+                * Check for bmp mark 'BM'
+                */
+               if (!((bmp->header.signature[0] == 'B') &&
+                     (bmp->header.signature[1] == 'M'))) {
+                       printf("There is no valid bmp file at the given address\n");
+                       free(dst);
+                       return(1);
+               }
+
+               printf("Gzipped BMP image detected!\n");
+#else /* CONFIG_VIDEO_BMP_GZIP */
                printf("There is no valid bmp file at the given address\n");
                return(1);
+#endif /* CONFIG_VIDEO_BMP_GZIP */
        }
        printf("Image size    : %d x %d\n", le32_to_cpu(bmp->header.width),
               le32_to_cpu(bmp->header.height));
        printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count));
        printf("Compression   : %d\n", le32_to_cpu(bmp->header.compression));
+
+#ifdef CONFIG_VIDEO_BMP_GZIP
+       if (dst) {
+               free(dst);
+       }
+#endif /* CONFIG_VIDEO_BMP_GZIP */
+
        return(0);
 }
 
index 6a5576cd9f39a1dc194d093558b163b3e22d8233..8599a49d057b954f11d0cb73deb2f8124c2eeb78 100644 (file)
 #include <environment.h>
 #include <asm/byteorder.h>
 
+#ifdef CONFIG_OF_FLAT_TREE
+#include <ft_build.h>
+#endif
+
  /*cmd_boot.c*/
  extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
@@ -197,7 +201,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)data, len) != checksum) {
+       if (crc32 (0, (uchar *)data, len) != checksum) {
                puts ("Bad Header Checksum\n");
                SHOW_BOOT_PROGRESS (-2);
                return 1;
@@ -221,7 +225,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (verify) {
                puts ("   Verifying Checksum ... ");
-               if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
+               if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
                        printf ("Bad Data CRC\n");
                        SHOW_BOOT_PROGRESS (-3);
                        return 1;
@@ -489,6 +493,11 @@ fixup_silent_linux ()
 }
 #endif /* CONFIG_SILENT_CONSOLE */
 
+#ifdef CONFIG_OF_FLAT_TREE
+extern const unsigned char oftree_dtb[];
+extern const unsigned int oftree_dtb_len;
+#endif
+
 #ifdef CONFIG_PPC
 static void
 do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
@@ -511,6 +520,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
        bd_t    *kbd;
        void    (*kernel)(bd_t *, ulong, ulong, ulong, ulong);
        image_header_t *hdr = &header;
+#ifdef CONFIG_OF_FLAT_TREE
+       char    *of_flat_tree;
+#endif
 
        if ((s = getenv ("initrd_high")) != NULL) {
                /* a value of "no" or a similar string will act like 0,
@@ -621,7 +633,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
                checksum = hdr->ih_hcrc;
                hdr->ih_hcrc = 0;
 
-               if (crc32 (0, (char *)data, len) != checksum) {
+               if (crc32 (0, (uchar *)data, len) != checksum) {
                        puts ("Bad Header Checksum\n");
                        SHOW_BOOT_PROGRESS (-11);
                        do_reset (cmdtp, flag, argc, argv);
@@ -649,13 +661,13 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 
                                if (chunk > CHUNKSZ)
                                        chunk = CHUNKSZ;
-                               csum = crc32 (csum, (char *)cdata, chunk);
+                               csum = crc32 (csum, (uchar *)cdata, chunk);
                                cdata += chunk;
 
                                WATCHDOG_RESET();
                        }
 #else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-                       csum = crc32 (0, (char *)data, len);
+                       csum = crc32 (0, (uchar *)data, len);
 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
 
                        if (csum != hdr->ih_dcrc) {
@@ -776,15 +788,26 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
                initrd_end = 0;
        }
 
+#ifdef CONFIG_OF_FLAT_TREE
+       if (initrd_start == 0)
+               of_flat_tree = (char *)(((ulong)kbd - OF_FLAT_TREE_MAX_SIZE -
+                                       sizeof(bd_t)) & ~0xF);
+       else
+               of_flat_tree = (char *)((initrd_start - OF_FLAT_TREE_MAX_SIZE -
+                                       sizeof(bd_t)) & ~0xF);
+#endif
 
        debug ("## Transferring control to Linux (at address %08lx) ...\n",
                (ulong)kernel);
 
        SHOW_BOOT_PROGRESS (15);
 
+#ifndef CONFIG_OF_FLAT_TREE
+
 #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
        unlock_ram_in_cache();
 #endif
+
        /*
         * Linux Kernel Parameters:
         *   r3: ptr to board info data
@@ -794,6 +817,25 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
         *   r7: End   of command line string
         */
        (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+
+#else
+       ft_setup(of_flat_tree, OF_FLAT_TREE_MAX_SIZE, kbd);
+       /* ft_dump_blob(of_flat_tree); */
+
+#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
+       unlock_ram_in_cache();
+#endif
+       /*
+        * Linux Kernel Parameters:
+        *   r3: ptr to OF flat tree, followed by the board info data
+        *   r4: initrd_start or 0 if no initrd
+        *   r5: initrd_end - unused if r4 is 0
+        *   r6: Start of command line string
+        *   r7: End   of command line string
+        */
+       (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end, cmd_start, cmd_end);
+
+#endif
 }
 #endif /* CONFIG_PPC */
 
@@ -1037,7 +1079,7 @@ static int image_info (ulong addr)
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)data, len) != checksum) {
+       if (crc32 (0, (uchar *)data, len) != checksum) {
                puts ("   Bad Header Checksum\n");
                return 1;
        }
@@ -1049,7 +1091,7 @@ static int image_info (ulong addr)
        len  = ntohl(hdr->ih_size);
 
        puts ("   Verifying Checksum ... ");
-       if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
+       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
                puts ("   Bad Data CRC\n");
                return 1;
        }
@@ -1094,7 +1136,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        checksum = ntohl(header.ih_hcrc);
                        header.ih_hcrc = 0;
 
-                       if (crc32 (0, (char *)&header, sizeof(image_header_t))
+                       if (crc32 (0, (uchar *)&header, sizeof(image_header_t))
                            != checksum)
                                goto next_sector;
 
@@ -1105,7 +1147,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        len  = ntohl(hdr->ih_size);
 
                        puts ("   Verifying Checksum ... ");
-                       if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
+                       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
                                puts ("   Bad Data CRC\n");
                        }
                        puts ("OK\n");
index e5db1bc360b9eb3ece877dda24ea9fa8be2d955a..5e9bea30450683eea1d22c91d920676c3e5fe4e6 100644 (file)
@@ -143,7 +143,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        cmd ? "read" : "write", curr_device, off, size);
 
                ret = doc_rw(doc_dev_desc + curr_device, cmd, off, size,
-                            &total, (u_char*)addr);
+                            (size_t *)&total, (u_char*)addr);
 
                printf ("%d bytes %s: %s\n", total, cmd ? "read" : "write",
                        ret ? "ERROR" : "OK");
@@ -304,12 +304,12 @@ int doc_rw (struct DiskOnChip* this, int cmd,
 
                if (cmd)
                        ret = doc_read_ecc(this, from, len,
-                                          &n, (u_char*)buf,
-                                          noecc ? NULL : eccbuf);
+                                          (size_t *)&n, (u_char*)buf,
+                                          noecc ? (uchar *)NULL : (uchar *)eccbuf);
                else
                        ret = doc_write_ecc(this, from, len,
-                                           &n, (u_char*)buf,
-                                           noecc ? NULL : eccbuf);
+                                           (size_t *)&n, (u_char*)buf,
+                                           noecc ? (uchar *)NULL : (uchar *)eccbuf);
 
                if (ret)
                        break;
@@ -804,7 +804,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
                /* Check for ANAND header first. Then can whinge if it's found but later
                   checks fail */
                if ((ret = doc_read_ecc(nftl->mtd, block * nftl->EraseSize, SECTORSIZE,
-                                       &retlen, buf, NULL))) {
+                                       (size_t *)&retlen, buf, NULL))) {
                        static int warncount = 5;
 
                        if (warncount) {
@@ -829,7 +829,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
                /* To be safer with BIOS, also use erase mark as discriminant */
                if ((ret = doc_read_oob(nftl->mtd, block * nftl->EraseSize + SECTORSIZE + 8,
-                               8, &retlen, (char *)&h1) < 0)) {
+                               8, (size_t *)&retlen, (uchar *)&h1) < 0)) {
 #ifdef NFTL_DEBUG
                        printf("ANAND header found at 0x%x, but OOB data read failed\n",
                               block * nftl->EraseSize);
@@ -902,7 +902,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
                                /* read one sector for every SECTORSIZE of blocks */
                                if ((ret = doc_read_ecc(nftl->mtd, block * nftl->EraseSize +
                                                       i + SECTORSIZE, SECTORSIZE,
-                                                      &retlen, buf, (char *)&oob)) < 0) {
+                                                      (size_t *)&retlen, buf, (uchar *)&oob)) < 0) {
                                        puts ("Read of bad sector table failed\n");
                                        return -1;
                                }
index af836cd614ef4e61ad2eab6f137a914c69be9ddc..927e22f0300e89cad388976accbeb4760ea7e274 100644 (file)
@@ -231,7 +231,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        return(1);
                }
 
-               if (strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) {
+               if (strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) {
                        printf ("\n** Invalid partition type \"%.32s\""
                                " (expect \"" BOOT_PART_TYPE "\")\n",
                                info.type);
index c4b73929493b1cc487895011709434caabee9cbf..9a01e7df8b6b4a68f29f51db07e5ff2fc63dfc8f 100644 (file)
@@ -69,7 +69,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
        unsigned int i;
        int rc;
 
-       dataptr = fpgadata;
+       dataptr = (unsigned char *)fpgadata;
 
 #if CFG_FPGA_XILINX
        /* skip the first bytes of the bitsteam, their meaning is unknown */
index 2e44c7fde1e674e94df03381a35d279d29e49a29..c543bb5314892df8799afc754f8dfd4a54774107 100644 (file)
@@ -461,7 +461,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
         */
        do {
                printf("%08lx:", addr);
-               if(i2c_read(chip, addr, alen, (char *)&data, size) != 0) {
+               if(i2c_read(chip, addr, alen, (uchar *)&data, size) != 0) {
                        puts ("\nError reading the chip,\n");
                } else {
                        data = cpu_to_be32(data);
@@ -510,7 +510,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
                                 */
                                reset_cmd_timeout();
 #endif
-                               if(i2c_write(chip, addr, alen, (char *)&data, size) != 0) {
+                               if(i2c_write(chip, addr, alen, (uchar *)&data, size) != 0) {
                                        puts ("Error writing the chip.\n");
                                }
 #ifdef CFG_EEPROM_PAGE_WRITE_DELAY_MS
index 1adfe2bfaf8b49154c1db828cdb0cff81626b4cc..6663dea2f4af9d734016f56ffa5152dab76a7e02 100644 (file)
@@ -417,8 +417,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                SHOW_BOOT_PROGRESS (-1);
                return 1;
        }
-       if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
-           (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
+       if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
+           (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
                printf ("\n** Invalid partition type \"%.32s\""
                        " (expect \"" BOOT_PART_TYPE "\")\n",
                        info.type);
@@ -450,7 +450,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
+       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
                puts ("\n** Bad Header Checksum **\n");
                SHOW_BOOT_PROGRESS (-2);
                return 1;
index 9db5f2cc46cacc78995d2432210b13bce0d4db6d..559d7b4c300dacfd2826f146c0a33447203f6387 100644 (file)
@@ -318,11 +318,20 @@ int
 do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        uint rcode = 0;
+       iopin_t iopin;
        static uint port = 0;
        static uint pin = 0;
        static uint value = 0;
-       static enum { DIR, PAR, SOR, ODR, DAT, INT } cmd = DAT;
-       iopin_t iopin;
+       static enum {
+               DIR,
+               PAR,
+               SOR,
+               ODR,
+               DAT,
+#if defined(CONFIG_8xx)
+               INT
+#endif
+       } cmd = DAT;
 
        if (argc != 5) {
                puts ("iopset PORT PIN CMD VALUE\n");
@@ -374,6 +383,7 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        if (rcode == 0) {
                iopin.port = port;
                iopin.pin = pin;
+               iopin.flag = 0;
                switch (cmd) {
                case DIR:
                        if (value)
index b85db69e131361c62267bbb7ed11bedbd2a806ac..749849711a007fcfc6817ddca3144e2e0c0dcfb2 100644 (file)
@@ -166,7 +166,7 @@ load_serial (ulong offset)
                    if (addr2info(store_addr)) {
                        int rc;
 
-                       rc = flash_write((uchar *)binbuf,store_addr,binlen);
+                       rc = flash_write((char *)binbuf,store_addr,binlen);
                        if (rc != 0) {
                                flash_perror (rc);
                                return (~0);
index 57ef48461a537b12228ab830fe27db794d8c51c7..efc9689c298b55675bde676c5708bb66917c9b3d 100644 (file)
@@ -179,7 +179,7 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        case 2:
                if (strcmp(argv[1],"show") == 0) {
                        for (i=0; i < (log_size&LOGBUFF_MASK); i++) {
-                               s = log_buf+((log_start+i)&LOGBUFF_MASK);
+                               s = (char *)log_buf+((log_start+i)&LOGBUFF_MASK);
                                putc (*s);
                        }
                        return 0;
index bafb1d6792d96d657e2badb149c0c89f4eb6433c..0f4f9b73df91f4049a4b7995d9d4992266a4385d 100644 (file)
@@ -179,7 +179,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
 #endif
                puts ("    ");
-               cp = linebuf;
+               cp = (u_char *)linebuf;
                for (i=0; i<linebytes; i++) {
                        if ((*cp < 0x20) || (*cp > 0x7e))
                                putc ('.');
@@ -430,7 +430,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                puts ("Copy to Flash... ");
 
-               rc = flash_write ((uchar *)addr, dest, count*size);
+               rc = flash_write ((char *)addr, dest, count*size);
                if (rc != 0) {
                        flash_perror (rc);
                        return (1);
index 5648ab21785dee96053a6b85f3620924d4d8f610..b0c01d1205aa50e45ea0e78964a5a3a0f3fd9b1f 100644 (file)
@@ -200,12 +200,12 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        /* read out-of-band data */
                        if (cmd & NANDRW_READ) {
                                ret = nand_read_oob(nand_dev_desc + curr_device,
-                                                   off, size, &total,
+                                                   off, size, (size_t *)&total,
                                                    (u_char*)addr);
                        }
                        else {
                                ret = nand_write_oob(nand_dev_desc + curr_device,
-                                                    off, size, &total,
+                                                    off, size, (size_t *)&total,
                                                     (u_char*)addr);
                        }
                        return ret;
@@ -241,7 +241,7 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        curr_device, off, size);
 
                ret = nand_rw(nand_dev_desc + curr_device, cmd, off, size,
-                            &total, (u_char*)addr);
+                            (size_t *)&total, (u_char*)addr);
 
                printf (" %d bytes %s: %s\n", total,
                        (cmd & NANDRW_READ) ? "read" : "written",
@@ -401,7 +401,7 @@ U_BOOT_CMD(
  */
 int check_block (struct nand_chip *nand, unsigned long pos)
 {
-       int retlen;
+       size_t retlen;
        uint8_t oob_data;
        uint16_t oob_data16[6];
        int page0 = pos & (-nand->erasesize);
@@ -423,9 +423,9 @@ int check_block (struct nand_chip *nand, unsigned long pos)
                        return 1;
        } else {
                /* Note - bad block marker can be on first or second page */
-               if (nand_read_oob(nand, page0 + badpos, 1, &retlen, &oob_data)
+               if (nand_read_oob(nand, page0 + badpos, 1, &retlen, (unsigned char *)&oob_data)
                    || oob_data != 0xff
-                   || nand_read_oob (nand, page1 + badpos, 1, &retlen, &oob_data)
+                   || nand_read_oob (nand, page1 + badpos, 1, &retlen, (unsigned char *)&oob_data)
                    || oob_data != 0xff)
                        return 1;
        }
@@ -501,11 +501,11 @@ int nand_rw (struct nand_chip* nand, int cmd,
                if (cmd & NANDRW_READ) {
                        ret = nand_read_ecc(nand, start,
                                           min(len, eblk + erasesize - start),
-                                          &n, (u_char*)buf, eccbuf);
+                                          (size_t *)&n, (u_char*)buf, (u_char *)eccbuf);
                } else {
                        ret = nand_write_ecc(nand, start,
                                            min(len, eblk + erasesize - start),
-                                           &n, (u_char*)buf, eccbuf);
+                                           (size_t *)&n, (u_char*)buf, (u_char *)eccbuf);
                }
 
                if (ret)
@@ -1591,7 +1591,7 @@ int nand_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean)
                                        l = NAND_JFFS2_OOB16_FSDALEN;
                                }
 
-                               ret = nand_write_oob(nand, ofs + p, l, &n,
+                               ret = nand_write_oob(nand, ofs + p, l, (size_t *)&n,
                                                     (u_char *)&clean_marker);
                                /* quit here if write failed */
                                if (ret)
index 578b0ca93608ba28b4ff9a70f4b7138ffd75878b..1babffec2e0a8fc322b2ac462635e41bef4eb57a 100644 (file)
@@ -124,7 +124,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                        for (nxt=j; env_get_char(nxt) != '\0'; ++nxt)
                                ;
-                       k = envmatch(name, j);
+                       k = envmatch((uchar *)name, j);
                        if (k < 0) {
                                continue;
                        }
@@ -157,7 +157,7 @@ int _do_setenv (int flag, int argc, char *argv[])
        int   i, len, oldval;
        int   console = -1;
        uchar *env, *nxt = NULL;
-       uchar *name;
+       char *name;
        bd_t *bd = gd->bd;
 
        uchar *env_data = env_get_addr(0);
@@ -174,7 +174,7 @@ int _do_setenv (int flag, int argc, char *argv[])
        for (env=env_data; *env; env=nxt+1) {
                for (nxt=env; *nxt; ++nxt)
                        ;
-               if ((oldval = envmatch(name, env-env_data)) >= 0)
+               if ((oldval = envmatch((uchar *)name, env-env_data)) >= 0)
                        break;
        }
 
@@ -191,7 +191,7 @@ int _do_setenv (int flag, int argc, char *argv[])
                if ( (strcmp (name, "serial#") == 0) ||
                    ((strcmp (name, "ethaddr") == 0)
 #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
-                    && (strcmp (env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)
+                    && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)
 #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */
                    ) ) {
                        printf ("Can't overwrite \"%s\"\n", name);
@@ -483,7 +483,7 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  * or NULL if not found
  */
 
-char *getenv (uchar *name)
+char *getenv (char *name)
 {
        int i, nxt;
 
@@ -497,15 +497,15 @@ char *getenv (uchar *name)
                                return (NULL);
                        }
                }
-               if ((val=envmatch(name, i)) < 0)
+               if ((val=envmatch((uchar *)name, i)) < 0)
                        continue;
-               return (env_get_addr(val));
+               return ((char *)env_get_addr(val));
        }
 
        return (NULL);
 }
 
-int getenv_r (uchar *name, uchar *buf, unsigned len)
+int getenv_r (char *name, char *buf, unsigned len)
 {
        int i, nxt;
 
@@ -517,7 +517,7 @@ int getenv_r (uchar *name, uchar *buf, unsigned len)
                                return (-1);
                        }
                }
-               if ((val=envmatch(name, i)) < 0)
+               if ((val=envmatch((uchar *)name, i)) < 0)
                        continue;
                /* found; copy out */
                n = 0;
index 31f2ba2f69682a5029063278edddf712c015dff2..62446d4efebb2fdff4a3fe819895673e4212b08f 100644 (file)
@@ -2681,7 +2681,7 @@ static void print_fixed (volatile uchar *p)
 #define        MAX_IDENT_FIELDS        4
 
 static uchar *known_cards[] = {
-       "ARGOSY PnPIDE D5",
+       (uchar *)"ARGOSY PnPIDE D5",
        NULL
 };
 
@@ -2722,12 +2722,12 @@ static int identify  (volatile uchar *p)
                else
                        break;
        }
-       puts (id_str);
+       puts ((char *)id_str);
        putc ('\n');
 
        for (card=known_cards; *card; ++card) {
                debug ("## Compare against \"%s\"\n", *card);
-               if (strcmp(*card, id_str) == 0) {       /* found! */
+               if (strcmp((char *)*card, (char *)id_str) == 0) {       /* found! */
                        debug ("## CARD FOUND ##\n");
                        return (1);
                }
index ec53790f8134be96852e25b1126abd5cb477e987..e8048611f93b2ff615d18cc41807a2cb6610677b 100644 (file)
@@ -247,8 +247,8 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                printf("error reading partinfo\n");
                return 1;
        }
-       if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
-           (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
+       if ((strncmp((char *)(info.type), BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
+           (strncmp((char *)(info.type), BOOT_PART_COMP, sizeof(info.type)) != 0)) {
                printf ("\n** Invalid partition type \"%.32s\""
                        " (expect \"" BOOT_PART_TYPE "\")\n",
                        info.type);
@@ -277,7 +277,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
+       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
                puts ("\n** Bad Header Checksum **\n");
                return 1;
        }
index 7b6faf79c5a3d3863b47623e9436192b9e08a048..a6fdf7fddbd0924e7d10c0a9171df35ec88b98c9 100644 (file)
@@ -119,7 +119,7 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                printf("Error with the SPI transaction.\n");
                rcode = 1;
        } else {
-               cp = din;
+               cp = (char *)din;
                for(j = 0; j < ((bitlen + 7) / 8); j++) {
                        printf("%02X", *cp++);
                }
index 0738f55303352783671b3061ed79f686a9eec279..fdfd042acaa7582596bfa2e0c6ead6f483ac2fe2 100644 (file)
@@ -362,15 +362,15 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (get_partition_info (stor_dev, part, &info)) {
                /* try to boot raw .... */
-               strncpy(&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE));
-               strncpy(&info.name[0], "Raw", 4);
+               strncpy((char *)&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE));
+               strncpy((char *)&info.name[0], "Raw", 4);
                info.start=0;
                info.blksz=0x200;
                info.size=2880;
                printf("error reading partinfo...try to boot raw\n");
        }
-       if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
-           (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
+       if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
+           (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
                printf ("\n** Invalid partition type \"%.32s\""
                        " (expect \"" BOOT_PART_TYPE "\")\n",
                        info.type);
@@ -398,7 +398,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
+       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
                puts ("\n** Bad Header Checksum **\n");
                return 1;
        }
index 9be4cc1dbf58e1c2d688a312bf3367d566e819d9..3201135ea2eddbe7b46c427c7f1deef21d9d7d32 100644 (file)
@@ -283,7 +283,7 @@ int env_complete(char *var, int maxv, char *cmdv[], int bufsz, char *buf)
                for (nxt=i; env_get_char(nxt) != '\0'; ++nxt)
                        ;
 
-               lval = env_get_addr(i);
+               lval = (char *)env_get_addr(i);
                rval = strchr(lval, '=');
                if (rval != NULL) {
                        vallen = rval - lval;
index d6257d07bd097db647a8e7b8d503c00e660a68e4..a2ea9c41406842d7acbc404aef25538f19d75df7 100644 (file)
@@ -202,7 +202,7 @@ int saveenv(void)
        debug (" %08lX ... %08lX ...",
                (ulong)&(flash_addr_new->data),
                sizeof(env_ptr->data)+(ulong)&(flash_addr_new->data));
-       if ((rc = flash_write(env_ptr->data,
+       if ((rc = flash_write((char *)env_ptr->data,
                        (ulong)&(flash_addr_new->data),
                        sizeof(env_ptr->data))) ||
            (rc = flash_write((char *)&(env_ptr->crc),
@@ -291,7 +291,7 @@ int saveenv(void)
        ulong   flash_offset;
        uchar   env_buffer[CFG_ENV_SECT_SIZE];
 #else
-       uchar *env_buffer = (char *)env_ptr;
+       uchar *env_buffer = (uchar *)env_ptr;
 #endif /* CFG_ENV_SECT_SIZE */
        int rcode = 0;
 
@@ -337,7 +337,7 @@ int saveenv(void)
                return 1;
 
        puts ("Writing to Flash... ");
-       rc = flash_write(env_buffer, flash_sect_addr, len);
+       rc = flash_write((char *)env_buffer, flash_sect_addr, len);
        if (rc != 0) {
                flash_perror (rc);
                rcode = 1;
index 2fb3319d40f4f213ba4265db1446469c417065b5..a64bc985299500bcd2f995ba14740c9af939bfdd 100644 (file)
@@ -135,7 +135,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 */
@@ -174,7 +174,7 @@ flash_write (uchar *src, ulong addr, ulong cnt)
                len = info->start[0] + info->size - addr;
                if (len > cnt)
                        len = cnt;
-               if ((i = write_buff(info, src, addr, len)) != 0) {
+               if ((i = write_buff(info, (uchar *)src, addr, len)) != 0) {
                        return (i);
                }
                cnt  -= len;
index c41c6f89a74eb281f5dfc06f82546cf50622cf6e..02d3e42b3bbf076db365aba7d9a59c104d52ff9b 100644 (file)
@@ -53,8 +53,8 @@ static int next_desc = FPGA_INVALID_DEVICE;
 static fpga_desc desc_table[CONFIG_MAX_FPGA_DEVICES];
 
 /* Local static functions */
-static const fpga_desc * const fpga_get_desc( int devnum );
-static const fpga_desc * const fpga_validate( int devnum, void *buf,
+static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_get_desc( int devnum );
+static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf,
                                         size_t bsize, char *fn );
 static int fpga_dev_info( int devnum );
 
@@ -82,7 +82,7 @@ static void fpga_no_sup( char *fn, char *msg )
 /* fpga_get_desc
  *     map a device number to a descriptor
  */
-static const fpga_desc * const fpga_get_desc( int devnum )
+static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_get_desc( int devnum )
 {
        fpga_desc *desc = (fpga_desc * )NULL;
 
@@ -99,10 +99,10 @@ static const fpga_desc * const fpga_get_desc( int devnum )
 /* fpga_validate
  *     generic parameter checking code
  */
-static const fpga_desc * const fpga_validate( int devnum, void *buf,
+static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf,
                                         size_t bsize, char *fn )
 {
-       const fpga_desc * const desc = fpga_get_desc( devnum );
+       fpga_desc * desc = fpga_get_desc( devnum );
 
        if ( !desc ) {
                printf( "%s: Invalid device number %d\n", fn, devnum );
@@ -147,7 +147,7 @@ static int fpga_dev_info( int devnum )
                        printf( "Altera Device\nDescriptor @ 0x%p\n", desc );
                        ret_val = altera_info( desc->devdesc );
 #else
-                       fpga_no_sup( __FUNCTION__, "Altera devices" );
+                       fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
 #endif
                        break;
                default:
@@ -185,7 +185,7 @@ int fpga_reloc( fpga_type devtype, void *desc, ulong reloc_off )
 #if CONFIG_FPGA & CFG_FPGA_ALTERA
                ret_val = altera_reloc( desc, reloc_off );
 #else
-               fpga_no_sup( __FUNCTION__, "Altera devices" );
+               fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
 #endif
                break;
        default:
@@ -216,7 +216,7 @@ void fpga_init( ulong reloc_off )
 /* fpga_count
  * Basic interface function to get the current number of devices available.
  */
-const int fpga_count( void )
+int fpga_count( void )
 {
        return next_desc;
 }
@@ -263,7 +263,7 @@ int fpga_add( fpga_type devtype, void *desc )
 int fpga_load( int devnum, void *buf, size_t bsize )
 {
        int ret_val = FPGA_FAIL;           /* assume failure */
-       const fpga_desc * const desc = fpga_validate( devnum, buf, bsize, __FUNCTION__ );
+       fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ );
 
        if ( desc ) {
                switch ( desc->devtype ) {
@@ -278,7 +278,7 @@ int fpga_load( int devnum, void *buf, size_t bsize )
 #if CONFIG_FPGA & CFG_FPGA_ALTERA
                        ret_val = altera_load( desc->devdesc, buf, bsize );
 #else
-                       fpga_no_sup( __FUNCTION__, "Altera devices" );
+                       fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
 #endif
                        break;
                default:
@@ -296,7 +296,7 @@ int fpga_load( int devnum, void *buf, size_t bsize )
 int fpga_dump( int devnum, void *buf, size_t bsize )
 {
        int ret_val = FPGA_FAIL;           /* assume failure */
-       const fpga_desc * const desc = fpga_validate( devnum, buf, bsize, __FUNCTION__ );
+       fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ );
 
        if ( desc ) {
                switch ( desc->devtype ) {
@@ -311,7 +311,7 @@ int fpga_dump( int devnum, void *buf, size_t bsize )
 #if CONFIG_FPGA & CFG_FPGA_ALTERA
                        ret_val = altera_dump( desc->devdesc, buf, bsize );
 #else
-                       fpga_no_sup( __FUNCTION__, "Altera devices" );
+                       fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
 #endif
                        break;
                default:
diff --git a/common/ft_build.c b/common/ft_build.c
new file mode 100644 (file)
index 0000000..624a1e1
--- /dev/null
@@ -0,0 +1,695 @@
+/*
+ * OF flat tree builder
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <environment.h>
+
+#include <asm/errno.h>
+#include <stddef.h>
+
+#include <ft_build.h>
+
+#ifdef CONFIG_OF_FLAT_TREE
+
+/* align addr on a size boundary - adjust address up if needed -- Cort */
+#define _ALIGN(addr,size)       (((addr)+(size)-1)&(~((size)-1)))
+
+static void ft_put_word(struct ft_cxt *cxt, u32 v)
+{
+       if (cxt->overflow)      /* do nothing */
+               return;
+
+       /* check for overflow */
+       if (cxt->p + 4 > cxt->pstr) {
+               cxt->overflow = 1;
+               return;
+       }
+
+       *(u32 *) cxt->p = cpu_to_be32(v);
+       cxt->p += 4;
+}
+
+static inline void ft_put_bin(struct ft_cxt *cxt, const void *data, int sz)
+{
+       u8 *p;
+
+       if (cxt->overflow)      /* do nothing */
+               return;
+
+       /* next pointer pos */
+       p = (u8 *) _ALIGN((unsigned long)cxt->p + sz, 4);
+
+       /* check for overflow */
+       if (p > cxt->pstr) {
+               cxt->overflow = 1;
+               return;
+       }
+
+       memcpy(cxt->p, data, sz);
+       if ((sz & 3) != 0)
+               memset(cxt->p + sz, 0, 4 - (sz & 3));
+       cxt->p = p;
+}
+
+void ft_begin_node(struct ft_cxt *cxt, const char *name)
+{
+       ft_put_word(cxt, OF_DT_BEGIN_NODE);
+       ft_put_bin(cxt, name, strlen(name) + 1);
+}
+
+void ft_end_node(struct ft_cxt *cxt)
+{
+       ft_put_word(cxt, OF_DT_END_NODE);
+}
+
+void ft_nop(struct ft_cxt *cxt)
+{
+       ft_put_word(cxt, OF_DT_NOP);
+}
+
+static int lookup_string(struct ft_cxt *cxt, const char *name)
+{
+       u8 *p;
+
+       p = cxt->pstr;
+       while (p < cxt->pstr_begin) {
+               if (strcmp(p, name) == 0)
+                       return p - cxt->p_begin;
+               p += strlen(p) + 1;
+       }
+
+       return -1;
+}
+
+void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz)
+{
+       int len, off;
+
+       if (cxt->overflow)
+               return;
+
+       len = strlen(name) + 1;
+
+       off = lookup_string(cxt, name);
+       if (off == -1) {
+               /* check if we have space */
+               if (cxt->p + 12 + sz + len > cxt->pstr) {
+                       cxt->overflow = 1;
+                       return;
+               }
+
+               cxt->pstr -= len;
+               memcpy(cxt->pstr, name, len);
+               off = cxt->pstr - cxt->p_begin;
+       }
+
+       /* now put offset from beginning of *STRUCTURE* */
+       /* will be fixed up at the end */
+       ft_put_word(cxt, OF_DT_PROP);
+       ft_put_word(cxt, sz);
+       ft_put_word(cxt, off);
+       ft_put_bin(cxt, data, sz);
+}
+
+void ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str)
+{
+       ft_prop(cxt, name, str, strlen(str) + 1);
+}
+
+void ft_prop_int(struct ft_cxt *cxt, const char *name, int val)
+{
+       u32 v = cpu_to_be32((u32) val);
+
+       ft_prop(cxt, name, &v, 4);
+}
+
+/* start construction of the flat OF tree */
+void ft_begin(struct ft_cxt *cxt, void *blob, int max_size)
+{
+       struct boot_param_header *bph = blob;
+       u32 off;
+
+       /* clear the cxt */
+       memset(cxt, 0, sizeof(*cxt));
+
+       cxt->bph = bph;
+       cxt->max_size = max_size;
+
+       /* zero everything in the header area */
+       memset(bph, 0, sizeof(*bph));
+
+       bph->magic = cpu_to_be32(OF_DT_HEADER);
+       bph->version = cpu_to_be32(0x10);
+       bph->last_comp_version = cpu_to_be32(0x10);
+
+       /* start pointers */
+       cxt->pres_begin = (u8 *) _ALIGN((unsigned long)(bph + 1), 8);
+       cxt->pres = cxt->pres_begin;
+
+       off = (unsigned long)cxt->pres_begin - (unsigned long)bph;
+       bph->off_mem_rsvmap = cpu_to_be32(off);
+
+       ((u64 *) cxt->pres)[0] = 0;     /* phys = 0, size = 0, terminate */
+       ((u64 *) cxt->pres)[1] = 0;
+
+       cxt->p_anchor = cxt->pres + 16; /* over the terminator */
+}
+
+/* add a reserver physical area to the rsvmap */
+void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
+{
+       ((u64 *) cxt->pres)[0] = cpu_to_be64(physaddr); /* phys = 0, size = 0, terminate */
+       ((u64 *) cxt->pres)[1] = cpu_to_be64(size);
+
+       cxt->pres += 18;        /* advance */
+
+       ((u64 *) cxt->pres)[0] = 0;     /* phys = 0, size = 0, terminate */
+       ((u64 *) cxt->pres)[1] = 0;
+
+       /* keep track of size */
+       cxt->res_size = cxt->pres + 16 - cxt->pres_begin;
+
+       cxt->p_anchor = cxt->pres + 16; /* over the terminator */
+}
+
+void ft_begin_tree(struct ft_cxt *cxt)
+{
+       cxt->p_begin = cxt->p_anchor;
+       cxt->pstr_begin = (char *)cxt->bph + cxt->max_size;     /* point at the end */
+
+       cxt->p = cxt->p_begin;
+       cxt->pstr = cxt->pstr_begin;
+}
+
+int ft_end_tree(struct ft_cxt *cxt)
+{
+       struct boot_param_header *bph = cxt->bph;
+       int off, sz, sz1;
+       u32 tag, v;
+       u8 *p;
+
+       ft_put_word(cxt, OF_DT_END);
+
+       if (cxt->overflow)
+               return -ENOMEM;
+
+       /* size of the areas */
+       cxt->struct_size = cxt->p - cxt->p_begin;
+       cxt->strings_size = cxt->pstr_begin - cxt->pstr;
+
+       /* the offset we must move */
+       off = (cxt->pstr_begin - cxt->p_begin) - cxt->strings_size;
+
+       /* the new strings start */
+       cxt->pstr_begin = cxt->p_begin + cxt->struct_size;
+
+       /* move the whole string area */
+       memmove(cxt->pstr_begin, cxt->pstr, cxt->strings_size);
+
+       /* now perform the fixup of the strings */
+       p = cxt->p_begin;
+       while ((tag = be32_to_cpu(*(u32 *) p)) != OF_DT_END) {
+               p += 4;
+
+               if (tag == OF_DT_BEGIN_NODE) {
+                       p = (u8 *) _ALIGN((unsigned long)p + strlen(p) + 1, 4);
+                       continue;
+               }
+
+               if (tag == OF_DT_END_NODE || tag == OF_DT_NOP)
+                       continue;
+
+               if (tag != OF_DT_PROP)
+                       return -EINVAL;
+
+               sz = be32_to_cpu(*(u32 *) p);
+               p += 4;
+
+               v = be32_to_cpu(*(u32 *) p);
+               v -= off;
+               *(u32 *) p = cpu_to_be32(v);    /* move down */
+               p += 4;
+
+               p = (u8 *) _ALIGN((unsigned long)p + sz, 4);
+       }
+
+       /* fix sizes */
+       p = (char *)cxt->bph;
+       sz = (cxt->pstr_begin + cxt->strings_size) - p;
+       sz1 = _ALIGN(sz, 16);   /* align at 16 bytes */
+       if (sz != sz1)
+               memset(p + sz, 0, sz1 - sz);
+       bph->totalsize = cpu_to_be32(sz1);
+       bph->off_dt_struct = cpu_to_be32(cxt->p_begin - p);
+       bph->off_dt_strings = cpu_to_be32(cxt->pstr_begin - p);
+
+       /* the new strings start */
+       cxt->pstr_begin = cxt->p_begin + cxt->struct_size;
+       cxt->pstr = cxt->pstr_begin + cxt->strings_size;
+
+       return 0;
+}
+
+/**********************************************************************/
+
+static inline int isprint(int c)
+{
+       return c >= 0x20 && c <= 0x7e;
+}
+
+static int is_printable_string(const void *data, int len)
+{
+       const char *s = data;
+       const char *ss;
+
+       /* zero length is not */
+       if (len == 0)
+               return 0;
+
+       /* must terminate with zero */
+       if (s[len - 1] != '\0')
+               return 0;
+
+       ss = s;
+       while (*s && isprint(*s))
+               s++;
+
+       /* not zero, or not done yet */
+       if (*s != '\0' || (s + 1 - ss) < len)
+               return 0;
+
+       return 1;
+}
+
+static void print_data(const void *data, int len)
+{
+       int i;
+       const u8 *s;
+
+       /* no data, don't print */
+       if (len == 0)
+               return;
+
+       if (is_printable_string(data, len)) {
+               printf(" = \"%s\"", (char *)data);
+               return;
+       }
+
+       switch (len) {
+       case 1:         /* byte */
+               printf(" = <0x%02x>", (*(u8 *) data) & 0xff);
+               break;
+       case 2:         /* half-word */
+               printf(" = <0x%04x>", be16_to_cpu(*(u16 *) data) & 0xffff);
+               break;
+       case 4:         /* word */
+               printf(" = <0x%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
+               break;
+       case 8:         /* double-word */
+               printf(" = <0x%16llx>", be64_to_cpu(*(uint64_t *) data));
+               break;
+       default:                /* anything else... hexdump */
+               printf(" = [");
+               for (i = 0, s = data; i < len; i++)
+                       printf("%02x%s", s[i], i < len - 1 ? " " : "");
+               printf("]");
+
+               break;
+       }
+}
+
+void ft_dump_blob(const void *bphp)
+{
+       const struct boot_param_header *bph = bphp;
+       const uint64_t *p_rsvmap = (const uint64_t *)
+               ((const char *)bph + be32_to_cpu(bph->off_mem_rsvmap));
+       const u32 *p_struct = (const u32 *)
+               ((const char *)bph + be32_to_cpu(bph->off_dt_struct));
+       const u32 *p_strings = (const u32 *)
+               ((const char *)bph + be32_to_cpu(bph->off_dt_strings));
+       u32 tag;
+       const u32 *p;
+       const char *s, *t;
+       int depth, sz, shift;
+       int i;
+       uint64_t addr, size;
+
+       if (be32_to_cpu(bph->magic) != OF_DT_HEADER) {
+               /* not valid tree */
+               return;
+       }
+
+       depth = 0;
+       shift = 4;
+
+       for (i = 0;; i++) {
+               addr = be64_to_cpu(p_rsvmap[i * 2]);
+               size = be64_to_cpu(p_rsvmap[i * 2 + 1]);
+               if (addr == 0 && size == 0)
+                       break;
+
+               printf("/memreserve/ 0x%llx 0x%llx;\n", addr, size);
+       }
+
+       p = p_struct;
+       while ((tag = be32_to_cpu(*p++)) != OF_DT_END) {
+
+               /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */
+
+               if (tag == OF_DT_BEGIN_NODE) {
+                       s = (const char *)p;
+                       p = (u32 *) _ALIGN((unsigned long)p + strlen(s) + 1, 4);
+
+                       printf("%*s%s {\n", depth * shift, "", s);
+
+                       depth++;
+                       continue;
+               }
+
+               if (tag == OF_DT_END_NODE) {
+                       depth--;
+
+                       printf("%*s};\n", depth * shift, "");
+                       continue;
+               }
+
+               if (tag == OF_DT_NOP) {
+                       printf("%*s[NOP]\n", depth * shift, "");
+                       continue;
+               }
+
+               if (tag != OF_DT_PROP) {
+                       fprintf(stderr, "%*s ** Unknown tag 0x%08x\n",
+                               depth * shift, "", tag);
+                       break;
+               }
+               sz = be32_to_cpu(*p++);
+               s = (const char *)p_strings + be32_to_cpu(*p++);
+               t = (const char *)p;
+               p = (const u32 *)_ALIGN((unsigned long)p + sz, 4);
+               printf("%*s%s", depth * shift, "", s);
+               print_data(t, sz);
+               printf(";\n");
+       }
+}
+
+void ft_backtrack_node(struct ft_cxt *cxt)
+{
+       if (be32_to_cpu(*(u32 *) (cxt->p - 4)) != OF_DT_END_NODE)
+               return;         /* XXX only for node */
+
+       cxt->p -= 4;
+}
+
+/* note that the root node of the blob is "peeled" off */
+void ft_merge_blob(struct ft_cxt *cxt, void *blob)
+{
+       struct boot_param_header *bph = (struct boot_param_header *)blob;
+       u32 *p_struct = (u32 *) ((char *)bph + be32_to_cpu(bph->off_dt_struct));
+       u32 *p_strings =
+           (u32 *) ((char *)bph + be32_to_cpu(bph->off_dt_strings));
+       u32 tag, *p;
+       char *s, *t;
+       int depth, sz;
+
+       if (be32_to_cpu(*(u32 *) (cxt->p - 4)) != OF_DT_END_NODE)
+               return;         /* XXX only for node */
+
+       cxt->p -= 4;
+
+       depth = 0;
+       p = p_struct;
+       while ((tag = be32_to_cpu(*p++)) != OF_DT_END) {
+
+               /* printf("tag: 0x%08x (%d) - %d\n", tag, p - p_struct, depth); */
+
+               if (tag == OF_DT_BEGIN_NODE) {
+                       s = (char *)p;
+                       p = (u32 *) _ALIGN((unsigned long)p + strlen(s) + 1, 4);
+
+                       if (depth++ > 0)
+                               ft_begin_node(cxt, s);
+
+                       continue;
+               }
+
+               if (tag == OF_DT_END_NODE) {
+                       ft_end_node(cxt);
+                       if (--depth == 0)
+                               break;
+                       continue;
+               }
+
+               if (tag == OF_DT_NOP)
+                       continue;
+
+               if (tag != OF_DT_PROP)
+                       break;
+
+               sz = be32_to_cpu(*p++);
+               s = (char *)p_strings + be32_to_cpu(*p++);
+               t = (char *)p;
+               p = (u32 *) _ALIGN((unsigned long)p + sz, 4);
+
+               ft_prop(cxt, s, t, sz);
+       }
+}
+
+void *ft_get_prop(void *bphp, const char *propname, int *szp)
+{
+       struct boot_param_header *bph = bphp;
+       uint32_t *p_struct =
+           (uint32_t *) ((char *)bph + be32_to_cpu(bph->off_dt_struct));
+       uint32_t *p_strings =
+           (uint32_t *) ((char *)bph + be32_to_cpu(bph->off_dt_strings));
+       uint32_t version = be32_to_cpu(bph->version);
+       uint32_t tag;
+       uint32_t *p;
+       char *s, *t;
+       char *ss;
+       int sz;
+       static char path[256], prop[256];
+
+       path[0] = '\0';
+
+       p = p_struct;
+       while ((tag = be32_to_cpu(*p++)) != OF_DT_END) {
+
+               if (tag == OF_DT_BEGIN_NODE) {
+                       s = (char *)p;
+                       p = (uint32_t *) _ALIGN((unsigned long)p + strlen(s) +
+                                               1, 4);
+                       strcat(path, s);
+                       strcat(path, "/");
+                       continue;
+               }
+
+               if (tag == OF_DT_END_NODE) {
+                       path[strlen(path) - 1] = '\0';
+                       ss = strrchr(path, '/');
+                       if (ss != NULL)
+                               ss[1] = '\0';
+                       continue;
+               }
+
+               if (tag == OF_DT_NOP)
+                       continue;
+
+               if (tag != OF_DT_PROP)
+                       break;
+
+               sz = be32_to_cpu(*p++);
+               s = (char *)p_strings + be32_to_cpu(*p++);
+               if (version < 0x10 && sz >= 8)
+                       p = (uint32_t *) _ALIGN((unsigned long)p, 8);
+               t = (char *)p;
+               p = (uint32_t *) _ALIGN((unsigned long)p + sz, 4);
+
+               strcpy(prop, path);
+               strcat(prop, s);
+
+               if (strcmp(prop, propname) == 0) {
+                       *szp = sz;
+                       return t;
+               }
+       }
+
+       return NULL;
+}
+
+/********************************************************************/
+
+extern unsigned char oftree_dtb[];
+extern unsigned int oftree_dtb_len;
+
+/* Function that returns a character from the environment */
+extern uchar(*env_get_char) (int);
+
+#define BDM(x) {       .name = #x, .offset = offsetof(bd_t, bi_ ##x ) }
+
+static const struct {
+       const char *name;
+       int offset;
+} bd_map[] = {
+       BDM(memstart),
+       BDM(memsize),
+       BDM(flashstart),
+       BDM(flashsize),
+       BDM(flashoffset),
+       BDM(sramstart),
+       BDM(sramsize),
+#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \
+       || defined(CONFIG_E500)
+       BDM(immr_base),
+#endif
+#if defined(CONFIG_MPC5xxx)
+       BDM(mbar_base),
+#endif
+#if defined(CONFIG_MPC83XX)
+       BDM(immrbar),
+#endif
+#if defined(CONFIG_MPC8220)
+       BDM(mbar_base),
+       BDM(inpfreq),
+       BDM(pcifreq),
+       BDM(pevfreq),
+       BDM(flbfreq),
+       BDM(vcofreq),
+#endif
+       BDM(bootflags),
+       BDM(ip_addr),
+       BDM(intfreq),
+       BDM(busfreq),
+#ifdef CONFIG_CPM2
+       BDM(cpmfreq),
+       BDM(brgfreq),
+       BDM(sccfreq),
+       BDM(vco),
+#endif
+#if defined(CONFIG_MPC5xxx)
+       BDM(ipbfreq),
+       BDM(pcifreq),
+#endif
+       BDM(baudrate),
+};
+
+void ft_setup(void *blob, int size, bd_t * bd)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+       u8 *end;
+       u32 *p;
+       int len;
+       struct ft_cxt cxt;
+       int i, k, nxt;
+       static char tmpenv[256];
+       char *s, *lval, *rval;
+       ulong clock;
+       uint32_t v;
+
+       /* disable OF tree; booting old kernel */
+       if (getenv("disable_of") != NULL) {
+               memcpy(blob, bd, sizeof(*bd));
+               return;
+       }
+
+       ft_begin(&cxt, blob, size);
+
+       /* fs_add_rsvmap not used */
+
+       ft_begin_tree(&cxt);
+
+       ft_begin_node(&cxt, "");
+
+       ft_end_node(&cxt);
+
+       /* copy RO tree */
+       ft_merge_blob(&cxt, oftree_dtb);
+
+       /* back into root */
+       ft_backtrack_node(&cxt);
+
+       ft_begin_node(&cxt, "u-boot-env");
+
+       for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
+               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt) ;
+               s = tmpenv;
+               for (k = i; k < nxt && s < &tmpenv[sizeof(tmpenv) - 1]; ++k)
+                       *s++ = env_get_char(k);
+               *s++ = '\0';
+               lval = tmpenv;
+               s = strchr(tmpenv, '=');
+               if (s != NULL) {
+                       *s++ = '\0';
+                       rval = s;
+               } else
+                       continue;
+               ft_prop_str(&cxt, lval, rval);
+       }
+
+       ft_end_node(&cxt);
+
+       ft_begin_node(&cxt, "chosen");
+
+       ft_prop_str(&cxt, "name", "chosen");
+       ft_prop_str(&cxt, "bootargs", getenv("bootargs"));
+       ft_prop_int(&cxt, "linux,platform", 0x600);     /* what is this? */
+
+       ft_end_node(&cxt);
+
+       ft_end_node(&cxt);      /* end root */
+
+       ft_end_tree(&cxt);
+
+       /*
+          printf("merged OF-tree\n");
+          ft_dump_blob(blob);
+        */
+
+       /* paste the bd_t at the end of the flat tree */
+       end = (char *)blob +
+           be32_to_cpu(((struct boot_param_header *)blob)->totalsize);
+       memcpy(end, bd, sizeof(*bd));
+
+#ifdef CONFIG_PPC
+
+       for (i = 0; i < sizeof(bd_map)/sizeof(bd_map[0]); i++) {
+               sprintf(tmpenv, "/bd_t/%s", bd_map[i].name);
+               v = *(uint32_t *)((char *)bd + bd_map[i].offset);
+
+               p = ft_get_prop(blob, tmpenv, &len);
+               if (p != NULL)
+                       *p = cpu_to_be32(v);
+       }
+
+       p = ft_get_prop(blob, "/bd_t/enetaddr", &len);
+       if (p != NULL)
+               memcpy(p, bd->bi_enetaddr, 6);
+
+       p = ft_get_prop(blob, "/bd_t/ethspeed", &len);
+       if (p != NULL)
+               *p = cpu_to_be32((uint32_t) bd->bi_ethspeed);
+
+       clock = bd->bi_intfreq;
+       p = ft_get_prop(blob, "/cpus/" OF_CPU "/clock-frequency", &len);
+       if (p != NULL)
+               *p = cpu_to_be32(clock);
+
+#ifdef OF_TBCLK
+       clock = OF_TBCLK;
+       p = ft_get_prop(blob, "/cpus/" OF_CPU "/timebase-frequency", &len);
+       if (p != NULL)
+               *p = cpu_to_be32(OF_TBCLK);
+#endif
+
+#endif                         /* __powerpc__ */
+
+       /*
+          printf("final OF-tree\n");
+          ft_dump_blob(blob);
+        */
+
+}
+
+#endif
index c10b1176f65638dcec691f62a6a1809661dd8661..bb5041a08d872d93b04077fab9edadbd02fca12c 100644 (file)
@@ -296,7 +296,7 @@ extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
 #endif
 
 /* "globals" within this file */
-static char *ifs;
+static uchar *ifs;
 static char map[256];
 #ifndef __U_BOOT__
 static int fake_mode;
@@ -3134,8 +3134,8 @@ void mapset(const unsigned char *set, int code)
 void update_ifs_map(void)
 {
        /* char *ifs and char map[256] are both globals. */
-       ifs = getenv("IFS");
-       if (ifs == NULL) ifs=" \t\n";
+       ifs = (uchar *)getenv("IFS");
+       if (ifs == NULL) ifs=(uchar *)" \t\n";
        /* Precompute a list of 'flow through' behavior so it can be treated
         * quickly up front.  Computation is necessary because of IFS.
         * Special case handling of IFS == " \t\n" is not implemented.
@@ -3144,11 +3144,11 @@ void update_ifs_map(void)
         */
        memset(map,0,sizeof(map)); /* most characters flow through always */
 #ifndef __U_BOOT__
-       mapset("\\$'\"`", 3);      /* never flow through */
-       mapset("<>;&|(){}#", 1);   /* flow through if quoted */
+       mapset((uchar *)"\\$'\"`", 3);      /* never flow through */
+       mapset((uchar *)"<>;&|(){}#", 1);   /* flow through if quoted */
 #else
-       mapset("\\$'\"", 3);       /* never flow through */
-       mapset(";&|#", 1);         /* flow through if quoted */
+       mapset((uchar *)"\\$'\"", 3);       /* never flow through */
+       mapset((uchar *)";&|#", 1);         /* flow through if quoted */
 #endif
        mapset(ifs, 2);            /* also flow through if quoted */
 }
@@ -3168,7 +3168,7 @@ int parse_stream_outer(struct in_str *inp, int flag)
                ctx.type = flag;
                initialize_context(&ctx);
                update_ifs_map();
-               if (!(flag & FLAG_PARSE_SEMICOLON) || (flag & FLAG_REPARSING)) mapset(";$&|", 0);
+               if (!(flag & FLAG_PARSE_SEMICOLON) || (flag & FLAG_REPARSING)) mapset((uchar *)";$&|", 0);
                inp->promptmode=1;
                rcode = parse_stream(&temp, &ctx, inp, '\n');
 #ifdef __U_BOOT__
index 06adb3ea5142542eca0dd52051cd66cd618c6406..6de6ec99a22273c4ff8fd7ac515fcf42cff6ac85 100644 (file)
@@ -144,7 +144,7 @@ mem2hex(char *mem, char *buf, int count)
        }
        *buf = 0;
        longjmp_on_fault = 0;
-       return buf;
+       return (unsigned char *)buf;
 }
 
 /* convert the hex array pointed to by buf into binary to be placed in mem
@@ -353,7 +353,7 @@ handle_exception (struct pt_regs *regs)
                *ptr++ = hexchars[rp->num >> 4];
                *ptr++ = hexchars[rp->num & 0xf];
                *ptr++ = ':';
-               ptr = mem2hex((char *)&rp->val, ptr, 4);
+               ptr = (char *)mem2hex((char *)&rp->val, ptr, 4);
                *ptr++ = ';';
        }
 
@@ -364,7 +364,7 @@ handle_exception (struct pt_regs *regs)
                printf("kgdb: remcomOutBuffer: %s\n", remcomOutBuffer);
 #endif
 
-       putpacket(remcomOutBuffer);
+       putpacket((unsigned char *)&remcomOutBuffer);
 
        while (1) {
                volatile int errnum;
@@ -508,7 +508,7 @@ handle_exception (struct pt_regs *regs)
 #endif
 
                /* reply to the request */
-               putpacket(remcomOutBuffer);
+               putpacket((unsigned char *)&remcomOutBuffer);
 
        } /* while(1) */
 }
@@ -548,7 +548,7 @@ kgdb_output_string (const char* s, unsigned int count)
 
        buffer[0] = 'O';
        mem2hex ((char *)s, &buffer[1], count);
-       putpacket(buffer);
+       putpacket((unsigned char *)&buffer);
 
        return 1;
 }
index 7bf7a63fd7b99dcff0eb0a6fa4e0ff37ced4bf05..e64972fd813a6e10ade52623140df65fa234249c 100644 (file)
@@ -279,9 +279,9 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
 static inline void lcd_puts_xy (ushort x, ushort y, uchar *s)
 {
 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-       lcd_drawchars (x, y+BMP_LOGO_HEIGHT, s, strlen (s));
+       lcd_drawchars (x, y+BMP_LOGO_HEIGHT, s, strlen ((char *)s));
 #else
-       lcd_drawchars (x, y, s, strlen (s));
+       lcd_drawchars (x, y, s, strlen ((char *)s));
 #endif
 }
 
@@ -526,7 +526,7 @@ void bitmap_plot (int x, int y)
                sizeof(bmp_logo_palette)/(sizeof(ushort)));
 
        bmap = &bmp_logo_bitmap[0];
-       fb   = (char *)(lcd_base + y * lcd_line_length + x);
+       fb   = (uchar *)(lcd_base + y * lcd_line_length + x);
 
        if (NBITS(panel_info.vl_bpix) < 12) {
                /* Leave room for default color map */
@@ -710,15 +710,15 @@ static void *lcd_logo (void)
 #ifdef CONFIG_MPC823
 # ifdef CONFIG_LCD_INFO
        sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__);
-       lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, info, strlen(info));
+       lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, (uchar *)info, strlen(info));
 
        sprintf (info, "(C) 2004 DENX Software Engineering");
        lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT,
-                                       info, strlen(info));
+                                       (uchar *)info, strlen(info));
 
        sprintf (info, "    Wolfgang DENK, wd@denx.de");
        lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT * 2,
-                                       info, strlen(info));
+                                       (uchar *)info, strlen(info));
 #  ifdef CONFIG_LCD_INFO_BELOW_LOGO
        sprintf (info, "MPC823 CPU at %s MHz",
                strmhz(temp, gd->cpu_clk));
@@ -737,7 +737,7 @@ static void *lcd_logo (void)
                gd->ram_size >> 20,
                gd->bd->bi_flashsize >> 20 );
        lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT * 4,
-                                       info, strlen(info));
+                                       (uchar *)info, strlen(info));
 
 #  endif /* CONFIG_LCD_INFO_BELOW_LOGO */
 # endif /* CONFIG_LCD_INFO */
index 1389958de3e1bd0251535476dcc16dde6a626f3c..f042f3a636fd6171ce2f96c6f8a15b49fb33169b 100644 (file)
@@ -347,7 +347,7 @@ void main_loop (void)
 #ifdef CONFIG_MODEM_SUPPORT
        debug ("DEBUG: main_loop:   do_mdm_init=%d\n", do_mdm_init);
        if (do_mdm_init) {
-               uchar *str = strdup(getenv("mdm_cmd"));
+               char *str = strdup(getenv("mdm_cmd"));
                setenv ("preboot", str);  /* set or delete definition */
                if (str != NULL)
                        free (str);
index f7ca49840a08173e8e037e99310076bbfe59ffc1..3d0e08c6ff3866f295913bd576b80bb230992ff2 100644 (file)
@@ -399,7 +399,7 @@ int  i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
  */
 uchar i2c_reg_read(uchar i2c_addr, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_read(i2c_addr, reg, 1, &buf, 1);
 
index 69d195af605539875fee45da3d87a38458e7b448..99e4ab0d2335a88642ec5a82e2c3da61d5bb90f2 100644 (file)
@@ -490,7 +490,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
  */
 int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
 {
-       int result;
+       int result = 0;
        int dir_in,retry;
        unsigned int pipe;
        unsigned long status;
@@ -528,7 +528,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
 
                USB_STOR_PRINTF("CB_transport: control msg returned %d, direction is %s to go 0x%lx\n",result,dir_in ? "IN" : "OUT",srb->datalen);
                if (srb->datalen) {
-                       result = us_one_transfer(us, pipe, srb->pdata,srb->datalen);
+                       result = us_one_transfer(us, pipe, (char *)srb->pdata,srb->datalen);
                        USB_STOR_PRINTF("CBI attempted to transfer data, result is %d status %lX, len %d\n", result,us->pusb_dev->status,us->pusb_dev->act_len);
                        if(!(us->pusb_dev->status & USB_ST_NAK_REC))
                                break;
@@ -847,7 +847,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
 {
        char *ptr;
 
-       ptr=srb->pdata;
+       ptr=(char *)srb->pdata;
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_REQ_SENSE;
        srb->cmd[1]=srb->lun<<5;
@@ -857,7 +857,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
        srb->cmdlen=12;
        ss->transport(srb,ss);
        USB_STOR_PRINTF("Request Sense returned %02X %02X %02X\n",srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
-       srb->pdata=ptr;
+       srb->pdata=(uchar *)ptr;
        return 0;
 }
 
index 40ce3bcbbf008ea2a3a4efeda94cce76271b4900..e03e78cb28527403f1085c5dfdc955b0daf0e509 100644 (file)
@@ -54,7 +54,7 @@ int xilinx_load (Xilinx_desc * desc, void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
@@ -101,7 +101,7 @@ int xilinx_dump (Xilinx_desc * desc, void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
@@ -148,7 +148,7 @@ int xilinx_info (Xilinx_desc * desc)
 {
        int ret_val = FPGA_FAIL;
 
-       if (xilinx_validate (desc, __FUNCTION__)) {
+       if (xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("Family:        \t");
                switch (desc->family) {
                case Xilinx_Spartan2:
@@ -244,7 +244,7 @@ int xilinx_reloc (Xilinx_desc * desc, ulong reloc_offset)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
index d88517f4b1af6f1683b3a4dfea94543e5045e906..ca5b7d198cea8a39beec2b8c905b69a040d5fab3 100644 (file)
@@ -184,7 +184,7 @@ int eth_init (bd_t * bd)
 
        /* Init Ehternet buffers */
        for (i = 0; i < RBF_FRAMEMAX; i++) {
-               rbfdt[i].addr = rbf_framebuf[i];
+               rbfdt[i].addr = (unsigned long)rbf_framebuf[i];
                rbfdt[i].size = 0;
        }
        rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP;
index c3d30a049d7fc6ebbf7a2b32af98ab5f86731baa..eadb7ecd346fd38b1652ffad86da879e7d4dbe6e 100644 (file)
@@ -320,7 +320,7 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
         * Set individual address filter for unicast address
         * and set physical address registers.
         */
-       mpc5xxx_fec_set_hwaddr(fec, dev->enetaddr);
+       mpc5xxx_fec_set_hwaddr(fec, (char *)dev->enetaddr);
 
        /*
         * Set multicast address filter
@@ -785,7 +785,7 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
        unsigned long ievent;
        int frame_length, len = 0;
        NBUF *frame;
-       char buff[FEC_MAX_PKT_SIZE];
+       uchar buff[FEC_MAX_PKT_SIZE];
 
 #if (DEBUG & 0x1)
        printf ("mpc5xxx_fec_recv %d Start...\n", fec->rbdIndex);
index 845f7c05eff51356eed4777e3fe68b6a6bc26f63..044db46f6fb43676627c835ba844871a6e5a89d7 100644 (file)
@@ -55,8 +55,9 @@ static int  mpc_get_fdr   (int);
 
 static int mpc_reg_in(volatile u32 *reg)
 {
-       return *reg >> 24;
+       int ret = *reg >> 24;
        __asm__ __volatile__ ("eieio");
+       return ret;
 }
 
 static void mpc_reg_out(volatile u32 *reg, int val, int mask)
@@ -298,7 +299,7 @@ int i2c_probe(uchar chip)
 
 int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
 {
-       uchar                xaddr[4];
+       char                xaddr[4];
        struct mpc5xxx_i2c * regs        = (struct mpc5xxx_i2c *)I2C_BASE;
        int                  ret         = -1;
 
@@ -329,7 +330,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
                goto Done;
        }
 
-       if (receive_bytes(chip, buf, len)) {
+       if (receive_bytes(chip, (char *)buf, len)) {
                printf("i2c_read: receive_bytes failed\n");
                goto Done;
        }
@@ -342,7 +343,7 @@ Done:
 
 int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
 {
-       uchar               xaddr[4];
+       char               xaddr[4];
        struct mpc5xxx_i2c *regs        = (struct mpc5xxx_i2c *)I2C_BASE;
        int                 ret         = -1;
 
@@ -367,7 +368,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
                goto Done;
        }
 
-       if (send_bytes(chip, buf, len)) {
+       if (send_bytes(chip, (char *)buf, len)) {
                printf("i2c_write: send_bytes failed\n");
                goto Done;
        }
@@ -380,7 +381,7 @@ Done:
 
 uchar i2c_reg_read(uchar chip, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_read(chip, reg, 1, &buf, 1);
 
index e974ab3494f53eee8e9f579f6cc5d282f7c8f8f9..d5cd22e542afebee9a6d8707b18a4b8c13a40374 100644 (file)
@@ -330,7 +330,7 @@ static int mpc8220_fec_init (struct eth_device *dev, bd_t * bis)
         * Set individual address filter for unicast address
         * and set physical address registers.
         */
-       mpc8220_fec_set_hwaddr (fec, dev->enetaddr);
+       mpc8220_fec_set_hwaddr (fec, (char *)(dev->enetaddr));
 
        /*
         * Set multicast address filter
index e9d077178b10f4adcbf5ee0fa6fe9064bd0b6889..62f7c0f5d330df815284ca99031017880c66273c 100644 (file)
@@ -73,8 +73,10 @@ static int mpc_get_fdr (int);
 
 static int mpc_reg_in (volatile u32 * reg)
 {
-       return *reg >> 24;
+       int ret;
+       ret = *reg >> 24;
        __asm__ __volatile__ ("eieio");
+       return ret;
 }
 
 static void mpc_reg_out (volatile u32 * reg, int val, int mask)
@@ -324,7 +326,7 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
                goto Done;
        }
 
-       if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+       if (send_bytes (chip, (char *)&xaddr[4 - alen], alen)) {
                printf ("i2c_read: send_bytes failed\n");
                goto Done;
        }
@@ -335,7 +337,7 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
                goto Done;
        }
 
-       if (receive_bytes (chip, buf, len)) {
+       if (receive_bytes (chip, (char *)buf, len)) {
                printf ("i2c_read: receive_bytes failed\n");
                goto Done;
        }
@@ -368,12 +370,12 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
                goto Done;
        }
 
-       if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+       if (send_bytes (chip, (char *)&xaddr[4 - alen], alen)) {
                printf ("i2c_write: send_bytes failed\n");
                goto Done;
        }
 
-       if (send_bytes (chip, buf, len)) {
+       if (send_bytes (chip, (char *)buf, len)) {
                printf ("i2c_write: send_bytes failed\n");
                goto Done;
        }
@@ -386,7 +388,7 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
 
 uchar i2c_reg_read (uchar chip, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_read (chip, reg, 1, &buf, 1);
 
index 7445a1ce3140d1b21e39da393fa1b2ce7966a2e4..3add687514c060907f3150b03f2ebd5b8c034b98 100644 (file)
@@ -264,12 +264,12 @@ int i2c_probe (uchar chip)
         * and looking for an <ACK> back.
         */
        udelay (10000);
-       return i2c_read (chip, 0, 1, (char *) &tmp, 1);
+       return i2c_read (chip, 0, 1, (uchar *) &tmp, 1);
 }
 
 uchar i2c_reg_read (uchar i2c_addr, uchar reg)
 {
-       char buf[1];
+       uchar buf[1];
 
        i2c_read (i2c_addr, reg, 1, buf, 1);
 
index e0ac6840815f87db632e1c5dc1f688c749808b0a..ea97ab85fbc091944b6c4a7707dfa253778751d5 100644 (file)
@@ -752,7 +752,7 @@ i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 uchar
 i2c_reg_read(uchar chip, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_read(chip, reg, 1, &buf, 1);
 
index 7ccb8a960999b2c859963acd42f04acb14bc57f8..4e70f808a4d2e8dfe9dff69d40c3d2cc9a848286 100644 (file)
@@ -233,12 +233,12 @@ int i2c_probe (uchar chip)
         * and looking for an <ACK> back.
         */
        udelay(10000);
-       return i2c_read (chip, 0, 1, (char *)&tmp, 1);
+       return i2c_read (chip, 0, 1, (uchar *)&tmp, 1);
 }
 
 uchar i2c_reg_read (uchar i2c_addr, uchar reg)
 {
-       char buf[1];
+       uchar buf[1];
 
        i2c_read (i2c_addr, reg, 1, buf, 1);
 
index 2d0848799584164a7468948e1fc94ae9af541218..32dcf5d47e507d447f352ad1914779ac2380d1f5 100644 (file)
@@ -245,12 +245,12 @@ int i2c_probe (uchar chip)
         * and looking for an <ACK> back.
         */
        udelay(10000);
-       return i2c_read (chip, 0, 1, (char *)&tmp, 1);
+       return i2c_read (chip, 0, 1, (uchar *)&tmp, 1);
 }
 
 uchar i2c_reg_read (uchar i2c_addr, uchar reg)
 {
-       char buf[1];
+       uchar buf[1];
 
        i2c_read (i2c_addr, reg, 1, buf, 1);
 
index bfa6625fa8481b567854f5b67d21a45ebdf7312c..5fa150e915b34e9357a8a92962caeca14a3440d6 100644 (file)
@@ -21,6 +21,6 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing 
 
 PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -ffixed-r29 -mstring -mcpu=860 -msoft-float
index baa3552b078f5a0fee32006ae216b51ea6cefe95..682db53edb10d9807e015f03b717682087fe308b 100644 (file)
@@ -724,7 +724,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 uchar
 i2c_reg_read(uchar i2c_addr, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
 
index 9213d101a72d20511ccbec5441f850b07de1de3c..e318ed0d298aefa9bc84c0ee4e27d0a2a1522083 100644 (file)
@@ -525,11 +525,11 @@ int spi_post_test (int flags)
 
        for (i = 0; i < TEST_NUM; i++) {
                for (l = TEST_MIN_LENGTH; l <= TEST_MAX_LENGTH; l += 8) {
-                       packet_fill (txbuf, l);
+                       packet_fill ((char *)txbuf, l);
 
                        spi_xfer (l);
 
-                       if (packet_check (rxbuf, l) < 0) {
+                       if (packet_check ((char *)rxbuf, l) < 0) {
                                goto Done;
                        }
                }
index f2b8814c83112b2131b0ca55b5c364dc22df9d97..ee60477ab8f18753450a25c15860dbd763725665 100644 (file)
@@ -447,9 +447,9 @@ static void video_drawchars (int xx, int yy, unsigned char *s, int count)
        }
 }
 
-static inline void video_drawstring (int xx, int yy, unsigned char *s)
+static inline void video_drawstring (int xx, int yy, char *s)
 {
-       video_drawchars (xx, yy, s, strlen (s));
+       video_drawchars (xx, yy, (unsigned char *)s, strlen (s));
 }
 
 /* Relative to console plotting functions */
@@ -474,7 +474,7 @@ static void video_putchar (int xx, int yy, unsigned char c)
 
 static inline void video_putstring (int xx, int yy, unsigned char *s)
 {
-       video_putchars (xx, yy, s, strlen (s));
+       video_putchars (xx, yy, (unsigned char *)s, strlen ((char *)s));
 }
 
 /************************************************************************/
index 34f6e973f47fdc86575bb82f7e4d2d204935cd99..d3f1de4359ba1a1166dd043eb87b29f4e418ecd9 100644 (file)
 static uint32_t mal_ier;
 
 #if !defined(CONFIG_NET_MULTI)
-struct eth_device *emac0_dev;
+struct eth_device *emac0_dev = NULL;
 #endif
 
 
@@ -306,8 +306,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
        /* before doing anything, figure out if we have a MAC address */
        /* if not, bail */
-       if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0)
+       if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0) {
+               printf("ERROR: ethaddr not set!\n");
                return -1;
+       }
 
 #if defined(CONFIG_440GX)
        /* Need to get the OPB frequency so we can access the PHY */
@@ -1486,12 +1488,16 @@ void eth_halt (void) {
 int eth_init (bd_t *bis)
 {
        ppc_4xx_eth_initialize(bis);
-       return(ppc_4xx_eth_init(emac0_dev, bis));
+       if (emac0_dev) {
+               return ppc_4xx_eth_init(emac0_dev, bis);
+       } else {
+               printf("ERROR: ethaddr not set!\n");
+               return -1;
+       }
 }
 
 int eth_send(volatile void *packet, int length)
 {
-
        return (ppc_4xx_eth_send(emac0_dev, packet, length));
 }
 
index 3a644a4cc4f106fea735a0a4c264bbb5135809df..be94b571ff20ba2f0ab7586237cd7d5769c58bc7 100644 (file)
@@ -428,7 +428,7 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
  */
 uchar i2c_reg_read(uchar i2c_addr, uchar reg)
 {
-       char buf;
+       uchar buf;
 
        i2c_read(i2c_addr, reg, 1, &buf, 1);
 
index 48102efcff089ce41cf56c0ed6a369a660b39542..7c9ac25e218d7fd63b1ec0c6bf245438fd3c6637 100644 (file)
@@ -456,7 +456,7 @@ long int spd_sdram(int(read_spd)(uint addr))
 
 int spd_read(uint addr)
 {
-       char data[2];
+       uchar data[2];
 
        if (i2c_read(SPD_EEPROM_ADDRESS, addr, 1, data, 1) == 0)
                return (int)data[0];
index a37c32d9e2e2af2c41f227670c0903f6f1bc7cd5..133ee7988343aa0e130a19232c0f8933a86143dc 100644 (file)
@@ -75,7 +75,7 @@ static int test_block_type(unsigned char *buffer)
            (buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
                return (-1);
        } /* no DOS Signature at all */
-       if(strncmp(&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+       if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
                return DOS_PBR; /* is PBR */
        return DOS_MBR;     /* Is MBR */
 }
@@ -195,23 +195,23 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
                        switch(dev_desc->if_type) {
                                case IF_TYPE_IDE:
                                case IF_TYPE_ATAPI:
-                                       sprintf (info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
+                                       sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
                                case IF_TYPE_SCSI:
-                                       sprintf (info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
+                                       sprintf ((char *)info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
                                case IF_TYPE_USB:
-                                       sprintf (info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
+                                       sprintf ((char *)info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
                                case IF_TYPE_DOC:
-                                       sprintf (info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
+                                       sprintf ((char *)info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
                                default:
-                                       sprintf (info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
+                                       sprintf ((char *)info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
                        }
                        /* sprintf(info->type, "%d, pt->sys_ind); */
-                       sprintf (info->type, "U-Boot");
+                       sprintf ((char *)info->type, "U-Boot");
                        return 0;
                }
 
index ee8c7c6f29b4d57a456ff77e42e2831d9a5e4a88..073532436e8bc90587310d248780a822148f8ba5 100644 (file)
@@ -87,7 +87,7 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_
                                dev_desc->dev, part_num);
                return (-1);
        }
-       if(strncmp(ppr->stand_ident,"CD001",5)!=0) {
+       if(strncmp((char *)ppr->stand_ident,"CD001",5)!=0) {
                if(verb)
                        printf ("** Wrong ISO Ident: %s on %d:%d **\n",
                                ppr->stand_ident,dev_desc->dev, part_num);
@@ -154,23 +154,23 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_
        /* the validation entry seems to be ok, now search the "partition" */
        entry_num=0;
        offset=0x20;
-       sprintf (info->type, "U-Boot");
+       sprintf ((char *)info->type, "U-Boot");
        switch(dev_desc->if_type) {
                case IF_TYPE_IDE:
                case IF_TYPE_ATAPI:
-                       sprintf (info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
+                       sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
                case IF_TYPE_SCSI:
-                       sprintf (info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
+                       sprintf ((char *)info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
                case IF_TYPE_USB:
-                       sprintf (info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
+                       sprintf ((char *)info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
                case IF_TYPE_DOC:
-                       sprintf (info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
+                       sprintf ((char *)info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
                default:
-                       sprintf (info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
+                       sprintf ((char *)info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
        }
        /* the bootcatalog (including validation Entry) is limited to 2048Bytes
diff --git a/doc/README.OFT b/doc/README.OFT
new file mode 100644 (file)
index 0000000..8f00ebb
--- /dev/null
@@ -0,0 +1,28 @@
+Open Firmware Flat Tree and usage.
+----------------------------------
+
+As part of the ongoing cleanup of the Linux PPC trees, the preferred
+way to pass bootloader and board setup information is the open
+firmware flat tree.
+
+Please take a look at the following email discussion for some 
+background.
+
+  http://ozlabs.org/pipermail/linuxppc-dev/2005-August/019408.html
+  http://ozlabs.org/pipermail/linuxppc-dev/2005-August/019362.html
+
+The generated tree is part static and part dynamic.
+
+There is a static part which is compiled in with DTC and a dynamic
+part which is programmatically appended.
+
+You'll need a fairly recent DTC tool, which is available by git at
+
+  rsync://ozlabs.org/dtc/dtc.git
+
+The xxd binary dumper is needed too which I got from
+
+  ftp://ftp.uni-erlangen.de/pub/utilities/etc/xxd-1.10.tar.gz
+
+
+Pantelis Antoniou, 13 Oct 2005
index aba4a0341bdacbdd14a92c624a6cd202364b57a6..9727aebbcb2ffe03f51f752add36e0ed9e97978c 100644 (file)
@@ -501,7 +501,7 @@ static void video_drawchars (int xx, int yy, unsigned char *s, int count)
 
 static inline void video_drawstring (int xx, int yy, unsigned char *s)
 {
-       video_drawchars (xx, yy, s, strlen (s));
+       video_drawchars (xx, yy, s, strlen ((char *)s));
 }
 
 /*****************************************************************************/
@@ -548,12 +548,12 @@ void console_cursor (int state)
                sprintf (info, " %02d:%02d:%02d ", tm.tm_hour, tm.tm_min,
                         tm.tm_sec);
                video_drawstring (VIDEO_VISIBLE_COLS - 10 * VIDEO_FONT_WIDTH,
-                                 VIDEO_INFO_Y, info);
+                                 VIDEO_INFO_Y, (uchar *)info);
 
                sprintf (info, "%02d.%02d.%04d", tm.tm_mday, tm.tm_mon,
                         tm.tm_year);
                video_drawstring (VIDEO_VISIBLE_COLS - 10 * VIDEO_FONT_WIDTH,
-                                 VIDEO_INFO_Y + 1 * VIDEO_FONT_HEIGHT, info);
+                                 VIDEO_INFO_Y + 1 * VIDEO_FONT_HEIGHT, (uchar *)info);
        }
 #endif
 
@@ -779,11 +779,18 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
                 */
                len = CFG_VIDEO_LOGO_MAX_SIZE;
                dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+               if (dst == NULL) {
+                       printf("Error: malloc in gunzip failed!\n");
+                       return(1);
+               }
                if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)bmp_image, &len) != 0) {
                        printf ("Error: no valid bmp or bmp.gz image at %lx\n", bmp_image);
                        free(dst);
                        return 1;
                }
+               if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
+                       printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
+               }
 
                /*
                 * Set addr to decompressed image
@@ -1112,7 +1119,7 @@ static void *video_logo (void)
        logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
 
        sprintf (info, " %s", &version_string);
-       video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info);
+       video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *)info);
 
 #ifdef CONFIG_CONSOLE_EXTRA_INFO
        {
@@ -1123,7 +1130,7 @@ static void *video_logo (void)
                        if (*info)
                                video_drawstring (VIDEO_INFO_X,
                                                  VIDEO_INFO_Y + i * VIDEO_FONT_HEIGHT,
-                                                 info);
+                                                 (uchar *)info);
                }
        }
 #endif
index 5386d9269b61400482b9102da699e711ea5e3e06..c43cd5ec2fe918ca1cad7d59a618fc15e1b4f122 100644 (file)
@@ -214,7 +214,7 @@ int dc21x4x_initialize(bd_t *bis)
 {
        int                     idx=0;
        int                     card_number = 0;
-       int                     cfrv;
+       unsigned int            cfrv;
        unsigned char           timer;
        pci_dev_t               devbusfn;
        unsigned int            iobase;
@@ -708,7 +708,7 @@ static int write_srom(struct eth_device *dev, u_long ioaddr, int index, int new_
 #ifndef CONFIG_TULIP_FIX_DAVICOM
 static void read_hw_addr(struct eth_device *dev, bd_t *bis)
 {
-       u_short tmp, *p = (short *)(&dev->enetaddr[0]);
+       u_short tmp, *p = (u_short *)(&dev->enetaddr[0]);
        int i, j = 0;
 
        for (i = 0; i < (ETH_ALEN >> 1); i++) {
index 787134abf91f039eb8692810647cd84373eb409b..927acbb26737a20e02962f67047e192545a870a1 100644 (file)
@@ -2822,7 +2822,7 @@ e1000_poll(struct eth_device *nic)
        if (!(le32_to_cpu(rd->status)) & E1000_RXD_STAT_DD)
                return 0;
        /*DEBUGOUT("recv: packet len=%d \n", rd->length); */
-       NetReceive(packet, le32_to_cpu(rd->length));
+       NetReceive((uchar *)packet, le32_to_cpu(rd->length));
        fill_rx(hw);
        return 1;
 }
index 1c1b9a09b802af2d97cd2ed08214701e556de0dd..b009db63ebe404f5e816b8a0de22d7050f222fb7 100644 (file)
@@ -756,6 +756,7 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
 {
        u32 i, status = 0;
        u32 tx_status = 0;
+       vu_long *res = (vu_long *)&tx_status;
 
        /* Stop the transmitter */
        OUTL(dev, TxOff, ChipCmd);
@@ -781,7 +782,7 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
        OUTL(dev, TxOn, ChipCmd);
 
        for (i = 0;
-            ((vu_long)tx_status = le32_to_cpu(txd.cmdsts)) & DescOwn;
+            (*res = le32_to_cpu(txd.cmdsts)) & DescOwn;
             i++) {
                if (i >= TOUT_LOOP) {
                        printf
index be99c3b4d7646012456ced3685a006affc847ebc..976f86aaff5d41405affd4cd13a8c77dc625aa81 100644 (file)
@@ -363,7 +363,7 @@ ns8382x_initialize(bd_t * bis)
                /* get MAC address */
                for (i = 0; i < 3; i++) {
                        u32 data;
-                       char *mac = &dev->enetaddr[i * 2];
+                       char *mac = (char *)&dev->enetaddr[i * 2];
 
                        OUTL(dev, i * 2, RxFilterAddr);
                        data = INL(dev, RxFilterData);
index 17e8044aaeef0cf6014406ccc9a2da9a8a6eb3d0..da9ac7f99affc56887827389b0e6ccac10b91978 100644 (file)
@@ -195,7 +195,7 @@ int pcnet_initialize(bd_t *bis)
        /*
         * Setup the PCI device.
         */
-       pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &dev->iobase);
+       pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, (unsigned int *)&dev->iobase);
        dev->iobase &= ~0xf;
 
        PCNET_DEBUG1("%s: devbusfn=0x%x iobase=0x%x: ",
index a87aaf3e6cd61048ed609a455b0cbed3e4d386b9..20f9beb0172ad6809d471201a7077f0165bec864 100644 (file)
@@ -525,7 +525,8 @@ static unsigned int FindPQ (unsigned int freq, unsigned int *pp, unsigned int *p
 /*****************************************************************************/
 static void smiLoadCcr (struct ctfb_res_modes *var, unsigned short device_id)
 {
-       unsigned int p, q;
+       unsigned int p = 0;
+       unsigned int q = 0;
        long long freq;
        register GraphicDevice *pGD  = (GraphicDevice *)&smi;
 
index ddca901856651b9b933d6da6f987fcac58dfff5c..069a42fe318ebf08818ebcbcdd4f12aa38d878cb 100644 (file)
@@ -200,11 +200,11 @@ int tsec_init(struct eth_device* dev, bd_t * bd)
        for(i=0;i<MAC_ADDR_LEN;i++) {
                tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->enetaddr[i];
        }
-       (uint)(regs->macstnaddr1) = *((uint *)(tmpbuf));
+       regs->macstnaddr1 = *((uint *)(tmpbuf));
 
        tempval = *((uint *)(tmpbuf +4));
 
-       (uint)(regs->macstnaddr2) = tempval;
+       regs->macstnaddr2 = tempval;
 
        /* reset the indices to zero */
        rxIdx = 0;
index 60b937ef8de5092c7a6cc98d25af96d8d4bc8988..020c31d2f53543846417d446d7fc82feca93eed8 100644 (file)
@@ -78,9 +78,9 @@ static inline short inw(long addr)
 
 static inline void *memcpy(void *dst, const void *src, unsigned int len)
 {
-       void * ret = dst;
-       while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
-       return ret;
+       char *ret = dst;
+       while (len-- > 0) *(ret)++ = *((char *)src)++;
+       return (void *)ret;
 }
 
 /* The EEPROM commands include the alway-set leading bit. */
index 6b78f69985c029f1f3b25d68fd450f4bbd220e7c..ae01e0b05d24695217f5fa981b4084842dadca9e 100644 (file)
@@ -292,7 +292,7 @@ static int thread_start (int id)
                current_tid = id;
                PDEBUG ("thread_start: to be stack=0%08x",
                        (unsigned)lthreads[id].stack);
-               setctxsp (&lthreads[id].stack[STK_SIZE]);
+               setctxsp ((vu_char *)&lthreads[id].stack[STK_SIZE]);
                thread_launcher ();
        }
 
index 1a40a700c47abbc6335eda263690c0c9bc9ecf82..a823b5aba4089a1160480fc8f4e6b1961836b932 100644 (file)
@@ -83,7 +83,7 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
                /* no signature found */
                return -1;
        }
-       if(!strncmp(&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
+       if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
                /* ok, we assume we are on a PBR only */
                cur_part = 1;
                part_offset=0;
index cf01f888a47a12b393874d59c7c419ede0ebdd41..74577d9c62b39c2b0662c62a59f1feee1a2d8dbe 100644 (file)
@@ -48,8 +48,8 @@
 void rubin_do_decompress(unsigned char *bits, unsigned char *in,
                         unsigned char *page_out, __u32 destlen)
 {
-       register char *curr = page_out;
-       char *end = page_out + destlen;
+       register char *curr = (char *)page_out;
+       char *end = (char *)(page_out + destlen);
        register unsigned long temp;
        register unsigned long result;
        register unsigned long p;
@@ -85,8 +85,10 @@ void rubin_do_decompress(unsigned char *bits, unsigned char *in,
                                rec_q <<= 1;
                                rec_q |= (temp >> (bit++ ^ 7)) & 1;
                                if (bit > 31) {
+                                       u32 *p = (u32 *)in;
                                        bit = 0;
-                                       temp = *(++((u32 *) in));
+                                       temp = *(++p);
+                                       in = (unsigned char *)p;
                                }
                        }
                        i0 =  (bits[i] * p) >> 8;
index 0f2907183732ec30654921aaf90407818c58bfe6..c6c0c2a57fd2f22b52d26e0d506d55096382d9e1 100644 (file)
@@ -496,7 +496,7 @@ static int compare_dirents(struct b_node *new, struct b_node *old)
 
        /* length is also the same, so use ascending sort by name
         */
-       cmp = strncmp(jNew->name, jOld->name, jNew->nsize);
+       cmp = strncmp((char *)jNew->name, (char *)jOld->name, jNew->nsize);
        if (cmp != 0)
                return cmp > 0;
 
@@ -572,8 +572,8 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
        struct jffs2_raw_inode *jNode;
        u32 totalSize = 0;
        u32 latestVersion = 0;
-       char *lDest;
-       char *src;
+       uchar *lDest;
+       uchar *src;
        long ret;
        int i;
        u32 counter = 0;
@@ -624,14 +624,14 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
 #endif
 
                        if(dest) {
-                               src = ((char *) jNode) + sizeof(struct jffs2_raw_inode);
+                               src = ((uchar *) jNode) + sizeof(struct jffs2_raw_inode);
                                /* ignore data behind latest known EOF */
                                if (jNode->offset > totalSize) {
                                        put_fl_mem(jNode);
                                        continue;
                                }
 
-                               lDest = (char *) (dest + jNode->offset);
+                               lDest = (uchar *) (dest + jNode->offset);
 #if 0
                                putLabeledWord("read_inode: src = ", src);
                                putLabeledWord("read_inode: dest = ", lDest);
@@ -709,7 +709,7 @@ jffs2_1pass_find_inode(struct b_lists * pL, const char *name, u32 pino)
                jDir = (struct jffs2_raw_dirent *) get_node_mem(b->offset);
                if ((pino == jDir->pino) && (len == jDir->nsize) &&
                    (jDir->ino) &&      /* 0 for unlink */
-                   (!strncmp(jDir->name, name, len))) {        /* a match */
+                   (!strncmp((char *)jDir->name, name, len))) {        /* a match */
                        if (jDir->version < version) {
                                put_fl_mem(jDir);
                                continue;
@@ -776,7 +776,7 @@ static inline void dump_stat(struct stat *st, const char *name)
        if (st->st_mtime == (time_t)(-1)) /* some ctimes really hate -1 */
                st->st_mtime = 1;
 
-       ctime_r(&st->st_mtime, s/*,64*/); /* newlib ctime doesn't have buflen */
+       ctime_r((time_t *)&st->st_mtime, s/*,64*/); /* newlib ctime doesn't have buflen */
 
        if ((p = strchr(s,'\n')) != NULL) *p = '\0';
        if ((p = strchr(s,'\r')) != NULL) *p = '\0';
@@ -796,7 +796,7 @@ static inline u32 dump_inode(struct b_lists * pL, struct jffs2_raw_dirent *d, st
 
        if(!d || !i) return -1;
 
-       strncpy(fname, d->name, d->nsize);
+       strncpy(fname, (char *)d->name, d->nsize);
        fname[d->nsize] = '\0';
 
        memset(&st,0,sizeof(st));
@@ -971,7 +971,7 @@ jffs2_1pass_resolve_inode(struct b_lists * pL, u32 ino)
                        putnstr(src, jNode->dsize);
                        putstr("\r\n");
 #endif
-                       strncpy(tmp, src, jNode->dsize);
+                       strncpy(tmp, (char *)src, jNode->dsize);
                        tmp[jNode->dsize] = '\0';
                        put_fl_mem(jNode);
                        break;
index 7b6048249c91274fedacc89051ba6ad4b282acf6..3f5bcf63a1f980eb0c5e95e458119f55f5855274 100644 (file)
@@ -39,7 +39,7 @@ extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val)
 #  define __arch_swab16(x) ld_le16(&x)
 #  define __arch_swab32(x) ld_le32(&x)
 #else
-static __inline__ __const__ __u16 ___arch__swab16(__u16 value)
+static __inline__ __attribute__((const)) __u16 ___arch__swab16(__u16 value)
 {
        __u16 result;
 
@@ -49,7 +49,7 @@ static __inline__ __const__ __u16 ___arch__swab16(__u16 value)
        return result;
 }
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 value)
+static __inline__ __attribute__((const)) __u32 ___arch__swab32(__u32 value)
 {
        __u32 result;
 
index c79a023f7c50a2f41ecbe3b20c076264a961c6d2..9ee4849611c3cf812027d979ea6b7eba28d2bf58 100644 (file)
@@ -40,7 +40,7 @@
                                                /* crc, base, loop, mtest       */
 #define CFG_CMD_NET            0x00000080ULL   /* bootp, tftpboot, rarpboot    */
 #define CFG_CMD_ENV            0x00000100ULL   /* saveenv                      */
-#define CFG_CMD_KGDB           0x00000200ULL   /* kgdb                         */
+#define CFG_CMD_KGDB           0x0000000000000200ULL   /* kgdb                         */
 #define CFG_CMD_PCMCIA         0x00000400ULL   /* PCMCIA support               */
 #define CFG_CMD_IDE            0x00000800ULL   /* IDE harddisk support         */
 #define CFG_CMD_PCI            0x00001000ULL   /* pciinfo                      */
index 8536a99c0cb43c5e4156ee15d534b6a9d9288652..d2570a803ea45eb96b924c956e015a3d3f7df65d 100644 (file)
@@ -208,8 +208,8 @@ extern ulong load_addr;             /* Default Load Address */
 /* common/cmd_nvedit.c */
 int    env_init     (void);
 void   env_relocate (void);
-char   *getenv      (uchar *);
-int    getenv_r     (uchar *name, uchar *buf, unsigned len);
+char   *getenv      (char *);
+int    getenv_r     (char *name, char *buf, unsigned len);
 int    saveenv      (void);
 #ifdef CONFIG_PPC              /* ARM version to be fixed! */
 void inline setenv   (char *, char *);
index c34d650aa2f887a51ba7e309bffb8217b5637a51..ba4b1a2bc8cdf373513d785e5a352dbe9c8689d0 100644 (file)
 
 #undef DEBUG
 
-#define CONFIG_405  1     /* This is a PPC405 CPU     */
-#define CONFIG_4xx  1     /* ...member of PPC4xx family   */
+#define CONFIG_405     1               /* This is a PPC405 CPU     */
+#define CONFIG_4xx     1               /* ...member of PPC4xx family   */
 
-#define CONFIG_AP1000  1   /* ...on an AP1000 board    */
+#define CONFIG_AP1000  1               /* ...on an AP1000 board    */
 
-#define CONFIG_PCI 1
+#define CONFIG_PCI     1
 
-#define CFG_HUSH_PARSER                1       /* use "hush" command parser    */
-#define CFG_PROMPT                     "0> "
+#define CFG_HUSH_PARSER 1              /* use "hush" command parser    */
+#define CFG_PROMPT             "0> "
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#define CONFIG_COMMAND_EDIT 1
-#define CONFIG_COMMAND_HISTORY 1
+#define CONFIG_COMMAND_EDIT    1
+#define CONFIG_COMMAND_HISTORY 1
 #define CONFIG_COMPLETE_ADDRESSES 1
 
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 #endif
 
-#define CONFIG_BAUDRATE            57600
-#define CONFIG_BOOTDELAY    3  /* autoboot after 3 seconds */
+#define CONFIG_BAUDRATE                57600
+#define CONFIG_BOOTDELAY       3       /* autoboot after 3 seconds */
 
-#define CONFIG_BOOTCOMMAND  ""     /* autoboot command */
+#define CONFIG_BOOTCOMMAND     ""      /* autoboot command */
 
 /* Size (bytes) of interrupt driven serial port buffer.
  * Set to 0 to use polling instead of interrupts.
  */
 #undef CONFIG_SERIAL_SOFTWARE_FIFO
 
-#define CONFIG_BOOTARGS            "console=ttyS0,57600"
+#define CONFIG_BOOTARGS                "console=ttyS0,57600"
 
-#define CONFIG_LOADS_ECHO   1  /* echo on for serial download  */
-#define CFG_LOADS_BAUD_CHANGE  1   /* allow baudrate change    */
+#define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
+#define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#define CONFIG_COMMANDS               ( (CONFIG_CMD_DFL & \
-               (~CFG_CMD_RTC) & ~(CFG_CMD_I2C)) | \
-               CFG_CMD_IRQ | \
-               CFG_CMD_PCI | \
-               CFG_CMD_DHCP | \
-               CFG_CMD_ASKENV | \
-               CFG_CMD_ELF  | \
-               CFG_CMD_PING | \
-               CFG_CMD_MVENV  \
+#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
+                               CFG_CMD_ASKENV  | \
+                               CFG_CMD_DHCP    | \
+                               CFG_CMD_ELF     | \
+                               CFG_CMD_IRQ     | \
+                               CFG_CMD_MVENV   | \
+                               CFG_CMD_PCI     | \
+                               CFG_CMD_PING    \
                               )
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
-#undef CONFIG_WATCHDOG         /* watchdog disabled        */
+#undef CONFIG_WATCHDOG                 /* watchdog disabled        */
 
-#define CONFIG_SYS_CLK_FREQ 30000000
+#define CONFIG_SYS_CLK_FREQ    30000000
 
-#define CONFIG_SPD_EEPROM      1       /* use SPD EEPROM for setup    */
+#define CONFIG_SPD_EEPROM      1       /* use SPD EEPROM for setup    */
 
 /*
  * Miscellaneous configurable options
  */
-#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_LONGHELP                   /* undef to save memory     */
 #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
 /* usually: (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) */
-#define CFG_PBSIZE (CFG_CBSIZE+4+16) /* Print Buffer Size */
-#define CFG_MAXARGS 16     /* max number of command args   */
-#define CFG_BARGSIZE   CFG_CBSIZE  /* Boot Argument Buffer Size    */
+#define CFG_PBSIZE     (CFG_CBSIZE+4+16)       /* Print Buffer Size */
+#define CFG_MAXARGS    16              /* max number of command args   */
+#define CFG_BARGSIZE   CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
-#define CFG_ALT_MEMTEST            1
-#define CFG_MEMTEST_START   0x00400000 /* memtest works on */
-#define CFG_MEMTEST_END            0x01000000  /* 4 ... 16 MB in DRAM  */
+#define CFG_ALT_MEMTEST                1
+#define CFG_MEMTEST_START      0x00400000      /* memtest works on */
+#define CFG_MEMTEST_END                0x01000000      /* 4 ... 16 MB in DRAM  */
 
 /*
  * If CFG_EXT_SERIAL_CLOCK, then the UART divisor is 1.
  * If CFG_405_UART_ERRATA_59 and 200MHz CPU clock,
  * set Linux BASE_BAUD to 403200.
  */
-#undef CFG_EXT_SERIAL_CLOCK           /* external serial clock */
-#undef CFG_405_UART_ERRATA_59         /* 405GP/CR Rev. D silicon */
-
-#define CFG_NS16550_CLK            40000000
-#define CFG_DUART_CHAN     0
-#define CFG_NS16550_COM1    (0x4C000000 + 0x1000)
-#define CFG_NS16550_COM2    (0x4C800000 + 0x1000)
-#define CFG_NS16550_REG_SIZE 4
-#define CFG_NS16550 1
-#define CFG_INIT_CHAN1  1
-#define CFG_INIT_CHAN2  0
+#undef CFG_EXT_SERIAL_CLOCK            /* external serial clock */
+#undef CFG_405_UART_ERRATA_59          /* 405GP/CR Rev. D silicon */
+
+#define CFG_NS16550_CLK                40000000
+#define CFG_DUART_CHAN         0
+#define CFG_NS16550_COM1       (0x4C000000 + 0x1000)
+#define CFG_NS16550_COM2       (0x4C800000 + 0x1000)
+#define CFG_NS16550_REG_SIZE   4
+#define CFG_NS16550            1
+#define CFG_INIT_CHAN1         1
+#define CFG_INIT_CHAN2         0
 
 /* The following table includes the supported baudrates */
 #define CFG_BAUDRATE_TABLE  \
     {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
 
-#define CFG_LOAD_ADDR      0x00100000  /* default load address */
-#define CFG_EXTBDINFO      1   /* To use extended board_into (bd_t) */
+#define CFG_LOAD_ADDR          0x00200000      /* default load address */
+#define CFG_EXTBDINFO          1               /* To use extended board_into (bd_t) */
 
-#define CFG_HZ     1000        /* decrementer freq: 1 ms ticks */
+#define CFG_HZ                 1000            /* decrementer freq: 1 ms ticks */
 
 /*-----------------------------------------------------------------------
  * Start addresses for the final memory configuration
  * (Set up by the startup code)
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
-#define CFG_SDRAM_BASE     0x00000000
-#define CFG_FLASH_BASE     0x20000000
-#define CFG_MONITOR_BASE    TEXT_BASE
-#define CFG_MONITOR_LEN            (192 * 1024)    /* Reserve 196 kB for Monitor   */
-#define CFG_MALLOC_LEN     (128 * 1024)    /* Reserve 128 kB for malloc()  */
+#define CFG_SDRAM_BASE         0x00000000
+#define CFG_FLASH_BASE         0x20000000
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_MONITOR_LEN                (192 * 1024)    /* Reserve 196 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 * 1024)    /* Reserve 128 kB for malloc()  */
 
 /*
  * 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 */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
-#define CFG_FLASH_CFI      1
-#define CFG_PROGFLASH_BASE  CFG_FLASH_BASE
-#define CFG_CONFFLASH_BASE  0x24000000
+#define CFG_FLASH_CFI          1
+#define CFG_PROGFLASH_BASE     CFG_FLASH_BASE
+#define CFG_CONFFLASH_BASE     0x24000000
 
-#define CFG_MAX_FLASH_BANKS 2  /* max number of memory banks       */
-#define CFG_MAX_FLASH_SECT  256 /* max number of sectors on one chip   */
+#define CFG_MAX_FLASH_BANKS    2       /* max number of memory banks       */
+#define CFG_MAX_FLASH_SECT     256     /* 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_WRITE_TOUT   500     /* Timeout for Flash Write (in ms)      */
 
-#define CFG_FLASH_PROTECTION   1   /* use hardware protection      */
+#define CFG_FLASH_PROTECTION   1       /* use hardware protection          */
 
 /* BEG ENVIRONNEMENT FLASH */
 #ifdef CFG_ENV_IS_IN_FLASH
-#define CFG_ENV_OFFSET     0x00040000 /* Offset of Environment Sector  */
-#define CFG_ENV_SIZE       0x1000  /* Total Size of Environment Sector */
-#define CFG_ENV_SECT_SIZE   0x20000 /* see README - env sector total size   */
+#define CFG_ENV_OFFSET         0x00040000 /* Offset of Environment Sector      */
+#define CFG_ENV_SIZE           0x1000  /* Total Size of Environment Sector */
+#define CFG_ENV_SECT_SIZE      0x20000 /* see README - env sector total size   */
 #endif
 /* END ENVIRONNEMENT FLASH */
 /*-----------------------------------------------------------------------
  * NVRAM organization
  */
-#define CFG_NVRAM_BASE_ADDR 0xf0000000 /* NVRAM base address   */
-#define CFG_NVRAM_SIZE     0x1ff8      /* NVRAM size   */
+#define CFG_NVRAM_BASE_ADDR    0xf0000000      /* NVRAM base address   */
+#define CFG_NVRAM_SIZE         0x1ff8          /* NVRAM size   */
 
 #ifdef CFG_ENV_IS_IN_NVRAM
-#define CFG_ENV_SIZE       0x1000      /* Size of Environment vars */
+#define CFG_ENV_SIZE           0x1000          /* Size of Environment vars */
 #define CFG_ENV_ADDR       \
     (CFG_NVRAM_BASE_ADDR+CFG_NVRAM_SIZE-CFG_ENV_SIZE)  /* Env  */
 #endif
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
-#define CFG_DCACHE_SIZE            16384
-#define CFG_CACHELINE_SIZE  32
+#define CFG_DCACHE_SIZE                16384
+#define CFG_CACHELINE_SIZE     32
 #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
 
 /*
  * BR0/1 and OR0/1 (FLASH)
  */
 
-#define FLASH_BASE0_PRELIM  CFG_FLASH_BASE  /* FLASH bank #0   */
-#define FLASH_BASE1_PRELIM  0      /* FLASH bank #1    */
+#define FLASH_BASE0_PRELIM     CFG_FLASH_BASE  /* FLASH bank #0        */
+#define FLASH_BASE1_PRELIM     0               /* FLASH bank #1        */
 
 /* Configuration Port location */
-#define CONFIG_PORT_ADDR    0xF0000500
+#define CONFIG_PORT_ADDR       0xF0000500
 
 /*-----------------------------------------------------------------------
  * Definitions for initial stack pointer and data area (in DPRAM)
 
 #define CFG_INIT_RAM_ADDR      0x400000  /* inside of SDRAM                     */
 #define CFG_INIT_RAM_END       0x2000  /* End of used area in RAM             */
-#define CFG_GBL_DATA_SIZE      128  /* size in bytes reserved for initial data */
-#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
 /*-----------------------------------------------------------------------
  *
  * Boot Flags
  */
-#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              */
 
 #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 */
+#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /* JFFS2 stuff */
 
-#define CFG_JFFS2_FIRST_BANK 0
-#define CFG_JFFS2_NUM_BANKS 1
-#define CFG_JFFS2_FIRST_SECTOR 1
+#define CFG_JFFS2_FIRST_BANK   0
+#define CFG_JFFS2_NUM_BANKS    1
+#define CFG_JFFS2_FIRST_SECTOR 1
 
 #define CONFIG_NET_MULTI
 #define CONFIG_E1000
 
-#define CFG_ETH_DEV_FN    0x0800
-#define CFG_ETH_IOBASE    0x31000000
-#define CFG_ETH_MEMBASE           0x32000000
+#define CFG_ETH_DEV_FN         0x0800
+#define CFG_ETH_IOBASE         0x31000000
+#define CFG_ETH_MEMBASE                0x32000000
 
 #endif /* __CONFIG_H */
index b53e85edae8f7234047f74d269f434588e205abb..3ac567b4d93e110446f8e3eae7d02efac1a5a00b 100644 (file)
 #define CFG_LCD_MEM             CFG_LCD_BIG_MEM
 #define CFG_LCD_REG             CFG_LCD_BIG_REG
 
-#define CFG_LCD_LOGO_MAX_SIZE   (1024*1024)
+#define CFG_VIDEO_LOGO_MAX_SIZE (1 << 20)
 
 /*-----------------------------------------------------------------------
  * Definitions for initial stack pointer and data area (in data cache)
index dd29be0e6a3c21142140b4a3c637c92574b68e12..131c21555d3e674fefddb0ccf6556611e56e9555 100644 (file)
@@ -88,7 +88,7 @@
 #define CFG_CONSOLE_IS_IN_ENV
 #define CONFIG_SPLASH_SCREEN
 #define CONFIG_VIDEO_BMP_GZIP          /* gzip compressed bmp images   */
-#define CFG_VIDEO_LOGO_MAX_SIZE        (1024*1024)     /* for decompressed img */
+#define CFG_VIDEO_LOGO_MAX_SIZE        (2 << 20)       /* for decompressed img */
 
 #define ADD_BMP_CMD            CFG_CMD_BMP
 #else
 #define CFG_FLASH_BASE         0xFFF80000
 #define CFG_MONITOR_BASE       TEXT_BASE
 #define CFG_MONITOR_LEN                (512 * 1024)    /* Reserve 512 kB for Monitor   */
-#define CFG_MALLOC_LEN         (2 * 1024*1024) /* Reserve 2 MB for malloc()    */
+#define CFG_MALLOC_LEN         (4 << 20)       /* Reserve 4 MB for malloc()    */
 
 #if (CFG_MONITOR_BASE < FLASH_BASE0_PRELIM)
 # define CFG_RAMBOOT           1
 #define CFG_LCD_SMALL_MEM       0xF1400000  /* Epson S1D13704 Mem Base Address  */
 #define CFG_LCD_SMALL_REG       0xF140FFE0  /* Epson S1D13704 Reg Base Address  */
 
-#define CFG_LCD_LOGO_MAX_SIZE   (1024*1024)
-
 /*-----------------------------------------------------------------------
  * Universal Interrupt Controller (UIC) Setup
  */
index d24d05f25e1bd12a3cef9cba121306d24118fb8c..cd04c1ad5a373951581abcb2453d772589940b7c 100644 (file)
 #define SCL            0x1000          /* PA 3 */
 #define SDA            0x2000          /* PA 2 */
 
-#define PAR            immr->im_ioport.iop_papar
-#define DIR            immr->im_ioport.iop_padir
-#define DAT            immr->im_ioport.iop_padat
-
-#define I2C_INIT       {PAR &= ~(SCL | SDA); DIR |=  SCL;}
-#define I2C_ACTIVE     (DIR |=  SDA)
-#define I2C_TRISTATE   (DIR &= ~SDA)
-#define I2C_READ       ((DAT & SDA) != 0)
-#define I2C_SDA(bit)   if (bit) DAT |=  SDA; \
-                       else DAT &= ~SDA
-#define I2C_SCL(bit)   if (bit) DAT |=  SCL; \
-                       else DAT &= ~SCL
-#define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
+#define __I2C_DIR      immr->im_ioport.iop_padir
+#define __I2C_DAT      immr->im_ioport.iop_padat
+#define __I2C_PAR      immr->im_ioport.iop_papar
+#define        I2C_INIT        { __I2C_PAR &= ~(SDA|SCL);      \
+                         __I2C_DIR |= (SDA|SCL);       }
+#define        I2C_READ        ((__I2C_DAT & SDA) ? 1 : 0)
+#define        I2C_SDA(x)      { if (x) __I2C_DAT |= SDA; else __I2C_DAT &= ~SDA; }
+#define        I2C_SCL(x)      { if (x) __I2C_DAT |= SCL; else __I2C_DAT &= ~SCL; }
+#define        I2C_DELAY       { udelay(5); }
+#define        I2C_ACTIVE      { __I2C_DIR |= SDA; }
+#define        I2C_TRISTATE    { __I2C_DIR &= ~SDA; }
 
 #define CONFIG_RTC_PCF8563
 #define CFG_I2C_RTC_ADDR               0x51
index af06efcb32896a05b644ae02e7c895c7ba7adc99..0b8c71d852bd70063d1a6c8d04c8d41bb4bcec8d 100644 (file)
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP                 /* do pci plug-and-play */
 
-#define        CONFIG_EEPRO100
+/* #define CONFIG_EEPRO100     XXX - FIXME: conflicts when CONFIG_MII is enabled */
 #define        CONFIG_E1000
 #undef CONFIG_TULIP
 
index af74f9dc07d4b7a733186de13743312569813a89..99a7b08e4d60c2d052ecf342a27d0743caa2bd3a 100644 (file)
 #if defined (CONFIG_SOFT_I2C)
 #define        SDA     0x00010
 #define        SCL     0x00020
-#define DIR immr->im_cpm.cp_pbdir
-#define DAT    immr->im_cpm.cp_pbdat
-#define PAR    immr->im_cpm.cp_pbpar
-#define        ODR     immr->im_cpm.cp_pbodr
-#define        I2C_INIT        {PAR&=~(SDA|SCL);ODR&=~(SDA|SCL);DAT|=(SDA|SCL);DIR|=(SDA|SCL);}
-#define        I2C_READ        ((DAT&SDA)?1:0)
-#define        I2C_SDA(x)      {if(x)DAT|=SDA;else DAT&=~SDA;}
-#define        I2C_SCL(x)      {if(x)DAT|=SCL;else DAT&=~SCL;}
-#define        I2C_DELAY       {udelay(5);}
-#define        I2C_ACTIVE       {DIR|=SDA;}
-#define        I2C_TRISTATE {DIR&=~SDA;}
+#define __I2C_DIR      immr->im_cpm.cp_pbdir
+#define __I2C_DAT      immr->im_cpm.cp_pbdat
+#define __I2C_PAR      immr->im_cpm.cp_pbpar
+#define        __I2C_ODR       immr->im_cpm.cp_pbodr
+#define        I2C_INIT        { __I2C_PAR &= ~(SDA|SCL);      \
+                         __I2C_ODR &= ~(SDA|SCL);      \
+                         __I2C_DAT |= (SDA|SCL);       \
+                         __I2C_DIR|=(SDA|SCL); }
+#define        I2C_READ        ((__I2C_DAT & SDA) ? 1 : 0)
+#define        I2C_SDA(x)      { if (x) __I2C_DAT |= SDA; else __I2C_DAT &= ~SDA; }
+#define        I2C_SCL(x)      { if (x) __I2C_DAT |= SCL; else __I2C_DAT &= ~SCL; }
+#define        I2C_DELAY       { udelay(5); }
+#define        I2C_ACTIVE      { __I2C_DIR |= SDA; }
+#define        I2C_TRISTATE    { __I2C_DIR &= ~SDA; }
 #endif
 
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
index 909d724abc46da6597c27c5b3bf0e741755e65fc..a57f7cf9ecb4c74f60f2975e24d08bcde24ea060 100644 (file)
@@ -83,7 +83,7 @@
 #define CONFIG_PCI_IO_SIZE     0x01000000
 
 #define CONFIG_NET_MULTI       1
-#define CONFIG_EEPRO100                1
+/* #define CONFIG_EEPRO100     XXX - FIXME: conflicts when CONFIG_MII is enabled */
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 #endif /* CONFIG_STK52XX */
index d2c230d563f7c6d26cff3f5e6fedbecc404008ee..04966d77a4a12347c751f74a238b3ee1cd9623aa 100644 (file)
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP                 /* do pci plug-and-play */
 
-#define CONFIG_EEPRO100
+/* #define CONFIG_EEPRO100     XXX - FIXME: conflicts when CONFIG_MII is enabled */
 #undef CONFIG_TULIP
 
 #if !defined(CONFIG_PCI_PNP)
index b3ce3da822c054cb853d316df4da5ba5a0845ea4..3ca137e53aca281879073e572b2fc476986ee83e 100644 (file)
 #define CFG_LCD_SMALL_MEM       0xF1400000  /* Epson S1D13704 Mem Base Address  */
 #define CFG_LCD_SMALL_REG       0xF140FFE0  /* Epson S1D13704 Reg Base Address  */
 
-#define CFG_LCD_LOGO_MAX_SIZE   (1024*1024)
+#define CFG_VIDEO_LOGO_MAX_SIZE (1 << 20)
 
 /*-----------------------------------------------------------------------
  * FPGA stuff
index 217c00f71b1eda6e933ea537a9a73da31aa59105..624fa1d6e28da082884ff61b96529ffde8e3faed 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #define CFG_ENV_OFFSET         0x000047A4      /* Offset of Environment Sector */
 #define CFG_ENV_SIZE           0x00002000      /* Total Size of Environment Sector */
-#define ENV_CRC                        0x8BF6F24B
+/* #define ENV_CRC             0x8BF6F24B      XXX - FIXME: gets defined automatically */
 
 #define CFG_MALLOC_LEN         (512 << 10)     /* Reserve 512 kB for malloc()  */
 
index ffa2678598a8927a7283baa3cb2f420eb3eac9bf..62b90e85fde99a0d1151dd706bdf0f56459db0ed 100644 (file)
@@ -69,7 +69,7 @@
 #define CFG_XLB_PIPELINING     1
 
 #define CONFIG_NET_MULTI       1
-#define CONFIG_EEPRO100                1
+/* #define CONFIG_EEPRO100     XXX - FIXME: conflicts when CONFIG_MII is enabled */
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 
index f6e6a609cf2415b69c20155b65e7754db476d882..3ffe6b2e05f429aeea8443f51821f143cc12fc39 100644 (file)
@@ -574,19 +574,15 @@ typedef unsigned int led_id_t;
 #define CONFIG_CRC32_VERIFY    1
 #define CONFIG_HUSH_OLD_PARSER_COMPATIBLE      1
 
-/* Note: change below for your network setting!!!
- * This was done just to facilitate manufacturing test and configuration.
- */
-#define CONFIG_ETHADDR  00:e0:0c:07:9b:8a
+/*****************************************************************************/
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_FLAT_TREE    1
 
-#define CONFIG_SERVERIP        192.168.08.1
-#define CONFIG_IPADDR                  192.168.08.85
-#define CONFIG_GATEWAYIP       192.168.08.1
-#define CONFIG_NETMASK         255.255.255.0
-#define CONFIG_HOSTNAME        stx_xtc
-#define CONFIG_ROOTPATH        /xtcroot
-#define CONFIG_BOOTFILE        uImage
-#define CONFIG_LOADADDR                0x1000000
+/* maximum size of the flat tree (8K) */
+#define OF_FLAT_TREE_MAX_SIZE  8192
 
+#define OF_CPU                 "PowerPC,MPC870@0"
+#define OF_TBCLK               (MPC8XX_HZ / 16)
 
 #endif /* __CONFIG_H */
index 6381cfcc7e98c654d24136edb382bf1878eab0c2..decb046c53c8477bc31fffaf465561979160dcaa 100644 (file)
@@ -83,7 +83,7 @@ extern int flash_sect_protect (int flag, ulong addr_first, ulong addr_last);
 
 /* common/flash.c */
 extern void flash_protect (int flag, ulong from, ulong to, flash_info_t *info);
-extern int flash_write (uchar *, ulong, ulong);
+extern int flash_write (char *, ulong, ulong);
 extern flash_info_t *addr2info (ulong);
 extern int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt);
 
index 782b58e7e6382bb271ca43b9824979e421526435..a038aa189577a749f476bed4c46c7ef52d48f8d3 100644 (file)
@@ -73,7 +73,7 @@ typedef struct {               /* typedef fpga_desc */
 /* root function definitions */
 extern void fpga_init( ulong reloc_off );
 extern int fpga_add( fpga_type devtype, void *desc );
-extern const int fpga_count( void );
+extern int fpga_count( void );
 extern int fpga_load( int devnum, void *buf, size_t bsize );
 extern int fpga_dump( int devnum, void *buf, size_t bsize );
 extern int fpga_info( int devnum );
diff --git a/include/ft_build.h b/include/ft_build.h
new file mode 100644 (file)
index 0000000..9104b1a
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * OF Flat tree builder
+ *
+ */
+
+#ifndef FT_BUILD_H
+#define FT_BUILD_H
+
+#include <linux/types.h>
+#include <asm/u-boot.h>
+
+/* Definitions used by the flattened device tree */
+#define OF_DT_HEADER           0xd00dfeed      /* marker */
+#define OF_DT_BEGIN_NODE       0x1     /* Start of node, full name */
+#define OF_DT_END_NODE         0x2     /* End node */
+#define OF_DT_PROP             0x3     /* Property: name off, size,
+                                        * content */
+#define OF_DT_NOP              0x4     /* nop */
+#define OF_DT_END              0x9
+
+#define OF_DT_VERSION          0x10
+
+struct boot_param_header {
+       u32 magic;              /* magic word OF_DT_HEADER */
+       u32 totalsize;          /* total size of DT block */
+       u32 off_dt_struct;      /* offset to structure */
+       u32 off_dt_strings;     /* offset to strings */
+       u32 off_mem_rsvmap;     /* offset to memory reserve map */
+       u32 version;            /* format version */
+       u32 last_comp_version;  /* last compatible version */
+       /* version 2 fields below */
+       u32 boot_cpuid_phys;    /* Physical CPU id we're booting on */
+       /* version 3 fields below */
+       u32 dt_strings_size;    /* size of the DT strings block */
+};
+
+struct ft_cxt {
+       struct boot_param_header *bph;
+       int max_size;           /* maximum size of tree */
+       int overflow;           /* set when this happens */
+       u8 *p, *pstr, *pres;    /* running pointers */
+       u8 *p_begin, *pstr_begin, *pres_begin;  /* starting pointers */
+       u8 *p_anchor;           /* start of constructed area */
+       int struct_size, strings_size, res_size;
+};
+
+void ft_begin_node(struct ft_cxt *cxt, const char *name);
+void ft_end_node(struct ft_cxt *cxt);
+
+void ft_begin_tree(struct ft_cxt *cxt);
+int ft_end_tree(struct ft_cxt *cxt);
+
+void ft_nop(struct ft_cxt *cxt);
+void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz);
+void ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
+void ft_prop_int(struct ft_cxt *cxt, const char *name, int val);
+void ft_begin(struct ft_cxt *cxt, void *blob, int max_size);
+void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
+
+void ft_setup(void *blob, int size, bd_t * bd);
+
+void ft_dump_blob(const void *bphp);
+void ft_merge_blob(struct ft_cxt *cxt, void *blob);
+void *ft_get_prop(void *bphp, const char *propname, int *szp);
+
+#endif
index 03468f70864c7af36fbffe084176a9fc3d684a81..b1d570e528ef9215ce9b9d76e8cc20fbb677d380 100644 (file)
@@ -96,7 +96,7 @@
 #endif /* OPTIMIZE */
 
 
-static __inline__ __const__ __u16 __fswab16(__u16 x)
+static __inline__ __attribute__((const)) __u16 __fswab16(__u16 x)
 {
        return __arch__swab16(x);
 }
@@ -109,7 +109,7 @@ static __inline__ void __swab16s(__u16 *addr)
        __arch__swab16s(addr);
 }
 
-static __inline__ __const__ __u32 __fswab32(__u32 x)
+static __inline__ __attribute__((const)) __u32 __fswab32(__u32 x)
 {
        return __arch__swab32(x);
 }
@@ -123,7 +123,7 @@ static __inline__ void __swab32s(__u32 *addr)
 }
 
 #ifdef __BYTEORDER_HAS_U64__
-static __inline__ __const__ __u64 __fswab64(__u64 x)
+static __inline__ __attribute__((const)) __u64 __fswab64(__u64 x)
 {
 #  ifdef __SWAB_64_THRU_32__
        __u32 h = x >> 32;
index 623d22508239b81466f61bea037db7d070f1132f..47eab59dde2c5b6a9132dde1b49fd5d63911430d 100644 (file)
@@ -453,7 +453,7 @@ extern IPaddr_t getenv_IPaddr (char *);
 extern ushort getenv_VLAN(char *);
 
 /* copy a filename (allow for "..." notation, limit length) */
-extern void    copy_filename (uchar *dst, uchar *src, int size);
+extern void    copy_filename (char *dst, char *src, int size);
 
 /**********************************************************************/
 
index b1c6ab0e4ec3987b3783b1bd58f60ae5f138e2eb..c3ce33f9ee807bbee5ded9a66caa011bb7d5d3f6 100644 (file)
@@ -186,7 +186,7 @@ typedef int (init_fnc_t) (void);
 
 static int init_baudrate (void)
 {
-       uchar tmp[64];  /* long enough for environment variables */
+       char tmp[64];   /* long enough for environment variables */
        int i = getenv_r ("baudrate", tmp, sizeof (tmp));
 
        gd->baudrate = (i > 0)
@@ -401,8 +401,8 @@ void board_init_f (ulong bootflag)
        /*
         * reserve protected RAM
         */
-       i = getenv_r ("pram", tmp, sizeof (tmp));
-       reg = (i > 0) ? simple_strtoul (tmp, NULL, 10) : CONFIG_PRAM;
+       i = getenv_r ("pram", (char *)tmp, sizeof (tmp));
+       reg = (i > 0) ? simple_strtoul ((const char *)tmp, NULL, 10) : CONFIG_PRAM;
        addr -= (reg << 10);            /* size is in kB */
        debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
@@ -542,8 +542,8 @@ void board_init_f (ulong bootflag)
        bd->bi_baudrate = gd->baudrate; /* Console Baudrate     */
 
 #ifdef CFG_EXTBDINFO
-       strncpy (bd->bi_s_version, "1.2", sizeof (bd->bi_s_version));
-       strncpy (bd->bi_r_version, U_BOOT_VERSION, sizeof (bd->bi_r_version));
+       strncpy ((char *)bd->bi_s_version, "1.2", sizeof (bd->bi_s_version));
+       strncpy ((char *)bd->bi_r_version, U_BOOT_VERSION, sizeof (bd->bi_r_version));
 
        bd->bi_procfreq = gd->cpu_clk;  /* Processor Speed, In Hz */
        bd->bi_plb_busfreq = gd->bus_clk;
@@ -1042,8 +1042,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
                /* Also take the logbuffer into account (pram is in kB) */
                pram += (LOGBUFF_LEN+LOGBUFF_OVERHEAD)/1024;
 #endif
-               sprintf (memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
-               setenv ("mem", memsz);
+               sprintf ((char *)memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
+               setenv ("mem", (char *)memsz);
        }
 #endif
 
@@ -1081,6 +1081,41 @@ void hang (void)
 
 #ifdef CONFIG_MODEM_SUPPORT
 /* called from main loop (common/main.c) */
+/* 'inline' - We have to do it fast */
+static inline void mdm_readline(char *buf, int bufsiz)
+{
+       char c;
+       char *p;
+       int n;
+
+       n = 0;
+       p = buf;
+       for(;;) {
+               c = serial_getc();
+
+               /*              dbg("(%c)", c); */
+
+               switch(c) {
+               case '\r':
+                       break;
+               case '\n':
+                       *p = '\0';
+                       return;
+
+               default:
+                       if(n++ > bufsiz) {
+                               *p = '\0';
+                               return; /* sanity check */
+                       }
+                       *p = c;
+                       p++;
+                       break;
+               }
+       }
+}
+
+
+
 extern void  dbg(const char *fmt, ...);
 int mdm_init (void)
 {
@@ -1088,7 +1123,6 @@ int mdm_init (void)
        char *init_str;
        int i;
        extern char console_buffer[];
-       static inline void mdm_readline(char *buf, int bufsiz);
        extern void enable_putc(void);
        extern int hwflow_onoff(int);
 
@@ -1143,38 +1177,6 @@ int mdm_init (void)
        return 0;
 }
 
-/* 'inline' - We have to do it fast */
-static inline void mdm_readline(char *buf, int bufsiz)
-{
-       char c;
-       char *p;
-       int n;
-
-       n = 0;
-       p = buf;
-       for(;;) {
-               c = serial_getc();
-
-               /*              dbg("(%c)", c); */
-
-               switch(c) {
-               case '\r':
-                       break;
-               case '\n':
-                       *p = '\0';
-                       return;
-
-               default:
-                       if(n++ > bufsiz) {
-                               *p = '\0';
-                               return; /* sanity check */
-                       }
-                       *p = c;
-                       p++;
-                       break;
-               }
-       }
-}
 #endif
 
 #if 0 /* We could use plain global data, but the resulting code is bigger */
index b907351f25c5434969731cfa2bb587ecd860eba6..8c56c0845f3c61e977f95e4ff4bea932b2627101 100644 (file)
@@ -330,7 +330,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
        /* Retrieve extended information (we must parse the vendor area) */
        if (NetReadLong((ulong*)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
-               BootpVendorProcess(&bp->bp_vend[4], len);
+               BootpVendorProcess((uchar *)&bp->bp_vend[4], len);
 
        NetSetTimeout(0, (thand_f *)0);
 
@@ -387,7 +387,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
        u8 *x;
 #endif
 #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SEND_HOSTNAME)
-       uchar *hostname;
+       char *hostname;
 #endif
 
        *e++ = 99;              /* RFC1048 Magic Cookie */
@@ -578,7 +578,7 @@ BootpRequest (void)
        unsigned char bi_enetaddr[6];
        int   reg;
        char  *e,*s;
-       uchar tmp[64];
+       char tmp[64];
        ulong tst1, tst2, sum, m_mask, m_value = 0;
 
        if (BootpTry ==0) {
@@ -679,9 +679,9 @@ BootpRequest (void)
 
        /* Request additional information from the BOOTP/DHCP server */
 #if (CONFIG_COMMANDS & CFG_CMD_DHCP)
-       ext_len = DhcpExtended(bp->bp_vend, DHCP_DISCOVER, 0, 0);
+       ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
 #else
-       ext_len = BootpExtended(bp->bp_vend);
+       ext_len = BootpExtended((u8 *)bp->bp_vend);
 #endif /* CFG_CMD_DHCP */
 
        /*
@@ -836,7 +836,7 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
         * Copy options from OFFER packet if present
         */
        NetCopyIP(&OfferedIP, &bp->bp_yiaddr);
-       extlen = DhcpExtended(bp->bp_vend, DHCP_REQUEST, NetDHCPServerIP, OfferedIP);
+       extlen = DhcpExtended((u8 *)bp->bp_vend, DHCP_REQUEST, NetDHCPServerIP, OfferedIP);
 
        pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + extlen;
        iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + extlen;
@@ -882,7 +882,7 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
                        dhcp_state = REQUESTING;
 
                        if (NetReadLong((ulong*)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
-                               DhcpOptionsProcess(&bp->bp_vend[4]);
+                               DhcpOptionsProcess((u8 *)&bp->bp_vend[4]);
 
                        BootpCopyNetParams(bp); /* Store net params from reply */
 
@@ -897,11 +897,11 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
        case REQUESTING:
                debug ("DHCP State: REQUESTING\n");
 
-               if ( DhcpMessageType(bp->bp_vend) == DHCP_ACK ) {
+               if ( DhcpMessageType((u8 *)bp->bp_vend) == DHCP_ACK ) {
                        char *s;
 
                        if (NetReadLong((ulong*)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
-                               DhcpOptionsProcess(&bp->bp_vend[4]);
+                               DhcpOptionsProcess((u8 *)&bp->bp_vend[4]);
                        BootpCopyNetParams(bp); /* Store net params from reply */
                        dhcp_state = BOUND;
                        puts ("DHCP client bound to address ");
index fe1edd13ba83da29a7c5aa33c211c804e16951d6..cfab0e1e87f815e182cbe95bb3801d42a7753387 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -109,7 +109,7 @@ int eth_register(struct eth_device* dev)
 
 int eth_initialize(bd_t *bis)
 {
-       unsigned char enetvar[32], env_enetaddr[6];
+       char enetvar[32], env_enetaddr[6];
        int i, eth_number = 0;
        char *tmp, *end;
 
index 11b770004b11c2cde847b2190307039ab49689e1..d1a15e2a096d81a07a2e5c8fcb6d8f9240713784 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -810,6 +810,7 @@ static ushort CDP_compute_csum(const uchar *buff, ushort len)
        int     odd;
        ulong   result = 0;
        ushort  leftover;
+       ushort *p;
 
        if (len > 0) {
                odd = 1 & (ulong)buff;
@@ -819,7 +820,9 @@ static ushort CDP_compute_csum(const uchar *buff, ushort len)
                        buff++;
                }
                while (len > 1) {
-                       result += *((const ushort *)buff)++;
+                       p = (ushort *)buff;
+                       result += *p++;
+                       buff = (uchar *)p;
                        if (result & 0x80000000)
                                result = (result & 0xFFFF) + (result >> 16);
                        len -= 2;
@@ -1655,7 +1658,7 @@ NetSetIP(volatile uchar * xip, IPaddr_t dest, int dport, int sport, int len)
        ip->ip_sum   = ~NetCksum((uchar *)ip, IP_HDR_SIZE_NO_UDP / 2);
 }
 
-void copy_filename (uchar *dst, uchar *src, int size)
+void copy_filename (char *dst, char *src, int size)
 {
        if (*src && (*src == '"')) {
                ++src;
index 43c43368a056625adabef77bd60f627254163ccd..eca21d294eb3cae2dfbb7072142c61fc39b703e6 100644 (file)
@@ -78,7 +78,7 @@ store_block (unsigned block, uchar * src, unsigned len)
        }
 
        if (rc) { /* Flash is destination for this packet */
-               rc = flash_write ((uchar *)src, (ulong)(load_addr+offset), len);
+               rc = flash_write ((char *)src, (ulong)(load_addr+offset), len);
                if (rc) {
                        flash_perror (rc);
                        NetState = NETLOOP_FAIL;
index 0dac858ea49c7640c4d05356015a3b53d4184229..a10bc502d33e7ecce1befb347356bc1b5e9aa230 100644 (file)
@@ -224,7 +224,7 @@ const unsigned long long otherpattern = 0x0123456789abcdefULL;
 
 static int memory_post_dataline(unsigned long long * pmem)
 {
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof(pattern)/ sizeof(pattern[0]);
        int i;
        unsigned int hi, lo, pathi, patlo;
@@ -418,14 +418,14 @@ static int memory_post_tests (unsigned long start, unsigned long size)
        int ret = 0;
 
        if (ret == 0)
-               ret = memory_post_dataline ((long long *)start);
+               ret = memory_post_dataline ((unsigned long long *)start);
        WATCHDOG_RESET ();
        if (ret == 0)
-               ret = memory_post_addrline ((long *)start, (long *)start, size);
+               ret = memory_post_addrline ((ulong *)start, (ulong *)start, size);
        WATCHDOG_RESET ();
        if (ret == 0)
-               ret = memory_post_addrline ((long *)(start + size - 8),
-                                           (long *)start, size);
+               ret = memory_post_addrline ((ulong *)(start + size - 8),
+                                           (ulong *)start, size);
        WATCHDOG_RESET ();
        if (ret == 0)
                ret = memory_post_test1 (start, size, 0x00000000);