mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 19:00:34 +02:00
u-boot: update to 2018.03
todo: check wandboard version. there are internal changes to merge the different wandboard images to one and u-boot.imx is not build anymore. Which file is needed to boot on wandboard? Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -1,128 +0,0 @@
|
||||
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
|
||||
index 04a51db..bccc3e3 100644
|
||||
--- a/fs/fat/fat.c
|
||||
+++ b/fs/fat/fat.c
|
||||
@@ -823,8 +823,11 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
int ret = -1;
|
||||
int firsttime;
|
||||
__u32 root_cluster = 0;
|
||||
+ __u32 read_blk;
|
||||
int rootdir_size = 0;
|
||||
- int j;
|
||||
+ int buffer_blk_cnt;
|
||||
+ int do_read;
|
||||
+ __u8 *dir_ptr;
|
||||
|
||||
if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) {
|
||||
debug("Error: reading boot sector\n");
|
||||
@@ -909,24 +912,54 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
isdir = 1;
|
||||
}
|
||||
|
||||
- j = 0;
|
||||
+ buffer_blk_cnt = 0;
|
||||
+ firsttime = 1;
|
||||
while (1) {
|
||||
int i;
|
||||
|
||||
- if (j == 0) {
|
||||
- debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%zd\n",
|
||||
- cursect, mydata->clust_size, DIRENTSPERBLOCK);
|
||||
+ if (mydata->fatsize == 32 || firsttime) {
|
||||
+ dir_ptr = do_fat_read_at_block;
|
||||
+ firsttime = 0;
|
||||
+ } else {
|
||||
+ /**
|
||||
+ * FAT16 sector buffer modification:
|
||||
+ * Each loop, the second buffered block is moved to
|
||||
+ * the buffer begin, and two next sectors are read
|
||||
+ * next to the previously moved one. So the sector
|
||||
+ * buffer keeps always 3 sectors for fat16.
|
||||
+ * And the current sector is the buffer second sector
|
||||
+ * beside the "firsttime" read, when it is the first one.
|
||||
+ *
|
||||
+ * PREFETCH_BLOCKS is 2 for FAT16 == loop[0:1]
|
||||
+ * n = computed root dir sector
|
||||
+ * loop | cursect-1 | cursect | cursect+1 |
|
||||
+ * 0 | sector n+0 | sector n+1 | none |
|
||||
+ * 1 | none | sector n+0 | sector n+1 |
|
||||
+ * 0 | sector n+1 | sector n+2 | sector n+3 |
|
||||
+ * 1 | sector n+3 | ...
|
||||
+ */
|
||||
+ dir_ptr = (do_fat_read_at_block + mydata->sect_size);
|
||||
+ memcpy(do_fat_read_at_block, dir_ptr, mydata->sect_size);
|
||||
+ }
|
||||
+
|
||||
+ do_read = 1;
|
||||
+
|
||||
+ if (mydata->fatsize == 32 && buffer_blk_cnt)
|
||||
+ do_read = 0;
|
||||
+
|
||||
+ if (do_read) {
|
||||
+ read_blk = (mydata->fatsize == 32) ?
|
||||
+ mydata->clust_size : PREFETCH_BLOCKS;
|
||||
+
|
||||
+ debug("FAT read(sect=%d, cnt:%d), clust_size=%d, DIRENTSPERBLOCK=%zd\n",
|
||||
+ cursect, read_blk, mydata->clust_size, DIRENTSPERBLOCK);
|
||||
|
||||
- if (disk_read(cursect,
|
||||
- (mydata->fatsize == 32) ?
|
||||
- (mydata->clust_size) :
|
||||
- PREFETCH_BLOCKS,
|
||||
- do_fat_read_at_block) < 0) {
|
||||
+ if (disk_read(cursect, read_blk, dir_ptr) < 0) {
|
||||
debug("Error: reading rootdir block\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- dentptr = (dir_entry *) do_fat_read_at_block;
|
||||
+ dentptr = (dir_entry *)dir_ptr;
|
||||
}
|
||||
|
||||
for (i = 0; i < DIRENTSPERBLOCK; i++) {
|
||||
@@ -951,7 +984,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
|
||||
get_vfatname(mydata,
|
||||
root_cluster,
|
||||
- do_fat_read_at_block,
|
||||
+ dir_ptr,
|
||||
dentptr, l_name);
|
||||
|
||||
if (dols == LS_ROOT) {
|
||||
@@ -1062,7 +1095,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
|
||||
goto rootdir_done; /* We got a match */
|
||||
}
|
||||
- debug("END LOOP: j=%d clust_size=%d\n", j,
|
||||
+ debug("END LOOP: buffer_blk_cnt=%d clust_size=%d\n", buffer_blk_cnt,
|
||||
mydata->clust_size);
|
||||
|
||||
/*
|
||||
@@ -1070,10 +1103,10 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
* root directory clusters when a cluster has been
|
||||
* completely processed.
|
||||
*/
|
||||
- ++j;
|
||||
+ ++buffer_blk_cnt;
|
||||
int rootdir_end = 0;
|
||||
if (mydata->fatsize == 32) {
|
||||
- if (j == mydata->clust_size) {
|
||||
+ if (buffer_blk_cnt == mydata->clust_size) {
|
||||
int nxtsect = 0;
|
||||
int nxt_clust = 0;
|
||||
|
||||
@@ -1086,11 +1119,11 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
root_cluster = nxt_clust;
|
||||
|
||||
cursect = nxtsect;
|
||||
- j = 0;
|
||||
+ buffer_blk_cnt = 0;
|
||||
}
|
||||
} else {
|
||||
- if (j == PREFETCH_BLOCKS)
|
||||
- j = 0;
|
||||
+ if (buffer_blk_cnt == PREFETCH_BLOCKS)
|
||||
+ buffer_blk_cnt = 0;
|
||||
|
||||
rootdir_end = (++cursect - mydata->rootdir_sect >=
|
||||
rootdir_size);
|
||||
@@ -1,20 +0,0 @@
|
||||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
|
||||
index 9896e54..99c6dcc 100644
|
||||
--- a/include/linux/compiler-gcc.h
|
||||
+++ b/include/linux/compiler-gcc.h
|
||||
@@ -44,9 +44,10 @@
|
||||
*/
|
||||
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
|
||||
!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
|
||||
-# define inline inline __attribute__((always_inline))
|
||||
-# define __inline__ __inline__ __attribute__((always_inline))
|
||||
-# define __inline __inline __attribute__((always_inline))
|
||||
+/* XXX: check __GNUC_STDC_INLINE__, fix line length */
|
||||
+# define inline inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
|
||||
+# define __inline__ __inline__ __attribute__((always_inline)) __attribute__((__gnu_inline__))
|
||||
+# define __inline __inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
|
||||
#endif
|
||||
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
--
|
||||
1.8.3.2
|
||||
@@ -1,71 +0,0 @@
|
||||
diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
|
||||
new file mode 100644
|
||||
index 0000000..622117b
|
||||
--- /dev/null
|
||||
+++ b/include/linux/compiler-gcc6.h
|
||||
@@ -0,0 +1,65 @@
|
||||
+#ifndef __LINUX_COMPILER_H
|
||||
+#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
|
||||
+#endif
|
||||
+
|
||||
+#define __used __attribute__((__used__))
|
||||
+#define __must_check __attribute__((warn_unused_result))
|
||||
+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
|
||||
+
|
||||
+/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
+ to them will be unlikely. This means a lot of manual unlikely()s
|
||||
+ are unnecessary now for any paths leading to the usual suspects
|
||||
+ like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||
+ older compilers]
|
||||
+
|
||||
+ Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||
+ in the preprocessor, but we can live with this because they're unreleased.
|
||||
+ Maketime probing would be overkill here.
|
||||
+
|
||||
+ gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||
+ a special section, but I don't see any sense in this right now in
|
||||
+ the kernel context */
|
||||
+#define __cold __attribute__((__cold__))
|
||||
+
|
||||
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
+
|
||||
+#ifndef __CHECKER__
|
||||
+# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
+# define __compiletime_error(message) __attribute__((error(message)))
|
||||
+#endif /* __CHECKER__ */
|
||||
+
|
||||
+/*
|
||||
+ * Mark a position in code as unreachable. This can be used to
|
||||
+ * suppress control flow warnings after asm blocks that transfer
|
||||
+ * control elsewhere.
|
||||
+ *
|
||||
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
|
||||
+ * this in the preprocessor, but we can live with this because they're
|
||||
+ * unreleased. Really, we need to have autoconf for the kernel.
|
||||
+ */
|
||||
+#define unreachable() __builtin_unreachable()
|
||||
+
|
||||
+/* Mark a function definition as prohibited from being cloned. */
|
||||
+#define __noclone __attribute__((__noclone__))
|
||||
+
|
||||
+/*
|
||||
+ * Tell the optimizer that something else uses this function or variable.
|
||||
+ */
|
||||
+#define __visible __attribute__((externally_visible))
|
||||
+
|
||||
+/*
|
||||
+ * GCC 'asm goto' miscompiles certain code sequences:
|
||||
+ *
|
||||
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
+ *
|
||||
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
+ *
|
||||
+ * (asm goto is automatically volatile - the naming reflects this.)
|
||||
+ */
|
||||
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
+
|
||||
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
+#define __HAVE_BUILTIN_BSWAP32__
|
||||
+#define __HAVE_BUILTIN_BSWAP64__
|
||||
+#define __HAVE_BUILTIN_BSWAP16__
|
||||
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,20 +0,0 @@
|
||||
diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
|
||||
index e7ff952..f58c963 100644
|
||||
--- a/board/sunxi/gmac.c
|
||||
+++ b/board/sunxi/gmac.c
|
||||
@@ -24,6 +24,15 @@ int sunxi_gmac_initialize(bd_t *bis)
|
||||
CCM_GMAC_CTRL_GPIT_MII);
|
||||
#endif
|
||||
|
||||
+ /*
|
||||
+ * HdG: this is necessary to get GMAC to work reliable on the
|
||||
+ * Bananapi. We don't know what these undocumented bits do, so this
|
||||
+ * is a Bananapi specific hack for now.
|
||||
+ */
|
||||
+#ifdef CONFIG_BANANAPI
|
||||
+ setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
|
||||
+#endif
|
||||
+
|
||||
/* Configure pin mux settings for GMAC */
|
||||
for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
|
||||
#ifdef CONFIG_RGMII
|
||||
12
src/patches/u-boot/sunxi/orangepi-zero-add-macs.diff
Normal file
12
src/patches/u-boot/sunxi/orangepi-zero-add-macs.diff
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -Naur org/sun8i-h2-plus-orangepi-zero.dts new/sun8i-h2-plus-orangepi-zero.dts
|
||||
--- org/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts 2018-01-09 01:25:29.000000000 +0000
|
||||
+++ new/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts 2018-03-09 16:32:32.233836000 +0000
|
||||
@@ -59,6 +59,8 @@
|
||||
serial0 = &uart0;
|
||||
/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
|
||||
ethernet1 = &xr819;
|
||||
+ ethernet2 = &xr819;
|
||||
+ //ethernet3 = &xr819;
|
||||
};
|
||||
|
||||
chosen {
|
||||
Reference in New Issue
Block a user