diff options
author | John Rigby <john.rigby@linaro.org> | 2011-10-18 21:19:17 -0600 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-12-06 12:16:42 -0700 |
commit | 5461313e54cce1bc85c0599d6dc7ba3c49094b62 (patch) | |
tree | 0d47a1545cea98c812324527b2879ca89667b5ce /common | |
parent | c8e42565afaaea61e1e5e159ca850652baa247f6 (diff) |
OMAP4: Panda: Add usb peripheral boot
Stripped down fastboot protocol for now but could be
just about anything. Will revisit once a fastboot
or dfu implementation hits upstream.
Signed-off-by: John Rigby <john.rigby@linaro.org>
Conflicts:
arch/arm/cpu/armv7/omap-common/Makefile
arch/arm/include/asm/omap_common.h
common/spl/spl.c
include/configs/omap4_common.h
spl/Makefile
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/Makefile | 1 | ||||
-rw-r--r-- | common/spl/spl.c | 5 | ||||
-rw-r--r-- | common/spl/spl_dsu.c | 48 |
3 files changed, 54 insertions, 0 deletions
diff --git a/common/spl/Makefile b/common/spl/Makefile index 5698a2335..e1960b806 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -19,6 +19,7 @@ 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_NET_SUPPORT) += spl_net.o +COBJS-$(CONFIG_SPL_DSU_SUPPORT) += spl_dsu.o endif COBJS := $(sort $(COBJS-y)) diff --git a/common/spl/spl.c b/common/spl/spl.c index 0d829c0f1..3b484e3a1 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -205,6 +205,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2) #endif break; #endif +#ifdef CONFIG_SPL_DSU_SUPPORT + case BOOT_DEVICE_USB: + spl_dsu_load_image(); + break; +#endif default: debug("SPL: Un-supported Boot Device\n"); hang(); diff --git a/common/spl/spl_dsu.c b/common/spl/spl_dsu.c new file mode 100644 index 000000000..b26a2ea37 --- /dev/null +++ b/common/spl/spl_dsu.c @@ -0,0 +1,48 @@ +/* + * (C) Copyright 2010 + * Texas Instruments, <www.ti.com> + * + * Aneesh V <aneesh@ti.com> + * + * 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 <spl.h> + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_SPL_DSU_SUPPORT +void spl_dsu_load_image(void) +{ + u32 loadaddr; + u32 size; + int err; + struct image_header *header; + + err = dsudownload(&loadaddr, &size); + + if (err) { + serial_printf("usb download failed"); + hang(); + } + header = (struct image_header *)loadaddr; + spl_parse_image_header(header); + memcpy((void *)spl_image.load_addr, (void *)loadaddr, spl_image.size); +} +#endif |