Skip to content

Commit d290f2e

Browse files
author
Lada Trimasova
committed
arc: axs10x - bump u-boot to 2016.03 release
Updating u-boot version to one of the latest stable versions. Add u-boot patch to fix verifying checksum problem with the latest bit-file: [U-Boot] arc/cache: really do flush_dcache_all() even if IOC exists, u-boot patch which adds virt_to_phys() stub for ARC: [U-Boot] arc: Add virt_to_phys() stub, u-boot patch which disables IOC in U-Boot: [PATCH] arc/cache: Disable IOC Signed-off-by: Lada Trimasova <[email protected]>
1 parent 1a60893 commit d290f2e

File tree

5 files changed

+149
-2
lines changed

5 files changed

+149
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From patchwork Fri Apr 8 17:00:07 2016
2+
Content-Type: text/plain; charset="utf-8"
3+
MIME-Version: 1.0
4+
Content-Transfer-Encoding: 7bit
5+
Subject: [U-Boot] arc: Add virt_to_phys() stub
6+
From: Alexey Brodkin <[email protected]>
7+
X-Patchwork-Id: 608123
8+
Message-Id: <[email protected]>
9+
10+
Cc: Marek Vasut <[email protected]>, Alexey Brodkin <[email protected]>
11+
Date: Fri, 8 Apr 2016 10:00:07 -0700
12+
13+
Commit cf7c93cdd755 "usb: ehci: Implement V2P mapping"
14+
introduced usage of virt_to_phys() in ehci-hcd.
15+
16+
Since there was no implementation of virt_to_phys() for ARC
17+
compilation of the ehci-generic driver failed.
18+
19+
This change adds virt_to_phys() stub for ARC so now
20+
USB driver for AXS101 board could be built again.
21+
22+
Signed-off-by: Alexey Brodkin <[email protected]>
23+
Cc: Marek Vasut <[email protected]>
24+
Cc: Daniel Schwierzeck <[email protected]>
25+
Cc: Hans de Goede <[email protected]>
26+
Acked-by: Marek Vasut <[email protected]>
27+
---
28+
arch/arc/include/asm/io.h | 5 +++++
29+
1 file changed, 5 insertions(+)
30+
31+
diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
32+
index 281682c..b6f7724 100644
33+
--- a/arch/arc/include/asm/io.h
34+
+++ b/arch/arc/include/asm/io.h
35+
@@ -239,4 +239,9 @@ static inline int __raw_writesl(unsigned int addr, void *data, int longlen)
36+
#define setbits_8(addr, set) setbits(8, addr, set)
37+
#define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
38+
39+
+static inline phys_addr_t virt_to_phys(void *vaddr)
40+
+{
41+
+ return (phys_addr_t)((unsigned long)vaddr);
42+
+}
43+
+
44+
#endif /* __ASM_ARC_IO_H */
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From 9a6dd15b56b5bb005290d0e4f51e76d384b6c1e6 Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Mon, 25 Apr 2016 13:21:01 +0300
4+
Subject: [PATCH] arc/cache: Disable IOC
5+
6+
As of today there's no way in U-Boot to distinguish
7+
cache operations on data being DMAed to or from memory
8+
and all those CPUs do them selves on memory.
9+
10+
If IOC block was detected we disabled all cache operations
11+
and that was completely fine for data being transferred
12+
by means of DMA simply because IOC did its work and
13+
made sure data is coherent.
14+
15+
But except DMA that changes memory in U-Boot
16+
we sometimes need to alter memory contents as well.
17+
And it applies not only to data but to instructions as well.
18+
These are 2 very good examples:
19+
1) U-Boot's self relocation
20+
2) Kick-start of slave cores in SMP systems
21+
22+
In both above cases we modify code and if instructions
23+
caches of CPUs won't be updated until that new code gets
24+
pushed out of data cache of the core which made modification
25+
to either SLC or in external memory (if there's no SLC).
26+
27+
So until there's a good and clean solution on cache management for
28+
2 separate cases (DMA and instructions) we'll disable IOC in U-Boot.
29+
30+
Signed-off-by: Alexey Brodkin <[email protected]>
31+
---
32+
arch/arc/lib/cache.c | 3 ++-
33+
1 file changed, 2 insertions(+), 1 deletion(-)
34+
35+
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
36+
index d1fb661..b52d7be 100644
37+
--- a/arch/arc/lib/cache.c
38+
+++ b/arch/arc/lib/cache.c
39+
@@ -148,7 +148,7 @@ static void read_decode_cache_bcr_arcv2(void)
40+
slc_exists = 1;
41+
slc_line_sz = (slc_cfg.fields.lsz == 0) ? 128 : 64;
42+
}
43+
-
44+
+#if 0 /* Disable IOC due to inability to distinguish ops on DMA data and not */
45+
union {
46+
struct bcr_clust_cfg {
47+
#ifdef CONFIG_CPU_BIG_ENDIAN
48+
@@ -163,6 +163,7 @@ static void read_decode_cache_bcr_arcv2(void)
49+
cbcr.word = read_aux_reg(ARC_BCR_CLUSTER);
50+
if (cbcr.fields.c)
51+
ioc_exists = 1;
52+
+#endif
53+
}
54+
#endif
55+
56+
--
57+
2.5.0
58+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From patchwork Mon Apr 18 10:28:39 2016
2+
Content-Type: text/plain; charset="utf-8"
3+
MIME-Version: 1.0
4+
Content-Transfer-Encoding: 7bit
5+
Subject: [U-Boot] arc/cache: really do flush_dcache_all() even if IOC exists
6+
From: Alexey Brodkin <[email protected]>
7+
X-Patchwork-Id: 611647
8+
Message-Id: <[email protected]>
9+
10+
Cc: Alexey Brodkin <[email protected]>
11+
Date: Mon, 18 Apr 2016 13:28:39 +0300
12+
13+
flush_dcache_all() is used in the very end of U-Boot self relocation
14+
to write back all copied and then patched code and data to their
15+
new location in the very end of available memory space.
16+
17+
Since that has nothing to do with IO (i.e. no external DMA happens
18+
here) IOC won't help here and we need to write back data cache contents
19+
manually.
20+
21+
Signed-off-by: Alexey Brodkin <[email protected]>
22+
---
23+
arch/arc/lib/cache.c | 7 ++-----
24+
1 file changed, 2 insertions(+), 5 deletions(-)
25+
26+
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
27+
index 56988dd..d1fb661 100644
28+
--- a/arch/arc/lib/cache.c
29+
+++ b/arch/arc/lib/cache.c
30+
@@ -430,13 +430,10 @@ void invalidate_dcache_all(void)
31+
32+
void flush_dcache_all(void)
33+
{
34+
-#ifdef CONFIG_ISA_ARCV2
35+
- if (!ioc_exists)
36+
-#endif
37+
- __dc_entire_op(OP_FLUSH);
38+
+ __dc_entire_op(OP_FLUSH);
39+
40+
#ifdef CONFIG_ISA_ARCV2
41+
- if (slc_exists && !ioc_exists)
42+
+ if (slc_exists)
43+
__slc_entire_op(OP_FLUSH);
44+
#endif
45+
}

configs/snps_axs101_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs101"
2121
BR2_TARGET_UBOOT=y
2222
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
2323
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
24-
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2015.07"
24+
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.03"
2525
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs101"
2626

2727
# Extra toolchain options for HS38 VDK release

configs/snps_axs103_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
2222
BR2_TARGET_UBOOT=y
2323
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
2424
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
25-
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2015.07"
25+
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.03"
2626
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs103"
2727

2828
# Extra toolchain options for HS38 VDK release

0 commit comments

Comments
 (0)