Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
authorTom Rini <trini@ti.com>
Thu, 4 Apr 2013 16:01:27 +0000 (12:01 -0400)
committerTom Rini <trini@ti.com>
Thu, 4 Apr 2013 16:01:27 +0000 (12:01 -0400)
186 files changed:
MAKEALL
Makefile
README
arch/arm/cpu/arm926ejs/spear/spear600.c
arch/arm/cpu/arm926ejs/spear/spl_boot.c
arch/blackfin/include/asm/posix_types.h
arch/m68k/lib/interrupts.c
arch/nds32/lib/interrupts.c
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c
board/LEOX/elpt860/u-boot.lds.debug
board/Marvell/common/memory.c
board/Marvell/db64360/mpsc.c
board/Marvell/db64360/mv_eth.h
board/Marvell/db64460/mpsc.c
board/Marvell/db64460/mv_eth.h
board/Marvell/include/core.h
board/RPXClassic/u-boot.lds.debug
board/RPXlite/u-boot.lds.debug
board/RPXlite_dw/u-boot.lds.debug
board/amcc/bamboo/bamboo.c
board/amcc/bamboo/bamboo.h
board/amcc/yucca/yucca.c
board/bf533-ezkit/flash-defines.h
board/bf533-ezkit/flash.c
board/bf533-stamp/video.h
board/cogent/u-boot.lds.debug
board/cray/L1/u-boot.lds.debug
board/eltec/mhpc/u-boot.lds.debug
board/emk/top860/u-boot.lds.debug
board/esd/common/lcd.c
board/esd/common/lcd.h
board/esd/cpci750/mpsc.c
board/esd/cpci750/mv_eth.h
board/esd/dasa_sim/cmd_dasa_sim.c
board/esd/pmc440/fpga.c
board/evb64260/eth_addrtbl.c
board/flagadm/u-boot.lds.debug
board/gen860t/fpga.c
board/genietv/u-boot.lds.debug
board/hermes/u-boot.lds.debug
board/hymod/u-boot.lds.debug
board/icu862/u-boot.lds.debug
board/ip860/u-boot.lds.debug
board/ivm/u-boot.lds.debug
board/kup/kup4k/u-boot.lds.debug
board/kup/kup4x/u-boot.lds.debug
board/lwmon/u-boot.lds.debug
board/matrix_vision/mvblx/mvblx.c
board/mbx8xx/u-boot.lds.debug
board/mousse/flash.c
board/mousse/u-boot.lds.ram
board/mousse/u-boot.lds.rom
board/mpl/common/isa.c
board/mpl/mip405/mip405.c
board/mpl/pip405/pip405.c
board/mpl/pip405/u-boot.lds.debug
board/netphone/u-boot.lds.debug
board/netta/u-boot.lds.debug
board/netta2/u-boot.lds.debug
board/netvia/u-boot.lds.debug
board/nx823/u-boot.lds.debug
board/prodrive/p3mx/mpsc.c
board/prodrive/p3mx/mv_eth.h
board/quantum/u-boot.lds.debug
board/sacsng/clkinit.c
board/sacsng/clkinit.h
board/sandburst/karef/u-boot.lds.debug
board/sandburst/metrobox/u-boot.lds.debug
board/spd8xx/u-boot.lds.debug
board/spear/x600/fpga.c
board/stx/stxxtc/u-boot.lds.debug
board/svm_sc8xx/u-boot.lds.debug
board/teejet/mt_ventoux/mt_ventoux.c
board/w7o/u-boot.lds.debug
board/xes/xpedite1000/u-boot.lds.debug
common/bedbug.c
common/cmd_bedbug.c
common/cmd_fdc.c
common/cmd_mmc.c
common/cmd_scsi.c
common/dlmalloc.c
common/dlmalloc.src
common/env_dataflash.c
common/env_eeprom.c
common/env_fat.c
common/env_mmc.c
common/env_nand.c
common/env_nvram.c
common/env_onenand.c
common/env_sf.c
disk/part_efi.c
doc/README.fdt-control
drivers/bios_emulator/atibios.c
drivers/bios_emulator/besys.c
drivers/bios_emulator/bios.c
drivers/bios_emulator/include/biosemu.h
drivers/bios_emulator/x86emu/debug.c
drivers/block/ahci.c
drivers/block/sata_dwc.c
drivers/block/sata_dwc.h
drivers/block/sym53c8xx.c
drivers/fpga/ACEX1K.c
drivers/fpga/altera.c
drivers/fpga/cyclon2.c
drivers/fpga/lattice.c
drivers/fpga/spartan2.c
drivers/fpga/spartan3.c
drivers/fpga/virtex2.c
drivers/fpga/xilinx.c
drivers/mtd/nand/mxc_nand.c
drivers/net/armada100_fec.c
drivers/net/armada100_fec.h
drivers/net/e1000.c
drivers/net/e1000.h
drivers/net/e1000_spi.c
drivers/net/ne2000_base.h
drivers/net/npe/IxEthAcc.c
drivers/net/npe/IxEthAccCommon.c
drivers/net/npe/IxEthAccDataPlane.c
drivers/net/npe/IxEthAccMac.c
drivers/net/npe/IxEthDBAPI.c
drivers/net/npe/IxEthDBAPISupport.c
drivers/net/npe/IxEthDBCore.c
drivers/net/npe/IxEthDBEvents.c
drivers/net/npe/IxEthDBFeatures.c
drivers/net/npe/IxEthDBFirewall.c
drivers/net/npe/IxEthDBLearning.c
drivers/net/npe/IxEthDBNPEAdaptor.c
drivers/net/npe/IxEthDBPortUpdate.c
drivers/net/npe/IxEthDBReports.c
drivers/net/npe/IxEthDBSearch.c
drivers/net/npe/IxEthDBSpanningTree.c
drivers/net/npe/IxEthDBUtil.c
drivers/net/npe/IxEthDBVlan.c
drivers/net/npe/IxEthMii.c
drivers/net/npe/IxFeatureCtrl.c
drivers/net/npe/IxNpeDl.c
drivers/net/npe/IxNpeDlImageMgr.c
drivers/net/npe/IxNpeDlNpeMgr.c
drivers/net/npe/IxNpeMh.c
drivers/net/npe/IxNpeMhConfig.c
drivers/net/npe/IxNpeMhSend.c
drivers/net/npe/IxOsalOsSemaphore.c
drivers/net/npe/IxQMgrDispatcher.c
drivers/net/npe/IxQMgrInit.c
drivers/net/npe/IxQMgrQCfg.c
drivers/net/npe/include/IxAtmdAccCtrl.h
drivers/net/npe/include/IxEthAcc_p.h
drivers/net/npe/include/IxEthDB.h
drivers/net/npe/include/IxEthDB_p.h
drivers/net/npe/include/IxEthMii.h
drivers/net/npe/include/IxFeatureCtrl.h
drivers/net/npe/include/IxHssAcc.h
drivers/net/npe/include/IxNpeDl.h
drivers/net/npe/include/IxNpeDlNpeMgrUtils_p.h
drivers/net/npe/include/IxNpeDlNpeMgr_p.h
drivers/net/npe/include/IxNpeMhConfig_p.h
drivers/net/npe/include/IxOsal.h
drivers/net/npe/include/IxOsalTypes.h
drivers/net/npe/include/IxPerfProfAcc.h
drivers/net/npe/include/IxQMgrAqmIf_p.h
drivers/net/npe/include/IxSspAcc.h
drivers/net/npe/include/IxTimeSyncAcc.h
drivers/net/npe/npe.c
drivers/rtc/ds1374.c
drivers/serial/usbtty.c
drivers/spi/ich.c
drivers/usb/musb-new/linux-compat.h
dts/Makefile
fs/ext4/ext4_common.h
fs/ext4/ext4_journal.c
include/at91rm9200_net.h
include/bedbug/ppc.h
include/fpga.h
include/galileo/core.h
include/linux/mtd/nand.h
include/linux/types.h
include/linux/usb/gadget.h
include/malloc.h
include/scsi.h
include/sym53c8xx.h
include/usbdevice.h
include/xyzModem.h

diff --git a/MAKEALL b/MAKEALL
index 91fa495..2737eab 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -664,7 +664,7 @@ build_target() {
        export BUILD_DIR="${output_dir}"
 
        target_arch=$(get_target_arch ${target})
-       eval cross_toolchain=\$CROSS_COMPILE_${target_arch^^}
+       eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
        if [ "${cross_toolchain}" ] ; then
            MAKE="make CROSS_COMPILE=${cross_toolchain}"
        elif [ "${CROSS_COMPILE}" ] ; then
index d60a14b..db7561c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@
 VERSION = 2013
 PATCHLEVEL = 04
 SUBLEVEL =
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 ifneq "$(SUBLEVEL)" ""
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 else
@@ -406,8 +406,10 @@ ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
-ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
+ifneq ($(CONFIG_SPL_TARGET),)
+ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
+endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
 ifneq ($(CONFIG_TEGRA),)
diff --git a/README b/README
index a35ef31..5701016 100644 (file)
--- a/README
+++ b/README
@@ -496,6 +496,13 @@ The following options need to be configured:
                exists, unlike the similar options in the Linux kernel. Do not
                set these options unless they apply!
 
+- CPU timer options:
+               CONFIG_SYS_HZ
+
+               The frequency of the timer returned by get_timer().
+               get_timer() must operate in milliseconds and this CONFIG
+               option must be set to 1000.
+
 - Linux Kernel Interface:
                CONFIG_CLOCKS_IN_MHZ
 
@@ -1938,15 +1945,15 @@ CBFS (Coreboot Filesystem) support
 
                I2C_READ
 
-               Code that returns TRUE if the I2C data line is high,
-               FALSE if it is low.
+               Code that returns true if the I2C data line is high,
+               false if it is low.
 
                eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
 
                I2C_SDA(bit)
 
-               If <bit> is TRUE, sets the I2C data line high. If it
-               is FALSE, it clears it (low).
+               If <bit> is true, sets the I2C data line high. If it
+               is false, it clears it (low).
 
                eg: #define I2C_SDA(bit) \
                        if(bit) immr->im_cpm.cp_pbdat |=  PB_SDA; \
@@ -1954,8 +1961,8 @@ CBFS (Coreboot Filesystem) support
 
                I2C_SCL(bit)
 
-               If <bit> is TRUE, sets the I2C clock line high. If it
-               is FALSE, it clears it (low).
+               If <bit> is true, sets the I2C clock line high. If it
+               is false, it clears it (low).
 
                eg: #define I2C_SCL(bit) \
                        if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \
index ff52131..9f0c1d1 100644 (file)
@@ -28,9 +28,6 @@
 #include <asm/arch/spr_misc.h>
 #include <asm/arch/spr_defs.h>
 
-#define FALSE                          0
-#define TRUE                           (!FALSE)
-
 static void sel_1v8(void)
 {
        struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
@@ -133,8 +130,8 @@ void soc_init(void)
 /*
  * xxx_boot_selected:
  *
- * return TRUE if the particular booting option is selected
- * return FALSE otherwise
+ * return true if the particular booting option is selected
+ * return false otherwise
  */
 static u32 read_bootstrap(void)
 {
@@ -150,18 +147,18 @@ int snor_boot_selected(void)
                /* Check whether SNOR boot is selected */
                if ((bootstrap & CONFIG_SPEAR_ONLYSNORBOOT) ==
                        CONFIG_SPEAR_ONLYSNORBOOT)
-                       return TRUE;
+                       return true;
 
                if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
                        CONFIG_SPEAR_NORNAND8BOOT)
-                       return TRUE;
+                       return true;
 
                if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
                        CONFIG_SPEAR_NORNAND16BOOT)
-                       return TRUE;
+                       return true;
        }
 
-       return FALSE;
+       return false;
 }
 
 int nand_boot_selected(void)
@@ -172,20 +169,20 @@ int nand_boot_selected(void)
                /* Check whether NAND boot is selected */
                if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
                        CONFIG_SPEAR_NORNAND8BOOT)
-                       return TRUE;
+                       return true;
 
                if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
                        CONFIG_SPEAR_NORNAND16BOOT)
-                       return TRUE;
+                       return true;
        }
 
-       return FALSE;
+       return false;
 }
 
 int pnor_boot_selected(void)
 {
        /* Parallel NOR boot is not selected in any SPEAr600 revision */
-       return FALSE;
+       return false;
 }
 
 int usb_boot_selected(void)
@@ -195,39 +192,39 @@ int usb_boot_selected(void)
        if (USB_BOOT_SUPPORTED) {
                /* Check whether USB boot is selected */
                if (!(bootstrap & CONFIG_SPEAR_USBBOOT))
-                       return TRUE;
+                       return true;
        }
 
-       return FALSE;
+       return false;
 }
 
 int tftp_boot_selected(void)
 {
        /* TFTP boot is not selected in any SPEAr600 revision */
-       return FALSE;
+       return false;
 }
 
 int uart_boot_selected(void)
 {
        /* UART boot is not selected in any SPEAr600 revision */
-       return FALSE;
+       return false;
 }
 
 int spi_boot_selected(void)
 {
        /* SPI boot is not selected in any SPEAr600 revision */
-       return FALSE;
+       return false;
 }
 
 int i2c_boot_selected(void)
 {
        /* I2C boot is not selected in any SPEAr600 revision */
-       return FALSE;
+       return false;
 }
 
 int mmc_boot_selected(void)
 {
-       return FALSE;
+       return false;
 }
 
 void plat_late_init(void)
index f2f9a49..3e2953c 100644 (file)
@@ -120,7 +120,7 @@ u32 spl_boot(void)
        /*
         * All the supported booting devices are listed here. Each of
         * the booting type supported by the platform would define the
-        * macro xxx_BOOT_SUPPORTED to TRUE.
+        * macro xxx_BOOT_SUPPORTED to true.
         */
 
        if (SNOR_BOOT_SUPPORTED && snor_boot_selected()) {
index 000ffe5..1f28b36 100644 (file)
@@ -61,9 +61,6 @@ typedef unsigned int __kernel_gid32_t;
 typedef unsigned short __kernel_old_uid_t;
 typedef unsigned short __kernel_old_gid_t;
 
-#define BOOL_WAS_DEFINED
-typedef enum { false = 0, true = 1 } bool;
-
 #ifdef __GNUC__
 typedef long long __kernel_loff_t;
 #endif
index 133494f..9751db4 100644 (file)
@@ -96,7 +96,7 @@ int disable_interrupts (void)
        sr = get_sr ();
        set_sr (sr | 0x0700);
 
-       return ((sr & 0x0700) == 0);    /* return TRUE, if interrupts were enabled before */
+       return ((sr & 0x0700) == 0);    /* return true, if interrupts were enabled before */
 }
 
 void int_handler (struct pt_regs *fp)
index ca8c227..b4d0adc 100644 (file)
@@ -59,7 +59,7 @@ void enable_interrupts(void)
 
 /*
  * disable interrupts
- * Return TRUE if GIE is enabled before we disable it.
+ * Return true if GIE is enabled before we disable it.
  */
 int disable_interrupts(void)
 {
index 5495dc5..825a292 100644 (file)
@@ -513,7 +513,7 @@ void fsl_serdes_init(void)
        size_t arglen;
 #endif
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
-       int need_serdes_a001;   /* TRUE == need work-around for SERDES A001 */
+       int need_serdes_a001;   /* true == need work-around for SERDES A001 */
 #endif
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
        char buffer[HWCONFIG_BUFFER_SIZE];
index 8a20a2b..161d274 100644 (file)
@@ -88,8 +88,6 @@ void spd_ddr_init_hang (void) __attribute__((weak, alias("__spd_ddr_init_hang"))
 #define NUMMEMTESTS            8
 #define NUMMEMWORDS            8
 #define MAXBXCR                        4
-#define TRUE                   1
-#define FALSE                  0
 
 /*
  * This DDR2 setup code can dynamically setup the TLB entries for the DDR2 memory
@@ -298,7 +296,7 @@ static void get_spd_info(unsigned long *dimm_populated,
        unsigned char num_of_bytes;
        unsigned char total_size;
 
-       dimm_found = FALSE;
+       dimm_found = false;
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                num_of_bytes = 0;
                total_size = 0;
@@ -307,16 +305,16 @@ static void get_spd_info(unsigned long *dimm_populated,
                total_size = spd_read(iic0_dimm_addr[dimm_num], 1);
 
                if ((num_of_bytes != 0) && (total_size != 0)) {
-                       dimm_populated[dimm_num] = TRUE;
-                       dimm_found = TRUE;
+                       dimm_populated[dimm_num] = true;
+                       dimm_found = true;
                        debug("DIMM slot %lu: populated\n", dimm_num);
                } else {
-                       dimm_populated[dimm_num] = FALSE;
+                       dimm_populated[dimm_num] = false;
                        debug("DIMM slot %lu: Not populated\n", dimm_num);
                }
        }
 
-       if (dimm_found == FALSE) {
+       if (dimm_found == false) {
                printf("ERROR - No memory installed. Install a DDR-SDRAM DIMM.\n\n");
                spd_ddr_init_hang ();
        }
@@ -330,7 +328,7 @@ static void check_mem_type(unsigned long *dimm_populated,
        unsigned char dimm_type;
 
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        dimm_type = spd_read(iic0_dimm_addr[dimm_num], 2);
                        switch (dimm_type) {
                        case 7:
@@ -356,7 +354,7 @@ static void check_volt_type(unsigned long *dimm_populated,
        unsigned long voltage_type;
 
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        voltage_type = spd_read(iic0_dimm_addr[dimm_num], 8);
                        if (voltage_type != 0x04) {
                                printf("ERROR: DIMM %lu with unsupported voltage level.\n",
@@ -398,12 +396,12 @@ static void program_cfg0(unsigned long *dimm_populated,
        /*
         * FIXME: assume the DDR SDRAMs in both banks are the same
         */
-       ecc_enabled = TRUE;
+       ecc_enabled = true;
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        ecc = spd_read(iic0_dimm_addr[dimm_num], 11);
                        if (ecc != 0x02) {
-                               ecc_enabled = FALSE;
+                               ecc_enabled = false;
                        }
 
                        /*
@@ -437,7 +435,7 @@ static void program_cfg0(unsigned long *dimm_populated,
        /*
         * program Memory Data Error Checking
         */
-       if (ecc_enabled == TRUE) {
+       if (ecc_enabled == true) {
                cfg0 |= SDRAM_CFG0_MCHK_GEN;
        } else {
                cfg0 |= SDRAM_CFG0_MCHK_NON;
@@ -493,7 +491,7 @@ static void program_rtr(unsigned long *dimm_populated,
        bus_period_x_10 = ONE_BILLION / (sys_info.freqPLB / 10);
 
        for (dimm_num = 0;  dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        refresh_rate_type = 0x7F & spd_read(iic0_dimm_addr[dimm_num], 12);
                        switch (refresh_rate_type) {
                        case 0x00:
@@ -585,15 +583,15 @@ static void program_tr0(unsigned long *dimm_populated,
        t_rp_ns = 0;
        t_rcd_ns = 0;
        t_ras_ns = 0;
-       cas_2_0_available = TRUE;
-       cas_2_5_available = TRUE;
-       cas_3_0_available = TRUE;
+       cas_2_0_available = true;
+       cas_2_5_available = true;
+       cas_3_0_available = true;
        tcyc_2_0_ns_x_10 = 0;
        tcyc_2_5_ns_x_10 = 0;
        tcyc_3_0_ns_x_10 = 0;
 
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        wcsbc = spd_read(iic0_dimm_addr[dimm_num], 15);
                        t_rp_ns  = spd_read(iic0_dimm_addr[dimm_num], 27) >> 2;
                        t_rcd_ns = spd_read(iic0_dimm_addr[dimm_num], 29) >> 2;
@@ -640,7 +638,7 @@ static void program_tr0(unsigned long *dimm_populated,
                                if (cas_index != 0) {
                                        cas_index++;
                                }
-                               cas_3_0_available = FALSE;
+                               cas_3_0_available = false;
                        }
 
                        if (((cas_bit & 0x08) != 0) || (cas_index < 3)) {
@@ -650,7 +648,7 @@ static void program_tr0(unsigned long *dimm_populated,
                                if (cas_index != 0) {
                                        cas_index++;
                                }
-                               cas_2_5_available = FALSE;
+                               cas_2_5_available = false;
                        }
 
                        if (((cas_bit & 0x04) != 0) || (cas_index < 3)) {
@@ -660,7 +658,7 @@ static void program_tr0(unsigned long *dimm_populated,
                                if (cas_index != 0) {
                                        cas_index++;
                                }
-                               cas_2_0_available = FALSE;
+                               cas_2_0_available = false;
                        }
 
                        break;
@@ -683,13 +681,13 @@ static void program_tr0(unsigned long *dimm_populated,
        /*
         * Program SD_CASL field
         */
-       if ((cas_2_0_available == TRUE) &&
+       if ((cas_2_0_available == true) &&
            (bus_period_x_10 >= tcyc_2_0_ns_x_10)) {
                tr0 |= SDRAM_TR0_SDCL_2_0_CLK;
-       } else if ((cas_2_5_available == TRUE) &&
+       } else if ((cas_2_5_available == true) &&
                 (bus_period_x_10 >= tcyc_2_5_ns_x_10)) {
                tr0 |= SDRAM_TR0_SDCL_2_5_CLK;
-       } else if ((cas_3_0_available == TRUE) &&
+       } else if ((cas_3_0_available == true) &&
                 (bus_period_x_10 >= tcyc_3_0_ns_x_10)) {
                tr0 |= SDRAM_TR0_SDCL_3_0_CLK;
        } else {
@@ -950,9 +948,9 @@ static void program_tr1(void)
        current_fail_length = 0;
        current_start = 0;
        rdclt_offset = 0;
-       window_found = FALSE;
-       fail_found = FALSE;
-       pass_found = FALSE;
+       window_found = false;
+       fail_found = false;
+       pass_found = false;
        debug("Starting memory test ");
 
        for (k = 0; k < NUMHALFCYCLES; k++) {
@@ -963,8 +961,8 @@ static void program_tr1(void)
                        mtsdram(SDRAM0_TR1, (tr1 | SDRAM_TR1_RDCT_ENCODE(rdclt)));
 
                        if (short_mem_test()) {
-                               if (fail_found == TRUE) {
-                                       pass_found = TRUE;
+                               if (fail_found == true) {
+                                       pass_found = true;
                                        if (current_pass_length == 0) {
                                                current_start = rdclt_offset + rdclt;
                                        }
@@ -983,10 +981,10 @@ static void program_tr1(void)
                                current_fail_length++;
 
                                if (current_fail_length >= (dly_val>>2)) {
-                                       if (fail_found == FALSE) {
-                                               fail_found = TRUE;
-                                       } else if (pass_found == TRUE) {
-                                               window_found = TRUE;
+                                       if (fail_found == false) {
+                                               fail_found = true;
+                                       } else if (pass_found == true) {
+                                               window_found = true;
                                                break;
                                        }
                                }
@@ -994,9 +992,8 @@ static void program_tr1(void)
                }
                debug(".");
 
-               if (window_found == TRUE) {
+               if (window_found == true)
                        break;
-               }
 
                tr1 = tr1 ^ SDRAM_TR1_RDCD_MASK;
                rdclt_offset += dly_val;
@@ -1006,7 +1003,7 @@ static void program_tr1(void)
        /*
         * make sure we find the window
         */
-       if (window_found == FALSE) {
+       if (window_found == false) {
                printf("ERROR: Cannot determine a common read delay.\n");
                spd_ddr_init_hang ();
        }
@@ -1115,7 +1112,7 @@ static unsigned long program_bxcr(unsigned long *dimm_populated,
        bank_base_addr = CONFIG_SYS_SDRAM_BASE;
 
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        num_row_addr = spd_read(iic0_dimm_addr[dimm_num], 3);
                        num_col_addr = spd_read(iic0_dimm_addr[dimm_num], 4);
                        num_banks    = spd_read(iic0_dimm_addr[dimm_num], 5);
index 85217ea..def7ebf 100644 (file)
@@ -241,13 +241,6 @@ void board_add_ram_info(int use_default)
 /*-----------------------------------------------------------------------------+
  * Defines
  *-----------------------------------------------------------------------------*/
-#ifndef        TRUE
-#define TRUE           1
-#endif
-#ifndef FALSE
-#define FALSE          0
-#endif
-
 #define SDRAM_DDR1     1
 #define SDRAM_DDR2     2
 #define SDRAM_NONE     0
@@ -683,7 +676,7 @@ static void get_spd_info(unsigned long *dimm_populated,
        unsigned char num_of_bytes;
        unsigned char total_size;
 
-       dimm_found = FALSE;
+       dimm_found = false;
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                num_of_bytes = 0;
                total_size = 0;
@@ -696,16 +689,16 @@ static void get_spd_info(unsigned long *dimm_populated,
                      iic0_dimm_addr[dimm_num], total_size);
 
                if ((num_of_bytes != 0) && (total_size != 0)) {
-                       dimm_populated[dimm_num] = TRUE;
-                       dimm_found = TRUE;
+                       dimm_populated[dimm_num] = true;
+                       dimm_found = true;
                        debug("DIMM slot %lu: populated\n", dimm_num);
                } else {
-                       dimm_populated[dimm_num] = FALSE;
+                       dimm_populated[dimm_num] = false;
                        debug("DIMM slot %lu: Not populated\n", dimm_num);
                }
        }
 
-       if (dimm_found == FALSE) {
+       if (dimm_found == false) {
                printf("ERROR - No memory installed. Install a DDR-SDRAM DIMM.\n\n");
                spd_ddr_init_hang ();
        }
@@ -724,7 +717,7 @@ static void check_mem_type(unsigned long *dimm_populated,
        unsigned long dimm_type;
 
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
-               if (dimm_populated[dimm_num] == TRUE) {
+               if (dimm_populated[dimm_num] == true) {
                        dimm_type = spd_read(iic0_dimm_addr[dimm_num], 2);
                        switch (dimm_type) {
                        case 1:
@@ -994,14 +987,14 @@ static void program_copt1(unsigned long *dimm_populated,
        unsigned long val;
 
 #ifdef CONFIG_DDR_ECC
-       ecc_enabled = TRUE;
+       ecc_enabled = true;
 #else
-       ecc_enabled = FALSE;
+       ecc_enabled = false;
 #endif
-       dimm_32bit = FALSE;
-       dimm_64bit = FALSE;
-       buf0 = FALSE;
-       buf1 = FALSE;
+       dimm_32bit = false;
+       dimm_64bit = false;
+       buf0 = false;
+       buf1 = false;
 
        /*------------------------------------------------------------------
         * Set memory controller options reg 1, SDRAM_MCOPT1.
@@ -1026,7 +1019,7 @@ static void program_copt1(unsigned long *dimm_populated,
                        /* test ecc support */
                        ecc = (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 11);
                        if (ecc != 0x02) /* ecc not supported */
-                               ecc_enabled = FALSE;
+                               ecc_enabled = false;
 
                        /* test bank count */
                        bankcount = (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 17);
@@ -1048,15 +1041,15 @@ static void program_copt1(unsigned long *dimm_populated,
                                if (registered == 1) { /* DDR2 always buffered */
                                        /* TODO: what about above  comments ? */
                                        mcopt1 |= SDRAM_MCOPT1_RDEN;
-                                       buf0 = TRUE;
+                                       buf0 = true;
                                } else {
                                        /* TODO: the mask 0x02 doesn't match Samsung def for byte 21. */
                                        if ((attribute & 0x02) == 0x00) {
                                                /* buffered not supported */
-                                               buf0 = FALSE;
+                                               buf0 = false;
                                        } else {
                                                mcopt1 |= SDRAM_MCOPT1_RDEN;
-                                               buf0 = TRUE;
+                                               buf0 = true;
                                        }
                                }
                        }
@@ -1068,14 +1061,14 @@ static void program_copt1(unsigned long *dimm_populated,
                                if (registered == 1) {
                                        /* DDR2 always buffered */
                                        mcopt1 |= SDRAM_MCOPT1_RDEN;
-                                       buf1 = TRUE;
+                                       buf1 = true;
                                } else {
                                        if ((attribute & 0x02) == 0x00) {
                                                /* buffered not supported */
-                                               buf1 = FALSE;
+                                               buf1 = false;
                                        } else {
                                                mcopt1 |= SDRAM_MCOPT1_RDEN;
-                                               buf1 = TRUE;
+                                               buf1 = true;
                                        }
                                }
                        }
@@ -1087,11 +1080,11 @@ static void program_copt1(unsigned long *dimm_populated,
                        switch (data_width) {
                        case 72:
                        case 64:
-                               dimm_64bit = TRUE;
+                               dimm_64bit = true;
                                break;
                        case 40:
                        case 32:
-                               dimm_32bit = TRUE;
+                               dimm_32bit = true;
                                break;
                        default:
                                printf("WARNING: Detected a DIMM with a data width of %lu bits.\n",
@@ -1110,20 +1103,19 @@ static void program_copt1(unsigned long *dimm_populated,
                }
        }
 
-       if ((dimm_64bit == TRUE) && (dimm_32bit == TRUE)) {
+       if ((dimm_64bit == true) && (dimm_32bit == true)) {
                printf("ERROR: Cannot mix 32 bit and 64 bit DDR-SDRAM DIMMs together.\n");
                spd_ddr_init_hang ();
-       }
-       else if ((dimm_64bit == TRUE) && (dimm_32bit == FALSE)) {
+       } else if ((dimm_64bit == true) && (dimm_32bit == false)) {
                mcopt1 |= SDRAM_MCOPT1_DMWD_64;
-       } else if ((dimm_64bit == FALSE) && (dimm_32bit == TRUE)) {
+       } else if ((dimm_64bit == false) && (dimm_32bit == true)) {
                mcopt1 |= SDRAM_MCOPT1_DMWD_32;
        } else {
                printf("ERROR: Please install only 32 or 64 bit DDR-SDRAM DIMMs.\n\n");
                spd_ddr_init_hang ();
        }
 
-       if (ecc_enabled == TRUE)
+       if (ecc_enabled == true)
                mcopt1 |= SDRAM_MCOPT1_MCHK_GEN;
        else
                mcopt1 |= SDRAM_MCOPT1_MCHK_NON;
@@ -1171,14 +1163,14 @@ static void program_codt(unsigned long *dimm_populated,
                        total_rank += dimm_rank;
                        total_dimm++;
                        if ((dimm_num == 0) && (total_dimm == 1))
-                               firstSlot = TRUE;
+                               firstSlot = true;
                        else
-                               firstSlot = FALSE;
+                               firstSlot = false;
                }
        }
        if (dimm_type == SDRAM_DDR2) {
                codt |= SDRAM_CODT_DQS_1_8_V_DDR2;
-               if ((total_dimm == 1) && (firstSlot == TRUE)) {
+               if ((total_dimm == 1) && (firstSlot == true)) {
                        if (total_rank == 1) {  /* PUUU */
                                codt |= CALC_ODT_R(0);
                                modt0 = CALC_ODT_W(0);
@@ -1193,7 +1185,7 @@ static void program_codt(unsigned long *dimm_populated,
                                modt2 = 0x00000000;
                                modt3 = 0x00000000;
                        }
-               } else if ((total_dimm == 1) && (firstSlot != TRUE)) {
+               } else if ((total_dimm == 1) && (firstSlot != true)) {
                        if (total_rank == 1) {  /* UUPU */
                                codt |= CALC_ODT_R(2);
                                modt0 = 0x00000000;
@@ -1467,26 +1459,26 @@ static void program_mode(unsigned long *dimm_populated,
         * the dimm modules installed.
         *-----------------------------------------------------------------*/
        t_wr_ns = 0;
-       cas_2_0_available = TRUE;
-       cas_2_5_available = TRUE;
-       cas_3_0_available = TRUE;
-       cas_4_0_available = TRUE;
-       cas_5_0_available = TRUE;
+       cas_2_0_available = true;
+       cas_2_5_available = true;
+       cas_3_0_available = true;
+       cas_4_0_available = true;
+       cas_5_0_available = true;
        max_2_0_tcyc_ns_x_100 = 10;
        max_2_5_tcyc_ns_x_100 = 10;
        max_3_0_tcyc_ns_x_100 = 10;
        max_4_0_tcyc_ns_x_100 = 10;
        max_5_0_tcyc_ns_x_100 = 10;
-       sdram_ddr1 = TRUE;
+       sdram_ddr1 = true;
 
        /* loop through all the DIMM slots on the board */
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                /* If a dimm is installed in a particular slot ... */
                if (dimm_populated[dimm_num] != SDRAM_NONE) {
                        if (dimm_populated[dimm_num] == SDRAM_DDR1)
-                               sdram_ddr1 = TRUE;
+                               sdram_ddr1 = true;
                        else
-                               sdram_ddr1 = FALSE;
+                               sdram_ddr1 = false;
 
                        cas_bit = spd_read(iic0_dimm_addr[dimm_num], 18);
                        debug("cas_bit[SPD byte 18]=%02lx\n", cas_bit);
@@ -1543,7 +1535,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_4_0_available = FALSE;
+                                       cas_4_0_available = false;
                                }
 
                                if (((cas_bit & 0x10) == 0x10) && (cas_index < 3) &&
@@ -1554,7 +1546,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_3_0_available = FALSE;
+                                       cas_3_0_available = false;
                                }
 
                                if (((cas_bit & 0x08) == 0x08) && (cas_index < 3) &&
@@ -1565,7 +1557,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_2_5_available = FALSE;
+                                       cas_2_5_available = false;
                                }
 
                                if (((cas_bit & 0x04) == 0x04) && (cas_index < 3) &&
@@ -1576,7 +1568,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_2_0_available = FALSE;
+                                       cas_2_0_available = false;
                                }
                        } else {
                                /*
@@ -1592,7 +1584,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_5_0_available = FALSE;
+                                       cas_5_0_available = false;
                                }
 
                                if (((cas_bit & 0x10) == 0x10) && (cas_index < 3) &&
@@ -1603,7 +1595,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_4_0_available = FALSE;
+                                       cas_4_0_available = false;
                                }
 
                                if (((cas_bit & 0x08) == 0x08) && (cas_index < 3) &&
@@ -1614,7 +1606,7 @@ static void program_mode(unsigned long *dimm_populated,
                                } else {
                                        if (cas_index != 0)
                                                cas_index++;
-                                       cas_3_0_available = FALSE;
+                                       cas_3_0_available = false;
                                }
                        }
                }
@@ -1636,14 +1628,17 @@ static void program_mode(unsigned long *dimm_populated,
        debug("cycle_4_0_clk=%lu\n", cycle_4_0_clk);
        debug("cycle_5_0_clk=%lu\n", cycle_5_0_clk);
 
-       if (sdram_ddr1 == TRUE) { /* DDR1 */
-               if ((cas_2_0_available == TRUE) && (sdram_freq <= cycle_2_0_clk)) {
+       if (sdram_ddr1 == true) { /* DDR1 */
+               if ((cas_2_0_available == true) &&
+                       (sdram_freq <= cycle_2_0_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR1_2_0_CLK;
                        *selected_cas = DDR_CAS_2;
-               } else if ((cas_2_5_available == TRUE) && (sdram_freq <= cycle_2_5_clk)) {
+               } else if ((cas_2_5_available == true) &&
+                       (sdram_freq <= cycle_2_5_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR1_2_5_CLK;
                        *selected_cas = DDR_CAS_2_5;
-               } else if ((cas_3_0_available == TRUE) && (sdram_freq <= cycle_3_0_clk)) {
+               } else if ((cas_3_0_available == true) &&
+                       (sdram_freq <= cycle_3_0_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR1_3_0_CLK;
                        *selected_cas = DDR_CAS_3;
                } else {
@@ -1656,13 +1651,16 @@ static void program_mode(unsigned long *dimm_populated,
                debug("cas_3_0_available=%d\n", cas_3_0_available);
                debug("cas_4_0_available=%d\n", cas_4_0_available);
                debug("cas_5_0_available=%d\n", cas_5_0_available);
-               if ((cas_3_0_available == TRUE) && (sdram_freq <= cycle_3_0_clk)) {
+               if ((cas_3_0_available == true) &&
+                       (sdram_freq <= cycle_3_0_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR2_3_0_CLK;
                        *selected_cas = DDR_CAS_3;
-               } else if ((cas_4_0_available == TRUE) && (sdram_freq <= cycle_4_0_clk)) {
+               } else if ((cas_4_0_available == true) &&
+                       (sdram_freq <= cycle_4_0_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR2_4_0_CLK;
                        *selected_cas = DDR_CAS_4;
-               } else if ((cas_5_0_available == TRUE) && (sdram_freq <= cycle_5_0_clk)) {
+               } else if ((cas_5_0_available == true) &&
+                       (sdram_freq <= cycle_5_0_clk)) {
                        mmode |= SDRAM_MMODE_DCL_DDR2_5_0_CLK;
                        *selected_cas = DDR_CAS_5;
                } else {
@@ -1677,7 +1675,7 @@ static void program_mode(unsigned long *dimm_populated,
                }
        }
 
-       if (sdram_ddr1 == TRUE)
+       if (sdram_ddr1 == true)
                mmode |= SDRAM_MMODE_WR_DDR1;
        else {
 
@@ -1851,16 +1849,16 @@ static void program_tr(unsigned long *dimm_populated,
        t_wpc_ns = 0;
        t_wtr_ns = 0;
        t_rpc_ns = 0;
-       sdram_ddr1 = TRUE;
+       sdram_ddr1 = true;
 
        /* loop through all the DIMM slots on the board */
        for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                /* If a dimm is installed in a particular slot ... */
                if (dimm_populated[dimm_num] != SDRAM_NONE) {
                        if (dimm_populated[dimm_num] == SDRAM_DDR2)
-                               sdram_ddr1 = TRUE;
+                               sdram_ddr1 = true;
                        else
-                               sdram_ddr1 = FALSE;
+                               sdram_ddr1 = false;
 
                        t_rcd_ns = max(t_rcd_ns, spd_read(iic0_dimm_addr[dimm_num], 29) >> 2);
                        t_rrd_ns = max(t_rrd_ns, spd_read(iic0_dimm_addr[dimm_num], 28) >> 2);
@@ -1925,7 +1923,7 @@ static void program_tr(unsigned long *dimm_populated,
                break;
        }
 
-       if (sdram_ddr1 == TRUE) { /* DDR1 */
+       if (sdram_ddr1 == true) { /* DDR1 */
                if (sdram_freq < 200000000) {
                        sdtr2 |= SDRAM_SDTR2_WTR_1_CLK;
                        sdtr2 |= SDRAM_SDTR2_WPC_2_CLK;
@@ -2548,8 +2546,8 @@ calibration_loop:
        current_pass_length = 0;
        current_fail_length = 0;
        current_start = 0;
-       fail_found = FALSE;
-       pass_found = FALSE;
+       fail_found = false;
+       pass_found = false;
 
        /*
         * get the delay line calibration register value
@@ -2570,8 +2568,8 @@ calibration_loop:
                 * See if the rffd value passed.
                 *-----------------------------------------------------------------*/
                if (short_mem_test()) {
-                       if (fail_found == TRUE) {
-                               pass_found = TRUE;
+                       if (fail_found == true) {
+                               pass_found = true;
                                if (current_pass_length == 0)
                                        current_start = rffd;
 
@@ -2589,11 +2587,10 @@ calibration_loop:
                        current_fail_length++;
 
                        if (current_fail_length >= (dly_val >> 2)) {
-                               if (fail_found == FALSE) {
-                                       fail_found = TRUE;
-                               } else if (pass_found == TRUE) {
+                               if (fail_found == false)
+                                       fail_found = true;
+                               else if (pass_found == true)
                                        break;
-                               }
                        }
                }
        }               /* for rffd */
@@ -2618,9 +2615,9 @@ calibration_loop:
        current_pass_length = 0;
        current_fail_length = 0;
        current_start = 0;
-       window_found = FALSE;
-       fail_found = FALSE;
-       pass_found = FALSE;
+       window_found = false;
+       fail_found = false;
+       pass_found = false;
 
        for (rqfd = 0; rqfd <= SDRAM_RQDC_RQFD_MAX; rqfd++) {
                mfsdram(SDRAM_RQDC, rqdc_reg);
@@ -2635,8 +2632,8 @@ calibration_loop:
                 * See if the rffd value passed.
                 *-----------------------------------------------------------------*/
                if (short_mem_test()) {
-                       if (fail_found == TRUE) {
-                               pass_found = TRUE;
+                       if (fail_found == true) {
+                               pass_found = true;
                                if (current_pass_length == 0)
                                        current_start = rqfd;
 
@@ -2653,10 +2650,10 @@ calibration_loop:
                        current_pass_length = 0;
                        current_fail_length++;
 
-                       if (fail_found == FALSE) {
-                               fail_found = TRUE;
-                       } else if (pass_found == TRUE) {
-                               window_found = TRUE;
+                       if (fail_found == false) {
+                               fail_found = true;
+                       } else if (pass_found == true) {
+                               window_found = true;
                                break;
                        }
                }
@@ -2667,7 +2664,7 @@ calibration_loop:
        /*------------------------------------------------------------------
         * Make sure we found the valid read passing window.  Halt if not
         *-----------------------------------------------------------------*/
-       if (window_found == FALSE) {
+       if (window_found == false) {
                if (rqfd_start < SDRAM_RQDC_RQFD_MAX) {
                        putc('\b');
                        putc(slash[loopi++ % 8]);
@@ -2769,13 +2766,13 @@ static void test(void)
        mtsdram(SDRAM_MCOPT1, (val & ~SDRAM_MCOPT1_MCHK_MASK) |
                SDRAM_MCOPT1_MCHK_NON);
 
-       window_found = FALSE;
-       begin_found[0] = FALSE;
-       end_found[0] = FALSE;
-       search_end[0] = FALSE;
-       begin_found[1] = FALSE;
-       end_found[1] = FALSE;
-       search_end[1] = FALSE;
+       window_found = false;
+       begin_found[0] = false;
+       end_found[0] = false;
+       search_end[0] = false;
+       begin_found[1] = false;
+       end_found[1] = false;
+       search_end[1] = false;
 
        for (dimm_num = 0; dimm_num < MAXDIMMS; dimm_num++) {
                mfsdram(SDRAM_MB0CF + (bxcr_num << 2), bxcf[bxcr_num]);
@@ -2812,32 +2809,32 @@ static void test(void)
                         * See if the rffd value passed.
                         *-----------------------------------------------------------------*/
                        if (i < NUMMEMTESTS) {
-                               if ((end_found[dimm_num] == FALSE) &&
-                                   (search_end[dimm_num] == TRUE)) {
-                                       end_found[dimm_num] = TRUE;
+                               if ((end_found[dimm_num] == false) &&
+                                   (search_end[dimm_num] == true)) {
+                                       end_found[dimm_num] = true;
                                }
-                               if ((end_found[0] == TRUE) &&
-                                   (end_found[1] == TRUE))
+                               if ((end_found[0] == true) &&
+                                   (end_found[1] == true))
                                        break;
                        } else {
-                               if (begin_found[dimm_num] == FALSE) {
-                                       begin_found[dimm_num] = TRUE;
-                                       search_end[dimm_num] = TRUE;
+                               if (begin_found[dimm_num] == false) {
+                                       begin_found[dimm_num] = true;
+                                       search_end[dimm_num] = true;
                                }
                        }
                } else {
-                       begin_found[dimm_num] = TRUE;
-                       end_found[dimm_num] = TRUE;
+                       begin_found[dimm_num] = true;
+                       end_found[dimm_num] = true;
                }
        }
 
-       if ((begin_found[0] == TRUE) && (begin_found[1] == TRUE))
-               window_found = TRUE;
+       if ((begin_found[0] == true) && (begin_found[1] == true))
+               window_found = true;
 
        /*------------------------------------------------------------------
         * Make sure we found the valid read passing window.  Halt if not
         *-----------------------------------------------------------------*/
-       if (window_found == FALSE) {
+       if (window_found == false) {
                printf("ERROR: Cannot determine a common read delay for the "
                       "DIMM(s) installed.\n");
                spd_ddr_init_hang ();
index ce769a7..3ceab32 100644 (file)
 /*-----------------------------------------------------------------------------+
  * Defines
  *-----------------------------------------------------------------------------*/
-#ifndef        TRUE
-#define TRUE           1
-#endif
-#ifndef FALSE
-#define FALSE          0
-#endif
-
 #define MAXDIMMS       2
 #define MAXRANKS       2
 
@@ -279,7 +272,7 @@ static void get_spd_info(unsigned long dimm_ranks[],
                         unsigned long num_dimm_banks)
 {
        unsigned long dimm_num;
-       unsigned long dimm_found = FALSE;
+       unsigned long dimm_found = false;
        unsigned long const max_ranks_per_dimm = (1 == num_dimm_banks) ? 2 : 1;
        unsigned char num_of_bytes;
        unsigned char total_size;
@@ -334,7 +327,7 @@ static void get_spd_info(unsigned long dimm_ranks[],
                                       "\n\n");
                                spd_ddr_init_hang();
                        }
-                       dimm_found = TRUE;
+                       dimm_found = true;
                        debug("DIMM slot %lu: populated with %lu-rank DDR2 DIMM"
                              "\n", dimm_num, ranks_on_dimm);
                        if (ranks_on_dimm > max_ranks_per_dimm) {
@@ -355,7 +348,7 @@ static void get_spd_info(unsigned long dimm_ranks[],
                        debug("DIMM slot %lu: Not populated\n", dimm_num);
                }
        }
-       if (dimm_found == FALSE) {
+       if (dimm_found == false) {
                printf("ERROR: No memory installed.\n");
                printf("Install at least one DDR2 DIMM.\n\n");
                spd_ddr_init_hang();
@@ -882,7 +875,7 @@ static void program_ddr0_22(unsigned long dimm_ranks[],
                        /* Check for ECC */
                        if (0 == (spd_read(iic0_dimm_addr[dimm_num], 11) &
                                  0x02)) {
-                               ecc_available = FALSE;
+                               ecc_available = false;
                        }
                }
        }
index 92901b1..592d9e3 100644 (file)
@@ -134,6 +134,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 7fd6355..1400604 100644 (file)
@@ -383,7 +383,7 @@ unsigned int memoryGetDeviceWidth (DEVICE device)
 * OUTPUT:
 *       None.
 * RETURN:
-*       False for invalid size, true otherwise.
+*       false for invalid size, true otherwise.
 *
 * CAUTION: PCI_functions must be implemented later To_do !!!!!!!!!!!!!!!!!
 *
@@ -509,7 +509,7 @@ bool memoryMapBank (MEMORY_BANK bank, unsigned int bankBase,
 *       None.
 *
 * RETURN:
-*       False for invalid size, true otherwise.
+*       false for invalid size, true otherwise.
 *
 * CAUTION: PCI_functions must be implemented later To_do !!!!!!!!!!!!!!!!!
 *
@@ -624,7 +624,7 @@ bool memoryMapDeviceSpace (DEVICE device, unsigned int deviceBase,
 *       None.
 *
 * RETURN:
-*       False for invalid size, true otherwise.
+*       false for invalid size, true otherwise.
 *
 *******************************************************************************/
 bool memorySetPciWindow (PCI_MEM_WINDOW pciWindow, unsigned int pciWindowBase,
@@ -885,7 +885,7 @@ void gtMemorySetInternalSramBaseAddr (unsigned int sramBaseAddress)
 *       None.
 *
 * RETURN:
-*       False for invalid size, true otherwise.
+*       false for invalid size, true otherwise.
 *
 *******************************************************************************/
 bool memorySetProtectRegion (MEMORY_PROTECT_WINDOW window,
@@ -1380,7 +1380,7 @@ void MemoryEnableWindow (MEMORY_WINDOW window)
 * OUTPUT:
 *       None.
 * RETURN:
-*       True for a closed window, false otherwise .
+*       true for a closed window, false otherwise .
 *******************************************************************************/
 MEMORY_WINDOW_STATUS MemoryGetMemWindowStatus (MEMORY_WINDOW window)
 {
index 7ad6ae8..9227e5c 100644 (file)
@@ -966,7 +966,7 @@ static int galmpsc_set_snoop (int mpsc, int value)
 *       None.
 *
 * RETURN:
-*       True for success, false otherwise.
+*       true for success, false otherwise.
 *
 *******************************************************************************/
 
index bd8e05d..d7de9d9 100644 (file)
 **************************************************************************
 **************************************************************************
 *************************************************************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 /* In case not using SG on Tx, define MAX_SKB_FRAGS as 0 */
 #ifndef MAX_SKB_FRAGS
 #define MAX_SKB_FRAGS 0
index 303a636..45e13b8 100644 (file)
@@ -966,7 +966,7 @@ static int galmpsc_set_snoop (int mpsc, int value)
 *       None.
 *
 * RETURN:
-*       True for success, false otherwise.
+*       true for success, false otherwise.
 *
 *******************************************************************************/
 
index af4e818..1107e95 100644 (file)
 **************************************************************************
 **************************************************************************
 *************************************************************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 /* In case not using SG on Tx, define MAX_SKB_FRAGS as 0 */
 #ifndef MAX_SKB_FRAGS
 #define MAX_SKB_FRAGS 0
index c413439..3119d0a 100644 (file)
@@ -91,11 +91,6 @@ extern unsigned int INTERNAL_REG_BASE_ADDR;
 #define _1G            0x40000000
 #define _2G            0x80000000
 
-#ifndef        BOOL_WAS_DEFINED
-#define BOOL_WAS_DEFINED
-typedef enum _bool{false,true} bool;
-#endif
-
 /* Little to Big endian conversion macros */
 
 #ifdef LE /* Little Endian */
index e88bd97..40f17e9 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index e88bd97..40f17e9 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 88c410c..7b89b4f 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 79788a8..6f5d0a6 100644 (file)
@@ -477,16 +477,16 @@ int is_powerpc440ep_pass1(void)
        pvr = get_pvr();
 
        if (pvr == PVR_POWERPC_440EP_PASS1)
-               return TRUE;
+               return true;
        else if (pvr == PVR_POWERPC_440EP_PASS2)
-               return FALSE;
+               return false;
        else {
                printf("brdutil error 3\n");
                for (;;)
                        ;
        }
 
-       return(FALSE);
+       return false;
 }
 
 /*----------------------------------------------------------------------------+
@@ -495,9 +495,9 @@ int is_powerpc440ep_pass1(void)
 int is_nand_selected(void)
 {
 #ifdef CONFIG_BAMBOO_NAND
-       return TRUE;
+       return true;
 #else
-       return FALSE;
+       return false;
 #endif
 }
 
@@ -507,7 +507,7 @@ int is_nand_selected(void)
 unsigned char config_on_ebc_cs4_is_small_flash(void)
 {
        /* Not implemented yet => returns constant value */
-       return TRUE;
+       return true;
 }
 
 /*----------------------------------------------------------------------------+
@@ -561,7 +561,7 @@ void ext_bus_cntlr_init(void)
        /*-------------------------------------------------------------------------+
          |  PPC440EP Pass1
          +-------------------------------------------------------------------------*/
-       if (is_powerpc440ep_pass1() == TRUE) {
+       if (is_powerpc440ep_pass1() == true) {
                switch(bootstrap_settings) {
                case SDR0_PSTRP0_BOOTSTRAP_SETTINGS0:
                        /* Default Strap Settings 0 : CPU 400 - PLB 133 - Boot EBC 8 bit 33MHz */
@@ -738,7 +738,7 @@ void ext_bus_cntlr_init(void)
                /*------------------------------------------------------------------------- */
                ebc0_cs0_bnap_value = EBC0_BNAP_SMALL_FLASH;
                ebc0_cs0_bncr_value = EBC0_BNCR_SMALL_FLASH_CS0;
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -765,7 +765,7 @@ void ext_bus_cntlr_init(void)
                /*------------------------------------------------------------------------- */
                ebc0_cs0_bnap_value = EBC0_BNAP_LARGE_FLASH_OR_SRAM;
                ebc0_cs0_bncr_value = EBC0_BNCR_LARGE_FLASH_OR_SRAM_CS0;
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -812,7 +812,7 @@ void ext_bus_cntlr_init(void)
                ebc0_cs0_bnap_value = 0;
                ebc0_cs0_bncr_value = 0;
 
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -830,7 +830,7 @@ void ext_bus_cntlr_init(void)
                        ebc0_cs3_bncr_value = 0;
                }
 
-               if ((config_on_ebc_cs4_is_small_flash()) == TRUE) {
+               if ((config_on_ebc_cs4_is_small_flash()) == true) {
                        /* Small Flash */
                        ebc0_cs4_bnap_value = EBC0_BNAP_SMALL_FLASH;
                        ebc0_cs4_bncr_value = EBC0_BNCR_SMALL_FLASH_CS4;
index f2b78a9..6c49733 100644 (file)
 #define         PVR_POWERPC_440EP_PASS1    0x42221850
 #define         PVR_POWERPC_440EP_PASS2    0x422218D3
 
-#define TRUE 1
-#define FALSE 0
-
 #define GPIO0          0
 #define GPIO1          1
 
index 1fab794..f606d92 100644 (file)
@@ -47,9 +47,6 @@ void fpga_init (void);
 #define DEBUGF(fmt,args...)
 #endif
 
-#define FALSE  0
-#define TRUE   1
-
 int board_early_init_f (void)
 {
 /*----------------------------------------------------------------------------+
index eb0af94..f073c0c 100644 (file)
@@ -32,8 +32,6 @@
 
 #define V_ULONG(a)             (*(volatile unsigned long *)( a ))
 #define V_BYTE(a)              (*(volatile unsigned char *)( a ))
-#define TRUE                   0x1
-#define FALSE                  0x0
 #define BUFFER_SIZE            0x80000
 #define NO_COMMAND             0
 #define GET_CODES              1
index ab808d8..e4fcd1e 100644 (file)
@@ -309,7 +309,7 @@ int read_flash(long nOffset, int *pnValue)
        nValue = *(volatile unsigned short *)addr;
        SSYNC();
        *pnValue = nValue;
-       return TRUE;
+       return true;
 }
 
 int poll_toggle_bit(long lOffset)
@@ -398,7 +398,7 @@ int erase_block_flash(int nBlock, unsigned long address)
        long ulSectorOff = 0x0;
 
        if ((nBlock < 0) || (nBlock > AFP_NumSectors))
-               return FALSE;
+               return false;
 
        ulSectorOff = (address - CONFIG_SYS_FLASH_BASE);
 
index 80837e2..949c3d8 100644 (file)
@@ -9,9 +9,6 @@
 #define YELLOW  (0xD292D210)   /* yellow pixel pattern  */
 #define WHITE   (0xFE80FE80)   /* white pixel pattern   */
 
-#define true   1
-#define false  0
-
 typedef struct {
        unsigned int sav;
        unsigned int eav;
index e88bd97..40f17e9 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 99cbed4..1b45e5e 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 614bbb2..a33b0a6 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 39807d4..704e8c9 100644 (file)
@@ -126,6 +126,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 3dfbf3b..1a5f656 100644 (file)
@@ -260,7 +260,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                /*
                 * Big epson detected
                 */
-               reg_byte_swap = FALSE;
+               reg_byte_swap = false;
                palette_index = 0x1e2;
                palette_value = 0x1e4;
                lcd_depth = 16;
@@ -269,7 +269,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                /*
                 * Big epson detected (with register swap bug)
                 */
-               reg_byte_swap = TRUE;
+               reg_byte_swap = true;
                palette_index = 0x1e3;
                palette_value = 0x1e5;
                lcd_depth = 16;
@@ -278,7 +278,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                /*
                 * Small epson detected (704)
                 */
-               reg_byte_swap = FALSE;
+               reg_byte_swap = false;
                palette_index = 0x15;
                palette_value = 0x17;
                lcd_depth = 8;
@@ -287,7 +287,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                /*
                 * Small epson detected (705)
                 */
-               reg_byte_swap = FALSE;
+               reg_byte_swap = false;
                palette_index = 0x15;
                palette_value = 0x17;
                lcd_depth = 8;
@@ -300,7 +300,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                        /*
                         * S1D13505 detected
                         */
-                       reg_byte_swap = TRUE;
+                       reg_byte_swap = true;
                        palette_index = 0x25;
                        palette_value = 0x27;
                        lcd_depth = 16;
index 01f6019..5c48b5a 100644 (file)
 #define LOAD_LONG(data)   SWAP_LONG(data)
 #define LOAD_SHORT(data)  SWAP_SHORT(data)
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE (!FALSE)
-#endif
-
 #define S1D_WRITE_PALETTE(p,i,r,g,b)                                   \
        {                                                               \
                out_8(&((uchar*)(p))[palette_index], (uchar)(i));       \
index c89426d..4adcec0 100644 (file)
@@ -967,7 +967,7 @@ static int galmpsc_set_snoop (int mpsc, int value)
 *       None.
 *
 * RETURN:
-*       True for success, false otherwise.
+*       true for success, false otherwise.
 *
 *******************************************************************************/
 
index 3d0cb10..94745bc 100644 (file)
 **************************************************************************
 **************************************************************************
 *************************************************************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 /* In case not using SG on Tx, define MAX_SKB_FRAGS as 0 */
 #ifndef MAX_SKB_FRAGS
 #define MAX_SKB_FRAGS 0
index 0014808..ccea715 100644 (file)
 #define OK 0
 #define ERROR (-1)
 
-#define TRUE 1
-#define FALSE 0
-
-
 extern u_long pci9054_iobase;
 
 
@@ -97,7 +93,7 @@ static int PciEepromWriteLongVPD (int offs, unsigned int value)
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 
index f92bbff..d38cc96 100644 (file)
@@ -113,7 +113,7 @@ void fpga_serialslave_init(void)
 {
        debug("%s:%d: Initialize serial slave interface\n", __FUNCTION__,
              __LINE__);
-       fpga_pgm_fn(FALSE, FALSE, 0);   /* make sure program pin is inactive */
+       fpga_pgm_fn(false, false, 0);   /* make sure program pin is inactive */
 }
 
 
@@ -188,7 +188,7 @@ int fpga_done_fn(int cookie)
 int fpga_pre_config_fn(int cookie)
 {
        debug("%s:%d: FPGA pre-configuration\n", __FUNCTION__, __LINE__);
-       fpga_reset(TRUE);
+       fpga_reset(true);
 
        /* release init# */
        out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | GPIO0_FPGA_FORCEINIT);
@@ -213,9 +213,9 @@ int fpga_post_config_fn(int cookie)
        /* enable PLD0..7 pins */
        out_be32((void*)GPIO1_OR, in_be32((void*)GPIO1_OR) & ~GPIO1_IOEN_N);
 
-       fpga_reset(TRUE);
+       fpga_reset(true);
        udelay (100);
-       fpga_reset(FALSE);
+       fpga_reset(false);
        udelay (100);
 
        FPGA_OUT32(&fpga->status, (gd->board_type << STATUS_HWREV_SHIFT) & STATUS_HWREV_MASK);
@@ -296,7 +296,7 @@ void ngcc_fpga_serialslave_init(void)
              __FUNCTION__, __LINE__);
 
        /* make sure program pin is inactive */
-       ngcc_fpga_pgm_fn (FALSE, FALSE, 0);
+       ngcc_fpga_pgm_fn(false, false, 0);
 }
 
 /*
@@ -382,10 +382,10 @@ int ngcc_fpga_pre_config_fn(int cookie)
        pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
        debug("%s:%d: FPGA pre-configuration\n", __FUNCTION__, __LINE__);
 
-       ngcc_fpga_reset(TRUE);
+       ngcc_fpga_reset(true);
        FPGA_CLRBITS(&fpga->ctrla, 0xfffffe00);
 
-       ngcc_fpga_reset(TRUE);
+       ngcc_fpga_reset(true);
        return 0;
 }
 
@@ -401,7 +401,7 @@ int ngcc_fpga_post_config_fn(int cookie)
        debug("%s:%d: NGCC FPGA post configuration\n", __FUNCTION__, __LINE__);
 
        udelay (100);
-       ngcc_fpga_reset(FALSE);
+       ngcc_fpga_reset(false);
 
        FPGA_SETBITS(&fpga->ctrla, 0x29f8c000);
 
index e8ef0e3..8c2c17f 100644 (file)
@@ -6,9 +6,6 @@
 #include "eth.h"
 #include "eth_addrtbl.h"
 
-#define TRUE 1
-#define FALSE 0
-
 #define PRINTF printf
 
 #ifdef CONFIG_GT_USE_MAC_HASH_TABLE
@@ -160,8 +157,8 @@ u32 hashTableFunction (u32 macH, u32 macL, u32 HashSize, u32 hash_mode)
  * rd   - the RD field in the address table.
  * Outputs
  * address table entry is added.
- * TRUE if success.
- * FALSE if table full
+ * true if success.
+ * false if table full
  */
 int addAddressTableEntry (u32 port, u32 macH, u32 macL, u32 rd, u32 skip)
 {
@@ -206,7 +203,7 @@ int addAddressTableEntry (u32 port, u32 macH, u32 macL, u32 rd, u32 skip)
 
        if (i == HOP_NUMBER) {
                PRINTF ("addGT64260addressTableEntry: table section is full\n");
-               return (FALSE);
+               return false;
        }
 
        /*
@@ -215,7 +212,7 @@ int addAddressTableEntry (u32 port, u32 macH, u32 macL, u32 rd, u32 skip)
        entry->hi = newHi;
        entry->lo = newLo;
        DCACHE_FLUSH_N_SYNC ((u32) entry, MAC_ENTRY_SIZE);
-       return (TRUE);
+       return true;
 }
 
 #endif /* CONFIG_GT_USE_MAC_HASH_TABLE */
index 614bbb2..a33b0a6 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index d42c500..4c36009 100644 (file)
@@ -182,7 +182,7 @@ void fpga_selectmap_init (void)
 {
        PRINTF ("%s:%d: Initialize SelectMap interface\n", __FUNCTION__,
                __LINE__);
-       fpga_pgm_fn (FALSE, FALSE, 0);  /* make sure program pin is inactive */
+       fpga_pgm_fn(false, false, 0);   /* make sure program pin is inactive */
 }
 
 
@@ -314,7 +314,7 @@ int fpga_abort_fn (int cookie)
 int fpga_pre_config_fn (int cookie)
 {
        PRINTF ("%s:%d: FPGA pre-configuration\n", __FUNCTION__, __LINE__);
-       fpga_reset (TRUE);
+       fpga_reset(true);
        return 0;
 }
 
@@ -328,9 +328,9 @@ int fpga_post_config_fn (int cookie)
        int rc;
 
        PRINTF ("%s:%d: FPGA post configuration\n", __FUNCTION__, __LINE__);
-       fpga_reset (TRUE);
+       fpga_reset(true);
        udelay (1000);
-       fpga_reset (FALSE);
+       fpga_reset(false);
        udelay (1000);
 
        /*
index a3aeb60..cc86941 100644 (file)
@@ -138,6 +138,6 @@ SECTIONS
   {
     common/env_embedded.o (.ppcenv)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 4383c49..982b0f3 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index e88bd97..40f17e9 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 9995288..d5220cc 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 0b34177..ecc9f26 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index bae9fb2..62c66d7 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 88c410c..7b89b4f 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 88c410c..7b89b4f 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 1d1b76a..cb5ed9c 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 49af384..3ea15a1 100644 (file)
@@ -162,7 +162,7 @@ int board_eth_init(bd_t *bis)
 
 int overwrite_console(void)
 {
-       /* return TRUE if console should be overwritten */
+       /* return true if console should be overwritten */
        return 0;
 }
 
index 063f2cc..1135117 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index cc40535..5f60c8d 100644 (file)
@@ -450,7 +450,7 @@ STATUS flashWrite (flash_dev_t * dev, int pos, char *buf, int len)
 }
 
 /*
- * flashWritable returns TRUE if a range contains all F's.
+ * flashWritable returns true if a range contains all F's.
  */
 
 STATUS flashWritable (flash_dev_t * dev, int pos, int len)
index 5255651..2055429 100644 (file)
@@ -96,6 +96,6 @@ SECTIONS
     common/env_embedded.o (.ppcenv)
   } > ram
 
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 29a34fb..3c7c544 100644 (file)
@@ -123,6 +123,6 @@ SECTIONS
    *(COMMON)
   }
 
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index fc56153..66724ed 100644 (file)
 #define PRINTF(fmt,args...)
 #endif
 
-#ifndef        TRUE
-#define TRUE            1
-#endif
-#ifndef FALSE
-#define FALSE           0
-#endif
-
 #if defined(CONFIG_PIP405)
 
 extern int drv_isa_kbd_init (void);
@@ -116,9 +109,9 @@ unsigned char open_cfg_super_IO(int address)
        out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x55); /* open config */
        out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x20); /* set address to DEV ID */
        if(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 0x1)==0x40) /* ok Device ID is correct */
-               return TRUE;
+               return true;
        else
-               return FALSE;
+               return false;
 }
 
 void close_cfg_super_IO(int address)
@@ -179,7 +172,7 @@ void isa_sio_loadtable(void)
 
 void isa_sio_setup(void)
 {
-       if(open_cfg_super_IO(SIO_CFG_PORT)==TRUE)
+       if (open_cfg_super_IO(SIO_CFG_PORT) == true)
        {
                isa_sio_loadtable();
                close_cfg_super_IO(0x3F0);
index 56a84e9..89ea276 100644 (file)
@@ -77,8 +77,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #undef SDRAM_DEBUG
 #define ENABLE_ECC /* for ecc boards */
-#define FALSE           0
-#define TRUE            1
 
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
 #ifndef __ldiv_t_defined
@@ -771,7 +769,8 @@ int last_stage_init (void)
 
 int overwrite_console (void)
 {
-       return ((in8 (PLD_EXT_CONF_REG) & 0x1)==0);     /* return TRUE if console should be overwritten */
+       /* return true if console should be overwritten */
+       return ((in8(PLD_EXT_CONF_REG) & 0x1) == 0);
 }
 
 
index 75f57ad..b203037 100644 (file)
@@ -36,9 +36,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #undef SDRAM_DEBUG
 
-#define FALSE           0
-#define TRUE            1
-
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
 #ifndef __ldiv_t_defined
 typedef struct {
@@ -700,7 +697,8 @@ int misc_init_r (void)
 
 int overwrite_console (void)
 {
-       return (in8 (CONFIG_PORT_ADDR) & 0x1);  /* return TRUE if console should be overwritten */
+       /* return true if console should be overwritten */
+       return in8(CONFIG_PORT_ADDR) & 0x1;
 }
 
 
@@ -945,7 +943,7 @@ void print_pip405_info (void)
 
 void user_led0 (unsigned char on)
 {
-       if (on == TRUE)
+       if (on == true)
                out8 (PLD_LED_USER_REG, (in8 (PLD_LED_USER_REG) | 0x1));
        else
                out8 (PLD_LED_USER_REG, (in8 (PLD_LED_USER_REG) & 0xfe));
@@ -953,7 +951,7 @@ void user_led0 (unsigned char on)
 
 void user_led1 (unsigned char on)
 {
-       if (on == TRUE)
+       if (on == true)
                out8 (PLD_LED_USER_REG, (in8 (PLD_LED_USER_REG) | 0x2));
        else
                out8 (PLD_LED_USER_REG, (in8 (PLD_LED_USER_REG) & 0xfd));
index 99cbed4..1b45e5e 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index e1fe052..5f74337 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index e1fe052..5f74337 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index e1fe052..5f74337 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 3243fc0..2fb5897 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 614bbb2..a33b0a6 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index cc05b45..c6a3af5 100644 (file)
@@ -962,7 +962,7 @@ static int galmpsc_set_snoop (int mpsc, int value)
 *       None.
 *
 * RETURN:
-*       True for success, false otherwise.
+*       true for success, false otherwise.
 *
 *******************************************************************************/
 
index 8cc00dc..58a8cb9 100644 (file)
 **************************************************************************
 **************************************************************************
 *************************************************************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 /* In case not using SG on Tx, define MAX_SKB_FRAGS as 0 */
 #ifndef MAX_SKB_FRAGS
 #define MAX_SKB_FRAGS 0
index abc4640..c4cc39d 100644 (file)
@@ -125,6 +125,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 4a7f362..3894a5c 100644 (file)
@@ -94,11 +94,11 @@ uint Daq_BRG_Get_Div16(uint brg)
 
      if (*brg_ptr & CPM_BRG_DIV16) {
         /* DIV16 active */
-        return (TRUE);
+        return true;
      }
      else {
         /* DIV16 inactive */
-        return (FALSE);
+        return false;
      }
 }
 
index 011638f..68d69db 100644 (file)
  * MA 02111-1307 USA
  */
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE (!FALSE)
-#endif
-
 #define SLRCLK_EN_MASK  0x00040000 /* PA13 - SLRCLK_EN*     */
 
 #define MIN_SAMPLE_RATE       4000 /* Minimum sample rate */
index 6b99f13..b3b365e 100644 (file)
@@ -141,6 +141,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 0b4192e..412af14 100644 (file)
@@ -141,6 +141,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 063f2cc..1135117 100644 (file)
@@ -133,6 +133,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 85eb31b..74baa3f 100644 (file)
@@ -113,7 +113,7 @@ static int fpga_done_fn(int cookie)
 static int fpga_pre_config_fn(int cookie)
 {
        debug("%s:%d: FPGA pre-configuration\n", __func__, __LINE__);
-       fpga_reset(TRUE);
+       fpga_reset(true);
 
        return 0;
 }
@@ -128,9 +128,9 @@ static int fpga_post_config_fn(int cookie)
 
        debug("%s:%d: FPGA post configuration\n", __func__, __LINE__);
 
-       fpga_reset(TRUE);
+       fpga_reset(true);
        udelay(100);
-       fpga_reset(FALSE);
+       fpga_reset(false);
        udelay(100);
 
        return rc;
@@ -200,7 +200,7 @@ static Xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
 static void fpga_serialslave_init(void)
 {
        debug("%s:%d: Initialize serial slave interface\n", __func__, __LINE__);
-       fpga_pgm_fn(FALSE, FALSE, 0);   /* make sure program pin is inactive */
+       fpga_pgm_fn(false, false, 0);   /* make sure program pin is inactive */
 }
 
 static int expi_setup(int freq)
index e1fe052..5f74337 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index abc4640..c4cc39d 100644 (file)
@@ -125,6 +125,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index d576786..8347cf9 100644 (file)
@@ -179,9 +179,9 @@ int fpga_post_config_fn(int cookie)
 {
        debug("%s:%d: FPGA post-configuration\n", __func__, __LINE__);
 
-       fpga_reset(TRUE);
+       fpga_reset(true);
        udelay(100);
-       fpga_reset(FALSE);
+       fpga_reset(false);
 
        return 0;
 }
index 18b7752..5792bac 100644 (file)
@@ -132,6 +132,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index c02581d..cb26f0d 100644 (file)
@@ -137,6 +137,6 @@ SECTIONS
    *(.bss)
    *(COMMON)
   }
-  __bss_end__ = . ;
+  __bss_end = . ;
   PROVIDE (end = .);
 }
index 60109cf..42ecf61 100644 (file)
@@ -72,7 +72,7 @@ int downstring __P ((char *));
  *                     F_INSTR         - output raw instruction.
  *                     F_LINENO        - show line # info if available.
  *
- * Returns TRUE if the area was successfully disassembled or FALSE if
+ * Returns true if the area was successfully disassembled or false if
  * a problem was encountered with accessing the memory.
  */
 
@@ -137,8 +137,8 @@ int disppc (unsigned char *memaddr, unsigned char *virtual, int num_instr,
        for (i = 0; i < num_instr; ++i, memaddr += 4, ctx.virtual += 4) {
 #ifdef USE_SOURCE_CODE
                if (ctx.flags & F_LINENO) {
-                       if ((line_info_from_addr ((Elf32_Word) ctx.virtual, filename,
-                                                                         funcname, &line_no) == TRUE) &&
+                       if ((line_info_from_addr ((Elf32_Word) ctx.virtual,
+                               filename, funcname, &line_no) == true) &&
                                ((line_no != last_line_no) ||
                                 (strcmp (last_funcname, funcname) != 0))) {
                                print_source_line (filename, funcname, line_no, pfunc);
@@ -154,15 +154,15 @@ int disppc (unsigned char *memaddr, unsigned char *virtual, int num_instr,
 #ifdef USE_SOURCE_CODE
                if (ctx.flags & F_SYMBOL) {
                        if ((symname =
-                                symbol_name_from_addr ((Elf32_Word) ctx.virtual,
-                                                                               TRUE, 0)) != 0) {
+                                symbol_name_from_addr((Elf32_Word) ctx.virtual,
+                                               true, 0)) != 0) {
                                cursym = symname;
                                symoffset = 0;
                        } else {
                                if ((cursym == 0) &&
                                        ((symname =
-                                         symbol_name_from_addr ((Elf32_Word) ctx.virtual,
-                                                                                        FALSE, &symoffset)) != 0)) {
+                                         symbol_name_from_addr((Elf32_Word) ctx.virtual,
+                                               false, &symoffset)) != 0)) {
                                        cursym = symname;
                                } else {
                                        symoffset += 4;
@@ -205,7 +205,8 @@ int disppc (unsigned char *memaddr, unsigned char *virtual, int num_instr,
                }
 
                if (((ctx.flags & F_SIMPLE) == 0) ||
-                       (ctx.op->hfunc == 0) || ((*ctx.op->hfunc) (&ctx) == FALSE)) {
+                       (ctx.op->hfunc == 0) ||
+                       ((*ctx.op->hfunc) (&ctx) == false)) {
                        sprintf (&ctx.data[ctx.datalen], "%-7s ", ctx.op->name);
                        ctx.datalen += 8;
                        print_operands (&ctx);
@@ -214,7 +215,7 @@ int disppc (unsigned char *memaddr, unsigned char *virtual, int num_instr,
                (*pfunc) (ctx.data);
        }
 
-       return TRUE;
+       return true;
 }                                                              /* disppc */
 \f
 
@@ -364,10 +365,10 @@ int print_operands (struct ppc_ctx *ctx)
  *     value           The address of an unsigned long to be filled in
  *                     with the value of the operand if it is found.  This
  *                     will only be filled in if the function returns
- *                     TRUE.  This may be passed as 0 if the value is
+ *                     true.  This may be passed as 0 if the value is
  *                     not required.
  *
- * Returns TRUE if the operand was found or FALSE if it was not.
+ * Returns true if the operand was found or false if it was not.
  */
 
 int get_operand_value (struct opcode *op, unsigned long instr,
@@ -379,7 +380,7 @@ int get_operand_value (struct opcode *op, unsigned long instr,
   /*------------------------------------------------------------*/
 
        if (field > n_operands) {
-               return FALSE;                   /* bad operand ?! */
+               return false;                   /* bad operand ?! */
        }
 
        /* Walk through the operands and list each in order */
@@ -393,10 +394,10 @@ int get_operand_value (struct opcode *op, unsigned long instr,
                if (value) {
                        *value = (instr >> opr->shift) & ((1 << opr->bits) - 1);
                }
-               return TRUE;
+               return true;
        }
 
-       return FALSE;
+       return false;
 }                                                              /* operand_value */
 \f
 
@@ -649,7 +650,7 @@ int tbr_value (char *name)
  * Arguments:
  *     ctx             A pointer to the disassembler context record.
  *
- * Returns TRUE if the simpler form was printed or FALSE if it was not.
+ * Returns true if the simpler form was printed or false if it was not.
  */
 
 int handle_bc (struct ppc_ctx *ctx)
@@ -669,33 +670,33 @@ int handle_bc (struct ppc_ctx *ctx)
 
   /*------------------------------------------------------------*/
 
-       if (get_operand_value (ctx->op, ctx->instr, O_BO, &bo) == FALSE)
-               return FALSE;
+       if (get_operand_value(ctx->op, ctx->instr, O_BO, &bo) == false)
+               return false;
 
-       if (get_operand_value (ctx->op, ctx->instr, O_BI, &bi) == FALSE)
-               return FALSE;
+       if (get_operand_value(ctx->op, ctx->instr, O_BI, &bi) == false)
+               return false;
 
        if ((bo == 12) && (bi == 0)) {
                ctx->op = &blt;
                sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name);
                ctx->datalen += 8;
                print_operands (ctx);
-               return TRUE;
+               return true;
        } else if ((bo == 4) && (bi == 10)) {
                ctx->op = &bne;
                sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name);
                ctx->datalen += 8;
                print_operands (ctx);
-               return TRUE;
+               return true;
        } else if ((bo == 16) && (bi == 0)) {
                ctx->op = &bdnz;
                sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name);
                ctx->datalen += 8;
                print_operands (ctx);
-               return TRUE;
+               return true;
        }
 
-       return FALSE;
+       return false;
 }                                                              /* handle_blt */
 \f
 
@@ -719,7 +720,7 @@ int handle_bc (struct ppc_ctx *ctx)
  *     pfunc           The address of a function to call to print the output.
  *
  *
- * Returns TRUE if it was able to output the line info, or false if it was
+ * Returns true if it was able to output the line info, or false if it was
  * not.
  */
 
@@ -734,7 +735,7 @@ int print_source_line (char *filename, char *funcname,
        sprintf (out_buf, "%s %s(): line %d", filename, funcname, line_no);
        (*pfunc) (out_buf);
 
-       return TRUE;
+       return true;
 }                                                              /* print_source_line */
 \f
 
@@ -1039,14 +1040,14 @@ int downstring (char *s)
  * Arguments:
  *     nextaddr        The address (to be filled in) of the next
  *                     instruction to execute.  This will only be a valid
- *                     address if TRUE is returned.
+ *                     address if true is returned.
  *
  *     step_over       A flag indicating how to compute addresses for
  *                     branch statements:
- *                      TRUE  = Step over the branch (next)
- *                      FALSE = step into the branch (step)
+ *                      true  = Step over the branch (next)
+ *                      false = step into the branch (step)
  *
- * Returns TRUE if it was able to compute the address.  Returns FALSE if
+ * Returns true if it was able to compute the address.  Returns false if
  * it has a problem reading the current instruction or one of the registers.
  */
 
@@ -1075,7 +1076,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
 
        if (nextaddr == 0 || regs == 0) {
                printf ("find_next_address: bad args");
-               return FALSE;
+               return false;
        }
 
        pc = regs->nip & 0xfffffffc;
@@ -1083,7 +1084,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
 
        if ((op = find_opcode (instr)) == (struct opcode *) 0) {
                printf ("find_next_address: can't parse opcode 0x%lx", instr);
-               return FALSE;
+               return false;
        }
 
        ctr = regs->ctr;
@@ -1100,7 +1101,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
                        !get_operand_value (op, instr, O_BI, &bi) ||
                        !get_operand_value (op, instr, O_AA, &aa) ||
                        !get_operand_value (op, instr, O_LK, &lk))
-                       return FALSE;
+                       return false;
 
                if ((addr & (1 << 13)) != 0)
                        addr = addr - (1 << 14);
@@ -1116,7 +1117,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
                if (!get_operand_value (op, instr, O_LI, &addr) ||
                        !get_operand_value (op, instr, O_AA, &aa) ||
                        !get_operand_value (op, instr, O_LK, &lk))
-                       return FALSE;
+                       return false;
 
                if ((addr & (1 << 23)) != 0)
                        addr = addr - (1 << 24);
@@ -1130,7 +1131,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
                if (!get_operand_value (op, instr, O_BO, &bo) ||
                        !get_operand_value (op, instr, O_BI, &bi) ||
                        !get_operand_value (op, instr, O_LK, &lk))
-                       return FALSE;
+                       return false;
 
                addr = ctr;
                aa = 1;
@@ -1143,7 +1144,7 @@ int find_next_address (unsigned char *nextaddr, int step_over,
                if (!get_operand_value (op, instr, O_BO, &bo) ||
                        !get_operand_value (op, instr, O_BI, &bi) ||
                        !get_operand_value (op, instr, O_LK, &lk))
-                       return FALSE;
+                       return false;
 
                addr = lr;
                aa = 1;
@@ -1227,12 +1228,12 @@ int find_next_address (unsigned char *nextaddr, int step_over,
                step = next = pc + 4;
        }
 
-       if (step_over == TRUE)
+       if (step_over == true)
                *(unsigned long *) nextaddr = next;
        else
                *(unsigned long *) nextaddr = step;
 
-       return TRUE;
+       return true;
 }                                                              /* find_next_address */
 
 
index 9791423..77b6e3e 100644 (file)
@@ -292,7 +292,7 @@ int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
-       if (!find_next_address ((unsigned char *) &addr, FALSE, bug_ctx.regs))
+       if (!find_next_address((unsigned char *) &addr, false, bug_ctx.regs))
                return 1;
 
        if (bug_ctx.set)
@@ -323,7 +323,7 @@ int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
-       if (!find_next_address ((unsigned char *) &addr, TRUE, bug_ctx.regs))
+       if (!find_next_address((unsigned char *) &addr, true, bug_ctx.regs))
                return 1;
 
        if (bug_ctx.set)
index 66e0ef0..dfa3690 100644 (file)
 #define PRINTF(fmt,args...)
 #endif
 
-#ifndef        TRUE
-#define TRUE            1
-#endif
-#ifndef FALSE
-#define FALSE           0
-#endif
-
 /*#if defined(CONFIG_CMD_DATE) */
 /*#include <rtc.h> */
 /*#endif */
@@ -214,9 +207,9 @@ int wait_for_fdc_int(void)
                timeout--;
                udelay(10);
                if(timeout==0) /* timeout occured */
-                       return FALSE;
+                       return false;
        }
-       return TRUE;
+       return true;
 }
 
 /* reads a byte from the FIFO of the FDC and checks direction and RQM bit
@@ -244,7 +237,7 @@ int fdc_need_more_output(void)
                        c=(unsigned char)read_fdc_byte();
                        printf("Error: more output: %x\n",c);
        }
-       return TRUE;
+       return true;
 }
 
 
@@ -260,10 +253,10 @@ int write_fdc_byte(unsigned char val)
                udelay(10);
                fdc_need_more_output();
                if(timeout==0) /* timeout occured */
-                       return FALSE;
+                       return false;
        }
        write_fdc_reg(FDC_FIFO,val);
-       return TRUE;
+       return true;
 }
 
 /* sets up all FDC commands and issues it to the FDC. If
@@ -344,9 +337,9 @@ int fdc_issue_cmd(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
        }
        for(i=0;i<pCMD->cmdlen;i++) {
                /* PRINTF("write cmd%d = 0x%02X\n",i,pCMD->cmd[i]); */
-               if(write_fdc_byte(pCMD->cmd[i])==FALSE) {
+               if (write_fdc_byte(pCMD->cmd[i]) == false) {
                        PRINTF("Error: timeout while issue cmd%d\n",i);
-                       return FALSE;
+                       return false;
                }
        }
        timeout=FDC_TIME_OUT;
@@ -355,12 +348,12 @@ int fdc_issue_cmd(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
                        timeout--;
                        if(timeout==0) {
                                PRINTF(" timeout while reading result%d MSR=0x%02X\n",i,read_fdc_reg(FDC_MSR));
-                               return FALSE;
+                               return false;
                        }
                }
                pCMD->result[i]=(unsigned char)read_fdc_byte();
        }
-       return TRUE;
+       return true;
 }
 
 /* selects the drive assigned in the cmd structur and
@@ -391,9 +384,10 @@ void stop_fdc_drive(FDC_COMMAND_STRUCT *pCMD)
 int fdc_recalibrate(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
 {
        pCMD->cmd[COMMAND]=FDC_CMD_RECALIBRATE;
-       if(fdc_issue_cmd(pCMD,pFG)==FALSE)
-               return FALSE;
-       while(wait_for_fdc_int()!=TRUE);
+       if (fdc_issue_cmd(pCMD, pFG) == false)
+               return false;
+       while (wait_for_fdc_int() != true);
+
        pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
        return(fdc_issue_cmd(pCMD,pFG));
 }
@@ -403,9 +397,10 @@ int fdc_recalibrate(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
 int fdc_seek(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
 {
        pCMD->cmd[COMMAND]=FDC_CMD_SEEK;
-       if(fdc_issue_cmd(pCMD,pFG)==FALSE)
-               return FALSE;
-       while(wait_for_fdc_int()!=TRUE);
+       if (fdc_issue_cmd(pCMD, pFG) == false)
+               return false;
+       while (wait_for_fdc_int() != true);
+
        pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
        return(fdc_issue_cmd(pCMD,pFG));
 }
@@ -421,7 +416,7 @@ int fdc_terminate(FDC_COMMAND_STRUCT *pCMD)
        for(i=0;i<7;i++) {
                pCMD->result[i]=(unsigned char)read_fdc_byte();
        }
-       return TRUE;
+       return true;
 }
 
 /* reads data from FDC, seek commands are issued automatic */
@@ -440,18 +435,18 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
        retriesrw=0;
        retriescal=0;
        offset=0;
-       if(fdc_seek(pCMD,pFG)==FALSE) {
+       if (fdc_seek(pCMD, pFG) == false) {
                stop_fdc_drive(pCMD);
                if (flags)
                        enable_interrupts();
-               return FALSE;
+               return false;
        }
        if((pCMD->result[STATUS_0]&0x20)!=0x20) {
                printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
                stop_fdc_drive(pCMD);
                if (flags)
                        enable_interrupts();
-               return FALSE;
+               return false;
        }
        /* now determine the next seek point */
        /*      lastblk=pCMD->blnr + blocks; */
@@ -466,11 +461,11 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
 retryrw:
                len=sect_size * readblk;
                pCMD->cmd[COMMAND]=FDC_CMD_READ;
-               if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
+               if (fdc_issue_cmd(pCMD, pFG) == false) {
                        stop_fdc_drive(pCMD);
                        if (flags)
                                enable_interrupts();
-                       return FALSE;
+                       return false;
                }
                for (i=0;i<len;i++) {
                        timeout=FDC_TIME_OUT;
@@ -492,15 +487,15 @@ retryrw:
                                                        stop_fdc_drive(pCMD);
                                                        if (flags)
                                                                enable_interrupts();
-                                                       return FALSE;
+                                                       return false;
                                                }
                                                else {
                                                        PRINTF(" trying to recalibrate Try %d\n",retriescal);
-                                                       if(fdc_recalibrate(pCMD,pFG)==FALSE) {
+                                                       if (fdc_recalibrate(pCMD, pFG) == false) {
                                                                stop_fdc_drive(pCMD);
                                                                if (flags)
                                                                        enable_interrupts();
-                                                               return FALSE;
+                                                               return false;
                                                        }
                                                        retriesrw=0;
                                                        goto retrycal;
@@ -512,7 +507,7 @@ retryrw:
                                        } /* else >FDC_RW_RETRIES */
                                }/* if output */
                                timeout--;
-                       }while(TRUE);
+                       } while (true);
                } /* for len */
                /* the last sector of a track or all data has been read,
                 * we need to get the results */
@@ -530,22 +525,22 @@ retryrw:
                        readblk=blocks;
 retrycal:
                /* a seek is necessary */
-               if(fdc_seek(pCMD,pFG)==FALSE) {
+               if (fdc_seek(pCMD, pFG) == false) {
                        stop_fdc_drive(pCMD);
                        if (flags)
                                enable_interrupts();
-                       return FALSE;
+                       return false;
                }
                if((pCMD->result[STATUS_0]&0x20)!=0x20) {
                        PRINTF("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
                        stop_fdc_drive(pCMD);
-                       return FALSE;
+                       return false;
                }
-       }while(TRUE); /* start over */
+       } while (true); /* start over */
        stop_fdc_drive(pCMD); /* switch off drive */
        if (flags)
                enable_interrupts();
-       return TRUE;
+       return true;
 }
 
 /* Scan all drives and check if drive is present and disk is inserted */
@@ -559,20 +554,20 @@ int fdc_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
                pCMD->drive=drives;
                select_fdc_drive(pCMD);
                pCMD->blnr=0; /* set to the 1st block */
-               if(fdc_recalibrate(pCMD,pFG)==FALSE)
+               if (fdc_recalibrate(pCMD, pFG) == false)
                        continue;
                if((pCMD->result[STATUS_0]&0x10)==0x10)
                        continue;
                /* ok drive connected check for disk */
                state|=(1<<drives);
                pCMD->blnr=pFG->size; /* set to the last block */
-               if(fdc_seek(pCMD,pFG)==FALSE)
+               if (fdc_seek(pCMD, pFG) == false)
                        continue;
                pCMD->blnr=0; /* set to the 1st block */
-               if(fdc_recalibrate(pCMD,pFG)==FALSE)
+               if (fdc_recalibrate(pCMD, pFG) == false)
                        continue;
                pCMD->cmd[COMMAND]=FDC_CMD_READ_ID;
-               if(fdc_issue_cmd(pCMD,pFG)==FALSE)
+               if (fdc_issue_cmd(pCMD, pFG) == false)
                        continue;
                state|=(0x10<<drives);
        }
@@ -584,7 +579,7 @@ int fdc_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
                        ((state&(0x10<<i))==(0x10<<i)) ? pFG->name : "");
        }
        pCMD->flags=state;
-       return TRUE;
+       return true;
 }
 
 
@@ -611,9 +606,9 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
        write_fdc_reg(FDC_CCR,pFG->rate);
        /* then initialize the DSR */
        write_fdc_reg(FDC_DSR,pFG->rate);
-       if(wait_for_fdc_int()==FALSE) {
+       if (wait_for_fdc_int() == false) {
                        PRINTF("Time Out after writing CCR\n");
-                       return FALSE;
+                       return false;
        }
        /* now issue sense Interrupt and status command
         * assuming only one drive present (drive 0) */
@@ -621,7 +616,7 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
        for(i=0;i<4;i++) {
                /* issue sense interrupt for all 4 possible drives */
                pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
-               if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
+               if (fdc_issue_cmd(pCMD, pFG) == false) {
                        PRINTF("Sense Interrupt for drive %d failed\n",i);
                }
        }
@@ -629,24 +624,24 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
        pCMD->drive=drive;
        select_fdc_drive(pCMD);
        pCMD->cmd[COMMAND]=FDC_CMD_CONFIGURE;
-       if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
+       if (fdc_issue_cmd(pCMD, pFG) == false) {
                PRINTF(" configure timeout\n");
                stop_fdc_drive(pCMD);
-               return FALSE;
+               return false;
        }
        /* issue specify command */
        pCMD->cmd[COMMAND]=FDC_CMD_SPECIFY;
-       if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
+       if (fdc_issue_cmd(pCMD, pFG) == false) {
                PRINTF(" specify timeout\n");
                stop_fdc_drive(pCMD);
-               return FALSE;
+               return false;
 
        }
        /* then, we clear the reset in the DOR */
        /* fdc_check_drive(pCMD,pFG);   */
        /*      write_fdc_reg(FDC_DOR,0x04); */
 
-       return TRUE;
+       return true;
 }
 
 #if defined(CONFIG_CMD_FDOS)
@@ -664,30 +659,30 @@ int fdc_fdos_init (int drive)
        FDC_COMMAND_STRUCT *pCMD = &cmd;
 
        /* setup FDC and scan for drives  */
-       if(fdc_setup(drive,pCMD,pFG)==FALSE) {
+       if (fdc_setup(drive, pCMD, pFG) == false) {
                printf("\n** Error in setup FDC **\n");
-               return FALSE;
+               return false;
        }
-       if(fdc_check_drive(pCMD,pFG)==FALSE) {
+       if (fdc_check_drive(pCMD, pFG) == false) {
                printf("\n** Error in check_drives **\n");
-               return FALSE;
+               return false;
        }
        if((pCMD->flags&(1<<drive))==0) {
                /* drive not available */
                printf("\n** Drive %d not available **\n",drive);
-               return FALSE;
+               return false;
        }
        if((pCMD->flags&(0x10<<drive))==0) {
                /* no disk inserted */
                printf("\n** No disk inserted in drive %d **\n",drive);
-               return FALSE;
+               return false;
        }
        /* ok, we have a valid source */
        pCMD->drive=drive;
 
        /* read first block */
        pCMD->blnr=0;
-       return TRUE;
+       return true;
 }
 /**************************************************************************
 * int fdc_fdos_seek
@@ -747,11 +742,11 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return CMD_RET_USAGE;
        }
        /* setup FDC and scan for drives  */
-       if(fdc_setup(boot_drive,pCMD,pFG)==FALSE) {
+       if (fdc_setup(boot_drive, pCMD, pFG) == false) {
                printf("\n** Error in setup FDC **\n");
                return 1;
        }
-       if(fdc_check_drive(pCMD,pFG)==FALSE) {
+       if (fdc_check_drive(pCMD, pFG) == false) {
                printf("\n** Error in check_drives **\n");
                return 1;
        }
@@ -769,7 +764,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        pCMD->drive=boot_drive;
        /* read first block */
        pCMD->blnr=0;
-       if(fdc_read_data((unsigned char *)addr,1,pCMD,pFG)==FALSE) {
+       if (fdc_read_data((unsigned char *)addr, 1, pCMD, pFG) == false) {
                printf("\nRead error:");
                for(i=0;i<7;i++)
                        printf("result%d: 0x%02X\n",i,pCMD->result[i]);
@@ -801,7 +796,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                nrofblk++;
        printf("Loading %ld Bytes (%d blocks) at 0x%08lx..\n",imsize,nrofblk,addr);
        pCMD->blnr=0;
-       if(fdc_read_data((unsigned char *)addr,nrofblk,pCMD,pFG)==FALSE) {
+       if (fdc_read_data((unsigned char *)addr, nrofblk, pCMD, pFG) == false) {
                /* read image block */
                printf("\nRead error:");
                for(i=0;i<7;i++)
index 8c53a10..9f3d6c5 100644 (file)
@@ -164,8 +164,12 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        if (strcmp(argv[1], "rescan") == 0) {
-               struct mmc *mmc = find_mmc_device(curr_device);
+               struct mmc *mmc;
 
+               if (argc != 2)
+                       return CMD_RET_USAGE;
+
+               mmc = find_mmc_device(curr_device);
                if (!mmc) {
                        printf("no mmc device at slot %x\n", curr_device);
                        return 1;
@@ -179,8 +183,12 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        return 0;
        } else if (strncmp(argv[1], "part", 4) == 0) {
                block_dev_desc_t *mmc_dev;
-               struct mmc *mmc = find_mmc_device(curr_device);
+               struct mmc *mmc;
+
+               if (argc != 2)
+                       return CMD_RET_USAGE;
 
+               mmc = find_mmc_device(curr_device);
                if (!mmc) {
                        printf("no mmc device at slot %x\n", curr_device);
                        return 1;
@@ -196,6 +204,8 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                puts("get mmc type error!\n");
                return 1;
        } else if (strcmp(argv[1], "list") == 0) {
+               if (argc != 2)
+                       return CMD_RET_USAGE;
                print_mmc_devices('\n');
                return 0;
        } else if (strcmp(argv[1], "dev") == 0) {
index 266bfa6..13b3d99 100644 (file)
@@ -110,7 +110,7 @@ void scsi_scan(int mode)
                scsi_dev_desc[i].vendor[0]=0;
                scsi_dev_desc[i].product[0]=0;
                scsi_dev_desc[i].revision[0]=0;
-               scsi_dev_desc[i].removable=FALSE;
+               scsi_dev_desc[i].removable = false;
                scsi_dev_desc[i].if_type=IF_TYPE_SCSI;
                scsi_dev_desc[i].dev=i;
                scsi_dev_desc[i].part_type=PART_TYPE_UNKNOWN;
@@ -125,7 +125,7 @@ void scsi_scan(int mode)
                        pccb->pdata=(unsigned char *)&tempbuff;
                        pccb->datalen=512;
                        scsi_setup_inquiry(pccb);
-                       if(scsi_exec(pccb)!=TRUE) {
+                       if (scsi_exec(pccb) != true) {
                                if(pccb->contr_stat==SCSI_SEL_TIME_OUT) {
                                        debug ("Selection timeout ID %d\n",pccb->target);
                                        continue; /* selection timeout => assuming no device present */
@@ -139,7 +139,7 @@ void scsi_scan(int mode)
                                continue; /* skip unknown devices */
                        }
                        if((modi&0x80)==0x80) /* drive is removable */
-                               scsi_dev_desc[scsi_max_devs].removable=TRUE;
+                               scsi_dev_desc[scsi_max_devs].removable=true;
                        /* get info for this device */
                        scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].vendor[0],
                                       &tempbuff[8], 8);
@@ -152,8 +152,8 @@ void scsi_scan(int mode)
 
                        pccb->datalen=0;
                        scsi_setup_test_unit_ready(pccb);
-                       if(scsi_exec(pccb)!=TRUE) {
-                               if(scsi_dev_desc[scsi_max_devs].removable==TRUE) {
+                       if (scsi_exec(pccb) != true) {
+                               if (scsi_dev_desc[scsi_max_devs].removable == true) {
                                        scsi_dev_desc[scsi_max_devs].type=perq;
                                        goto removable;
                                }
@@ -404,7 +404,7 @@ static ulong scsi_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer)
                debug("scsi_read_ext: startblk " LBAF
                      ", blccnt %x buffer %lx\n",
                      start, smallblks, buf_addr);
-               if(scsi_exec(pccb)!=TRUE) {
+               if (scsi_exec(pccb) != true) {
                        scsi_print_error(pccb);
                        blkcnt-=blks;
                        break;
@@ -458,7 +458,7 @@ static ulong scsi_write(int device, ulong blknr,
                }
                debug("%s: startblk " LBAF ", blccnt %x buffer %lx\n",
                      __func__, start, smallblks, buf_addr);
-               if (scsi_exec(pccb) != TRUE) {
+               if (scsi_exec(pccb) != true) {
                        scsi_print_error(pccb);
                        blkcnt -= blks;
                        break;
@@ -521,7 +521,7 @@ int scsi_read_capacity(ccb *pccb, lbaint_t *capacity, unsigned long *blksz)
        pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
 
        pccb->datalen = 8;
-       if (scsi_exec(pccb) != TRUE)
+       if (scsi_exec(pccb) != true)
                return 1;
 
        *capacity = ((lbaint_t)pccb->pdata[0] << 24) |
@@ -547,7 +547,7 @@ int scsi_read_capacity(ccb *pccb, lbaint_t *capacity, unsigned long *blksz)
        pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
 
        pccb->datalen = 16;
-       if (scsi_exec(pccb) != TRUE)
+       if (scsi_exec(pccb) != true)
                return 1;
 
        *capacity = ((uint64_t)pccb->pdata[0] << 56) |
index 2a9d169..3c70d5d 100644 (file)
   MORECORE_FAILURE          (default: -1)
      The value returned upon failure of MORECORE.
   MORECORE_CLEARS           (default 1)
-     True (1) if the routine mapped to MORECORE zeroes out memory (which
+     true (1) if the routine mapped to MORECORE zeroes out memory (which
      holds for sbrk).
   DEFAULT_TRIM_THRESHOLD
   DEFAULT_TOP_PAD
index 32a38bc..d86acff 100644 (file)
   MORECORE_FAILURE          (default: -1)
      The value returned upon failure of MORECORE.
   MORECORE_CLEARS           (default 1)
-     True (1) if the routine mapped to MORECORE zeroes out memory (which
+     true (1) if the routine mapped to MORECORE zeroes out memory (which
      holds for sbrk).
   DEFAULT_TRIM_THRESHOLD
   DEFAULT_TOP_PAD
index 38c9615..0591b99 100644 (file)
@@ -30,6 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
 env_t *env_ptr;
 
 char *env_name_spec = "dataflash";
+static char env_buf[CONFIG_ENV_SIZE];
 
 uchar env_get_char_spec(int index)
 {
@@ -42,11 +43,9 @@ uchar env_get_char_spec(int index)
 
 void env_relocate_spec(void)
 {
-       char buf[CONFIG_ENV_SIZE];
+       read_dataflash(CONFIG_ENV_ADDR, CONFIG_ENV_SIZE, env_buf);
 
-       read_dataflash(CONFIG_ENV_ADDR, CONFIG_ENV_SIZE, buf);
-
-       env_import(buf, 1);
+       env_import(env_buf, 1);
 }
 
 #ifdef CONFIG_ENV_OFFSET_REDUND
@@ -55,20 +54,20 @@ void env_relocate_spec(void)
 
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res;
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
 
        return write_dataflash(CONFIG_ENV_ADDR,
-                               (unsigned long)&env_new,
+                               (unsigned long)env_new,
                                CONFIG_ENV_SIZE);
 }
 
index 45c935b..b136f04 100644 (file)
@@ -38,6 +38,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 env_t *env_ptr;
+static char env_buf[CONFIG_ENV_SIZE];
 
 char *env_name_spec = "EEPROM";
 int env_eeprom_bus = -1;
@@ -111,7 +112,7 @@ uchar env_get_char_spec(int index)
 
 void env_relocate_spec(void)
 {
-       char buf[CONFIG_ENV_SIZE];
+       char *buf = env_buf;
        unsigned int off = CONFIG_ENV_OFFSET;
 
 #ifdef CONFIG_ENV_OFFSET_REDUND
@@ -126,7 +127,7 @@ void env_relocate_spec(void)
 
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res;
        int     rc;
@@ -138,13 +139,13 @@ int saveenv(void)
 
        BUG_ON(env_ptr != NULL);
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
 
 #ifdef CONFIG_ENV_OFFSET_REDUND
        if (gd->env_valid == 1) {
@@ -152,11 +153,11 @@ int saveenv(void)
                off_red = CONFIG_ENV_OFFSET;
        }
 
-       env_new.flags = ACTIVE_FLAG;
+       env_new->flags = ACTIVE_FLAG;
 #endif
 
        rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,
-                             off, (uchar *)&env_new, CONFIG_ENV_SIZE);
+                             off, (uchar *)env_new, CONFIG_ENV_SIZE);
 
 #ifdef CONFIG_ENV_OFFSET_REDUND
        if (rc == 0) {
index c0f18ab..dd7139d 100644 (file)
@@ -37,6 +37,7 @@
 char *env_name_spec = "FAT";
 
 env_t *env_ptr;
+static char env_buf[CONFIG_ENV_SIZE];
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -52,7 +53,7 @@ int env_init(void)
 #ifdef CONFIG_CMD_SAVEENV
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = env_buf;
        ssize_t len;
        char    *res;
        block_dev_desc_t *dev_desc = NULL;
@@ -60,7 +61,7 @@ int saveenv(void)
        int part = FAT_ENV_PART;
        int err;
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
@@ -95,8 +96,8 @@ int saveenv(void)
                return 1;
        }
 
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
-       err = file_fat_write(FAT_ENV_FILE, (void *)&env_new, sizeof(env_t));
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
+       err = file_fat_write(FAT_ENV_FILE, (void *)env_new, sizeof(env_t));
        if (err == -1) {
                printf("\n** Unable to write \"%s\" from %s%d:%d **\n",
                        FAT_ENV_FILE, FAT_ENV_INTERFACE, dev, part);
@@ -110,7 +111,7 @@ int saveenv(void)
 
 void env_relocate_spec(void)
 {
-       char buf[CONFIG_ENV_SIZE];
+       char *buf = env_buf;
        block_dev_desc_t *dev_desc = NULL;
        int dev = FAT_ENV_DEVICE;
        int part = FAT_ENV_PART;
index 02bd5ae..f568013 100644 (file)
@@ -40,6 +40,8 @@ env_t *env_ptr = &environment;
 env_t *env_ptr;
 #endif /* ENV_IS_EMBEDDED */
 
+DEFINE_CACHE_ALIGN_BUFFER(char, env_buf, CONFIG_ENV_SIZE);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if !defined(CONFIG_ENV_OFFSET)
@@ -112,7 +114,7 @@ static inline int write_env(struct mmc *mmc, unsigned long size,
 
 int saveenv(void)
 {
-       ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
+       env_t *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res;
        struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
@@ -127,7 +129,7 @@ int saveenv(void)
                goto fini;
        }
 
-       res = (char *)&env_new->data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
@@ -135,7 +137,7 @@ int saveenv(void)
                goto fini;
        }
 
-       env_new->crc = crc32(0, &env_new->data[0], ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
        printf("Writing to MMC(%d)... ", CONFIG_SYS_MMC_ENV_DEV);
        if (write_env(mmc, CONFIG_ENV_SIZE, offset, (u_char *)env_new)) {
                puts("failed\n");
@@ -169,7 +171,6 @@ static inline int read_env(struct mmc *mmc, unsigned long size,
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-       ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
        struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
        u32 offset;
        int ret;
@@ -184,12 +185,12 @@ void env_relocate_spec(void)
                goto fini;
        }
 
-       if (read_env(mmc, CONFIG_ENV_SIZE, offset, buf)) {
+       if (read_env(mmc, CONFIG_ENV_SIZE, offset, env_buf)) {
                ret = 1;
                goto fini;
        }
 
-       env_import(buf, 1);
+       env_import(env_buf, 1);
        ret = 0;
 
 fini:
index 5b69889..8cc2055 100644 (file)
@@ -64,6 +64,8 @@ env_t *env_ptr = (env_t *)CONFIG_NAND_ENV_DST;
 env_t *env_ptr;
 #endif /* ENV_IS_EMBEDDED */
 
+DEFINE_CACHE_ALIGN_BUFFER(char, env_buf, CONFIG_ENV_SIZE);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -173,7 +175,7 @@ static unsigned char env_flags;
 
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res;
        int     ret = 0;
@@ -185,14 +187,14 @@ int saveenv(void)
        if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
                return 1;
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc     = crc32(0, env_new.data, ENV_SIZE);
-       env_new.flags   = ++env_flags; /* increase the serial */
+       env_new->crc    = crc32(0, env_new->data, ENV_SIZE);
+       env_new->flags  = ++env_flags; /* increase the serial */
 
        if (gd->env_valid == 1) {
                puts("Erasing redundant NAND...\n");
@@ -201,7 +203,7 @@ int saveenv(void)
                        return 1;
 
                puts("Writing to redundant NAND... ");
-               ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)&env_new);
+               ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)env_new);
        } else {
                puts("Erasing NAND...\n");
                nand_erase_options.offset = CONFIG_ENV_OFFSET;
@@ -209,7 +211,7 @@ int saveenv(void)
                        return 1;
 
                puts("Writing to NAND... ");
-               ret = writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new);
+               ret = writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new);
        }
        if (ret) {
                puts("FAILED!\n");
@@ -226,7 +228,7 @@ int saveenv(void)
 int saveenv(void)
 {
        int     ret = 0;
-       ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res;
        nand_erase_options_t nand_erase_options;
@@ -238,7 +240,7 @@ int saveenv(void)
        if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
                return 1;
 
-       res = (char *)&env_new->data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
@@ -404,7 +406,6 @@ void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
        int ret;
-       ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
 
 #if defined(CONFIG_ENV_OFFSET_OOB)
        ret = get_nand_env_oob(&nand_info[0], &nand_env_oob_offset);
@@ -420,13 +421,13 @@ void env_relocate_spec(void)
        }
 #endif
 
-       ret = readenv(CONFIG_ENV_OFFSET, (u_char *)buf);
+       ret = readenv(CONFIG_ENV_OFFSET, (u_char *)env_buf);
        if (ret) {
                set_default_env("!readenv() failed");
                return;
        }
 
-       env_import(buf, 1);
+       env_import(env_buf, 1);
 #endif /* ! ENV_IS_EMBEDDED */
 }
 #endif /* CONFIG_ENV_OFFSET_REDUND */
index eab0e7b..ff74a6c 100644 (file)
@@ -59,6 +59,10 @@ env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
 
 char *env_name_spec = "NVRAM";
 
+#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE
+static char env_buf[CONFIG_ENV_SIZE];
+#endif
+
 #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE
 uchar env_get_char_spec(int index)
 {
@@ -72,36 +76,38 @@ uchar env_get_char_spec(int index)
 
 void env_relocate_spec(void)
 {
-       char buf[CONFIG_ENV_SIZE];
+       char *buf;
 
 #if defined(CONFIG_SYS_NVRAM_ACCESS_ROUTINE)
+       buf = env_buf;
        nvram_read(buf, CONFIG_ENV_ADDR, CONFIG_ENV_SIZE);
 #else
-       memcpy(buf, (void *)CONFIG_ENV_ADDR, CONFIG_ENV_SIZE);
+       buf = (void *)CONFIG_ENV_ADDR;
 #endif
        env_import(buf, 1);
 }
 
 int saveenv(void)
 {
-       env_t   env_new;
+#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE
+       env_t   *env_new = (env_t *)env_buf;
+#else
+       env_t   *env_new = (env_t *)CONFIG_ENV_ADDR;
+#endif
        ssize_t len;
        char    *res;
        int     rcode = 0;
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
 
 #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE
-       nvram_write(CONFIG_ENV_ADDR, &env_new, CONFIG_ENV_SIZE);
-#else
-       if (memcpy((char *)CONFIG_ENV_ADDR, &env_new, CONFIG_ENV_SIZE) == NULL)
-               rcode = 1;
+       nvram_write(CONFIG_ENV_ADDR, env_new, CONFIG_ENV_SIZE);
 #endif
        return rcode;
 }
@@ -115,7 +121,7 @@ int env_init(void)
 {
 #if defined(CONFIG_SYS_NVRAM_ACCESS_ROUTINE)
        ulong crc;
-       uchar data[ENV_SIZE];
+       uchar *data = env_buf;
 
        nvram_read(&crc, CONFIG_ENV_ADDR, sizeof(ulong));
        nvram_read(data, CONFIG_ENV_ADDR + sizeof(ulong), ENV_SIZE);
index faa903d..6fd5613 100644 (file)
@@ -42,6 +42,8 @@ char *env_name_spec = "OneNAND";
 #define ONENAND_MAX_ENV_SIZE   CONFIG_ENV_SIZE
 #define ONENAND_ENV_SIZE(mtd)  (ONENAND_MAX_ENV_SIZE - ENV_HEADER_SIZE)
 
+static char env_buf[CONFIG_ENV_SIZE];
+
 DECLARE_GLOBAL_DATA_PTR;
 
 void env_relocate_spec(void)
@@ -56,8 +58,7 @@ void env_relocate_spec(void)
        char *buf = (char *)&environment;
 #else
        loff_t env_addr = CONFIG_ENV_ADDR;
-       char onenand_env[ONENAND_MAX_ENV_SIZE];
-       char *buf = (char *)&onenand_env[0];
+       char *buf = env_buf;
 #endif /* ENV_IS_EMBEDDED */
 
 #ifndef ENV_IS_EMBEDDED
@@ -81,7 +82,7 @@ void env_relocate_spec(void)
 
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = env_buf;
        ssize_t len;
        char    *res;
        struct mtd_info *mtd = &onenand_mtd;
@@ -94,13 +95,13 @@ int saveenv(void)
                .callback       = NULL,
        };
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
 
        instr.len = CONFIG_ENV_SIZE;
 #ifdef CONFIG_ENV_ADDR_FLEX
@@ -119,7 +120,7 @@ int saveenv(void)
        }
 
        if (mtd->write(mtd, env_addr, ONENAND_MAX_ENV_SIZE, &retlen,
-                       (u_char *)&env_new)) {
+                       (u_char *)env_new)) {
                printf("OneNAND: write failed at 0x%llx\n", instr.addr);
                return 2;
        }
index d9e9085..9a592ba 100644 (file)
@@ -58,11 +58,12 @@ DECLARE_GLOBAL_DATA_PTR;
 char *env_name_spec = "SPI Flash";
 
 static struct spi_flash *env_flash;
+static char env_buf[CONFIG_ENV_SIZE];
 
 #if defined(CONFIG_ENV_OFFSET_REDUND)
 int saveenv(void)
 {
-       env_t   env_new;
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
        char    *res, *saved_buffer = NULL, flag = OBSOLETE_FLAG;
        u32     saved_size, saved_offset, sector = 1;
@@ -78,14 +79,14 @@ int saveenv(void)
                }
        }
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
-       env_new.crc     = crc32(0, env_new.data, ENV_SIZE);
-       env_new.flags   = ACTIVE_FLAG;
+       env_new->crc    = crc32(0, env_new->data, ENV_SIZE);
+       env_new->flags  = ACTIVE_FLAG;
 
        if (gd->env_valid == 1) {
                env_new_offset = CONFIG_ENV_OFFSET_REDUND;
@@ -125,7 +126,7 @@ int saveenv(void)
        puts("Writing to SPI flash...");
 
        ret = spi_flash_write(env_flash, env_new_offset,
-               CONFIG_ENV_SIZE, &env_new);
+               CONFIG_ENV_SIZE, env_new);
        if (ret)
                goto done;
 
@@ -137,7 +138,7 @@ int saveenv(void)
        }
 
        ret = spi_flash_write(env_flash, env_offset + offsetof(env_t, flags),
-                               sizeof(env_new.flags), &flag);
+                               sizeof(env_new->flags), &flag);
        if (ret)
                goto done;
 
@@ -243,7 +244,7 @@ int saveenv(void)
        u32     saved_size, saved_offset, sector = 1;
        char    *res, *saved_buffer = NULL;
        int     ret = 1;
-       env_t   env_new;
+       env_t   *env_new = (env_t *)env_buf;
        ssize_t len;
 
        if (!env_flash) {
@@ -276,13 +277,13 @@ int saveenv(void)
                        sector++;
        }
 
-       res = (char *)&env_new.data;
+       res = (char *)env_new->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
                error("Cannot export environment: errno = %d\n", errno);
                goto done;
        }
-       env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+       env_new->crc = crc32(0, env_new->data, ENV_SIZE);
 
        puts("Erasing SPI flash...");
        ret = spi_flash_erase(env_flash, CONFIG_ENV_OFFSET,
@@ -292,7 +293,7 @@ int saveenv(void)
 
        puts("Writing to SPI flash...");
        ret = spi_flash_write(env_flash, CONFIG_ENV_OFFSET,
-               CONFIG_ENV_SIZE, &env_new);
+               CONFIG_ENV_SIZE, env_new);
        if (ret)
                goto done;
 
@@ -315,7 +316,7 @@ int saveenv(void)
 
 void env_relocate_spec(void)
 {
-       char buf[CONFIG_ENV_SIZE];
+       char *buf = env_buf;
        int ret;
 
        env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
index b3fd0e9..e9987f0 100644 (file)
@@ -30,6 +30,7 @@
  *
  * This limits the maximum size of addressable storage to < 2 Terra Bytes
  */
+#include <asm/unaligned.h>
 #include <common.h>
 #include <command.h>
 #include <ide.h>
@@ -505,7 +506,7 @@ err:
 static int pmbr_part_valid(struct partition *part)
 {
        if (part->sys_ind == EFI_PMBR_OSTYPE_EFI_GPT &&
-               le32_to_cpu(part->start_sect) == 1UL) {
+               get_unaligned_le32(&part->start_sect) == 1UL) {
                return 1;
        }
 
index 85bda03..8352835 100644 (file)
@@ -156,6 +156,14 @@ To use this, put something like this in your board header file:
 
 #define CONFIG_EXTRA_ENV_SETTINGS      "fdtcontroladdr=10000\0"
 
+Build:
+
+After board configuration is done, fdt supported u-boot can be build in two ways:
+1)  build the default dts which is defined from CONFIG_DEFAULT_DEVICE_TREE
+    $ make
+2)  build the user specified dts file
+    $ make DEVICE_TREE=<dts-file-name>
+
 
 Limitations
 -----------
index dbb5e8c..3b2ed6e 100644 (file)
 /* Length of the BIOS image */
 #define MAX_BIOSLEN        (128 * 1024L)
 
-/* Define some useful types and macros */
-#define true               1
-#define false              0
-
 /* Place to save PCI BAR's that we change and later restore */
 static u32 saveROMBaseAddress;
 static u32 saveBaseAddress10;
@@ -242,7 +238,7 @@ pcidev      - PCI device info for the video card on the bus to boot
 VGAInfo - BIOS emulator VGA info structure
 
 RETURNS:
-True if successfully initialised, false if not.
+true if successfully initialised, false if not.
 
 REMARKS:
 Loads and POST's the display controllers BIOS, directly from the BIOS
@@ -295,7 +291,7 @@ static int PCI_postController(pci_dev_t pcidev, BE_VGAInfo * VGAInfo)
 PARAMETERS:
 pcidev     - PCI device info for the video card on the bus to boot
 pVGAInfo    - Place to return VGA info structure is requested
-cleanUp            - True to clean up on exit, false to leave emulator active
+cleanUp            - true to clean up on exit, false to leave emulator active
 
 REMARKS:
 Boots the PCI/AGP video card on the bus using the Video ROM BIOS image
index 84724b7..ad88a53 100644 (file)
@@ -47,6 +47,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"
 
index 7cf4879..bcc192f 100644 (file)
@@ -41,6 +41,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"
 
index 13cb317..e92e96e 100644 (file)
@@ -127,9 +127,9 @@ biosmem_limit   - Limit of the BIOS image
 busmem_base     - Base of the VGA bus memory
 timer           - Timer used to emulate PC timer ports
 timer0          - Latched value for timer 0
-timer0Latched   - True if timer 0 value was just latched
+timer0Latched   - true if timer 0 value was just latched
 timer2          - Current value for timer 2
-emulateVGA      - True to emulate VGA I/O and memory accesses
+emulateVGA      - true to emulate VGA I/O and memory accesses
 ****************************************************************************/
 
 typedef struct {
index 6417d09..2fa8050 100644 (file)
@@ -309,7 +309,7 @@ void x86emu_single_step(void)
                case 'P':
                        noDecode = (noDecode) ? 0 : 1;
                        printk("Toggled decoding to %s\n",
-                              (noDecode) ? "FALSE" : "TRUE");
+                              (noDecode) ? "false" : "true");
                        break;
                case 't':
                case 0:
index 8c785ae..cab7f8c 100644 (file)
@@ -865,14 +865,14 @@ int scsi_exec(ccb *pccb)
                break;
        default:
                printf("Unsupport SCSI command 0x%02x\n", pccb->cmd[0]);
-               return FALSE;
+               return false;
        }
 
        if (ret) {
                debug("SCSI command 0x%02x ret errno %d\n", pccb->cmd[0], ret);
-               return FALSE;
+               return false;
        }
-       return TRUE;
+       return true;
 
 }
 
index 28d87f5..49288a7 100644 (file)
@@ -360,7 +360,7 @@ int init_sata(int dev)
        if (status == 0x7f) {
                printf("Hard Disk not found.\n");
                dev_state = SATA_NODEVICE;
-               rc = FALSE;
+               rc = false;
                return rc;
        }
 
@@ -381,7 +381,7 @@ int init_sata(int dev)
                        printf("** TimeOUT **\n");
 
                        dev_state = SATA_NODEVICE;
-                       rc = FALSE;
+                       rc = false;
                        return rc;
                }
                if ((i >= 100) && ((i % 100) == 0))
@@ -458,7 +458,7 @@ static int sata_dwc_softreset(struct ata_port *ap)
        } else {
                printf("No device found\n");
                dev_state = SATA_NODEVICE;
-               return FALSE;
+               return false;
        }
 
        tmp = ATA_DEVICE_OBS;
@@ -737,7 +737,7 @@ static int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
        status = ata_busy_wait(ap, ATA_BUSY, 30000);
        if (status & ATA_BUSY) {
                printf("BSY = 0 check. timeout.\n");
-               rc = FALSE;
+               rc = false;
                return rc;
        }
 
@@ -987,7 +987,7 @@ unsigned ata_exec_internal(struct ata_device *dev,
        status = ata_busy_wait(ap, ATA_BUSY, 300000);
        if (status & ATA_BUSY) {
                printf("BSY = 0 check. timeout.\n");
-               rc = FALSE;
+               rc = false;
                return rc;
        }
 
@@ -997,7 +997,7 @@ unsigned ata_exec_internal(struct ata_device *dev,
        tag = ATA_TAG_INTERNAL;
 
        if (test_and_set_bit(tag, &ap->qc_allocated)) {
-               rc = FALSE;
+               rc = false;
                return rc;
        }
 
@@ -1656,14 +1656,14 @@ static int check_sata_dev_state(void)
 
                ret = ata_dev_read_sectors(pdata, datalen, 0, 1);
 
-               if (ret == TRUE)
+               if (ret == true)
                        break;
 
                i++;
                if (i > (ATA_RESET_TIME * 100)) {
                        printf("** TimeOUT **\n");
                        dev_state = SATA_NODEVICE;
-                       return FALSE;
+                       return false;
                }
 
                if ((i >= 100) && ((i % 100) == 0))
@@ -1672,7 +1672,7 @@ static int check_sata_dev_state(void)
 
        dev_state = SATA_READY;
 
-       return TRUE;
+       return true;
 }
 
 static unsigned int ata_dev_set_feature(struct ata_device *dev,
@@ -1772,7 +1772,7 @@ ulong sata_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer)
                        blks = 0;
                }
 
-               if (ata_dev_read_sectors(pdata, datalen, block, n_block) != TRUE) {
+               if (ata_dev_read_sectors(pdata, datalen, block, n_block) != true) {
                        printf("sata_dwc : Hard disk read error.\n");
                        blkcnt -= blks;
                        break;
@@ -1795,7 +1795,7 @@ static int ata_dev_read_sectors(unsigned char *pdata, unsigned long datalen,
        int may_fallback = 1;
 
        if (dev_state == SATA_ERROR)
-               return FALSE;
+               return false;
 
        ata_dev_select(ap, dev->devno, 1, 1);
 
@@ -1893,11 +1893,11 @@ retry:
                goto err_out;
        }
 
-       return TRUE;
+       return true;
 
 err_out:
        printf("failed to READ SECTORS (%s, err_mask=0x%x)\n", reason, err_mask);
-       return FALSE;
+       return false;
 }
 
 #if defined(CONFIG_SATA_DWC) && !defined(CONFIG_LBA48)
@@ -1946,7 +1946,7 @@ ulong sata_write(int device, ulong blknr, lbaint_t blkcnt, const void *buffer)
                        blks = 0;
                }
 
-               if (ata_dev_write_sectors(pdata, datalen, block, n_block) != TRUE) {
+               if (ata_dev_write_sectors(pdata, datalen, block, n_block) != true) {
                        printf("sata_dwc : Hard disk read error.\n");
                        blkcnt -= blks;
                        break;
@@ -1969,7 +1969,7 @@ static int ata_dev_write_sectors(unsigned char* pdata, unsigned long datalen,
        int may_fallback = 1;
 
        if (dev_state == SATA_ERROR)
-               return FALSE;
+               return false;
 
        ata_dev_select(ap, dev->devno, 1, 1);
 
@@ -2068,9 +2068,9 @@ retry:
                goto err_out;
        }
 
-       return TRUE;
+       return true;
 
 err_out:
        printf("failed to WRITE SECTORS (%s, err_mask=0x%x)\n", reason, err_mask);
-       return FALSE;
+       return false;
 }
index 204d644..e4e4ab1 100644 (file)
@@ -467,11 +467,4 @@ struct ata_port {
        unsigned char           *pdata;
 };
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 #endif
index 564aa98..656683a 100644 (file)
@@ -764,9 +764,9 @@ int scsi_exec(ccb *pccb)
 retry:
        scsi_issue(pccb);
        if(pccb->contr_stat!=SIR_COMPLETE)
-               return FALSE;
+               return false;
        if(pccb->status==S_GOOD)
-               return TRUE;
+               return true;
        if(pccb->status==S_CHECK_COND) { /* check condition */
                for(i=0;i<16;i++)
                        tmpcmd[i]=pccb->cmd[i];
@@ -797,12 +797,12 @@ retry:
                        case SENSE_NO_SENSE:
                        case SENSE_RECOVERED_ERROR:
                                /* seems to be ok */
-                               return TRUE;
+                               return true;
                                break;
                        case SENSE_NOT_READY:
                                if((pccb->sense_buf[12]!=0x04)||(pccb->sense_buf[13]!=0x01)) {
                                        /* if device is not in process of becoming ready */
-                                       return FALSE;
+                                       return false;
                                        break;
                                } /* else fall through */
                        case SENSE_UNIT_ATTENTION:
@@ -814,13 +814,13 @@ retry:
                                        goto retry;
                                }
                                PRINTF("Target %d not ready, %d retried\n",pccb->target,retrycnt);
-                               return FALSE;
+                               return false;
                        default:
-                               return FALSE;
+                               return false;
                }
        }
        PRINTF("Status = %X\n",pccb->status);
-       return FALSE;
+       return false;
 }
 
 
index 4703fc1..0ae78f9 100644 (file)
@@ -140,7 +140,7 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->config) (TRUE, TRUE, cookie);     /* Assert nCONFIG */
+               (*fn->config) (true, true, cookie);     /* Assert nCONFIG */
 
                udelay(2);              /* T_cfg > 2us  */
 
@@ -152,7 +152,7 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
                        return FPGA_FAIL;
                }
 
-               (*fn->config) (FALSE, TRUE, cookie);    /* Deassert nCONFIG */
+               (*fn->config) (false, true, cookie);    /* Deassert nCONFIG */
                udelay(2);              /* T_cf2st1 < 4us       */
 
                /* Wait for nSTATUS to be released (i.e. deasserted) */
@@ -192,13 +192,13 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
                        i = 8;
                        do {
                                /* Deassert the clock */
-                               (*fn->clk) (FALSE, TRUE, cookie);
+                               (*fn->clk) (false, true, cookie);
                                CONFIG_FPGA_DELAY ();
                                /* Write data */
-                               (*fn->data) ( (val & 0x01), TRUE, cookie);
+                               (*fn->data) ((val & 0x01), true, cookie);
                                CONFIG_FPGA_DELAY ();
                                /* Assert the clock */
-                               (*fn->clk) (TRUE, TRUE, cookie);
+                               (*fn->clk) (true, true, cookie);
                                CONFIG_FPGA_DELAY ();
                                val >>= 1;
                                i --;
@@ -232,9 +232,9 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
 
        for (i = 0; i < 12; i++) {
                CONFIG_FPGA_DELAY ();
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
                CONFIG_FPGA_DELAY ();
-               (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+               (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
        }
 
        ret_val = FPGA_SUCCESS;
index f087d01..8388da5 100644 (file)
@@ -215,7 +215,7 @@ int altera_info( Altera_desc *desc )
 
 static int altera_validate (Altera_desc * desc, const char *fn)
 {
-       int ret_val = FALSE;
+       int ret_val = false;
 
        if (desc) {
                if ((desc->family > min_altera_type) &&
@@ -223,7 +223,7 @@ static int altera_validate (Altera_desc * desc, const char *fn)
                        if ((desc->iface > min_altera_iface_type) &&
                                (desc->iface < max_altera_iface_type)) {
                                if (desc->size) {
-                                       ret_val = TRUE;
+                                       ret_val = true;
                                } else {
                                        printf ("%s: NULL part size\n", fn);
                                }
index 0773e73..6b734c2 100644 (file)
@@ -144,9 +144,9 @@ static int CYC2_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->config) (FALSE, TRUE, cookie);    /* De-assert nCONFIG */
+               (*fn->config) (false, true, cookie);    /* De-assert nCONFIG */
                udelay(100);
-               (*fn->config) (TRUE, TRUE, cookie);     /* Assert nCONFIG */
+               (*fn->config) (true, true, cookie);     /* Assert nCONFIG */
 
                udelay(2);              /* T_cfg > 2us  */
 
@@ -164,7 +164,7 @@ static int CYC2_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
                /* Get ready for the burn */
                CONFIG_FPGA_DELAY ();
 
-               ret = (*fn->write) (buf, bsize, TRUE, cookie);
+               ret = (*fn->write) (buf, bsize, true, cookie);
                if (ret) {
                        puts ("** Write failed.\n");
                        (*fn->abort) (cookie);
index d8b642a..8c3465a 100644 (file)
@@ -275,7 +275,7 @@ signed char ispVM(void)
 
 static int lattice_validate(Lattice_desc *desc, const char *fn)
 {
-       int ret_val = FALSE;
+       int ret_val = false;
 
        if (desc) {
                if ((desc->family > min_lattice_type) &&
@@ -283,7 +283,7 @@ static int lattice_validate(Lattice_desc *desc, const char *fn)
                        if ((desc->iface > min_lattice_iface_type) &&
                                (desc->iface < max_lattice_iface_type)) {
                                if (desc->size) {
-                                       ret_val = TRUE;
+                                       ret_val = true;
                                } else {
                                        printf("%s: NULL part size\n", fn);
                                }
index 4bc7070..0bc400d 100644 (file)
@@ -162,11 +162,11 @@ static int Spartan2_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->pgm) (TRUE, TRUE, cookie);        /* Assert the program, commit */
+               (*fn->pgm) (true, true, cookie);        /* Assert the program, commit */
 
                /* Get ready for the burn */
                CONFIG_FPGA_DELAY ();
-               (*fn->pgm) (FALSE, TRUE, cookie);       /* Deassert the program, commit */
+               (*fn->pgm) (false, true, cookie);       /* Deassert the program, commit */
 
                ts = get_timer (0);             /* get current time */
                /* Now wait for INIT and BUSY to go high */
@@ -179,20 +179,20 @@ static int Spartan2_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        }
                } while ((*fn->init) (cookie) && (*fn->busy) (cookie));
 
-               (*fn->wr) (TRUE, TRUE, cookie); /* Assert write, commit */
-               (*fn->cs) (TRUE, TRUE, cookie); /* Assert chip select, commit */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->wr) (true, true, cookie); /* Assert write, commit */
+               (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                /* Load the data */
                while (bytecount < bsize) {
                        /* XXX - do we check for an Ctrl-C press in here ??? */
                        /* XXX - Check the error bit? */
 
-                       (*fn->wdata) (data[bytecount++], TRUE, cookie); /* write the data */
+                       (*fn->wdata) (data[bytecount++], true, cookie); /* write the data */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_CHECK_BUSY
                        ts = get_timer (0);     /* get current time */
@@ -201,9 +201,9 @@ static int Spartan2_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                                 * make sure we aren't busy forever... */
 
                                CONFIG_FPGA_DELAY ();
-                               (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                               (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                                CONFIG_FPGA_DELAY ();
-                               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                                if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {    /* check the time */
                                        puts ("** Timeout waiting for BUSY to clear.\n");
@@ -220,8 +220,8 @@ static int Spartan2_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                CONFIG_FPGA_DELAY ();
-               (*fn->cs) (FALSE, TRUE, cookie);        /* Deassert the chip select */
-               (*fn->wr) (FALSE, TRUE, cookie);        /* Deassert the write pin */
+               (*fn->cs) (false, true, cookie);        /* Deassert the chip select */
+               (*fn->wr) (false, true, cookie);        /* Deassert the write pin */
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');                    /* terminate the dotted line */
@@ -233,9 +233,9 @@ static int Spartan2_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                while ((*fn->done) (cookie) == FPGA_FAIL) {
 
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                        if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {    /* check the time */
                                puts ("** Timeout waiting for DONE to clear.\n");
@@ -277,15 +277,15 @@ static int Spartan2_sp_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                printf ("Starting Dump of FPGA Device %d...\n", cookie);
 
-               (*fn->cs) (TRUE, TRUE, cookie); /* Assert chip select, commit */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                /* dump the data */
                while (bytecount < bsize) {
                        /* XXX - do we check for an Ctrl-C press in here ??? */
 
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
                        (*fn->rdata) (&(data[bytecount++]), cookie);    /* read the data */
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                        if (bytecount % (bsize / 40) == 0)
@@ -293,9 +293,9 @@ static int Spartan2_sp_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
                }
 
-               (*fn->cs) (FALSE, FALSE, cookie);       /* Deassert the chip select */
-               (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->cs) (false, false, cookie);       /* Deassert the chip select */
+               (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');                    /* terminate the dotted line */
@@ -351,7 +351,7 @@ static int Spartan2_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->pgm) (TRUE, TRUE, cookie);        /* Assert the program, commit */
+               (*fn->pgm) (true, true, cookie);        /* Assert the program, commit */
 
                /* Wait for INIT state (init low)                            */
                ts = get_timer (0);             /* get current time */
@@ -365,7 +365,7 @@ static int Spartan2_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                /* Get ready for the burn */
                CONFIG_FPGA_DELAY ();
-               (*fn->pgm) (FALSE, TRUE, cookie);       /* Deassert the program, commit */
+               (*fn->pgm) (false, true, cookie);       /* Deassert the program, commit */
 
                ts = get_timer (0);             /* get current time */
                /* Now wait for INIT to go high */
@@ -390,13 +390,13 @@ static int Spartan2_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        i = 8;
                        do {
                                /* Deassert the clock */
-                               (*fn->clk) (FALSE, TRUE, cookie);
+                               (*fn->clk) (false, true, cookie);
                                CONFIG_FPGA_DELAY ();
                                /* Write data */
-                               (*fn->wr) ((val & 0x80), TRUE, cookie);
+                               (*fn->wr) ((val & 0x80), true, cookie);
                                CONFIG_FPGA_DELAY ();
                                /* Assert the clock */
-                               (*fn->clk) (TRUE, TRUE, cookie);
+                               (*fn->clk) (true, true, cookie);
                                CONFIG_FPGA_DELAY ();
                                val <<= 1;
                                i --;
@@ -417,14 +417,14 @@ static int Spartan2_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                /* now check for done signal */
                ts = get_timer (0);             /* get current time */
                ret_val = FPGA_SUCCESS;
-               (*fn->wr) (TRUE, TRUE, cookie);
+               (*fn->wr) (true, true, cookie);
 
                while (! (*fn->done) (cookie)) {
 
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                        putc ('*');
 
index 1633a70..c63c605 100644 (file)
@@ -166,11 +166,11 @@ static int Spartan3_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->pgm) (TRUE, TRUE, cookie);        /* Assert the program, commit */
+               (*fn->pgm) (true, true, cookie);        /* Assert the program, commit */
 
                /* Get ready for the burn */
                CONFIG_FPGA_DELAY ();
-               (*fn->pgm) (FALSE, TRUE, cookie);       /* Deassert the program, commit */
+               (*fn->pgm) (false, true, cookie);       /* Deassert the program, commit */
 
                ts = get_timer (0);             /* get current time */
                /* Now wait for INIT and BUSY to go high */
@@ -183,20 +183,20 @@ static int Spartan3_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        }
                } while ((*fn->init) (cookie) && (*fn->busy) (cookie));
 
-               (*fn->wr) (TRUE, TRUE, cookie); /* Assert write, commit */
-               (*fn->cs) (TRUE, TRUE, cookie); /* Assert chip select, commit */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->wr) (true, true, cookie); /* Assert write, commit */
+               (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                /* Load the data */
                while (bytecount < bsize) {
                        /* XXX - do we check for an Ctrl-C press in here ??? */
                        /* XXX - Check the error bit? */
 
-                       (*fn->wdata) (data[bytecount++], TRUE, cookie); /* write the data */
+                       (*fn->wdata) (data[bytecount++], true, cookie); /* write the data */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_CHECK_BUSY
                        ts = get_timer (0);     /* get current time */
@@ -205,9 +205,9 @@ static int Spartan3_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                                 * make sure we aren't busy forever... */
 
                                CONFIG_FPGA_DELAY ();
-                               (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                               (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                                CONFIG_FPGA_DELAY ();
-                               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                                if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {    /* check the time */
                                        puts ("** Timeout waiting for BUSY to clear.\n");
@@ -224,8 +224,8 @@ static int Spartan3_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                CONFIG_FPGA_DELAY ();
-               (*fn->cs) (FALSE, TRUE, cookie);        /* Deassert the chip select */
-               (*fn->wr) (FALSE, TRUE, cookie);        /* Deassert the write pin */
+               (*fn->cs) (false, true, cookie);        /* Deassert the chip select */
+               (*fn->wr) (false, true, cookie);        /* Deassert the write pin */
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');                    /* terminate the dotted line */
@@ -239,9 +239,9 @@ static int Spartan3_sp_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                         * make sure we aren't busy forever... */
 
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                        if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {    /* check the time */
                                puts ("** Timeout waiting for DONE to clear.\n");
@@ -283,15 +283,15 @@ static int Spartan3_sp_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                printf ("Starting Dump of FPGA Device %d...\n", cookie);
 
-               (*fn->cs) (TRUE, TRUE, cookie); /* Assert chip select, commit */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                /* dump the data */
                while (bytecount < bsize) {
                        /* XXX - do we check for an Ctrl-C press in here ??? */
 
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
                        (*fn->rdata) (&(data[bytecount++]), cookie);    /* read the data */
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                        if (bytecount % (bsize / 40) == 0)
@@ -299,9 +299,9 @@ static int Spartan3_sp_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
                }
 
-               (*fn->cs) (FALSE, FALSE, cookie);       /* Deassert the chip select */
-               (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
-               (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+               (*fn->cs) (false, false, cookie);       /* Deassert the chip select */
+               (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
+               (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');                    /* terminate the dotted line */
@@ -357,7 +357,7 @@ static int Spartan3_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                }
 
                /* Establish the initial state */
-               (*fn->pgm) (TRUE, TRUE, cookie);        /* Assert the program, commit */
+               (*fn->pgm) (true, true, cookie);        /* Assert the program, commit */
 
                /* Wait for INIT state (init low)                            */
                ts = get_timer (0);             /* get current time */
@@ -373,7 +373,7 @@ static int Spartan3_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                /* Get ready for the burn */
                CONFIG_FPGA_DELAY ();
-               (*fn->pgm) (FALSE, TRUE, cookie);       /* Deassert the program, commit */
+               (*fn->pgm) (false, true, cookie);       /* Deassert the program, commit */
 
                ts = get_timer (0);             /* get current time */
                /* Now wait for INIT to go high */
@@ -389,7 +389,7 @@ static int Spartan3_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                /* Load the data */
                if(*fn->bwr)
-                       (*fn->bwr) (data, bsize, TRUE, cookie);
+                       (*fn->bwr) (data, bsize, true, cookie);
                else {
                        while (bytecount < bsize) {
 
@@ -405,13 +405,13 @@ static int Spartan3_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                                i = 8;
                                do {
                                        /* Deassert the clock */
-                                       (*fn->clk) (FALSE, TRUE, cookie);
+                                       (*fn->clk) (false, true, cookie);
                                        CONFIG_FPGA_DELAY ();
                                        /* Write data */
-                                       (*fn->wr) ((val & 0x80), TRUE, cookie);
+                                       (*fn->wr) ((val & 0x80), true, cookie);
                                        CONFIG_FPGA_DELAY ();
                                        /* Assert the clock */
-                                       (*fn->clk) (TRUE, TRUE, cookie);
+                                       (*fn->clk) (true, true, cookie);
                                        CONFIG_FPGA_DELAY ();
                                        val <<= 1;
                                        i --;
@@ -433,16 +433,16 @@ static int Spartan3_ss_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                /* now check for done signal */
                ts = get_timer (0);             /* get current time */
                ret_val = FPGA_SUCCESS;
-               (*fn->wr) (TRUE, TRUE, cookie);
+               (*fn->wr) (true, true, cookie);
 
                while (! (*fn->done) (cookie)) {
                        /* XXX - we should have a check in here somewhere to
                         * make sure we aren't busy forever... */
 
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (FALSE, TRUE, cookie);       /* Deassert the clock pin */
+                       (*fn->clk) (false, true, cookie);       /* Deassert the clock pin */
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);        /* Assert the clock pin */
+                       (*fn->clk) (true, true, cookie);        /* Assert the clock pin */
 
                        putc ('*');
 
index b26d231..3974e47 100644 (file)
@@ -221,7 +221,7 @@ static int Virtex2_ssm_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                 * There is no maximum value for the pulse width.  Check to make
                 * sure that INIT_B goes low after assertion of PROG_B
                 */
-               (*fn->pgm) (TRUE, TRUE, cookie);
+               (*fn->pgm) (true, true, cookie);
                udelay (10);
                ts = get_timer (0);
                do {
@@ -234,9 +234,9 @@ static int Virtex2_ssm_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        }
                } while (!(*fn->init) (cookie));
 
-               (*fn->pgm) (FALSE, TRUE, cookie);
+               (*fn->pgm) (false, true, cookie);
                CONFIG_FPGA_DELAY ();
-               (*fn->clk) (TRUE, TRUE, cookie);
+               (*fn->clk) (true, true, cookie);
 
                /*
                 * Start a timer and wait for INIT_B to go high
@@ -253,8 +253,8 @@ static int Virtex2_ssm_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        }
                } while ((*fn->init) (cookie) && (*fn->busy) (cookie));
 
-               (*fn->wr) (TRUE, TRUE, cookie);
-               (*fn->cs) (TRUE, TRUE, cookie);
+               (*fn->wr) (true, true, cookie);
+               (*fn->cs) (true, true, cookie);
 
                udelay (10000);
 
@@ -286,15 +286,15 @@ static int Virtex2_ssm_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                        }
 #endif
 
-                       (*fn->wdata) (data[bytecount++], TRUE, cookie);
+                       (*fn->wdata) (data[bytecount++], true, cookie);
                        CONFIG_FPGA_DELAY ();
 
                        /*
                         * Cycle the clock pin
                         */
-                       (*fn->clk) (FALSE, TRUE, cookie);
+                       (*fn->clk) (false, true, cookie);
                        CONFIG_FPGA_DELAY ();
-                       (*fn->clk) (TRUE, TRUE, cookie);
+                       (*fn->clk) (true, true, cookie);
 
 #ifdef CONFIG_SYS_FPGA_CHECK_BUSY
                        ts = get_timer (0);
@@ -319,8 +319,8 @@ static int Virtex2_ssm_load(Xilinx_desc *desc, const void *buf, size_t bsize)
                 * Finished writing the data; deassert FPGA CS_B and WRITE_B signals.
                 */
                CONFIG_FPGA_DELAY ();
-               (*fn->cs) (FALSE, TRUE, cookie);
-               (*fn->wr) (FALSE, TRUE, cookie);
+               (*fn->cs) (false, true, cookie);
+               (*fn->wr) (false, true, cookie);
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');
@@ -381,8 +381,8 @@ static int Virtex2_ssm_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
 
                printf ("Starting Dump of FPGA Device %d...\n", cookie);
 
-               (*fn->cs) (TRUE, TRUE, cookie);
-               (*fn->clk) (TRUE, TRUE, cookie);
+               (*fn->cs) (true, true, cookie);
+               (*fn->clk) (true, true, cookie);
 
                while (bytecount < bsize) {
 #ifdef CONFIG_SYS_FPGA_CHECK_CTRLC
@@ -394,8 +394,8 @@ static int Virtex2_ssm_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
                        /*
                         * Cycle the clock and read the data
                         */
-                       (*fn->clk) (FALSE, TRUE, cookie);
-                       (*fn->clk) (TRUE, TRUE, cookie);
+                       (*fn->clk) (false, true, cookie);
+                       (*fn->clk) (true, true, cookie);
                        (*fn->rdata) (&(data[bytecount++]), cookie);
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                        if (bytecount % (bsize / 40) == 0)
@@ -406,9 +406,9 @@ static int Virtex2_ssm_dump(Xilinx_desc *desc, const void *buf, size_t bsize)
                /*
                 * Deassert CS_B and cycle the clock to deselect the device.
                 */
-               (*fn->cs) (FALSE, FALSE, cookie);
-               (*fn->clk) (FALSE, TRUE, cookie);
-               (*fn->clk) (TRUE, TRUE, cookie);
+               (*fn->cs) (false, false, cookie);
+               (*fn->clk) (false, true, cookie);
+               (*fn->clk) (true, true, cookie);
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
                putc ('\n');
index 4072cb4..32787b2 100644 (file)
@@ -242,7 +242,7 @@ int xilinx_info (Xilinx_desc * desc)
 
 static int xilinx_validate (Xilinx_desc * desc, char *fn)
 {
-       int ret_val = FALSE;
+       int ret_val = false;
 
        if (desc) {
                if ((desc->family > min_xilinx_type) &&
@@ -250,7 +250,7 @@ static int xilinx_validate (Xilinx_desc * desc, char *fn)
                        if ((desc->iface > min_xilinx_iface_type) &&
                                (desc->iface < max_xilinx_iface_type)) {
                                if (desc->size) {
-                                       ret_val = TRUE;
+                                       ret_val = true;
                                } else
                                        printf ("%s: NULL part size\n", fn);
                        } else
index d0ded48..04836c0 100644 (file)
@@ -29,8 +29,6 @@
 
 #define DRIVER_NAME "mxc_nand"
 
-typedef enum {false, true} bool;
-
 struct mxc_nand_host {
        struct mtd_info                 mtd;
        struct nand_chip                *nand;
index ed7cf20..89ebf0b 100644 (file)
@@ -100,7 +100,7 @@ static int smi_reg_read(const char *devname, u8 phy_addr, u8 phy_reg,
        }
 
        /* wait for the SMI register to become available */
-       if (armdfec_phy_timeout(&regs->smi, SMI_BUSY, FALSE)) {
+       if (armdfec_phy_timeout(&regs->smi, SMI_BUSY, false)) {
                printf("ARMD100 FEC: (%s) PHY busy timeout\n",  __func__);
                return -1;
        }
@@ -108,7 +108,7 @@ static int smi_reg_read(const char *devname, u8 phy_addr, u8 phy_reg,
        writel((phy_addr << 16) | (phy_reg << 21) | SMI_OP_R, &regs->smi);
 
        /* now wait for the data to be valid */
-       if (armdfec_phy_timeout(&regs->smi, SMI_R_VALID, TRUE)) {
+       if (armdfec_phy_timeout(&regs->smi, SMI_R_VALID, true)) {
                val = readl(&regs->smi);
                printf("ARMD100 FEC: (%s) PHY Read timeout, val=0x%x\n",
                                __func__, val);
@@ -143,7 +143,7 @@ static int smi_reg_write(const char *devname,
        }
 
        /* wait for the SMI register to become available */
-       if (armdfec_phy_timeout(&regs->smi, SMI_BUSY, FALSE)) {
+       if (armdfec_phy_timeout(&regs->smi, SMI_BUSY, false)) {
                printf("ARMD100 FEC: (%s) PHY busy timeout\n",  __func__);
                return -1;
        }
index e2df4fc..dcac964 100644 (file)
 #ifndef __ARMADA100_FEC_H__
 #define __ARMADA100_FEC_H__
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 #define PORT_NUM               0x0
 
 /* RX & TX descriptor command */
index 8ba98b2..c1863f4 100644 (file)
@@ -313,14 +313,14 @@ void e1000_standby_eeprom(struct e1000_hw *hw)
 *
 * hw - Struct containing variables accessed by shared code
 ****************************************************************************/
-static boolean_t e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
+static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
 {
        uint32_t eecd = 0;
 
        DEBUGFUNC();
 
        if (hw->mac_type == e1000_ich8lan)
-               return FALSE;
+               return false;
 
        if (hw->mac_type == e1000_82573 || hw->mac_type == e1000_82574) {
                eecd = E1000_READ_REG(hw, EECD);
@@ -330,9 +330,9 @@ static boolean_t e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
 
                /* If both bits are set, device is Flash type */
                if (eecd == 0x03)
-                       return FALSE;
+                       return false;
        }
-       return TRUE;
+       return true;
 }
 
 /******************************************************************************
@@ -421,8 +421,8 @@ static int32_t e1000_init_eeprom_params(struct e1000_hw *hw)
                eeprom->opcode_bits = 3;
                eeprom->address_bits = 6;
                eeprom->delay_usec =