diff options
100 files changed, 469 insertions, 533 deletions
@@ -134,7 +134,7 @@ Additional fields (if present) indicate release candidates or bug fix releases in "stable" maintenance trees. Examples: - U-Boot v2009.11 - Release November 2009 + U-Boot v2009.11 - Release November 2009 U-Boot v2009.11.1 - Release 1 in version November 2009 stable tree U-Boot v2010.09-rc1 - Release candiate 1 for September 2010 release @@ -769,7 +769,7 @@ The following options need to be configured: CONFIG_CMD_NAND * NAND support CONFIG_CMD_NET bootp, tftpboot, rarpboot CONFIG_CMD_PCA953X * PCA953x I2C gpio commands - CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command + CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command CONFIG_CMD_PCI * pciinfo CONFIG_CMD_PCMCIA * PCMCIA support CONFIG_CMD_PING * send ICMP ECHO_REQUEST to network @@ -1432,18 +1432,37 @@ The following options need to be configured: Define a default value for the IP address to use for the default Ethernet interface, in case this is not determined through e.g. bootp. + (Environment variable "ipaddr") - Server IP address: CONFIG_SERVERIP Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command. + (Environment variable "serverip") CONFIG_KEEP_SERVERADDR Keeps the server's MAC address, in the env 'serveraddr' for passing to bootargs (like Linux's netconsole option) +- Gateway IP address: + CONFIG_GATEWAYIP + + Defines a default value for the IP address of the + default router where packets to other networks are + sent to. + (Environment variable "gatewayip") + +- Subnet mask: + CONFIG_NETMASK + + Defines a default value for the subnet mask (or + routing prefix) which is used to determine if an IP + address belongs to the local subnet or needs to be + forwarded through a router. + (Environment variable "netmask") + - Multicast TFTP Mode: CONFIG_MCAST_TFTP @@ -1730,24 +1749,24 @@ The following options need to be configured: CONFIG_I2C_MULTI_BUS This option allows the use of multiple I2C buses, each of which - must have a controller. At any point in time, only one bus is - active. To switch to a different bus, use the 'i2c dev' command. + must have a controller. At any point in time, only one bus is + active. To switch to a different bus, use the 'i2c dev' command. Note that bus numbering is zero-based. CONFIG_SYS_I2C_NOPROBES This option specifies a list of I2C devices that will be skipped - when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS + when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS is set, specify a list of bus-device pairs. Otherwise, specify a 1D array of device addresses e.g. #undef CONFIG_I2C_MULTI_BUS - #define CONFIG_SYS_I2C_NOPROBES {0x50,0x68} + #define CONFIG_SYS_I2C_NOPROBES {0x50,0x68} will skip addresses 0x50 and 0x68 on a board with one I2C bus - #define CONFIG_I2C_MULTI_BUS + #define CONFIG_I2C_MULTI_BUS #define CONFIG_SYS_I2C_MULTI_NOPROBES {{0,0x50},{0,0x68},{1,0x54}} will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on bus 1 @@ -1866,7 +1885,7 @@ The following options need to be configured: Enables a hardware SPI driver for general-purpose reads and writes. As with CONFIG_SOFT_SPI, the board configuration must define a list of chip-select function pointers. - Currently supported on some MPC8xxx processors. For an + Currently supported on some MPC8xxx processors. For an example, see include/configs/mpc8349emds.h. CONFIG_MXC_SPI @@ -2181,7 +2200,7 @@ Legacy uImage format: 13 common/image.c Start multifile image verification 14 common/image.c No initial ramdisk, no multifile, continue. - 15 arch/<arch>/lib/bootm.c All preparation done, transferring control to OS + 15 arch/<arch>/lib/bootm.c All preparation done, transferring control to OS -30 arch/powerpc/lib/board.c Fatal error, hang the system -31 post/post.c POST test failed, detected by post_output_backlog() @@ -2428,6 +2447,20 @@ Modem Support: See also: doc/README.Modem +Board initialization settings: +------------------------------ + +During Initialization u-boot calls a number of board specific functions +to allow the preparation of board specific prerequisites, e.g. pin setup +before drivers are initialized. To enable these callbacks the +following configuration macros have to be defined. Currently this is +architecture specific, so please check arch/your_architecture/lib/board.c +typically in board_init_f() and board_init_r(). + +- CONFIG_BOARD_EARLY_INIT_F: Call board_early_init_f() +- CONFIG_BOARD_EARLY_INIT_R: Call board_early_init_r() +- CONFIG_BOARD_LATE_INIT: Call board_late_init() +- CONFIG_BOARD_POSTCLK_INIT: Call board_postclk_init() Configuration Settings: ----------------------- @@ -2545,7 +2578,7 @@ Configuration Settings: used) must be put below this limit, unless "bootm_low" enviroment variable is defined and non-zero. In such case all data for the Linux kernel must be between "bootm_low" - and "bootm_low" + CONFIG_SYS_BOOTMAPSZ. The environment + and "bootm_low" + CONFIG_SYS_BOOTMAPSZ. The environment variable "bootm_mapsize" will override the value of CONFIG_SYS_BOOTMAPSZ. If CONFIG_SYS_BOOTMAPSZ is undefined, then the value in "bootm_size" will be used instead. @@ -2835,7 +2868,7 @@ to save the current settings. This setting describes a second storage area of CONFIG_ENV_SIZE size used to hold a redundant copy of the environment data, so that there is a valid backup copy in case there is a power failure - during a "saveenv" operation. CONFIG_ENV_OFFSET_RENDUND must be + during a "saveenv" operation. CONFIG_ENV_OFFSET_RENDUND must be aligned to an erase block boundary. - CONFIG_ENV_RANGE (optional): @@ -2929,7 +2962,7 @@ Low Level (hardware related) configuration options: - CONFIG_SYS_CCSRBAR_PHYS: Physical address of CCSR. CCSR can be relocated to a new physical address, if desired. In this case, this macro should - be set to that address. Otherwise, it should be set to the + be set to that address. Otherwise, it should be set to the same value as CONFIG_SYS_CCSRBAR_DEFAULT. For example, CCSR is typically relocated on 36-bit builds. It is recommended that this macro be defined via the _HIGH and _LOW macros: @@ -3461,7 +3494,7 @@ List of environment variables (most likely not complete): kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and bootm_mapsize. - bootm_mapsize - Size of the initial memory mapping for the Linux kernel. + bootm_mapsize - Size of the initial memory mapping for the Linux kernel. This variable is given as a hexadecimal number and it defines the size of the memory region starting at base address bootm_low that is accessible by the Linux kernel @@ -3615,12 +3648,12 @@ flash or offset in NAND flash. boards currenlty use other variables for these purposes, and some boards use these variables for other purposes. -Image File Name RAM Address Flash Location ------ --------- ----------- -------------- -u-boot u-boot u-boot_addr_r u-boot_addr -Linux kernel bootfile kernel_addr_r kernel_addr -device tree blob fdtfile fdt_addr_r fdt_addr -ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr +Image File Name RAM Address Flash Location +----- --------- ----------- -------------- +u-boot u-boot u-boot_addr_r u-boot_addr +Linux kernel bootfile kernel_addr_r kernel_addr +device tree blob fdtfile fdt_addr_r fdt_addr +ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr The following environment variables may be used and automatically updated by the network boot commands ("bootp" and "rarpboot"), @@ -3735,7 +3768,7 @@ o If neither SROM nor the environment contain a MAC address, an error is raised. If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses -will be programmed into hardware as part of the initialization process. This +will be programmed into hardware as part of the initialization process. This may be skipped by setting the appropriate 'ethmacskip' environment variable. The naming convention is as follows: "ethmacskip" (=>eth0), "eth1macskip" (=>eth1) etc. diff --git a/arch/arm/cpu/armv7/omap4/clocks.c b/arch/arm/cpu/armv7/omap4/clocks.c index 4f0e0cd..095ba39 100644 --- a/arch/arm/cpu/armv7/omap4/clocks.c +++ b/arch/arm/cpu/armv7/omap4/clocks.c @@ -603,7 +603,7 @@ static inline void enable_clock_domain(u32 *const clkctrl_reg, u32 enable_mode) { clrsetbits_le32(clkctrl_reg, CD_CLKCTRL_CLKTRCTRL_MASK, enable_mode << CD_CLKCTRL_CLKTRCTRL_SHIFT); - debug("Enable clock domain - 0x%08x\n", clkctrl_reg); + debug("Enable clock domain - %p\n", clkctrl_reg); } static inline void wait_for_clk_enable(u32 *clkctrl_addr) @@ -630,7 +630,7 @@ static inline void enable_clock_module(u32 *const clkctrl_addr, u32 enable_mode, { clrsetbits_le32(clkctrl_addr, MODULE_CLKCTRL_MODULEMODE_MASK, enable_mode << MODULE_CLKCTRL_MODULEMODE_SHIFT); - debug("Enable clock module - 0x%08x\n", clkctrl_addr); + debug("Enable clock module - %p\n", clkctrl_addr); if (wait_for_enable) wait_for_clk_enable(clkctrl_addr); } diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 9061d18..751102d 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -40,7 +40,7 @@ unsigned int query_sdram_size(void) u32 reg; reg = readl(&pmc->pmc_scratch20); - debug("pmc->pmc_scratch20 (ODMData) = 0x%08lX\n", reg); + debug("pmc->pmc_scratch20 (ODMData) = 0x%08x\n", reg); /* bits 31:28 in OdmData are used for RAM size */ switch ((reg) >> 28) { diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 9b16d75..a482706 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -589,7 +589,7 @@ void board_init_r(gd_t *id, ulong dest_addr) } #endif -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT board_late_init(); #endif diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 7e190d1..584cbce 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h @@ -25,7 +25,7 @@ #define readw(addr) \ ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) #define readl(addr) \ - ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; }) + ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) #define writeb(b, addr) \ (void)((*(volatile unsigned char *) (addr)) = (b)) diff --git a/arch/powerpc/cpu/mpc512x/serial.c b/arch/powerpc/cpu/mpc512x/serial.c index 5ee9cef..7c53346 100644 --- a/arch/powerpc/cpu/mpc512x/serial.c +++ b/arch/powerpc/cpu/mpc512x/serial.c @@ -140,7 +140,7 @@ void serial_setbrg_dev(unsigned int idx) if (br_env) baudrate = simple_strtoul(br_env, NULL, 10); - debug("%s: idx %d, baudrate %d\n", __func__, idx, baudrate); + debug("%s: idx %d, baudrate %ld\n", __func__, idx, baudrate); } /* calculate divisor for setting PSC CTUR and CTLR registers */ diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c index 14821f4..aff1f6d 100644 --- a/arch/powerpc/cpu/mpc86xx/interrupts.c +++ b/arch/powerpc/cpu/mpc86xx/interrupts.c @@ -59,28 +59,28 @@ int interrupt_init_cpu(unsigned long *decrementer_count) pic->gcr = MPC86xx_PICGCR_MODE; *decrementer_count = get_tbclk() / CONFIG_SYS_HZ; - debug("interrupt init: tbclk() = %d MHz, decrementer_count = %ld\n", + debug("interrupt init: tbclk() = %ld MHz, decrementer_count = %ld\n", (get_tbclk() / 1000000), *decrementer_count); #ifdef CONFIG_INTERRUPTS pic->iivpr1 = 0x810001; /* 50220 enable mcm interrupts */ - debug("iivpr1@%x = %x\n", &pic->iivpr1, pic->iivpr1); + debug("iivpr1@%p = %x\n", &pic->iivpr1, pic->iivpr1); pic->iivpr2 = 0x810002; /* 50240 enable ddr interrupts */ - debug("iivpr2@%x = %x\n", &pic->iivpr2, pic->iivpr2); + debug("iivpr2@%p = %x\n", &pic->iivpr2, pic->iivpr2); pic->iivpr3 = 0x810003; /* 50260 enable lbc interrupts */ - debug("iivpr3@%x = %x\n", &pic->iivpr3, pic->iivpr3); + debug("iivpr3@%p = %x\n", &pic->iivpr3, pic->iivpr3); #if defined(CONFIG_PCI1) || defined(CONFIG_PCIE1) pic->iivpr8 = 0x810008; /* enable pcie1 interrupts */ - debug("iivpr8@%x = %x\n", &pic->iivpr8, pic->iivpr8); + debug("iivpr8@%p = %x\n", &pic->iivpr8, pic->iivpr8); #endif #if defined(CONFIG_PCI2) || defined(CONFIG_PCIE2) pic->iivpr9 = 0x810009; /* enable pcie2 interrupts */ - debug("iivpr9@%x = %x\n", &pic->iivpr9, pic->iivpr9); + debug("iivpr9@%p = %x\n", &pic->iivpr9, pic->iivpr9); #endif pic->ctpr = 0; /* 40080 clear current task priority register */ diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c index 9184764..376be2f 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr1_dimm_params.c @@ -41,7 +41,7 @@ compute_ranksize(unsigned int mem_type, unsigned char row_dens) /* Bottom 2 bits up to the top. */ bsize = ((row_dens >> 2) | ((row_dens & 3) << 6)); bsize <<= 24ULL; - debug("DDR: DDR I rank density = 0x%08x\n", bsize); + debug("DDR: DDR I rank density = 0x%16llx\n", bsize); return bsize; } diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c index b565e33..f637f3d 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr2_dimm_params.c @@ -40,7 +40,7 @@ compute_ranksize(unsigned int mem_type, unsigned char row_dens) /* Bottom 5 bits up to the top. */ bsize = ((row_dens >> 5) | ((row_dens & 31) << 3)); bsize <<= 27ULL; - debug("DDR: DDR II rank density = 0x%08x\n", bsize); + debug("DDR: DDR II rank density = 0x%16llx\n", bsize); return bsize; } diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c index 838cebe..ffb503a 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c @@ -71,7 +71,7 @@ compute_ranksize(const ddr3_spd_eeprom_t *spd) bsize = 1ULL << (nbit_sdram_cap_bsize - 3 + nbit_primary_bus_width - nbit_sdram_width); - debug("DDR: DDR III rank density = 0x%16lx\n", bsize); + debug("DDR: DDR III rank density = 0x%16llx\n", bsize); return bsize; } diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c index ec7291f..e05daf2 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr.c @@ -820,7 +820,7 @@ static void program_tr0(unsigned long *dimm_populated, break; } - debug("tr0: %x\n", tr0); + debug("tr0: %lx\n", tr0); mtsdram(SDRAM0_TR0, tr0); } @@ -1051,7 +1051,7 @@ static void program_tr1(void) } tr1 |= SDRAM_TR1_RDCT_ENCODE(rdclt_average); - debug("tr1: %x\n", tr1); + debug("tr1: %lx\n", tr1); /* * program SDRAM Timing Register 1 TR1 @@ -1124,7 +1124,7 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, num_col_addr = spd_read(iic0_dimm_addr[dimm_num], 4); num_banks = spd_read(iic0_dimm_addr[dimm_num], 5); bank_size_id = spd_read(iic0_dimm_addr[dimm_num], 31); - debug("DIMM%d: row=%d col=%d banks=%d\n", dimm_num, + debug("DIMM%ld: row=%d col=%d banks=%d\n", dimm_num, num_row_addr, num_col_addr, num_banks); /* @@ -1193,9 +1193,11 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, bank_parms[ctrl_bank_num[dimm_num]+i].bank_size_bytes = (4 << 20) * bank_size_id; bank_parms[ctrl_bank_num[dimm_num]+i].cr = cr; - debug("DIMM%d-bank %d (SDRAM0_B%dCR): bank_size_bytes=%d\n", - dimm_num, i, ctrl_bank_num[dimm_num]+i, - bank_parms[ctrl_bank_num[dimm_num]+i].bank_size_bytes); + debug("DIMM%ld-bank %ld (SDRAM0_B%ldCR): " + "bank_size_bytes=%ld\n", + dimm_num, i, + ctrl_bank_num[dimm_num] + i, + bank_parms[ctrl_bank_num[dimm_num] + i].bank_size_bytes); } } } @@ -1239,7 +1241,8 @@ static unsigned long program_bxcr(unsigned long *dimm_populated, bank_parms[sorted_bank_num[bx_cr_num]].cr; mtdcr(SDRAM0_CFGDATA, temp); bank_base_addr += bank_parms[sorted_bank_num[bx_cr_num]].bank_size_bytes; - debug("SDRAM0_B%dCR=0x%08lx\n", sorted_bank_num[bx_cr_num], temp); + debug("SDRAM0_B%ldCR=0x%08lx\n", + sorted_bank_num[bx_cr_num], temp); } } diff --git a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c index b909fca..4b8e65a 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c @@ -907,8 +907,8 @@ static u32 DQS_calibration_methodB(struct ddrautocal *cal) mtsdram(SDRAM_RQDC, rqdc_reg); mtsdram(SDRAM_RFDC, rfdc_reg); - debug("RQDC: 0x%08X\n", rqdc_reg); - debug("RFDC: 0x%08X\n", rfdc_reg); + debug("RQDC: 0x%08lX\n", rqdc_reg); + debug("RFDC: 0x%08lX\n", rfdc_reg); /* if something passed, then return the size of the largest window */ if (passed != 0) { @@ -1214,7 +1214,7 @@ u32 DQS_autocalibration(void) SDRAM_RQDC_RQFD_ENCODE(tcal.autocal.rqfd)); mfsdram(SDRAM_RQDC, rqdc_reg); - debug("*** best_result: read value SDRAM_RQDC 0x%08x\n", + debug("*** best_result: read value SDRAM_RQDC 0x%08lx\n", rqdc_reg); #if defined(CONFIG_DDR_RFDC_FIXED) @@ -1227,7 +1227,7 @@ u32 DQS_autocalibration(void) #endif /* CONFIG_DDR_RFDC_FIXED */ mfsdram(SDRAM_RFDC, rfdc_reg); - debug("*** best_result: read value SDRAM_RFDC 0x%08x\n", + debug("*** best_result: read value SDRAM_RFDC 0x%08lx\n", rfdc_reg); mfsdram(SDRAM_RDCC, val); debug("*** SDRAM_RDCC 0x%08x\n", val); diff --git a/arch/powerpc/cpu/ppc4xx/4xx_pcie.c b/arch/powerpc/cpu/ppc4xx/4xx_pcie.c index b76890e..a87e93b 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_pcie.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_pcie.c @@ -265,7 +265,8 @@ static int pcie_read_config(struct pci_controller *hose, unsigned int devfn, */ pcie_dmer_disable (); - debug("%s: cfg_data=%08x offset=%08x\n", __func__, hose->cfg_data, offset); + debug("%s: cfg_data=%p offset=%08x\n", __func__, + hose->cfg_data, offset); switch (len) { case 1: *val = in_8(hose->cfg_data + offset); diff --git a/arch/powerpc/cpu/ppc4xx/denali_data_eye.c b/arch/powerpc/cpu/ppc4xx/denali_data_eye.c index 9bba0ca..19b65be 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_data_eye.c +++ b/arch/powerpc/cpu/ppc4xx/denali_data_eye.c @@ -317,7 +317,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK) | DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift); mtdcr(ddrcfgd, val); - debug("DDR0_09=0x%08lx\n", val); + debug("DDR0_09=0x%08x\n", val); /* -----------------------------------------------------------+ * Set 'dqs_out_shift' = wr_dqs_shift + 32 @@ -327,7 +327,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK) | DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift); mtdcr(ddrcfgd, val); - debug("DDR0_22=0x%08lx\n", val); + debug("DDR0_22=0x%08x\n", val); /* -----------------------------------------------------------+ * Set 'dll_dqs_delay_X'. @@ -337,7 +337,7 @@ void denali_core_search_data_eye(void) val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK) | DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_17=0x%08lx\n", val); + debug("DDR0_17=0x%08x\n", val); /* dll_dqs_delay_1 to dll_dqs_delay_4 */ mtdcr(ddrcfga, DDR0_18); @@ -347,7 +347,7 @@ void denali_core_search_data_eye(void) | DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X) | DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_18=0x%08lx\n", val); + debug("DDR0_18=0x%08x\n", val); /* dll_dqs_delay_5 to dll_dqs_delay_8 */ mtdcr(ddrcfga, DDR0_19); @@ -357,7 +357,7 @@ void denali_core_search_data_eye(void) | DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X) | DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X); mtdcr(ddrcfgd, val); - debug("DDR0_19=0x%08lx\n", val); + debug("DDR0_19=0x%08x\n", val); /* -----------------------------------------------------------+ * Assert 'start' parameter. diff --git a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c index c35b113..ce769a7 100644 --- a/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/denali_spd_ddr2.c @@ -360,7 +360,7 @@ static void get_spd_info(unsigned long dimm_ranks[], printf("Install at least one DDR2 DIMM.\n\n"); spd_ddr_init_hang(); } - debug("Total number of ranks = %d\n", *ranks); + debug("Total number of ranks = %ld\n", *ranks); } /*------------------------------------------------------------------ @@ -387,7 +387,7 @@ static void check_frequency(unsigned long *dimm_ranks, if (dimm_ranks[dimm_num]) { cycle_time = get_tcyc(spd_read(iic0_dimm_addr[dimm_num], 9)); - debug("cycle_time=%d ps\n", cycle_time); + debug("cycle_time=%ld ps\n", cycle_time); if (cycle_time > (calc_cycle_time + 10)) { /* @@ -470,10 +470,10 @@ static void get_dimm_size(unsigned long dimm_ranks[], } } } - debug("Number of rows = %d\n", *rows); - debug("Number of columns = %d\n", *cols); - debug("Number of banks = %d\n", *banks); - debug("Data width = %d\n", *width); + debug("Number of rows = %ld\n", *rows); + debug("Number of columns = %ld\n", *cols); + debug("Number of banks = %ld\n", *banks); + debug("Data width = %ld\n", *width); if (*rows > 14) { printf("ERROR: DRAM DIMM modules have %lu address rows.\n", *rows); @@ -568,7 +568,7 @@ static void program_ddr0_03(unsigned long dimm_ranks[], /*------------------------------------------------------------------ * Get the board configuration info. *-----------------------------------------------------------------*/ - debug("sdram_freq = %d\n", sdram_freq); + debug("sdram_freq = %ld\n", sdram_freq); /*------------------------------------------------------------------ * Handle the timing. We need to find the worst case timing of all @@ -601,7 +601,7 @@ static void program_ddr0_03(unsigned long dimm_ranks[], get_tcyc(spd_read(iic0_dimm_addr[dimm_num], tcyc_addr[cas_index])); - debug("cas_index = %d: cycle_time_ps = %d\n", + debug("cas_index = %ld: cycle_time_ps = %ld\n", cas_index, cycle_time_ps); /* * DDR2 devices use the following bitmask for CAS latency: @@ -640,10 +640,10 @@ static void program_ddr0_03(unsigned long dimm_ranks[], cycle_3_0_clk = MULDIV64(ONE_BILLION, 1000, max_3_0_tcyc_ps) + 10; cycle_4_0_clk = MULDIV64(ONE_BILLION, 1000, max_4_0_tcyc_ps) + 10; cycle_5_0_clk = MULDIV64(ONE_BILLION, 1000, max_5_0_tcyc_ps) + 10; - debug("cycle_2_0_clk = %d\n", cycle_2_0_clk); - debug("cycle_3_0_clk = %d\n", cycle_3_0_clk); - debug("cycle_4_0_clk = %d\n", cycle_4_0_clk); - debug("cycle_5_0_clk = %d\n", cycle_5_0_clk); + debug("cycle_2_0_clk = %ld\n", cycle_2_0_clk); + debug("cycle_3_0_clk = %ld\n", cycle_3_0_clk); + debug("cycle_4_0_clk = %ld\n", cycle_4_0_clk); + debug("cycle_5_0_clk = %ld\n", cycle_5_0_clk); if ((cas_available & 0x04) && (sdram_freq <= cycle_2_0_clk)) { *cas_latency = 2; @@ -673,7 +673,7 @@ static void program_ddr0_03(unsigned long dimm_ranks[], cycle_3_0_clk, cycle_4_0_clk, cycle_5_0_clk); spd_ddr_init_hang(); } - debug("CAS latency = %d\n", *cas_latency); + debug("CAS latency = %ld\n", *cas_latency); mtsdram(DDR0_03, ddr0_03); } @@ -728,11 +728,11 @@ static void program_ddr0_04(unsigned long dimm_ranks[], t_rtp_ps = max(t_rtp_ps, ps); } } - debug("t_rc_ps = %d\n", t_rc_ps); + debug("t_rc_ps = %ld\n", t_rc_ps); t_rc_clk = (MULDIV64(sdram_freq, t_rc_ps, ONE_BILLION) + 999) / 1000; - debug("t_rrd_ps = %d\n", t_rrd_ps); + debug("t_rrd_ps = %ld\n", t_rrd_ps); t_rrd_clk = (MULDIV64(sdram_freq, t_rrd_ps, ONE_BILLION) + 999) / 1000; - debug("t_rtp_ps = %d\n", t_rtp_ps); + debug("t_rtp_ps = %ld\n", t_rtp_ps); t_rtp_clk = (MULDIV64(sdram_freq, t_rtp_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_04, DDR0_04_TRC_ENCODE(t_rc_clk) | DDR0_04_TRRD_ENCODE(t_rrd_clk) | @@ -769,9 +769,9 @@ static void program_ddr0_05(unsigned long dimm_ranks[], t_ras_ps = max(t_ras_ps, ps); } } - debug("t_rp_ps = %d\n", t_rp_ps); + debug("t_rp_ps = %ld\n", t_rp_ps); t_rp_clk = (MULDIV64(sdram_freq, t_rp_ps, ONE_BILLION) + 999) / 1000; - debug("t_ras_ps = %d\n", t_ras_ps); + debug("t_ras_ps = %ld\n", t_ras_ps); t_ras_clk = (MULDIV64(sdram_freq, t_ras_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_05, ddr0_05 | DDR0_05_TRP_ENCODE(t_rp_clk) | DDR0_05_TRAS_MIN_ENCODE(t_ras_clk)); @@ -828,9 +828,9 @@ static void program_ddr0_06(unsigned long dimm_ranks[], t_rfc_ps = max(t_rfc_ps, ps); } } - debug("t_wtr_ps = %d\n", t_wtr_ps); + debug("t_wtr_ps = %ld\n", t_wtr_ps); t_wtr_clk = (MULDIV64(sdram_freq, t_wtr_ps, ONE_BILLION) + 999) / 1000; - debug("t_rfc_ps = %d\n", t_rfc_ps); + debug("t_rfc_ps = %ld\n", t_rfc_ps); t_rfc_clk = (MULDIV64(sdram_freq, t_rfc_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_06, ddr0_06 | DDR0_06_TWTR_ENCODE(t_wtr_clk) | DDR0_06_TRFC_ENCODE(t_rfc_clk)); @@ -857,7 +857,7 @@ static void program_ddr0_11(unsigned long sdram_freq) unsigned long const t_xsnr_ps = 200000; /* 200 ns */ unsigned long t_xsnr_clk; - debug("t_xsnr_ps = %d\n", t_xsnr_ps); + debug("t_xsnr_ps = %ld\n", t_xsnr_ps); t_xsnr_clk = (MULDIV64(sdram_freq, t_xsnr_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_11, DDR0_11_SREFRESH_ENCODE(0) | @@ -928,9 +928,9 @@ static void program_ddr0_26(unsigned long sdram_freq) unsigned long t_ref_clk; /* Round down t_ras_max_clk and t_ref_clk */ - debug("t_ras_max_ps = %d\n", t_ras_max_ps); + debug("t_ras_max_ps = %ld\n", t_ras_max_ps); t_ras_max_clk = MULDIV64(sdram_freq, t_ras_max_ps, ONE_BILLION) / 1000; - debug("t_ref_ps = %d\n", t_ref_ps); + debug("t_ref_ps = %ld\n", t_ref_ps); t_ref_clk = MULDIV64(sdram_freq, t_ref_ps, ONE_BILLION) / 1000; mtsdram(DDR0_26, DDR0_26_TRAS_MAX_ENCODE(t_ras_max_clk) | DDR0_26_TREF_ENCODE(t_ref_clk)); @@ -941,7 +941,7 @@ static void program_ddr0_27(unsigned long sdram_freq) unsigned long const t_init_ps = 200000000; /* 200 us. init */ unsigned long t_init_clk; - debug("t_init_ps = %d\n", t_init_ps); + debug("t_init_ps = %ld\n", t_init_ps); t_init_clk = (MULDIV64(sdram_freq, t_init_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_27, DDR0_27_EMRS_DATA_ENCODE(0x0000) | @@ -975,7 +975,7 @@ static void program_ddr0_43(unsigned long dimm_ranks[], t_wr_ps = max(t_wr_ps, ps); } } - debug("t_wr_ps = %d\n", t_wr_ps); + debug("t_wr_ps = %ld\n", t_wr_ps); t_wr_clk = (MULDIV64(sdram_freq, t_wr_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_43, ddr0_43 | DDR0_43_TWR_ENCODE(t_wr_clk)); } @@ -1003,7 +1003,7 @@ static void program_ddr0_44(unsigned long dimm_ranks[], t_rcd_ps = max(t_rcd_ps, ps); } } - debug("t_rcd_ps = %d\n", t_rcd_ps); + debug("t_rcd_ps = %ld\n", t_rcd_ps); t_rcd_clk = (MULDIV64(sdram_freq, t_rcd_ps, ONE_BILLION) + 999) / 1000; mtsdram(DDR0_44, DDR0_44_TRCD_ENCODE(t_rcd_clk)); } diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c index 1fd8fa6..ae5a517 100644 --- a/arch/sandbox/lib/board.c +++ b/arch/sandbox/lib/board.c @@ -250,7 +250,7 @@ void board_init_r(gd_t *id, ulong dest_addr) /* enable exceptions */ enable_interrupts(); -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT board_late_init(); #endif diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 6148e6b..d9c0c22 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -141,7 +141,7 @@ init_fnc_t *init_sequence[] = stdio_init, console_init_r, interrupt_init, -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT board_late_init, #endif #if defined(CONFIG_CMD_NET) diff --git a/board/Marvell/include/mv_gen_reg.h b/board/Marvell/include/mv_gen_reg.h index 03fcd88..008185e 100644 --- a/board/Marvell/include/mv_gen_reg.h +++ b/board/Marvell/include/mv_gen_reg.h @@ -1864,6 +1864,14 @@ #define ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port) (0x3500 + (port<<10)) #define ETH_DA_FILTER_UNICAST_TABLE_BASE(port) (0x3600 + (port<<10)) +/* Compat with interrupts.c */ +#define ETHERNET0_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(0) +#define ETHERNET1_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(1) +#define ETHERNET2_INTERRUPT_CAUSE_REGISTER ETH_INTERRUPT_CAUSE_REG(2) + +#define ETHERNET0_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(0) +#define ETHERNET1_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(1) +#define ETHERNET2_INTERRUPT_MASK_REGISTER ETH_INTERRUPT_MASK_REG(2) /* Ethernet GT64260 */ /* diff --git a/board/cpc45/pd67290.c b/board/cpc45/pd67290.c index 0d8ef23..815e4ba 100644 --- a/board/cpc45/pd67290.c +++ b/board/cpc45/pd67290.c @@ -225,11 +225,7 @@ static u_int cirrus_set_opts (socket_info_t * s) { cirrus_state_t *p = &s->c_state; u_int mask = 0xffff; -#if DEBUG - char buf[200]; - - memset (buf, 0, 200); -#endif + char buf[200] = {0}; if (has_ring == -1) has_ring = 1; diff --git a/board/dave/PPChameleonEVB/flash.c b/board/dave/PPChameleonEVB/flash.c index 2e1a9ab..3d5b20d 100644 --- a/board/dave/PPChameleonEVB/flash.c +++ b/board/dave/PPChameleonEVB/flash.c @@ -51,7 +51,8 @@ unsigned long flash_init (void) int size_val = 0; debug("[%s, %d] Entering ...\n", __FUNCTION__, __LINE__); - debug("[%s, %d] flash_info = 0x%08X ...\n", __FUNCTION__, __LINE__, flash_info); + debug("[%s, %d] flash_info = 0x%p ...\n", __func__, __LINE__, + flash_info); /* Init: no FLASHes known */ for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c index c266ebe..a60809a 100644 --- a/board/esd/pmc405de/pmc405de.c +++ b/board/esd/pmc405de/pmc405de.c @@ -441,7 +441,7 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ param = base - (pram << 10); printf("PARAM: @%08x\n", param); - debug("memsize=0x%08x, base=0x%08x\n", gd->bd->bi_memsize, base); + debug("memsize=0x%08x, base=0x%08x\n", (u32)gd->bd->bi_memsize, base); /* clear entire PA ram */ memset((void*)param, 0, (pram << 10)); diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c index 200d7ee..0202876 100644 --- a/board/esd/pmc440/cmd_pmc440.c +++ b/board/esd/pmc440/cmd_pmc440.c @@ -368,7 +368,7 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ param = base - (pram << 10); printf("PARAM: @%08x\n", param); - debug("memsize=0x%08x, base=0x%08x\n", gd->bd->bi_memsize, base); + debug("memsize=0x%08x, base=0x%08x\n", (u32)gd->bd->bi_memsize, base); /* clear entire PA ram */ memset((void*)param, 0, (pram << 10)); diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index b356a47..97eeab3 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -253,14 +253,14 @@ int misc_init_r(void) /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x08, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n", tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); tmp_val = 0x10; i2c_write(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n", tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); return 0; } diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index 1854e27..5b3b560 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -76,14 +76,14 @@ int misc_init_r(void) /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x08, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n",tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); tmp_val = 0x10; i2c_write(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); /* Verify if enabled */ tmp_val = 0; i2c_read(0x38, 0x0A, 1, &tmp_val, sizeof(tmp_val)); - debug("DVI Encoder Read: 0x%02lx\n",tmp_val); + debug("DVI Encoder Read: 0x%02x\n", tmp_val); return 0; } diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c index 84a50b6..a5b51a0 100644 --- a/board/freescale/mx35pdk/mx35pdk.c +++ b/board/freescale/mx35pdk/mx35pdk.c @@ -39,8 +39,8 @@ #include <asm/arch/sys_proto.h> #include <netdev.h> -#ifndef BOARD_LATE_INIT -#error "BOARD_LATE_INIT must be set for this board" +#ifndef CONFIG_BOARD_LATE_INIT +#error "CONFIG_BOARD_LATE_INIT must be set for this board" #endif #ifndef CONFIG_BOARD_EARLY_INIT_F diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 73ca513..2a0dad0 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -414,7 +414,7 @@ int board_init(void) return 0; } -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { #ifdef CONFIG_MXC_SPI diff --git a/board/freescale/p1022ds/diu.c b/board/freescale/p1022ds/diu.c index cef81ce..d5428ea 100644 --- a/board/freescale/p1022ds/diu.c +++ b/board/freescale/p1022ds/diu.c @@ -74,7 +74,7 @@ void diu_set_pixel_clock(unsigned int pixclock) temp = 1000000000 / pixclock; temp *= 1000; pixval = speed_ccb / temp; - debug("DIU pixval = %lu\n", pixval); + debug("DIU pixval = %u\n", pixval); /* Modify PXCLK in GUTS CLKDVDR */ temp = in_be32(&gur->clkdvdr) & 0x2000FFFF; diff --git a/board/imx31_phycore/imx31_phycore.c b/board/imx31_phycore/imx31_phycore.c index a697e47..c165590 100644 --- a/board/imx31_phycore/imx31_phycore.c +++ b/board/imx31_phycore/imx31_phycore.c @@ -97,7 +97,7 @@ int board_early_init_f(void) return 0; } -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { #ifdef CONFIG_S6E63D6 diff --git a/board/r360mpi/flash.c b/board/r360mpi/flash.c index 45cccf7..26ec11d 100644 --- a/board/r360mpi/flash.c +++ b/board/r360mpi/flash.c @@ -219,7 +219,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) value = addr[0]; - debug ("Manuf. ID @ 0x%08lx: 0x%08lx\n", (ulong)addr, value); + debug("Manuf. ID @ 0x%08lx: 0x%08x\n", (ulong)addr, value); switch (value) { case (FPW) INTEL_MANUFACT: @@ -235,7 +235,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) value = addr[1]; /* device ID */ - debug ("Device ID @ 0x%08lx: 0x%08lx\n", (ulong)(&addr[1]), value); + debug("Device ID @ 0x%08lx: 0x%08x\n", (ulong)(&addr[1]), value); switch (value) { case (FPW) INTEL_ID_28F320J3A: diff --git a/board/spc1920/hpi.c b/board/spc1920/hpi.c index 26d0f9c..9d8ec10 100644 --- a/board/spc1920/hpi.c +++ b/board/spc1920/hpi.c @@ -234,13 +234,13 @@ static int hpi_write_inc(u32 addr, u32 *data, u32 count) HPI_HPIA_1 = addr1; HPI_HPIA_2 = addr2; - debugX(4, "writing from data=0x%lx to 0x%lx\n", + debug("writing from data=0x%lx to 0x%lx\n", (ulong)data, (ulong)(data+count)); for(i=0; i<count; i++) { HPI_HPID_INC_1 = (u16) ((data[i] >> 16) & 0xffff); HPI_HPID_INC_2 = (u16) (data[i] & 0xffff); - debugX(4, "hpi_write_inc: data1=0x%x, data2=0x%x\n", + debug("hpi_write_inc: data1=0x%x, data2=0x%x\n", (u16) ((data[i] >> 16) & 0xffff), (u16) (data[i] & 0xffff)); } @@ -273,7 +273,7 @@ static int hpi_read_inc(u32 addr, u32 *buf, u32 count) for(i=0; i<count; i++) { data1 = HPI_HPID_INC_1; data2 = HPI_HPID_INC_2; - debugX(4, "hpi_read_inc: data1=0x%x, data2=0x%x\n", data1, data2); + debug("hpi_read_inc: data1=0x%x, data2=0x%x\n", data1, data2); buf[i] = (((u32) data1) << 16) | (data2 & 0xffff); } @@ -354,9 +354,9 @@ int hpi_test(void) u32 test_data[HPI_TEST_CHUNKSIZE]; u32 read_data[HPI_TEST_CHUNKSIZE]; - debugX(2, "hpi_test: activating hpi..."); + debug("hpi_test: activating hpi..."); hpi_activate(); - debugX(2, "OK.\n"); + debug("OK.\n"); #if 0 /* Dump the first 1024 bytes @@ -372,22 +372,22 @@ int hpi_test(void) /* HPIA read-write test * */ - debugX(1, "hpi_test: starting HPIA read-write tests...\n"); + debug("hpi_test: starting HPIA read-write tests...\n"); err |= hpi_write_addr_test(0xdeadc0de); err |= hpi_write_addr_test(0xbeefd00d); err |= hpi_write_addr_test(0xabcd1234); err |= hpi_write_addr_test(0xaaaaaaaa); if(err) { - debugX(1, "hpi_test: HPIA read-write tests: *** FAILED ***\n"); + debug("hpi_test: HPIA read-write tests: *** FAILED ***\n"); return -1; } - debugX(1, "hpi_test: HPIA read-write tests: OK\n"); + debug("hpi_test: HPIA read-write tests: OK\n"); /* read write test using nonincremental data regs * */ - debugX(1, "hpi_test: starting nonincremental tests...\n"); + debug("hpi_test: starting nonincremental tests...\n"); for(i=HPI_TEST_START; i<HPI_TEST_END; i+=4) { err |= hpi_read_write_test(i, pattern); @@ -400,16 +400,16 @@ int hpi_test(void) err |= hpi_read_write_test(i, pattern); if(err) { - debugX(1, "hpi_test: nonincremental tests *** FAILED ***\n"); + debug("hpi_test: nonincremental tests *** FAILED ***\n"); return -1; } } - debugX(1, "hpi_test: nonincremental test OK\n"); + debug("hpi_test: nonincremental test OK\n"); /* read write a chunk of data using nonincremental data regs * */ - debugX(1, "hpi_test: starting nonincremental chunk tests...\n"); + debug("hpi_test: starting nonincremental chunk tests...\n"); pattern = HPI_TEST_PATTERN; for(i=HPI_TEST_START; i<HPI_TEST_END; i+=4) { hpi_write_noinc(i, pattern); @@ -426,7 +426,7 @@ int hpi_test(void) tmp = hpi_read_noinc(i); if(tmp != pattern) { - debugX(1, "hpi_test: noninc chunk test *** FAILED *** @ 0x%x, written=0x%x, read=0x%x\n", i, pattern, tmp); + debug("hpi_test: noninc chunk test *** FAILED *** @ 0x%x, written=0x%x, read=0x%x\n", i, pattern, tmp); err = -1; } /* stolen from cmd_mem.c */ @@ -438,23 +438,23 @@ int hpi_test(void) } if(err) return -1; - debugX(1, "hpi_test: nonincremental chunk test OK\n"); + debug("hpi_test: nonincremental chunk test OK\n"); #ifdef DO_TINY_TEST /* small verbose test using autoinc and nonautoinc to compare * */ - debugX(1, "hpi_test: tiny_autoinc_test...\n"); + debug("hpi_test: tiny_autoinc_test...\n"); hpi_tiny_autoinc_test(); - debugX(1, "hpi_test: tiny_autoinc_test done\n"); + debug("hpi_test: tiny_autoinc_test done\n"); #endif /* DO_TINY_TEST */ /* $%& write a chunk of data using the autoincremental regs * */ - debugX(1, "hpi_test: starting autoinc test %d chunks with 0x%x bytes...\n", + debug("hpi_test: starting autoinc test %d chunks with 0x%x bytes...\n", ((HPI_TEST_END - HPI_TEST_START) / HPI_TEST_CHUNKSIZE), HPI_TEST_CHUNKSIZE); @@ -462,9 +462,9 @@ int hpi_test(void) i < ((HPI_TEST_END - HPI_TEST_START) / HPI_TEST_CHUNKSIZE); i++) { /* generate the pattern data */ - debugX(3, "generating pattern data: "); + debug("generating pattern data: "); for(ii = 0; ii < HPI_TEST_CHUNKSIZE; ii++) { - debugX(3, "0x%x ", pattern); + debug("0x%x ", pattern); test_data[ii] = pattern; read_data[ii] = 0x0; /* zero to be sure */ @@ -476,24 +476,24 @@ int hpi_test(void) pattern = ~pattern; } } - debugX(3, "done\n"); + debug("done\n"); - debugX(2, "Writing autoinc data @ 0x%x\n", i); + debug("Writing autoinc data @ 0x%x\n", i); hpi_write_inc(i, test_data, HPI_TEST_CHUNKSIZE); - debugX(2, "Reading autoinc data @ 0x%x\n", i); + debug("Reading autoinc data @ 0x%x\n", i); hpi_read_inc(i, read_data, HPI_TEST_CHUNKSIZE); /* compare */ for(ii = 0; ii < HPI_TEST_CHUNKSIZE; ii++) { - debugX(3, "hpi_test_autoinc: @ 0x%x, written=0x%x, read=0x%x", i+ii, test_data[ii], read_data[ii]); + debug("hpi_test_autoinc: @ 0x%x, written=0x%x, read=0x%x", i+ii, test_data[ii], read_data[ii]); if(read_data[ii] != test_data[ii]) { - debugX(0, "hpi_test: autoinc test @ 0x%x, written=0x%x, read=0x%x *** FAILED ***\n", i+ii, test_data[ii], read_data[ii]); + debug("hpi_test: autoinc test @ 0x%x, written=0x%x, read=0x%x *** FAILED ***\n", i+ii, test_data[ii], read_data[ii]); return -1; } } } - debugX(1, "hpi_test: autoinc test OK\n"); + debug("hpi_test: autoinc test OK\n"); return 0; } @@ -510,22 +510,22 @@ int hpi_test(void) 0x0009000a, 0x000b000c, 0x000d000e, 0x000f0001 }; - debugX(0, "hpi_test: activating hpi..."); + debug("hpi_test: activating hpi..."); hpi_activate(); - debugX(0, "OK.\n"); + debug("OK.\n"); while(1) { led9(1); - debugX(0, " writing to autoinc...\n"); + debug(" writing to autoinc...\n"); hpi_write_inc(TINY_AUTOINC_BASE_ADDR, dummy_data, TINY_AUTOINC_DATA_SIZE); - debugX(0, " reading from autoinc...\n"); + debug(" reading from autoinc...\n"); hpi_read_inc(TINY_AUTOINC_BASE_ADDR, read_data, TINY_AUTOINC_DATA_SIZE); for(i=0; i < (TINY_AUTOINC_DATA_SIZE); i++) { - debugX(0, " written=0x%x, read(inc)=0x%x\n", + debug(" written=0x%x, read(inc)=0x%x\n", dummy_data[i], read_data[i]); } led9(0); @@ -546,11 +546,11 @@ static int hpi_write_addr_test(u32 addr) read_back = (((u32) HPI_HPIA_1)<<16) | ((u32) HPI_HPIA_2); if(read_back == addr) { - debugX(2, " hpi_write_addr_test OK: written=0x%x, read=0x%x\n", + debug(" hpi_write_addr_test OK: written=0x%x, read=0x%x\n", addr, read_back); return 0; } else { - debugX(0, " hpi_write_addr_test *** FAILED ***: written=0x%x, read=0x%x\n", + debug(" hpi_write_addr_test *** FAILED ***: written=0x%x, read=0x%x\n", addr, read_back); return -1; } @@ -567,10 +567,10 @@ static int hpi_read_write_test(u32 addr, u32 data) read_back = hpi_read_noinc(addr); if(read_back == data) { - debugX(2, " hpi_read_write_test: OK, addr=0x%x written=0x%x, read=0x%x\n", addr, data, read_back); + debug(" hpi_read_write_test: OK, addr=0x%x written=0x%x, read=0x%x\n", addr, data, read_back); return 0; } else { - debugX(0, " hpi_read_write_test: *** FAILED ***, addr=0x%x written=0x%x, read=0x%x\n", addr, data, read_back); + debug(" hpi_read_write_test: *** FAILED ***, addr=0x%x written=0x%x, read=0x%x\n", addr, data, read_back); return -1; } diff --git a/board/st-ericsson/u8500/u8500_href.c b/board/st-ericsson/u8500/u8500_href.c index 9283fab..5f85fdc 100644 --- a/board/st-ericsson/u8500/u8500_href.c +++ b/board/st-ericsson/u8500/u8500_href.c @@ -226,7 +226,7 @@ unsigned int addr_vall_arr[] = { 0xA03FE024, 0x00000000 /* USB */ }; -#ifdef BOARD_LATE_INIT +#ifdef CONFIG_BOARD_LATE_INIT #ifdef CONFIG_MMC #define LDO_VAUX3_MASK 0x3 @@ -351,7 +351,7 @@ int board_late_init(void) return 0; } -#endif /* BOARD_LATE_INIT */ +#endif /* CONFIG_BOARD_LATE_INIT */ static void early_gpio_setup(struct gpio_register *gpio_reg, u32 bits) { diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 260e392..7af8b4c 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -123,7 +123,7 @@ phys_size_t initdram (int board_type) (long *)(CONFIG_SYS_DDR_BASE + size)); size += bank_size; - debug("DDR Bank%d size: %d MiB\n\n", cs, bank_size >> 20); + debug("DDR Bank%d size: %ld MiB\n\n", cs, bank_size >> 20); /* exit if less than one bank */ if(size < DDR_MAX_SIZE_PER_CS) break; @@ -333,7 +333,7 @@ static long int get_ddr_bank_size(short cs, long *base) */ static void set_cs_bounds(short cs, long base, long size) { - debug("Setting bounds %08x, %08x for cs %d\n", base, size, cs); + debug("Setting bounds %08lx, %08lx for cs %d\n", base, size, cs); if(size == 0){ im->ddr.csbnds[cs].csbnds = 0x00000000; } else { @@ -351,7 +351,7 @@ static void set_cs_bounds(short cs, long base, long size) */ static void set_cs_config(short cs, long config) { - debug("Setting config %08x for cs %d\n", config, cs); + debug("Setting config %08lx for cs %d\n", config, cs); im->ddr.cs_config[cs] = config; SYNC; } diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 9b2952f..c4c13a6 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -72,6 +72,12 @@ int fsl_init2 (void) { int board_eth_init(bd_t *bis) { int ret = 0; + +#ifdef CONFIG_XILINX_AXIEMAC + ret |= xilinx_axiemac_initialize(bis, XILINX_AXIEMAC_BASEADDR, + XILINX_AXIDMA_BASEADDR); +#endif + #ifdef CONFIG_XILINX_EMACLITE u32 txpp = 0; u32 rxpp = 0; diff --git a/common/cmd_ide.c b/common/cmd_ide.c index d909c54..1fc0377 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -1218,7 +1218,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer) lba48 = 1; } #endif - debug ("ide_read dev %d start %LX, blocks %lX buffer at %lX\n", + debug("ide_read dev %d start %lX, blocks %lX buffer at %lX\n", device, blknr, blkcnt, (ulong)buffer); ide_led (DEVICE_LED(device), 1); /* LED on */ diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index 2c2e4e0..b7c833b 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -839,9 +839,7 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ const char *mtd_id; unsigned int mtd_id_len; const char *p; -#ifdef DEBUG const char *pend; -#endif LIST_HEAD(tmp_list); struct list_head *entry, *n; u16 num_parts; diff --git a/common/usb.c b/common/usb.c index 2cd50db..bed5116 100644 --- a/common/usb.c +++ b/common/usb.c @@ -56,16 +56,16 @@ #endif #ifdef DEBUG -#define USB_DEBUG -#define USB_HUB_DEBUG -#endif - -#ifdef USB_DEBUG -#define USB_PRINTF(fmt, args...) printf(fmt , ##args) +#define USB_DEBUG 1 +#define USB_HUB_DEBUG 1 #else -#define USB_PRINTF(fmt, args...) +#define USB_DEBUG 0 +#define USB_HUB_DEBUG 0 #endif +#define USB_PRINTF(fmt, args...) debug_cond(USB_DEBUG, fmt, ##args) +#define USB_HUB_PRINTF(fmt, args...) debug_cond(USB_HUB_DEBUG, fmt, ##args) + #define USB_BUFSIZ 512 static struct usb_device usb_dev[USB_MAX_DEVICE]; @@ -968,13 +968,6 @@ void usb_scan_devices(void) * Probes device for being a hub and configurate it */ -#ifdef USB_HUB_DEBUG -#define USB_HUB_PRINTF(fmt, args...) printf(fmt , ##args) -#else -#define USB_HUB_PRINTF(fmt, args...) -#endif - - static struct usb_hub_device hub_dev[USB_MAX_HUB]; static int usb_hub_index; diff --git a/common/usb_storage.c b/common/usb_storage.c index 16667f3..d9a2585 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -56,16 +56,17 @@ #include <part.h> #include <usb.h> -#undef USB_STOR_DEBUG #undef BBB_COMDAT_TRACE #undef BBB_XPORT_TRACE #ifdef USB_STOR_DEBUG -#define USB_STOR_PRINTF(fmt, args...) printf(fmt , ##args) +#define USB_BLK_DEBUG 1 #else -#define USB_STOR_PRINTF(fmt, args...) +#define USB_BLK_DEBUG 0 #endif +#define USB_STOR_PRINTF(fmt, args...) debug_cond(USB_BLK_DEBUG, fmt, ##args) + #include <scsi.h> /* direction table -- this indicates the direction of the data * transfer for each command code -- a 1 indicates input @@ -372,7 +373,7 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length) usb_clear_halt(us->pusb_dev, pipe); us->pusb_dev->status = stat; if (this_xfer == partial) { - USB_STOR_PRINTF("bulk transferred with error %X, but data ok\n", us->pusb_dev->status); + USB_STOR_PRINTF("bulk transferred with error %lX, but data ok\n", us->pusb_dev->status); return 0; } else @@ -384,12 +385,12 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length) } USB_STOR_PRINTF("bulk transferred with error"); if (this_xfer == partial) { - USB_STOR_PRINTF(" %d, but data ok\n", + USB_STOR_PRINTF(" %ld, but data ok\n", us->pusb_dev->status); return 0; } /* if our try counter reaches 0, bail out */ - USB_STOR_PRINTF(" %d, data %d\n", + USB_STOR_PRINTF(" %ld, data %d\n", us->pusb_dev->status, partial); if (!maxtry--) return result; @@ -437,19 +438,19 @@ static int usb_stor_BBB_reset(struct us_data *us) /* long wait for reset */ wait_ms(150); - USB_STOR_PRINTF("BBB_reset result %d: status %X reset\n", result, + USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result, us->pusb_dev->status); pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in); result = usb_clear_halt(us->pusb_dev, pipe); /* long wait for reset */ wait_ms(150); - USB_STOR_PRINTF("BBB_reset result %d: status %X clearing IN endpoint\n", + USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n", result, us->pusb_dev->status); /* long wait for reset */ pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out); result = usb_clear_halt(us->pusb_dev, pipe); wait_ms(150); - USB_STOR_PRINTF("BBB_reset result %d: status %X" + USB_STOR_PRINTF("BBB_reset result %d: status %lX" " clearing OUT endpoint\n", result, us->pusb_dev->status); USB_STOR_PRINTF("BBB_reset done\n"); @@ -477,7 +478,7 @@ static int usb_stor_CB_reset(struct us_data *us) /* long wait for reset */ wait_ms(1500); - USB_STOR_PRINTF("CB_reset result %d: status %X" + USB_STOR_PRINTF("CB_reset result %d: status %lX" " clearing endpoint halt\n", result, us->pusb_dev->status); usb_clear_halt(us->pusb_dev, usb_rcvbulkpipe(us->pusb_dev, us->ep_in)); @@ -568,7 +569,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us) srb->cmd, srb->cmdlen, USB_CNTL_TIMEOUT * 5); USB_STOR_PRINTF("CB_transport: control msg returned %d," - " status %X\n", result, us->pusb_dev->status); + " status %lX\n", result, us->pusb_dev->status); /* check the return code for the command */ if (result < 0) { if (us->pusb_dev->status & USB_ST_STALLED) { @@ -580,7 +581,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us) us->pusb_dev->status = status; } USB_STOR_PRINTF(" error during command %02X" - " Stat = %X\n", srb->cmd[0], + " Stat = %lX\n", srb->cmd[0], us->pusb_dev->status); return result; } @@ -777,7 +778,7 @@ again: usb_stor_BBB_reset(us); return USB_STOR_TRANSPORT_FAILED; } else if (data_actlen > srb->datalen) { - USB_STOR_PRINTF("transferred %dB instead of %dB\n", + USB_STOR_PRINTF("transferred %dB instead of %ldB\n", data_actlen, srb->datalen); return USB_STOR_TRANSPORT_FAILED; } else if (csw.bCSWStatus == CSWSTATUS_FAILED) { @@ -802,7 +803,7 @@ int usb_stor_CB_transport(ccb *srb, struct us_data *us) /* issue the command */ do_retry: result = usb_stor_CB_comdat(srb, us); - USB_STOR_PRINTF("command / Data returned %d, status %X\n", + USB_STOR_PRINTF("command / Data returned %d, status %lX\n", result, us->pusb_dev->status); /* if this is an CBI Protocol, get IRQ */ if (us->protocol == US_PR_CBI) { @@ -825,7 +826,7 @@ do_retry: /* do we have to issue an auto request? */ /* HERE we have to check the result */ if ((result < 0) && !(us->pusb_dev->status & USB_ST_STALLED)) { - USB_STOR_PRINTF("ERROR %X\n", us->pusb_dev->status); + USB_STOR_PRINTF("ERROR %lX\n", us->pusb_dev->status); us->transport_reset(us); return USB_STOR_TRANSPORT_ERROR; } @@ -852,7 +853,7 @@ do_retry: status = usb_stor_CBI_get_status(psrb, us); if ((result < 0) && !(us->pusb_dev->status & USB_ST_STALLED)) { - USB_STOR_PRINTF(" AUTO REQUEST ERROR %d\n", + USB_STOR_PRINTF(" AUTO REQUEST ERROR %ld\n", us->pusb_dev->status); return USB_STOR_TRANSPORT_ERROR; } diff --git a/disk/part_efi.c b/disk/part_efi.c index e591724..e7f2714 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -121,40 +121,37 @@ static char *print_efiname(gpt_entry *pte) void print_part_efi(block_dev_desc_t * dev_desc) { ALLOC_CACHE_ALIGN_BUFFER(gpt_header, gpt_head, 1); - gpt_entry **pgpt_pte = NULL; + gpt_entry *gpt_pte = NULL; int i = 0; if (!dev_desc) { - printf("%s: Invalid Argument(s)\n", __FUNCTION__); + printf("%s: Invalid Argument(s)\n", __func__); return; } /* This function validates AND fills in the GPT header and PTE */ if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, - gpt_head, pgpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", __FUNCTION__); + &(gpt_head), &gpt_pte) != 1) { + printf("%s: *** ERROR: Invalid GPT ***\n", __func__); return; } - debug("%s: gpt-entry at 0x%08X\n", __FUNCTION__, (unsigned int)*pgpt_pte); + debug("%s: gpt-entry at %p\n", __func__, gpt_pte); printf("Part\tName\t\t\tStart LBA\tEnd LBA\n"); for (i = 0; i < le32_to_int(gpt_head->num_partition_entries); i++) { - if (is_pte_valid(&(*pgpt_pte)[i])) { + if (is_pte_valid(&gpt_pte[i])) { printf("%3d\t%-18s\t0x%08llX\t0x%08llX\n", (i + 1), - print_efiname(&(*pgpt_pte)[i]), - le64_to_int((*pgpt_pte)[i].starting_lba), - le64_to_int((*pgpt_pte)[i].ending_lba)); + print_efiname(&gpt_pte[i]), + le64_to_int(gpt_pte[i].starting_lba), + le64_to_int(gpt_pte[i].ending_lba)); } else { break; /* Stop at the first non valid PTE */ } } /* Remember to free pte */ - if (*pgpt_pte != NULL) { - debug("%s: Freeing pgpt_pte\n", __FUNCTION__); - free(*pgpt_pte); - } + free(gpt_pte); return; } @@ -162,40 +159,37 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part, disk_partition_t * info) { ALLOC_CACHE_ALIGN_BUFFER(gpt_header, gpt_head, 1); - gpt_entry **pgpt_pte = NULL; + gpt_entry *gpt_pte = NULL; /* "part" argument must be at least 1 */ if (!dev_desc || !info || part < 1) { - printf("%s: Invalid Argument(s)\n", __FUNCTION__); + printf("%s: Invalid Argument(s)\n", __func__); return -1; } /* This function validates AND fills in the GPT header and PTE */ if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, - gpt_head, pgpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", __FUNCTION__); + &(gpt_head), &gpt_pte) != 1) { + printf("%s: *** ERROR: Invalid GPT ***\n", __func__); return -1; } /* The ulong casting limits the maximum disk size to 2 TB */ - info->start = (ulong) le64_to_int((*pgpt_pte)[part - 1].starting_lba); + info->start = (ulong) le64_to_int(gpt_pte[part - 1].starting_lba); /* The ending LBA is inclusive, to calculate size, add 1 to it */ - info->size = ((ulong)le64_to_int((*pgpt_pte)[part - 1].ending_lba) + 1) + info->size = ((ulong)le64_to_int(gpt_pte[part - 1].ending_lba) + 1) - info->start; info->blksz = GPT_BLOCK_SIZE; sprintf((char *)info->name, "%s", - print_efiname(&(*pgpt_pte)[part - 1])); + print_efiname(&gpt_pte[part - 1])); sprintf((char *)info->type, "U-Boot"); - debug("%s: start 0x%lX, size 0x%lX, name %s", __FUNCTION__, + debug("%s: start 0x%lX, size 0x%lX, name %s", __func__, info->start, info->size, info->name); /* Remember to free pte */ - if (*pgpt_pte != NULL) { - debug("%s: Freeing pgpt_pte\n", __FUNCTION__); - free(*pgpt_pte); - } + free(gpt_pte); return 0; } @@ -271,7 +265,7 @@ static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, unsigned long long lastlba; if (!dev_desc || !pgpt_head) { - printf("%s: Invalid Argument(s)\n", __FUNCTION__); + printf("%s: Invalid Argument(s)\n", __func__); return 0; } @@ -349,9 +343,7 @@ static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, le32_to_int(pgpt_head->partition_entry_array_crc32), calc_crc32); - if (*pgpt_pte != NULL) { - free(*pgpt_pte); - } + free(*pgpt_pte); return 0; } @@ -375,14 +367,14 @@ static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc, gpt_entry *pte = NULL; if (!dev_desc || !pgpt_head) { - printf("%s: Invalid Argument(s)\n", __FUNCTION__); + printf("%s: Invalid Argument(s)\n", __func__); return NULL; } count = le32_to_int(pgpt_head->num_partition_entries) * le32_to_int(pgpt_head->sizeof_partition_entry); - debug("%s: count = %lu * %lu = %u\n", __FUNCTION__, + debug("%s: count = %lu * %lu = %u\n", __func__, le32_to_int(pgpt_head->num_partition_entries), le32_to_int(pgpt_head->sizeof_partition_entry), count); @@ -393,7 +385,7 @@ static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc, if (count == 0 || pte == NULL) { printf("%s: ERROR: Can't allocate 0x%X bytes for GPT Entries\n", - __FUNCTION__, count); + __func__, count); return NULL; } @@ -421,7 +413,7 @@ static int is_pte_valid(gpt_entry * pte) efi_guid_t unused_guid; if (!pte) { - printf("%s: Invalid Argument(s)\n", __FUNCTION__); + printf("%s: Invalid Argument(s)\n", __func__); return 0; } @@ -433,7 +425,7 @@ static int is_pte_valid(gpt_entry * pte) if (memcmp(pte->partition_type_guid.b, unused_guid.b, sizeof(unused_guid.b)) == 0) { - debug("%s: Found an unused PTE GUID at 0x%08X\n", __FUNCTION__, + debug("%s: Found an unused PTE GUID at 0x%08X\n", __func__, (unsigned int)pte); return 0; diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c index 64f52bb..015b341 100644 --- a/drivers/block/ahci.c +++ b/drivers/block/ahci.c @@ -398,7 +398,7 @@ static int ahci_port_start(u8 port) * 32 bytes each in size */ pp->cmd_slot = (struct ahci_cmd_hdr *)mem; - debug("cmd_slot = 0x%x\n", pp->cmd_slot); + debug("cmd_slot = %p\n", pp->cmd_slot); mem += (AHCI_CMD_SLOT_SZ + 224); /* diff --git a/drivers/block/sata_sil3114.c b/drivers/block/sata_sil3114.c index d43064e..1e60636 100644 --- a/drivers/block/sata_sil3114.c +++ b/drivers/block/sata_sil3114.c @@ -171,7 +171,7 @@ static void sata_identify (int num, int dev) sata_dev_desc[devno].removable = 0; sata_dev_desc[devno].lba = (u32) n_sectors; - debug ("lba=0x%x\n", sata_dev_desc[devno].lba); + debug("lba=0x%lx\n", sata_dev_desc[devno].lba); #ifdef CONFIG_LBA48 if (iobuf[83] & (1 << 10)) { diff --git a/drivers/fpga/lattice.c b/drivers/fpga/lattice.c index 50d9e542..d8b642a 100644 --- a/drivers/fpga/lattice.c +++ b/drivers/fpga/lattice.c @@ -317,7 +317,7 @@ int lattice_load(Lattice_desc *desc, const void *buf, size_t bsize) read_bytes = 0; bufsize = bsize; debug("%s: Launching the Lattice ISPVME Loader:" - " addr 0x%x size 0x%x...\n", + " addr %p size 0x%lx...\n", __func__, fpga_image, bufsize); ret_val = ispVM(); if (ret_val) diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c index 48e21ef..3c2905c 100644 --- a/drivers/mmc/pxa_mmc.c +++ b/drivers/mmc/pxa_mmc.c @@ -55,7 +55,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat) /****************************************************/ { static uint32_t resp[4], a, b, c; - ulong status; + uint32_t status; int i; debug("mmc_cmd %u 0x%04x 0x%04x 0x%04x\n", cmd, argh, argl, @@ -97,7 +97,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat) int /****************************************************/ -mmc_block_read(uchar * dst, ulong src, ulong len) +mmc_block_read(uchar * dst, uint32_t src, int len) /****************************************************/ { ushort argh, argl; @@ -107,7 +107,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len) return 0; } - debug("mmc_block_rd dst %lx src %lx len %d\n", (ulong) dst, src, len); + debug("mmc_block_rd dst %p src %08x len %d\n", dst, src, len); argh = len >> 16; argl = len & 0xffff; @@ -298,7 +298,7 @@ pxa_mmc_read(long src, uchar * dst, int size) int /****************************************************/ -pxa_mmc_write(uchar * src, ulong dst, int size) +pxa_mmc_write(uchar * src, uint32_t dst, int size) /****************************************************/ { ulong end, part_start, part_end, part_len, aligned_start, aligned_end; @@ -325,14 +325,14 @@ pxa_mmc_write(uchar * src, ulong dst, int size) /* all block aligned accesses */ debug - ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - src, (ulong) dst, end, part_start, part_end, aligned_start, + ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); if (part_start) { part_len = mmc_block_size - part_start; debug - ("ps src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - (ulong) src, dst, end, part_start, part_end, aligned_start, + ("ps src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); if ((mmc_block_read(mmc_buf, aligned_start, mmc_block_size)) < 0) { @@ -347,26 +347,26 @@ pxa_mmc_write(uchar * src, ulong dst, int size) src += part_len; } debug - ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - src, (ulong) dst, end, part_start, part_end, aligned_start, + ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); for (; dst < aligned_end; src += mmc_block_size, dst += mmc_block_size) { debug - ("al src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - src, (ulong) dst, end, part_start, part_end, aligned_start, + ("al src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); if ((mmc_block_write(dst, (uchar *) src, mmc_block_size)) < 0) { return -1; } } debug - ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - src, (ulong) dst, end, part_start, part_end, aligned_start, + ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); if (part_end && dst < end) { debug - ("pe src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n", - src, (ulong) dst, end, part_start, part_end, aligned_start, + ("pe src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n", + src, dst, end, part_start, part_end, aligned_start, aligned_end); if ((mmc_block_read(mmc_buf, aligned_end, mmc_block_size)) < 0) { return -1; diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index ac91dfd..5494bcf 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2149,7 +2149,7 @@ void flash_protect_default(void) #if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) { - debug("autoprotecting from %08x to %08x\n", + debug("autoprotecting from %08lx to %08lx\n", apl[i].start, apl[i].start + apl[i].size - 1); flash_protect(FLAG_PROTECT_SET, apl[i].start, diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c index da8c9b1..36d30c3 100644 --- a/drivers/mtd/jedec_flash.c +++ b/drivers/mtd/jedec_flash.c @@ -390,7 +390,8 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je debug("unlock address index %d\n", uaddr_idx); info->addr_unlock1 = unlock_addrs[uaddr_idx].addr1; info->addr_unlock2 = unlock_addrs[uaddr_idx].addr2; - debug("unlock addresses are 0x%x/0x%x\n", info->addr_unlock1, info->addr_unlock2); + debug("unlock addresses are 0x%lx/0x%lx\n", + info->addr_unlock1, info->addr_unlock2); sect_cnt = 0; total_size = 0; @@ -399,7 +400,7 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je ulong erase_region_count = (jedec_entry->regions[i] & 0xff) + 1; total_size += erase_region_size * erase_region_count; - debug ("erase_region_count = %d erase_region_size = %d\n", + debug("erase_region_count = %ld erase_region_size = %ld\n", erase_region_count, erase_region_size); for (j = 0; j < erase_region_count; j++) { if (sect_cnt >= CONFIG_SYS_MAX_FLASH_SECT) { diff --git a/drivers/mtd/nand/s3c2410_nand.c b/drivers/mtd/nand/s3c2410_nand.c index 27351fb..e1a459b 100644 --- a/drivers/mtd/nand/s3c2410_nand.c +++ b/drivers/mtd/nand/s3c2410_nand.c @@ -56,7 +56,7 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) struct nand_chip *chip = mtd->priv; struct s3c2410_nand *nand = s3c2410_get_base_nand(); - debugX(1, "hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl); + debug("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl); if (ctrl & NAND_CTRL_CHANGE) { ulong IO_ADDR_W = (ulong)nand; @@ -83,7 +83,7 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) static int s3c2410_dev_ready(struct mtd_info *mtd) { struct s3c2410_nand *nand = s3c2410_get_base_nand(); - debugX(1, "dev_ready\n"); + debug("dev_ready\n"); return readl(&nand->nfstat) & 0x01; } @@ -91,7 +91,7 @@ static int s3c2410_dev_ready(struct mtd_info *mtd) void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode) { struct s3c2410_nand *nand = s3c2410_get_base_nand(); - debugX(1, "s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode); + debug("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode); writel(readl(&nand->nfconf) | S3C2410_NFCONF_INITECC, &nand->nfconf); } @@ -102,7 +102,7 @@ static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, ecc_code[0] = readb(&nand->nfecc); ecc_code[1] = readb(&nand->nfecc + 1); ecc_code[2] = readb(&nand->nfecc + 2); - debugX(1, "s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n", + debug("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n", mtd , ecc_code[0], ecc_code[1], ecc_code[2]); return 0; @@ -128,7 +128,7 @@ int board_nand_init(struct nand_chip *nand) struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); struct s3c2410_nand *nand_reg = s3c2410_get_base_nand(); - debugX(1, "board_nand_init()\n"); + debug("board_nand_init()\n"); writel(readl(&clk_power->clkcon) | (1 << 4), &clk_power->clkcon); @@ -183,7 +183,7 @@ int board_nand_init(struct nand_chip *nand) nand->options = 0; #endif - debugX(1, "end of nand_init\n"); + debug("end of nand_init\n"); return 0; } diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 9ab5c80..8013ad9 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1349,7 +1349,7 @@ get_speed: hw_p->rx_phys = bd_cached + MAL_TX_DESC_SIZE; hw_p->tx = (mal_desc_t *)(bd_uncached); hw_p->rx = (mal_desc_t *)(bd_uncached + MAL_TX_DESC_SIZE); - debug("hw_p->tx=%08x, hw_p->rx=%08x\n", hw_p->tx, hw_p->rx); + debug("hw_p->tx=%p, hw_p->rx=%p\n", hw_p->tx, hw_p->rx); } for (i = 0; i < NUM_TX_BUFF; i++) { @@ -1362,7 +1362,7 @@ get_speed: if ((NUM_TX_BUFF - 1) == i) hw_p->tx[i].ctrl |= MAL_TX_CTRL_WRAP; hw_p->tx_run[i] = -1; - debug("TX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->tx[i].data_ptr); + debug("TX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->tx[i].data_ptr); } for (i = 0; i < NUM_RX_BUFF; i++) { @@ -1373,7 +1373,7 @@ get_speed: hw_p->rx[i].ctrl |= MAL_RX_CTRL_WRAP; hw_p->rx[i].ctrl |= MAL_RX_CTRL_EMPTY | MAL_RX_CTRL_INTR; hw_p->rx_ready[i] = -1; - debug("RX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->rx[i].data_ptr); + debug("RX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->rx[i].data_ptr); } reg = 0x00000000; diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index cfe2176..0c0c7cd 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -109,7 +109,7 @@ static void fec_mii_setspeed(struct fec_priv *fec) */ writel((((imx_get_fecclk() / 1000000) + 2) / 5) << 1, &fec->eth->mii_speed); - debug("fec_init: mii_speed %#lx\n", + debug("fec_init: mii_speed %08x\n", readl(&fec->eth->mii_speed)); } static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr, @@ -629,7 +629,7 @@ static int fec_recv(struct eth_device *dev) */ ievent = readl(&fec->eth->ievent); writel(ievent, &fec->eth->ievent); - debug("fec_recv: ievent 0x%x\n", ievent); + debug("fec_recv: ievent 0x%lx\n", ievent); if (ievent & FEC_IEVENT_BABR) { fec_halt(dev); fec_init(dev, fec->bd); diff --git a/drivers/net/ks8695eth.c b/drivers/net/ks8695eth.c index cd36880..8e988d1 100644 --- a/drivers/net/ks8695eth.c +++ b/drivers/net/ks8695eth.c @@ -196,7 +196,7 @@ static int ks8695_eth_send(struct eth_device *dev, volatile void *packet, volatile struct ks8695_txdesc *dp; static int next = 0; - debug ("%s(%d): eth_send(packet=%x,len=%d)\n", __FILE__, __LINE__, + debug ("%s(%d): eth_send(packet=%p,len=%d)\n", __FILE__, __LINE__, packet, len); dp = &ks8695_tx[next]; diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 7f601d4..bff1314 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -305,10 +305,10 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) inbound = fsl_pci_setup_inbound_windows(hose, out_lo, pcie_cap, pi); for (r = 0; r < hose->region_count; r++) - debug("PCI reg:%d %016llx:%016llx %016llx %08x\n", r, + debug("PCI reg:%d %016llx:%016llx %016llx %08lx\n", r, (u64)hose->regions[r].phys_start, - hose->regions[r].bus_start, - hose->regions[r].size, + (u64)hose->regions[r].bus_start, + (u64)hose->regions[r].size, hose->regions[r].flags); pci_register_hose(hose); @@ -344,7 +344,7 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) setbits_be32(&pci->pdb_stat, 0x08000000); (void) in_be32(&pci->pdb_stat); udelay(100); - debug(" Asserting PCIe reset @%x = %x\n", + debug(" Asserting PCIe reset @%p = %x\n", &pci->pdb_stat, in_be32(&pci->pdb_stat)); /* clear PCIe reset */ clrbits_be32(&pci->pdb_stat, 0x08000000); diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 1bcb3a5..1cde83a 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -272,11 +272,7 @@ static u_int cirrus_set_opts (socket_info_t * s) { cirrus_state_t *p = &s->c_state; u_int mask = 0xffff; -#if DEBUG - char buf[200]; - - memset (buf, 0, 200); -#endif + char buf[200] = {0}; if (has_ring == -1) has_ring = 1; diff --git a/drivers/pcmcia/tqm8xx_pcmcia.c b/drivers/pcmcia/tqm8xx_pcmcia.c index 859cbe0..dda7d37 100644 --- a/drivers/pcmcia/tqm8xx_pcmcia.c +++ b/drivers/pcmcia/tqm8xx_pcmcia.c @@ -43,19 +43,28 @@ static inline void power_config(int slot) {} static inline void power_off(int slot) { - out_be32(PCMCIA_CTRL, 0); + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + + out_be32(addr, 0); } static inline void power_on_5_0(int slot) { + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + /* Enable 5V Vccout */ - out_be32(PCMCIA_CTRL, 2); + out_be32(addr, 2); } static inline void power_on_3_3(int slot) { + volatile unsigned __iomem *addr; + addr = (volatile unsigned __iomem *)PCMCIA_CTRL; + /* Enable 3.3V Vccout */ - out_be32(PCMCIA_CTRL, 1); + out_be32(addr, 1); } #else diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index f872cd8..a1ebd33 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -97,8 +97,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, pm = spibrg / (max_hz * 16 * 2); if (pm > 16) { pm = 16; - debug("Requested speed is too low: %d Hz, " - "%d Hz is used.\n", max_hz, spibrg / (32 * 16)); + debug("Requested speed is too low: %d Hz, %ld Hz " + "is used.\n", max_hz, spibrg / (32 * 16)); } } else pm = spibrg / (max_hz * 2); @@ -234,7 +234,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out, break; } - debug("spi_xfer: slave %u:%u dout %08X(%08x) din %08X(%08x) len %u\n", + debug("spi_xfer: slave %u:%u dout %08X(%p) din %08X(%p) len %u\n", slave->bus, slave->cs, *(uint *) dout, dout, *(uint *) din, din, len); diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index 54c4036..dfe542d 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -127,7 +127,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, unsigned int tmpdout, tmpdin; int tm, isread = 0; - debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", + debug("spi_xfer: slave %u:%u dout %p din %p bitlen %u\n", slave->bus, slave->cs, dout, din, bitlen); if (flags & SPI_XFER_BEGIN) @@ -163,7 +163,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, isread = 1; tmpdin = readl(&spireg->din); debug - ("spi_xfer: din %08x..%08x read\n", + ("spi_xfer: din %p..%08x read\n", din, tmpdin); if (din) { diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index 97f2729..7ee4f87 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -377,7 +377,7 @@ static int smsc95xx_write_hwaddr(struct eth_device *eth) /* set hardware address */ debug("** %s()\n", __func__); - addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr)); + addr_lo = cpu_to_le32(*eth->enetaddr); addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4))); ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); if (ret < 0) { diff --git a/drivers/video/bus_vcxk.c b/drivers/video/bus_vcxk.c index 67a59a7..7aecb92 100644 --- a/drivers/video/bus_vcxk.c +++ b/drivers/video/bus_vcxk.c @@ -164,7 +164,7 @@ int vcxk_init(unsigned long width, unsigned long height) #else #error CONFIG_SYS_VCXK_DEFAULT_LINEALIGN is invalid #endif - debug("linesize ((%d + 15) / 8 & ~0x1) = %d\n", + debug("linesize ((%ld + 15) / 8 & ~0x1) = %ld\n", display_width, display_bwidth); #ifdef CONFIG_SYS_VCXK_AUTODETECT diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 4e653b8..1863563 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1152,7 +1152,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y) colors = le32_to_cpu(bmp->header.colors_used); compression = le32_to_cpu(bmp->header.compression); - debug("Display-bmp: %d x %d with %d colors\n", + debug("Display-bmp: %ld x %ld with %d colors\n", width, height, colors); if (compression != BMP_BI_RGB diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 7cf173c..28baa54 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -46,7 +46,6 @@ static void downcase (char *str) static block_dev_desc_t *cur_dev = NULL; static unsigned long part_offset = 0; -static unsigned long part_size; static int cur_part = 1; @@ -100,7 +99,6 @@ int fat_register_device (block_dev_desc_t * dev_desc, int part_no) if (!get_partition_info(dev_desc, part_no, &info)) { part_offset = info.start; cur_part = part_no; - part_size = info.size; } else if ((strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3) == 0) || (strncmp((char *)&buffer[DOS_FS32_TYPE_OFFSET], "FAT32", 5) == 0)) { /* ok, we assume we are on a PBR only */ @@ -574,8 +572,8 @@ static dir_entry *get_dentfromdir (fsdata *mydata, int startsect, } if ((dentptr->attr & ATTR_VOLUME)) { #ifdef CONFIG_SUPPORT_VFAT - if ((dentptr->attr & ATTR_VFAT) && - (dentptr-> name[0] & LAST_LONG_ENTRY_MASK)) { + if ((dentptr->attr & ATTR_VFAT) == ATTR_VFAT && + (dentptr->name[0] & LAST_LONG_ENTRY_MASK)) { prevcksum = ((dir_slot *)dentptr)->alias_checksum; get_vfatname(mydata, curclust, get_dentfromdir_block, @@ -899,7 +897,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, } if ((dentptr->attr & ATTR_VOLUME)) { #ifdef CONFIG_SUPPORT_VFAT - if ((dentptr->attr & ATTR_VFAT) && + if ((dentptr->attr & ATTR_VFAT) == ATTR_VFAT && (dentptr->name[0] & LAST_LONG_ENTRY_MASK)) { prevcksum = ((dir_slot *)dentptr)->alias_checksum; diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c index c67a085..c4329af 100644 --- a/fs/yaffs2/yaffs_guts.c +++ b/fs/yaffs2/yaffs_guts.c @@ -78,8 +78,6 @@ static int yaffs_UpdateObjectHeader(yaffs_Object * in, const YCHAR * name, int force, int isShrink, int shadows); static void yaffs_RemoveObjectFromDirectory(yaffs_Object * obj); static int yaffs_CheckStructures(void); -static int yaffs_DeleteWorker(yaffs_Object * in, yaffs_Tnode * tn, __u32 level, - int chunkOffset, int *limit); static int yaffs_DoGenericObjectDeletion(yaffs_Object * in); static yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blockNo); @@ -595,55 +593,6 @@ static void yaffs_VerifyObjectHeader(yaffs_Object *obj, yaffs_ObjectHeader *oh, obj->objectId)); } - - -static int yaffs_VerifyTnodeWorker(yaffs_Object * obj, yaffs_Tnode * tn, - __u32 level, int chunkOffset) -{ - int i; - yaffs_Device *dev = obj->myDev; - int ok = 1; - - if (tn) { - if (level > 0) { - - for (i = 0; i < YAFFS_NTNODES_INTERNAL && ok; i++){ - if (tn->internal[i]) { - ok = yaffs_VerifyTnodeWorker(obj, - tn->internal[i], - level - 1, - (chunkOffset<<YAFFS_TNODES_INTERNAL_BITS) + i); - } - } - } else if (level == 0) { - int i; - yaffs_ExtendedTags tags; - __u32 objectId = obj->objectId; - - chunkOffset <<= YAFFS_TNODES_LEVEL0_BITS; - - for(i = 0; i < YAFFS_NTNODES_LEVEL0; i++){ - __u32 theChunk = yaffs_GetChunkGroupBase(dev,tn,i); - - if(theChunk > 0){ - /* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),tags.objectId,tags.chunkId,theChunk)); */ - yaffs_ReadChunkWithTagsFromNAND(dev,theChunk,NULL, &tags); - if(tags.objectId != objectId || tags.chunkId != chunkOffset){ - T(~0,(TSTR("Object %d chunkId %d NAND mismatch chunk %d tags (%d:%d)"TENDSTR), - objectId, chunkOffset, theChunk, - tags.objectId, tags.chunkId)); - } - } - chunkOffset++; - } - } - } - - return ok; - -} - - static void yaffs_VerifyFile(yaffs_Object *obj) { int requiredTallness; @@ -1546,104 +1495,6 @@ static int yaffs_FindChunkInGroup(yaffs_Device * dev, int theChunk, return -1; } - -/* DeleteWorker scans backwards through the tnode tree and deletes all the - * chunks and tnodes in the file - * Returns 1 if the tree was deleted. - * Returns 0 if it stopped early due to hitting the limit and the delete is incomplete. - */ - -static int yaffs_DeleteWorker(yaffs_Object * in, yaffs_Tnode * tn, __u32 level, - int chunkOffset, int *limit) -{ - int i; - int chunkInInode; - int theChunk; - yaffs_ExtendedTags tags; - int foundChunk; - yaffs_Device *dev = in->myDev; - - int allDone = 1; - - if (tn) { - if (level > 0) { - - for (i = YAFFS_NTNODES_INTERNAL - 1; allDone && i >= 0; - i--) { - if (tn->internal[i]) { - if (limit && (*limit) < 0) { - allDone = 0; - } else { - allDone = - yaffs_DeleteWorker(in, - tn-> - internal - [i], - level - - 1, - (chunkOffset - << - YAFFS_TNODES_INTERNAL_BITS) - + i, - limit); - } - if (allDone) { - yaffs_FreeTnode(dev, - tn-> - internal[i]); - tn->internal[i] = NULL; - } - } - - } - return (allDone) ? 1 : 0; - } else if (level == 0) { - int hitLimit = 0; - - for (i = YAFFS_NTNODES_LEVEL0 - 1; i >= 0 && !hitLimit; - i--) { - theChunk = yaffs_GetChunkGroupBase(dev,tn,i); - if (theChunk) { - - chunkInInode = - (chunkOffset << - YAFFS_TNODES_LEVEL0_BITS) + i; - - foundChunk = - yaffs_FindChunkInGroup(dev, - theChunk, - &tags, - in->objectId, - chunkInInode); - - if (foundChunk > 0) { - yaffs_DeleteChunk(dev, - foundChunk, 1, - __LINE__); - in->nDataChunks--; - if (limit) { - *limit = *limit - 1; - if (*limit <= 0) { - hitLimit = 1; - } - } - - } - - yaffs_PutLevel0Tnode(dev,tn,i,0); - } - - } - return (i < 0) ? 1 : 0; - - } - - } - - return 1; - -} - static void yaffs_SoftDeleteChunk(yaffs_Device * dev, int chunk) { @@ -4605,8 +4456,8 @@ int yaffs_ReadDataFromFile(yaffs_Object * in, __u8 * buffer, loff_t offset, int nBytes) { - __u32 chunk; - __u32 start; + __u32 chunk = 0; + __u32 start = 0; int nToCopy; int n = nBytes; int nDone = 0; @@ -4725,8 +4576,8 @@ int yaffs_WriteDataToFile(yaffs_Object * in, const __u8 * buffer, loff_t offset, int nBytes, int writeThrough) { - __u32 chunk; - __u32 start; + __u32 chunk = 0; + __u32 start = 0; int nToCopy; int n = nBytes; int nDone = 0; @@ -4960,8 +4811,8 @@ int yaffs_ResizeFile(yaffs_Object * in, loff_t newSize) { int oldFileSize = in->variant.fileVariant.fileSize; - __u32 newSizeOfPartialChunk; - __u32 newFullChunks; + __u32 newSizeOfPartialChunk = 0; + __u32 newFullChunks = 0; yaffs_Device *dev = in->myDev; diff --git a/include/common.h b/include/common.h index fb41d7a..5ca8820 100644 --- a/include/common.h +++ b/include/common.h @@ -116,21 +116,27 @@ typedef volatile unsigned char vu_char; #include <flash.h> #include <image.h> -#ifdef DEBUG -#define debug(fmt,args...) printf (fmt ,##args) -#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); -#else -#define debug(fmt,args...) -#define debugX(level,fmt,args...) -#endif /* DEBUG */ - #ifdef DEBUG -# define _DEBUG 1 +#define _DEBUG 1 #else -# define _DEBUG 0 +#define _DEBUG 0 #endif /* + * Output a debug text when condition "cond" is met. The "cond" should be + * computed by a preprocessor in the best case, allowing for the best + * optimization. + */ +#define debug_cond(cond, fmt, args...) \ + do { \ + if (cond) \ + printf(fmt, ##args); \ + } while (0) + +#define debug(fmt, args...) \ + debug_cond(_DEBUG, fmt, ##args) + +/* * An assertion is run-time check done in debug mode only. If DEBUG is not * defined then it is skipped. If DEBUG is defined and the assertion fails, * then it calls panic*( which may or may not reset/halt U-Boot (see diff --git a/include/configs/PCIPPC2.h b/include/configs/PCIPPC2.h index fb485b0..77cedc0 100644 --- a/include/configs/PCIPPC2.h +++ b/include/configs/PCIPPC2.h @@ -55,6 +55,10 @@ #define CONFIG_PREBOOT "" #define CONFIG_BOOTDELAY 5 +#ifndef __ASSEMBLY__ +#include <galileo/core.h> +#endif + /* * BOOTP options */ diff --git a/include/configs/PCIPPC6.h b/include/configs/PCIPPC6.h index 16d6450..a8d20ca 100644 --- a/include/configs/PCIPPC6.h +++ b/include/configs/PCIPPC6.h @@ -55,6 +55,10 @@ #define CONFIG_PREBOOT "" #define CONFIG_BOOTDELAY 5 +#ifndef __ASSEMBLY__ +#include <galileo/core.h> +#endif + /* * BOOTP options */ diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h index 183045b..8b8113d 100644 --- a/include/configs/VCMA9.h +++ b/include/configs/VCMA9.h @@ -76,7 +76,7 @@ #define CONFIG_CMD_BSP #define CONFIG_CMD_NAND -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_SYS_HUSH_PARSER #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " diff --git a/include/configs/cerf250.h b/include/configs/cerf250.h index be325e8..70427da 100644 --- a/include/configs/cerf250.h +++ b/include/configs/cerf250.h @@ -36,7 +36,7 @@ */ #define CONFIG_PXA250 1 /* This is an PXA250 CPU */ #define CONFIG_CERF250 1 /* on Cerf PXA Board */ -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_BAUDRATE 38400 #define CONFIG_SYS_TEXT_BASE 0x0 diff --git a/include/configs/colibri_pxa270.h b/include/configs/colibri_pxa270.h index 011731b..8a3446e 100644 --- a/include/configs/colibri_pxa270.h +++ b/include/configs/colibri_pxa270.h @@ -28,7 +28,7 @@ #define CONFIG_PXA27X 1 /* Marvell PXA270 CPU */ #define CONFIG_VPAC270 1 /* Toradex Colibri PXA270 board */ -#undef BOARD_LATE_INIT +#undef CONFIG_BOARD_LATE_INIT #undef CONFIG_USE_IRQ #undef CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/efikamx.h b/include/configs/efikamx.h index 7e4b424..b507786 100644 --- a/include/configs/efikamx.h +++ b/include/configs/efikamx.h @@ -79,7 +79,7 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) #define CONFIG_BOARD_EARLY_INIT_F -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT /* * Hardware drivers diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h index 48bd50b..f4bfee4 100644 --- a/include/configs/imx31_phycore.h +++ b/include/configs/imx31_phycore.h @@ -192,7 +192,7 @@ /* EET platform additions */ #ifdef CONFIG_IMX31_PHYCORE_EET -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_MXC_GPIO diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h index 20e1087..a239efc 100644 --- a/include/configs/jadecpu.h +++ b/include/configs/jadecpu.h @@ -51,7 +51,7 @@ #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS 1 #define CONFIG_INITRD_TAG 1 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT /* * Compressions diff --git a/include/configs/lubbock.h b/include/configs/lubbock.h index bbdae3c..90c5bf8 100644 --- a/include/configs/lubbock.h +++ b/include/configs/lubbock.h @@ -41,7 +41,7 @@ #define CONFIG_SHARP_LM8V31 #endif #define CONFIG_MMC -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_DOS_PARTITION #define CONFIG_SYS_TEXT_BASE 0x0 #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 09ff7c4..6b3fd76 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -68,6 +68,10 @@ # define CONFIG_XILINX_LL_TEMAC 1 # define CONFIG_SYS_ENET #endif +#if defined(XILINX_AXIEMAC_BASEADDR) +# define CONFIG_XILINX_AXIEMAC 1 +# define CONFIG_SYS_ENET +#endif #undef ET_DEBUG diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h index 61d758e..3e73775 100644 --- a/include/configs/mpc7448hpc2.h +++ b/include/configs/mpc7448hpc2.h @@ -54,6 +54,10 @@ #undef CONFIG_ECC /* disable ECC support */ +#ifndef __ASSEMBLY__ +#include <galileo/core.h> +#endif + /* Board-specific Initialization Functions to be called */ #define CONFIG_SYS_BOARD_ASM_INIT #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/ms7750se.h b/include/configs/ms7750se.h index 16fb0d4..03f52f3 100644 --- a/include/configs/ms7750se.h +++ b/include/configs/ms7750se.h @@ -45,7 +45,7 @@ #define CONFIG_SCIF_CONSOLE 1 #define CONFIG_BAUDRATE 38400 #define CONFIG_CONS_SCIF1 1 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_BOOTDELAY -1 #define CONFIG_BOOTARGS "console=ttySC0,38400" diff --git a/include/configs/mx1ads.h b/include/configs/mx1ads.h index 0643312..9c1b255 100644 --- a/include/configs/mx1ads.h +++ b/include/configs/mx1ads.h @@ -45,7 +45,7 @@ /* #define _CONFIG_UART2 */ /* internal uart 2 */ /* #define CONFIG_SILENT_CONSOLE */ /* use this to disable output */ -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define USE_920T_MMU 1 #if 0 diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h index b72f30b..2e5cde5 100644 --- a/include/configs/mx31pdk.h +++ b/include/configs/mx31pdk.h @@ -106,7 +106,7 @@ */ #undef CONFIG_CMD_IMLS -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_BOOTDELAY 3 diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h index 1707b4d..79bae56 100644 --- a/include/configs/mx35pdk.h +++ b/include/configs/mx35pdk.h @@ -42,7 +42,7 @@ #define CONFIG_SYS_64BIT_VSPRINTF #define CONFIG_BOARD_EARLY_INIT_F -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ #define CONFIG_REVISION_TAG diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index 0d4ceb3..028a842 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -54,7 +54,7 @@ */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT /* * Hardware drivers diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h index 97ae2f2..4703248 100644 --- a/include/configs/mx53evk.h +++ b/include/configs/mx53evk.h @@ -44,7 +44,7 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) #define CONFIG_BOARD_EARLY_INIT_F -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_MXC_GPIO #define CONFIG_MXC_UART diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h index 13d1e66..20db397 100644 --- a/include/configs/nhk8815.h +++ b/include/configs/nhk8815.h @@ -96,7 +96,7 @@ #define CONFIG_SYS_MEMTEST_END 0x0FFFFFFF #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 256 * 1024) -#define BOARD_LATE_INIT /* call board_late_init during start up */ +#define CONFIG_BOARD_LATE_INIT /* call board_late_init during start up */ /* timing informazion */ #define CONFIG_SYS_HZ 1000 /* Mandatory... */ diff --git a/include/configs/p3mx.h b/include/configs/p3mx.h index 94a6992..e44009e 100644 --- a/include/configs/p3mx.h +++ b/include/configs/p3mx.h @@ -447,4 +447,8 @@ #define L2_ENABLE (L2_INIT | L2CR_L2E) +#ifndef __ASSEMBLY__ +#include <../board/Marvell/include/core.h> +#endif + #endif /* __CONFIG_H */ diff --git a/include/configs/pleb2.h b/include/configs/pleb2.h index 7dd6246..2aeb7fb 100644 --- a/include/configs/pleb2.h +++ b/include/configs/pleb2.h @@ -38,7 +38,7 @@ #define CONFIG_PLEB2 1 /* on an PLEB2 Board */ #undef CONFIG_LCD #undef CONFIG_MMC -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_SYS_TEXT_BASE 0x0 #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ diff --git a/include/configs/ppmc7xx.h b/include/configs/ppmc7xx.h index d3c8990..4ceee17 100644 --- a/include/configs/ppmc7xx.h +++ b/include/configs/ppmc7xx.h @@ -51,6 +51,10 @@ #define CONFIG_SYS_TEXT_BASE 0xFFF00000 +#ifndef __ASSEMBLY__ +#include <galileo/core.h> +#endif + /* * Monitor configuration * diff --git a/include/configs/pxa255_idp.h b/include/configs/pxa255_idp.h index cd95081..620d270 100644 --- a/include/configs/pxa255_idp.h +++ b/include/configs/pxa255_idp.h @@ -64,7 +64,7 @@ #define CONFIG_MMC 1 #define CONFIG_DOS_PARTITION 1 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ diff --git a/include/configs/qong.h b/include/configs/qong.h index f2a1e01..c61a9b3 100644 --- a/include/configs/qong.h +++ b/include/configs/qong.h @@ -138,7 +138,7 @@ #define CONFIG_CMD_SETEXPR #define CONFIG_CMD_SPI -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_BOOTDELAY 5 diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h index a7a92f7..0ce3fa8 100644 --- a/include/configs/r2dplus.h +++ b/include/configs/r2dplus.h @@ -30,7 +30,7 @@ #define CONFIG_SCIF_CONSOLE 1 #define CONFIG_BAUDRATE 115200 #define CONFIG_CONS_SCIF1 1 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_BOOTDELAY -1 #define CONFIG_BOOTARGS "console=ttySC0,115200" diff --git a/include/configs/sh7757lcr.h b/include/configs/sh7757lcr.h index 4a5fd0d..2d6eb33 100644 --- a/include/configs/sh7757lcr.h +++ b/include/configs/sh7757lcr.h @@ -107,7 +107,7 @@ #define SH7757LCR_ETHERNET_MAC_BASE SH7757LCR_ETHERNET_MAC_BASE_SPI #define SH7757LCR_ETHERNET_MAC_SIZE 17 #define SH7757LCR_ETHERNET_NUM_CH 2 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT /* Gigabit Ether */ #define SH7757LCR_GIGA_ETHERNET_NUM_CH 2 diff --git a/include/configs/trizepsiv.h b/include/configs/trizepsiv.h index 6ec9b80..2d55044 100644 --- a/include/configs/trizepsiv.h +++ b/include/configs/trizepsiv.h @@ -43,7 +43,7 @@ #define CONFIG_PXA27X 1 /* This is an PXA27x CPU */ #define CONFIG_MMC 1 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #define CONFIG_SYS_TEXT_BASE 0x0 #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ diff --git a/include/configs/tx25.h b/include/configs/tx25.h index 6380bb8..8cb57ff 100644 --- a/include/configs/tx25.h +++ b/include/configs/tx25.h @@ -137,7 +137,7 @@ #define CONFIG_FEC_MXC_PHYADDR 0x1f #define CONFIG_MII #define CONFIG_CMD_NET -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_ENV_OVERWRITE #define CONFIG_BOOTDELAY 5 diff --git a/include/configs/u8500_href.h b/include/configs/u8500_href.h index 636922c..4747fbd 100644 --- a/include/configs/u8500_href.h +++ b/include/configs/u8500_href.h @@ -35,7 +35,7 @@ #define CONFIG_SYS_HZ 1000 /* must be 1000 */ #define CONFIG_BOARD_EARLY_INIT_F -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT /* * Size of malloc() pool diff --git a/include/configs/vision2.h b/include/configs/vision2.h index a2a9f3f..bee9e97 100644 --- a/include/configs/vision2.h +++ b/include/configs/vision2.h @@ -39,7 +39,7 @@ #define CONFIG_REVISION_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT #define CONFIG_MACH_TYPE MACH_TYPE_TTC_VISION2 diff --git a/include/configs/xaeniax.h b/include/configs/xaeniax.h index 8a41416..6dce8ae 100644 --- a/include/configs/xaeniax.h +++ b/include/configs/xaeniax.h @@ -45,7 +45,7 @@ #define CONFIG_SYS_TEXT_BASE 0x0 -#define BOARD_LATE_INIT 1 +#define CONFIG_BOARD_LATE_INIT #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h index ade40b5..9505007 100644 --- a/include/configs/zipitz2.h +++ b/include/configs/zipitz2.h @@ -29,7 +29,7 @@ #define CONFIG_ZIPITZ2 1 /* Zipit Z2 board */ #define CONFIG_SYS_TEXT_BASE 0x0 -#undef BOARD_LATE_INIT +#undef CONFIG_BOARD_LATE_INIT #undef CONFIG_USE_IRQ #undef CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/zmx25.h b/include/configs/zmx25.h index 0d5ee14..9a7a27a 100644 --- a/include/configs/zmx25.h +++ b/include/configs/zmx25.h @@ -46,7 +46,7 @@ #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG -#define BOARD_LATE_INIT +#define CONFIG_BOARD_LATE_INIT /* * Compressions diff --git a/include/i2c.h b/include/i2c.h index 8ceb4c8..ee31034 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -46,16 +46,16 @@ */ #define I2C_RXTX_LEN 128 /* maximum tx/rx buffer length */ -#if defined(CONFIG_I2C_MULTI_BUS) -#if !defined(CONFIG_SYS_MAX_I2C_BUS) -#define CONFIG_SYS_MAX_I2C_BUS 2 -#endif -#define I2C_GET_BUS() i2c_get_bus_num() -#define I2C_SET_BUS(a) i2c_set_bus_num(a) +#ifdef CONFIG_I2C_MULTI_BUS +#define MAX_I2C_BUS 2 +#define I2C_MULTI_BUS 1 #else -#define CONFIG_SYS_MAX_I2C_BUS 1 -#define I2C_GET_BUS() 0 -#define I2C_SET_BUS(a) +#define MAX_I2C_BUS 1 +#define I2C_MULTI_BUS 0 +#endif + +#if !defined(CONFIG_SYS_MAX_I2C_BUS) +#define CONFIG_SYS_MAX_I2C_BUS MAX_I2C_BUS #endif /* define the I2C bus number for RTC and DTT if not already done */ @@ -236,4 +236,18 @@ int i2c_set_bus_speed(unsigned int); unsigned int i2c_get_bus_speed(void); +/* NOTE: These two functions MUST be always_inline to avoid code growth! */ +static inline unsigned int I2C_GET_BUS(void) __attribute__((always_inline)); +static inline unsigned int I2C_GET_BUS(void) +{ + return I2C_MULTI_BUS ? i2c_get_bus_num() : 0; +} + +static inline void I2C_SET_BUS(unsigned int bus) __attribute__((always_inline)); +static inline void I2C_SET_BUS(unsigned int bus) +{ + if (I2C_MULTI_BUS) + i2c_set_bus_num(bus); +} + #endif /* _I2C_H_ */ diff --git a/include/image.h b/include/image.h index 1ba866e..c56a18d 100644 --- a/include/image.h +++ b/include/image.h @@ -615,7 +615,7 @@ void fit_conf_print(const void *fit, int noffset, const char *p); #ifndef USE_HOSTCC static inline int fit_image_check_target_arch(const void *fdt, int node) { - return !fit_image_check_arch(fdt, node, IH_ARCH_DEFAULT); + return fit_image_check_arch(fdt, node, IH_ARCH_DEFAULT); } #endif /* USE_HOSTCC */ diff --git a/include/lcd.h b/include/lcd.h index 0e098d9..89cc90c 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -159,8 +159,8 @@ typedef struct vidinfo { #elif defined(CONFIG_ATMEL_LCD) typedef struct vidinfo { - u_long vl_col; /* Number of columns (i.e. 640) */ - u_long vl_row; /* Number of rows (i.e. 480) */ + ushort vl_col; /* Number of columns (i.e. 640) */ + ushort vl_row; /* Number of rows (i.e. 480) */ u_long vl_clk; /* pixel clock in ps */ /* LCD configuration register */ diff --git a/include/net.h b/include/net.h index b408dea..ad9afbf 100644 --- a/include/net.h +++ b/include/net.h @@ -430,6 +430,12 @@ extern int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, i extern void NetReceive(volatile uchar *, int); /* + * Check if autoload is enabled. If so, use either NFS or TFTP to download + * the boot file. + */ +void net_auto_load(void); + +/* * The following functions are a bit ugly, but necessary to deal with * alignment restrictions on ARM. * diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c index 8860bfb..2eafad2 100644 --- a/lib/lzma/LzmaTools.c +++ b/lib/lzma/LzmaTools.c @@ -67,11 +67,11 @@ int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, ELzmaStatus state; SizeT compressedSize = (SizeT)(length - LZMA_PROPS_SIZE); - debug ("LZMA: Image address............... 0x%lx\n", inStream); - debug ("LZMA: Properties address.......... 0x%lx\n", inStream + LZMA_PROPERTIES_OFFSET); - debug ("LZMA: Uncompressed size address... 0x%lx\n", inStream + LZMA_SIZE_OFFSET); - debug ("LZMA: Compressed data address..... 0x%lx\n", inStream + LZMA_DATA_OFFSET); - debug ("LZMA: Destination address......... 0x%lx\n", outStream); + debug ("LZMA: Image address............... 0x%p\n", inStream); + debug ("LZMA: Properties address.......... 0x%p\n", inStream + LZMA_PROPERTIES_OFFSET); + debug ("LZMA: Uncompressed size address... 0x%p\n", inStream + LZMA_SIZE_OFFSET); + debug ("LZMA: Compressed data address..... 0x%p\n", inStream + LZMA_DATA_OFFSET); + debug ("LZMA: Destination address......... 0x%p\n", outStream); memset(&state, 0, sizeof(state)); @@ -107,8 +107,8 @@ int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, } } - debug ("LZMA: Uncompresed size............ 0x%lx\n", outSizeFull); - debug ("LZMA: Compresed size.............. 0x%lx\n", compressedSize); + debug ("LZMA: Uncompresed size............ 0x%x\n", outSizeFull); + debug ("LZMA: Compresed size.............. 0x%x\n", compressedSize); g_Alloc.Alloc = SzAlloc; g_Alloc.Free = SzFree; diff --git a/net/bootp.c b/net/bootp.c index b703f42..b789eec 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -138,36 +138,6 @@ static int truncate_sz (const char *name, int maxlen, int curlen) return (curlen); } -/* - * Check if autoload is enabled. If so, use either NFS or TFTP to download - * the boot file. - */ -static void auto_load(void) -{ - const char *s = getenv("autoload"); - - if (s != NULL) { - if (*s == 'n') { - /* - * Just use BOOTP to configure system; - * Do not use TFTP to load the bootfile. - */ - NetState = NETLOOP_SUCCESS; - return; - } -#if defined(CONFIG_CMD_NFS) - if (strcmp(s, "NFS") == 0) { - /* - * Use NFS to load the bootfile. - */ - NfsStart(); - return; - } -#endif - } - TftpStart(TFTPGET); -} - #if !defined(CONFIG_CMD_DHCP) static void BootpVendorFieldProcess (u8 * ext) @@ -354,7 +324,7 @@ BootpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, debug("Got good BOOTP\n"); - auto_load(); + net_auto_load(); } #endif @@ -979,7 +949,7 @@ DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, dhcp_state = BOUND; printf ("DHCP client bound to address %pI4\n", &NetOurIP); - auto_load(); + net_auto_load(); return; } break; @@ -215,7 +215,9 @@ volatile uchar *NetRxPackets[PKTBUFSRX]; /* Current RX packet handler */ static rxhand_f *packetHandler; +#ifdef CONFIG_CMD_TFTPPUT static rxhand_icmp_f *packet_icmp_handler; /* Current ICMP rx handler */ +#endif /* Current timeout handler */ static thand_f *timeHandler; /* Time base value */ @@ -244,7 +246,6 @@ int NetArpWaitTry; void ArpRequest(void) { - int i; volatile uchar *pkt; ARP_t *arp; @@ -266,11 +267,8 @@ void ArpRequest(void) memcpy(&arp->ar_data[0], NetOurEther, 6); /* source IP addr */ NetWriteIP((uchar *) &arp->ar_data[6], NetOurIP); - for (i = 10; i < 16; ++i) { - /* dest ET addr = 0 */ - arp->ar_data[i] = 0; - } - + /* dest ET addr = 0 */ + memset(&arp->ar_data[10], '\0', 6); if ((NetArpWaitPacketIP & NetOurSubnetMask) != (NetOurIP & NetOurSubnetMask)) { if (NetOurGatewayIP == 0) { @@ -311,6 +309,36 @@ void ArpTimeoutCheck(void) } } +/* + * Check if autoload is enabled. If so, use either NFS or TFTP to download + * the boot file. + */ +void net_auto_load(void) +{ + const char *s = getenv("autoload"); + + if (s != NULL) { + if (*s == 'n') { + /* + * Just use BOOTP/RARP to configure system; + * Do not use TFTP to load the bootfile. + */ + NetState = NETLOOP_SUCCESS; + return; + } +#if defined(CONFIG_CMD_NFS) + if (strcmp(s, "NFS") == 0) { + /* + * Use NFS to load the bootfile. + */ + NfsStart(); + return; + } +#endif + } + TftpStart(TFTPGET); +} + static void NetInitLoop(enum proto_t protocol) { static int env_changed_id; @@ -576,9 +604,11 @@ restart: } done: +#ifdef CONFIG_CMD_TFTPPUT /* Clear out the handlers */ NetSetHandler(NULL); net_set_icmp_handler(NULL); +#endif return ret; } @@ -653,10 +683,12 @@ NetSetHandler(rxhand_f *f) packetHandler = f; } +#ifdef CONFIG_CMD_TFTPPUT void net_set_icmp_handler(rxhand_icmp_f *f) { packet_icmp_handler = f; } +#endif void NetSetTimeout(ulong iv, thand_f *f) @@ -1397,10 +1429,12 @@ static void receive_icmp(IP_t *ip, int len, IPaddr_t src_ip, Ethernet_t *et) break; #endif default: +#ifdef CONFIG_CMD_TFTPPUT if (packet_icmp_handler) packet_icmp_handler(icmph->type, icmph->code, ntohs(ip->udp_dst), src_ip, ntohs(ip->udp_src), icmph->un.data, ntohs(ip->udp_len)); +#endif break; } } @@ -46,24 +46,8 @@ static void RarpHandler(uchar *dummi0, unsigned dummi1, IPaddr_t sip, unsigned dummi2, unsigned dummi3) { - char *s; debug("Got good RARP\n"); - if ((s = getenv("autoload")) != NULL) { - if (*s == 'n') { - /* - * Just use RARP to configure system; - * Do not use TFTP/NFS to to load the bootfile. - */ - NetState = NETLOOP_SUCCESS; - return; -#if defined(CONFIG_CMD_NFS) - } else if ((s != NULL) && !strcmp(s, "NFS")) { - NfsStart(); - return; -#endif - } - } - TftpStart (); + net_auto_load(); } @@ -198,7 +198,7 @@ store_block(unsigned block, uchar *src, unsigned len) } /* Clear our state ready for a new transfer */ -void new_transfer(void) +static void new_transfer(void) { TftpLastBlock = 0; TftpBlockWrap = 0; @@ -332,8 +332,12 @@ TftpSend(void) case STATE_SEND_WRQ: xp = pkt; s = (ushort *)pkt; +#ifdef CONFIG_CMD_TFTPPUT *s++ = htons(TftpState == STATE_SEND_RRQ ? TFTP_RRQ : TFTP_WRQ); +#else + *s++ = htons(TFTP_RRQ); +#endif pkt = (uchar *)s; strcpy((char *)pkt, tftp_filename); pkt += strlen(tftp_filename) + 1; @@ -421,7 +425,7 @@ TftpSend(void) TftpOurPort, len); } - +#ifdef CONFIG_CMD_TFTPPUT static void icmp_handler(unsigned type, unsigned code, unsigned dest, IPaddr_t sip, unsigned src, uchar *pkt, unsigned len) { @@ -430,6 +434,7 @@ static void icmp_handler(unsigned type, unsigned code, unsigned dest, restart("TFTP server died"); } } +#endif static void TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, @@ -729,7 +734,12 @@ void TftpStart(enum proto_t protocol) printf("Using %s device\n", eth_get_name()); printf("TFTP %s server %pI4; our IP address is %pI4", - protocol == TFTPPUT ? "to" : "from", &TftpRemoteIP, &NetOurIP); +#ifdef CONFIG_CMD_TFTPPUT + protocol == TFTPPUT ? "to" : "from", +#else + "from", +#endif + &TftpRemoteIP, &NetOurIP); /* Check if we need to send across this subnet */ if (NetOurGatewayIP && NetOurSubnetMask) { @@ -771,8 +781,9 @@ void TftpStart(enum proto_t protocol) NetSetTimeout(TftpTimeoutMSecs, TftpTimeout); NetSetHandler(TftpHandler); +#ifdef CONFIG_CMD_TFTPPUT net_set_icmp_handler(icmp_handler); - +#endif TftpRemotePort = WELL_KNOWN_PORT; TftpTimeoutCount = 0; /* Use a pseudo-random port unless a specific port is set */ |