diff options
32 files changed, 236 insertions, 110 deletions
@@ -402,11 +402,11 @@ The following options need to be configured: CONFIG_A003399_NOR_WORKAROUND Enables a workaround for IFC erratum A003399. It is only - requred during NOR boot. + required during NOR boot. CONFIG_A008044_WORKAROUND Enables a workaround for T1040/T1042 erratum A008044. It is only - requred during NAND boot and valid for Rev 1.0 SoC revision + required during NAND boot and valid for Rev 1.0 SoC revision CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY @@ -438,7 +438,7 @@ The following options need to be configured: time of U-boot entry and is required to be re-initialized. CONFIG_DEEP_SLEEP - Inidcates this SoC supports deep sleep feature. If deep sleep is + Indicates this SoC supports deep sleep feature. If deep sleep is supported, core will start to execute uboot when wakes up. - Generic CPU options: @@ -752,7 +752,7 @@ The following options need to be configured: CONFIG_MEMSIZE_IN_BYTES [relevant for MIPS only] - When transferring memsize parameter to linux, some versions + When transferring memsize parameter to Linux, some versions expect it to be in bytes, others in MB. Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes. @@ -1962,7 +1962,7 @@ CBFS (Coreboot Filesystem) support CONFIG_LCD_ALIGNMENT - Normally the LCD is page-aligned (tyically 4KB). If this is + Normally the LCD is page-aligned (typically 4KB). If this is defined then the LCD will be aligned to this value instead. For ARM it is sometimes useful to use MMU_SECTION_SIZE here, since it is cheaper to change data cache settings on @@ -2038,7 +2038,7 @@ CBFS (Coreboot Filesystem) support can be displayed via the splashscreen support or the bmp command. -- Do compresssing for memory range: +- Do compressing for memory range: CONFIG_CMD_ZIP If this option is set, it would use zlib deflate method @@ -2401,7 +2401,7 @@ CBFS (Coreboot Filesystem) support - define slave for bus 2 with CONFIG_SYS_MXC_I2C2_SLAVE - define speed for bus 3 with CONFIG_SYS_MXC_I2C3_SPEED - define slave for bus 3 with CONFIG_SYS_MXC_I2C3_SLAVE - If thoses defines are not set, default value is 100000 + If those defines are not set, default value is 100000 for speed, and 0 for slave. - drivers/i2c/rcar_i2c.c: @@ -2434,7 +2434,7 @@ CBFS (Coreboot Filesystem) support - CONFIG_SYS_I2C_SH_SPEED4 for for the speed channel 4 - CONFIG_SYS_I2C_SH_BASE5 for setting the register channel 5 - CONFIG_SYS_I2C_SH_SPEED5 for for the speed channel 5 - - CONFIF_SYS_I2C_SH_NUM_CONTROLLERS for nummber of i2c buses + - CONFIG_SYS_I2C_SH_NUM_CONTROLLERS for number of i2c buses - drivers/i2c/omap24xx_i2c.c - activate this driver with CONFIG_SYS_I2C_OMAP24XX @@ -2478,7 +2478,7 @@ CBFS (Coreboot Filesystem) support additional defines: CONFIG_SYS_NUM_I2C_BUSES - Hold the number of i2c busses you want to use. If you + Hold the number of i2c buses you want to use. If you don't use/have i2c muxes on your i2c bus, this is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can omit this define. @@ -2494,7 +2494,7 @@ CBFS (Coreboot Filesystem) support define. CONFIG_SYS_I2C_BUSES - hold a list of busses you want to use, only used if + hold a list of buses you want to use, only used if CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example a board with CONFIG_SYS_I2C_MAX_HOPS = 1 and CONFIG_SYS_NUM_I2C_BUSES = 9: @@ -2832,14 +2832,14 @@ CBFS (Coreboot Filesystem) support CONFIG_SYS_FPGA_WAIT_INIT - Maximum time to wait for the INIT_B line to deassert - after PROB_B has been deasserted during a Virtex II + Maximum time to wait for the INIT_B line to de-assert + after PROB_B has been de-asserted during a Virtex II FPGA configuration sequence. The default time is 500 ms. CONFIG_SYS_FPGA_WAIT_BUSY - Maximum time to wait for BUSY to deassert during + Maximum time to wait for BUSY to de-assert during Virtex II FPGA configuration. The default is 5 ms. CONFIG_SYS_FPGA_WAIT_CONFIG @@ -2991,11 +2991,11 @@ CBFS (Coreboot Filesystem) support of the backslashes before semicolons and special symbols. -- Commandline Editing and History: +- Command Line Editing and History: CONFIG_CMDLINE_EDITING Enable editing and History functions for interactive - commandline input operations + command line input operations - Default Environment: CONFIG_EXTRA_ENV_SETTINGS @@ -3046,7 +3046,7 @@ CBFS (Coreboot Filesystem) support CONFIG_DELAY_ENVIRONMENT Normally the environment is loaded when the board is - intialised so that it is available to U-Boot. This inhibits + initialised so that it is available to U-Boot. This inhibits that so that the environment is not available until explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL this is instead controlled by the value of @@ -3092,7 +3092,7 @@ CBFS (Coreboot Filesystem) support Define this option to use dual flash support where two flash memories can be connected with a given cs line. - currently Xilinx Zynq qspi support these type of connections. + Currently Xilinx Zynq qspi supports these type of connections. CONFIG_SYS_SPI_ST_ENABLE_WP_PIN enable the W#/Vpp signal to disable writing to the status @@ -3767,7 +3767,7 @@ FIT uImage format: CONFIG_SYS_NAND_HW_ECC_OOBFIRST Define this if you need to first read the OOB and then the - data. This is used for example on davinci plattforms. + data. This is used, for example, on davinci platforms. CONFIG_SPL_OMAP3_ID_NAND Support for an OMAP3-specific set of functions to return the @@ -4000,7 +4000,7 @@ Configuration Settings: This feature allocates regions with increasing addresses within the region. calloc() is supported, but realloc() is not available. free() is supported but does nothing. - The memory will be freed (or in fact just forgotton) when + The memory will be freed (or in fact just forgotten) when U-Boot relocates itself. Pre-relocation malloc() is only supported on ARM and sandbox @@ -4161,8 +4161,8 @@ Configuration Settings: The format of the list is: type_attribute = [s|d|x|b|i|m] - access_atribute = [a|r|o|c] - attributes = type_attribute[access_atribute] + access_attribute = [a|r|o|c] + attributes = type_attribute[access_attribute] entry = variable_name[:attributes] list = entry[,list] @@ -4182,7 +4182,7 @@ Configuration Settings: - CONFIG_ENV_FLAGS_LIST_DEFAULT Define this to a list (string) to define the ".flags" - envirnoment variable in the default or embedded environment. + environment variable in the default or embedded environment. - CONFIG_ENV_FLAGS_LIST_STATIC Define this to a list (string) to define validation that @@ -4208,7 +4208,7 @@ Configuration Settings: - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only) This is set by OMAP boards for the max time that reset should be asserted. See doc/README.omap-reset-time for details on how - the value can be calulated on a given board. + the value can be calculated on a given board. - CONFIG_USE_STDINT If stdint.h is available with your toolchain you can define this @@ -4309,7 +4309,7 @@ accordingly! provision. BE CAREFUL! The first access to the environment happens quite early -in U-Boot initalization (when we try to get the setting of for the +in U-Boot initialization (when we try to get the setting of for the console baudrate). You *MUST* have mapped your NVRAM area then, or U-Boot will hang. @@ -4532,16 +4532,16 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface. table, or the whole device D if has no partition table. - "D:auto": first partition in device D with bootable flag set. - If none, first valid paratition in device D. If no + If none, first valid partition in device D. If no partition table then means device D. - FAT_ENV_FILE: It's a string of the FAT file name. This file use to store the - envrionment. + environment. - CONFIG_FAT_WRITE: - This should be defined. Otherwise it cannot save the envrionment file. + This should be defined. Otherwise it cannot save the environment file. - CONFIG_ENV_IS_IN_MMC: @@ -4724,7 +4724,7 @@ Low Level (hardware related) configuration options: if CONFIG_SYS_FDC_HW_INIT is defined, then the function fdc_hw_init() is called at the beginning of the FDC setup. fdc_hw_init() must be provided by the board - source code. It is used to make hardware dependant + source code. It is used to make hardware-dependent initializations. - CONFIG_IDE_AHB: @@ -4733,7 +4733,7 @@ Low Level (hardware related) configuration options: When software is doing ATA command and data transfer to IDE devices through IDE-AHB controller, some additional registers accessing to these kind of IDE-AHB controller - is requierd. + is required. - CONFIG_SYS_IMMR: Physical address of the Internal Memory. DO NOT CHANGE unless you know exactly what you're @@ -4846,7 +4846,7 @@ Low Level (hardware related) configuration options: required. - CONFIG_PCI_ENUM_ONLY - Only scan through and get the devices on the busses. + Only scan through and get the devices on the buses. Don't do any setup work, presumably because someone or something has already done it, and we don't need to do it a second time. Useful for platforms that are pre-booted @@ -5468,7 +5468,7 @@ List of environment variables (most likely not complete): npe_ucode - set load address for the NPE microcode - silent_linux - If set then linux will be told to boot silently, by + silent_linux - If set then Linux will be told to boot silently, by changing the console to be empty. If "yes" it will be made silent. If "no" it will not be made silent. If unset, then it will be made silent if the U-Boot console @@ -5555,7 +5555,7 @@ Callback functions for environment variables: --------------------------------------------- For some environment variables, the behavior of u-boot needs to change -when their values are changed. This functionailty allows functions to +when their values are changed. This functionality allows functions to be associated with arbitrary variables. On creation, overwrite, or deletion, the callback will provide the opportunity for some side effect to happen or for the change to be rejected. @@ -5578,7 +5578,7 @@ Callbacks can also be associated by defining the ".callbacks" variable with the same list format above. Any association in ".callbacks" will override any association in the static list. You can define CONFIG_ENV_CALLBACK_LIST_DEFAULT to a list (string) to define the -".callbacks" envirnoment variable in the default or embedded environment. +".callbacks" environment variable in the default or embedded environment. Command Line Parsing: @@ -6343,7 +6343,7 @@ code for the initialization procedures: * Initialized global data (data segment) is read-only. Do not attempt to write it. -* Do not use any uninitialized global data (or implicitely initialized +* Do not use any uninitialized global data (or implicitly initialized as zero data - BSS segment) at all - this is undefined, initiali- zation is performed later (when relocating to RAM). @@ -6351,7 +6351,7 @@ code for the initialization procedures: that. Having only the stack as writable memory limits means we cannot use -normal global data to share information beween the code. But it +normal global data to share information between the code. But it turned out that the implementation of U-Boot can be greatly simplified by making a global data structure (gd_t) available to all functions. We could pass a pointer to this data as argument to _all_ @@ -6482,7 +6482,7 @@ System Initialization: In the reset configuration, U-Boot starts at the reset entry point (on most PowerPC systems at address 0x00000100). Because of the reset -configuration for CS0# this is a mirror of the onboard Flash memory. +configuration for CS0# this is a mirror of the on board Flash memory. To be able to re-map memory U-Boot then jumps to its link address. To be able to implement the initialization code in C, a (small!) initial stack is set up in the internal Dual Ported RAM (in case CPUs @@ -6598,7 +6598,7 @@ coding style; see the file "Documentation/CodingStyle" and the script Source files originating from a different project (for example the MTD subsystem) are generally exempt from these guidelines and are not -reformated to ease subsequent migration to newer versions of those +reformatted to ease subsequent migration to newer versions of those sources. Please note that U-Boot is implemented in C (and to some small parts in diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 29b1d73438..eaf09d1a62 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -294,7 +294,6 @@ void s_init(void) save_omap_boot_params(); #endif watchdog_disable(); - timer_init(); set_uart_mux_conf(); setup_clocks_for_console(); uart_soft_reset(); diff --git a/arch/arm/cpu/armv7/keystone/init.c b/arch/arm/cpu/armv7/keystone/init.c index c2b947839d..c96845c4e2 100644 --- a/arch/arm/cpu/armv7/keystone/init.c +++ b/arch/arm/cpu/armv7/keystone/init.c @@ -15,6 +15,16 @@ #include <asm/arch/hardware.h> #include <asm/arch/psc_defs.h> +#define MAX_PCI_PORTS 2 +enum pci_mode { + ENDPOINT, + LEGACY_ENDPOINT, + ROOTCOMPLEX, +}; + +#define DEVCFG_MODE_MASK (BIT(2) | BIT(1)) +#define DEVCFG_MODE_SHIFT 1 + void chip_configuration_unlock(void) { __raw_writel(KS2_KICK0_MAGIC, KS2_KICK0); @@ -68,6 +78,24 @@ void osr_init(void) } #endif +/* Function to set up PCIe mode */ +static void config_pcie_mode(int pcie_port, enum pci_mode mode) +{ + u32 val = __raw_readl(KS2_DEVCFG); + + if (pcie_port >= MAX_PCI_PORTS) + return; + + /** + * each pci port has two bits for mode and it starts at + * bit 1. So use port number to get the right bit position. + */ + pcie_port <<= 1; + val &= ~(DEVCFG_MODE_MASK << pcie_port); + val |= ((mode << DEVCFG_MODE_SHIFT) << pcie_port); + __raw_writel(val, KS2_DEVCFG); +} + int arch_cpu_init(void) { chip_configuration_unlock(); @@ -77,8 +105,13 @@ int arch_cpu_init(void) msmc_share_all_segments(KS2_MSMC_SEGMENT_NETCP); msmc_share_all_segments(KS2_MSMC_SEGMENT_QM_PDSP); msmc_share_all_segments(KS2_MSMC_SEGMENT_PCIE0); + + /* Initialize the PCIe-0 to work as Root Complex */ + config_pcie_mode(0, ROOTCOMPLEX); #if defined(CONFIG_SOC_K2E) || defined(CONFIG_SOC_K2L) msmc_share_all_segments(KS2_MSMC_SEGMENT_PCIE1); + /* Initialize the PCIe-1 to work as Root Complex */ + config_pcie_mode(1, ROOTCOMPLEX); #endif #ifdef CONFIG_SOC_K2L osr_init(); diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c index cb18908867..00a108212a 100644 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c @@ -9,12 +9,14 @@ */ #include <common.h> +#include <ahci.h> #include <spl.h> #include <asm/omap_common.h> #include <asm/arch/omap.h> #include <asm/arch/mmc_host_def.h> #include <asm/arch/sys_proto.h> #include <watchdog.h> +#include <scsi.h> DECLARE_GLOBAL_DATA_PTR; @@ -143,3 +145,10 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) image_entry((u32 *)&gd->arch.omap_boot_params); } #endif + +#ifdef CONFIG_SCSI_AHCI_PLAT +void arch_preboot_os(void) +{ + ahci_reset(DWC_AHSATA_BASE); +} +#endif diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c index a24baa1337..d18bc50c5a 100644 --- a/arch/arm/cpu/armv7/omap-common/sata.c +++ b/arch/arm/cpu/armv7/omap-common/sata.c @@ -85,3 +85,9 @@ void scsi_init(void) init_sata(0); scsi_scan(1); } + +void scsi_bus_reset(void) +{ + ahci_reset(DWC_AHSATA_BASE); + ahci_init(DWC_AHSATA_BASE); +} diff --git a/arch/arm/cpu/armv7/omap-common/timer.c b/arch/arm/cpu/armv7/omap-common/timer.c index 7c9924dc39..032bd2c24f 100644 --- a/arch/arm/cpu/armv7/omap-common/timer.c +++ b/arch/arm/cpu/armv7/omap-common/timer.c @@ -41,11 +41,6 @@ int timer_init(void) writel((CONFIG_SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST, &timer_base->tclr); - /* reset time, capture current incrementer value time */ - gd->arch.lastinc = readl(&timer_base->tcrr) / - (TIMER_CLOCK / CONFIG_SYS_HZ); - gd->arch.tbl = 0; /* start "advancing" time stamp from 0 */ - return 0; } diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index 6903696e1b..4462c72c7a 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -121,8 +121,6 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_380_mhz_1cs; else if (omap4_rev == OMAP4430_ES2_0) *regs = &emif_regs_elpida_200_mhz_2cs; - else if (omap4_rev == OMAP4430_ES2_3) - *regs = &emif_regs_elpida_400_mhz_1cs; else if (omap4_rev < OMAP4470_ES1_0) *regs = &emif_regs_elpida_400_mhz_2cs; else @@ -138,8 +136,6 @@ static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs if (omap_rev == OMAP4430_ES1_0) *dmm_lisa_regs = &lisa_map_2G_x_1_x_2; - else if (omap_rev == OMAP4430_ES2_3) - *dmm_lisa_regs = &lisa_map_2G_x_2_x_2; else if (omap_rev < OMAP4460_ES1_0) *dmm_lisa_regs = &lisa_map_2G_x_2_x_2; else diff --git a/arch/arm/cpu/armv7/socfpga/lowlevel_init.S b/arch/arm/cpu/armv7/socfpga/lowlevel_init.S index 2f2e9fcc7c..afed773c63 100644 --- a/arch/arm/cpu/armv7/socfpga/lowlevel_init.S +++ b/arch/arm/cpu/armv7/socfpga/lowlevel_init.S @@ -7,13 +7,6 @@ #include <config.h> #include <version.h> -/* Save the parameter pass in by previous boot loader */ -.global save_boot_params -save_boot_params: - /* no parameter to save */ - bx lr - - /* Set up the platform, once the cpu has been initialized */ .globl lowlevel_init lowlevel_init: diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c index 0b0d6a76fc..ad19e4c47c 100644 --- a/arch/arm/cpu/armv7/virt-dt.c +++ b/arch/arm/cpu/armv7/virt-dt.c @@ -90,6 +90,8 @@ static int fdt_psci(void *fdt) int armv7_update_dt(void *fdt) { + if (!armv7_boot_nonsec()) + return 0; #ifndef CONFIG_ARMV7_SECURE_BASE /* secure code lives in RAM, keep it alive */ fdt_add_mem_rsv(fdt, (unsigned long)__secure_start, diff --git a/arch/arm/include/asm/arch-keystone/hardware.h b/arch/arm/include/asm/arch-keystone/hardware.h index be22bdb1ca..16cbcee12b 100644 --- a/arch/arm/include/asm/arch-keystone/hardware.h +++ b/arch/arm/include/asm/arch-keystone/hardware.h @@ -144,6 +144,7 @@ typedef volatile unsigned int *dv_reg_p; #define KS2_DEVICE_STATE_CTRL_BASE 0x02620000 #define KS2_JTAG_ID_REG (KS2_DEVICE_STATE_CTRL_BASE + 0x18) #define KS2_DEVSTAT (KS2_DEVICE_STATE_CTRL_BASE + 0x20) +#define KS2_DEVCFG (KS2_DEVICE_STATE_CTRL_BASE + 0x14c) /* PSC */ #define KS2_PSC_BASE 0x02350000 diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h index 83d858f305..e19975efaf 100644 --- a/arch/arm/include/asm/arch-omap4/sys_proto.h +++ b/arch/arm/include/asm/arch-omap4/sys_proto.h @@ -22,6 +22,9 @@ extern const struct emif_regs emif_regs_elpida_200_mhz_2cs; extern const struct emif_regs emif_regs_elpida_380_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_2cs; +extern const struct dmm_lisa_map_regs lisa_map_2G_x_1_x_2; +extern const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2; +extern const struct dmm_lisa_map_regs ma_lisa_map_2G_x_2_x_2; struct omap_sysinfo { char *board_string; }; diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h index 323f282fb7..a13da23cf1 100644 --- a/arch/arm/include/asm/armv7.h +++ b/arch/arm/include/asm/armv7.h @@ -80,6 +80,7 @@ void v7_outer_cache_inval_range(u32 start, u32 end); int armv7_init_nonsec(void); int armv7_update_dt(void *fdt); +bool armv7_boot_nonsec(void); /* defined in assembly file */ unsigned int _nonsec_init(void); diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index a7f7c67997..0c1298a31e 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -238,7 +238,7 @@ static void boot_prep_linux(bootm_headers_t *images) } #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) -static bool boot_nonsec(void) +bool armv7_boot_nonsec(void) { char *s = getenv("bootm_boot_mode"); #ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT @@ -305,7 +305,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) if (!fake) { #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) - if (boot_nonsec()) { + if (armv7_boot_nonsec()) { armv7_init_nonsec(); secure_ram_addr(_do_nonsec_entry)(kernel_entry, 0, machid, r2); diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 16368cbb0d..783ba3576f 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -180,6 +180,22 @@ void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) else *regs = &emif_regs_elpida_400_mhz_1cs; } + +void emif_get_dmm_regs(const struct dmm_lisa_map_regs + **dmm_lisa_regs) +{ + u32 omap_rev = omap_revision(); + + if (omap_rev == OMAP4430_ES1_0) + *dmm_lisa_regs = &lisa_map_2G_x_1_x_2; + else if (omap_rev == OMAP4430_ES2_3) + *dmm_lisa_regs = &lisa_map_2G_x_2_x_2; + else if (omap_rev < OMAP4460_ES1_0) + *dmm_lisa_regs = &lisa_map_2G_x_2_x_2; + else + *dmm_lisa_regs = &ma_lisa_map_2G_x_2_x_2; +} + #endif /** diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index f0b713c1cf..e6d8a7ae2c 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -515,7 +515,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -#elif defined(CONFIG_ARC700) +#elif defined(CONFIG_ARC) int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 25b4675744..dc59fab828 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -123,7 +123,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (control) gd->fdt_blob = blob; else - set_working_fdt_addr(blob); + set_working_fdt_addr((void *)blob); if (argc >= 2) { int len; diff --git a/common/image.c b/common/image.c index b75a5ce29a..e691a51789 100644 --- a/common/image.c +++ b/common/image.c @@ -485,12 +485,22 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz) return; #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) + if (to > from) { + from += len; + to += len; + } while (len > 0) { size_t tail = (len > chunksz) ? chunksz : len; WATCHDOG_RESET(); + if (to > from) { + to -= tail; + from -= tail; + } memmove(to, from, tail); - to += tail; - from += tail; + if (to < from) { + to += tail; + from += tail; + } len -= tail; } #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */ diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c index c9a3beb79b..37d2d2a28e 100644 --- a/drivers/block/ahci.c +++ b/drivers/block/ahci.c @@ -137,6 +137,33 @@ static void sunxi_dma_init(volatile u8 *port_mmio) } #endif +int ahci_reset(u32 base) +{ + int i = 1000; + u32 host_ctl_reg = base + HOST_CTL; + u32 tmp = readl(host_ctl_reg); /* global controller reset */ + + if ((tmp & HOST_RESET) == 0) + writel_with_flush(tmp | HOST_RESET, host_ctl_reg); + + /* + * reset must complete within 1 second, or + * the hardware should be considered fried. + */ + do { + udelay(1000); + tmp = readl(host_ctl_reg); + i--; + } while ((i > 0) && (tmp & HOST_RESET)); + + if (i == 0) { + printf("controller reset failed (0x%x)\n", tmp); + return -1; + } + + return 0; +} + static int ahci_host_init(struct ahci_probe_ent *probe_ent) { #ifndef CONFIG_SCSI_AHCI_PLAT @@ -156,23 +183,9 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent) cap_save &= ((1 << 28) | (1 << 17)); cap_save |= (1 << 27); /* Staggered Spin-up. Not needed. */ - /* global controller reset */ - tmp = readl(mmio + HOST_CTL); - if ((tmp & HOST_RESET) == 0) - writel_with_flush(tmp | HOST_RESET, mmio + HOST_CTL); - - /* reset must complete within 1 second, or - * the hardware should be considered fried. - */ - i = 1000; - do { - udelay(1000); - tmp = readl(mmio + HOST_CTL); - if (!i--) { - debug("controller reset failed (0x%x)\n", tmp); - return -1; - } - } while (tmp & HOST_RESET); + ret = ahci_reset(probe_ent->mmio_base); + if (ret) + return ret; writel_with_flush(HOST_AHCI_EN, mmio + HOST_CTL); writel(cap_save, mmio + HOST_CAP); @@ -997,12 +1010,11 @@ static int ata_io_flush(u8 port) } -void scsi_bus_reset(void) +__weak void scsi_bus_reset(void) { /*Not implement*/ } - void scsi_print_error(ccb * pccb) { /*The ahci error info can be read in the ahci driver*/ diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c index 93829a40b6..459904d81c 100644 --- a/drivers/mtd/nand/omap_gpmc.c +++ b/drivers/mtd/nand/omap_gpmc.c @@ -368,8 +368,9 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat, uint32_t error_loc[ELM_MAX_ERROR_COUNT]; enum bch_level bch_type; uint32_t i, ecc_flag = 0; - uint8_t count, err = 0; + uint8_t count; uint32_t byte_pos, bit_pos; + int err = 0; /* check calculated ecc */ for (i = 0; i < ecc->bytes && !ecc_flag; i++) { diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 04a51db6d4..bccc3e3ed8 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -823,8 +823,11 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, int ret = -1; int firsttime; __u32 root_cluster = 0; + __u32 read_blk; int rootdir_size = 0; - int j; + int buffer_blk_cnt; + int do_read; + __u8 *dir_ptr; if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) { debug("Error: reading boot sector\n"); @@ -909,24 +912,54 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, isdir = 1; } - j = 0; + buffer_blk_cnt = 0; + firsttime = 1; while (1) { int i; - if (j == 0) { - debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%zd\n", - cursect, mydata->clust_size, DIRENTSPERBLOCK); + if (mydata->fatsize == 32 || firsttime) { + dir_ptr = do_fat_read_at_block; + firsttime = 0; + } else { + /** + * FAT16 sector buffer modification: + * Each loop, the second buffered block is moved to + * the buffer begin, and two next sectors are read + * next to the previously moved one. So the sector + * buffer keeps always 3 sectors for fat16. + * And the current sector is the buffer second sector + * beside the "firsttime" read, when it is the first one. + * + * PREFETCH_BLOCKS is 2 for FAT16 == loop[0:1] + * n = computed root dir sector + * loop | cursect-1 | cursect | cursect+1 | + * 0 | sector n+0 | sector n+1 | none | + * 1 | none | sector n+0 | sector n+1 | + * 0 | sector n+1 | sector n+2 | sector n+3 | + * 1 | sector n+3 | ... + */ + dir_ptr = (do_fat_read_at_block + mydata->sect_size); + memcpy(do_fat_read_at_block, dir_ptr, mydata->sect_size); + } + + do_read = 1; + + if (mydata->fatsize == 32 && buffer_blk_cnt) + do_read = 0; + + if (do_read) { + read_blk = (mydata->fatsize == 32) ? + mydata->clust_size : PREFETCH_BLOCKS; + + debug("FAT read(sect=%d, cnt:%d), clust_size=%d, DIRENTSPERBLOCK=%zd\n", + cursect, read_blk, mydata->clust_size, DIRENTSPERBLOCK); - if (disk_read(cursect, - (mydata->fatsize == 32) ? - (mydata->clust_size) : - PREFETCH_BLOCKS, - do_fat_read_at_block) < 0) { + if (disk_read(cursect, read_blk, dir_ptr) < 0) { debug("Error: reading rootdir block\n"); goto exit; } - dentptr = (dir_entry *) do_fat_read_at_block; + dentptr = (dir_entry *)dir_ptr; } for (i = 0; i < DIRENTSPERBLOCK; i++) { @@ -951,7 +984,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, get_vfatname(mydata, root_cluster, - do_fat_read_at_block, + dir_ptr, dentptr, l_name); if (dols == LS_ROOT) { @@ -1062,7 +1095,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, goto rootdir_done; /* We got a match */ } - debug("END LOOP: j=%d clust_size=%d\n", j, + debug("END LOOP: buffer_blk_cnt=%d clust_size=%d\n", buffer_blk_cnt, mydata->clust_size); /* @@ -1070,10 +1103,10 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, * root directory clusters when a cluster has been * completely processed. */ - ++j; + ++buffer_blk_cnt; int rootdir_end = 0; if (mydata->fatsize == 32) { - if (j == mydata->clust_size) { + if (buffer_blk_cnt == mydata->clust_size) { int nxtsect = 0; int nxt_clust = 0; @@ -1086,11 +1119,11 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, root_cluster = nxt_clust; cursect = nxtsect; - j = 0; + buffer_blk_cnt = 0; } } else { - if (j == PREFETCH_BLOCKS) - j = 0; + if (buffer_blk_cnt == PREFETCH_BLOCKS) + buffer_blk_cnt = 0; rootdir_end = (++cursect - mydata->rootdir_sect >= rootdir_size); diff --git a/include/ahci.h b/include/ahci.h index 35b8a8c09b..e8dee53575 100644 --- a/include/ahci.h +++ b/include/ahci.h @@ -161,5 +161,6 @@ struct ahci_probe_ent { }; int ahci_init(u32 base); +int ahci_reset(u32 base); #endif diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 560e3bf775..0004750518 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -47,8 +47,6 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART #ifdef CONFIG_NAND #define NANDARGS \ diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h index 4472c3e555..b00585c47b 100644 --- a/include/configs/am43xx_evm.h +++ b/include/configs/am43xx_evm.h @@ -148,8 +148,6 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART #ifndef CONFIG_SPL_BUILD #define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/beagle_x15.h b/include/configs/beagle_x15.h index cc36330938..c7719f389a 100644 --- a/include/configs/beagle_x15.h +++ b/include/configs/beagle_x15.h @@ -42,10 +42,9 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART /* CPSW Ethernet */ +#define CONFIG_CMD_NFS #define CONFIG_CMD_NET /* 'bootp' and 'tftp' */ #define CONFIG_CMD_DHCP #define CONFIG_BOOTP_DNS /* Configurable parts of CMD_DHCP */ diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h index 7c693d62d1..93938642fa 100644 --- a/include/configs/cm5200.h +++ b/include/configs/cm5200.h @@ -8,6 +8,11 @@ #ifndef __CONFIG_H #define __CONFIG_H + +#define CONFIG_SYS_GENERIC_BOARD +#define CONFIG_DISPLAY_BOARDINFO + + /* * High Level Configuration Options */ diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h index ccd9b88adc..9767512a5c 100644 --- a/include/configs/cm_t35.h +++ b/include/configs/cm_t35.h @@ -25,6 +25,7 @@ #define CONFIG_CMD_GPIO #define CONFIG_CM_T3X /* working with CM-T35 and CM-T3730 */ #define CONFIG_OMAP_COMMON +#define CONFIG_SYS_GENERIC_BOARD #define CONFIG_SDRC /* The chip has SDRC controller */ diff --git a/include/configs/cm_t54.h b/include/configs/cm_t54.h index 92ce1e17da..0cd4aec7e2 100644 --- a/include/configs/cm_t54.h +++ b/include/configs/cm_t54.h @@ -63,6 +63,19 @@ #define CONFIG_HSMMC2_8BIT #define CONFIG_SUPPORT_EMMC_BOOT +/* SATA Boot related defines */ +#define CONFIG_SPL_SATA_SUPPORT +#define CONFIG_SPL_SATA_BOOT_DEVICE 0 +#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1 + +#define CONFIG_CMD_SCSI +#define CONFIG_LIBATA +#define CONFIG_SCSI_AHCI +#define CONFIG_SCSI_AHCI_PLAT +#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1 +#define CONFIG_SYS_SCSI_MAX_LUN 1 +#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ + CONFIG_SYS_SCSI_MAX_LUN) /* USB UHH support options */ #define CONFIG_CMD_USB #define CONFIG_USB_HOST diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h index e5f8afef1e..e5a612cfc6 100644 --- a/include/configs/da850evm.h +++ b/include/configs/da850evm.h @@ -157,7 +157,7 @@ #define CONFIG_SPL_SPI_FLASH_SUPPORT #define CONFIG_SPL_SPI_LOAD #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 -#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x30000 +#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x40000 #endif /* @@ -251,7 +251,7 @@ #undef CONFIG_ENV_IS_IN_NAND #define CONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_SIZE (64 << 10) -#define CONFIG_ENV_OFFSET (256 << 10) +#define CONFIG_ENV_OFFSET (512 << 10) #define CONFIG_ENV_SECT_SIZE (64 << 10) #define CONFIG_SYS_NO_FLASH #endif @@ -259,6 +259,7 @@ /* * U-Boot general configuration */ +#define CONFIG_SYS_GENERIC_BOARD #define CONFIG_MISC_INIT_R #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOOTFILE "uImage" /* Boot file name */ @@ -275,6 +276,7 @@ #define CONFIG_SYS_LONGHELP #define CONFIG_CRC32_VERIFY #define CONFIG_MX_CYCLIC +#define CONFIG_OF_LIBFDT /* * Linux Information diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index 930b08e2f9..77e2f587bd 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -21,6 +21,7 @@ #define CONFIG_MACH_TYPE MACH_TYPE_DEVKIT8000 #define CONFIG_OMAP_GPIO #define CONFIG_OMAP_COMMON +#define CONFIG_SYS_GENERIC_BOARD /* * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 174a711bb4..dee2b11056 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -48,8 +48,6 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART #define CONFIG_HSMMC2_8BIT /* CPSW Ethernet */ diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h index e07795f921..0ca4e82e0f 100644 --- a/include/configs/omap5_uevm.h +++ b/include/configs/omap5_uevm.h @@ -36,8 +36,6 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART #define CONFIG_HSMMC2_8BIT #define CONFIG_SUPPORT_EMMC_BOOT diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index bc751722e8..2bd116477c 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -187,6 +187,8 @@ #define CONFIG_CMD_EXT2 #define CONFIG_CMD_EXT4 #define CONFIG_CMD_FS_GENERIC +#define CONFIG_PARTITION_UUIDS +#define CONFIG_CMD_PART #endif /* |