aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-12-19 11:06:58 -0700
committerJohn Rigby <john.rigby@linaro.org>2011-12-19 21:19:16 -0700
commitfd45af542f887a2e2ac0c55d89387df7b28b8a70 (patch)
tree58e9409af28eee69eef9c6c3b82ad5fc583376f5
parent537d985febd3b8bf1e5b17e4178903a799d23f18 (diff)
downloadu-boot-linaro-stable-fd45af542f887a2e2ac0c55d89387df7b28b8a70.tar.gz
OMAP4: Fix USB SPL Boot build errors
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--arch/arm/cpu/armv7/omap-common/Makefile3
-rw-r--r--arch/arm/cpu/armv7/omap-common/spl.c25
-rw-r--r--arch/arm/cpu/armv7/omap-common/spl_usb.c55
-rw-r--r--arch/arm/include/asm/omap_common.h4
4 files changed, 63 insertions, 24 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/Makefile b/arch/arm/cpu/armv7/omap-common/Makefile
index a68461126..11f944dcc 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -48,6 +48,9 @@ endif
ifdef CONFIG_SPL_MMC_SUPPORT
COBJS += spl_mmc.o
endif
+ifdef CONFIG_SPL_USB_SUPPORT
+COBJS += spl_usb.o
+endif
endif
ifndef CONFIG_SPL_BUILD
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
index b54b36260..f982b2bf4 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -106,29 +106,6 @@ static void jump_to_image_no_args(void)
image_entry((u32 *)boot_params_ptr_addr);
}
-#ifdef CONFIG_SPL_DSU_SUPPORT
-extern int dsudownload(u32 *, u32 *);
-
-static void dsuload(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;
- parse_image_header(header);
- memcpy((void *)image_load_addr, (void *)loadaddr, size);
- image_size = size;
-}
-#endif
-
void jump_to_image_no_args(void) __attribute__ ((noreturn));
void board_init_r(gd_t *id, ulong dummy)
{
@@ -160,7 +137,7 @@ void board_init_r(gd_t *id, ulong dummy)
#endif
#ifdef CONFIG_SPL_DSU_SUPPORT
case BOOT_DEVICE_USB:
- dsuload();
+ spl_dsu_load_image();
break;
#endif
default:
diff --git a/arch/arm/cpu/armv7/omap-common/spl_usb.c b/arch/arm/cpu/armv7/omap-common/spl_usb.c
new file mode 100644
index 000000000..4edaf0381
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap-common/spl_usb.c
@@ -0,0 +1,55 @@
+/*
+ * (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 <asm/u-boot.h>
+#include <asm/utils.h>
+#include <asm/arch/sys_proto.h>
+#include <version.h>
+#include <asm/omap_common.h>
+#include <asm/arch/mmc_host_def.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 *)loadaddr, (void *)spl_image.load_addr, spl_image.size);
+}
+#endif
+
+
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index dcd4937c5..4af08f868 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -95,6 +95,10 @@ void spl_nand_load_image(void);
/* MMC SPL functions */
void spl_mmc_load_image(void);
+/* USB SPL functions */
+void spl_dsu_load_image(void);
+int dsudownload(u32 *, u32 *);
+
#ifdef CONFIG_SPL_BOARD_INIT
void spl_board_init(void);
#endif