diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/cmd_mmc.c | 7 | ||||
| -rw-r--r-- | common/lcd.c | 41 | ||||
| -rw-r--r-- | common/spl/Makefile | 1 | ||||
| -rw-r--r-- | common/spl/spl.c | 10 | ||||
| -rw-r--r-- | common/spl/spl_onenand.c | 47 | 
5 files changed, 106 insertions, 0 deletions
| diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 7dacd5114..8c53a1031 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -282,6 +282,13 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  		mmc_init(mmc); +		if ((state == MMC_WRITE || state == MMC_ERASE)) { +			if (mmc_getwp(mmc) == 1) { +				printf("Error: card is write protected!\n"); +				return 1; +			} +		} +  		switch (state) {  		case MMC_READ:  			n = mmc->block_dev.block_read(curr_device, blk, diff --git a/common/lcd.c b/common/lcd.c index 66d4f94f9..590bbb930 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -33,6 +33,8 @@  #include <common.h>  #include <command.h>  #include <stdarg.h> +#include <search.h> +#include <env_callback.h>  #include <linux/types.h>  #include <stdio_dev.h>  #if defined(CONFIG_POST) @@ -1034,6 +1036,18 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)  }  #endif +#ifdef CONFIG_SPLASH_SCREEN_PREPARE +static inline int splash_screen_prepare(void) +{ +	return board_splash_screen_prepare(); +} +#else +static inline int splash_screen_prepare(void) +{ +	return 0; +} +#endif +  static void *lcd_logo(void)  {  #ifdef CONFIG_SPLASH_SCREEN @@ -1045,6 +1059,9 @@ static void *lcd_logo(void)  		int x = 0, y = 0;  		do_splash = 0; +		if (splash_screen_prepare()) +			return (void *)gd->fb_base; +  		addr = simple_strtoul (s, NULL, 16);  #ifdef CONFIG_SPLASH_SCREEN_ALIGN  		s = getenv("splashpos"); @@ -1084,6 +1101,30 @@ static void *lcd_logo(void)  #endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */  } +#ifdef CONFIG_SPLASHIMAGE_GUARD +static int on_splashimage(const char *name, const char *value, enum env_op op, +	int flags) +{ +	ulong addr; +	int aligned; + +	if (op == env_op_delete) +		return 0; + +	addr = simple_strtoul(value, NULL, 16); +	/* See README.displaying-bmps */ +	aligned = (addr % 4 == 2); +	if (!aligned) { +		printf("Invalid splashimage value. Value must be 16 bit aligned, but not 32 bit aligned\n"); +		return -1; +	} + +	return 0; +} + +U_BOOT_ENV_CALLBACK(splashimage, on_splashimage); +#endif +  void lcd_position_cursor(unsigned col, unsigned row)  {  	console_col = min(col, CONSOLE_COLS - 1); diff --git a/common/spl/Makefile b/common/spl/Makefile index 5698a2335..da2afc11b 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -18,6 +18,7 @@ COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o  COBJS-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o  COBJS-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o +COBJS-$(CONFIG_SPL_ONENAND_SUPPORT) += spl_onenand.o  COBJS-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o  endif diff --git a/common/spl/spl.c b/common/spl/spl.c index ff9ba7b0a..6715e0d20 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -197,6 +197,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)  		spl_nand_load_image();  		break;  #endif +#ifdef CONFIG_SPL_ONENAND_SUPPORT +	case BOOT_DEVICE_ONENAND: +		spl_onenand_load_image(); +		break; +#endif  #ifdef CONFIG_SPL_NOR_SUPPORT  	case BOOT_DEVICE_NOR:  		spl_nor_load_image(); @@ -221,6 +226,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)  #endif  		break;  #endif +#ifdef CONFIG_SPL_USBETH_SUPPORT +	case BOOT_DEVICE_USBETH: +		spl_net_load_image("usb_ether"); +		break; +#endif  	default:  		debug("SPL: Un-supported Boot Device\n");  		hang(); diff --git a/common/spl/spl_onenand.c b/common/spl/spl_onenand.c new file mode 100644 index 000000000..434930356 --- /dev/null +++ b/common/spl/spl_onenand.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2013 + * ISEE 2007 SL - Enric Balletbo i Serra <eballetbo@iseebcn.com> + * + * Based on common/spl/spl_nand.c + * Copyright (C) 2011 + * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#include <common.h> +#include <config.h> +#include <spl.h> +#include <asm/io.h> +#include <onenand_uboot.h> + +void spl_onenand_load_image(void) +{ +	struct image_header *header; + +	debug("spl: onenand\n"); + +	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */ +	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE); +	/* Load u-boot */ +	onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, +		CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header); +	spl_parse_image_header(header); +	onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, +		spl_image.size, (void *)spl_image.load_addr); +} |