[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.1-309-gd2ed37e
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2012-05-20 21:13:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d2ed37ed5125e32f4e0241ee0a27cb7442e18a6c (commit)
from c99eb077701053abbdd77d921bf3e4930c7918e5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d2ed37ed5125e32f4e0241ee0a27cb7442e18a6c
Author: Eric Jarrige <eri...@ar...>
Date: Sun May 20 23:12:56 2012 +0200
[UBOOT] apf27: fix FPGA autoload issue on boot
-----------------------------------------------------------------------
Summary of changes:
...-Add-support-for-the-armadeus-apf27-board.patch | 49 +++++--------------
1 files changed, 13 insertions(+), 36 deletions(-)
diff --git a/patches/u-boot/2011.12/302-Add-support-for-the-armadeus-apf27-board.patch b/patches/u-boot/2011.12/302-Add-support-for-the-armadeus-apf27-board.patch
index ba99f40..a8cde15 100644
--- a/patches/u-boot/2011.12/302-Add-support-for-the-armadeus-apf27-board.patch
+++ b/patches/u-boot/2011.12/302-Add-support-for-the-armadeus-apf27-board.patch
@@ -79,7 +79,7 @@ new file mode 100644
index 0000000..e08b7a2
--- /dev/null
+++ b/board/armadeus/apf27/apf27.c
-@@ -0,0 +1,225 @@
+@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2007 Sascha Hauer, Pengutronix
+ * Copyright (C) 2008,2009 Eric Jarrige <jo...@us...>
@@ -104,37 +104,14 @@ index 0000000..e08b7a2
+#include <common.h>
+#include "crc.h"
+#include "fpga.h"
++#include <jffs2/jffs2.h>
+#include <nand.h>
++#include <netdev.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/errno.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
-+static int read_firmware (size_t offset, size_t end, u_char * buf)
-+{
-+ size_t amount_loaded = 0;
-+ size_t blocksize;
-+
-+ u_char *char_ptr;
-+
-+ blocksize = nand_info[0].erasesize;
-+
-+ while (offset < end) {
-+ if (nand_block_isbad(&nand_info[0], offset)) {
-+ offset += blocksize;
-+ } else {
-+ char_ptr = &buf[amount_loaded];
-+ if (nand_read(&nand_info[0], offset, &blocksize, char_ptr))
-+ return 1;
-+ offset += blocksize;
-+ amount_loaded += blocksize;
-+ }
-+ }
-+
-+ return amount_loaded;
-+}
-+
-+
+static int apf27_devices_init(void)
+{
+ int i;
@@ -215,22 +192,22 @@ index 0000000..e08b7a2
+{
+ char *s;
+ u_char * firmware_buffer = (u_char *)(CONFIG_SYS_LOAD_ADDR + CONFIG_SYS_MONITOR_LEN);
-+ size_t end = 0;
+ size_t size = 0;
+ size_t offset = -1;
-+ char *autoload = getenv ("firmware_autoload");
++ char *autoload = getenv ("firmware_autoload");
++ u8 pnum;
++ struct mtd_device *dev;
++ struct part_info *part;
+
+#if defined(CONFIG_FPGA)
+ /* init and download fpga */
+ if (( autoload ) && (0 == strcmp(autoload, "1"))) {
-+ if ((s = getenv("firmware_offset")) != NULL) {
-+ offset = simple_strtoul(s, NULL, 16);
-+ }
-+ if ((s = getenv("firmware_len")) != NULL) {
-+ end = offset + simple_strtoul(s, NULL, 16);
-+ }
-+ if ((-1 != offset) && (offset != end)) {
-+ size = read_firmware (offset, end, firmware_buffer);
++ if (mtdparts_init() == 0)
++ if (find_dev_and_part("firmware", &dev, &pnum, &part) == 0) {
++ size = part->size;
++ if (nand_read_skip_bad(&nand_info[0], part->offset,
++ &size, firmware_buffer))
++ size = 0;
+ }
+ }
+ APF27_init_fpga (firmware_buffer, size);
hooks/post-receive
--
armadeus
|