[Armadeus-commitlog] armadeus branch, master, updated. armadeus-6.0-88-g0901cbe
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2016-05-30 10:58:02
|
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 0901cbe64e727eeed08c3977300cc9b5e82ed837 (commit)
via 60a9167fbe22df32fa0d37105d5a53e3daa89e77 (commit)
via eef3f0dc28dadb3a9f64bb079f540205f7b3a5aa (commit)
from 516bd4e4f95018d20e3a95bbdaae440e97b36afa (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 0901cbe64e727eeed08c3977300cc9b5e82ed837
Author: Julien BOIBESSOT <jul...@ar...>
Date: Wed May 25 15:29:00 2016 +0200
[U-BOOT] All boards: define CONFIG_STANDALONE_LOAD_ADDR in configs supposed to support it. That way, one might be able to test U-Boot standalone apps.
commit 60a9167fbe22df32fa0d37105d5a53e3daa89e77
Author: Julien BOIBESSOT <jul...@ar...>
Date: Tue May 24 10:00:39 2016 +0200
[U-BOOT] 2015.01: update patches to better suite format needed by git-am
commit eef3f0dc28dadb3a9f64bb079f540205f7b3a5aa
Author: Julien BOIBESSOT <jul...@ar...>
Date: Mon May 23 16:01:09 2016 +0200
[U-BOOT] 2015.01: rename patches to better fit git format-patch output
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf27/apf27-u-boot-2015.01.h | 3 +-
.../armadeus/apf27/apf27mainline-u-boot-2015.01.h | 3 +-
.../device/armadeus/apf28/apf28-u-boot-2015.01.h | 3 +-
.../armadeus/apf28/apf28mainline-u-boot-2015.01.h | 3 +-
.../device/armadeus/apf51/apf51-u-boot-2015.01.h | 3 +-
.../device/armadeus/apf6/apf6-u-boot-2014.07.h | 1 +
.../device/armadeus/apf6/apf6-u-boot-2015.01.h | 1 +
.../armadeus/apf9328/apf9328-u-boot-2015.01.h | 3 +-
...mand-env-param-compatibility-with-legacy-.patch | 27 +
...-continuous-MMU-memory-mapping-beside-the.patch | 109 ++
...upport-tftp-direct-download-to-NAND-flash.patch | 268 +++++
.../0004-i2c-mxc-fix-mx51-i2c-declaration.patch | 39 +
...-restore-command-env-param-compatitbility.patch | 15 -
...02-arm-support-continuous-mmu-mem-mapping.patch | 97 --
.../2015.01/003-nand_large_file_download.patch | 265 -----
.../004-i2c-mxc-fix-mx51-i2c-declaration.patch | 40 -
.../0100-apf9328-add-apf9328-in-Kconfig.patch | 38 +
...ction-get_timer-to-adjust-frequency-accor.patch | 28 +
...-Add-i2c-registers-for-Freescale-imx1-L-S.patch | 47 +
...pf9328-Add-Armadeus-Project-board-APF9328.patch | 1200 +++++++++++++++++++
...-PLL-freq-computation.-Improve-PLL-freq-c.patch | 66 ++
...-a-printf-in-speed.c-to-use-debug-instead.patch | 28 +
...0-change-some-printf-to-use-debug-instead.patch | 51 +
...e-is-not-correctly-flushed-during-the-boo.patch | 34 +
...rt-boot-from-RAM.-This-patch-adds-capabil.patch | 39 +
.../0302-mxc_nand.c-Support-nand-lock-unlock.patch | 101 ++
.../2015.01/0303-spartan3-Fix-minor-issue.patch | 77 ++
.../2015.01/0304-Add-apf27-imxfuse-command.patch | 379 ++++++
patches/u-boot/2015.01/0400-i.MX51.patch | 530 +++++++++
patches/u-boot/2015.01/0401-apf51.patch | 1042 +++++++++++++++++
.../2015.01/0402-apf51-add-apf51-in-Kconfig.patch | 36 +
.../2015.01/0403-Add-APF51-new-NAND-SPL.patch | 387 ++++++
.../2015.01/0500-apf28-add-apf28-in-Kconfig.patch | 36 +
.../2015.01/0501-i.MX28-update-and-fix.patch | 71 ++
patches/u-boot/2015.01/0502-add-APF28.patch | 1225 ++++++++++++++++++++
...3-APF28-workaround-for-RAM-size-detection.patch | 30 +
patches/u-boot/2015.01/0600-add-APF6.patch | 1025 ++++++++++++++++
...-bootstrap-get-uboot-image-on-serial-port.patch | 29 +
...0602-APF6-in-bootstrap-don-t-use-env-vars.patch | 43 +
patches/u-boot/2015.01/100-apf9328-Kconfig.patch | 26 -
patches/u-boot/2015.01/101-mx1-timer.patch | 25 -
patches/u-boot/2015.01/102-mx1-i2c.patch | 46 -
patches/u-boot/2015.01/103-apf9328.patch | 1185 -------------------
patches/u-boot/2015.01/106-mx1-pllclk.patch | 63 -
patches/u-boot/2015.01/107-mx1-pllclk-debug.patch | 26 -
patches/u-boot/2015.01/108-DM9000.patch | 48 -
.../2015.01/300-imx27-fix_dcache_boot_issue.patch | 22 -
.../2015.01/301-apf27-support-boot-from-RAM.patch | 27 -
.../u-boot/2015.01/302-imx-nand-lock-unlock.patch | 98 --
patches/u-boot/2015.01/303-spartan.patch | 71 --
.../u-boot/2015.01/304-apf27-misc-commands.patch | 376 ------
patches/u-boot/2015.01/400-imx51.patch | 522 ---------
patches/u-boot/2015.01/401-apf51.patch | 1026 ----------------
patches/u-boot/2015.01/402-apf51-Kconfig.patch | 27 -
patches/u-boot/2015.01/403-apf51-nand-spl-NG.patch | 361 ------
patches/u-boot/2015.01/500-apf28-Kconfig.patch | 28 -
.../u-boot/2015.01/501-imx28-update-and-fix.patch | 60 -
patches/u-boot/2015.01/502-add-apf28.patch | 1208 -------------------
.../503-apf28-workaround-ram-size-detection.patch | 18 -
patches/u-boot/2015.01/600-add-apf6.patch | 986 ----------------
..._bootstrap_get_uboot_image_on_serial_port.patch | 17 -
.../602-apf6-in_bootstrap_dont_use_env_vars.patch | 30 -
62 files changed, 6999 insertions(+), 6719 deletions(-)
create mode 100644 patches/u-boot/2015.01/0001-Restore-command-env-param-compatibility-with-legacy-.patch
create mode 100644 patches/u-boot/2015.01/0002-ARM-support-continuous-MMU-memory-mapping-beside-the.patch
create mode 100644 patches/u-boot/2015.01/0003-tftp-support-tftp-direct-download-to-NAND-flash.patch
create mode 100644 patches/u-boot/2015.01/0004-i2c-mxc-fix-mx51-i2c-declaration.patch
delete mode 100644 patches/u-boot/2015.01/001-restore-command-env-param-compatitbility.patch
delete mode 100644 patches/u-boot/2015.01/002-arm-support-continuous-mmu-mem-mapping.patch
delete mode 100644 patches/u-boot/2015.01/003-nand_large_file_download.patch
delete mode 100644 patches/u-boot/2015.01/004-i2c-mxc-fix-mx51-i2c-declaration.patch
create mode 100644 patches/u-boot/2015.01/0100-apf9328-add-apf9328-in-Kconfig.patch
create mode 100644 patches/u-boot/2015.01/0101-mx1-Fix-function-get_timer-to-adjust-frequency-accor.patch
create mode 100644 patches/u-boot/2015.01/0102-Add-i2c-registers-for-Freescale-imx1-L-S.patch
create mode 100644 patches/u-boot/2015.01/0103-apf9328-Add-Armadeus-Project-board-APF9328.patch
create mode 100644 patches/u-boot/2015.01/0106-mx1-improve-PLL-freq-computation.-Improve-PLL-freq-c.patch
create mode 100644 patches/u-boot/2015.01/0107-mx1-change-a-printf-in-speed.c-to-use-debug-instead.patch
create mode 100644 patches/u-boot/2015.01/0108-DM9000-change-some-printf-to-use-debug-instead.patch
create mode 100644 patches/u-boot/2015.01/0300-imx27-Dcache-is-not-correctly-flushed-during-the-boo.patch
create mode 100644 patches/u-boot/2015.01/0301-apf27-Support-boot-from-RAM.-This-patch-adds-capabil.patch
create mode 100644 patches/u-boot/2015.01/0302-mxc_nand.c-Support-nand-lock-unlock.patch
create mode 100644 patches/u-boot/2015.01/0303-spartan3-Fix-minor-issue.patch
create mode 100644 patches/u-boot/2015.01/0304-Add-apf27-imxfuse-command.patch
create mode 100644 patches/u-boot/2015.01/0400-i.MX51.patch
create mode 100644 patches/u-boot/2015.01/0401-apf51.patch
create mode 100644 patches/u-boot/2015.01/0402-apf51-add-apf51-in-Kconfig.patch
create mode 100644 patches/u-boot/2015.01/0403-Add-APF51-new-NAND-SPL.patch
create mode 100644 patches/u-boot/2015.01/0500-apf28-add-apf28-in-Kconfig.patch
create mode 100644 patches/u-boot/2015.01/0501-i.MX28-update-and-fix.patch
create mode 100644 patches/u-boot/2015.01/0502-add-APF28.patch
create mode 100644 patches/u-boot/2015.01/0503-APF28-workaround-for-RAM-size-detection.patch
create mode 100644 patches/u-boot/2015.01/0600-add-APF6.patch
create mode 100644 patches/u-boot/2015.01/0601-APF6-in-bootstrap-get-uboot-image-on-serial-port.patch
create mode 100644 patches/u-boot/2015.01/0602-APF6-in-bootstrap-don-t-use-env-vars.patch
delete mode 100644 patches/u-boot/2015.01/100-apf9328-Kconfig.patch
delete mode 100644 patches/u-boot/2015.01/101-mx1-timer.patch
delete mode 100644 patches/u-boot/2015.01/102-mx1-i2c.patch
delete mode 100644 patches/u-boot/2015.01/103-apf9328.patch
delete mode 100644 patches/u-boot/2015.01/106-mx1-pllclk.patch
delete mode 100644 patches/u-boot/2015.01/107-mx1-pllclk-debug.patch
delete mode 100644 patches/u-boot/2015.01/108-DM9000.patch
delete mode 100644 patches/u-boot/2015.01/300-imx27-fix_dcache_boot_issue.patch
delete mode 100644 patches/u-boot/2015.01/301-apf27-support-boot-from-RAM.patch
delete mode 100644 patches/u-boot/2015.01/302-imx-nand-lock-unlock.patch
delete mode 100644 patches/u-boot/2015.01/303-spartan.patch
delete mode 100644 patches/u-boot/2015.01/304-apf27-misc-commands.patch
delete mode 100644 patches/u-boot/2015.01/400-imx51.patch
delete mode 100644 patches/u-boot/2015.01/401-apf51.patch
delete mode 100644 patches/u-boot/2015.01/402-apf51-Kconfig.patch
delete mode 100644 patches/u-boot/2015.01/403-apf51-nand-spl-NG.patch
delete mode 100644 patches/u-boot/2015.01/500-apf28-Kconfig.patch
delete mode 100644 patches/u-boot/2015.01/501-imx28-update-and-fix.patch
delete mode 100644 patches/u-boot/2015.01/502-add-apf28.patch
delete mode 100644 patches/u-boot/2015.01/503-apf28-workaround-ram-size-detection.patch
delete mode 100644 patches/u-boot/2015.01/600-add-apf6.patch
delete mode 100644 patches/u-boot/2015.01/601-apf6-in_bootstrap_get_uboot_image_on_serial_port.patch
delete mode 100644 patches/u-boot/2015.01/602-apf6-in_bootstrap_dont_use_env_vars.patch
diff --git a/buildroot/target/device/armadeus/apf27/apf27-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf27/apf27-u-boot-2015.01.h
index 5ce3427..3e86391 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf27/apf27-u-boot-2015.01.h
@@ -182,10 +182,11 @@
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0xA0000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/buildroot/target/device/armadeus/apf27/apf27mainline-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf27/apf27mainline-u-boot-2015.01.h
index b3f009f..9247170 100644
--- a/buildroot/target/device/armadeus/apf27/apf27mainline-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf27/apf27mainline-u-boot-2015.01.h
@@ -182,10 +182,11 @@
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0xA0000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/buildroot/target/device/armadeus/apf28/apf28-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf28/apf28-u-boot-2015.01.h
index 8b94528..610fb56 100644
--- a/buildroot/target/device/armadeus/apf28/apf28-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf28/apf28-u-boot-2015.01.h
@@ -172,10 +172,11 @@
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0x40000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2015.01.h
index 3b6d788..24bebab 100644
--- a/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2015.01.h
@@ -172,10 +172,11 @@
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0x40000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2015.01.h
index 515a8bb..27fffa3 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2015.01.h
@@ -199,10 +199,11 @@
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0x90000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/buildroot/target/device/armadeus/apf6/apf6-u-boot-2014.07.h b/buildroot/target/device/armadeus/apf6/apf6-u-boot-2014.07.h
index 3c2a3a9..9b1bb7b 100644
--- a/buildroot/target/device/armadeus/apf6/apf6-u-boot-2014.07.h
+++ b/buildroot/target/device/armadeus/apf6/apf6-u-boot-2014.07.h
@@ -84,6 +84,7 @@
#define CONFIG_SYS_MEMTEST_START 0x10000000
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
#define CONFIG_LOADADDR 0x12000000
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/* MMC Configuration */
#define CONFIG_SUPPORT_EMMC_BOOT
diff --git a/buildroot/target/device/armadeus/apf6/apf6-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf6/apf6-u-boot-2015.01.h
index 3c2a3a9..9b1bb7b 100644
--- a/buildroot/target/device/armadeus/apf6/apf6-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf6/apf6-u-boot-2015.01.h
@@ -84,6 +84,7 @@
#define CONFIG_SYS_MEMTEST_START 0x10000000
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
#define CONFIG_LOADADDR 0x12000000
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/* MMC Configuration */
#define CONFIG_SUPPORT_EMMC_BOOT
diff --git a/buildroot/target/device/armadeus/apf9328/apf9328-u-boot-2015.01.h b/buildroot/target/device/armadeus/apf9328/apf9328-u-boot-2015.01.h
index 1bd8cbf..404818f 100644
--- a/buildroot/target/device/armadeus/apf9328/apf9328-u-boot-2015.01.h
+++ b/buildroot/target/device/armadeus/apf9328/apf9328-u-boot-2015.01.h
@@ -163,10 +163,11 @@
#define CONFIG_BOOTCOMMAND "run jffsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
- * Default load address for user programs and kernel
+ * Default load address for user/standalone programs and kernel
*/
#define CONFIG_LOADADDR 0x08000000
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_LOADADDR
/*
* Extra Environments
diff --git a/patches/u-boot/2015.01/0001-Restore-command-env-param-compatibility-with-legacy-.patch b/patches/u-boot/2015.01/0001-Restore-command-env-param-compatibility-with-legacy-.patch
new file mode 100644
index 0000000..b3a859f
--- /dev/null
+++ b/patches/u-boot/2015.01/0001-Restore-command-env-param-compatibility-with-legacy-.patch
@@ -0,0 +1,27 @@
+From 3b5d9c425d02fa25d38b4d761483c12a633b0a79 Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:07:02 +0200
+Subject: [PATCH 1/1] Restore command env param compatibility with legacy
+ U-Boot versions
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+---
+ common/cmd_nvedit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
+index 855808c..5a26ea8 100644
+--- a/common/cmd_nvedit.c
++++ b/common/cmd_nvedit.c
+@@ -749,7 +749,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int __flag,
+ }
+ }
+ debug("Final value for argc=%d\n", argc);
+- if (all && (argc == 0)) {
++ if ((all || (flag & H_FORCE)) && (argc == 0)) {
+ /* Reset the whole environment */
+ set_default_env("## Resetting to default environment\n");
+ return 0;
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0002-ARM-support-continuous-MMU-memory-mapping-beside-the.patch b/patches/u-boot/2015.01/0002-ARM-support-continuous-MMU-memory-mapping-beside-the.patch
new file mode 100644
index 0000000..f91d53c
--- /dev/null
+++ b/patches/u-boot/2015.01/0002-ARM-support-continuous-MMU-memory-mapping-beside-the.patch
@@ -0,0 +1,109 @@
+From f47202fc2fcadd2aaf6739f28895c011f353ec38 Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:10:06 +0200
+Subject: [PATCH 1/1] ARM: support continuous MMU memory mapping beside the
+ regular identity mapping.
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+---
+ arch/arm/include/asm/cache.h | 4 ++--
+ arch/arm/lib/cache-cp15.c | 26 +++++++++++++++++---------
+ 2 files changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
+index a836e9f..e432b21 100644
+--- a/arch/arm/include/asm/cache.h
++++ b/arch/arm/include/asm/cache.h
+@@ -27,12 +27,12 @@ static inline void invalidate_l2_cache(void)
+
+ void l2_cache_enable(void);
+ void l2_cache_disable(void);
+-void set_section_dcache(int section, enum dcache_option option);
++void set_section_dcache(int section, int section_index, enum dcache_option option);
+
+ void arm_init_before_mmu(void);
+ void arm_init_domains(void);
+ void cpu_cache_initialization(void);
+-void dram_bank_mmu_setup(int bank);
++void dram_bank_mmu_setup(int bank, int page_offset);
+
+ #endif
+
+diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
+index 0291afa..c63e3f1 100644
+--- a/arch/arm/lib/cache-cp15.c
++++ b/arch/arm/lib/cache-cp15.c
+@@ -32,14 +32,14 @@ static void cp_delay (void)
+ asm volatile("" : : : "memory");
+ }
+
+-void set_section_dcache(int section, enum dcache_option option)
++void set_section_dcache(int section, int section_index, enum dcache_option option)
+ {
+ u32 *page_table = (u32 *)gd->arch.tlb_addr;
+ u32 value;
+
+ value = (section << MMU_SECTION_SHIFT) | (3 << 10);
+ value |= option;
+- page_table[section] = value;
++ page_table[section_index] = value;
+ }
+
+ __weak void mmu_page_table_flush(unsigned long start, unsigned long stop)
+@@ -58,11 +58,11 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
+ debug("%s: start=%pa, size=%zu, option=%d\n", __func__, &start, size,
+ option);
+ for (upto = start; upto < end; upto++)
+- set_section_dcache(upto, option);
++ set_section_dcache(upto, upto, option);
+ mmu_page_table_flush((u32)&page_table[start], (u32)&page_table[end]);
+ }
+
+-__weak void dram_bank_mmu_setup(int bank)
++__weak void dram_bank_mmu_setup(int bank, int page_offset)
+ {
+ bd_t *bd = gd->bd;
+ int i;
+@@ -72,11 +72,11 @@ __weak void dram_bank_mmu_setup(int bank)
+ i < (bd->bi_dram[bank].start >> 20) + (bd->bi_dram[bank].size >> 20);
+ i++) {
+ #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
+- set_section_dcache(i, DCACHE_WRITETHROUGH);
++ set_section_dcache(i, page_offset++, DCACHE_WRITETHROUGH);
+ #elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
+- set_section_dcache(i, DCACHE_WRITEALLOC);
++ set_section_dcache(i, page_offset++, DCACHE_WRITEALLOC);
+ #else
+- set_section_dcache(i, DCACHE_WRITEBACK);
++ set_section_dcache(i, page_offset++, DCACHE_WRITEBACK);
+ #endif
+ }
+ }
+@@ -86,14 +86,22 @@ static inline void mmu_setup(void)
+ {
+ int i;
+ u32 reg;
++ bd_t *bd = gd->bd;
++ int page_offset, continuity_offset;
+
+ arm_init_before_mmu();
+ /* Set up an identity-mapping for all 4GB, rw for everyone */
+ for (i = 0; i < 4096; i++)
+- set_section_dcache(i, DCACHE_OFF);
++ set_section_dcache(i, i, DCACHE_OFF);
+
++ continuity_offset = bd->bi_dram[0].start >> 20;
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+- dram_bank_mmu_setup(i);
++ page_offset = (bd->bi_dram[i].start) >> 20;
++ /* direct identity mapping */
++ dram_bank_mmu_setup(i, page_offset);
++ /* secondary mapping to build a continous memory space */
++ dram_bank_mmu_setup(i, continuity_offset);
++ continuity_offset = (bd->bi_dram[i].start + bd->bi_dram[i].size) >> 20;
+ }
+
+ /* Copy the page table address to cp15 */
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0003-tftp-support-tftp-direct-download-to-NAND-flash.patch b/patches/u-boot/2015.01/0003-tftp-support-tftp-direct-download-to-NAND-flash.patch
new file mode 100644
index 0000000..8a48c9c
--- /dev/null
+++ b/patches/u-boot/2015.01/0003-tftp-support-tftp-direct-download-to-NAND-flash.patch
@@ -0,0 +1,268 @@
+From 1926cf4a956c39daf15ce420f1f5d00c98e41486 Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:15:06 +0200
+Subject: [PATCH 1/1] tftp: support tftp direct download to NAND flash.
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+Signed-off-by: Philippe Reynes <tr...@ya...>
+Signed-off-by: Nicolas Colombain <nic...@ar...>
+---
+ common/cmd_net.c | 26 ++++++++++-
+ net/tftp.c | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 161 insertions(+), 1 deletion(-)
+
+diff --git a/common/cmd_net.c b/common/cmd_net.c
+index 09489d4..d6018c0 100644
+--- a/common/cmd_net.c
++++ b/common/cmd_net.c
+@@ -12,6 +12,10 @@
+ #include <command.h>
+ #include <net.h>
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++int tftpboot2nand=0; /* set to 1 for tftp to nand direct */
++#endif
++
+ static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
+
+ static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+@@ -35,11 +39,19 @@ int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+ return ret;
+ }
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++U_BOOT_CMD(
++ tftpboot, 4, 1, do_tftpb,
++ "boot image via network using TFTP protocol",
++ "[loadAddress] [[hostIPaddr:]bootfilename] [nand]"
++);
++#else
+ U_BOOT_CMD(
+ tftpboot, 3, 1, do_tftpb,
+ "boot image via network using TFTP protocol",
+ "[loadAddress] [[hostIPaddr:]bootfilename]"
+ );
++#endif
+
+ #ifdef CONFIG_CMD_TFTPPUT
+ int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+@@ -185,6 +197,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
+ int size;
+ ulong addr;
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++ tftpboot2nand = 0;
++#endif
++
+ /* pre-set load_addr */
+ if ((s = getenv("loadaddr")) != NULL) {
+ load_addr = simple_strtoul(s, NULL, 16);
+@@ -212,8 +228,16 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
+
+ break;
+
+-#ifdef CONFIG_CMD_TFTPPUT
+ case 4:
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++ if( strcmp(argv[3],"nand") == 0 ) {
++ tftpboot2nand = 1;
++ load_addr = simple_strtoul(argv[1], NULL, 16);
++ copy_filename (BootFile, argv[2], sizeof(BootFile));
++ break;
++ }
++#endif
++#ifdef CONFIG_CMD_TFTPPUT
+ if (strict_strtoul(argv[1], 16, &save_addr) < 0 ||
+ strict_strtoul(argv[2], 16, &save_size) < 0) {
+ printf("Invalid address/size\n");
+diff --git a/net/tftp.c b/net/tftp.c
+index 0a2c533..708198e 100644
+--- a/net/tftp.c
++++ b/net/tftp.c
+@@ -15,6 +15,11 @@
+ #include <flash.h>
+ #endif
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++#include <nand.h>
++extern int tftpboot2nand;
++#endif
++
+ /* Well known TFTP port # */
+ #define WELL_KNOWN_PORT 69
+ /* Millisecs to timeout for lost pkt */
+@@ -28,6 +33,11 @@
+ /* Number of "loading" hashes per line (for checking the image size) */
+ #define HASHES_PER_LINE 65
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++static int temp_buf_offset = 0;
++unsigned long nand_offset = 0;
++#endif
++
+ /*
+ * TFTP operations.
+ */
+@@ -156,12 +166,120 @@ mcast_cleanup(void)
+
+ #endif /* CONFIG_MCAST_TFTP */
+
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++static size_t drop_ffs(const nand_info_t *nand, const u_char *buf,
++ const size_t *len)
++{
++ size_t l = *len;
++ ssize_t i;
++
++ for (i = l - 1; i >= 0; i--)
++ if (buf[i] != 0xFF)
++ break;
++
++ /* The resulting length must be aligned to the minimum flash I/O size */
++ l = i + 1;
++ l = (l + nand->writesize - 1) / nand->writesize;
++ l *= nand->writesize;
++
++ /*
++ * since the input length may be unaligned, prevent access past the end
++ * of the buffer
++ */
++ return min(l, *len);
++}
++
++static int tftp_nand_write(nand_info_t *meminfo, uchar *src, unsigned long *offset, size_t *length )
++{
++/* size_t written ;*/
++ int ret = 0;
++ loff_t offs;
++ int blockstart = -1;
++ size_t truncated_write_size;
++ /* find first non bad block */
++ do {
++ blockstart = (*offset) & (~meminfo->erasesize+1);
++ offs = blockstart;
++ ret = meminfo->_block_isbad(meminfo, offs);
++
++ if (ret < 0) {
++ printf("Bad block check failed\n");
++ return -1;
++ }
++ if (ret == 1) {
++ (*offset) = blockstart + meminfo->erasesize;
++/* printf("\rBad block at 0x%lx "
++ "in erase block from "
++ "0x%x will be skipped. new offset %x\n",
++ (long) offs,
++ blockstart, *offset);*/
++ }
++ } while ((ret!=0) && (*offset < meminfo->size) );
++
++ if (*offset < meminfo->size) {
++ /* write out the page data */
++ truncated_write_size = drop_ffs(meminfo, src, length);
++ ret = nand_write(meminfo, *offset, &truncated_write_size, src);
++/* ret = meminfo->write(meminfo,
++ *offset,
++ meminfo->oobblock,
++ &written,
++ src);*/
++ }
++ if (ret != 0) {
++ printf("writing NAND page at offset 0x%lx failed\n",
++ *offset);
++ return -1;
++ }
++ return ret;
++}
++
++static void tftp_2_nand(uchar * src, unsigned len)
++{
++ #define TFTP2NAND_BUFFER_SIZE 4096
++ static u_char temp_buf[TFTP2NAND_BUFFER_SIZE];
++ size_t nand_page_size;
++ /* retrieve current nand infos */
++ nand_info_t *nand;
++ nand = &nand_info[nand_curr_device];
++
++ nand_page_size = nand->writesize;
++ if ((nand_page_size<<1) > TFTP2NAND_BUFFER_SIZE) {
++ printf("error: NAND page size too big\n");
++ net_set_state(NETLOOP_FAIL);
++ return;
++ }
++
++ if ((TftpBlkSize<<1) > TFTP2NAND_BUFFER_SIZE) {
++ printf("error: tftp block size too big\n");
++ net_set_state(NETLOOP_FAIL);
++ return;
++ }
++
++ if (len)
++ (void)memcpy((void *)(temp_buf + temp_buf_offset), src, len);
++ temp_buf_offset += len;
++ if ((temp_buf_offset >= nand_page_size) || (!len) ){
++ if (tftp_nand_write(nand, temp_buf, &nand_offset, &nand_page_size)) {
++ net_set_state(NETLOOP_FAIL);
++ return;
++ }
++ nand_offset += nand_page_size;
++ if (len) {
++ temp_buf_offset -= nand_page_size;
++ (void)memcpy((void *)(temp_buf), (void *)(temp_buf+nand_page_size), temp_buf_offset);
++ }
++ }
++}
++#endif
++
+ static inline void
+ store_block(int block, uchar *src, unsigned len)
+ {
+ ulong offset = block * TftpBlkSize + TftpBlockWrapOffset;
+ ulong newsize = offset + len;
+ #ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
++#ifndef CONFIG_SYS_NO_FLASH
+ int i, rc = 0;
+
+ for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
+@@ -182,6 +300,13 @@ store_block(int block, uchar *src, unsigned len)
+ return;
+ }
+ } else
++#endif /* CONFIG_SYS_NO_FLASH */
++#ifdef CONFIG_CMD_NAND
++ if (tftpboot2nand) {
++ tftp_2_nand(src, len);
++ }
++ else
++#endif /* CONFIG_CMD_NAND */
+ #endif /* CONFIG_SYS_DIRECT_FLASH_TFTP */
+ {
+ (void)memcpy((void *)(load_addr + offset), src, len);
+@@ -204,6 +329,10 @@ static void new_transfer(void)
+ #ifdef CONFIG_CMD_TFTPPUT
+ TftpFinalBlock = 0;
+ #endif
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++ temp_buf_offset = 0;
++ nand_offset = load_addr;
++#endif
+ }
+
+ #ifdef CONFIG_CMD_TFTPPUT
+@@ -293,6 +422,13 @@ static void update_block_number(void)
+ /* The TFTP get or put is complete */
+ static void tftp_complete(void)
+ {
++#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++ /* complete write to nand with last buffer */
++ if (tftpboot2nand)
++ tftp_2_nand(NULL, 0);
++
++#endif /* defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP) */
++
+ #ifdef CONFIG_TFTP_TSIZE
+ /* Print hash marks for the last packet received */
+ while (TftpTsize && TftpNumchars < 49) {
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0004-i2c-mxc-fix-mx51-i2c-declaration.patch b/patches/u-boot/2015.01/0004-i2c-mxc-fix-mx51-i2c-declaration.patch
new file mode 100644
index 0000000..89127b3
--- /dev/null
+++ b/patches/u-boot/2015.01/0004-i2c-mxc-fix-mx51-i2c-declaration.patch
@@ -0,0 +1,39 @@
+From 8cc45b2a0332154b9ef2deaa3085da90f4397da7 Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Tue, 13 May 2014 14:22:51 +0200
+Subject: [PATCH 1/1] i2c: mxc: fix mx51 i2c declaration
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+---
+ drivers/i2c/mxc_i2c.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
+index fc5ee35..c3300f4 100644
+--- a/drivers/i2c/mxc_i2c.c
++++ b/drivers/i2c/mxc_i2c.c
+@@ -410,8 +410,11 @@ static void * const i2c_bases[] = {
+ #elif defined(CONFIG_MX27)
+ (void *)IMX_I2C1_BASE,
+ (void *)IMX_I2C2_BASE
++#elif defined(CONFIG_MX51)
++ (void *)I2C1_BASE_ADDR,
++ (void *)I2C2_BASE_ADDR,
+ #elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \
+- defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
++ defined(CONFIG_MX53) || \
+ defined(CONFIG_MX6) || defined(CONFIG_LS102XA)
+ (void *)I2C1_BASE_ADDR,
+ (void *)I2C2_BASE_ADDR,
+@@ -544,7 +547,7 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe,
+ CONFIG_SYS_MXC_I2C2_SPEED,
+ CONFIG_SYS_MXC_I2C2_SLAVE, 1)
+ #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\
+- defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\
++ defined(CONFIG_MX53) ||\
+ defined(CONFIG_MX6) || defined(CONFIG_LS102XA)
+ U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe,
+ mxc_i2c_read, mxc_i2c_write,
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/001-restore-command-env-param-compatitbility.patch b/patches/u-boot/2015.01/001-restore-command-env-param-compatitbility.patch
deleted file mode 100644
index d1700d0..0000000
--- a/patches/u-boot/2015.01/001-restore-command-env-param-compatitbility.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-restore command env param compatitbility with legacy U-Boot versions
-
-Signed-off-by: Eric Jarrige <eri...@ar...>
----
---- uboot-custom/common/cmd_nvedit.c
-+++ uboot-custom/common/cmd_nvedit.c
-@@ -749,7 +749,7 @@ static int do_env_default(cmd_tbl_t *cmd
- }
- }
- debug("Final value for argc=%d\n", argc);
-- if (all && (argc == 0)) {
-+ if ((all || (flag & H_FORCE)) && (argc == 0)) {
- /* Reset the whole environment */
- set_default_env("## Resetting to default environment\n");
- return 0;
diff --git a/patches/u-boot/2015.01/002-arm-support-continuous-mmu-mem-mapping.patch b/patches/u-boot/2015.01/002-arm-support-continuous-mmu-mem-mapping.patch
deleted file mode 100644
index e462a7d..0000000
--- a/patches/u-boot/2015.01/002-arm-support-continuous-mmu-mem-mapping.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-ARM: support continuous MMU memory mapping beside the regular identity mapping.
-
-Signed-off-by: Eric Jarrige <eri...@ar...>
----
-diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
-index 939de10..25f0ff1 100644
---- a/arch/arm/lib/cache-cp15.c
-+++ b/arch/arm/lib/cache-cp15.c
-@@ -32,14 +32,14 @@ static void cp_delay (void)
- asm volatile("" : : : "memory");
- }
-
--void set_section_dcache(int section, enum dcache_option option)
-+void set_section_dcache(int section, int section_index, enum dcache_option option)
- {
- u32 *page_table = (u32 *)gd->arch.tlb_addr;
- u32 value;
-
- value = (section << MMU_SECTION_SHIFT) | (3 << 10);
- value |= option;
-- page_table[section] = value;
-+ page_table[section_index] = value;
- }
-
- __weak void mmu_page_table_flush(unsigned long start, unsigned long stop)
-@@ -58,11 +58,11 @@ void mmu_set_region_dcache_behaviour(u32
- debug("%s: start=%pa, size=%zu, option=%d\n", __func__, &start, size,
- option);
- for (upto = start; upto < end; upto++)
-- set_section_dcache(upto, option);
-+ set_section_dcache(upto, upto, option);
- mmu_page_table_flush((u32)&page_table[start], (u32)&page_table[end]);
- }
-
--__weak void dram_bank_mmu_setup(int bank)
-+__weak void dram_bank_mmu_setup(int bank, int page_offset)
- {
- bd_t *bd = gd->bd;
- int i;
-@@ -72,11 +72,11 @@ __weak void dram_bank_mmu_setup(int bank
- i < (bd->bi_dram[bank].start >> 20) + (bd->bi_dram[bank].size >> 20);
- i++) {
- #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-- set_section_dcache(i, DCACHE_WRITETHROUGH);
-+ set_section_dcache(i, page_offset++, DCACHE_WRITETHROUGH);
- #elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-- set_section_dcache(i, DCACHE_WRITEALLOC);
-+ set_section_dcache(i, page_offset++, DCACHE_WRITEALLOC);
- #else
-- set_section_dcache(i, DCACHE_WRITEBACK);
-+ set_section_dcache(i, page_offset++, DCACHE_WRITEBACK);
- #endif
- }
- }
-@@ -86,14 +86,22 @@ static inline void mmu_setup(void)
- {
- int i;
- u32 reg;
-+ bd_t *bd = gd->bd;
-+ int page_offset, continuity_offset;
-
- arm_init_before_mmu();
- /* Set up an identity-mapping for all 4GB, rw for everyone */
- for (i = 0; i < 4096; i++)
-- set_section_dcache(i, DCACHE_OFF);
-+ set_section_dcache(i, i, DCACHE_OFF);
-
-+ continuity_offset = bd->bi_dram[0].start >> 20;
- for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
-- dram_bank_mmu_setup(i);
-+ page_offset = (bd->bi_dram[i].start) >> 20;
-+ /* direct identity mapping */
-+ dram_bank_mmu_setup(i, page_offset);
-+ /* secondary mapping to build a continous memory space */
-+ dram_bank_mmu_setup(i, continuity_offset);
-+ continuity_offset = (bd->bi_dram[i].start + bd->bi_dram[i].size) >> 20;
- }
-
- /* Copy the page table address to cp15 */
-diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
---- a/arch/arm/include/asm/cache.h
-+++ b/arch/arm/include/asm/cache.h
-@@ -27,12 +27,12 @@ static inline void invalidate_l2_cache(v
-
- void l2_cache_enable(void);
- void l2_cache_disable(void);
--void set_section_dcache(int section, enum dcache_option option);
-+void set_section_dcache(int section, int section_index, enum dcache_option option);
-
- void arm_init_before_mmu(void);
- void arm_init_domains(void);
- void cpu_cache_initialization(void);
--void dram_bank_mmu_setup(int bank);
-+void dram_bank_mmu_setup(int bank, int page_offset);
-
- #endif
-
diff --git a/patches/u-boot/2015.01/003-nand_large_file_download.patch b/patches/u-boot/2015.01/003-nand_large_file_download.patch
deleted file mode 100644
index 25c80f1..0000000
--- a/patches/u-boot/2015.01/003-nand_large_file_download.patch
+++ /dev/null
@@ -1,265 +0,0 @@
-tftp: support tftp direct download to NAND flash.
-
-Signed-off-by: Eric Jarrige <eri...@ar...>
-Signed-off-by: Philippe Reynes <tr...@ya...>
-Signed-off-by: Nicolas Colombain <nic...@ar...>
----
- common/cmd_net.c | 26 ++++++++++++-
- net/tftp.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 137 insertions(+), 1 deletions(-)
-
-diff --git a/common/cmd_net.c b/common/cmd_net.c
-index a9ade8b..fc1ce05 100644
---- a/common/cmd_net.c
-+++ b/common/cmd_net.c
-@@ -12,6 +12,10 @@
- #include <command.h>
- #include <net.h>
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+int tftpboot2nand=0; /* set to 1 for tftp to nand direct */
-+#endif
-+
- static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
-
- static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-@@ -35,11 +39,19 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
- return ret;
- }
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+U_BOOT_CMD(
-+ tftpboot, 4, 1, do_tftpb,
-+ "boot image via network using TFTP protocol",
-+ "[loadAddress] [[hostIPaddr:]bootfilename] [nand]"
-+);
-+#else
- U_BOOT_CMD(
- tftpboot, 3, 1, do_tftpb,
- "boot image via network using TFTP protocol",
- "[loadAddress] [[hostIPaddr:]bootfilename]"
- );
-+#endif
-
- #ifdef CONFIG_CMD_TFTPPUT
- int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-@@ -185,6 +197,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
- int size;
- ulong addr;
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+ tftpboot2nand = 0;
-+#endif
-+
- /* pre-set load_addr */
- if ((s = getenv("loadaddr")) != NULL) {
- load_addr = simple_strtoul(s, NULL, 16);
-@@ -212,8 +228,16 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
-
- break;
-
--#ifdef CONFIG_CMD_TFTPPUT
- case 4:
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+ if( strcmp(argv[3],"nand") == 0 ) {
-+ tftpboot2nand = 1;
-+ load_addr = simple_strtoul(argv[1], NULL, 16);
-+ copy_filename (BootFile, argv[2], sizeof(BootFile));
-+ break;
-+ }
-+#endif
-+#ifdef CONFIG_CMD_TFTPPUT
- if (strict_strtoul(argv[1], 16, &save_addr) < 0 ||
- strict_strtoul(argv[2], 16, &save_size) < 0) {
- printf("Invalid address/size\n");
-diff --git a/net/tftp.c b/net/tftp.c
-index 59a8ebb..727e746 100644
---- a/net/tftp.c
-+++ b/net/tftp.c
-@@ -15,6 +15,11 @@
- #include <flash.h>
- #endif
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+#include <nand.h>
-+extern int tftpboot2nand;
-+#endif
-+
- /* Well known TFTP port # */
- #define WELL_KNOWN_PORT 69
- /* Millisecs to timeout for lost pkt */
-@@ -28,6 +33,11 @@
- /* Number of "loading" hashes per line (for checking the image size) */
- #define HASHES_PER_LINE 65
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+static int temp_buf_offset = 0;
-+unsigned long nand_offset = 0;
-+#endif
-+
- /*
- * TFTP operations.
- */
-@@ -156,12 +166,120 @@ mcast_cleanup(void)
-
- #endif /* CONFIG_MCAST_TFTP */
-
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+static size_t drop_ffs(const nand_info_t *nand, const u_char *buf,
-+ const size_t *len)
-+{
-+ size_t l = *len;
-+ ssize_t i;
-+
-+ for (i = l - 1; i >= 0; i--)
-+ if (buf[i] != 0xFF)
-+ break;
-+
-+ /* The resulting length must be aligned to the minimum flash I/O size */
-+ l = i + 1;
-+ l = (l + nand->writesize - 1) / nand->writesize;
-+ l *= nand->writesize;
-+
-+ /*
-+ * since the input length may be unaligned, prevent access past the end
-+ * of the buffer
-+ */
-+ return min(l, *len);
-+}
-+
-+static int tftp_nand_write(nand_info_t *meminfo, uchar *src, unsigned long *offset, size_t *length )
-+{
-+/* size_t written ;*/
-+ int ret = 0;
-+ loff_t offs;
-+ int blockstart = -1;
-+ size_t truncated_write_size;
-+ /* find first non bad block */
-+ do {
-+ blockstart = (*offset) & (~meminfo->erasesize+1);
-+ offs = blockstart;
-+ ret = meminfo->_block_isbad(meminfo, offs);
-+
-+ if (ret < 0) {
-+ printf("Bad block check failed\n");
-+ return -1;
-+ }
-+ if (ret == 1) {
-+ (*offset) = blockstart + meminfo->erasesize;
-+/* printf("\rBad block at 0x%lx "
-+ "in erase block from "
-+ "0x%x will be skipped. new offset %x\n",
-+ (long) offs,
-+ blockstart, *offset);*/
-+ }
-+ } while ((ret!=0) && (*offset < meminfo->size) );
-+
-+ if (*offset < meminfo->size) {
-+ /* write out the page data */
-+ truncated_write_size = drop_ffs(meminfo, src, length);
-+ ret = nand_write(meminfo, *offset, &truncated_write_size, src);
-+/* ret = meminfo->write(meminfo,
-+ *offset,
-+ meminfo->oobblock,
-+ &written,
-+ src);*/
-+ }
-+ if (ret != 0) {
-+ printf("writing NAND page at offset 0x%lx failed\n",
-+ *offset);
-+ return -1;
-+ }
-+ return ret;
-+}
-+
-+static void tftp_2_nand(uchar * src, unsigned len)
-+{
-+ #define TFTP2NAND_BUFFER_SIZE 4096
-+ static u_char temp_buf[TFTP2NAND_BUFFER_SIZE];
-+ size_t nand_page_size;
-+ /* retrieve current nand infos */
-+ nand_info_t *nand;
-+ nand = &nand_info[nand_curr_device];
-+
-+ nand_page_size = nand->writesize;
-+ if ((nand_page_size<<1) > TFTP2NAND_BUFFER_SIZE) {
-+ printf("error: NAND page size too big\n");
-+ net_set_state(NETLOOP_FAIL);
-+ return;
-+ }
-+
-+ if ((TftpBlkSize<<1) > TFTP2NAND_BUFFER_SIZE) {
-+ printf("error: tftp block size too big\n");
-+ net_set_state(NETLOOP_FAIL);
-+ return;
-+ }
-+
-+ if (len)
-+ (void)memcpy((void *)(temp_buf + temp_buf_offset), src, len);
-+ temp_buf_offset += len;
-+ if ((temp_buf_offset >= nand_page_size) || (!len) ){
-+ if( tftp_nand_write(nand, temp_buf, &nand_offset, &nand_page_size) ){
-+ net_set_state(NETLOOP_FAIL);
-+ return;
-+ }
-+ nand_offset += nand_page_size;
-+ if (len){
-+ temp_buf_offset -= nand_page_size;
-+ (void)memcpy((void *)(temp_buf), (void *)(temp_buf+nand_page_size), temp_buf_offset);
-+ }
-+ }
-+}
-+#endif
-+
- static inline void
- store_block(int block, uchar *src, unsigned len)
- {
- ulong offset = block * TftpBlkSize + TftpBlockWrapOffset;
- ulong newsize = offset + len;
- #ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
-+#ifndef CONFIG_SYS_NO_FLASH
- int i, rc = 0;
-
- for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
-@@ -182,6 +276,13 @@ store_block(int block, uchar *src, unsigned len)
- return;
- }
- } else
-+#endif /* CONFIG_SYS_NO_FLASH */
-+#ifdef CONFIG_CMD_NAND
-+ if (tftpboot2nand) {
-+ tftp_2_nand(src, len);
-+ }
-+ else
-+#endif /* CONFIG_CMD_NAND */
- #endif /* CONFIG_SYS_DIRECT_FLASH_TFTP */
- {
- (void)memcpy((void *)(load_addr + offset), src, len);
-@@ -204,6 +305,10 @@ static void new_transfer(void)
- #ifdef CONFIG_CMD_TFTPPUT
- TftpFinalBlock = 0;
- #endif
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+ temp_buf_offset = 0;
-+ nand_offset = load_addr;
-+#endif
- }
-
- #ifdef CONFIG_CMD_TFTPPUT
-@@ -293,6 +398,13 @@ static void update_block_number(void)
- /* The TFTP get or put is complete */
- static void tftp_complete(void)
- {
-+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
-+ /* complete write to nand with last buffer */
-+ if (tftpboot2nand)
-+ tftp_2_nand(NULL, 0);
-+
-+#endif /* defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP) */
-+
- #ifdef CONFIG_TFTP_TSIZE
- /* Print hash marks for the last packet received */
- while (TftpTsize && TftpNumchars < 49) {
---
-1.7.2.5
-
diff --git a/patches/u-boot/2015.01/004-i2c-mxc-fix-mx51-i2c-declaration.patch b/patches/u-boot/2015.01/004-i2c-mxc-fix-mx51-i2c-declaration.patch
deleted file mode 100644
index 04f72f5..0000000
--- a/patches/u-boot/2015.01/004-i2c-mxc-fix-mx51-i2c-declaration.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 8cc45b2a0332154b9ef2deaa3085da90f4397da7 Mon Sep 17 00:00:00 2001
-From: Eric Jarrige <eri...@ar...>
-Date: Tue, 13 May 2014 14:22:51 +0200
-Subject: [PATCH 1/1] i2c: mxc: fix mx51 i2c declaration
-
-
-Signed-off-by: Eric Jarrige <eri...@ar...>
----
- drivers/i2c/mxc_i2c.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
-index 595019b..a4280b4 100644
---- a/drivers/i2c/mxc_i2c.c
-+++ b/drivers/i2c/mxc_i2c.c
-@@ -410,8 +410,11 @@ static void * const i2c_bases[] = {
- #elif defined(CONFIG_MX27)
- (void *)IMX_I2C1_BASE,
- (void *)IMX_I2C2_BASE
-+#elif defined(CONFIG_MX51)
-+ (void *)I2C1_BASE_ADDR,
-+ (void *)I2C2_BASE_ADDR,
- #elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \
-- defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
-+ defined(CONFIG_MX53) || \
- defined(CONFIG_MX6) || defined(CONFIG_LS102XA)
- (void *)I2C1_BASE_ADDR,
- (void *)I2C2_BASE_ADDR,
-@@ -544,7 +547,7 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe,
- CONFIG_SYS_MXC_I2C2_SPEED,
- CONFIG_SYS_MXC_I2C2_SLAVE, 1)
- #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\
-- defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\
-+ defined(CONFIG_MX53) ||\
- defined(CONFIG_MX6) || defined(CONFIG_LS102XA)
- U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe,
- mxc_i2c_read, mxc_i2c_write,
---
-1.7.9.5
-
diff --git a/patches/u-boot/2015.01/0100-apf9328-add-apf9328-in-Kconfig.patch b/patches/u-boot/2015.01/0100-apf9328-add-apf9328-in-Kconfig.patch
new file mode 100644
index 0000000..e299e7f
--- /dev/null
+++ b/patches/u-boot/2015.01/0100-apf9328-add-apf9328-in-Kconfig.patch
@@ -0,0 +1,38 @@
+From 17e4dd51ceff139c0fa7198cad544d3a0f101f5f Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:41:43 +0200
+Subject: [PATCH 1/1] apf9328: add apf9328 in Kconfig
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+---
+ arch/arm/Kconfig | 5 +++++
+ git-am-juju.sh | 36 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 41 insertions(+)
+ create mode 100755 git-am-juju.sh
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 5eb1d03..90661aa 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -260,6 +260,10 @@ config TARGET_APF27
+ select CPU_ARM926EJS
+ select SUPPORT_SPL
+
++config TARGET_APF9328
++ bool "Support apf9328"
++ select CPU_ARM920T
++
+ config TARGET_IMX27LITE
+ bool "Support imx27lite"
+ select CPU_ARM926EJS
+@@ -852,6 +856,7 @@ source "board/Marvell/gplugd/Kconfig"
+ source "board/afeb9260/Kconfig"
+ source "board/altera/socfpga/Kconfig"
+ source "board/armadeus/apf27/Kconfig"
++source "board/armadeus/apf9328/Kconfig"
+ source "board/armltd/integrator/Kconfig"
+ source "board/armltd/vexpress/Kconfig"
+ source "board/armltd/vexpress64/Kconfig"
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0101-mx1-Fix-function-get_timer-to-adjust-frequency-accor.patch b/patches/u-boot/2015.01/0101-mx1-Fix-function-get_timer-to-adjust-frequency-accor.patch
new file mode 100644
index 0000000..840ce8d
--- /dev/null
+++ b/patches/u-boot/2015.01/0101-mx1-Fix-function-get_timer-to-adjust-frequency-accor.patch
@@ -0,0 +1,28 @@
+From 72728dabe3544373229c28b2d20cf44928d65f3c Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:42:44 +0200
+Subject: [PATCH 1/1] mx1: Fix function get_timer() to adjust frequency according to CONFIG_SYS_HZ
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+Signed-off-by: Philippe Reynes <tr...@ya...>
+Cc: Stefano Babic <sb...@de...>
+---
+ arch/arm/cpu/arm920t/imx/timer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
+index b62558f..bc1f3e5 100644
+--- a/arch/arm/cpu/arm920t/imx/timer.c
++++ b/arch/arm/cpu/arm920t/imx/timer.c
+@@ -39,7 +39,7 @@ int timer_init (void)
+ */
+ ulong get_timer (ulong base)
+ {
+- return get_timer_masked() - base;
++ return get_timer_masked() / (1000000 / CONFIG_SYS_HZ) - base;
+ }
+
+ ulong get_timer_masked (void)
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0102-Add-i2c-registers-for-Freescale-imx1-L-S.patch b/patches/u-boot/2015.01/0102-Add-i2c-registers-for-Freescale-imx1-L-S.patch
new file mode 100644
index 0000000..2c75eac
--- /dev/null
+++ b/patches/u-boot/2015.01/0102-Add-i2c-registers-for-Freescale-imx1-L-S.patch
@@ -0,0 +1,47 @@
+From 7c8d741ddd71cc1ac1929d3aa39ba1ca49d5b054 Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:43:35 +0200
+Subject: [PATCH 1/1] Add i2c registers for Freescale imx1/L/S
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+Signed-off-by: Philippe Reynes <tr...@ya...>
+Cc: Stefano Babic <sb...@de...>
+---
+ arch/arm/include/asm/arch-imx/imx-regs.h | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/arch/arm/include/asm/arch-imx/imx-regs.h b/arch/arm/include/asm/arch-imx/imx-regs.h
+index 4de0779..1fd3e17 100644
+--- a/arch/arm/include/asm/arch-imx/imx-regs.h
++++ b/arch/arm/include/asm/arch-imx/imx-regs.h
+@@ -634,4 +634,27 @@
+ #define TSTAT_CAPT (1<<1) /* Capture event */
+ #define TSTAT_COMP (1) /* Compare event */
+
++/*
++ * I2C module
++ */
++#define IADR __REG(IMX_I2C_BASE + 0x000) /* I2C Address Register */
++#define IFDR __REG(IMX_I2C_BASE + 0x004) /* I2C Frequency Divider Register*/
++#define I2CR __REG(IMX_I2C_BASE + 0x008) /* I2C Control Register */
++#define I2SR __REG(IMX_I2C_BASE + 0x00C) /* I2C Status Register */
++#define I2DR __REG(IMX_I2C_BASE + 0x010) /* I2C Data I/O Register */
++/* I2C Control Register Bit Fields */
++#define I2CR_IEN (1<<7) /* I2C Enable */
++#define I2CR_IIEN (1<<6) /* I2C Interrupt Enable */
++#define I2CR_MSTA (1<<5) /* I2C Master/Slave Mode Select */
++#define I2CR_MTX (1<<4) /* I2C Transmit/Receive Mode Select */
++#define I2CR_TXAK (1<<3) /* I2C Transmit Acknowledge Enable */
++#define I2CR_RSTA (1<<2) /* I2C Repeated START */
++#define I2SR_ICF (1<<7) /* I2C Data Transfer */
++#define I2SR_IAAS (1<<6) /* I2C Addressed As a Slave */
++#define I2SR_IBB (1<<5) /* I2C Bus Busy */
++#define I2SR_IAL (1<<4) /* I2C Arbitration Lost */
++#define I2SR_SRW (1<<2) /* I2C Slave Read/Write */
++#define I2SR_IIF (1<<1) /* I2C interrupt */
++#define I2SR_RXAK (1<<0) /* I2C Received Acknowledge */
++
+ #endif /* _IMX_REGS_H */
+--
+2.1.4
+
diff --git a/patches/u-boot/2015.01/0103-apf9328-Add-Armadeus-Project-board-APF9328.patch b/patches/u-boot/2015.01/0103-apf9328-Add-Armadeus-Project-board-APF9328.patch
new file mode 100644
index 0000000..c0260eb
--- /dev/null
+++ b/patches/u-boot/2015.01/0103-apf9328-Add-Armadeus-Project-board-APF9328.patch
@@ -0,0 +1,1200 @@
+From a502d32ab3dfc91251be6ca84a4ff45890a64d9f Mon Sep 17 00:00:00 2001
+From: Eric Jarrige <eri...@ar...>
+Date: Mon, 23 May 2016 12:44:09 +0200
+Subject: [PATCH 1/1] apf9328: Add Armadeus Project board APF9328
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+Signed-off-by: Nicolas Colombain <nic...@ar...>
+Signed-off-by: Philippe Reynes <tr...@ya...>
+---
+ board/armadeus/apf9328/Kconfig | 15 ++
+ board/armadeus/apf9328/MAINTAINERS | 6 +
+ board/armadeus/apf9328/Makefile | 10 +
+ board/armadeus/apf9328/apf9328.c | 61 +++++
+ board/armadeus/apf9328/apf9328fpga.c | 65 +++++
+ board/armadeus/apf9328/apf9328fpga.h | 10 +
+ board/armadeus/apf9328/eeprom.c | 72 ++++++
+ board/armadeus/apf9328/fpga.c | 116 +++++++++
+ board/armadeus/apf9328/fpga.h | 15 ++
+ board/armadeus/apf9328/i2c.c | 260 +++++++++++++++++++
+ board/armadeus/apf9328/lowlevel_init.S | 458 +++++++++++++++++++++++++++++++++
+ configs/apf9328_defconfig | 2 +
+ 12 files changed, 1090 insertions(+)
+ create mode 100644 board/armadeus/apf9328/Kconfig
+ create mode 100644 board/armadeus/apf9328/MAINTAINERS
+ create mode 100644 board/armadeus/apf9328/Makefile
+ create mode 100644 board/armadeus/apf9328/apf9328.c
+ create mode 100644 board/armadeus/apf9328/apf9328fpga.c
+ create mode 100644 board/armadeus/apf9328/apf9328fpga.h
+ create mode 100644 board/armadeus/apf9328/eeprom.c
+ create mode 100644 board/armadeus/apf9328/fpga.c
+ create mode 100644 board/armadeus/apf9328/fpga.h
+ create mode 100644 board/armadeus/apf9328/i2c.c
+ create mode 100644 board/armadeus/apf9328/lowlevel_init.S
+ create mode 100644 configs/apf9328_defconfig
+
+diff --git a/board/armadeus/apf9328/Kconfig b/board/armadeus/apf9328/Kconfig
+new file mode 100644
+index 0000000..0b119a7
+--- /dev/null
++++ b/board/armadeus/apf9328/Kconfig
+@@ -0,0 +1,15 @@
++if TARGET_APF9328
++
++config SYS_BOARD
++ default "apf9328"
++
++config SYS_VENDOR
++ default "armadeus"
++
++config SYS_SOC
++ default "imx"
++
++config SYS_CONFIG_NAME
++ default "apf9328"
++
++endif
+diff --git a/board/armadeus/apf9328/MAINTAINERS b/board/armadeus/apf9328/MAINTAINERS
+new file mode 100644
+index 0000000..1393831
+--- /dev/null
++++ b/board/armadeus/apf9328/MAINTAINERS
+@@ -0,0 +1,6 @@
++APF9328 BOARD
++M: Eric Jarrige <eri...@ar...>
++S: Maintained
++F: board/armadeus/apf9328/
++F: include/configs/apf9328.h
++F: configs/apf9328_defconfig
+diff --git a/board/armadeus/apf9328/Makefile b/board/armadeus/apf9328/Makefile
+new file mode 100644
+index 0000000..b81c83e
+--- /dev/null
++++ b/board/armadeus/apf9328/Makefile
+@@ -0,0 +1,10 @@
++#
++# (C) Copyright 2000-2004
++# Wolfgang Denk, DENX Software Engineering, wd...@de....
++#
++# SPDX-License-Identifier: GPL-2.0+
++#
++
++obj-y := apf9328.o i2c.o eeprom.o
++obj-y += lowlevel_init.o
++obj-$(CONFIG_FPGA) += apf9328fpga.o fpga.o
+diff --git a/board/armadeus/apf9328/apf9328.c b/board/armadeus/apf9328/apf9328.c
+new file mode 100644
+index 0000000..22ac488
+--- /dev/null
++++ b/board/armadeus/apf9328/apf9328.c
+@@ -0,0 +1,61 @@
++/*
++ * Copyright (C) 2005-2015
++ * Nicolas Colombain <nic...@ar...>
++ * Eric Jarrige <eri...@ar...>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/arch/imx-regs.h>
++#include <flash.h>
++#include <netdev.h>
++#include "apf9328fpga.h"
++
++extern void imx_gpio_mode(int gpio_mode);
++
++DECLARE_GLOBAL_DATA_PTR;
++
++int board_init(void)
++{
++
++ gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
++
++#ifdef CONFIG_DRIVER_DM9000
++ imx_gpio_mode(GPIO_PORTB | GPIO_DR | GPIO_IN | 14);
++#endif
++
++#ifdef CONFIG_FPGA
++ apf9328_init_fpga();
++#endif
++
++ return 0;
++}
++
++int dram_init(void)
++{
++ /* dram_init must store complete ramsize in gd->ram_size */
++ gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1,
++ PHYS_SDRAM_1_SIZE);
++ return 0;
++}
++
++void enable_caches(void)
++{
++#ifndef CONFIG_SYS_DCACHE_OFF
++ /* Enable D-cache. I-cache is already enabled in start.S */
++ dcache_enable();
++#endif
++}
++
++void show_boot_progress(int status)
++{
++ return;
++}
++
++#ifdef CONFIG_DRIVER_DM9000
++int board_eth_init(bd_t *bis)
++{
++ return dm9000_initialize(bis);
++}
++#endif
+diff --git a/board/armadeus/apf9328/apf9328fpga.c b/board/armadeus/apf9328/apf9328fpga.c
+new file mode 100644
+index 0000000..0d486a6
+--- /dev/null
++++ b/board/armadeus/apf9328/apf9328fpga.c
+@@ -0,0 +1,65 @@
++/*
++ * Copyright (C) 2005-2015
++ * Nicolas Colombain <nic...@ar...>
++ * Eric Jarrige <eri...@ar...>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/*
++ * Spartan 3 FPGA configuration support for the APF9328 daughter board
++ */
++
++#include <common.h>
++#include <spartan3.h>
++#include <command.h>
++#include <jffs2/jffs2.h>
++#include <asm/arch/imx-regs.h>
++#include <asm/io.h>
++#include "apf9328fpga.h"
++
++#ifdef CONFIG_FPGA
++DECLARE_GLOBAL_DATA_PTR;
++/* Note that these are pointers to code that is in Flash. They will be
++ * relocated at runtime.
++ * Spartan3 code is used to download our Spartan 3 :) code is compatible.
++ * Just take care about the file size
++*/
++xilinx_spartan3_slave_serial_fns fpga_fns = {
++ fpga_pre_fn,
++ fpga_pgm_fn,
++ fpga_clk_fn,
++ fpga_init_fn,
++ fpga_done_fn,
++ fpga_wr_fn,
++ fpga_post_fn,
++ NULL,
++ fpga_abort_fn,
++};
++
++xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
++ {xilinx_spartan3,
++ slave_serial,
++ XILINX_XC3S400_SIZE,
++ (void *)&fpga_fns,
++ 0,
++ &spartan3_op }
++};
++
++/*
++ * Initialize the fpga. Return 1 on success, 0 on failure.
++ */
++int apf9328_init_fpga(void)
++{
++ int i;
++
++ fpga_init();
++
++ for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
++ fpga_add(fpga_xilinx, &fpga[i]);
++ }
++
++ return 0;
++}
++
++#endif /* CONFIG_FPGA */
+diff --git a/board/armadeus/apf9328/apf9328fpga.h b/board/armadeus/apf9328/apf9328fpga.h
+new file mode 100644
+index 0000000..2412687
+--- /dev/null
++++ b/board/armadeus/apf9328/apf9328fpga.h
+@@ -0,0 +1,10 @@
++/*
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/*
++ * Spartan 3 FPGA configuration support for the APF9328 daughter board
++ */
++
++#include "fpga.h"
++extern int apf9328_init_fpga(void);
+diff --git a/board/armadeus/apf9328/eeprom.c b/board/armadeus/apf9328/eeprom.c
+new file mode 100644
+index 0000000..6ba1720
+--- /dev/null
++++ b/board/armadeus/apf9328/eeprom.c
+@@ -0,0 +1,72 @@
++/*
++ * Copyright (C) 2008-2015 Armadeus Project
++ * Copyright (C) 2007
++ * Stefano Babic, DENX Software Engineering, sb...@de....
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <command.h>
++#include <dm9000.h>
++
++static int do_read_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc,
++ char * const argv[])
++{
++ unsigned int i;
++ u8 data[2];
++
++ for (i = 0; i < 0x40; i++) {
++ if (!(i % 0x10))
++ printf("\n%08x:", i);
++ dm9000_read_srom_word(i, data);
++ printf(" %02x%02x", data[1], data[0]);
++ }
++ printf("\n");
++ return 0;
++}
++
++static int do_write_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc,
++ char * const argv[])
++{
++ unsigned long offset, value;
++
++ if (argc < 4) {
++ cmd_usage(cmdtp);
++ return 1;
++ }
++
++ strict_strtoul(argv[2], 16, &offset);
++ strict_strtoul(argv[3], 16, &value);
++ if (offset > 0x40) {
++ printf("Wrong offset : 0x%lx\n", offset);
++ cmd_usage(cmdtp);
++ return 1;
++ }
++ dm9000_write_srom_word(offset, value);
++ return 0;
++}
++
++int do_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
++{
++ if (argc < 2) {
++ cmd_usage(cmdtp);
++ return 1;
++ }
++
++ if (strcmp(argv[1], "read") == 0) {
++ return do_read_dm9000_eeprom(cmdtp, flag, argc, argv);
++ } else if (strcmp(argv[1], "write") == 0) {
++ return do_write_dm9000_eeprom(cmdtp, flag, argc, argv);
++ } else {
++ cmd_usage(cmdtp);
++ return 1;
++ }
++}
++
++U_BOOT_CMD(dm9000ee, 4, 1, do_dm9000_eeprom,
++ "Read/Write eeprom connected to Ethernet Controller",
++ "\ndm9000ee write <word offset> <value>\n"
++ "\tdm9000ee read\n"
++ "\tword:\t\t00-02 : MAC Address\n"
++ "\t\t\t03-07 : DM9000 Configuration\n" "\t\t\t08-63 : User data");
+diff --git a/board/armadeus/apf9328/fpga.c b/board/armadeus/apf9328/fpga.c
+new file mode 100644
+index 0000000..fe161a1
+--- /dev/null
++++ b/board/armadeus/apf9328/fpga.c
+@@ -0,0 +1,116 @@
++/*
++ * Copyright (C) 2007
++ * Rich Ireland, Enterasys Networks, rir...@en....
++ * Keith Outwater, kei...@mv....
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#include <common.h>
++
++#ifdef CONFIG_FPGA
++
++#include <asm/arch/imx-regs.h>
++#include <asm/io.h>
++#include <config.h>
++
++extern void imx_gpio_mode(int gpio_mode);
++
++#define GPIO_PORT(x) ((x >> 5) & 3)
++#define GPIO_SET(x) (DR(GPIO_PORT(x)) |= (1<<(x & GPIO_PIN_MASK)))
++#define GPIO_CLEAR(x) (DR(GPIO_PORT(x)) &= ~(1<<(x & GPIO_PIN_MASK)))
++#define GPIO_WRITE(x, y) (y ? GPIO_SET(x) : GPIO_CLEAR(x))
++#define GPIO_READ(x) ((SSR(GPIO_PORT(x)) & (1<<(x & GPIO_PIN_MASK))))
++
++/*
++ * Port bit numbers for the serial slave controls
++ */
++#define FPGA_INIT CONFIG_SYS_FPGA_INIT
++#define FPGA_DONE CONFIG_SYS_FPGA_DONE
++#define FPGA_DIN CONFIG_SYS_FPGA_DATA
++#define FPGA_PROGRAM CONFIG_SYS_FPGA_PRG
++#define FPGA_CLOCK CONFIG_SYS_FPGA_CLK
++
++/* Note that these are pointers to code that is in Flash. They will be
++ * relocated at runtime.
++ * Spartan2 code is used to download our Spartan 3 :) code is compatible.
++ * Just take care about the file size
++*/
++
++/*
++ * nitialize GPIO port B before download
++ */
++int fpga_pre_fn(int cookie)
++{
++ debug("%s:%d: FPGA PRE ", __func__, __LINE__);
++
++ /* Initialize GPIO pins */
++ imx_gpio_mode(FPGA_INIT | GPIO_DR | GPIO_IN);
++ imx_gpio_mode(FPGA_DONE | GPIO_DR | GPIO_IN);
++ imx_gpio_mode(FPGA_DIN | GPIO_DR | GPIO_OUT);
++ imx_gpio_mode(FPGA_PROGRAM | GPIO_DR | GPIO_OUT);
++ imx_gpio_mode(FPGA_CLOCK | GPIO_DR | GPIO_OUT);
++ return cookie;
++}
++
++/*
++ * Set the FPGA's active-low program line to the specified level
++ */
++int fpga_pgm_fn(int assert, int ...
[truncated message content] |