]> git.sur5r.net Git - u-boot/commitdiff
Merge git://git.denx.de/u-boot-x86
authorTom Rini <trini@ti.com>
Mon, 24 Nov 2014 17:00:00 +0000 (12:00 -0500)
committerTom Rini <trini@ti.com>
Mon, 24 Nov 2014 17:00:00 +0000 (12:00 -0500)
Conflicts:
arch/x86/cpu/Makefile

Signed-off-by: Tom Rini <trini@ti.com>
216 files changed:
Kconfig
Makefile
README
arch/arm/Kconfig
arch/arm/cpu/arm1136/Makefile
arch/arm/cpu/arm1176/Makefile
arch/arm/cpu/arm1176/tnetv107x/clock.c
arch/arm/cpu/arm720t/Makefile
arch/arm/cpu/arm920t/Makefile
arch/arm/cpu/arm926ejs/Makefile
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
arch/arm/cpu/armv7/Makefile
arch/arm/cpu/armv7/bcm281xx/clk-core.h
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/exynos/spl_boot.c
arch/arm/cpu/armv7/omap-common/abb.c
arch/arm/cpu/armv7/tegra114/Makefile [deleted file]
arch/arm/cpu/armv7/tegra124/Makefile [deleted file]
arch/arm/cpu/armv7/tegra20/display.c
arch/arm/cpu/armv7/tegra30/Makefile [deleted file]
arch/arm/cpu/armv8/Makefile
arch/arm/include/asm/arch-armada100/config.h
arch/arm/include/asm/arch-at91/at91rm9200.h
arch/arm/include/asm/arch-at91/at91sam9260.h
arch/arm/include/asm/arch-at91/at91sam9261.h
arch/arm/include/asm/arch-at91/at91sam9263.h
arch/arm/include/asm/arch-at91/at91sam9g45.h
arch/arm/include/asm/arch-at91/at91sam9rl.h
arch/arm/include/asm/arch-at91/at91sam9x5.h
arch/arm/include/asm/arch-at91/sama5d3.h
arch/arm/include/asm/arch-kirkwood/config.h
arch/arm/include/asm/arch-lpc32xx/config.h
arch/arm/include/asm/arch-pantheon/config.h
arch/arm/lib/cache.c
arch/avr32/cpu/Makefile
arch/avr32/cpu/at32ap700x/clk.c
arch/blackfin/cpu/jtag-console.c
arch/blackfin/lib/string.c
arch/mips/cpu/mips32/Makefile
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
arch/nds32/cpu/n1213/Makefile
arch/powerpc/cpu/mpc5xxx/usb_ohci.c
arch/powerpc/cpu/mpc85xx/tlb.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
arch/powerpc/cpu/ppc4xx/usb_ohci.c
arch/powerpc/lib/bootm.c
arch/sandbox/cpu/os.c
arch/sandbox/cpu/start.c
arch/sandbox/cpu/state.c
arch/x86/cpu/Makefile
arch/x86/cpu/coreboot/pci.c
arch/x86/cpu/coreboot/sdram.c
board/broadcom/bcm11130/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm11130_nand/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm911360_entphn-ns/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm911360_entphn/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm911360k/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm958300k-ns/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm958300k/Kconfig [deleted file]
board/broadcom/bcm958300k/MAINTAINERS
board/broadcom/bcm958305k/MAINTAINERS [new file with mode: 0644]
board/broadcom/bcm958622hr/Kconfig [deleted file]
board/broadcom/bcm958622hr/MAINTAINERS
board/broadcom/bcm_ep/board.c
board/broadcom/bcmcygnus/Kconfig [new file with mode: 0644]
board/broadcom/bcmnsp/Kconfig [new file with mode: 0644]
board/davinci/da8xxevm/u-boot-spl-hawk.lds
board/esd/common/auto_update.c
board/freescale/common/sys_eeprom.c
board/gdsys/p1022/controlcenterd-id.c
board/imgtec/malta/malta.c
common/Kconfig
common/Makefile
common/board_f.c
common/cmd_elf.c
common/cmd_ext4.c
common/cmd_fat.c
common/cmd_fs.c
common/cmd_fs_uuid.c [new file with mode: 0644]
common/cmd_md5sum.c
common/cmd_pci.c
common/cmd_sf.c
common/env_fat.c
common/env_nand.c
common/fdt_support.c
common/lcd.c
common/spl/spl.c
common/spl/spl_ext.c
common/usb_hub.c
configs/bcm11130_defconfig [new file with mode: 0644]
configs/bcm11130_nand_defconfig [new file with mode: 0644]
configs/bcm911360_entphn-ns_defconfig [new file with mode: 0644]
configs/bcm911360_entphn_defconfig [new file with mode: 0644]
configs/bcm911360k_defconfig [new file with mode: 0644]
configs/bcm958300k-ns_defconfig [new file with mode: 0644]
configs/bcm958300k_defconfig
configs/bcm958305k_defconfig [new file with mode: 0644]
configs/bcm958622hr_defconfig
drivers/block/ahci.c
drivers/block/sata_sil.c
drivers/ddr/fsl/ctrl_regs.c
drivers/ddr/fsl/lc_common_dimm_params.c
drivers/ddr/fsl/main.c
drivers/dfu/dfu.c
drivers/fpga/zynqpl.c
drivers/i2c/fsl_i2c.c
drivers/misc/cros_ec_spi.c
drivers/misc/mxc_ocotp.c
drivers/mmc/fsl_esdhc.c
drivers/mmc/pxa_mmc_gen.c
drivers/mtd/nand/denali_spl.c
drivers/mtd/spi/sandbox.c
drivers/mtd/spi/sf_ops.c
drivers/net/netconsole.c
drivers/pci/pci.c
drivers/pci/pci_auto.c
drivers/serial/usbtty.c
drivers/spi/fsl_espi.c
drivers/spi/mxc_spi.c
drivers/spi/spi-uclass.c
drivers/tpm/tpm_tis_lpc.c
drivers/usb/gadget/composite.c
drivers/usb/gadget/designware_udc.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
drivers/usb/host/dwc2.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-s3c24xx.c
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/musb/musb_hcd.h
drivers/video/ati_radeon_fb.c
drivers/video/cfb_console.c
fs/ext4/dev.c
fs/ext4/ext4_common.c
fs/ext4/ext4_common.h
fs/ext4/ext4_write.c
fs/ext4/ext4fs.c
fs/fat/fat.c
fs/fat/fat_write.c
fs/fat/file.c
fs/fs.c
fs/sandbox/sandboxfs.c
fs/ubifs/ubifs.h
include/common.h
include/configs/T1040QDS.h
include/configs/T104xRDB.h
include/configs/T208xQDS.h
include/configs/T208xRDB.h
include/configs/VCMA9.h
include/configs/apf27.h
include/configs/armadillo-800eva.h
include/configs/bcm28155_ap.h
include/configs/bcm_ep_board.h
include/configs/calimain.h
include/configs/cam_enc_4xx.h
include/configs/cpuat91.h
include/configs/da830evm.h
include/configs/da850evm.h
include/configs/davinci_dm355evm.h
include/configs/davinci_dm355leopard.h
include/configs/davinci_dm365evm.h
include/configs/davinci_dm6467evm.h
include/configs/davinci_dvevm.h
include/configs/davinci_schmoogie.h
include/configs/davinci_sffsdr.h
include/configs/davinci_sonata.h
include/configs/ea20.h
include/configs/edb93xx.h
include/configs/edminiv2.h
include/configs/enbw_cmc.h
include/configs/flea3.h
include/configs/hawkboard.h
include/configs/ids8313.h
include/configs/imx27lite-common.h
include/configs/imx31_litekit.h
include/configs/imx31_phycore.h
include/configs/ipam390.h
include/configs/jadecpu.h
include/configs/ks2_evm.h
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h
include/configs/mx31ads.h
include/configs/mx31pdk.h
include/configs/mx35pdk.h
include/configs/nhk8815.h
include/configs/omap3_mvblx.h
include/configs/qong.h
include/configs/rpi_b.h
include/configs/sandbox.h
include/configs/scb9328.h
include/configs/smdk2410.h
include/configs/socfpga_common.h
include/configs/tao3530.h
include/configs/tnetv107x_evm.h
include/configs/tt01.h
include/configs/udoo.h
include/configs/versatile.h
include/configs/woodburn_common.h
include/configs/zmx25.h
include/configs/zynq-common.h
include/ext4fs.h
include/fat.h
include/fs.h
include/linux/compat.h
include/linux/kernel.h [new file with mode: 0644]
include/os.h
include/pci.h
include/sandboxfs.h
lib/strmhz.c
lib/vsprintf.c
scripts/Makefile.spl
test/fs/fs-test.sh [new file with mode: 0755]

diff --git a/Kconfig b/Kconfig
index f34f341dd72777151faeacb76d70e8e838c702ee..9b16d665f245178fa63fe3a16bc3d5b9c4defed2 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -93,6 +93,28 @@ config TPL
        help
          If you want to build TPL as well as the normal image and SPL, say Y.
 
+config FIT
+       bool "Support Flattened Image Tree"
+       depends on !SPL_BUILD
+       help
+         This option allows to boot the new uImage structrure,
+         Flattened Image Tree.  FIT is formally a FDT, which can include
+         images of various types (kernel, FDT blob, ramdisk, etc.)
+         in a single blob.  To boot this new uImage structure,
+         pass the the address of the blob to the "bootm" command.
+
+config FIT_VERBOSE
+       bool "Display verbose messages on FIT boot"
+       depends on FIT
+
+config FIT_SIGNATURE
+       bool "Enabel signature verification of FIT uImages"
+       depends on FIT
+       help
+         This option enables signature verification of FIT uImages,
+         using a hash signed and verified using RSA.
+         See doc/uImage.FIT/signature.txt for more details.
+
 config SYS_EXTRA_OPTIONS
        string "Extra Options (DEPRECATED)"
        depends on !SPL_BUILD
index 23590d91da8af8e2199a56847fcdfd4b8cdb03f5..db82dfe061ab767e62e5492fa5640376ee06ae48 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -610,9 +610,6 @@ HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makef
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
 libs-y += $(CPUDIR)/
-ifdef SOC
-libs-y += $(CPUDIR)/$(SOC)/
-endif
 libs-$(CONFIG_OF_EMBED) += dts/
 libs-y += arch/$(ARCH)/lib/
 libs-y += fs/
diff --git a/README b/README
index 837dca0c931852d5592047fe19012ffeb3e3e6a3..f52a5f7f64d78bb87aed645598860843154701de 100644 (file)
--- a/README
+++ b/README
@@ -989,6 +989,7 @@ The following options need to be configured:
                CONFIG_CMD_EXT4         * ext4 command support
                CONFIG_CMD_FS_GENERIC   * filesystem commands (e.g. load, ls)
                                          that work for multiple fs types
+               CONFIG_CMD_FS_UUID      * Look up a filesystem UUID
                CONFIG_CMD_SAVEENV        saveenv
                CONFIG_CMD_FDC          * Floppy Disk Support
                CONFIG_CMD_FAT          * FAT command support
@@ -2834,18 +2835,6 @@ CBFS (Coreboot Filesystem) support
 
                Enable auto completion of commands using TAB.
 
-               CONFIG_SYS_HUSH_PARSER
-
-               Define this variable to enable the "hush" shell (from
-               Busybox) as command line interpreter, thus enabling
-               powerful command line syntax like
-               if...then...else...fi conditionals or `&&' and '||'
-               constructs ("shell scripts").
-
-               If undefined, you get the old, much simpler behaviour
-               with a somewhat smaller memory footprint.
-
-
                CONFIG_SYS_PROMPT_HUSH_PS2
 
                This defines the secondary prompt string, which is
index 9b492bea3a065eab711bf2ac5f0129591f015c61..5241cb473b7777679f630c00b4f906a93df2f0dd 100644 (file)
@@ -521,12 +521,12 @@ config TARGET_BCM28155_AP
        bool "Support bcm28155_ap"
        select CPU_V7
 
-config TARGET_BCM958300K
-       bool "Support bcm958300k"
+config TARGET_BCMCYGNUS
+       bool "Support bcmcygnus"
        select CPU_V7
 
-config TARGET_BCM958622HR
-       bool "Support bcm958622hr"
+config TARGET_BCMNSP
+       bool "Support bcmnsp"
        select CPU_V7
 
 config ARCH_EXYNOS
@@ -861,8 +861,8 @@ source "board/bluegiga/apx4devkit/Kconfig"
 source "board/bluewater/snapper9260/Kconfig"
 source "board/boundary/nitrogen6x/Kconfig"
 source "board/broadcom/bcm28155_ap/Kconfig"
-source "board/broadcom/bcm958300k/Kconfig"
-source "board/broadcom/bcm958622hr/Kconfig"
+source "board/broadcom/bcmcygnus/Kconfig"
+source "board/broadcom/bcmnsp/Kconfig"
 source "board/calao/sbc35_a9g20/Kconfig"
 source "board/calao/tny_a9260/Kconfig"
 source "board/calao/usb_a9263/Kconfig"
index 3279f125f6534e2c1348c9d0561ee2044ba9ffc0..56a9390b0111856fcb335f858ec5bef5a75b2277 100644 (file)
@@ -7,3 +7,6 @@
 
 extra-y        = start.o
 obj-y  = cpu.o
+
+obj-$(CONFIG_MX31) += mx31/
+obj-$(CONFIG_MX35) += mx35/
index deec4274477551b17b13b8e1b601892246d2641c..ead2303373e58420270fc55ef7f570b71e81f419 100644 (file)
@@ -10,3 +10,6 @@
 
 extra-y        = start.o
 obj-y  = cpu.o
+
+obj-$(CONFIG_BCM2835) += bcm2835/
+obj-$(CONFIG_TNETV107X) += tnetv107x/
index 47c23bb2688f6f9cc5070998db1d7a795eb7c92a..7ba28d329fa8f6dc2766891425e086043a50cb9e 100644 (file)
@@ -16,7 +16,7 @@
 #define BIT(x)                 (1 << (x))
 
 #define MAX_PREDIV             64
-#define MAX_POSTDIV            8
+#define MAX_POSTDIV            8UL
 #define MAX_MULT               512
 #define MAX_DIV                        (MAX_PREDIV * MAX_POSTDIV)
 
@@ -362,7 +362,7 @@ static void init_pll(const struct pll_init_data *data)
        pllctl_reg_write(data->pll, ctl, tmp);
 
        mult = data->pll_freq / fpll;
-       for (mult = max(mult, 1); mult <= MAX_MULT; mult++) {
+       for (mult = max(mult, 1UL); mult <= MAX_MULT; mult++) {
                div = (fpll * mult) / data->pll_freq;
                if (div < 1 || div > MAX_DIV)
                        continue;
index 6badb3bb84b7200d9714c47d7f99ab09fdc11430..9f61ea25167d6bfc98ed01f2176cc628a03b9bf4 100644 (file)
@@ -9,3 +9,7 @@ extra-y = start.o
 obj-y  = interrupts.o cpu.o
 
 obj-$(CONFIG_TEGRA) += tegra-common/
+obj-$(CONFIG_TEGRA20) += tegra20/
+obj-$(CONFIG_TEGRA30) += tegra30/
+obj-$(CONFIG_TEGRA114) += tegra114/
+obj-$(CONFIG_TEGRA124) += tegra124/
index aac8043f6a8d0039ed8298164dfd0d6fc571955d..a72e5de99eb78b81e616b773df017d19657e1987 100644 (file)
@@ -9,3 +9,10 @@ extra-y        = start.o
 
 obj-y  += cpu.o
 obj-$(CONFIG_USE_IRQ)  += interrupts.o
+
+obj-$(if $(filter a320,$(SOC)),y) += a320/
+obj-$(CONFIG_AT91FAMILY) += at91/
+obj-$(CONFIG_EP93XX) += ep93xx/
+obj-$(CONFIG_IMX) += imx/
+obj-$(CONFIG_KS8695) += ks8695/
+obj-$(CONFIG_S3C24X0) += s3c24x0/
index 125299537f4dd60fe85b77ac76d7588f107d9fd5..adcea9f6834c0fbfc15e64ce1f8d084dac7e758f 100644 (file)
@@ -13,3 +13,18 @@ ifdef        CONFIG_SPL_NO_CPU_SUPPORT_CODE
 extra-y        :=
 endif
 endif
+
+obj-$(CONFIG_ARMADA100) += armada100/
+obj-$(CONFIG_AT91FAMILY) += at91/
+obj-$(CONFIG_ARCH_DAVINCI) += davinci/
+obj-$(CONFIG_KIRKWOOD) += kirkwood/
+obj-$(if $(filter lpc32xx,$(SOC)),y) += lpc32xx/
+obj-$(CONFIG_MB86R0x) += mb86r0x/
+obj-$(CONFIG_MX25) += mx25/
+obj-$(CONFIG_MX27) += mx27/
+obj-$(if $(filter mxs,$(SOC)),y) += mxs/
+obj-$(CONFIG_ARCH_NOMADIK) += nomadik/
+obj-$(CONFIG_ORION5X) += orion5x/
+obj-$(CONFIG_PANTHEON) += pantheon/
+obj-$(if $(filter spear,$(SOC)),y) += spear/
+obj-$(CONFIG_ARCH_VERSATILE) += versatile/
index d25019a51ef2ab0aa58ac75b923898a885365959..1c54ab7de3bfc3726b1c823e47500a462607b1a4 100644 (file)
@@ -1002,7 +1002,8 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
        uint32_t powered_by_linreg = 0;
        int adjust_up, tmp;
 
-       new_brownout = DIV_ROUND(new_target - new_brownout, cfg->step_mV);
+       new_brownout = DIV_ROUND_CLOSEST(new_target - new_brownout,
+                                        cfg->step_mV);
 
        cur_target = readl(cfg->reg);
        cur_target &= cfg->trg_mask;
index afeed4dad84bdddd4557604d6978549879e2dc59..e4197164706e3bc1c86dac97ca5bbd7c7d2cf306 100644 (file)
@@ -37,3 +37,28 @@ obj-$(CONFIG_TEGRA) += tegra-common/
 ifneq (,$(filter s5pc1xx exynos,$(SOC)))
 obj-y += s5p-common/
 endif
+
+obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
+obj-$(if $(filter armada-xp,$(SOC)),y) += armada-xp/
+obj-$(CONFIG_AT91FAMILY) += at91/
+obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
+obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
+obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/
+obj-$(CONFIG_ARCH_EXYNOS) += exynos/
+obj-$(CONFIG_ARCH_HIGHBANK) += highbank/
+obj-$(CONFIG_ARCH_KEYSTONE) += keystone/
+obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/
+obj-$(if $(filter mx5,$(SOC)),y) += mx5/
+obj-$(CONFIG_MX6) += mx6/
+obj-$(CONFIG_OMAP34XX) += omap3/
+obj-$(CONFIG_OMAP44XX) += omap4/
+obj-$(CONFIG_OMAP54XX) += omap5/
+obj-$(CONFIG_RMOBILE) += rmobile/
+obj-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx/
+obj-$(CONFIG_SOCFPGA) += socfpga/
+obj-$(CONFIG_ARCH_SUNXI) += sunxi/
+obj-$(CONFIG_TEGRA20) += tegra20/
+obj-$(CONFIG_U8500) += u8500/
+obj-$(CONFIG_ARCH_UNIPHIER) += uniphier/
+obj-$(CONFIG_VF610) += vf610/
+obj-$(CONFIG_ZYNQ) += zynq/
index 882a2977979c7fd87c09fe1866731a38da0a663f..4a694d7fe782267b0cd0b32df4004636827a7b0c 100644 (file)
@@ -73,10 +73,6 @@ struct clk {
 
 struct refclk *refclk_str_to_clk(const char *name);
 
-#define U8_MAX ((u8)~0U)
-#define U32_MAX        ((u32)~0U)
-#define U64_MAX        ((u64)~0U)
-
 /* The common clock framework uses u8 to represent a parent index */
 #define PARENT_COUNT_MAX       ((u32)U8_MAX)
 
index 7558effdb3388b7dce91a5561e7df0a5071fa85c..c0c95fbc83dc805953717b48d8701b15c52f7211 100644 (file)
@@ -1422,8 +1422,8 @@ static int clock_calc_best_scalar(unsigned int main_scaler_bits,
                return 1;
 
        for (i = 1; i <= loops; i++) {
-               const unsigned int effective_div = max(min(input_rate / i /
-                                                       target_rate, cap), 1);
+               const unsigned int effective_div =
+                       max(min(input_rate / i / target_rate, cap), 1U);
                const unsigned int effective_rate = input_rate / i /
                                                        effective_div;
                const int error = target_rate - effective_rate;
index 658e4cb715f92647d108780c4c81a70b10295bf0..ae3ad0167d19d5197e95c477ace390e58ead0147 100644 (file)
@@ -151,7 +151,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
        }
 
        for (upto = 0, i = 0; upto < uboot_size; upto += todo, i++) {
-               todo = min(uboot_size - upto, (1 << 15));
+               todo = min(uboot_size - upto, (unsigned int)(1 << 15));
                spi_rx_tx(regs, todo, (void *)(uboot_addr),
                          (void *)(SPI_FLASH_UBOOT_POS), i);
        }
index 423aeb980725c1bd700956f6cbfe50f40294e05b..a0add6643e1715a65a3e05a9b38cc7d08b809b41 100644 (file)
@@ -48,9 +48,9 @@ static void abb_setup_timings(u32 setup)
         */
 
        /* calculate SR2_WTCNT_VALUE */
-       sys_rate = DIV_ROUND(V_OSCK, 1000000);
-       clk_cycles = DIV_ROUND(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate);
-       sr2_cnt = DIV_ROUND(OMAP_ABB_SETTLING_TIME * 10, clk_cycles);
+       sys_rate = DIV_ROUND_CLOSEST(V_OSCK, 1000000);
+       clk_cycles = DIV_ROUND_CLOSEST(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate);
+       sr2_cnt = DIV_ROUND_CLOSEST(OMAP_ABB_SETTLING_TIME * 10, clk_cycles);
 
        setbits_le32(setup,
                     sr2_cnt << (ffs(OMAP_ABB_SETUP_SR2_WTCNT_VALUE_MASK) - 1));
diff --git a/arch/arm/cpu/armv7/tegra114/Makefile b/arch/arm/cpu/armv7/tegra114/Makefile
deleted file mode 100644 (file)
index 77e2319..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-# necessary to create built-in.o
-obj- := __dummy__.o
diff --git a/arch/arm/cpu/armv7/tegra124/Makefile b/arch/arm/cpu/armv7/tegra124/Makefile
deleted file mode 100644 (file)
index 9478d44..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2013-2014
-# NVIDIA Corporation <www.nvidia.com>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-# necessary to create built-in.o
-obj- := __dummy__.o
index d98cec90180f5d133432d57c68bf6759649c0c0c..61efed6464455b2e0a85d0efe54835a9fb9a5d0c 100644 (file)
@@ -45,8 +45,8 @@ static void update_window(struct dc_ctlr *dc, struct disp_ctl_win *win)
        writel(0, &dc->win.h_initial_dda);
        writel(0, &dc->win.v_initial_dda);
 
-       h_dda = (win->w * 0x1000) / max(win->out_w - 1, 1);
-       v_dda = (win->h * 0x1000) / max(win->out_h - 1, 1);
+       h_dda = (win->w * 0x1000) / max(win->out_w - 1, 1U);
+       v_dda = (win->h * 0x1000) / max(win->out_h - 1, 1U);
 
        val = h_dda << H_DDA_INC_SHIFT;
        val |= v_dda << V_DDA_INC_SHIFT;
diff --git a/arch/arm/cpu/armv7/tegra30/Makefile b/arch/arm/cpu/armv7/tegra30/Makefile
deleted file mode 100644 (file)
index 413eba1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-# necessary to create built-in.o
-obj- := __dummy__.o
index 7d93f59428ea79e7c7f7ee825376e62b2b598061..0c102230aef40785b12699fb1d4a2c4d5af630b7 100644 (file)
@@ -14,3 +14,5 @@ obj-y += exceptions.o
 obj-y  += cache.o
 obj-y  += tlb.o
 obj-y  += transition.o
+
+obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/
index 532411e1c3627b9951e4d4f79dfb650b8ca6d554..e062da18b113b0eff0550881f583da2e843a66f4 100644 (file)
@@ -16,7 +16,6 @@
 #define _ARMD1_CONFIG_H
 
 #include <asm/arch/armada100.h>
-#define CONFIG_ARM926EJS       1       /* Basic Architecture */
 /* default Dcache Line length for armada100 */
 #define CONFIG_SYS_CACHELINE_SIZE       32
 
index 25bb071e918535009c1b87efdf5dec8871239abf..d177bdcae56cd72565ab057ee12743d1e3891175 100644 (file)
@@ -7,7 +7,6 @@
 #define __AT91RM9200_H__
 
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 family */
-#define CONFIG_ARM920T         /* it's an ARM920T Core */
 #define CONFIG_ARCH_CPU_INIT   /* we need arch_cpu_init() for hw timers */
 #define CONFIG_AT91_GPIO       /* and require always gpio features */
 
index 1e613fa636d17818490a58e2032bcc43322a2d89..a30d569f6b1b32f5ecab6aa3b53457814e8dba9f 100644 (file)
@@ -21,7 +21,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index f7ad11349a787f1770c2686b882af5cc66df5f42..6dfcf4c0c865706205a790245a57b747cb74af07 100644 (file)
@@ -21,7 +21,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index 3206af8c3ea2e310d38e68a21b03a274486b426c..64a3888e227cc7bed21f2f3068d2340ab199b91b 100644 (file)
@@ -17,7 +17,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index 9cbfc277bd6b0ca459d2fd70cc03af65e37f23e5..6df8cdb56d07bb72501272b45e517976b017c56d 100644 (file)
@@ -15,7 +15,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index 00b6aa469fe3a432bf06564c2ab6ac1a64076125..3a8e6d62ce51e351b51c9253109c70278fdc839d 100644 (file)
@@ -17,7 +17,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index d49c18480dca68ac56c9eec2aa83ba549e7ee002..36a5cdf476882bb6f4161ef12dd33d625482fbaf 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef __AT91SAM9X5_H__
 #define __AT91SAM9X5_H__
 
-#define CONFIG_ARM926EJS       /* ARM926EJS Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 family */
 
 /*
index f7bc4ad33834b17ff2c610f777886af1f80e8442..227ba8082551b039e8ace1d7ee77ad3e70abd60b 100644 (file)
@@ -16,7 +16,6 @@
 /*
  * defines to be used in other places
  */
-#define CONFIG_ARMV7           /* ARM A5 Core */
 #define CONFIG_AT91FAMILY      /* it's a member of AT91 */
 
 /*
index ccc8e4e7d64b57bc9d1e94587b5e8d0e42d3d690..e77ac400d8d09e819bcfb1aa70143821df3e71e8 100644 (file)
@@ -24,7 +24,6 @@
 #endif /* CONFIG_KW88F6281 */
 
 #include <asm/arch/soc.h>
-#define CONFIG_ARM926EJS       1       /* Basic Architecture */
 #define CONFIG_SYS_CACHELINE_SIZE      32
                                /* default Dcache Line length for kirkwood */
 #define CONFIG_MD5     /* get_random_hex on krikwood needs MD5 support */
index c985401d3c551e486173b62fa894cdd5efae9fb5..8f6426bc1b0184d4c362487ca499268aa7e783f1 100644 (file)
@@ -10,7 +10,6 @@
 #define _LPC32XX_CONFIG_H
 
 /* Basic CPU architecture */
-#define CONFIG_ARM926EJS
 #define CONFIG_ARCH_CPU_INIT
 
 #define CONFIG_NR_DRAM_BANKS_MAX       2
index fdccd222dd4e439bc0eae2c8da95e01931b4bf86..1eed7b1d569d2ac51e8cfca0321650547674e56d 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <asm/arch/pantheon.h>
 
-#define CONFIG_ARM926EJS       1       /* Basic Architecture */
 /* default Dcache Line length for pantheon */
 #define CONFIG_SYS_CACHELINE_SIZE      32
 
index 4e597a4c1d16281a7efbaa2f15ca339db0109835..f1c0792ce8da0afcf1b17b68f6cd9b7547b07822 100644 (file)
@@ -11,7 +11,7 @@
 
 __weak void flush_cache(unsigned long start, unsigned long size)
 {
-#if defined(CONFIG_ARM1136)
+#if defined(CONFIG_CPU_ARM1136)
 
 #if !defined(CONFIG_SYS_ICACHE_OFF)
        asm("mcr p15, 0, r1, c7, c5, 0"); /* invalidate I cache */
@@ -21,14 +21,14 @@ __weak void flush_cache(unsigned long start, unsigned long size)
        asm("mcr p15, 0, r1, c7, c14, 0"); /* Clean+invalidate D cache */
 #endif
 
-#endif /* CONFIG_ARM1136 */
+#endif /* CONFIG_CPU_ARM1136 */
 
-#ifdef CONFIG_ARM926EJS
+#ifdef CONFIG_CPU_ARM926EJS
        /* test and clean, page 2-23 of arm926ejs manual */
        asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
        /* disable write buffer as well (page 2-22) */
        asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
-#endif /* CONFIG_ARM926EJS */
+#endif /* CONFIG_CPU_ARM926EJS */
        return;
 }
 
index 5e117212574af315bb3df2b3950271c8ea5bd0ce..00cede3fd981be7be855df45f0a84ef727c4edc1 100644 (file)
@@ -16,3 +16,5 @@ obj-y                 += cache.o
 obj-y                  += interrupts.o
 obj-$(CONFIG_PORTMUX_PIO) += portmux-pio.o
 obj-$(CONFIG_PORTMUX_GPIO) += portmux-gpio.o
+
+obj-$(if $(filter at32ap700x,$(SOC)),y) += at32ap700x/
index d5dbe3b908f9ef08fdaea5b1d213245b4ef044d7..0fc6088e3ee10e23584df8203a92ad39dfd15b33 100644 (file)
@@ -72,7 +72,7 @@ unsigned long __gclk_set_rate(unsigned int id, enum gclk_parent parent,
                sm_writel(PM_GCCTRL(id), parent | SM_BIT(CEN));
                rate = parent_rate;
        } else {
-               divider = min(255, divider / 2 - 1);
+               divider = min(255UL, divider / 2 - 1);
                sm_writel(PM_GCCTRL(id), parent | SM_BIT(CEN) | SM_BIT(DIVEN)
                                | SM_BF(DIV, divider));
                rate = parent_rate / (2 * (divider + 1));
index b8be3182a0906ff309ff8cb3ccc744b95fe8d21a..b0abeda90aec71025aa8568426bc93b7620d28bc 100644 (file)
@@ -168,7 +168,7 @@ static int jtag_getc(struct stdio_dev *dev)
                inbound_len = emudat;
        } else {
                /* store the bytes */
-               leftovers_len = min(4, inbound_len);
+               leftovers_len = min((size_t)4, inbound_len);
                inbound_len -= leftovers_len;
                leftovers = emudat;
        }
index f0a061b47ab1ee5555294cc858f4c6e8be415059..211df7b430c246b28b3977d6ecfadced44dac0ef 100644 (file)
@@ -121,7 +121,7 @@ static void dma_calc_size(unsigned long ldst, unsigned long lsrc, size_t count,
        *dshift = WDSIZE_P;
 #endif
 
-       *bpos = min(limit, ffs(ldst | lsrc | count)) - 1;
+       *bpos = min(limit, (unsigned long)ffs(ldst | lsrc | count)) - 1;
 }
 
 /* This version misbehaves for count values of 0 and 2^16+.
@@ -157,7 +157,7 @@ void dma_memcpy_nocache(void *dst, const void *src, size_t count)
 
 #ifdef PSIZE
        /* The max memory DMA peripheral transfer size is 4 bytes. */
-       dsize |= min(2, bpos) << PSIZE_P;
+       dsize |= min(2UL, bpos) << PSIZE_P;
 #endif
 
        /* Copy sram functions from sdram to sram */
index e0e6309c6f04e44c62825e02c9641c6adf51fb59..fa82dd375f4faa4f0a05867942e98049ee4c0dbf 100644 (file)
@@ -8,3 +8,5 @@
 extra-y        = start.o
 obj-y  = cache.o
 obj-y  += cpu.o interrupts.o time.o
+
+obj-$(CONFIG_SOC_AU1X00) += au1x00/
index a3dac70798d999de87da3d7851fabea03750a449..74bdb773032f10bac9a19d8d649f628436a919b7 100644 (file)
@@ -54,8 +54,6 @@
 #define readl(a)     au_readl((long)(a))
 #define writel(v,a)  au_writel((v),(int)(a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-
 #define DEBUG
 #ifdef DEBUG
 #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
index 206d304d4c5ff597f41b248c7c2af01c525d93f3..8ab1fcea26d9fe68a6f5ce16a73f6f23211a1874 100644 (file)
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-# necessary to create built-in.o
-obj- := __dummy__.o
-
 extra-y        = start.o
+
+obj-$(if $(filter ag101,$(SOC)),y) += ag101/
+obj-$(if $(filter ag102,$(SOC)),y) += ag102/
index 3c8b2d904fef6942874551516b385808c8de83f1..b7c1b5594a003a4c7b28f98ec3db67d48d199061 100644 (file)
@@ -42,8 +42,6 @@
 #define readl(a) (*((volatile u32 *)(a)))
 #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-
 #ifdef DEBUG
 #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
 #else
index 129ec662fe8a84ba289bb914cddd296eb8e08967..4adba95aaf804995cf6ed6a81b67e5534f1e2cd7 100644 (file)
@@ -300,7 +300,7 @@ unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr,
        unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE;
        u64 memsize = (u64)memsize_in_meg << 20;
 
-       memsize = min(memsize, CONFIG_MAX_MEM_MAPPED);
+       memsize = min(memsize, (u64)CONFIG_MAX_MEM_MAPPED);
        memsize = tlb_map_range(ram_tlb_address, p_addr, memsize, TLB_MAP_RAM);
 
        if (memsize)
index f8d03cba2d6f7a27dd69d3b5a5f793f166e87dcb..71bb9d776fa59c24303d985d21a269e10938a344 100644 (file)
@@ -1661,7 +1661,7 @@ static void program_mode(unsigned long *dimm_populated,
                for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                        /* If a dimm is installed in a particular slot ... */
                        if (dimm_populated[dimm_num] != SDRAM_NONE)
-                               t_wr_ns = max(t_wr_ns,
+                               t_wr_ns = max(t_wr_ns, (unsigned long)
                                              spd_read(iic0_dimm_addr[dimm_num], 36) >> 2);
                }
 
@@ -1838,12 +1838,18 @@ static void program_tr(unsigned long *dimm_populated,
                        else
                                sdram_ddr1 = false;
 
-                       t_rcd_ns = max(t_rcd_ns, spd_read(iic0_dimm_addr[dimm_num], 29) >> 2);
-                       t_rrd_ns = max(t_rrd_ns, spd_read(iic0_dimm_addr[dimm_num], 28) >> 2);
-                       t_rp_ns  = max(t_rp_ns,  spd_read(iic0_dimm_addr[dimm_num], 27) >> 2);
-                       t_ras_ns = max(t_ras_ns, spd_read(iic0_dimm_addr[dimm_num], 30));
-                       t_rc_ns  = max(t_rc_ns,  spd_read(iic0_dimm_addr[dimm_num], 41));
-                       t_rfc_ns = max(t_rfc_ns, spd_read(iic0_dimm_addr[dimm_num], 42));
+                       t_rcd_ns = max(t_rcd_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 29) >> 2);
+                       t_rrd_ns = max(t_rrd_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 28) >> 2);
+                       t_rp_ns  = max(t_rp_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 27) >> 2);
+                       t_ras_ns = max(t_ras_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 30));
+                       t_rc_ns  = max(t_rc_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 41));
+                       t_rfc_ns = max(t_rfc_ns,
+                                      (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 42));
                }
        }
 
@@ -1916,9 +1922,12 @@ static void program_tr(unsigned long *dimm_populated,
                for (dimm_num = 0; dimm_num < num_dimm_banks; dimm_num++) {
                        /* If a dimm is installed in a particular slot ... */
                        if (dimm_populated[dimm_num] != SDRAM_NONE) {
-                               t_wpc_ns = max(t_wtr_ns, spd_read(iic0_dimm_addr[dimm_num], 36) >> 2);
-                               t_wtr_ns = max(t_wtr_ns, spd_read(iic0_dimm_addr[dimm_num], 37) >> 2);
-                               t_rpc_ns = max(t_rpc_ns, spd_read(iic0_dimm_addr[dimm_num], 38) >> 2);
+                               t_wpc_ns = max(t_wtr_ns,
+                                              (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 36) >> 2);
+                               t_wtr_ns = max(t_wtr_ns,
+                                              (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 37) >> 2);
+                               t_rpc_ns = max(t_rpc_ns,
+                                              (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 38) >> 2);
                        }
                }
 
@@ -2314,7 +2323,8 @@ static void program_ecc(unsigned long *dimm_populated,
        for (dimm_num = 0; dimm_num < MAXDIMMS; dimm_num++) {
                /* If a dimm is installed in a particular slot ... */
                if (dimm_populated[dimm_num] != SDRAM_NONE)
-                       ecc = max(ecc, spd_read(iic0_dimm_addr[dimm_num], 11));
+                       ecc = max(ecc,
+                                 (unsigned long)spd_read(iic0_dimm_addr[dimm_num], 11));
        }
        if (ecc == 0)
                return;
index d1e78f6b0c3c78901d45fe43faef782c604f1d91..65a0675446e5bf41030d80e8dea1c1c2e18f76c5 100644 (file)
@@ -40,8 +40,6 @@
 #define readl(a) (*((volatile u32 *)(a)))
 #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-
 #ifdef DEBUG
 #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
 #else
index 33099a492dbe92ac7b31f20fe26f3b625b22f6f6..ef15e7ac92f292dd482cf65cf7bf9d2c05da91dc 100644 (file)
@@ -126,7 +126,7 @@ void arch_lmb_reserve(struct lmb *lmb)
 #endif
 
        size = min(bootm_size, get_effective_memsize());
-       size = min(size, CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE);
+       size = min(size, (ulong)CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE);
 
        if (size < bootm_size) {
                ulong base = bootmap_base + size;
index 1c4aa3f9bc4c4d054b7cbcd502163693a44319bc..31c93443dba008036e49723fe284eab58a40bda1 100644 (file)
@@ -385,7 +385,7 @@ const char *os_dirent_get_typename(enum os_dirent_t type)
        return os_dirent_typename[OS_FILET_UNKNOWN];
 }
 
-ssize_t os_get_filesize(const char *fname)
+int os_get_filesize(const char *fname, loff_t *size)
 {
        struct stat buf;
        int ret;
@@ -393,7 +393,8 @@ ssize_t os_get_filesize(const char *fname)
        ret = stat(fname, &buf);
        if (ret)
                return ret;
-       return buf.st_size;
+       *size = buf.st_size;
+       return 0;
 }
 
 void os_putc(int ch)
@@ -427,11 +428,11 @@ int os_read_ram_buf(const char *fname)
 {
        struct sandbox_state *state = state_get_current();
        int fd, ret;
-       int size;
+       loff_t size;
 
-       size = os_get_filesize(fname);
-       if (size < 0)
-               return -ENOENT;
+       ret = os_get_filesize(fname, &size);
+       if (ret < 0)
+               return ret;
        if (size != state->ram_size)
                return -ENOSPC;
        fd = open(fname, O_RDONLY);
index 53a99ae71b1361131637b0827a8b2afb142273e7..0df77704c6f769c7085940ca81592d064c7362af 100644 (file)
@@ -39,7 +39,7 @@ int sandbox_early_getopt_check(void)
 
        max_arg_len = 0;
        for (i = 0; i < num_options; ++i)
-               max_arg_len = max(strlen(sb_opt[i]->flag), max_arg_len);
+               max_arg_len = max((int)strlen(sb_opt[i]->flag), max_arg_len);
        max_noarg_len = max_arg_len + 7;
 
        for (i = 0; i < num_options; ++i) {
index 59adad653c2a9f59741ec0276363ea73eee2a3b2..ba73b7e251040831f45a38d29132479b605c0abc 100644 (file)
@@ -49,14 +49,14 @@ static int state_ensure_space(int extra_size)
 
 static int state_read_file(struct sandbox_state *state, const char *fname)
 {
-       int size;
+       loff_t size;
        int ret;
        int fd;
 
-       size = os_get_filesize(fname);
-       if (size < 0) {
+       ret = os_get_filesize(fname, &size);
+       if (ret < 0) {
                printf("Cannot find sandbox state file '%s'\n", fname);
-               return -ENOENT;
+               return ret;
        }
        state->state_fdt = os_malloc(size);
        if (!state->state_fdt) {
index 97f36d5d78b9f0ce3851c1ddfa207a67b82aea4d..2b9e9b9cf07f0996650f4c16b1c36aa13e579206 100644 (file)
@@ -11,4 +11,6 @@
 extra-y        = start.o
 obj-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o
 obj-y  += interrupts.o cpu.o call64.o
+
+obj-$(CONFIG_SYS_COREBOOT) += coreboot/
 obj-$(CONFIG_PCI) += pci.o
index 4778f71600bd9af7056c538e7b3073d996ef6751..6a3dd9391432017898e85c714100ee8e53232ce2 100644 (file)
@@ -18,7 +18,7 @@ static void config_pci_bridge(struct pci_controller *hose, pci_dev_t dev,
 {
        u8 secondary;
        hose->read_byte(hose, dev, PCI_SECONDARY_BUS, &secondary);
-       hose->last_busno = max(hose->last_busno, secondary);
+       hose->last_busno = max(hose->last_busno, (int)secondary);
        pci_hose_scan_bus(hose, secondary);
 }
 
index 342ff300b85388d800ffbc89b56a8203949f9474..e98a2302e79d83c51ff63a43a74e206d507b861a 100644 (file)
@@ -24,7 +24,7 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
 {
        int i;
 
-       unsigned num_entries = min(lib_sysinfo.n_memranges, max_entries);
+       unsigned num_entries = min((unsigned)lib_sysinfo.n_memranges, max_entries);
        if (num_entries < lib_sysinfo.n_memranges) {
                printf("Warning: Limiting e820 map to %d entries.\n",
                        num_entries);
diff --git a/board/broadcom/bcm11130/MAINTAINERS b/board/broadcom/bcm11130/MAINTAINERS
new file mode 100644 (file)
index 0000000..b22e86f
--- /dev/null
@@ -0,0 +1,6 @@
+BCM11130 BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcm28155_ap/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm11130_defconfig
diff --git a/board/broadcom/bcm11130_nand/MAINTAINERS b/board/broadcom/bcm11130_nand/MAINTAINERS
new file mode 100644 (file)
index 0000000..881db5b
--- /dev/null
@@ -0,0 +1,6 @@
+BCM11130_NAND BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcm28155_ap/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm11130_nand_defconfig
diff --git a/board/broadcom/bcm911360_entphn-ns/MAINTAINERS b/board/broadcom/bcm911360_entphn-ns/MAINTAINERS
new file mode 100644 (file)
index 0000000..b5f0207
--- /dev/null
@@ -0,0 +1,6 @@
+BCM911360_ENTPHN-NS BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcmcygnus/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm911360_entphn-ns_defconfig
diff --git a/board/broadcom/bcm911360_entphn/MAINTAINERS b/board/broadcom/bcm911360_entphn/MAINTAINERS
new file mode 100644 (file)
index 0000000..fb7ee2b
--- /dev/null
@@ -0,0 +1,6 @@
+BCM911360_ENTPHN BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcmcygnus/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm911360_entphn_defconfig
diff --git a/board/broadcom/bcm911360k/MAINTAINERS b/board/broadcom/bcm911360k/MAINTAINERS
new file mode 100644 (file)
index 0000000..754a15f
--- /dev/null
@@ -0,0 +1,6 @@
+BCM911360K BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcmcygnus/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm911360k_defconfig
diff --git a/board/broadcom/bcm958300k-ns/MAINTAINERS b/board/broadcom/bcm958300k-ns/MAINTAINERS
new file mode 100644 (file)
index 0000000..763401a
--- /dev/null
@@ -0,0 +1,6 @@
+BCM958300K-NS BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcmcygnus/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm958300k-ns_defconfig
diff --git a/board/broadcom/bcm958300k/Kconfig b/board/broadcom/bcm958300k/Kconfig
deleted file mode 100644 (file)
index 9289288..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if TARGET_BCM958300K
-
-config SYS_BOARD
-       default "bcm_ep"
-
-config SYS_VENDOR
-       default "broadcom"
-
-config SYS_SOC
-       default "bcmcygnus"
-
-config SYS_CONFIG_NAME
-       default "bcm_ep_board"
-
-endif
index f75ee6e73c0fae484d65cffc9256a56866a85ebe..8afc728a25a8dc72304f7c91bde742dfae73f8d1 100644 (file)
@@ -1,6 +1,6 @@
-Broadcom: Cygnus
+BCM958300K BOARD
 M:     Steve Rae <srae@broadcom.com>
 S:     Maintained
-F:     board/broadcom/bcm958300k/
+F:     board/broadcom/bcmcygnus/
 F:     include/configs/bcm_ep_board.h
 F:     configs/bcm958300k_defconfig
diff --git a/board/broadcom/bcm958305k/MAINTAINERS b/board/broadcom/bcm958305k/MAINTAINERS
new file mode 100644 (file)
index 0000000..179fd4e
--- /dev/null
@@ -0,0 +1,6 @@
+BCM958305K BOARD
+M:     Steve Rae <srae@broadcom.com>
+S:     Maintained
+F:     board/broadcom/bcmcygnus/
+F:     include/configs/bcm_ep_board.h
+F:     configs/bcm958305k_defconfig
diff --git a/board/broadcom/bcm958622hr/Kconfig b/board/broadcom/bcm958622hr/Kconfig
deleted file mode 100644 (file)
index 861c559..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if TARGET_BCM958622HR
-
-config SYS_BOARD
-       default "bcm_ep"
-
-config SYS_VENDOR
-       default "broadcom"
-
-config SYS_SOC
-       default "bcmnsp"
-
-config SYS_CONFIG_NAME
-       default "bcm_ep_board"
-
-endif
index c34272f70db4b14f8074782cfff955972074ae3b..d08aded83f2df279b7ab951b2135b22aabd80aab 100644 (file)
@@ -1,6 +1,6 @@
-Broadcom: Northstar Plus
+BCM958622HR BOARD
 M:     Steve Rae <srae@broadcom.com>
 S:     Maintained
-F:     board/broadcom/bcm958622hr/
+F:     board/broadcom/bcmnsp/
 F:     include/configs/bcm_ep_board.h
 F:     configs/bcm958622hr_defconfig
index e48cd3f76735cc7456a9c4da672cafe2bb279856..6a70a2e3056007a38958e0df03d63e75a6c9879b 100644 (file)
@@ -53,3 +53,17 @@ int board_early_init_f(void)
 
        return status;
 }
+
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+void smp_set_core_boot_addr(unsigned long addr, int corenr)
+{
+}
+
+void smp_kick_all_cpus(void)
+{
+}
+
+void smp_waitloop(unsigned previous_address)
+{
+}
+#endif
diff --git a/board/broadcom/bcmcygnus/Kconfig b/board/broadcom/bcmcygnus/Kconfig
new file mode 100644 (file)
index 0000000..faba4cf
--- /dev/null
@@ -0,0 +1,15 @@
+if TARGET_BCMCYGNUS
+
+config SYS_BOARD
+       default "bcm_ep"
+
+config SYS_VENDOR
+       default "broadcom"
+
+config SYS_SOC
+       default "bcmcygnus"
+
+config SYS_CONFIG_NAME
+       default "bcm_ep_board"
+
+endif
diff --git a/board/broadcom/bcmnsp/Kconfig b/board/broadcom/bcmnsp/Kconfig
new file mode 100644 (file)
index 0000000..a975082
--- /dev/null
@@ -0,0 +1,15 @@
+if TARGET_BCMNSP
+
+config SYS_BOARD
+       default "bcm_ep"
+
+config SYS_VENDOR
+       default "broadcom"
+
+config SYS_SOC
+       default "bcmnsp"
+
+config SYS_CONFIG_NAME
+       default "bcm_ep_board"
+
+endif
index 682f2685dc11293111419f77d9913dff927157f1..5c629db139bae17b89ff55121c180513d62f4bd1 100644 (file)
@@ -20,7 +20,7 @@ SECTIONS
        {
          *(.vectors)
          arch/arm/cpu/arm926ejs/start.o                (.text*)
-         arch/arm/cpu/arm926ejs/davinci/built-in.o     (.text*)
+         arch/arm/cpu/arm926ejs/built-in.o             (.text*)
          drivers/mtd/nand/built-in.o                   (.text*)
 
          *(.text*)
index b1680741e16b29202089e12378b45eb3df92e3c5..f3f70ffbad8caf6037a1ee265de0616901847f8e 100644 (file)
@@ -12,6 +12,7 @@
 #include <image.h>
 #include <asm/byteorder.h>
 #include <fat.h>
+#include <flash.h>
 #include <part.h>
 
 #include "auto_update.h"
@@ -30,14 +31,8 @@ extern int N_AU_IMAGES;
 #define MAX_LOADSZ 0x1c00000
 
 /* externals */
-extern int fat_register_device(block_dev_desc_t *, int);
-extern int file_fat_detectfs(void);
-extern long file_fat_read(const char *, void *, unsigned long);
 long do_fat_read (const char *filename, void *buffer,
                  unsigned long maxsize, int dols);
-extern int flash_sect_erase(ulong, ulong);
-extern int flash_sect_protect (int, ulong, ulong);
-extern int flash_write (char *, ulong, ulong);
 
 extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
 
index 6144c533ef27af60d629103aa5f117369ed373b4..c9c8eaade233d590c702236b06b70585d98b116b 100644 (file)
@@ -114,7 +114,7 @@ static void show_eeprom(void)
                e.date[3] & 0x80 ? "PM" : "");
 
        /* Show MAC addresses  */
-       for (i = 0; i < min(e.mac_count, MAX_NUM_PORTS); i++) {
+       for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) {
 
                u8 *p = e.mac[i];
 
@@ -223,7 +223,7 @@ static int prog_eeprom(void)
         */
        for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) {
                ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
-                       p, min((sizeof(e) - i), 8));
+                               p, min((int)(sizeof(e) - i), 8));
                if (ret)
                        break;
                udelay(5000);   /* 5ms write cycle timing */
@@ -461,7 +461,7 @@ int mac_read_from_eeprom(void)
                memset(e.mac[8], 0xff, 6);
 #endif
 
-       for (i = 0; i < min(e.mac_count, MAX_NUM_PORTS); i++) {
+       for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) {
                if (memcmp(&e.mac[i], "\0\0\0\0\0\0", 6) &&
                    memcmp(&e.mac[i], "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) {
                        char ethaddr[18];
index 70eff912aa6bc7d99634d101e7b54225c61f98b4..11d075c38593c91d0ce588ff7c11ee56796427fd 100644 (file)
@@ -236,7 +236,7 @@ static int ccdm_mmc_read(struct mmc *mmc, u64 src, u8 *dst, int size)
                        tmp_buf);
                if (!n)
                        goto failure;
-               result = min(size, blk_len - ofs);
+               result = min(size, (int)(blk_len - ofs));
                memcpy(dst, tmp_buf + ofs, result);
                dst += result;
                size -= result;
@@ -736,7 +736,8 @@ do_bin_func:
                                src_buf = buf;
                                for (ptr = (uint8_t *)src_buf, i = 20; i > 0;
                                        i -= data_size, ptr += data_size)
-                                       memcpy(ptr, data, min(i, data_size));
+                                       memcpy(ptr, data,
+                                              min_t(size_t, i, data_size));
                        }
                }
                bin_func(dst_reg->digest, src_buf, 20);
@@ -931,11 +932,12 @@ static struct key_program *load_key_chunk(const char *ifname,
        struct key_program header;
        uint32_t crc;
        uint8_t buf[12];
-       int i;
+       loff_t i;
 
        if (fs_set_blk_dev(ifname, dev_part_str, fs_type))
                goto failure;
-       i = fs_read(path, (ulong)buf, 0, 12);
+       if (fs_read(path, (ulong)buf, 0, 12, &i) < 0)
+               goto failure;
        if (i < 12)
                goto failure;
        header.magic = get_unaligned_be32(buf);
@@ -950,8 +952,9 @@ static struct key_program *load_key_chunk(const char *ifname,
                goto failure;
        if (fs_set_blk_dev(ifname, dev_part_str, fs_type))
                goto failure;
-       i = fs_read(path, (ulong)result, 0,
-               sizeof(struct key_program) + header.code_size);
+       if (fs_read(path, (ulong)result, 0,
+                   sizeof(struct key_program) + header.code_size, &i) < 0)
+               goto failure;
        if (i <= 0)
                goto failure;
        *result = header;
@@ -1042,7 +1045,7 @@ static int second_stage_init(void)
        const char *image_path = "/ccdm.itb";
        char *mac_path = NULL;
        ulong image_addr;
-       size_t image_size;
+       loff_t image_size;
        uint32_t err;
 
        printf("CCDM S2\n");
@@ -1084,10 +1087,11 @@ static int second_stage_init(void)
        image_addr = (ulong)get_image_location();
        if (fs_set_blk_dev("mmc", mmcdev, FS_TYPE_EXT))
                goto failure;
-       image_size = fs_read(image_path, image_addr, 0, 0);
+       if (fs_read(image_path, image_addr, 0, 0, &image_size) < 0)
+               goto failure;
        if (image_size <= 0)
                goto failure;
-       printf("CCDM image found on %s, %d bytes\n", mmcdev, image_size);
+       printf("CCDM image found on %s, %lld bytes\n", mmcdev, image_size);
 
        hmac_blob = load_key_chunk("mmc", mmcdev, FS_TYPE_EXT, mac_path);
        if (!hmac_blob) {
index d363e49919e96454e692658289271b448c29f64f..78c4bd4efe7114767e9c52ef07a42c6fe8c1460c 100644 (file)
@@ -37,7 +37,7 @@ static void malta_lcd_puts(const char *str)
        void *reg = (void *)CKSEG1ADDR(MALTA_ASCIIPOS0);
 
        /* print up to 8 characters of the string */
-       for (i = 0; i < min(strlen(str), 8); i++) {
+       for (i = 0; i < min((int)strlen(str), 8); i++) {
                __raw_writel(str[i], reg);
                reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0;
        }
index 216a8debd9afb7021622d70453511ea9f35c9fc2..fd84fa08bd3efc2569ac4200684f26abca5ac205 100644 (file)
 menu "Command line interface"
        depends on !SPL_BUILD
 
+config HUSH_PARSER
+       bool "Use hush shell"
+       select SYS_HUSH_PARSER
+       help
+         This option enables the "hush" shell (from Busybox) as command line
+         interpreter, thus enabling powerful command line syntax like
+         if...then...else...fi conditionals or `&&' and '||'
+         constructs ("shell scripts").
+
+         If disabled, you get the old, much simpler behaviour with a somewhat
+         smaller memory footprint.
+
+config SYS_HUSH_PARSER
+       bool
+       help
+         Backward compatibility.
+
+comment "Commands"
+
+menu "Info commands"
+
+config CMD_BDI
+       bool "bdinfo"
+       help
+         Print board info
+
+config CMD_CONSOLE
+       bool "coninfo"
+       help
+         Print console devices and information.
+
+config CMD_LICENSE
+       bool "license"
+       help
+         Print GPL license text
+
+endmenu
+
+menu "Boot commands"
+
+config CMD_BOOTD
+       bool "bootd"
+       help
+         Run the command stored in the environment "bootcmd", i.e.
+         "bootd" does the same thing as "run bootcmd".
+
 config CMD_BOOTM
-       bool "Enable bootm command"
+       bool "bootm"
        default y
        help
          Boot an application image from the memory.
 
-config CMD_CRC32
-       bool "Enable crc32 command"
+config CMD_GO
+       bool "go"
        default y
        help
-         Compute CRC32.
+         Start an application at a given address.
+
+config CMD_RUN
+       bool "run"
+       help
+         Run the command in the given environment variable.
+
+config CMD_IMI
+       bool "iminfo"
+       help
+         Print header information for application image.
+
+config CMD_IMLS
+       bool "imls"
+       help
+         List all images found in flash
+
+config CMD_XIMG
+       bool "imxtract"
+       help
+         Extract a part of a multi-image.
+
+endmenu
+
+menu "Environment commands"
 
 config CMD_EXPORTENV
-       bool "Enable env export command"
+       bool "env export"
        default y
        help
          Export environments.
 
 config CMD_IMPORTENV
-       bool "Enable env import command"
+       bool "env import"
        default y
        help
          Import environments.
 
-config CMD_GO
-       bool "Enable go command"
+config CMD_EDITENV
+       bool "editenv"
+       help
+         Edit environment variable.
+
+config CMD_SAVEENV
+       bool "saveenv"
+       help
+         Run the command in the given environment variable.
+
+endmenu
+
+menu "Memory commands"
+
+config CMD_MEMORY
+       bool "md, mm, nm, mw, cp, cmp, base, loop"
+       help
+         Memeory commands.
+           md - memory display
+           mm - memory modify (auto-incrementing address)
+           nm - memory modify (constant address)
+           mw - memory write (fill)
+           cp - memory copy
+           cmp - memory compare
+           base - print or set address offset
+           loop - initinite loop on address range
+
+config CMD_CRC32
+       bool "crc32"
        default y
        help
-         Start an application at a given address.
+         Compute CRC32.
+
+config LOOPW
+       bool "loopw"
+       help
+         Infinite write loop on address range
+
+config CMD_MEMTEST
+       bool "crc32"
+       help
+         Simple RAM read/write test.
+
+config CMD_MX_CYCLIC
+       bool "mdc, mwc"
+       help
+         mdc - memory display cyclic
+         mwc - memory write cyclic
+
+config CMD_MEMINFO
+       bool "meminfo"
+       help
+         Display memory information.
+
+endmenu
+
+menu "Device access commands"
+
+config CMD_LOADB
+       bool "loadb"
+       help
+         Load a binary file over serial line.
+
+config CMD_LOADS
+       bool "loads"
+       help
+         Load an S-Record file over serial line
+
+config CMD_FLASH
+       bool "flinfo, erase, protect"
+       help
+         NOR flash support.
+           flinfo - print FLASH memory information
+           erase - FLASH memory
+           protect - enable or disable FLASH write protection
+
+config CMD_NAND
+       bool "nand"
+       help
+         NAND support.
+
+config CMD_SPI
+       bool "sspi"
+       help
+         SPI utility command.
+
+config CMD_I2C
+       bool "i2c"
+       help
+         I2C support.
+
+config CMD_USB
+       bool "usb"
+       help
+         USB support.
+
+config CMD_FPGA
+       bool "fpga"
+       help
+         FPGA support.
+
+endmenu
+
+
+menu "Shell scripting commands"
+
+config CMD_ECHO
+       bool "echo"
+       help
+         Echo args to console
+
+config CMD_ITEST
+       bool "itest"
+       help
+         Return true/false on integer compare.
+
+config CMD_SOURCE
+       bool "source"
+       help
+         Run script from memory
+
+endmenu
+
+menu "Network commands"
+
+config CMD_NET
+       bool "bootp, tftpboot"
+       help
+         Network commands.
+         bootp - boot image via network using BOOTP/TFTP protocol
+         tftpboot - boot image via network using TFTP protocol
+
+config CMD_TFTPPUT
+       bool "tftp put"
+       help
+         TFTP put command, for uploading files to a server
+
+config CMD_TFTPSRV
+       bool "tftpsrv"
+       help
+         Act as a TFTP server and boot the first received file
+
+config CMD_RARP
+       bool "rarpboot"
+       help
+         Boot image via network using RARP/TFTP protocol
+
+config CMD_DHCP
+       bool "dhcp"
+       help
+         Boot image via network using DHCP/TFTP protocol
+
+config CMD_NFS
+       bool "nfs"
+       help
+         Boot image via network using NFS protocol.
+
+config CMD_PING
+       bool "ping"
+       help
+         Send ICMP ECHO_REQUEST to network host
+
+config CMD_CDP
+       bool "cdp"
+       help
+         Perform CDP network configuration
+
+config CMD_SNTP
+       bool "sntp"
+       help
+         Synchronize RTC via network
+
+config CMD_DNS
+       bool "dns"
+       help
+         Lookup the IP of a hostname
+
+config CMD_DNS
+       bool "dns"
+       help
+         Lookup the IP of a hostname
+
+config CMD_LINK_LOCAL
+       bool "linklocal"
+       help
+         Acquire a network IP address using the link-local protocol
+
+endmenu
+
+menu "Misc commands"
+
+config CMD_TIME
+       bool "time"
+       help
+         Run commands and summarize execution time.
+
+# TODO: rename to CMD_SLEEP
+config CMD_MISC
+       bool "sleep"
+       help
+         Delay execution for some time
+
+config CMD_TIMER
+       bool "timer"
+       help
+         Access the system timer.
+
+config CMD_SETGETDCR
+       bool "getdcr, setdcr, getidcr, setidcr"
+       depends on 4xx
+       help
+         getdcr - Get an AMCC PPC 4xx DCR's value
+         setdcr - Set an AMCC PPC 4xx DCR's value
+         getidcr - Get a register value via indirect DCR addressing
+         setidcr - Set a register value via indirect DCR addressing
+
+endmenu
 
 endmenu
index 6cc4de8a73f6ab24a20760ded2d64e395b65a94f..508a0b28f5ad325ad4059d539a1fad3257884040 100644 (file)
@@ -188,6 +188,7 @@ obj-y += usb.o usb_hub.o
 obj-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 obj-$(CONFIG_CMD_FASTBOOT) += cmd_fastboot.o
+obj-$(CONFIG_CMD_FS_UUID) += cmd_fs_uuid.o
 
 obj-$(CONFIG_CMD_USB_MASS_STORAGE) += cmd_usb_mass_storage.o
 obj-$(CONFIG_CMD_THOR_DOWNLOAD) += cmd_thordown.o
index 6e6a1a2b98497ea935996bf179de04042196a09f..f8fd324d0d79741c0741f24d38645895c22a2fbb 100644 (file)
@@ -142,17 +142,19 @@ static int init_baud_rate(void)
 static int display_text_info(void)
 {
 #ifndef CONFIG_SANDBOX
-       ulong bss_start, bss_end;
+       ulong bss_start, bss_end, text_base;
 
        bss_start = (ulong)&__bss_start;
        bss_end = (ulong)&__bss_end;
 
-       debug("U-Boot code: %08X -> %08lX  BSS: -> %08lX\n",
 #ifdef CONFIG_SYS_TEXT_BASE
-             CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
+       text_base = CONFIG_SYS_TEXT_BASE;
 #else
-             CONFIG_SYS_MONITOR_BASE, bss_start, bss_end);
+       text_base = CONFIG_SYS_MONITOR_BASE;
 #endif
+
+       debug("U-Boot code: %08lX -> %08lX  BSS: -> %08lX\n",
+               text_base, bss_start, bss_end);
 #endif
 
 #ifdef CONFIG_MODEM_SUPPORT
@@ -285,7 +287,7 @@ static int read_fdt_from_file(void)
        struct sandbox_state *state = state_get_current();
        const char *fname = state->fdt_fname;
        void *blob;
-       ssize_t size;
+       loff_t size;
        int err;
        int fd;
 
@@ -298,10 +300,10 @@ static int read_fdt_from_file(void)
                return -EINVAL;
        }
 
-       size = os_get_filesize(fname);
-       if (size < 0) {
+       err = os_get_filesize(fname, &size);
+       if (err < 0) {
                printf("Failed to file FDT file '%s'\n", fname);
-               return -ENOENT;
+               return err;
        }
        fd = os_open(fname, OS_O_RDONLY);
        if (fd < 0) {
@@ -579,7 +581,7 @@ static int reserve_stacks(void)
        gd->irq_sp = gd->start_addr_sp;
 # endif
 #else
-# ifdef CONFIG_PPC
+# if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
        ulong *s;
 # endif
 
@@ -609,6 +611,12 @@ static int reserve_stacks(void)
        s = (ulong *) gd->start_addr_sp;
        *s = 0; /* Terminate back chain */
        *++s = 0; /* NULL return address */
+# elif defined(CONFIG_MIPS)
+       /* Clear initial stack frame */
+       s = (ulong *) gd->start_addr_sp;
+       *s-- = 0;
+       *s-- = 0;
+       gd->start_addr_sp = (ulong) s;
 # endif /* Architecture specific code */
 
        return 0;
index 42a52965c2722282c36e6ebeaa0049c8c21b4c9f..58b61c26403b9fe79fe041c7c6cf2b6123309759 100644 (file)
@@ -210,9 +210,9 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         */
        bootline = getenv("bootargs");
        if (bootline) {
-               memcpy((void *) bootaddr, bootline,
-                       max(strlen(bootline), 255));
-               flush_cache(bootaddr, max(strlen(bootline), 255));
+               memcpy((void *)bootaddr, bootline,
+                      max(strlen(bootline), (size_t)255));
+               flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
        } else {
                sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE);
                tmp = getenv("bootfile");
@@ -240,9 +240,9 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                         CONFIG_SYS_VXWORKS_ADD_PARAMS);
 #endif
 
-               memcpy((void *) bootaddr, build_buf,
-                       max(strlen(build_buf), 255));
-               flush_cache(bootaddr, max(strlen(build_buf), 255));
+               memcpy((void *)bootaddr, build_buf,
+                      max(strlen(build_buf), (size_t)255));
+               flush_cache(bootaddr, max(strlen(build_buf), (size_t)255));
        }
 
        /*
index ecfc6d3c9bb077fa523ba6c476be388906862fbc..19423d1c81b83aec61545e1c9fb37d006e94806e 100644 (file)
@@ -61,61 +61,16 @@ int do_ext4_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 
 #if defined(CONFIG_CMD_EXT4_WRITE)
 int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc,
-                               char *const argv[])
+                 char *const argv[])
 {
-       const char *filename = "/";
-       int dev, part;
-       unsigned long ram_address;
-       unsigned long file_size;
-       disk_partition_t info;
-       block_dev_desc_t *dev_desc;
-
-       if (argc < 6)
-               return cmd_usage(cmdtp);
-
-       part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info, 1);
-       if (part < 0)
-               return 1;
-
-       dev = dev_desc->dev;
-
-       /* get the filename */
-       filename = argv[4];
-
-       /* get the address in hexadecimal format (string to int) */
-       ram_address = simple_strtoul(argv[3], NULL, 16);
-
-       /* get the filesize in hexadecimal format */
-       file_size = simple_strtoul(argv[5], NULL, 16);
-
-       /* set the device as block device */
-       ext4fs_set_blk_dev(dev_desc, &info);
-
-       /* mount the filesystem */
-       if (!ext4fs_mount(info.size)) {
-               printf("Bad ext4 partition %s %d:%d\n", argv[1], dev, part);
-               goto fail;
-       }
-
-       /* start write */
-       if (ext4fs_write(filename, (unsigned char *)ram_address, file_size)) {
-               printf("** Error ext4fs_write() **\n");
-               goto fail;
-       }
-       ext4fs_close();
-
-       return 0;
-
-fail:
-       ext4fs_close();
-
-       return 1;
+       return do_save(cmdtp, flag, argc, argv, FS_TYPE_EXT);
 }
 
-U_BOOT_CMD(ext4write, 6, 1, do_ext4_write,
-       "create a file in the root directory",
-       "<interface> <dev[:part]> <addr> <absolute filename path> [sizebytes]\n"
-       "    - create a file in / directory");
+U_BOOT_CMD(ext4write, 7, 1, do_ext4_write,
+          "create a file in the root directory",
+          "<interface> <dev[:part]> <addr> <absolute filename path>\n"
+          "    [sizebytes] [file offset]\n"
+          "    - create a file in / directory");
 
 #endif
 
@@ -132,7 +87,7 @@ U_BOOT_CMD(ext4ls, 4, 1, do_ext4_ls,
           "<interface> <dev[:part]> [directory]\n"
           "    - list files from 'dev' on 'interface' in a 'directory'");
 
-U_BOOT_CMD(ext4load, 6, 0, do_ext4_load,
+U_BOOT_CMD(ext4load, 7, 0, do_ext4_load,
           "load binary file from a Ext4 filesystem",
           "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
           "    - load binary file 'filename' from 'dev' on 'interface'\n"
index 633fbf1d311391bb9aa69fd9ce905013b12e9805..c00fb28b620b6d7108fda494f4e032724e829fe3 100644 (file)
@@ -100,7 +100,8 @@ U_BOOT_CMD(
 static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
                int argc, char * const argv[])
 {
-       long size;
+       loff_t size;
+       int ret;
        unsigned long addr;
        unsigned long count;
        block_dev_desc_t *dev_desc = NULL;
@@ -127,15 +128,15 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
        count = simple_strtoul(argv[5], NULL, 16);
 
        buf = map_sysmem(addr, count);
-       size = file_fat_write(argv[4], buf, count);
+       ret = file_fat_write(argv[4], buf, 0, count, &size);
        unmap_sysmem(buf);
-       if (size == -1) {
+       if (ret < 0) {
                printf("\n** Unable to write \"%s\" from %s %d:%d **\n",
                        argv[4], argv[1], dev, part);
                return 1;
        }
 
-       printf("%ld bytes written\n", size);
+       printf("%llu bytes written\n", size);
 
        return 0;
 }
index 675434078633400ff85866e4c7554458412b7dc1..0d9da113bf0c1305bc64e7e67368d6eba800b5e0 100644 (file)
@@ -51,6 +51,23 @@ U_BOOT_CMD(
        "      If 'pos' is 0 or omitted, the file is read from the start."
 )
 
+static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+                               char * const argv[])
+{
+       return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY);
+}
+
+U_BOOT_CMD(
+       save,   7,      0,      do_save_wrapper,
+       "save file to a filesystem",
+       "<interface> <dev[:part]> <addr> <filename> bytes [pos]\n"
+       "    - Save binary file 'filename' to partition 'part' on device\n"
+       "      type 'interface' instance 'dev' from addr 'addr' in memory.\n"
+       "      'bytes' gives the size to save in bytes and is mandatory.\n"
+       "      'pos' gives the file byte position to start writing to.\n"
+       "      If 'pos' is 0 or omitted, the file is written from the start."
+)
+
 static int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
                                char * const argv[])
 {
diff --git a/common/cmd_fs_uuid.c b/common/cmd_fs_uuid.c
new file mode 100644 (file)
index 0000000..613f3a4
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * cmd_fs_uuid.c -- fsuuid command
+ *
+ * Copyright (C) 2014, Bachmann electronic GmbH
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <command.h>
+#include <fs.h>
+
+static int do_fs_uuid_wrapper(cmd_tbl_t *cmdtp, int flag,
+       int argc, char * const argv[])
+{
+       return do_fs_uuid(cmdtp, flag, argc, argv, FS_TYPE_ANY);
+}
+
+U_BOOT_CMD(
+       fsuuid, 4, 1, do_fs_uuid_wrapper,
+       "Look up a filesystem UUID",
+       "<interface> <dev>:<part>\n"
+       "    - print filesystem UUID\n"
+       "fsuuid <interface> <dev>:<part> <varname>\n"
+       "    - set environment variable to filesystem UUID\n"
+);
index 3ac8cc41b1a450edc7f5e489b3a6e9e4c2d14a38..d22ace52206580052e47073eb47d6e59bb9d936c 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <command.h>
 #include <u-boot/md5.h>
+#include <asm/io.h>
 
 /*
  * Store the resulting sum to an address or variable
@@ -79,6 +80,7 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int verify = 0;
        int ac;
        char * const *av;
+       void *buf;
 
        if (argc < 3)
                return CMD_RET_USAGE;
@@ -96,7 +98,9 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        addr = simple_strtoul(*av++, NULL, 16);
        len = simple_strtoul(*av++, NULL, 16);
 
-       md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5);
+       buf = map_sysmem(addr, len);
+       md5_wd(buf, len, output, CHUNKSZ_MD5);
+       unmap_sysmem(buf);
 
        if (!verify) {
                printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1);
@@ -135,6 +139,7 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        unsigned long addr, len;
        unsigned int i;
        u8 output[16];
+       void *buf;
 
        if (argc < 3)
                return CMD_RET_USAGE;
@@ -142,7 +147,10 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        addr = simple_strtoul(argv[1], NULL, 16);
        len = simple_strtoul(argv[2], NULL, 16);
 
-       md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5);
+       buf = map_sysmem(addr, len);
+       md5_wd(buf, len, output, CHUNKSZ_MD5);
+       unmap_sysmem(buf);
+
        printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1);
        for (i = 0; i < 16; i++)
                printf("%02x", output[i]);
index a1ba42e2f3a2c3a4abc625af674a4599af451f38..e3a77e35820cbda7c663f2b737c187ed0f9e2227 100644 (file)
@@ -42,12 +42,16 @@ void pci_header_show_brief(pci_dev_t dev);
  */
 void pciinfo(int BusNum, int ShortPCIListing)
 {
+       struct pci_controller *hose = pci_bus_to_hose(BusNum);
        int Device;
        int Function;
        unsigned char HeaderType;
        unsigned short VendorID;
        pci_dev_t dev;
 
+       if (!hose)
+               return;
+
        printf("Scanning PCI devices on bus %d\n", BusNum);
 
        if (ShortPCIListing) {
@@ -67,6 +71,9 @@ void pciinfo(int BusNum, int ShortPCIListing)
 
                        dev = PCI_BDF(BusNum, Device, Function);
 
+                       if (pci_skip_dev(hose, dev))
+                               continue;
+
                        pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID);
                        if ((VendorID == 0xFFFF) || (VendorID == 0x0000))
                                continue;
index 95a6f89a845da57b5e5430b339dbda12f4d5d354..5c788e96bdb821de3b7cd6f4f6cb8a40a0238cc4 100644 (file)
@@ -18,7 +18,6 @@
 
 static struct spi_flash *flash;
 
-
 /*
  * This function computes the length argument for the erase command.
  * The length on which the command is to operate can be given in two forms:
@@ -71,9 +70,9 @@ static ulong bytes_per_second(unsigned int len, ulong start_ms)
 {
        /* less accurate but avoids overflow */
        if (len >= ((unsigned int) -1) / 1024)
-               return len / (max(get_timer(start_ms) / 1024, 1));
+               return len / (max(get_timer(start_ms) / 1024, 1UL));
        else
-               return 1024 * len / max(get_timer(start_ms), 1);
+               return 1024 * len / max(get_timer(start_ms), 1UL);
 }
 
 static int do_spi_flash_probe(int argc, char * const argv[])
@@ -223,7 +222,7 @@ static int spi_flash_update(struct spi_flash *flash, u32 offset,
                ulong last_update = get_timer(0);
 
                for (; buf < end && !err_oper; buf += todo, offset += todo) {
-                       todo = min(end - buf, flash->sector_size);
+                       todo = min_t(size_t, end - buf, flash->sector_size);
                        if (get_timer(last_update) > 100) {
                                printf("   \rUpdating, %zu%% %lu B/s",
                                       100 - (end - buf) / scale,
@@ -421,7 +420,8 @@ static int spi_flash_test(struct spi_flash *flash, uint8_t *buf, ulong len,
        for (i = 0; i < len; i++) {
                if (vbuf[i] != 0xff) {
                        printf("Check failed at %d\n", i);
-                       print_buffer(i, vbuf + i, 1, min(len - i, 0x40), 0);
+                       print_buffer(i, vbuf + i, 1,
+                                    min_t(uint, len - i, 0x40), 0);
                        return -1;
                }
        }
@@ -443,9 +443,11 @@ static int spi_flash_test(struct spi_flash *flash, uint8_t *buf, ulong len,
        for (i = 0; i < len; i++) {
                if (buf[i] != vbuf[i]) {
                        printf("Verify failed at %d, good data:\n", i);
-                       print_buffer(i, buf + i, 1, min(len - i, 0x40), 0);
+                       print_buffer(i, buf + i, 1,
+                                    min_t(uint, len - i, 0x40), 0);
                        printf("Bad data:\n");
-                       print_buffer(i, vbuf + i, 1, min(len - i, 0x40), 0);
+                       print_buffer(i, vbuf + i, 1,
+                                    min_t(uint, len - i, 0x40), 0);
                        return -1;
                }
        }
index 8db0160ceb0ced4fc703a2a11840d5e6bedde30d..e4c848935ad19d7cac64d07102e7ebe39841b58b 100644 (file)
@@ -41,6 +41,7 @@ int saveenv(void)
        disk_partition_t info;
        int dev, part;
        int err;
+       loff_t size;
 
        err = env_export(&env_new);
        if (err)
@@ -59,7 +60,8 @@ int saveenv(void)
                return 1;
        }
 
-       err = file_fat_write(FAT_ENV_FILE, (void *)&env_new, sizeof(env_t));
+       err = file_fat_write(FAT_ENV_FILE, (void *)&env_new, 0, sizeof(env_t),
+                            &size);
        if (err == -1) {
                printf("\n** Unable to write \"%s\" from %s%d:%d **\n",
                        FAT_ENV_FILE, FAT_ENV_INTERFACE, dev, part);
index 749605fe3fa89ab798a0ebde92f1f90e4a40fb2b..9c9bb82c0faf81f3d6d6295f99ecfcfd3a1cea2b 100644 (file)
@@ -132,7 +132,7 @@ static int writeenv(size_t offset, u_char *buf)
        u_char *char_ptr;
 
        blocksize = nand_info[0].erasesize;
-       len = min(blocksize, CONFIG_ENV_SIZE);
+       len = min(blocksize, (size_t)CONFIG_ENV_SIZE);
 
        while (amount_saved < CONFIG_ENV_SIZE && offset < end) {
                if (nand_block_isbad(&nand_info[0], offset)) {
@@ -244,7 +244,7 @@ static int readenv(size_t offset, u_char *buf)
        if (!blocksize)
                return 1;
 
-       len = min(blocksize, CONFIG_ENV_SIZE);
+       len = min(blocksize, (size_t)CONFIG_ENV_SIZE);
 
        while (amount_loaded < CONFIG_ENV_SIZE && offset < end) {
                if (nand_block_isbad(&nand_info[0], offset)) {
index 3f641566b977aff76275656c86093051d2b1217c..2d3c3870b19a3d42f0edb0e4f1f9c88272072b1e 100644 (file)
@@ -1199,7 +1199,8 @@ int fdt_node_offset_by_compat_reg(void *blob, const char *compat,
  */
 int fdt_alloc_phandle(void *blob)
 {
-       int offset, phandle = 0;
+       int offset;
+       uint32_t phandle = 0;
 
        for (offset = fdt_next_node(blob, -1, NULL); offset >= 0;
             offset = fdt_next_node(blob, offset, NULL)) {
index 37147af805ce8972081dd7a59420ecb14a2b0453..d8e13715c18f82c269cfd3b670a9567bbf895fd3 100644 (file)
@@ -746,7 +746,7 @@ static void splash_align_axis(int *axis, unsigned long panel_size,
        else
                return;
 
-       *axis = max(0, axis_alignment);
+       *axis = max(0, (int)axis_alignment);
 }
 #endif
 
@@ -1145,8 +1145,8 @@ U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-       console_col = min(col, CONSOLE_COLS - 1);
-       console_row = min(row, CONSOLE_ROWS - 1);
+       console_col = min_t(short, col, CONSOLE_COLS - 1);
+       console_row = min_t(short, row, CONSOLE_ROWS - 1);
 }
 
 int lcd_get_pixel_width(void)
index f01a21c83a51d9f0133393b0300c273edc410b2a..97eb8eb987d97ed6b0c128742642ecca1a169477 100644 (file)
@@ -221,7 +221,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
                break;
 #endif
        default:
-               debug("SPL: Un-supported Boot Device\n");
+#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+               printf("SPL: Unsupported Boot Device %d\n", boot_device);
+#endif
                hang();
        }
 
index d9eba5aef3a7bfae56ceda43df0a1726639d8804..5ff9bc5626c4f8ce669f60112735ab60a6da412e 100644 (file)
@@ -15,7 +15,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 {
        s32 err;
        struct image_header *header;
-       int filelen;
+       loff_t filelen, actlen;
        disk_partition_t part_info = {};
 
        header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
@@ -37,12 +37,12 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
                goto end;
        }
 
-       filelen = err = ext4fs_open(filename);
+       err = ext4fs_open(filename, &filelen);
        if (err < 0) {
                puts("spl: ext4fs_open failed\n");
                goto end;
        }
-       err = ext4fs_read((char *)header, sizeof(struct image_header));
+       err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen);
        if (err <= 0) {
                puts("spl: ext4fs_read failed\n");
                goto end;
@@ -50,7 +50,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 
        spl_parse_image_header(header);
 
-       err = ext4fs_read((char *)spl_image.load_addr, filelen);
+       err = ext4fs_read((char *)spl_image.load_addr, filelen, &actlen);
 
 end:
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
@@ -66,7 +66,7 @@ end:
 int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 {
        int err;
-       int filelen;
+       __maybe_unused loff_t filelen, actlen;
        disk_partition_t part_info = {};
        __maybe_unused char *file;
 
@@ -89,12 +89,12 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 #if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
        file = getenv("falcon_args_file");
        if (file) {
-               filelen = err = ext4fs_open(file);
+               err = ext4fs_open(file, &filelen);
                if (err < 0) {
                        puts("spl: ext4fs_open failed\n");
                        goto defaults;
                }
-               err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+               err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
                if (err <= 0) {
                        printf("spl: error reading image %s, err - %d, falling back to default\n",
                               file, err);
@@ -119,11 +119,11 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 defaults:
 #endif
 
-       filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
+       err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME, &filelen);
        if (err < 0)
                puts("spl: ext4fs_open failed\n");
 
-       err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+       err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
        if (err <= 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("%s: error reading image %s, err - %d\n",
index 0f1eab448649541a45e674bcfbd599460cc89677..66b4a725d1b3c1d2caf0fe005fe40e036b9b251f 100644 (file)
@@ -300,7 +300,8 @@ static int usb_hub_configure(struct usb_device *dev)
        }
        descriptor = (struct usb_hub_descriptor *)buffer;
 
-       length = min(descriptor->bLength, sizeof(struct usb_hub_descriptor));
+       length = min_t(int, descriptor->bLength,
+                      sizeof(struct usb_hub_descriptor));
 
        if (usb_get_hub_descriptor(dev, buffer, length) < 0) {
                debug("usb_hub_configure: failed to get hub " \
diff --git a/configs/bcm11130_defconfig b/configs/bcm11130_defconfig
new file mode 100644 (file)
index 0000000..f8c9f03
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_MMC_ENV_DEV=0"
+CONFIG_ARM=y
+CONFIG_TARGET_BCM28155_AP=y
diff --git a/configs/bcm11130_nand_defconfig b/configs/bcm11130_nand_defconfig
new file mode 100644 (file)
index 0000000..39cb709
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_ARM=y
+CONFIG_TARGET_BCM28155_AP=y
diff --git a/configs/bcm911360_entphn-ns_defconfig b/configs/bcm911360_entphn-ns_defconfig
new file mode 100644 (file)
index 0000000..6f5c154
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x20000000,ARMV7_NONSEC"
+CONFIG_ARM=y
+CONFIG_TARGET_BCMCYGNUS=y
diff --git a/configs/bcm911360_entphn_defconfig b/configs/bcm911360_entphn_defconfig
new file mode 100644 (file)
index 0000000..37b5846
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x20000000"
+CONFIG_ARM=y
+CONFIG_TARGET_BCMCYGNUS=y
diff --git a/configs/bcm911360k_defconfig b/configs/bcm911360k_defconfig
new file mode 100644 (file)
index 0000000..527e407
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x40000000"
+CONFIG_ARM=y
+CONFIG_TARGET_BCMCYGNUS=y
diff --git a/configs/bcm958300k-ns_defconfig b/configs/bcm958300k-ns_defconfig
new file mode 100644 (file)
index 0000000..0e3aaa7
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x40000000,ARMV7_NONSEC"
+CONFIG_ARM=y
+CONFIG_TARGET_BCMCYGNUS=y
index 066739db8bf0781be5745ee2c3f4f1fc702f1f27..527e4072c9211496231017dce134b5f9f31ac8ea 100644 (file)
@@ -1,3 +1,3 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x20000000"
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x40000000"
 CONFIG_ARM=y
-CONFIG_TARGET_BCM958300K=y
+CONFIG_TARGET_BCMCYGNUS=y
diff --git a/configs/bcm958305k_defconfig b/configs/bcm958305k_defconfig
new file mode 100644 (file)
index 0000000..527e407
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x40000000"
+CONFIG_ARM=y
+CONFIG_TARGET_BCMCYGNUS=y
index 8a45e515fbbe8b2b441fd7c4dd0e3599c02c6398..7c8630096822986c6cc968312b682bfd69deb97d 100644 (file)
@@ -1,3 +1,3 @@
 CONFIG_SYS_EXTRA_OPTIONS="SYS_SDRAM_SIZE=0x01000000"
 CONFIG_ARM=y
-CONFIG_TARGET_BCM958622HR=y
+CONFIG_TARGET_BCMNSP=y
index a93a8e1c04b797fe4d8cce58b3e232721c886519..c9a3beb79b2368d96905160052cbec38003ea2cb 100644 (file)
@@ -730,7 +730,7 @@ static int ata_scsiop_read_write(ccb *pccb, u8 is_write)
                u16 now_blocks; /* number of blocks per iteration */
                u32 transfer_size; /* number of bytes per iteration */
 
-               now_blocks = min(MAX_SATA_BLOCKS_READ_WRITE, blocks);
+               now_blocks = min((u16)MAX_SATA_BLOCKS_READ_WRITE, blocks);
 
                transfer_size = ATA_SECT_SIZE * now_blocks;
                if (transfer_size > user_buffer_size) {
index 1f510cd265c0b42657fc74b28253965bea1c3de0..b483dbb5d188888fdbacda243b2d1f78f10a5a0c 100644 (file)
@@ -519,7 +519,7 @@ int init_sata(int dev)
        u16 word;
 
        if (init_done == 1 && dev < sata_info.maxport)
-               return 1;
+               return 0;
 
        init_done = 1;
 
index 9a156bfd5e18c41d9ddcdfb4add0f63937808e11..9e2a4d2f467ee834078369344c2bf178c9d33f9c 100644 (file)
@@ -303,7 +303,7 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr,
 
 #ifdef CONFIG_SYS_FSL_DDR4
        /* tXP=max(4nCK, 6ns) */
-       int txp = max(mclk_ps * 4, 6000); /* unit=ps */
+       int txp = max((int)mclk_ps * 4, 6000); /* unit=ps */
        trwt_mclk = 2;
        twrt_mclk = 1;
        act_pd_exit_mclk = picos_to_mclk(txp);
@@ -312,7 +312,7 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr,
         * MRS_CYC = max(tMRD, tMOD)
         * tMRD = 8nCK, tMOD = max(24nCK, 15ns)
         */
-       tmrd_mclk = max(24, picos_to_mclk(15000));
+       tmrd_mclk = max(24U, picos_to_mclk(15000));
 #elif defined(CONFIG_SYS_FSL_DDR3)
        unsigned int data_rate = get_ddr_freq(0);
        int txp;
@@ -325,7 +325,7 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr,
         * spec has not the tAXPD, we use
         * tAXPD=1, need design to confirm.
         */
-       txp = max(mclk_ps * 3, (mclk_ps > 1540 ? 7500 : 6000));
+       txp = max((int)mclk_ps * 3, (mclk_ps > 1540 ? 7500 : 6000));
 
        tmrd_mclk = 4;
        /* set the turnaround time */
@@ -511,8 +511,8 @@ static void set_timing_cfg_1(fsl_ddr_cfg_regs_t *ddr,
 #ifdef CONFIG_SYS_FSL_DDR4
        refrec_ctrl = picos_to_mclk(common_dimm->trfc1_ps) - 8;
        wrrec_mclk = picos_to_mclk(common_dimm->twr_ps);
-       acttoact_mclk = max(picos_to_mclk(common_dimm->trrds_ps), 4);
-       wrtord_mclk = max(2, picos_to_mclk(2500));
+       acttoact_mclk = max(picos_to_mclk(common_dimm->trrds_ps), 4U);
+       wrtord_mclk = max(2U, picos_to_mclk(2500));
        if ((wrrec_mclk < 1) || (wrrec_mclk > 24))
                printf("Error: WRREC doesn't support %d clocks\n", wrrec_mclk);
        else
@@ -627,14 +627,14 @@ static void set_timing_cfg_2(fsl_ddr_cfg_regs_t *ddr,
        wr_data_delay = popts->write_data_delay;
 #ifdef CONFIG_SYS_FSL_DDR4
        cpo = 0;
-       cke_pls = max(3, picos_to_mclk(5000));
+       cke_pls = max(3U, picos_to_mclk(5000));
 #elif defined(CONFIG_SYS_FSL_DDR3)
        /*
         * cke pulse = max(3nCK, 7.5ns) for DDR3-800
         *             max(3nCK, 5.625ns) for DDR3-1066, 1333
         *             max(3nCK, 5ns) for DDR3-1600, 1866, 2133
         */
-       cke_pls = max(3, picos_to_mclk(mclk_ps > 1870 ? 7500 :
+       cke_pls = max(3U, picos_to_mclk(mclk_ps > 1870 ? 7500 :
                                       (mclk_ps > 1245 ? 5625 : 5000)));
 #else
        cke_pls = FSL_DDR_MIN_TCKE_PULSE_WIDTH_DDR;
@@ -1810,9 +1810,9 @@ static void set_timing_cfg_7(fsl_ddr_cfg_regs_t *ddr,
        unsigned int txpr, tcksre, tcksrx;
        unsigned int cke_rst, cksre, cksrx, par_lat, cs_to_cmd;
 
-       txpr = max(5, picos_to_mclk(common_dimm->trfc1_ps + 10000));
-       tcksre = max(5, picos_to_mclk(10000));
-       tcksrx = max(5, picos_to_mclk(10000));
+       txpr = max(5U, picos_to_mclk(common_dimm->trfc1_ps + 10000));
+       tcksre = max(5U, picos_to_mclk(10000));
+       tcksrx = max(5U, picos_to_mclk(10000));
        par_lat = 0;
        cs_to_cmd = 0;
 
@@ -1877,7 +1877,7 @@ static void set_timing_cfg_8(fsl_ddr_cfg_regs_t *ddr,
        }
 
        acttoact_bg = picos_to_mclk(common_dimm->trrdl_ps);
-       wrtord_bg = max(4, picos_to_mclk(7500));
+       wrtord_bg = max(4U, picos_to_mclk(7500));
        if (popts->otf_burst_chop_en)
                wrtord_bg += 2;
 
index 05a24dd6efdba2658cfcf68898dd7f7948edb922..73db4446153a213f127dfa31bb0bf8bd9ef74c04 100644 (file)
@@ -289,48 +289,58 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,
                 * Find minimum tckmax_ps to find fastest slow speed,
                 * i.e., this is the slowest the whole system can go.
                 */
-               tckmax_ps = min(tckmax_ps, dimm_params[i].tckmax_ps);
+               tckmax_ps = min(tckmax_ps,
+                               (unsigned int)dimm_params[i].tckmax_ps);
 #if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
-               taamin_ps = max(taamin_ps, dimm_params[i].taa_ps);
+               taamin_ps = max(taamin_ps,
+                               (unsigned int)dimm_params[i].taa_ps);
 #endif
-               tckmin_x_ps = max(tckmin_x_ps, dimm_params[i].tckmin_x_ps);
-               trcd_ps = max(trcd_ps, dimm_params[i].trcd_ps);
-               trp_ps = max(trp_ps, dimm_params[i].trp_ps);
-               tras_ps = max(tras_ps, dimm_params[i].tras_ps);
+               tckmin_x_ps = max(tckmin_x_ps,
+                                 (unsigned int)dimm_params[i].tckmin_x_ps);
+               trcd_ps = max(trcd_ps, (unsigned int)dimm_params[i].trcd_ps);
+               trp_ps = max(trp_ps, (unsigned int)dimm_params[i].trp_ps);
+               tras_ps = max(tras_ps, (unsigned int)dimm_params[i].tras_ps);
 #ifdef CONFIG_SYS_FSL_DDR4
-               trfc1_ps = max(trfc1_ps, dimm_params[i].trfc1_ps);
-               trfc2_ps = max(trfc2_ps, dimm_params[i].trfc2_ps);
-               trfc4_ps = max(trfc4_ps, dimm_params[i].trfc4_ps);
-               trrds_ps = max(trrds_ps, dimm_params[i].trrds_ps);
-               trrdl_ps = max(trrdl_ps, dimm_params[i].trrdl_ps);
-               tccdl_ps = max(tccdl_ps, dimm_params[i].tccdl_ps);
+               trfc1_ps = max(trfc1_ps,
+                              (unsigned int)dimm_params[i].trfc1_ps);
+               trfc2_ps = max(trfc2_ps,
+                              (unsigned int)dimm_params[i].trfc2_ps);
+               trfc4_ps = max(trfc4_ps,
+                              (unsigned int)dimm_params[i].trfc4_ps);
+               trrds_ps = max(trrds_ps,
+                              (unsigned int)dimm_params[i].trrds_ps);
+               trrdl_ps = max(trrdl_ps,
+                              (unsigned int)dimm_params[i].trrdl_ps);
+               tccdl_ps = max(tccdl_ps,
+                              (unsigned int)dimm_params[i].tccdl_ps);
 #else
-               twr_ps = max(twr_ps, dimm_params[i].twr_ps);
-               twtr_ps = max(twtr_ps, dimm_params[i].twtr_ps);
-               trfc_ps = max(trfc_ps, dimm_params[i].trfc_ps);
-               trrd_ps = max(trrd_ps, dimm_params[i].trrd_ps);
-               trtp_ps = max(trtp_ps, dimm_params[i].trtp_ps);
+               twr_ps = max(twr_ps, (unsigned int)dimm_params[i].twr_ps);
+               twtr_ps = max(twtr_ps, (unsigned int)dimm_params[i].twtr_ps);
+               trfc_ps = max(trfc_ps, (unsigned int)dimm_params[i].trfc_ps);
+               trrd_ps = max(trrd_ps, (unsigned int)dimm_params[i].trrd_ps);
+               trtp_ps = max(trtp_ps, (unsigned int)dimm_params[i].trtp_ps);
 #endif
-               trc_ps = max(trc_ps, dimm_params[i].trc_ps);
+               trc_ps = max(trc_ps, (unsigned int)dimm_params[i].trc_ps);
 #if defined(CONFIG_SYS_FSL_DDR1) || defined(CONFIG_SYS_FSL_DDR2)
-               tis_ps = max(tis_ps, dimm_params[i].tis_ps);
-               tih_ps = max(tih_ps, dimm_params[i].tih_ps);
-               tds_ps = max(tds_ps, dimm_params[i].tds_ps);
-               tdh_ps = max(tdh_ps, dimm_params[i].tdh_ps);
-               tqhs_ps = max(tqhs_ps, dimm_params[i].tqhs_ps);
+               tis_ps = max(tis_ps, (unsigned int)dimm_params[i].tis_ps);
+               tih_ps = max(tih_ps, (unsigned int)dimm_params[i].tih_ps);
+               tds_ps = max(tds_ps, (unsigned int)dimm_params[i].tds_ps);
+               tdh_ps = max(tdh_ps, (unsigned int)dimm_params[i].tdh_ps);
+               tqhs_ps = max(tqhs_ps, (unsigned int)dimm_params[i].tqhs_ps);
                /*
                 * Find maximum tdqsq_max_ps to find slowest.
                 *
                 * FIXME: is finding the slowest value the correct
                 * strategy for this parameter?
                 */
-               tdqsq_max_ps = max(tdqsq_max_ps, dimm_params[i].tdqsq_max_ps);
+               tdqsq_max_ps = max(tdqsq_max_ps,
+                                  (unsigned int)dimm_params[i].tdqsq_max_ps);
 #endif
                refresh_rate_ps = max(refresh_rate_ps,
-                                     dimm_params[i].refresh_rate_ps);
+                                     (unsigned int)dimm_params[i].refresh_rate_ps);
                /* extended_op_srt is either 0 or 1, 0 having priority */
                extended_op_srt = min(extended_op_srt,
-                                     dimm_params[i].extended_op_srt);
+                                     (unsigned int)dimm_params[i].extended_op_srt);
        }
 
        outpdimm->ndimms_present = number_of_dimms - temp1;
index b43b669e41ffc9be2b1bf812de30fa1eb714d6ff..6f291ebc03222c7a72f18a417f73554412b796ef 100644 (file)
@@ -106,7 +106,8 @@ static void __get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)
                i2c_write(SPD_SPA1_ADDRESS, 0, 1, &dummy, 1);
                ret = i2c_read(i2c_address, 0, 1,
                               (uchar *)((ulong)spd + 256),
-                              min(256, sizeof(generic_spd_eeprom_t) - 256));
+                              min(256,
+                                  (int)sizeof(generic_spd_eeprom_t) - 256));
        }
 #else
        ret = i2c_read(i2c_address, 0, 1, (uchar *)spd,
index 55e6a83b9ad6956ccc1013bdb227d99d5f9ddfbc..c0aba6e197c5ef3ea940685f874f75dd014c4dc4 100644 (file)
@@ -289,7 +289,7 @@ static int dfu_read_buffer_fill(struct dfu_entity *dfu, void *buf, int size)
        readn = 0;
        while (size > 0) {
                /* get chunk that can be read */
-               chunk = min(size, dfu->b_left);
+               chunk = min((long)size, dfu->b_left);
                /* consume */
                if (chunk > 0) {
                        memcpy(buf, dfu->i_buf, chunk);
index 68fe0f3b03afb99085fada927806cbe7afca6407..6a74f8961063c278a4088616e0a512ff75ddbeaa 100644 (file)
@@ -406,8 +406,8 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
        unsigned long ts; /* Timestamp */
        u32 isr_status, swap;
        u32 partialbit = 0;
-       u32 blocksize;
-       u32 pos = 0;
+       loff_t blocksize, actread;
+       loff_t pos = 0;
        int fstype;
        char *interface, *dev_part, *filename;
 
@@ -420,7 +420,7 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
        if (fs_set_blk_dev(interface, dev_part, fstype))
                return FPGA_FAIL;
 
-       if (fs_read(filename, (u32) buf, pos, blocksize) < 0)
+       if (fs_read(filename, (u32) buf, pos, blocksize, &actread) < 0)
                return FPGA_FAIL;
 
        if (zynq_validate_bitstream(desc, buf, bsize, blocksize, &swap,
@@ -443,10 +443,10 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
                        return FPGA_FAIL;
 
                if (bsize > blocksize) {
-                       if (fs_read(filename, (u32) buf, pos, blocksize) < 0)
+                       if (fs_read(filename, (u32) buf, pos, blocksize, &actread) < 0)
                                return FPGA_FAIL;
                } else {
-                       if (fs_read(filename, (u32) buf, pos, bsize) < 0)
+                       if (fs_read(filename, (u32) buf, pos, bsize, &actread) < 0)
                                return FPGA_FAIL;
                }
        } while (bsize > blocksize);
index 7bb1702bba283aa5b58000e12a4a3187a909137e..ff7f25a0ef7cdf2ce46cecc7954e654bc0d0d853 100644 (file)
@@ -127,7 +127,7 @@ static const struct {
 static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
        unsigned int i2c_clk, unsigned int speed)
 {
-       unsigned short divider = min(i2c_clk / speed, (unsigned short) -1);
+       unsigned short divider = min(i2c_clk / speed, (unsigned int)USHRT_MAX);
 
        /*
         * We want to choose an FDR/DFSR that generates an I2C bus speed that
index e403664bb561755184c60e9020e028b84169d40f..e6dba298b1e9f2a37b31b4511cf9c8902c9ff227 100644 (file)
@@ -143,7 +143,7 @@ int cros_ec_spi_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
                return -1;
        }
 
-       len = min(p[1], din_len);
+       len = min((int)p[1], din_len);
        cros_ec_dump_data("in", -1, p, len + 3);
 
        /* Response code is first byte of message */
index 3de1245699626aa4429dba9462ef398ef77bd63c..89737af9b73c417c61d55b5712d8c46f8b1ead4c 100644 (file)
@@ -122,8 +122,8 @@ static void set_timing(struct ocotp_regs *regs)
        relax = DIV_ROUND_UP(ipg_clk * BV_TIMING_RELAX_NS, 1000000000) - 1;
        strobe_read = DIV_ROUND_UP(ipg_clk * BV_TIMING_STROBE_READ_NS,
                                        1000000000) + 2 * (relax + 1) - 1;
-       strobe_prog = DIV_ROUND(ipg_clk * BV_TIMING_STROBE_PROG_US, 1000000) +
-                       2 * (relax + 1) - 1;
+       strobe_prog = DIV_ROUND_CLOSEST(ipg_clk * BV_TIMING_STROBE_PROG_US,
+                                               1000000) + 2 * (relax + 1) - 1;
 
        timing = BF(strobe_read, TIMING_STROBE_READ) |
                        BF(relax, TIMING_RELAX) |
index 26406072482f202a8ca6e2fa6cd8a54c87fbea4c..90b8ed01ccb033aba79a0a5cd1357a1fa2a40884 100644 (file)
@@ -610,7 +610,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
        cfg->cfg.f_min = 400000;
-       cfg->cfg.f_max = min(gd->arch.sdhc_clk, 52000000);
+       cfg->cfg.f_max = min(gd->arch.sdhc_clk, (u32)52000000);
 
        cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
index 1f297571e563c7c69bf653f574c890ea916ac69b..25ab0b1fc8e19b5d8213b835e3cb438f6042d2dd 100644 (file)
@@ -197,7 +197,7 @@ static int pxa_mmc_do_read_xfer(struct mmc *mmc, struct mmc_data *data)
        while (len) {
                /* The controller has data ready */
                if (readl(&regs->i_reg) & MMC_I_REG_RXFIFO_RD_REQ) {
-                       size = min(len, PXAMMC_FIFO_SIZE);
+                       size = min(len, (uint32_t)PXAMMC_FIFO_SIZE);
                        len -= size;
                        size /= 4;
 
@@ -233,14 +233,14 @@ static int pxa_mmc_do_write_xfer(struct mmc *mmc, struct mmc_data *data)
        while (len) {
                /* The controller is ready to receive data */
                if (readl(&regs->i_reg) & MMC_I_REG_TXFIFO_WR_REQ) {
-                       size = min(len, PXAMMC_FIFO_SIZE);
+                       size = min(len, (uint32_t)PXAMMC_FIFO_SIZE);
                        len -= size;
                        size /= 4;
 
                        while (size--)
                                writel(*buf++, &regs->txfifo);
 
-                       if (min(len, PXAMMC_FIFO_SIZE) < 32)
+                       if (min(len, (uint32_t)PXAMMC_FIFO_SIZE) < 32)
                                writel(MMC_PRTBUF_BUF_PART_FULL, &regs->prtbuf);
                }
 
index 65fdde8a65290eeb062f479a10ae26449d55703a..e98f537c2c36fa1d8035b4cfbc91ed2c6c0a98ee 100644 (file)
@@ -203,7 +203,7 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
                        if (ret < 0)
                                return ret;
 
-                       readlen = min(page_size - column, size);
+                       readlen = min(page_size - column, (int)size);
                        memcpy(dst, page_buffer, readlen);
 
                        column = 0;
index 1cf2f98310a17493a5a99cce29caa652cb9aabd1..be6c43ed88ac34ceeab141585a7916b4ce06c17d 100644 (file)
@@ -315,7 +315,7 @@ int sandbox_erase_part(struct sandbox_spi_flash *sbsf, int size)
        int ret;
 
        while (size > 0) {
-               todo = min(size, sizeof(sandbox_sf_0xff));
+               todo = min(size, (int)sizeof(sandbox_sf_0xff));
                ret = os_write(sbsf->fd, sandbox_sf_0xff, todo);
                if (ret != todo)
                        return ret;
index 85cf22d42ecd08761a149639ddbc2dda47ea590a..759231f2e34b6d66f55ac38e25a85c179cd50732 100644 (file)
@@ -313,10 +313,11 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
                        return ret;
 #endif
                byte_addr = offset % page_size;
-               chunk_len = min(len - actual, page_size - byte_addr);
+               chunk_len = min(len - actual, (size_t)(page_size - byte_addr));
 
                if (flash->spi->max_write_size)
-                       chunk_len = min(chunk_len, flash->spi->max_write_size);
+                       chunk_len = min(chunk_len,
+                                       (size_t)flash->spi->max_write_size);
 
                spi_flash_addr(write_addr, cmd);
 
index 623f7492c753652a8f0736658965756bd2e82438..677c89f0486f2a19f334db02b45a58a443b3e2da 100644 (file)
@@ -256,7 +256,7 @@ static void nc_puts(struct stdio_dev *dev, const char *s)
 
        len = strlen(s);
        while (len) {
-               int send_len = min(len, sizeof(input_buffer));
+               int send_len = min(len, (int)sizeof(input_buffer));
                nc_send_packet(s, send_len);
                len -= send_len;
                s += send_len;
index 60c333e2c0191d5ef8753075669a7edc3af95532..7ee21d1c1d1d039c734a64f635e0c8236569b422 100644 (file)
@@ -195,6 +195,9 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
                             bdf < PCI_BDF(bus + 1, 0, 0);
 #endif
                             bdf += PCI_BDF(0, 0, 1)) {
+                               if (pci_skip_dev(hose, bdf))
+                                       continue;
+
                                if (!PCI_FUNC(bdf)) {
                                        pci_read_config_byte(bdf,
                                                             PCI_HEADER_TYPE,
@@ -662,13 +665,15 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
 #endif
 
 #ifdef CONFIG_PCI_PNP
-               sub_bus = max(pciauto_config_device(hose, dev), sub_bus);
+               sub_bus = max((unsigned int)pciauto_config_device(hose, dev),
+                             sub_bus);
 #else
                cfg = pci_find_config(hose, class, vendor, device,
                                      PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev));
                if (cfg) {
                        cfg->config_device(hose, dev, cfg);
-                       sub_bus = max(sub_bus, hose->current_busno);
+                       sub_bus = max(sub_bus,
+                                     (unsigned int)hose->current_busno);
                }
 #endif
 
index 86ba6b523c11da2f7eb5ed47fe31b7798d1f59d1..44470fa812b0ed42ca475bb27262d1b7be0fb733 100644 (file)
@@ -387,7 +387,7 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
                n = pci_hose_scan_bus(hose, hose->current_busno);
 
                /* figure out the deepest we've gone for this leg */
-               sub_bus = max(n, sub_bus);
+               sub_bus = max((unsigned int)n, sub_bus);
                pciauto_postscan_setup_bridge(hose, dev, sub_bus);
 
                sub_bus = hose->current_busno;
index 7fb0b92078d327782e18f2004ea12b6808f35f91..75f0ec31bbfb9a6faedeaf9cf137ea1212ceefd5 100644 (file)
@@ -882,7 +882,7 @@ static int write_buffer (circbuf_t * buf)
                        space_avail =
                                current_urb->buffer_length -
                                current_urb->actual_length;
-                       popnum = min(space_avail, buf->size);
+                       popnum = min(space_avail, (int)buf->size);
                        if (popnum == 0)
                                break;
 
index ae0fe58f2c06400e2cebfbd3b9bc680354ae99be..375dc07f5f47f521d51544dd337a058873809a59 100644 (file)
@@ -273,7 +273,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
                        spi_cs_deactivate(slave);
                        return 0;
                }
-               buf_len = 2 * cmd_len + min(data_len, max_tran_len);
+               buf_len = 2 * cmd_len + min(data_len, (size_t)max_tran_len);
                len = cmd_len + data_len;
                rx_offset = cmd_len;
                buffer = (unsigned char *)malloc(buf_len);
@@ -306,7 +306,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
                if (data_in)
                        din = buffer + rx_offset;
                dout = buffer;
-               tran_len = min(data_len , max_tran_len);
+               tran_len = min(data_len, (size_t)max_tran_len);
                num_blks = DIV_ROUND_UP(tran_len + cmd_len, 4);
                num_bytes = (tran_len + cmd_len) % 4;
                fsl->data_len = tran_len + cmd_len;
index 23f2ba6223dce6d089ac6af3ac153b19d4e79844..08815994fe5d21d0effd00394cea05ce6698508c 100644 (file)
@@ -315,7 +315,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen,
                tmp = reg_read(&regs->rxdata);
                data = cpu_to_be32(tmp);
                debug("SPI Rx: 0x%x 0x%x\n", tmp, data);
-               cnt = min(nbytes, sizeof(data));
+               cnt = min_t(u32, nbytes, sizeof(data));
                if (din) {
                        memcpy(din, &data, cnt);
                        din += cnt;
index 13c6b77d73df350f943b1dd3c77ce8c7e0fef0c3..637d420a3b2120be60cee9e751ff63403f6fd904 100644 (file)
@@ -57,7 +57,7 @@ int spi_claim_bus(struct spi_slave *slave)
        speed = slave->max_hz;
        if (spi->max_hz) {
                if (speed)
-                       speed = min(speed, spi->max_hz);
+                       speed = min(speed, (int)spi->max_hz);
                else
                        speed = spi->max_hz;
        }
index eecf18cbf920ebe7721bea11178b5dbf5068b095..d09f8cee05b0940ea32c7707e5aeb4a1e6d2e90e 100644 (file)
@@ -274,7 +274,7 @@ static u32 tis_senddata(const u8 * const data, u32 len)
                 * changes to zero exactly after the last byte is fed into the
                 * FIFO.
                 */
-               count = min(burst, len - offset - 1);
+               count = min((u32)burst, len - offset - 1);
                while (count--)
                        tpm_write_byte(data[offset++],
                                  &lpc_tpm_dev[locality].data);
index 7bd25629c8ca5124b009df2b06dd423334ed7898..a4c5606527a824bca5f53a5c7514d38e2d530f8b 100644 (file)
@@ -743,8 +743,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                        if (!gadget_is_dualspeed(gadget))
                                break;
                        device_qual(cdev);
-                       value = min(w_length,
-                               sizeof(struct usb_qualifier_descriptor));
+                       value = min_t(int, w_length,
+                                     sizeof(struct usb_qualifier_descriptor));
                        break;
                case USB_DT_OTHER_SPEED_CONFIG:
                        if (!gadget_is_dualspeed(gadget))
index 3559400b284778d838f20cedc9043a29767e26c6..0db7a3b6c15566b65b4d7260603a30c59284b43f 100644 (file)
@@ -269,8 +269,8 @@ static void dw_write_noniso_tx_fifo(struct usb_endpoint_instance
                UDCDBGA("urb->buffer %p, buffer_length %d, actual_length %d",
                        urb->buffer, urb->buffer_length, urb->actual_length);
 
-               last = min(urb->actual_length - endpoint->sent,
-                          endpoint->tx_packetSize);
+               last = min_t(u32, urb->actual_length - endpoint->sent,
+                            endpoint->tx_packetSize);
 
                if (last) {
                        u8 *cp = urb->buffer + endpoint->sent;
index efd5c7fda146177cb521dd819fcae332679a60bb..942355528084b0022c475b5e35d3b136f6957e2c 100644 (file)
@@ -65,7 +65,8 @@ static int udc_write_urb(struct usb_endpoint_instance *endpoint)
        if (!urb || !urb->actual_length)
                return -1;
 
-       n = min(urb->actual_length - endpoint->sent, endpoint->tx_packetSize);
+       n = min_t(unsigned int, urb->actual_length - endpoint->sent,
+                 endpoint->tx_packetSize);
        if (n <= 0)
                return -1;
 
index 9c54b462c4ee5bb681832796c11395732df28500..7e7a2c2d906d73ec7f9a4753e9731955c191c2f9 100644 (file)
@@ -97,8 +97,8 @@ static int setdma_rx(struct s3c_ep *ep, struct s3c_request *req)
        u32 ep_num = ep_index(ep);
 
        buf = req->req.buf + req->req.actual;
-       length = min(req->req.length - req->req.actual,
-                    ep_num ? DMA_BUFFER_SIZE : ep->ep.maxpacket);
+       length = min_t(u32, req->req.length - req->req.actual,
+                      ep_num ? DMA_BUFFER_SIZE : ep->ep.maxpacket);
 
        ep->len = length;
        ep->dma_buf = buf;
index 2a5bbf5ac0e9be839f19a7cb7149927e0e9a1f30..e8142ac0922f1974c2b36c00de24eaa223d11215 100644 (file)
@@ -503,23 +503,23 @@ static int dwc_otg_submit_rh_msg_in_descriptor(struct usb_device *dev,
        case 0:
                switch (wValue & 0xff00) {
                case 0x0100:    /* device descriptor */
-                       len = min3(txlen, sizeof(root_hub_dev_des), wLength);
+                       len = min3(txlen, (int)sizeof(root_hub_dev_des), (int)wLength);
                        memcpy(buffer, root_hub_dev_des, len);
                        break;
                case 0x0200:    /* configuration descriptor */
-                       len = min3(txlen, sizeof(root_hub_config_des), wLength);
+                       len = min3(txlen, (int)sizeof(root_hub_config_des), (int)wLength);
                        memcpy(buffer, root_hub_config_des, len);
                        break;
                case 0x0300:    /* string descriptors */
                        switch (wValue & 0xff) {
                        case 0x00:
-                               len = min3(txlen, sizeof(root_hub_str_index0),
-                                          wLength);
+                               len = min3(txlen, (int)sizeof(root_hub_str_index0),
+                                          (int)wLength);
                                memcpy(buffer, root_hub_str_index0, len);
                                break;
                        case 0x01:
-                               len = min3(txlen, sizeof(root_hub_str_index1),
-                                          wLength);
+                               len = min3(txlen, (int)sizeof(root_hub_str_index1),
+                                          (int)wLength);
                                memcpy(buffer, root_hub_str_index1, len);
                                break;
                        }
@@ -556,7 +556,7 @@ static int dwc_otg_submit_rh_msg_in_descriptor(struct usb_device *dev,
                        data[10] = data[9];
                }
 
-               len = min3(txlen, data[0], wLength);
+               len = min3(txlen, (int)data[0], (int)wLength);
                memcpy(buffer, data, len);
                break;
        default:
index c671c72cb1cfc014a00b47b8b7ad38c1a52e5b0f..5520805af37a1c99b84843535d10b7e78496b452 100644 (file)
@@ -910,7 +910,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
        }
 
        mdelay(1);
-       len = min3(srclen, le16_to_cpu(req->length), length);
+       len = min3(srclen, (int)le16_to_cpu(req->length), length);
        if (srcptr != NULL && len > 0)
                memcpy(buffer, srcptr, len);
        else
index 46e4cee1d04c9dd3af28bdaa09b121f11e056719..0556f328e459b7d23b95b20a260b56c0a74ad33a 100644 (file)
@@ -103,12 +103,6 @@ static int rh_devnum;              /* address of Root Hub endpoint */
 
 /* ------------------------------------------------------------------------- */
 
-#define ALIGN(x,a)     (((x)+(a)-1UL)&~((a)-1UL))
-#define min_t(type,x,y)        \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; })
-
-/* ------------------------------------------------------------------------- */
-
 static int isp116x_reset(struct isp116x *isp116x);
 
 /* --- Debugging functions ------------------------------------------------- */
index dc0a4e31796356d818aa959acf52bf49ee002eae..97a7edeb53998713985a626faac565779d89b985 100644 (file)
@@ -47,7 +47,7 @@
 #include <asm/arch/hardware.h> /* needed for AT91_USB_HOST_BASE */
 #endif
 
-#if defined(CONFIG_ARM920T) || \
+#if defined(CONFIG_CPU_ARM920T) || \
     defined(CONFIG_S3C24X0) || \
     defined(CONFIG_440EP) || \
     defined(CONFIG_PCI_OHCI) || \
@@ -65,9 +65,6 @@
 #define OHCI_CONTROL_INIT \
        (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
 
-#define min_t(type, x, y) \
-                   ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-
 #ifdef CONFIG_PCI_OHCI
 static struct pci_device_id ohci_pci_ids[] = {
        {0x10b9, 0x5237},       /* ULI1575 PCI OHCI module ids */
index 3c659c60c97a5893309c3861ff75a06d1aefa2a8..8bb2275c09473a6e9a8e15486ea44e9849d05633 100644 (file)
@@ -35,9 +35,6 @@
 #define        OHCI_CONTROL_INIT \
        (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
 
-#define min_t(type, x, y) \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; })
-
 #undef DEBUG
 #ifdef DEBUG
 #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
index 511454479b109d3f303116e910b6d6722582d0bf..6f33456c90d0130fe6be40e2265bf21954a6e050 100644 (file)
@@ -550,9 +550,6 @@ static int check_usb_device_connecting(struct r8a66597 *r8a66597)
        return -1;      /* fail */
 }
 
-/* based on usb_ohci.c */
-#define min_t(type, x, y) \
-               ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; })
 /*-------------------------------------------------------------------------*
  * Virtual Root Hub
  *-------------------------------------------------------------------------*/
index 19c3ec62118d95c77957679de5cca93368ab24a3..b5aade988d484691d61065de2af4040e8739ed53 100644 (file)
@@ -511,7 +511,7 @@ static void record_transfer_result(struct usb_device *udev,
                                   union xhci_trb *event, int length)
 {
        udev->act_len = min(length, length -
-               EVENT_TRB_LEN(le32_to_cpu(event->trans_event.transfer_len)));
+               (int)EVENT_TRB_LEN(le32_to_cpu(event->trans_event.transfer_len)));
 
        switch (GET_COMP_CODE(le32_to_cpu(event->trans_event.transfer_len))) {
        case COMP_SUCCESS:
index 59dc096b0c3200c14c6cc39e9465c9af8e4b7578..87f2972cb266593fd6001c6be8aa9aefa37cfd97 100644 (file)
@@ -829,7 +829,7 @@ static int xhci_submit_root(struct usb_device *udev, unsigned long pipe,
        debug("scrlen = %d\n req->length = %d\n",
                srclen, le16_to_cpu(req->length));
 
-       len = min(srclen, le16_to_cpu(req->length));
+       len = min(srclen, (int)le16_to_cpu(req->length));
 
        if (srcptr != NULL && len > 0)
                memcpy(buffer, srcptr, len);
index 02b9adcbe4efb8d813654741de318b4bc7c31e0d..0c8e75d46c1e0b1a493eefe2807ac9173b874dcc 100644 (file)
@@ -37,9 +37,6 @@ extern unsigned char new[];
        ((readb(&musbr->power) & MUSB_POWER_HSMODE) \
                >> MUSB_POWER_HSMODE_SHIFT)
 
-#define min_t(type, x, y)      \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; })
-
 /* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
 
 /* destination of request */
index 38d2eb107ecd15c2d245968da5b920e551842492..618f5d93b6d1df89d090579a02973f317e34f8cf 100644 (file)
 #define DPRINT(x...) do{}while(0)
 #endif
 
-#ifndef min_t
-#define min_t(type,x,y) \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-#endif
-
 #define MAX_MAPPED_VRAM        (2048*2048*4)
 #define MIN_MAPPED_VRAM        (1024*768*1)
 
index a347e13d7de8fa5fc360524a76afdd85c70cb26e..a653bb4168551b78272f8f4f6ee087d63c7fec4b 100644 (file)
@@ -1541,14 +1541,14 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
        if (x == BMP_ALIGN_CENTER)
-               x = max(0, (VIDEO_VISIBLE_COLS - width) / 2);
+               x = max(0, (int)(VIDEO_VISIBLE_COLS - width) / 2);
        else if (x < 0)
-               x = max(0, VIDEO_VISIBLE_COLS - width + x + 1);
+               x = max(0, (int)(VIDEO_VISIBLE_COLS - width + x + 1));
 
        if (y == BMP_ALIGN_CENTER)
-               y = max(0, (VIDEO_VISIBLE_ROWS - height) / 2);
+               y = max(0, (int)(VIDEO_VISIBLE_ROWS - height) / 2);
        else if (y < 0)
-               y = max(0, VIDEO_VISIBLE_ROWS - height + y + 1);
+               y = max(0, (int)(VIDEO_VISIBLE_ROWS - height + y + 1));
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
        /*
@@ -1874,14 +1874,14 @@ static void plot_logo_or_black(void *screen, int width, int x, int y, int black)
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
        if (x == BMP_ALIGN_CENTER)
-               x = max(0, (VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH) / 2);
+               x = max(0, (int)(VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH) / 2);
        else if (x < 0)
-               x = max(0, VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH + x + 1);
+               x = max(0, (int)(VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH + x + 1));
 
        if (y == BMP_ALIGN_CENTER)
-               y = max(0, (VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT) / 2);
+               y = max(0, (int)(VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT) / 2);
        else if (y < 0)
-               y = max(0, VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1);
+               y = max(0, (int)(VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1));
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
        dest = (unsigned char *)screen + (y * width  + x) * VIDEO_PIXEL_SIZE;
@@ -2028,7 +2028,7 @@ static void *video_logo(void)
                 * we need to adjust the logo height
                 */
                if (video_logo_ypos == BMP_ALIGN_CENTER)
-                       video_logo_height += max(0, (VIDEO_VISIBLE_ROWS - \
+                       video_logo_height += max(0, (int)(VIDEO_VISIBLE_ROWS -
                                                     VIDEO_LOGO_HEIGHT) / 2);
                else if (video_logo_ypos > 0)
                        video_logo_height += video_logo_ypos;
index e0b513a4efb9f595ccec817bd5cce5c2c7b9ff6b..c77c02cdfce262cdb6910a4746b149f2b9f0d07f 100644 (file)
@@ -73,6 +73,7 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
        debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len);
 
        if (byte_offset != 0) {
+               int readlen;
                /* read first part which isn't aligned with start of sector */
                if (ext4fs_block_dev_desc->
                    block_read(ext4fs_block_dev_desc->dev,
@@ -81,13 +82,11 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
                        printf(" ** ext2fs_devread() read error **\n");
                        return 0;
                }
-               memcpy(buf, sec_buf + byte_offset,
-                       min(ext4fs_block_dev_desc->blksz
-                           - byte_offset, byte_len));
-               buf += min(ext4fs_block_dev_desc->blksz
-                          - byte_offset, byte_len);
-               byte_len -= min(ext4fs_block_dev_desc->blksz
-                               - byte_offset, byte_len);
+               readlen = min((int)ext4fs_block_dev_desc->blksz - byte_offset,
+                             byte_len);
+               memcpy(buf, sec_buf + byte_offset, readlen);
+               buf += readlen;
+               byte_len -= readlen;
                sector++;
        }
 
index cccc06a8889c59b780c7378340497d6815151ab2..cab5465b9d4f9e99158dbdc8cd2f704e090c9b4b 100644 (file)
@@ -1892,6 +1892,7 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
 {
        unsigned int fpos = 0;
        int status;
+       loff_t actread;
        struct ext2fs_node *diro = (struct ext2fs_node *) dir;
 
 #ifdef DEBUG
@@ -1909,8 +1910,8 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
 
                status = ext4fs_read_file(diro, fpos,
                                           sizeof(struct ext2_dirent),
-                                          (char *) &dirent);
-               if (status < 1)
+                                          (char *)&dirent, &actread);
+               if (status < 0)
                        return 0;
 
                if (dirent.namelen != 0) {
@@ -1921,8 +1922,9 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
                        status = ext4fs_read_file(diro,
                                                  fpos +
                                                  sizeof(struct ext2_dirent),
-                                                 dirent.namelen, filename);
-                       if (status < 1)
+                                                 dirent.namelen, filename,
+                                                 &actread);
+                       if (status < 0)
                                return 0;
 
                        fdiro = zalloc(sizeof(struct ext2fs_node));
@@ -2004,8 +2006,8 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
                                        printf("< ? > ");
                                        break;
                                }
-                               printf("%10d %s\n",
-                                       __le32_to_cpu(fdiro->inode.size),
+                               printf("%10u %s\n",
+                                      __le32_to_cpu(fdiro->inode.size),
                                        filename);
                        }
                        free(fdiro);
@@ -2020,6 +2022,7 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node)
        char *symlink;
        struct ext2fs_node *diro = node;
        int status;
+       loff_t actread;
 
        if (!diro->inode_read) {
                status = ext4fs_read_inode(diro->data, diro->ino, &diro->inode);
@@ -2036,7 +2039,7 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node)
        } else {
                status = ext4fs_read_file(diro, 0,
                                           __le32_to_cpu(diro->inode.size),
-                                          symlink);
+                                          symlink, &actread);
                if (status == 0) {
                        free(symlink);
                        return 0;
@@ -2170,11 +2173,10 @@ int ext4fs_find_file(const char *path, struct ext2fs_node *rootnode,
        return 1;
 }
 
-int ext4fs_open(const char *filename)
+int ext4fs_open(const char *filename, loff_t *len)
 {
        struct ext2fs_node *fdiro = NULL;
        int status;
-       int len;
 
        if (ext4fs_root == NULL)
                return -1;
@@ -2191,10 +2193,10 @@ int ext4fs_open(const char *filename)
                if (status == 0)
                        goto fail;
        }
-       len = __le32_to_cpu(fdiro->inode.size);
+       *len = __le32_to_cpu(fdiro->inode.size);
        ext4fs_file = fdiro;
 
-       return len;
+       return 0;
 fail:
        ext4fs_free_node(fdiro, &ext4fs_root->diropen);
 
index 5fa1719f2eebdcaf5107690040d909ee56e1e566..48fd2ac51dbb2761f233122ba7c801e946c94ef2 100644 (file)
@@ -50,8 +50,8 @@ static inline void *zalloc(size_t size)
 
 int ext4fs_read_inode(struct ext2_data *data, int ino,
                      struct ext2_inode *inode);
-int ext4fs_read_file(struct ext2fs_node *node, int pos,
-               unsigned int len, char *buf);
+int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, loff_t len,
+                    char *buf, loff_t *actread);
 int ext4fs_find_file(const char *path, struct ext2fs_node *rootnode,
                        struct ext2fs_node **foundnode, int expecttype);
 int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
index 648a59672c31eec1fcd0b409a185eb079670004a..f7c52cc4cc1493c81d4a2467a67196a3df6eaf07 100644 (file)
@@ -975,3 +975,35 @@ fail:
 
        return -1;
 }
+
+int ext4_write_file(const char *filename, void *buf, loff_t offset,
+                   loff_t len, loff_t *actwrite)
+{
+       int ret;
+
+       if (offset != 0) {
+               printf("** Cannot support non-zero offset **\n");
+               return -1;
+       }
+
+       /* mount the filesystem */
+       if (!ext4fs_mount(0)) {
+               printf("** Error Bad ext4 partition **\n");
+               goto fail;
+       }
+
+       ret = ext4fs_write(filename, buf, len);
+
+       if (ret) {
+               printf("** Error ext4fs_write() **\n");
+               goto fail;
+       }
+       ext4fs_close();
+
+       return 0;
+
+fail:
+       ext4fs_close();
+
+       return -1;
+}
index cbdc22026deb63a24968cbd3c0078407940bc5a2..943b5bcf35e903382dbc7f928d6577b6874c51c4 100644 (file)
@@ -45,8 +45,8 @@ void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot)
  * Optimized read file API : collects and defers contiguous sector
  * reads into one potentially more efficient larger sequential read action
  */
-int ext4fs_read_file(struct ext2fs_node *node, int pos,
-               unsigned int len, char *buf)
+int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
+               loff_t len, char *buf, loff_t *actread)
 {
        struct ext_filesystem *fs = get_fs();
        int i;
@@ -150,7 +150,8 @@ int ext4fs_read_file(struct ext2fs_node *node, int pos,
                previous_block_number = -1;
        }
 
-       return len;
+       *actread  = len;
+       return 0;
 }
 
 int ext4fs_ls(const char *dirname)
@@ -176,23 +177,24 @@ int ext4fs_ls(const char *dirname)
 
 int ext4fs_exists(const char *filename)
 {
-       int file_len;
+       loff_t file_len;
+       int ret;
 
-       file_len = ext4fs_open(filename);
-       return file_len >= 0;
+       ret = ext4fs_open(filename, &file_len);
+       return ret == 0;
 }
 
-int ext4fs_size(const char *filename)
+int ext4fs_size(const char *filename, loff_t *size)
 {
-       return ext4fs_open(filename);
+       return ext4fs_open(filename, size);
 }
 
-int ext4fs_read(char *buf, unsigned len)
+int ext4fs_read(char *buf, loff_t len, loff_t *actread)
 {
        if (ext4fs_root == NULL || ext4fs_file == NULL)
                return 0;
 
-       return ext4fs_read_file(ext4fs_file, 0, len, buf);
+       return ext4fs_read_file(ext4fs_file, 0, len, buf, actread);
 }
 
 int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
@@ -208,18 +210,19 @@ int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
        return 0;
 }
 
-int ext4_read_file(const char *filename, void *buf, int offset, int len)
+int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+                  loff_t *len_read)
 {
-       int file_len;
-       int len_read;
+       loff_t file_len;
+       int ret;
 
        if (offset != 0) {
                printf("** Cannot support non-zero offset **\n");
                return -1;
        }
 
-       file_len = ext4fs_open(filename);
-       if (file_len < 0) {
+       ret = ext4fs_open(filename, &file_len);
+       if (ret < 0) {
                printf("** File not found %s **\n", filename);
                return -1;
        }
@@ -227,7 +230,20 @@ int ext4_read_file(const char *filename, void *buf, int offset, int len)
        if (len == 0)
                len = file_len;
 
-       len_read = ext4fs_read(buf, len);
+       return ext4fs_read(buf, len, len_read);
+}
 
-       return len_read;
+int ext4fs_uuid(char *uuid_str)
+{
+       if (ext4fs_root == NULL)
+               return -1;
+
+#ifdef CONFIG_LIB_UUID
+       uuid_bin_to_str((unsigned char *)ext4fs_root->sblock.unique_id,
+                       uuid_str, UUID_STR_FORMAT_STD);
+
+       return 0;
+#else
+       return -ENOSYS;
+#endif
 }
index 561921fa2d364e548629fe8152cb953861699b3f..04a51db6d4cd9e278cdf09959af2f86408864278 100644 (file)
@@ -317,32 +317,32 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size)
 /*
  * Read at most 'maxsize' bytes from 'pos' in the file associated with 'dentptr'
  * into 'buffer'.
- * Return the number of bytes read or -1 on fatal errors.
+ * Update the number of bytes read in *gotsize or return -1 on fatal errors.
  */
 __u8 get_contents_vfatname_block[MAX_CLUSTSIZE]
        __aligned(ARCH_DMA_MINALIGN);
 
-static long
-get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
-            __u8 *buffer, unsigned long maxsize)
+static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
+                       __u8 *buffer, loff_t maxsize, loff_t *gotsize)
 {
-       unsigned long filesize = FAT2CPU32(dentptr->size), gotsize = 0;
+       loff_t filesize = FAT2CPU32(dentptr->size);
        unsigned int bytesperclust = mydata->clust_size * mydata->sect_size;
        __u32 curclust = START(dentptr);
        __u32 endclust, newclust;
-       unsigned long actsize;
+       loff_t actsize;
 
-       debug("Filesize: %ld bytes\n", filesize);
+       *gotsize = 0;
+       debug("Filesize: %llu bytes\n", filesize);
 
        if (pos >= filesize) {
-               debug("Read position past EOF: %lu\n", pos);
-               return gotsize;
+               debug("Read position past EOF: %llu\n", pos);
+               return 0;
        }
 
        if (maxsize > 0 && filesize > pos + maxsize)
                filesize = pos + maxsize;
 
-       debug("%ld bytes\n", filesize);
+       debug("%llu bytes\n", filesize);
 
        actsize = bytesperclust;
 
@@ -352,7 +352,7 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
                if (CHECK_CLUST(curclust, mydata->fatsize)) {
                        debug("curclust: 0x%x\n", curclust);
                        debug("Invalid FAT entry\n");
-                       return gotsize;
+                       return 0;
                }
                actsize += bytesperclust;
        }
@@ -364,7 +364,7 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
 
        /* align to beginning of next cluster if any */
        if (pos) {
-               actsize = min(filesize, bytesperclust);
+               actsize = min(filesize, (loff_t)bytesperclust);
                if (get_cluster(mydata, curclust, get_contents_vfatname_block,
                                (int)actsize) != 0) {
                        printf("Error reading cluster\n");
@@ -373,16 +373,16 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
                filesize -= actsize;
                actsize -= pos;
                memcpy(buffer, get_contents_vfatname_block + pos, actsize);
-               gotsize += actsize;
+               *gotsize += actsize;
                if (!filesize)
-                       return gotsize;
+                       return 0;
                buffer += actsize;
 
                curclust = get_fatent(mydata, curclust);
                if (CHECK_CLUST(curclust, mydata->fatsize)) {
                        debug("curclust: 0x%x\n", curclust);
                        debug("Invalid FAT entry\n");
-                       return gotsize;
+                       return 0;
                }
        }
 
@@ -398,7 +398,7 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
                        if (CHECK_CLUST(newclust, mydata->fatsize)) {
                                debug("curclust: 0x%x\n", newclust);
                                debug("Invalid FAT entry\n");
-                               return gotsize;
+                               return 0;
                        }
                        endclust = newclust;
                        actsize += bytesperclust;
@@ -410,14 +410,14 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos,
                        printf("Error reading cluster\n");
                        return -1;
                }
-               gotsize += actsize;
-               return gotsize;
+               *gotsize += actsize;
+               return 0;
 getit:
                if (get_cluster(mydata, curclust, buffer, (int)actsize) != 0) {
                        printf("Error reading cluster\n");
                        return -1;
                }
-               gotsize += (int)actsize;
+               *gotsize += (int)actsize;
                filesize -= actsize;
                buffer += actsize;
 
@@ -425,7 +425,7 @@ getit:
                if (CHECK_CLUST(curclust, mydata->fatsize)) {
                        debug("curclust: 0x%x\n", curclust);
                        printf("Invalid FAT entry\n");
-                       return gotsize;
+                       return 0;
                }
                actsize = bytesperclust;
                endclust = curclust;
@@ -633,8 +633,8 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
                                                }
                                                if (doit) {
                                                        if (dirc == ' ') {
-                                                               printf(" %8ld   %s%c\n",
-                                                                       (long)FAT2CPU32(dentptr->size),
+                                                               printf(" %8u   %s%c\n",
+                                                                      FAT2CPU32(dentptr->size),
                                                                        l_name,
                                                                        dirc);
                                                        } else {
@@ -690,8 +690,8 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 
                                if (doit) {
                                        if (dirc == ' ') {
-                                               printf(" %8ld   %s%c\n",
-                                                       (long)FAT2CPU32(dentptr->size),
+                                               printf(" %8u   %s%c\n",
+                                                      FAT2CPU32(dentptr->size),
                                                        s_name, dirc);
                                        } else {
                                                printf("            %s%c\n",
@@ -806,9 +806,8 @@ exit:
 __u8 do_fat_read_at_block[MAX_CLUSTSIZE]
        __aligned(ARCH_DMA_MINALIGN);
 
-long
-do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
-              unsigned long maxsize, int dols, int dogetsize)
+int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
+                  loff_t maxsize, int dols, int dogetsize, loff_t *size)
 {
        char fnamecopy[2048];
        boot_sector bs;
@@ -821,7 +820,7 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
        __u32 cursect;
        int idx, isdir = 0;
        int files = 0, dirs = 0;
-       long ret = -1;
+       int ret = -1;
        int firsttime;
        __u32 root_cluster = 0;
        int rootdir_size = 0;
@@ -974,8 +973,8 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
                                                }
                                                if (doit) {
                                                        if (dirc == ' ') {
-                                                               printf(" %8ld   %s%c\n",
-                                                                       (long)FAT2CPU32(dentptr->size),
+                                                               printf(" %8u   %s%c\n",
+                                                                      FAT2CPU32(dentptr->size),
                                                                        l_name,
                                                                        dirc);
                                                        } else {
@@ -1032,8 +1031,8 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
                                }
                                if (doit) {
                                        if (dirc == ' ') {
-                                               printf(" %8ld   %s%c\n",
-                                                       (long)FAT2CPU32(dentptr->size),
+                                               printf(" %8u   %s%c\n",
+                                                      FAT2CPU32(dentptr->size),
                                                        s_name, dirc);
                                        } else {
                                                printf("            %s%c\n",
@@ -1102,7 +1101,7 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
                        if (dols == LS_ROOT) {
                                printf("\n%d file(s), %d dir(s)\n\n",
                                       files, dirs);
-                               ret = 0;
+                               *size = 0;
                        }
                        goto exit;
                }
@@ -1141,7 +1140,7 @@ rootdir_done:
                if (get_dentfromdir(mydata, startsect, subname, dentptr,
                                     isdir ? 0 : dols) == NULL) {
                        if (dols && !isdir)
-                               ret = 0;
+                               *size = 0;
                        goto exit;
                }
 
@@ -1152,21 +1151,23 @@ rootdir_done:
                        subname = nextname;
        }
 
-       if (dogetsize)
-               ret = FAT2CPU32(dentptr->size);
-       else
-               ret = get_contents(mydata, dentptr, pos, buffer, maxsize);
-       debug("Size: %d, got: %ld\n", FAT2CPU32(dentptr->size), ret);
+       if (dogetsize) {
+               *size = FAT2CPU32(dentptr->size);
+               ret = 0;
+       } else {
+               ret = get_contents(mydata, dentptr, pos, buffer, maxsize, size);
+       }
+       debug("Size: %u, got: %llu\n", FAT2CPU32(dentptr->size), *size);
 
 exit:
        free(mydata->fatbuf);
        return ret;
 }
 
-long
-do_fat_read(const char *filename, void *buffer, unsigned long maxsize, int dols)
+int do_fat_read(const char *filename, void *buffer, loff_t maxsize, int dols,
+               loff_t *actread)
 {
-       return do_fat_read_at(filename, 0, buffer, maxsize, dols, 0);
+       return do_fat_read_at(filename, 0, buffer, maxsize, dols, 0, actread);
 }
 
 int file_fat_detectfs(void)
@@ -1233,44 +1234,55 @@ int file_fat_detectfs(void)
 
 int file_fat_ls(const char *dir)
 {
-       return do_fat_read(dir, NULL, 0, LS_YES);
+       loff_t size;
+
+       return do_fat_read(dir, NULL, 0, LS_YES, &size);
 }
 
 int fat_exists(const char *filename)
 {
-       int sz;
-       sz = do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1);
-       return sz >= 0;
+       int ret;
+       loff_t size;
+
+       ret = do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1, &size);
+       return ret == 0;
 }
 
-int fat_size(const char *filename)
+int fat_size(const char *filename, loff_t *size)
 {
-       return do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1);
+       return do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1, size);
 }
 
-long file_fat_read_at(const char *filename, unsigned long pos, void *buffer,
-                     unsigned long maxsize)
+int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
+                    loff_t maxsize, loff_t *actread)
 {
        printf("reading %s\n", filename);
-       return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO, 0);
+       return do_fat_read_at(filename, pos, buffer, maxsize, LS_NO, 0,
+                             actread);
 }
 
-long file_fat_read(const char *filename, void *buffer, unsigned long maxsize)
+int file_fat_read(const char *filename, void *buffer, int maxsize)
 {
-       return file_fat_read_at(filename, 0, buffer, maxsize);
+       loff_t actread;
+       int ret;
+
+       ret =  file_fat_read_at(filename, 0, buffer, maxsize, &actread);
+       if (ret)
+               return ret;
+       else
+               return actread;
 }
 
-int fat_read_file(const char *filename, void *buf, int offset, int len)
+int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+                 loff_t *actread)
 {
-       int len_read;
+       int ret;
 
-       len_read = file_fat_read_at(filename, offset, buf, len);
-       if (len_read == -1) {
+       ret = file_fat_read_at(filename, offset, buf, len, actread);
+       if (ret)
                printf("** Unable to read file %s **\n", filename);
-               return -1;
-       }
 
-       return len_read;
+       return ret;
 }
 
 void fat_close(void)
index 24ed5d371502e651f2c5a3a41b0cb90e1ffc11b2..88dd4959ccde28f0e541dfc31f5fb924988685c1 100644 (file)
@@ -660,24 +660,26 @@ static int clear_fatent(fsdata *mydata, __u32 entry)
 /*
  * Write at most 'maxsize' bytes from 'buffer' into
  * the file associated with 'dentptr'
- * Return the number of bytes read or -1 on fatal errors.
+ * Update the number of bytes written in *gotsize and return 0
+ * or return -1 on fatal errors.
  */
 static int
 set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
-             unsigned long maxsize)
+             loff_t maxsize, loff_t *gotsize)
 {
-       unsigned long filesize = FAT2CPU32(dentptr->size), gotsize = 0;
+       loff_t filesize = FAT2CPU32(dentptr->size);
        unsigned int bytesperclust = mydata->clust_size * mydata->sect_size;
        __u32 curclust = START(dentptr);
        __u32 endclust = 0, newclust = 0;
-       unsigned long actsize;
+       loff_t actsize;
 
-       debug("Filesize: %ld bytes\n", filesize);
+       *gotsize = 0;
+       debug("Filesize: %llu bytes\n", filesize);
 
        if (maxsize > 0 && filesize > maxsize)
                filesize = maxsize;
 
-       debug("%ld bytes\n", filesize);
+       debug("%llu bytes\n", filesize);
 
        actsize = bytesperclust;
        endclust = curclust;
@@ -692,7 +694,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
                        if (CHECK_CLUST(newclust, mydata->fatsize)) {
                                debug("curclust: 0x%x\n", newclust);
                                debug("Invalid FAT entry\n");
-                               return gotsize;
+                               return 0;
                        }
                        endclust = newclust;
                        actsize += bytesperclust;
@@ -706,7 +708,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
                }
 
                /* set remaining bytes */
-               gotsize += (int)actsize;
+               *gotsize += actsize;
                filesize -= actsize;
                buffer += actsize;
                actsize = filesize;
@@ -715,7 +717,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
                        debug("error: writing cluster\n");
                        return -1;
                }
-               gotsize += actsize;
+               *gotsize += actsize;
 
                /* Mark end of file in FAT */
                if (mydata->fatsize == 16)
@@ -724,20 +726,20 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
                        newclust = 0xfffffff;
                set_fatent_value(mydata, endclust, newclust);
 
-               return gotsize;
+               return 0;
 getit:
                if (set_cluster(mydata, curclust, buffer, (int)actsize) != 0) {
                        debug("error: writing cluster\n");
                        return -1;
                }
-               gotsize += (int)actsize;
+               *gotsize += actsize;
                filesize -= actsize;
                buffer += actsize;
 
                if (CHECK_CLUST(curclust, mydata->fatsize)) {
                        debug("curclust: 0x%x\n", curclust);
                        debug("Invalid FAT entry\n");
-                       return gotsize;
+                       return 0;
                }
                actsize = bytesperclust;
                curclust = endclust = newclust;
@@ -766,7 +768,7 @@ static void fill_dentry(fsdata *mydata, dir_entry *dentptr,
  * exceed the size of the block device
  * Return -1 when overflow occurs, otherwise return 0
  */
-static int check_overflow(fsdata *mydata, __u32 clustnum, unsigned long size)
+static int check_overflow(fsdata *mydata, __u32 clustnum, loff_t size)
 {
        __u32 startsect, sect_num;
 
@@ -923,8 +925,8 @@ static dir_entry *find_directory_entry(fsdata *mydata, int startsect,
        return NULL;
 }
 
-static int do_fat_write(const char *filename, void *buffer,
-       unsigned long size)
+static int do_fat_write(const char *filename, void *buffer, loff_t size,
+                       loff_t *actwrite)
 {
        dir_entry *dentptr, *retdent;
        __u32 startsect;
@@ -936,8 +938,8 @@ static int do_fat_write(const char *filename, void *buffer,
        int cursect;
        int ret = -1, name_len;
        char l_filename[VFAT_MAXLEN_BYTES];
-       int write_size = size;
 
+       *actwrite = size;
        dir_curclust = 0;
 
        if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) {
@@ -1015,7 +1017,7 @@ static int do_fat_write(const char *filename, void *buffer,
 
                ret = check_overflow(mydata, start_cluster, size);
                if (ret) {
-                       printf("Error: %ld overflow\n", size);
+                       printf("Error: %llu overflow\n", size);
                        goto exit;
                }
 
@@ -1025,13 +1027,12 @@ static int do_fat_write(const char *filename, void *buffer,
                        goto exit;
                }
 
-               ret = set_contents(mydata, retdent, buffer, size);
+               ret = set_contents(mydata, retdent, buffer, size, actwrite);
                if (ret < 0) {
                        printf("Error: writing contents\n");
                        goto exit;
                }
-               write_size = ret;
-               debug("attempt to write 0x%x bytes\n", write_size);
+               debug("attempt to write 0x%llx bytes\n", *actwrite);
 
                /* Flush fat buffer */
                ret = flush_fat_buffer(mydata);
@@ -1061,7 +1062,7 @@ static int do_fat_write(const char *filename, void *buffer,
 
                ret = check_overflow(mydata, start_cluster, size);
                if (ret) {
-                       printf("Error: %ld overflow\n", size);
+                       printf("Error: %llu overflow\n", size);
                        goto exit;
                }
 
@@ -1069,13 +1070,13 @@ static int do_fat_write(const char *filename, void *buffer,
                fill_dentry(mydata, empty_dentptr, filename,
                        start_cluster, size, 0x20);
 
-               ret = set_contents(mydata, empty_dentptr, buffer, size);
+               ret = set_contents(mydata, empty_dentptr, buffer, size,
+                                  actwrite);
                if (ret < 0) {
                        printf("Error: writing contents\n");
                        goto exit;
                }
-               write_size = ret;
-               debug("attempt to write 0x%x bytes\n", write_size);
+               debug("attempt to write 0x%llx bytes\n", *actwrite);
 
                /* Flush fat buffer */
                ret = flush_fat_buffer(mydata);
@@ -1096,11 +1097,17 @@ static int do_fat_write(const char *filename, void *buffer,
 
 exit:
        free(mydata->fatbuf);
-       return ret < 0 ? ret : write_size;
+       return ret;
 }
 
-int file_fat_write(const char *filename, void *buffer, unsigned long maxsize)
+int file_fat_write(const char *filename, void *buffer, loff_t offset,
+                  loff_t maxsize, loff_t *actwrite)
 {
+       if (offset != 0) {
+               printf("Error: non zero offset is currently not suported.\n");
+               return -1;
+       }
+
        printf("writing %s\n", filename);
-       return do_fat_write(filename, buffer, maxsize);
+       return do_fat_write(filename, buffer, maxsize, actwrite);
 }
index d910c46ddb159d5cf43a009f0d9248b5cd9768b2..89706117b9410c1be7363f268881e75640b36b2a 100644 (file)
@@ -162,8 +162,7 @@ file_ls(const char *dir)
        return filesystems[current_filesystem].ls(arg);
 }
 
-long
-file_read(const char *filename, void *buffer, unsigned long maxsize)
+int file_read(const char *filename, void *buffer, int maxsize)
 {
        char fullpath[1024];
        const char *arg;
diff --git a/fs/fs.c b/fs/fs.c
index dd680f39c9ca60472ea91f37a7a325f95da3b672..3da78606d1281f93ebe3108b9a7bd8f6e5f31edc 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -15,6 +15,7 @@
  */
 
 #include <config.h>
+#include <errno.h>
 #include <common.h>
 #include <part.h>
 #include <ext4fs.h>
@@ -46,19 +47,21 @@ static inline int fs_exists_unsupported(const char *filename)
        return 0;
 }
 
-static inline int fs_size_unsupported(const char *filename)
+static inline int fs_size_unsupported(const char *filename, loff_t *size)
 {
        return -1;
 }
 
 static inline int fs_read_unsupported(const char *filename, void *buf,
-                                     int offset, int len)
+                                     loff_t offset, loff_t len,
+                                     loff_t *actread)
 {
        return -1;
 }
 
 static inline int fs_write_unsupported(const char *filename, void *buf,
-                                     int offset, int len)
+                                     loff_t offset, loff_t len,
+                                     loff_t *actwrite)
 {
        return -1;
 }
@@ -67,6 +70,11 @@ static inline void fs_close_unsupported(void)
 {
 }
 
+static inline int fs_uuid_unsupported(char *uuid_str)
+{
+       return -1;
+}
+
 struct fstype_info {
        int fstype;
        /*
@@ -82,10 +90,13 @@ struct fstype_info {
                     disk_partition_t *fs_partition);
        int (*ls)(const char *dirname);
        int (*exists)(const char *filename);
-       int (*size)(const char *filename);
-       int (*read)(const char *filename, void *buf, int offset, int len);
-       int (*write)(const char *filename, void *buf, int offset, int len);
+       int (*size)(const char *filename, loff_t *size);
+       int (*read)(const char *filename, void *buf, loff_t offset,
+                   loff_t len, loff_t *actread);
+       int (*write)(const char *filename, void *buf, loff_t offset,
+                    loff_t len, loff_t *actwrite);
        void (*close)(void);
+       int (*uuid)(char *uuid_str);
 };
 
 static struct fstype_info fstypes[] = {
@@ -99,7 +110,12 @@ static struct fstype_info fstypes[] = {
                .exists = fat_exists,
                .size = fat_size,
                .read = fat_read_file,
+#ifdef CONFIG_FAT_WRITE
+               .write = file_fat_write,
+#else
                .write = fs_write_unsupported,
+#endif
+               .uuid = fs_uuid_unsupported,
        },
 #endif
 #ifdef CONFIG_FS_EXT4
@@ -112,7 +128,12 @@ static struct fstype_info fstypes[] = {
                .exists = ext4fs_exists,
                .size = ext4fs_size,
                .read = ext4_read_file,
+#ifdef CONFIG_CMD_EXT4_WRITE
+               .write = ext4_write_file,
+#else
                .write = fs_write_unsupported,
+#endif
+               .uuid = ext4fs_uuid,
        },
 #endif
 #ifdef CONFIG_SANDBOX
@@ -126,6 +147,7 @@ static struct fstype_info fstypes[] = {
                .size = sandbox_fs_size,
                .read = fs_read_sandbox,
                .write = fs_write_sandbox,
+               .uuid = fs_uuid_unsupported,
        },
 #endif
        {
@@ -138,6 +160,7 @@ static struct fstype_info fstypes[] = {
                .size = fs_size_unsupported,
                .read = fs_read_unsupported,
                .write = fs_write_unsupported,
+               .uuid = fs_uuid_unsupported,
        },
 };
 
@@ -206,6 +229,13 @@ static void fs_close(void)
        fs_type = FS_TYPE_ANY;
 }
 
+int fs_uuid(char *uuid_str)
+{
+       struct fstype_info *info = fs_get_info(fs_type);
+
+       return info->uuid(uuid_str);
+}
+
 int fs_ls(const char *dirname)
 {
        int ret;
@@ -233,20 +263,21 @@ int fs_exists(const char *filename)
        return ret;
 }
 
-int fs_size(const char *filename)
+int fs_size(const char *filename, loff_t *size)
 {
        int ret;
 
        struct fstype_info *info = fs_get_info(fs_type);
 
-       ret = info->size(filename);
+       ret = info->size(filename, size);
 
        fs_close();
 
        return ret;
 }
 
-int fs_read(const char *filename, ulong addr, int offset, int len)
+int fs_read(const char *filename, ulong addr, loff_t offset, loff_t len,
+           loff_t *actread)
 {
        struct fstype_info *info = fs_get_info(fs_type);
        void *buf;
@@ -257,11 +288,11 @@ int fs_read(const char *filename, ulong addr, int offset, int len)
         * means read the whole file.
         */
        buf = map_sysmem(addr, len);
-       ret = info->read(filename, buf, offset, len);
+       ret = info->read(filename, buf, offset, len, actread);
        unmap_sysmem(buf);
 
        /* If we requested a specific number of bytes, check we got it */
-       if (ret >= 0 && len && ret != len) {
+       if (ret == 0 && len && *actread != len) {
                printf("** Unable to read file %s **\n", filename);
                ret = -1;
        }
@@ -270,17 +301,18 @@ int fs_read(const char *filename, ulong addr, int offset, int len)
        return ret;
 }
 
-int fs_write(const char *filename, ulong addr, int offset, int len)
+int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
+            loff_t *actwrite)
 {
        struct fstype_info *info = fs_get_info(fs_type);
        void *buf;
        int ret;
 
        buf = map_sysmem(addr, len);
-       ret = info->write(filename, buf, offset, len);
+       ret = info->write(filename, buf, offset, len, actwrite);
        unmap_sysmem(buf);
 
-       if (ret >= 0 && ret != len) {
+       if (ret < 0 && len != *actwrite) {
                printf("** Unable to write file %s **\n", filename);
                ret = -1;
        }
@@ -292,7 +324,7 @@ int fs_write(const char *filename, ulong addr, int offset, int len)
 int do_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype)
 {
-       int size;
+       loff_t size;
 
        if (argc != 4)
                return CMD_RET_USAGE;
@@ -300,8 +332,7 @@ int do_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        if (fs_set_blk_dev(argv[1], argv[2], fstype))
                return 1;
 
-       size = fs_size(argv[3]);
-       if (size < 0)
+       if (fs_size(argv[3], &size) < 0)
                return CMD_RET_FAILURE;
 
        setenv_hex("filesize", size);
@@ -315,9 +346,10 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        unsigned long addr;
        const char *addr_str;
        const char *filename;
-       unsigned long bytes;
-       unsigned long pos;
-       int len_read;
+       loff_t bytes;
+       loff_t pos;
+       loff_t len_read;
+       int ret;
        unsigned long time;
        char *ep;
 
@@ -359,12 +391,12 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                pos = 0;
 
        time = get_timer(0);
-       len_read = fs_read(filename, addr, pos, bytes);
+       ret = fs_read(filename, addr, pos, bytes, &len_read);
        time = get_timer(time);
-       if (len_read <= 0)
+       if (ret < 0)
                return 1;
 
-       printf("%d bytes read in %lu ms", len_read, time);
+       printf("%llu bytes read in %lu ms", len_read, time);
        if (time > 0) {
                puts(" (");
                print_size(len_read / time * 1000, "/s");
@@ -408,9 +440,10 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 {
        unsigned long addr;
        const char *filename;
-       unsigned long bytes;
-       unsigned long pos;
-       int len;
+       loff_t bytes;
+       loff_t pos;
+       loff_t len;
+       int ret;
        unsigned long time;
 
        if (argc < 6 || argc > 7)
@@ -419,8 +452,8 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        if (fs_set_blk_dev(argv[1], argv[2], fstype))
                return 1;
 
-       filename = argv[3];
-       addr = simple_strtoul(argv[4], NULL, 16);
+       addr = simple_strtoul(argv[3], NULL, 16);
+       filename = argv[4];
        bytes = simple_strtoul(argv[5], NULL, 16);
        if (argc >= 7)
                pos = simple_strtoul(argv[6], NULL, 16);
@@ -428,12 +461,12 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                pos = 0;
 
        time = get_timer(0);
-       len = fs_write(filename, addr, pos, bytes);
+       ret = fs_write(filename, addr, pos, bytes, &len);
        time = get_timer(time);
-       if (len <= 0)
+       if (ret < 0)
                return 1;
 
-       printf("%d bytes written in %lu ms", len, time);
+       printf("%llu bytes written in %lu ms", len, time);
        if (time > 0) {
                puts(" (");
                print_size(len / time * 1000, "/s");
@@ -443,3 +476,28 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 
        return 0;
 }
+
+int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+               int fstype)
+{
+       int ret;
+       char uuid[37];
+       memset(uuid, 0, sizeof(uuid));
+
+       if (argc < 3 || argc > 4)
+               return CMD_RET_USAGE;
+
+       if (fs_set_blk_dev(argv[1], argv[2], fstype))
+               return 1;
+
+       ret = fs_uuid(uuid);
+       if (ret)
+               return CMD_RET_FAILURE;
+
+       if (argc == 4)
+               setenv(argv[3], uuid);
+       else
+               printf("%s\n", uuid);
+
+       return CMD_RET_SUCCESS;
+}
index ba6402c81c0a5a16ac10838cf0c5981331e9031c..a920bc087712ff289c65eec948f0f234229f9f5c 100644 (file)
@@ -13,10 +13,10 @@ int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
        return 0;
 }
 
-long sandbox_fs_read_at(const char *filename, unsigned long pos,
-                            void *buffer, unsigned long maxsize)
+int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
+                      loff_t maxsize, loff_t *actread)
 {
-       ssize_t size;
+       loff_t size;
        int fd, ret;
 
        fd = os_open(filename, OS_O_RDONLY);
@@ -27,16 +27,31 @@ long sandbox_fs_read_at(const char *filename, unsigned long pos,
                os_close(fd);
                return ret;
        }
-       if (!maxsize)
-               maxsize = os_get_filesize(filename);
+       if (!maxsize) {
+               ret = os_get_filesize(filename, &size);
+               if (ret) {
+                       os_close(fd);
+                       return ret;
+               }
+
+               maxsize = size;
+       }
+
        size = os_read(fd, buffer, maxsize);
        os_close(fd);
 
-       return size;
+       if (size < 0) {
+               ret = -1;
+       } else {
+               ret = 0;
+               *actread = size;
+       }
+
+       return ret;
 }
 
-long sandbox_fs_write_at(const char *filename, unsigned long pos,
-                        void *buffer, unsigned long towrite)
+int sandbox_fs_write_at(const char *filename, loff_t pos, void *buffer,
+                       loff_t towrite, loff_t *actwrite)
 {
        ssize_t size;
        int fd, ret;
@@ -52,7 +67,14 @@ long sandbox_fs_write_at(const char *filename, unsigned long pos,
        size = os_write(fd, buffer, towrite);
        os_close(fd);
 
-       return size;
+       if (size == -1) {
+               ret = -1;
+       } else {
+               ret = 0;
+               *actwrite = size;
+       }
+
+       return ret;
 }
 
 int sandbox_fs_ls(const char *dirname)
@@ -74,43 +96,42 @@ int sandbox_fs_ls(const char *dirname)
 
 int sandbox_fs_exists(const char *filename)
 {
-       ssize_t sz;
+       loff_t size;
+       int ret;
 
-       sz = os_get_filesize(filename);
-       return sz >= 0;
+       ret = os_get_filesize(filename, &size);
+       return ret == 0;
 }
 
-int sandbox_fs_size(const char *filename)
+int sandbox_fs_size(const char *filename, loff_t *size)
 {
-       return os_get_filesize(filename);
+       return os_get_filesize(filename, size);
 }
 
 void sandbox_fs_close(void)
 {
 }
 
-int fs_read_sandbox(const char *filename, void *buf, int offset, int len)
+int fs_read_sandbox(const char *filename, void *buf, loff_t offset, loff_t len,
+                   loff_t *actread)
 {
-       int len_read;
+       int ret;
 
-       len_read = sandbox_fs_read_at(filename, offset, buf, len);
-       if (len_read == -1) {
+       ret = sandbox_fs_read_at(filename, offset, buf, len, actread);
+       if (ret)
                printf("** Unable to read file %s **\n", filename);
-               return -1;
-       }
 
-       return len_read;
+       return ret;
 }
 
-int fs_write_sandbox(const char *filename, void *buf, int offset, int len)
+int fs_write_sandbox(const char *filename, void *buf, loff_t offset,
+                    loff_t len, loff_t *actwrite)
 {
-       int len_written;
+       int ret;
 
-       len_written = sandbox_fs_write_at(filename, offset, buf, len);
-       if (len_written == -1) {
+       ret = sandbox_fs_write_at(filename, offset, buf, len, actwrite);
+       if (ret)
                printf("** Unable to write file %s **\n", filename);
-               return -1;
-       }
 
-       return len_written;
+       return ret;
 }
index 0ce2475e0b8e9a9c95650837d20fef9adbc5415b..c12026147fc5635512482a8814abc43e17448d78 100644 (file)
@@ -476,10 +476,6 @@ struct file {
 #define MAX_LFS_FILESIZE       0x7fffffffffffffffUL
 #endif
 
-#define INT_MAX                ((int)(~0U>>1))
-#define INT_MIN                (-INT_MAX - 1)
-#define LLONG_MAX      ((long long)(~0ULL>>1))
-
 /*
  * These are the fs-independent mount-flags: up to 32 flags are supported
  */
index ecf7fcaf7b65f2cb98be8ae822474e21628e454e..f1ab2cf5f469a354d1f808212987fa72dc1699a0 100644 (file)
@@ -23,6 +23,7 @@ typedef volatile unsigned char        vu_char;
 #include <linux/stringify.h>
 #include <asm/ptrace.h>
 #include <stdarg.h>
+#include <linux/kernel.h>
 #if defined(CONFIG_PCI) && defined(CONFIG_4xx)
 #include <pci.h>
 #endif
@@ -96,15 +97,19 @@ typedef volatile unsigned char      vu_char;
 #define _DEBUG 0
 #endif
 
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#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);    \
+#define debug_cond(cond, fmt, args...)                 \
+       do {                                            \
+               if (cond)                               \
+                       printf(pr_fmt(fmt), ##args);    \
        } while (0)
 
 #define debug(fmt, args...)                    \
@@ -126,7 +131,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned line,
                __assert_fail(#x, __FILE__, __LINE__, __func__); })
 
 #define error(fmt, args...) do {                                       \
-               printf("ERROR: " fmt "\nat %s:%d/%s()\n",               \
+               printf("ERROR: " pr_fmt(fmt) "\nat %s:%d/%s()\n",       \
                        ##args, __FILE__, __LINE__, __func__);          \
 } while (0)
 
@@ -168,58 +173,6 @@ typedef void (interrupt_handler_t)(void *);
 # endif
 #endif
 
-/*
- * General Purpose Utilities
- */
-#define min(X, Y)                              \
-       ({ typeof(X) __x = (X);                 \
-               typeof(Y) __y = (Y);            \
-               (__x < __y) ? __x : __y; })
-
-#define max(X, Y)                              \
-       ({ typeof(X) __x = (X);                 \
-               typeof(Y) __y = (Y);            \
-               (__x > __y) ? __x : __y; })
-
-#define min3(X, Y, Z)                          \
-       ({ typeof(X) __x = (X);                 \
-               typeof(Y) __y = (Y);            \
-               typeof(Z) __z = (Z);            \
-               __x < __y ? (__x < __z ? __x : __z) :   \
-               (__y < __z ? __y : __z); })
-
-#define max3(X, Y, Z)                          \
-       ({ typeof(X) __x = (X);                 \
-               typeof(Y) __y = (Y);            \
-               typeof(Z) __z = (Z);            \
-               __x > __y ? (__x > __z ? __x : __z) :   \
-               (__y > __z ? __y : __z); })
-
-/*
- * Return the absolute value of a number.
- *
- * This handles unsigned and signed longs, ints, shorts and chars.  For all
- * input types abs() returns a signed long.
- *
- * For 64-bit types, use abs64()
- */
-#define abs(x) ({                                              \
-               long ret;                                       \
-               if (sizeof(x) == sizeof(long)) {                \
-                       long __x = (x);                         \
-                       ret = (__x < 0) ? -__x : __x;           \
-               } else {                                        \
-                       int __x = (x);                          \
-                       ret = (__x < 0) ? -__x : __x;           \
-               }                                               \
-               ret;                                            \
-       })
-
-#define abs64(x) ({                            \
-               s64 __x = (x);                  \
-               (__x < 0) ? -__x : __x;         \
-       })
-
 #if defined(CONFIG_ENV_IS_EMBEDDED)
 #define TOTAL_MALLOC_LEN       CONFIG_SYS_MALLOC_LEN
 #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
@@ -230,17 +183,6 @@ typedef void (interrupt_handler_t)(void *);
 #define        TOTAL_MALLOC_LEN        CONFIG_SYS_MALLOC_LEN
 #endif
 
-/**
- * container_of - cast a member of a structure out to the containing structure
- * @ptr:       the pointer to the member.
- * @type:      the type of the container struct this is embedded in.
- * @member:    the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({                     \
-       const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
-       (type *)( (char *)__mptr - offsetof(type,member) );})
-
 /*
  * Function Prototypes
  */
@@ -947,31 +889,7 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
 #error Read section CONFIG_SKIP_LOWLEVEL_INIT in README.
 #endif
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
 #define ROUND(a,b)             (((a) + (b) - 1) & ~((b) - 1))
-#define DIV_ROUND(n,d)         (((n) + ((d)/2)) / (d))
-#define DIV_ROUND_UP(n,d)      (((n) + (d) - 1) / (d))
-#define roundup(x, y)          ((((x) + ((y) - 1)) / (y)) * (y))
-
-/*
- * Divide positive or negative dividend by positive divisor and round
- * to closest integer. Result is undefined for negative divisors and
- * for negative dividends if the divisor variable type is unsigned.
- */
-#define DIV_ROUND_CLOSEST(x, divisor)(                 \
-{                                                      \
-       typeof(x) __x = x;                              \
-       typeof(divisor) __d = divisor;                  \
-       (((typeof(x))-1) > 0 ||                         \
-        ((typeof(divisor))-1) > 0 || (__x) > 0) ?      \
-               (((__x) + ((__d) / 2)) / (__d)) :       \
-               (((__x) - ((__d) / 2)) / (__d));        \
-}                                                      \
-)
-
-#define ALIGN(x,a)             __ALIGN_MASK((x),(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
 
 /*
  * ARCH_DMA_MINALIGN is defined in asm/cache.h for each architecture.  It
@@ -1053,7 +971,7 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
  * Usage of this macro shall be avoided or used with extreme care!
  */
 #define DEFINE_ALIGN_BUFFER(type, name, size, align)                   \
-       static char __##name[roundup(size * sizeof(type), align)]       \
+       static char __##name[ALIGN(size * sizeof(type), align)] \
                        __aligned(align);                               \
                                                                        \
        static type *name = (type *)__##name
index 1d0664ddf6e828b01a2801a96f73becd06d34036..2178f9d1fd6cf3b086b50490d16e9e9ae6df0074 100644 (file)
@@ -730,7 +730,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMDLINE_EDITING                 /* Command-line editing */
 #define CONFIG_AUTO_COMPLETE                   /* add autocompletion support */
 #define CONFIG_SYS_LOAD_ADDR   0x2000000       /* default load address */
-#define CONFIG_SYS_PROMPT      "=> "           /* Monitor Command Prompt */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
index 2bb86e40caf97b742f8ad39fe152a8b3b7c9dd08..216f34f75b3b0491c8d7580c1c3d1ae62e99f924 100644 (file)
 #define CONFIG_CMDLINE_EDITING                 /* Command-line editing */
 #define CONFIG_AUTO_COMPLETE                   /* add autocompletion support */
 #define CONFIG_SYS_LOAD_ADDR   0x2000000       /* default load address */
-#define CONFIG_SYS_PROMPT      "=> "           /* Monitor Command Prompt */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
index 27333589afe4f092214acd94ef6e93e3d696058a..2f381e7b49ea88445f54110bf2602612f0118024 100644 (file)
@@ -791,7 +791,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMDLINE_EDITING         /* Command-line editing */
 #define CONFIG_AUTO_COMPLETE           /* add autocompletion support */
 #define CONFIG_SYS_LOAD_ADDR   0x2000000 /* default load address */
-#define CONFIG_SYS_PROMPT      "=> "     /* Monitor Command Prompt */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_SYS_CBSIZE      1024      /* Console I/O Buffer Size */
 #else
index 400d979643caaf7cdaddc8ddfdae5dbf87a6169a..47b3bd55166bfdf31decf8ac766d0efbad512608 100644 (file)
@@ -750,7 +750,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMDLINE_EDITING         /* Command-line editing */
 #define CONFIG_AUTO_COMPLETE           /* add autocompletion support */
 #define CONFIG_SYS_LOAD_ADDR   0x2000000 /* default load address */
-#define CONFIG_SYS_PROMPT      "=> "     /* Monitor Command Prompt */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_SYS_CBSIZE      1024      /* Console I/O Buffer Size */
 #else
index a97f5faae4a47a8ed5ca210d5c722859858ce6e7..94078f548196a1075ebc0658910506fa1b45d631 100644 (file)
@@ -20,8 +20,7 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_ARM920T         /* This is an ARM920T Core */
-#define CONFIG_S3C24X0         /* in a SAMSUNG S3C24x0-type SoC */
+#define CONFIG_S3C24X0         /* This is a SAMSUNG S3C24x0-type SoC */
 #define CONFIG_S3C2410         /* specifically a SAMSUNG S3C2410 SoC */
 #define CONFIG_VCMA9           /* on a MPL VCMA9 Board  */
 #define CONFIG_MACH_TYPE       MACH_TYPE_MPL_VCMA9 /* Machine type */
index 4424c3044195ddb444891efd6e87a5e441569742..403692d51702f5be822a4e495bedf1ae18d29d77 100644 (file)
@@ -18,8 +18,7 @@
 /*
  * SoC configurations
  */
-#define CONFIG_ARM926EJS               /* this is an ARM926EJS CPU */
-#define CONFIG_MX27                    /* in a Freescale i.MX27 Chip */
+#define CONFIG_MX27                    /* This is a Freescale i.MX27 Chip */
 #define CONFIG_MACH_TYPE       1698    /* APF27 */
 #define CONFIG_SYS_GENERIC_BOARD
 
index b073b97bae5e0ee2d5876877572abb11c4e967c0..72469f35b2d9edc6eadf28eb85df4c067ea3efe6 100644 (file)
@@ -10,7 +10,6 @@
 #define __ARMADILLO_800EVA_H
 
 #undef DEBUG
-#define CONFIG_ARMV7
 #define CONFIG_R8A7740
 #define CONFIG_RMOBILE_BOARD_STRING "Armadillo-800EVA Board\n"
 #define CONFIG_SH_GPIO_PFC
index bf09939c8174ffc17c5a9d03b173948676e66a53..104577995e5f2c683cd0b58d50508871e93edc6f 100644 (file)
@@ -10,8 +10,7 @@
 #include <linux/sizes.h>
 #include <asm/arch/sysmap.h>
 
-/* Architecture, CPU, chip, mach, etc */
-#define CONFIG_ARMV7
+/* CPU, chip, mach, etc */
 #define CONFIG_KONA
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_GENERIC_BOARD
index 827844e9d9449c7499fb07411f3c3fb8ed06ad8c..fb85c7263b19103d405ace79b92bb9e0b4940977 100644 (file)
@@ -9,8 +9,6 @@
 
 #include <asm/arch/configs.h>
 
-/* Architecture, CPU, chip, etc */
-#define CONFIG_ARMV7
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
 #define CONFIG_SYS_GENERIC_BOARD
index b27f973896decb8040f99ec2779175c5aa35e30b..44c947f61869a0df9541df69263f760826a4ec49 100644 (file)
@@ -24,7 +24,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_CALIMAIN
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
index 5f30279fe66c50b89ec683c1ff43de640f2bca77..f8785dbafcf9f968460df4fba471b3658279db54 100644 (file)
@@ -14,7 +14,6 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            24000000        /* timer0 freq */
 #define CONFIG_SOC_DM365
index ce521012f220d3105599f974b465ae33b0c3abb0..8c7d97a18e35ce06601029ba6427f24765ec38dc 100644 (file)
@@ -26,7 +26,6 @@
 #define AT91C_MASTER_CLOCK             (AT91C_MAIN_CLOCK / 3)
 #define CONFIG_SYS_HZ_CLOCK            (AT91C_MASTER_CLOCK / 2)
 
-#define CONFIG_ARM920T
 #define CONFIG_AT91RM9200
 #define CONFIG_CPUAT91
 #define USE_920T_MMU
index 27171950a6c0e5673193e966a4981166d2475a7a..0bdcef7006dfb87c760b3bfd8969be1dbb0cc70d 100644 (file)
@@ -21,7 +21,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA830_EVM
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA830               /* TI DA830 SoC */
 #define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
index 5f857557375232948f9c4b26e23a08013483cb1c..e5f8afef1e9216b961339d281d45ab7aa9462eb9 100644 (file)
@@ -25,7 +25,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
index c2e187e3de2826f4cdf0cf8aa67fa9d8a53282eb..16b901b01b758c303c2227cef5fcb58b538a2eec 100644 (file)
@@ -15,7 +15,6 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            24000000        /* timer0 freq */
 #define CONFIG_SOC_DM355
index 5188fdf8785b91efcc5489126753c8dff119ebda..4eed72292dfab33feb7618da0eebad272480f343 100644 (file)
@@ -14,7 +14,6 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            24000000        /* timer0 freq */
 #define CONFIG_SOC_DM355                               /* DM355 based board */
index c4fccfd39a4593a4a58b5ea484df0e77d3e8ecf5..c50c059f65140eb7afe6385ad83c8de75a99617a 100644 (file)
@@ -15,7 +15,6 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            24000000        /* timer0 freq */
 #define CONFIG_SOC_DM365
index b1b18ad04127463a2886f5d9a2df9f4f263a0dce..2c5a837f6665c97240cb4a47a6dbbd404b112d83 100644 (file)
@@ -15,7 +15,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 
 /* Clock rates detection */
 #ifndef __ASSEMBLY__
index 9b3d0febc01eea814d0d815cd350da1abad4e275..2467f70522bed0a920f7351ed7dabe798949310d 100644 (file)
@@ -41,7 +41,6 @@
 /*===================*/
 /* SoC Configuration */
 /*===================*/
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            27000000        /* Timer Input clock freq */
 #define CONFIG_SOC_DM644X
index 96c8fe2a4d419c240640c1117fbfadaa5f388734..2505465242128abdbc609805e2cab91a8beeeb2b 100644 (file)
@@ -19,7 +19,6 @@
 /*===================*/
 /* SoC Configuration */
 /*===================*/
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            27000000        /* Timer Input clock freq */
 #define CONFIG_SOC_DM644X
index 6e07cce766e28ce3c63df02243c062e795bed399..e773835dd97fdaa51052b6f901d50e359d5bcaa4 100644 (file)
@@ -16,7 +16,6 @@
 #define CONFIG_SYS_USE_NAND
 #define CONFIG_SYS_USE_DSPLINK         /* don't power up the DSP. */
 /* SoC Configuration */
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            27000000        /* Timer Input clock freq */
 #define CONFIG_SOC_DM644X
index cd23aaca209b7589e210f22fb9f75f6d3e8964f1..dae37cdaf639bdb749203199b566d84267b7afbe 100644 (file)
@@ -43,7 +43,6 @@
 /*===================*/
 /* SoC Configuration */
 /*===================*/
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #define CONFIG_SYS_HZ_CLOCK            27000000        /* Timer Input clock freq */
 #define CONFIG_SOC_DM644X
index 1d50a37d2fc8be63be197af9a8aebb8defc715f2..ae89368bfba18b9738976e74fd85401b4b328e43 100644 (file)
@@ -28,7 +28,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
index 47a8420f42d37cf8a9d9d4614a25b255254e1c82..a82e8bcadc034f3a1e5b54b0631101e051f32096 100644 (file)
@@ -85,8 +85,7 @@
 #endif
 
 /* High-level configuration options */
-#define CONFIG_ARM920T         1               /* This is an ARM920T core... */
-#define CONFIG_EP93XX          1               /* in a Cirrus Logic 93xx SoC */
+#define CONFIG_EP93XX          1               /* This is a Cirrus Logic 93xx SoC */
 
 #define CONFIG_SYS_CLK_FREQ    14745600        /* EP93xx has a 14.7456 clock */
 #undef CONFIG_USE_IRQ                          /* Don't need IRQ/FIQ */
index 1df4fc198624e41cbc128279019dfd231ebf1f2b..70a698ab328e6392f73cac47a00a4ed3981de3a0 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #define CONFIG_MARVELL         1
-#define CONFIG_ARM926EJS       1       /* Basic Architecture */
 #define CONFIG_FEROCEON                1       /* CPU Core subversion */
 #define CONFIG_88F5182         1       /* SOC Name */
 #define CONFIG_MACH_EDMINIV2   1       /* Machine type */
index 30ca95f02d5c9a4cf2bf29a840d82899eb54a8c1..cdea4a854656aeabf1c70e6cf67306d66b86942d 100644 (file)
@@ -25,7 +25,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
index 84175676c25505b3d4db84507ca5c785bfc98f25..bf02829cde58f856efcf01647989fe3cdc9f603f 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
-#define CONFIG_ARM1136 /* This is an arm1136 CPU core */
 #define CONFIG_MX35
 
 #define CONFIG_SYS_DCACHE_OFF
index 8188c7b788237fbcba017138bb4a29202909cc0e..1d78e725e3cf407aabca1eb34c166e066035b0db 100644 (file)
@@ -20,7 +20,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_HAWK
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
index 3e55247465f718338f242e9896348ab24590d941..f08483487d9fc7dc7533076cfa6527127d7d8570 100644 (file)
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_PROMPT              "=> "
 #define CONFIG_SYS_CBSIZE              1024
 #define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE \
                                         + sizeof(CONFIG_SYS_PROMPT)+16)
index 9c25efe851e6ccdda9b406137282f09caa8d3b23..386dbd8895cdf34db16210f59b52c5594701afe3 100644 (file)
@@ -13,7 +13,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_MX27
 #define CONFIG_MX27_CLK32      32768           /* OSC32K frequency */
 
index 8428d84496ca4f3e40ddb41be0e0c67e58fad2e7..0f2203254545af97739c0adaba8b1d4069de07e5 100644 (file)
@@ -15,8 +15,7 @@
 #include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
-#define CONFIG_ARM1136         1    /* This is an arm1136 CPU core */
-#define CONFIG_MX31            1    /* in a mx31 */
+#define CONFIG_MX31            1    /* This is a mx31 */
 #define CONFIG_MX31_CLK32      32000
 
 #define CONFIG_DISPLAY_CPUINFO
index ffb67c2ebe1f681b21d87cec682b5ee5bffd9f7a..4195fa35330981d97e4831dfb6a8c19b21a7298a 100644 (file)
@@ -15,8 +15,7 @@
 #include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
-#define CONFIG_ARM1136                 /* This is an arm1136 CPU core */
-#define CONFIG_MX31                    /* in a mx31 */
+#define CONFIG_MX31                    /* This is a mx31 */
 #define CONFIG_MX31_CLK32      32000
 
 #define CONFIG_DISPLAY_CPUINFO
index 98e819bb189e31085086831f282407ecf0efba06..310d5e2106aca2f921fe580143e979e78c98142e 100644 (file)
@@ -25,7 +25,6 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
index 759e1129c2814aa6a4cce2cb6ea4c37cbfc61f05..8175621338fd95ea722afcd2a3dcb82691176505 100644 (file)
@@ -14,7 +14,6 @@
 #define CONFIG_MB86R0x_IOCLK   get_bus_freq(0)
 #define CONFIG_SYS_TEXT_BASE   0x10000000
 
-#define CONFIG_ARM926EJS       1       /* This is an ARM926EJS Core    */
 
 #define CONFIG_USE_ARCH_MEMCPY
 #define CONFIG_USE_ARCH_MEMSET
index dd5050fbe93b00ba65f5d4078623bcd4d8493ec1..42280ca0a505834d8e61e2e2c8c28f25802c65f9 100644 (file)
@@ -20,7 +20,6 @@
 #define CONFIG_SYS_THUMB_BUILD
 
 /* SoC Configuration */
-#define CONFIG_ARMV7
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_TEXT_BASE           0x0c001000
index d1f6ea7e7b0e6d5f1efcda54eca34af3cd3d3b3c..b19a60f2bd0213ab09595183352ac3e12dcb06b5 100644 (file)
@@ -344,7 +344,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_LONGHELP            /* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
-#define CONFIG_SYS_PROMPT              "=> "
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
 #define CONFIG_SYS_PBSIZE              \
index 3c73af8ac39dc6663fa0db3ed5d91eb9c3601618..e98e102e424727a739dbf68ead6df3983cf420c5 100644 (file)
 #define CONFIG_SYS_LONGHELP            /* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
-#define CONFIG_SYS_PROMPT              "=> "
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
 #define CONFIG_SYS_PBSIZE              \
index 51b1a141eb225d7d9bf67a6205820cec88d8fc74..0f4bd91c645d0be4177fa7cf5855710b1e46cce1 100644 (file)
@@ -12,8 +12,7 @@
 #include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
-#define CONFIG_ARM1136         1               /* This is an arm1136 CPU core */
-#define CONFIG_MX31            1               /* in a mx31 */
+#define CONFIG_MX31            1               /* This is a mx31 */
 
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
index bc4583baee6227e555ae203823dc8c3ffce962c6..2a3e53c7928ca8d32950df854307330026dce538 100644 (file)
@@ -17,8 +17,7 @@
 #include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
-#define CONFIG_ARM1136                 /* This is an arm1136 CPU core */
-#define CONFIG_MX31                    /* in a mx31 */
+#define CONFIG_MX31                    /* This is a mx31 */
 
 #define CONFIG_SYS_GENERIC_BOARD
 
index ab481441b296d45a60509e5bd6cc68fa0476a8ef..a145f0812f39803a5572fcdb62427a4963961743 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
-#define CONFIG_ARM1136 /* This is an arm1136 CPU core */
 #define CONFIG_MX35
 
 #define CONFIG_DISPLAY_CPUINFO
index 5419f551d316f3c23141bf5009eda1b3c0491a32..52cde4110c1c1125e0c4f32c1ca63c9221436fc2 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <nomadik.h>
 
-#define CONFIG_ARM926EJS
 #define CONFIG_NOMADIK_8815    /* cpu variant */
 
 #define CONFIG_SKIP_LOWLEVEL_INIT /* we have already been loaded to RAM */
index f3c21c4580aa5c067d0de68b3cdb0a302bdc3876..bf1d34dedb4dd475db9d04431dc627330e12400a 100644 (file)
@@ -18,7 +18,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_ARMV7           1       /* This is an ARM V7 CPU core */
 #define CONFIG_OMAP            1       /* in a TI OMAP core */
 #define CONFIG_MVBLX           1       /* working with mvBlueLYNX-X */
 #define CONFIG_MACH_TYPE       MACH_TYPE_MVBLX
index f9d6642cc49998217588132b4897eadf44865e29..d383fe878f547ecc58a206ba7b60e6037ca206ef 100644 (file)
@@ -12,8 +12,7 @@
 #include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
-#define CONFIG_ARM1136                 /* This is an arm1136 CPU core */
-#define CONFIG_MX31                    /* in a mx31 */
+#define CONFIG_MX31                    /* This is a mx31 */
 #define CONFIG_QONG
 
 #define CONFIG_DISPLAY_CPUINFO
index ca27f9ad787008c507241464aadbbf191286a83f..41e975fbcc0f292bb75da19e4cffaff86cddd89f 100644 (file)
@@ -21,7 +21,6 @@
 
 /* Architecture, CPU, etc.*/
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_ARM1176
 #define CONFIG_BCM2835
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_SYS_DCACHE_OFF
index ee4b24473cd27b37f803f10a4b3efccd0a000d8c..2b03841d9d5ae3cc7bf5a801879976d94640b86d 100644 (file)
@@ -48,6 +48,7 @@
 #define CONFIG_ANDROID_BOOT_IMAGE
 
 #define CONFIG_FS_FAT
+#define CONFIG_FAT_WRITE
 #define CONFIG_FS_EXT4
 #define CONFIG_EXT4_WRITE
 #define CONFIG_CMD_FAT
@@ -57,6 +58,7 @@
 #define CONFIG_DOS_PARTITION
 #define CONFIG_HOST_MAX_DEVICES 4
 #define CONFIG_CMD_FS_GENERIC
+#define CONFIG_CMD_MD5SUM
 
 #define CONFIG_SYS_VSNPRINTF
 
index e6d272dd1f53c4d7b1b71e006c0cc8b1f2a64ac1..f4a40bb9324717e8b83501b09bb3183a976f587a 100644 (file)
@@ -10,8 +10,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define CONFIG_ARM920T         1     /* this is an ARM920T CPU     */
-#define CONFIG_IMX             1     /* in a Motorola MC9328MXL Chip */
+#define CONFIG_IMX             1     /* This is a Motorola MC9328MXL Chip */
 #define CONFIG_SCB9328         1     /* on a scb9328tronix board */
 
 #define CONFIG_IMX_SERIAL
index d4ae19f96cec077c4c92e176cbd8eeafc07ffe39..b83c15f01fcdb415c05eb6cd57c57b4c1e13cee0 100644 (file)
@@ -17,8 +17,7 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_ARM920T         /* This is an ARM920T Core */
-#define CONFIG_S3C24X0         /* in a SAMSUNG S3C24x0-type SoC */
+#define CONFIG_S3C24X0         /* This is a SAMSUNG S3C24x0-type SoC */
 #define CONFIG_S3C2410         /* specifically a SAMSUNG S3C2410 SoC */
 #define CONFIG_SMDK2410                /* on a SAMSUNG SMDK2410 Board */
 
index c436fdaf526d52f258d82dfab37bbb0a571dc16e..c4ac94d0eb302ec6c64193fc99f109f069b00de8 100644 (file)
@@ -11,7 +11,6 @@
 /* Virtual target or real hardware */
 #undef CONFIG_SOCFPGA_VIRTUAL_TARGET
 
-#define CONFIG_ARMV7
 #define CONFIG_SYS_THUMB_BUILD
 
 #define CONFIG_SOCFPGA
index d687717dfb8823323713ba2fe79d275ebb198f03..a160329c1d71d39c797e44af03fb46c20ee0c728 100644 (file)
@@ -16,7 +16,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_ARMV7                   /* This is an ARM V7 CPU core */
 #define CONFIG_OMAP                    /* in a TI OMAP core */
 
 #define CONFIG_OMAP_GPIO
index 162826f7d354ec423c7f0d41c64cdb0ff400a86c..00a1a9e00269a8bc711c72d4b3f34ae848ddf6d8 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/arch/clock.h>
 
 /* Architecture, CPU, etc */
-#define CONFIG_ARM1176
 #define CONFIG_TNETV107X
 #define CONFIG_TNETV107X_EVM
 #define CONFIG_TNETV107X_WATCHDOG
index 0937653fc239a9a04d6cba5c900f6e5b305cf0c9..cf169a4c893ab77d2c1452d134862bab3511f65e 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
-#define CONFIG_ARM1136
 #define CONFIG_MX31
 
 #define CONFIG_DISPLAY_CPUINFO
index 700e9c1b23c85de05ff73a510da31cd65a309d72..b4a62453625bbffd1a5ebc50a681497e943d08ed 100644 (file)
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_SYS_HUSH_PARSER
-#define CONFIG_SYS_PROMPT             "=> "
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE              256
 
index 29c32fee5178060965cd87992c178ec7ccaad7b2..900b89c997807a70968f9b0d1d7fa61c2bf1cd51 100644 (file)
@@ -19,8 +19,7 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_ARM926EJS       1       /* This is an arm926ejs CPU core */
-#define CONFIG_VERSATILE       1       /* in Versatile Platform Board  */
+#define CONFIG_VERSATILE       1       /* This is Versatile Platform Board     */
 #define CONFIG_ARCH_VERSATILE  1       /* Specifically, a Versatile    */
 
 #define CONFIG_SYS_MEMTEST_START       0x100000
index d3d3e694cdaa3c71f20f29fb6693f75cd8bddd77..c7a17f7a49d3809693e047f4975125f34f1886fe 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/arch/imx-regs.h>
 
  /* High Level Configuration Options */
-#define CONFIG_ARM1136 /* This is an arm1136 CPU core */
 #define CONFIG_MX35
 #define CONFIG_MX35_HCLK_FREQ  24000000
 
index 8ffe6f1e0878c3fd0efe752413e4bcc687e4102e..356ac886f26051d4be4f59ed43b9d9ff045769a3 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <asm/arch/imx-regs.h>
 
-#define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_MX25
 #define CONFIG_SYS_TEXT_BASE           0xA0000000
 
index 2bc1562cecdb130b1fed40f99e5618bffcc9326a..c39c568ff88435fd9b1c30549707d6ce6fc86417 100644 (file)
@@ -10,9 +10,6 @@
 #ifndef __CONFIG_ZYNQ_COMMON_H
 #define __CONFIG_ZYNQ_COMMON_H
 
-/* High Level configuration Options */
-#define CONFIG_ARMV7
-
 /* CPU clock */
 #ifndef CONFIG_CPU_FREQ_HZ
 # define CONFIG_CPU_FREQ_HZ    800000000
index 6c419f3a233759c7e0998a1e5a25d7792a00bcfe..6888adc56f406d1c40049e240f8dc727e4e97009 100644 (file)
@@ -125,24 +125,28 @@ int ext4fs_init(void);
 void ext4fs_deinit(void);
 int ext4fs_filename_check(char *filename);
 int ext4fs_write(const char *fname, unsigned char *buffer,
-                               unsigned long sizebytes);
+                unsigned long sizebytes);
+int ext4_write_file(const char *filename, void *buf, loff_t offset, loff_t len,
+                   loff_t *actwrite);
 #endif
 
 struct ext_filesystem *get_fs(void);
-int ext4fs_open(const char *filename);
-int ext4fs_read(char *buf, unsigned len);
+int ext4fs_open(const char *filename, loff_t *len);
+int ext4fs_read(char *buf, loff_t len, loff_t *actread);
 int ext4fs_mount(unsigned part_length);
 void ext4fs_close(void);
 void ext4fs_reinit_global(void);
 int ext4fs_ls(const char *dirname);
 int ext4fs_exists(const char *filename);
-int ext4fs_size(const char *filename);
+int ext4fs_size(const char *filename, loff_t *size);
 void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
 int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
 void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
 long int read_allocated_block(struct ext2_inode *inode, int fileblock);
 int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
                 disk_partition_t *fs_partition);
-int ext4_read_file(const char *filename, void *buf, int offset, int len);
+int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+                  loff_t *actread);
 int ext4_read_superblock(char *buffer);
+int ext4fs_uuid(char *uuid_str);
 #endif
index 20ca3f3dca7df4476c5e94b9925815ba08bb6378..3038bd7e4f6e7133af0c5149395438a810dc719a 100644 (file)
@@ -178,8 +178,8 @@ typedef struct {
 
 typedef int    (file_detectfs_func)(void);
 typedef int    (file_ls_func)(const char *dir);
-typedef long   (file_read_func)(const char *filename, void *buffer,
-                                unsigned long maxsize);
+typedef int    (file_read_func)(const char *filename, void *buffer,
+                                int maxsize);
 
 struct filesystem {
        file_detectfs_func      *detect;
@@ -198,15 +198,17 @@ int file_cd(const char *path);
 int file_fat_detectfs(void);
 int file_fat_ls(const char *dir);
 int fat_exists(const char *filename);
-int fat_size(const char *filename);
-long file_fat_read_at(const char *filename, unsigned long pos, void *buffer,
-                     unsigned long maxsize);
-long file_fat_read(const char *filename, void *buffer, unsigned long maxsize);
+int fat_size(const char *filename, loff_t *size);
+int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
+                    loff_t maxsize, loff_t *actread);
+int file_fat_read(const char *filename, void *buffer, int maxsize);
 const char *file_getfsname(int idx);
 int fat_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
 int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
 
-int file_fat_write(const char *filename, void *buffer, unsigned long maxsize);
-int fat_read_file(const char *filename, void *buf, int offset, int len);
+int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,
+                  loff_t *actwrite);
+int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+                 loff_t *actread);
 void fat_close(void);
 #endif /* _FAT_H_ */
index 06a45f2788323b5d0fef4debf677bcf942cebe4d..ffb6ce7ada64f0498b46eac89d6a335bea83c488 100644 (file)
@@ -51,32 +51,41 @@ int fs_ls(const char *dirname);
 int fs_exists(const char *filename);
 
 /*
- * Determine a file's size
+ * fs_size - Determine a file's size
  *
- * Returns the file's size in bytes, or a negative value if it doesn't exist.
+ * @filename: Name of the file
+ * @size: Size of file
+ * @return 0 if ok with valid *size, negative on error
  */
-int fs_size(const char *filename);
+int fs_size(const char *filename, loff_t *size);
 
 /*
- * Read file "filename" from the partition previously set by fs_set_blk_dev(),
- * to address "addr", starting at byte offset "offset", and reading "len"
- * bytes. "offset" may be 0 to read from the start of the file. "len" may be
- * 0 to read the entire file. Note that not all filesystem types support
- * either/both offset!=0 or len!=0.
+ * fs_read - Read file from the partition previously set by fs_set_blk_dev()
+ * Note that not all filesystem types support either/both offset!=0 or len!=0.
  *
- * Returns number of bytes read on success. Returns <= 0 on error.
+ * @filename: Name of file to read from
+ * @addr: The address to read into
+ * @offset: The offset in file to read from
+ * @len: The number of bytes to read. Maybe 0 to read entire file
+ * @actread: Returns the actual number of bytes read
+ * @return 0 if ok with valid *actread, -1 on error conditions
  */
-int fs_read(const char *filename, ulong addr, int offset, int len);
+int fs_read(const char *filename, ulong addr, loff_t offset, loff_t len,
+           loff_t *actread);
 
 /*
- * Write file "filename" to the partition previously set by fs_set_blk_dev(),
- * from address "addr", starting at byte offset "offset", and writing "len"
- * bytes. "offset" may be 0 to write to the start of the file. Note that not
- * all filesystem types support offset!=0.
+ * fs_write - Write file to the partition previously set by fs_set_blk_dev()
+ * Note that not all filesystem types support offset!=0.
  *
- * Returns number of bytes read on success. Returns <= 0 on error.
+ * @filename: Name of file to read from
+ * @addr: The address to read into
+ * @offset: The offset in file to read from. Maybe 0 to write to start of file
+ * @len: The number of bytes to write
+ * @actwrite: Returns the actual number of bytes written
+ * @return 0 if ok with valid *actwrite, -1 on error conditions
  */
-int fs_write(const char *filename, ulong addr, int offset, int len);
+int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
+            loff_t *actwrite);
 
 /*
  * Common implementation for various filesystem commands, optionally limited
@@ -93,4 +102,11 @@ int file_exists(const char *dev_type, const char *dev_part, const char *file,
 int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype);
 
+/*
+ * Determine the UUID of the specified filesystem and print it. Optionally it is
+ * possible to store the UUID directly in env.
+ */
+int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+               int fstype);
+
 #endif /* _FS_H */
index 7ff6064b187b7b914f27ac8f5e7004a014037130..47b088973944404ba9e432308f1bcdb14d7a82b9 100644 (file)
@@ -57,17 +57,6 @@ void *kmem_cache_alloc(struct kmem_cache *obj, int flag);
 
 #define KERNEL_VERSION(a,b,c)  (((a) << 16) + ((b) << 8) + (c))
 
-/*
- * ..and if you can't take the strict
- * types, you can specify one yourself.
- *
- * Or not use min/max at all, of course.
- */
-#define min_t(type,x,y) \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-#define max_t(type,x,y) \
-       ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
-
 #ifndef BUG
 #define BUG() do { \
        printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
@@ -81,24 +70,6 @@ void *kmem_cache_alloc(struct kmem_cache *obj, int flag);
 
 #define PAGE_SIZE      4096
 
-/**
- * upper_32_bits - return MSB bits 32-63 of a number if little endian, or
- * return MSB bits 0-31 of a number if big endian.
- * @n: the number we're accessing
- *
- * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
- * the "right shift count >= width of type" warning when that quantity is
- * 32-bits.
- */
-#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
-
-/**
- * lower_32_bits - return LSB bits 0-31 of a number if little endian, or
- * return LSB bits 32-63 of a number if big endian.
- * @n: the number we're accessing
- */
-#define lower_32_bits(n) ((u32)(n))
-
 /* drivers/char/random.c */
 #define get_random_bytes(...)
 
@@ -152,17 +123,6 @@ typedef unsigned long blkcnt_t;
 
 #define ENOTSUPP       524     /* Operation is not supported */
 
-/* from include/linux/kernel.h */
-/*
- * This looks more complex than it should be. But we need to
- * get the type for the ~ right in round_down (it needs to be
- * as wide as the result!), and we want to evaluate the macro
- * arguments just once each.
- */
-#define __round_mask(x, y) ((__typeof__(x))((y)-1))
-#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
-#define round_down(x, y) ((x) & ~__round_mask(x, y))
-
 /* module */
 #define THIS_MODULE            0
 #define try_module_get(...)    1
@@ -198,18 +158,6 @@ typedef unsigned long blkcnt_t;
 
 #define blocking_notifier_call_chain(...) 0
 
-/*
- * Multiplies an integer by a fraction, while avoiding unnecessary
- * overflow or loss of precision.
- */
-#define mult_frac(x, numer, denom)(                    \
-{                                                      \
-       typeof(x) quot = (x) / (denom);                 \
-       typeof(x) rem  = (x) % (denom);                 \
-       (quot * (numer)) + ((rem * (numer)) / (denom)); \
-}                                                      \
-)
-
 #define __initdata
 #define late_initcall(...)
 
@@ -267,8 +215,6 @@ typedef int wait_queue_head_t;
 #define cond_resched()                 do { } while (0)
 #define yield()                                do { } while (0)
 
-#define INT_MAX                                ((int)(~0U>>1))
-
 #define __user
 #define __init
 #define __exit
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
new file mode 100644 (file)
index 0000000..89fcae0
--- /dev/null
@@ -0,0 +1,245 @@
+#ifndef _LINUX_KERNEL_H
+#define _LINUX_KERNEL_H
+
+
+#include <linux/types.h>
+
+#define USHRT_MAX      ((u16)(~0U))
+#define SHRT_MAX       ((s16)(USHRT_MAX>>1))
+#define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
+#define INT_MAX                ((int)(~0U>>1))
+#define INT_MIN                (-INT_MAX - 1)
+#define UINT_MAX       (~0U)
+#define LONG_MAX       ((long)(~0UL>>1))
+#define LONG_MIN       (-LONG_MAX - 1)
+#define ULONG_MAX      (~0UL)
+#define LLONG_MAX      ((long long)(~0ULL>>1))
+#define LLONG_MIN      (-LLONG_MAX - 1)
+#define ULLONG_MAX     (~0ULL)
+#define SIZE_MAX       (~(size_t)0)
+
+#define U8_MAX         ((u8)~0U)
+#define S8_MAX         ((s8)(U8_MAX>>1))
+#define S8_MIN         ((s8)(-S8_MAX - 1))
+#define U16_MAX                ((u16)~0U)
+#define S16_MAX                ((s16)(U16_MAX>>1))
+#define S16_MIN                ((s16)(-S16_MAX - 1))
+#define U32_MAX                ((u32)~0U)
+#define S32_MAX                ((s32)(U32_MAX>>1))
+#define S32_MIN                ((s32)(-S32_MAX - 1))
+#define U64_MAX                ((u64)~0ULL)
+#define S64_MAX                ((s64)(U64_MAX>>1))
+#define S64_MIN                ((s64)(-S64_MAX - 1))
+
+#define STACK_MAGIC    0xdeadbeef
+
+#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
+
+#define ALIGN(x,a)             __ALIGN_MASK((x),(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
+#define PTR_ALIGN(p, a)                ((typeof(p))ALIGN((unsigned long)(p), (a)))
+#define IS_ALIGNED(x, a)               (((x) & ((typeof(x))(a) - 1)) == 0)
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+/*
+ * This looks more complex than it should be. But we need to
+ * get the type for the ~ right in round_down (it needs to be
+ * as wide as the result!), and we want to evaluate the macro
+ * arguments just once each.
+ */
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+
+#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+
+#if BITS_PER_LONG == 32
+# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
+#else
+# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
+#endif
+
+/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
+#define roundup(x, y) (                                        \
+{                                                      \
+       const typeof(y) __y = y;                        \
+       (((x) + (__y - 1)) / __y) * __y;                \
+}                                                      \
+)
+#define rounddown(x, y) (                              \
+{                                                      \
+       typeof(x) __x = (x);                            \
+       __x - (__x % (y));                              \
+}                                                      \
+)
+
+/*
+ * Divide positive or negative dividend by positive divisor and round
+ * to closest integer. Result is undefined for negative divisors and
+ * for negative dividends if the divisor variable type is unsigned.
+ */
+#define DIV_ROUND_CLOSEST(x, divisor)(                 \
+{                                                      \
+       typeof(x) __x = x;                              \
+       typeof(divisor) __d = divisor;                  \
+       (((typeof(x))-1) > 0 ||                         \
+        ((typeof(divisor))-1) > 0 || (__x) > 0) ?      \
+               (((__x) + ((__d) / 2)) / (__d)) :       \
+               (((__x) - ((__d) / 2)) / (__d));        \
+}                                                      \
+)
+
+/*
+ * Multiplies an integer by a fraction, while avoiding unnecessary
+ * overflow or loss of precision.
+ */
+#define mult_frac(x, numer, denom)(                    \
+{                                                      \
+       typeof(x) quot = (x) / (denom);                 \
+       typeof(x) rem  = (x) % (denom);                 \
+       (quot * (numer)) + ((rem * (numer)) / (denom)); \
+}                                                      \
+)
+
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
+ * the "right shift count >= width of type" warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
+/*
+ * abs() handles unsigned and signed longs, ints, shorts and chars.  For all
+ * input types abs() returns a signed long.
+ * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()
+ * for those.
+ */
+#define abs(x) ({                                              \
+               long ret;                                       \
+               if (sizeof(x) == sizeof(long)) {                \
+                       long __x = (x);                         \
+                       ret = (__x < 0) ? -__x : __x;           \
+               } else {                                        \
+                       int __x = (x);                          \
+                       ret = (__x < 0) ? -__x : __x;           \
+               }                                               \
+               ret;                                            \
+       })
+
+#define abs64(x) ({                            \
+               s64 __x = (x);                  \
+               (__x < 0) ? -__x : __x;         \
+       })
+
+/*
+ * min()/max()/clamp() macros that also do
+ * strict type-checking.. See the
+ * "unnecessary" pointer comparison.
+ */
+#define min(x, y) ({                           \
+       typeof(x) _min1 = (x);                  \
+       typeof(y) _min2 = (y);                  \
+       (void) (&_min1 == &_min2);              \
+       _min1 < _min2 ? _min1 : _min2; })
+
+#define max(x, y) ({                           \
+       typeof(x) _max1 = (x);                  \
+       typeof(y) _max2 = (y);                  \
+       (void) (&_max1 == &_max2);              \
+       _max1 > _max2 ? _max1 : _max2; })
+
+#define min3(x, y, z) min((typeof(x))min(x, y), z)
+#define max3(x, y, z) max((typeof(x))max(x, y), z)
+
+/**
+ * min_not_zero - return the minimum that is _not_ zero, unless both are zero
+ * @x: value1
+ * @y: value2
+ */
+#define min_not_zero(x, y) ({                  \
+       typeof(x) __x = (x);                    \
+       typeof(y) __y = (y);                    \
+       __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
+
+/**
+ * clamp - return a value clamped to a given range with strict typechecking
+ * @val: current value
+ * @lo: lowest allowable value
+ * @hi: highest allowable value
+ *
+ * This macro does strict typechecking of lo/hi to make sure they are of the
+ * same type as val.  See the unnecessary pointer comparisons.
+ */
+#define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi)
+
+/*
+ * ..and if you can't take the strict
+ * types, you can specify one yourself.
+ *
+ * Or not use min/max/clamp at all, of course.
+ */
+#define min_t(type, x, y) ({                   \
+       type __min1 = (x);                      \
+       type __min2 = (y);                      \
+       __min1 < __min2 ? __min1: __min2; })
+
+#define max_t(type, x, y) ({                   \
+       type __max1 = (x);                      \
+       type __max2 = (y);                      \
+       __max1 > __max2 ? __max1: __max2; })
+
+/**
+ * clamp_t - return a value clamped to a given range using a given type
+ * @type: the type of variable to use
+ * @val: current value
+ * @lo: minimum allowable value
+ * @hi: maximum allowable value
+ *
+ * This macro does no typechecking and uses temporary variables of type
+ * 'type' to make all the comparisons.
+ */
+#define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
+
+/**
+ * clamp_val - return a value clamped to a given range using val's type
+ * @val: current value
+ * @lo: minimum allowable value
+ * @hi: maximum allowable value
+ *
+ * This macro does no typechecking and uses temporary variables of whatever
+ * type the input argument 'val' is.  This is useful when val is an unsigned
+ * type and min and max are literals that will otherwise be assigned a signed
+ * integer type.
+ */
+#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
+
+
+/*
+ * swap - swap value of @a and @b
+ */
+#define swap(a, b) \
+       do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ * @ptr:       the pointer to the member.
+ * @type:      the type of the container struct this is embedded in.
+ * @member:    the name of the member within the struct.
+ *
+ */
+#define container_of(ptr, type, member) ({                     \
+       const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+       (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#endif
index 0230a7f40da07893ff2d9d92f1929e7b9cabc1d2..e3645e01169b4a84ae7802ecf95a16298041499a 100644 (file)
@@ -217,9 +217,10 @@ const char *os_dirent_get_typename(enum os_dirent_t type);
  * Get the size of a file
  *
  * @param fname                Filename to check
- * @return size of file, or -1 if an error ocurred
+ * @param size         size of file is returned if no error
+ * @return 0 on success or -1 if an error ocurred
  */
-ssize_t os_get_filesize(const char *fname);
+int os_get_filesize(const char *fname, loff_t *size);
 
 /**
  * Write a character to the controlling OS terminal
index 2ff73653c5c2382ae654a22c047e743c67b55df1..d211351e44becf9b4c70e4f5cda357cce12f5a7e 100644 (file)
@@ -623,6 +623,7 @@ extern void pci_register_hose(struct pci_controller* hose);
 extern struct pci_controller* pci_bus_to_hose(int bus);
 extern struct pci_controller *find_hose_by_cfg_addr(void *cfg_addr);
 
+extern int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev);
 extern int pci_hose_scan(struct pci_controller *hose);
 extern int pci_hose_scan_bus(struct pci_controller *hose, int bus);
 
index e7c32623e101e31dde107d94468090dc3f041d4d..4c7745de91002d503640631f234d470c00ada0ee 100644 (file)
 
 int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
 
-long sandbox_fs_read_at(const char *filename, unsigned long pos,
-                            void *buffer, unsigned long maxsize);
+int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
+                      loff_t maxsize, loff_t *actread);
+int sandbox_fs_write_at(const char *filename, loff_t pos, void *buffer,
+                       loff_t maxsize, loff_t *actwrite);
 
 void sandbox_fs_close(void);
 int sandbox_fs_ls(const char *dirname);
 int sandbox_fs_exists(const char *filename);
-int sandbox_fs_size(const char *filename);
-int fs_read_sandbox(const char *filename, void *buf, int offset, int len);
-int fs_write_sandbox(const char *filename, void *buf, int offset, int len);
+int sandbox_fs_size(const char *filename, loff_t *size);
+int fs_read_sandbox(const char *filename, void *buf, loff_t offset, loff_t len,
+                   loff_t *actread);
+int fs_write_sandbox(const char *filename, void *buf, loff_t offset,
+                    loff_t len, loff_t *actwrite);
 
 #endif
index f9a17727f53b898e307a7b65853c00623f135909..5c16cc4fc7566dcfb7ff0eb6ccaed9074f5ecb4b 100644 (file)
@@ -11,11 +11,11 @@ char *strmhz (char *buf, unsigned long hz)
        long l, n;
        long m;
 
-       n = DIV_ROUND(hz, 1000) / 1000L;
+       n = DIV_ROUND_CLOSEST(hz, 1000) / 1000L;
        l = sprintf (buf, "%ld", n);
 
        hz -= n * 1000000L;
-       m = DIV_ROUND(hz, 1000L);
+       m = DIV_ROUND_CLOSEST(hz, 1000L);
        if (m != 0)
                sprintf (buf + l, ".%03ld", m);
        return (buf);
index b585713b7c55c78a598b165e547352ba7719c182..e0f264850f7fa75bc6cbeaad2537d3fffc4a318d 100644 (file)
@@ -25,9 +25,6 @@
 #include <div64.h>
 #define noinline __attribute__((noinline))
 
-/* some reluctance to put this into a new limits.h, so it is here */
-#define INT_MAX                ((int)(~0U>>1))
-
 unsigned long simple_strtoul(const char *cp, char **endp,
                                unsigned int base)
 {
@@ -518,6 +515,8 @@ static char *ip4_addr_string(char *buf, char *end, u8 *addr, int field_width,
 static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                int field_width, int precision, int flags)
 {
+       u64 num = (uintptr_t)ptr;
+
        /*
         * Being a boot loader, we explicitly allow pointers to
         * (physical) address null.
@@ -530,6 +529,17 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
 
 #ifdef CONFIG_CMD_NET
        switch (*fmt) {
+       case 'a':
+               flags |= SPECIAL | ZEROPAD;
+
+               switch (fmt[1]) {
+               case 'p':
+               default:
+                       field_width = sizeof(phys_addr_t) * 2 + 2;
+                       num = *(phys_addr_t *)ptr;
+                       break;
+               }
+               break;
        case 'm':
                flags |= SPECIAL;
                /* Fallthrough */
@@ -555,8 +565,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                field_width = 2*sizeof(void *);
                flags |= ZEROPAD;
        }
-       return number(buf, end, (unsigned long)ptr, 16, field_width,
-                     precision, flags);
+       return number(buf, end, num, 16, field_width, precision, flags);
 }
 
 static int vsnprintf_internal(char *buf, size_t size, const char *fmt,
index 07db0bff8dfb364195bdf08529d1f30d342bdaee..342d82e71182b1038d899e0fc45da2142c57e82c 100644 (file)
@@ -60,9 +60,6 @@ libs-y += arch/$(ARCH)/lib/
 
 libs-y += $(CPUDIR)/
 
-ifdef SOC
-libs-y += $(CPUDIR)/$(SOC)/
-endif
 libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
 
@@ -80,7 +77,7 @@ libs-y += fs/
 libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
 libs-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ drivers/power/pmic/
 libs-$(CONFIG_SPL_MTD_SUPPORT) += drivers/mtd/
-libs-$(if $(CONFIG_CMD_NAND),$(CONFIG_SPL_NAND_SUPPORT)) += drivers/mtd/nand/
+libs-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/
 libs-$(CONFIG_SPL_DRIVERS_MISC_SUPPORT) += drivers/misc/
 libs-$(CONFIG_SPL_ONENAND_SUPPORT) += drivers/mtd/onenand/
 libs-$(CONFIG_SPL_DMA_SUPPORT) += drivers/dma/
diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh
new file mode 100755 (executable)
index 0000000..a4fb055
--- /dev/null
@@ -0,0 +1,561 @@
+#!/bin/bash
+#
+# (C) Copyright 2014 Suriyan Ramasami
+#
+#  SPDX-License-Identifier:    GPL-2.0+
+#
+
+# Invoke this test script from U-Boot base directory as ./test/fs/fs-test.sh
+# It currently tests the fs/sb and native commands for ext4 and fat partitions
+# Expected results are as follows:
+# EXT4 tests:
+# fs-test.sb.ext4.out: Summary: PASS: 17 FAIL: 2
+# fs-test.ext4.out: Summary: PASS: 11 FAIL: 8
+# fs-test.fs.ext4.out: Summary: PASS: 11 FAIL: 8
+# FAT tests:
+# fs-test.sb.fat.out: Summary: PASS: 17 FAIL: 2
+# fs-test.fat.out: Summary: PASS: 19 FAIL: 0
+# fs-test.fs.fat.out: Summary: PASS: 19 FAIL: 0
+# Total Summary: TOTAL PASS: 94 TOTAL FAIL: 20
+
+# pre-requisite binaries list.
+PREREQ_BINS="md5sum mkfs mount umount dd fallocate mkdir"
+
+# All generated output files from this test will be in $OUT_DIR
+# Hence everything is sandboxed.
+OUT_DIR="sandbox/test/fs"
+
+# Location of generated sandbox u-boot
+UBOOT="./sandbox/u-boot"
+
+# Our mount directory will be in the sandbox
+MOUNT_DIR="${OUT_DIR}/mnt"
+
+# The file system image we create will have the $IMG prefix.
+IMG="${OUT_DIR}/3GB"
+
+# $SMALL_FILE is the name of the 1MB file in the file system image
+SMALL_FILE="1MB.file"
+
+# $BIG_FILE is the name of the 2.5GB file in the file system image
+BIG_FILE="2.5GB.file"
+
+# $MD5_FILE will have the expected md5s when we do the test
+# They shall have a suffix which represents their file system (ext4/fat)
+MD5_FILE="${OUT_DIR}/md5s.list"
+
+# $OUT shall be the prefix of the test output. Their suffix will be .out
+OUT="${OUT_DIR}/fs-test"
+
+# Full Path of the 1 MB file that shall be created in the fs image.
+MB1="${MOUNT_DIR}/${SMALL_FILE}"
+GB2p5="${MOUNT_DIR}/${BIG_FILE}"
+
+# ************************
+# * Functions start here *
+# ************************
+
+# Check if the prereq binaries exist, or exit
+function check_prereq() {
+       for prereq in $PREREQ_BINS; do
+               if [ ! -x `which $prereq` ]; then
+                       echo "Missing $prereq binary. Exiting!"
+                       exit
+               fi
+       done
+
+       # We use /dev/urandom to create files. Check if it exists.
+       if [ ! -c /dev/urandom ]; then
+               echo "Missing character special /dev/urandom. Exiting!"
+               exit
+       fi
+}
+
+# If 1st param is "clean", then clean out the generated files and exit
+function check_clean() {
+       if [ "$1" = "clean" ]; then
+               rm -rf "$OUT_DIR"
+               echo "Cleaned up generated files. Exiting"
+               exit
+       fi
+}
+
+# Generate sandbox U-Boot - gleaned from /test/dm/test-dm.sh
+function compile_sandbox() {
+       unset CROSS_COMPILE
+       NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor)
+       make O=sandbox sandbox_config
+       make O=sandbox -s -j${NUM_CPUS}
+
+       # Check if U-Boot exists
+       if [ ! -x "$UBOOT" ]; then
+               echo "$UBOOT does not exist or is not executable"
+               echo "Build error?"
+               echo "Please run this script as ./test/fs/`basename $0`"
+               exit
+       fi
+}
+
+# Clean out all generated files other than the file system images
+# We save time by not deleting and recreating the file system images
+function prepare_env() {
+       rm -f ${MD5_FILE}.* ${OUT}.*
+       mkdir ${OUT_DIR}
+}
+
+# 1st parameter is the name of the image file to be created
+# 2nd parameter is the filesystem - fat ext4 etc
+# -F cant be used with fat as it means something else.
+function create_image() {
+       # Create image if not already present - saves time, while debugging
+       if [ "$2" = "ext4" ]; then
+               MKFS_OPTION="-F"
+       else
+               MKFS_OPTION=""
+       fi
+       if [ ! -f "$1" ]; then
+               fallocate -l 3G "$1" &> /dev/null
+               mkfs -t "$2" $MKFS_OPTION "$1" &> /dev/null
+               if [ $? -ne 0 -a "$2" = "fat" ]; then
+                       # If we fail and we did fat, try vfat.
+                       mkfs -t vfat $MKFS_OPTION "$1" &> /dev/null
+               fi
+       fi
+}
+
+# 1st parameter is the FS type: fat/ext4
+# 2nd parameter is the name of small file
+# Returns filename which can be used for fat or ext4 for writing
+function fname_for_write() {
+       case $1 in
+               ext4)
+                       # ext4 needs absolute path name of file
+                       echo /${2}.w
+                       ;;
+
+               *)
+                       echo ${2}.w
+                       ;;
+       esac
+}
+
+# 1st parameter is image file
+# 2nd parameter is file system type - fat/ext4
+# 3rd parameter is name of small file
+# 4th parameter is name of big file
+# 5th parameter is fs/nonfs/sb - to dictate generic fs commands or
+# otherwise or sb hostfs
+# 6th parameter is the directory path for the files. Its "" for generic
+# fs and ext4/fat and full patch for sb hostfs
+# UBOOT is set in env
+function test_image() {
+       addr="0x01000008"
+       length="0x00100000"
+
+       case "$2" in
+               fat)
+               PREFIX="fat"
+               WRITE="write"
+               ;;
+
+               ext4)
+               PREFIX="ext4"
+               WRITE="write"
+               ;;
+
+               *)
+               echo "Unhandled filesystem $2. Exiting!"
+               exit
+               ;;
+       esac
+
+       case "$5" in
+               fs)
+               PREFIX=""
+               WRITE="save"
+               SUFFIX=" 0:0"
+               ;;
+
+               nonfs)
+               SUFFIX=" 0:0"
+               ;;
+
+               sb)
+               PREFIX="sb "
+               WRITE="save"
+               SUFFIX="fs -"
+               ;;
+
+               *)
+               echo "Unhandled mode $5. Exiting!"
+               exit
+               ;;
+
+       esac
+
+       if [ -z "$6" ]; then
+               FILE_WRITE=`fname_for_write $2 $3`
+               FILE_SMALL=$3
+               FILE_BIG=$4
+       else
+               FILE_WRITE=$6/`fname_for_write $2 $3`
+               FILE_SMALL=$6/$3
+               FILE_BIG=$6/$4
+       fi
+
+       # In u-boot commands, <interface> stands for host or hostfs
+       # hostfs maps to the host fs.
+       # host maps to the "sb bind" that we do
+
+       $UBOOT << EOF
+sb=$5
+setenv bind 'if test "\$sb" != sb; then sb bind 0 "$1"; fi'
+run bind
+# Test Case 1 - ls
+${PREFIX}ls host${SUFFIX} $6
+#
+# We want ${PREFIX}size host 0:0 $3 for host commands and
+# sb size hostfs - $3 for hostfs commands.
+# 1MB is 0x0010 0000
+# Test Case 2 - size of small file
+${PREFIX}size host${SUFFIX} $FILE_SMALL
+printenv filesize
+setenv filesize
+
+# 2.5GB (1024*1024*2500) is 0x9C40 0000
+# Test Case 3 - size of big file
+${PREFIX}size host${SUFFIX} $FILE_BIG
+printenv filesize
+setenv filesize
+
+# Notes about load operation
+# If I use 0x01000000 I get DMA misaligned error message
+# Last two parameters are size and offset.
+
+# Test Case 4a - Read full 1MB of small file
+${PREFIX}load host${SUFFIX} $addr $FILE_SMALL
+printenv filesize
+# Test Case 4b - Read full 1MB of small file
+md5sum $addr \$filesize
+setenv filesize
+
+# Test Case 5a - First 1MB of big file
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG $length 0x0
+printenv filesize
+# Test Case 5b - First 1MB of big file
+md5sum $addr \$filesize
+setenv filesize
+
+# fails for ext as no offset support
+# Test Case 6a - Last 1MB of big file
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG $length 0x9C300000
+printenv filesize
+# Test Case 6b - Last 1MB of big file
+md5sum $addr \$filesize
+setenv filesize
+
+# fails for ext as no offset support
+# Test Case 7a - One from the last 1MB chunk of 2GB
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG $length 0x7FF00000
+printenv filesize
+# Test Case 7b - One from the last 1MB chunk of 2GB
+md5sum $addr \$filesize
+setenv filesize
+
+# fails for ext as no offset support
+# Test Case 8a - One from the start 1MB chunk from 2GB
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG $length 0x80000000
+printenv filesize
+# Test Case 8b - One from the start 1MB chunk from 2GB
+md5sum $addr \$filesize
+setenv filesize
+
+# fails for ext as no offset support
+# Test Case 9a - One 1MB chunk crossing the 2GB boundary
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG $length 0x7FF80000
+printenv filesize
+# Test Case 9b - One 1MB chunk crossing the 2GB boundary
+md5sum $addr \$filesize
+setenv filesize
+
+# Generic failure case
+# Test Case 10 - 2MB chunk from the last 1MB of big file
+${PREFIX}load host${SUFFIX} $addr $FILE_BIG 0x00200000 0x9C300000
+printenv filesize
+#
+
+# Read 1MB from small file
+${PREFIX}load host${SUFFIX} $addr $FILE_SMALL
+# Write it back to test the writes
+# Test Case 11a - Check that the write succeeded
+${PREFIX}${WRITE} host${SUFFIX} $addr $FILE_WRITE \$filesize
+mw.b $addr 00 100
+${PREFIX}load host${SUFFIX} $addr $FILE_WRITE
+# Test Case 11b - Check md5 of written to is same as the one read from
+md5sum $addr \$filesize
+setenv filesize
+#
+reset
+
+EOF
+}
+
+# 1st argument is the name of the image file.
+# 2nd argument is the file where we generate the md5s of the files
+# generated with the appropriate start and length that we use to test.
+# It creates the necessary files in the image to test.
+# $GB2p5 is the path of the big file (2.5 GB)
+# $MB1 is the path of the small file (1 MB)
+# $MOUNT_DIR is the path we can use to mount the image file.
+function create_files() {
+       # Mount the image so we can populate it.
+       mkdir -p "$MOUNT_DIR"
+       sudo mount -o loop,rw "$1" "$MOUNT_DIR"
+
+       # Create big file in this image.
+       # Note that we work only on the start 1MB, couple MBs in the 2GB range
+       # and the last 1 MB of the huge 2.5GB file.
+       # So, just put random values only in those areas.
+       if [ ! -f "${GB2p5}" ]; then
+               sudo dd if=/dev/urandom of="${GB2p5}" bs=1M count=1 \
+                       &> /dev/null
+               sudo dd if=/dev/urandom of="${GB2p5}" bs=1M count=2 seek=2047 \
+                       &> /dev/null
+               sudo dd if=/dev/urandom of="${GB2p5}" bs=1M count=1 seek=2499 \
+                       &> /dev/null
+       fi
+
+       # Create a small file in this image.
+       if [ ! -f "${MB1}" ]; then
+               sudo dd if=/dev/urandom of="${MB1}" bs=1M count=1 \
+                       &> /dev/null
+       fi
+
+       # Delete the small file which possibly is written as part of a
+       # previous test.
+       sudo rm -f "${MB1}.w"
+
+       # Generate the md5sums of reads that we will test against small file
+       dd if="${MB1}" bs=1M skip=0 count=1 2> /dev/null | md5sum > "$2"
+
+       # Generate the md5sums of reads that we will test against big file
+       # One from beginning of file.
+       dd if="${GB2p5}" bs=1M skip=0 count=1 \
+               2> /dev/null | md5sum >> "$2"
+
+       # One from end of file.
+       dd if="${GB2p5}" bs=1M skip=2499 count=1 \
+               2> /dev/null | md5sum >> "$2"
+
+       # One from the last 1MB chunk of 2GB
+       dd if="${GB2p5}" bs=1M skip=2047 count=1 \
+               2> /dev/null | md5sum >> "$2"
+
+       # One from the start 1MB chunk from 2GB
+       dd if="${GB2p5}" bs=1M skip=2048 count=1 \
+               2> /dev/null | md5sum >> "$2"
+
+       # One 1MB chunk crossing the 2GB boundary
+       dd if="${GB2p5}" bs=512K skip=4095 count=2 \
+               2> /dev/null | md5sum >> "$2"
+
+       sync
+       sudo umount "$MOUNT_DIR"
+       rmdir "$MOUNT_DIR"
+}
+
+# 1st parameter is the text to print
+# if $? is 0 its a pass, else a fail
+# As a side effect it shall update env variable PASS and FAIL
+function pass_fail() {
+       if [ $? -eq 0 ]; then
+               echo pass - "$1"
+               PASS=$((PASS + 1))
+       else
+               echo FAIL - "$1"
+               FAIL=$((FAIL + 1))
+       fi
+}
+
+# 1st parameter is the string which leads to an md5 generation
+# 2nd parameter is the file we grep, for that string
+# 3rd parameter is the name of the file which has md5s in it
+# 4th parameter is the line # in the md5 file that we match it against
+# This function checks if the md5 of the file in the sandbox matches
+# that calculated while generating the file
+# 5th parameter is the string to print with the result
+check_md5() {
+       # md5sum in u-boot has output of form:
+       # md5 for 01000008 ... 01100007 ==> <md5>
+       # the 7th field is the actual md5
+       md5_src=`grep -A3 "$1" "$2" | grep "md5 for"`
+       md5_src=($md5_src)
+       md5_src=${md5_src[6]}
+
+       # The md5 list, each line is of the form:
+       # - <md5>
+       # the 2nd field is the actual md5
+       md5_dst=`sed -n $4p $3`
+       md5_dst=($md5_dst)
+       md5_dst=${md5_dst[0]}
+
+       # For a pass they should match.
+       [ "$md5_src" = "$md5_dst" ]
+       pass_fail "$5"
+}
+
+# 1st parameter is the name of the output file to check
+# 2nd parameter is the name of the file containing the md5 expected
+# 3rd parameter is the name of the small file
+# 4th parameter is the name of the big file
+# 5th paramter is the name of the written file
+# This function checks the output file for correct results.
+function check_results() {
+       echo "** Start $1"
+
+       PASS=0
+       FAIL=0
+
+       # Check if the ls is showing correct results for 2.5 gb file
+       grep -A6 "Test Case 1 " "$1" | egrep -iq "2621440000 *$4"
+       pass_fail "TC1: ls of $4"
+
+       # Check if the ls is showing correct results for 1 mb file
+       grep -A6 "Test Case 1 " "$1" | egrep -iq "1048576 *$3"
+       pass_fail "TC1: ls of $3"
+
+       # Check size command on 1MB.file
+       egrep -A3 "Test Case 2 " "$1" | grep -q "filesize=100000"
+       pass_fail "TC2: size of $3"
+
+       # Check size command on 2.5GB.file
+       egrep -A3 "Test Case 3 " "$1" | grep -q "filesize=9c400000"
+       pass_fail "TC3: size of $4"
+
+       # Check read full mb of 1MB.file
+       grep -A6 "Test Case 4a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC4: load of $3 size"
+       check_md5 "Test Case 4b " "$1" "$2" 1 "TC4: load from $3"
+
+       # Check first mb of 2.5GB.file
+       grep -A6 "Test Case 5a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC5: load of 1st MB from $4 size"
+       check_md5 "Test Case 5b " "$1" "$2" 2 "TC5: load of 1st MB from $4"
+
+       # Check last mb of 2.5GB.file
+       grep -A6 "Test Case 6a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC6: load of last MB from $4 size"
+       check_md5 "Test Case 6b " "$1" "$2" 3 "TC6: load of last MB from $4"
+
+       # Check last 1mb chunk of 2gb from 2.5GB file
+       grep -A6 "Test Case 7a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC7: load of last 1mb chunk of 2GB from $4 size"
+       check_md5 "Test Case 7b " "$1" "$2" 4 \
+               "TC7: load of last 1mb chunk of 2GB from $4"
+
+       # Check first 1mb chunk after 2gb from 2.5GB file
+       grep -A6 "Test Case 8a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC8: load 1st MB chunk after 2GB from $4 size"
+       check_md5 "Test Case 8b " "$1" "$2" 5 \
+               "TC8: load 1st MB chunk after 2GB from $4"
+
+       # Check 1mb chunk crossing the 2gb boundary from 2.5GB file
+       grep -A6 "Test Case 9a " "$1" | grep -q "filesize=100000"
+       pass_fail "TC9: load 1MB chunk crossing 2GB boundary from $4 size"
+       check_md5 "Test Case 9b " "$1" "$2" 6 \
+               "TC9: load 1MB chunk crossing 2GB boundary from $4"
+
+       # Check 2mb chunk from the last 1MB of 2.5GB file - generic failure case
+       grep -A6 "Test Case 10 " "$1" | grep -q 'Error: "filesize" not defined'
+       pass_fail "TC10: load 2MB from the last 1MB of $4 - generic fail case"
+
+       # Check 1mb chunk write
+       grep -A3 "Test Case 11a " "$1" | \
+               egrep -q '1048576 bytes written|update journal'
+       pass_fail "TC11: 1MB write to $5 - write succeeded"
+       check_md5 "Test Case 11b " "$1" "$2" 1 \
+               "TC11: 1MB write to $5 - content verified"
+       echo "** End $1"
+}
+
+# Takes in one parameter which is "fs" or "nonfs", which then dictates
+# if a fs test (size/load/save) or a nonfs test (fatread/extread) needs to
+# be performed.
+function test_fs_nonfs() {
+       echo "Creating files in $fs image if not already present."
+       create_files $IMAGE $MD5_FILE_FS
+
+       OUT_FILE="${OUT}.fs.${fs}.out"
+       test_image $IMAGE $fs $SMALL_FILE $BIG_FILE $1 "" \
+               > ${OUT_FILE}
+       check_results $OUT_FILE $MD5_FILE_FS $SMALL_FILE $BIG_FILE \
+               $WRITE_FILE
+       TOTAL_FAIL=$((TOTAL_FAIL + FAIL))
+       TOTAL_PASS=$((TOTAL_PASS + PASS))
+       echo "Summary: PASS: $PASS FAIL: $FAIL"
+       echo "--------------------------------------------"
+}
+
+# ********************
+# * End of functions *
+# ********************
+
+check_clean "$1"
+check_prereq
+compile_sandbox
+prepare_env
+
+# Track TOTAL_FAIL and TOTAL_PASS
+TOTAL_FAIL=0
+TOTAL_PASS=0
+
+# In each loop, for a given file system image, we test both the
+# fs command, like load/size/write, the file system specific command
+# like: ext4load/ext4size/ext4write and the sb load/ls/save commands.
+for fs in ext4 fat; do
+
+       echo "Creating $fs image if not already present."
+       IMAGE=${IMG}.${fs}.img
+       MD5_FILE_FS="${MD5_FILE}.${fs}"
+       create_image $IMAGE $fs
+
+       # sb commands test
+       echo "Creating files in $fs image if not already present."
+       create_files $IMAGE $MD5_FILE_FS
+
+       # Lets mount the image and test sb hostfs commands
+       mkdir -p "$MOUNT_DIR"
+       if [ "$fs" = "fat" ]; then
+               uid="uid=`id -u`"
+       else
+               uid=""
+       fi
+       sudo mount -o loop,rw,$uid "$IMAGE" "$MOUNT_DIR"
+       sudo chmod 777 "$MOUNT_DIR"
+
+       OUT_FILE="${OUT}.sb.${fs}.out"
+       test_image $IMAGE $fs $SMALL_FILE $BIG_FILE sb `pwd`/$MOUNT_DIR \
+               > ${OUT_FILE}
+       sudo umount "$MOUNT_DIR"
+       rmdir "$MOUNT_DIR"
+
+       check_results $OUT_FILE $MD5_FILE_FS $SMALL_FILE $BIG_FILE \
+               $WRITE_FILE
+       TOTAL_FAIL=$((TOTAL_FAIL + FAIL))
+       TOTAL_PASS=$((TOTAL_PASS + PASS))
+       echo "Summary: PASS: $PASS FAIL: $FAIL"
+       echo "--------------------------------------------"
+
+       test_fs_nonfs nonfs
+       test_fs_nonfs fs
+done
+
+echo "Total Summary: TOTAL PASS: $TOTAL_PASS TOTAL FAIL: $TOTAL_FAIL"
+echo "--------------------------------------------"
+if [ $TOTAL_FAIL -eq 0 ]; then
+       echo "PASSED"
+       exit 0
+else
+       echo "FAILED"
+       exit 1
+fi