Skip to content

Commit ad52687

Browse files
committed
Add some important u-boot patches
Signed-off-by: Evgeniy Didin <[email protected]>
1 parent 42a5ffc commit ad52687

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 002504c76b1023d16716cbd9f7d9906deee28009 Mon Sep 17 00:00:00 2001
2+
From: Eugeniy Paltsev <[email protected]>
3+
Date: Tue, 26 Dec 2017 21:12:53 +0300
4+
Subject: [PATCH 1/3] ARC: HSDK: hsdk-cmd: fix master CPU cache configuration
5+
6+
Signed-off-by: Eugeniy Paltsev <[email protected]>
7+
---
8+
board/synopsys/hsdk/hsdk-cmd.c | 14 +++++++-------
9+
1 file changed, 7 insertions(+), 7 deletions(-)
10+
11+
diff --git a/board/synopsys/hsdk/hsdk-cmd.c b/board/synopsys/hsdk/hsdk-cmd.c
12+
index 5d8f456a80..5140eb2dd9 100644
13+
--- a/board/synopsys/hsdk/hsdk-cmd.c
14+
+++ b/board/synopsys/hsdk/hsdk-cmd.c
15+
@@ -503,7 +503,7 @@ static void init_master_icache(void)
16+
{
17+
unsigned int r;
18+
19+
-#ifndef CONFIG_SYS_ICACHE_OFF
20+
+#ifdef CONFIG_SYS_ICACHE_OFF
21+
/* enable if required, else - nothing to do */
22+
if (env_common.icache.val) {
23+
r = ARC_AUX_IC_CTRL;
24+
@@ -531,7 +531,7 @@ static void init_master_dcache(void)
25+
{
26+
unsigned int r;
27+
28+
-#ifndef CONFIG_SYS_ICACHE_OFF
29+
+#ifdef CONFIG_SYS_ICACHE_OFF
30+
/* enable if required, else - nothing to do */
31+
if (env_common.dcache.val) {
32+
r = ARC_AUX_DC_CTRL;
33+
@@ -700,16 +700,16 @@ static void do_init_slave_cpus(void)
34+
u32 i;
35+
36+
for (i = 1; i < NR_CPUS; i++)
37+
- if (env_core.used[i])
38+
+ if (is_cpu_used(i))
39+
do_init_slave_cpu(i);
40+
}
41+
42+
static void do_init_master_cpu(void)
43+
{
44+
- if (env_core.used[MASTER_CPU]) {
45+
- init_master_icache();
46+
- init_master_dcache();
47+
- }
48+
+ /* Setup master caches even if master isn't used as we want to use
49+
+ * same cache configuration on all running CPUs */
50+
+ init_master_icache();
51+
+ init_master_dcache();
52+
}
53+
54+
enum hsdk_axi_masters {
55+
--
56+
2.11.0
57+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 697136ddf89c9c2d176ffdea55cd029e7717ac06 Mon Sep 17 00:00:00 2001
2+
From: Eugeniy Paltsev <[email protected]>
3+
Date: Tue, 26 Dec 2017 21:13:51 +0300
4+
Subject: [PATCH 2/3] ARC: HSDK: hsdk-cmd: get rid of env_core.used
5+
6+
Signed-off-by: Eugeniy Paltsev <[email protected]>
7+
---
8+
board/synopsys/hsdk/hsdk-cmd.c | 7 +------
9+
1 file changed, 1 insertion(+), 6 deletions(-)
10+
11+
diff --git a/board/synopsys/hsdk/hsdk-cmd.c b/board/synopsys/hsdk/hsdk-cmd.c
12+
index 5140eb2dd9..f2b2dfe252 100644
13+
--- a/board/synopsys/hsdk/hsdk-cmd.c
14+
+++ b/board/synopsys/hsdk/hsdk-cmd.c
15+
@@ -50,7 +50,6 @@ typedef struct {
16+
} u32_env;
17+
18+
struct hsdk_env_core_ctl {
19+
- bool used[NR_CPUS];
20+
u32_env entry[NR_CPUS];
21+
u32_env iccm[NR_CPUS];
22+
u32_env dccm[NR_CPUS];
23+
@@ -891,10 +890,6 @@ static int prepare_cpus(void)
24+
if (ret)
25+
return ret;
26+
27+
- for (i = 0; i < NR_CPUS; i++) {
28+
- env_core.used[i] = is_cpu_used(i);
29+
- }
30+
-
31+
printf("CPU start mask is %#x\n", env_common.core_mask.val);
32+
33+
do_init_slave_cpus();
34+
@@ -921,7 +916,7 @@ static int hsdk_go_run(u32 cpu_start_reg)
35+
/* Kick chosen slave CPUs */
36+
writel(cpu_start_reg, (void __iomem *)CREG_CPU_START);
37+
38+
- if (env_core.used[MASTER_CPU])
39+
+ if (is_cpu_used(MASTER_CPU))
40+
((void (*)(void))(env_core.entry[MASTER_CPU].val))();
41+
else
42+
halt_this_cpu();
43+
--
44+
2.11.0
45+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From fa0924131b9bae3595ac6a49e1f6400b346bd66b Mon Sep 17 00:00:00 2001
2+
From: Eugeniy Paltsev <[email protected]>
3+
Date: Tue, 26 Dec 2017 21:14:33 +0300
4+
Subject: [PATCH 3/3] ARC: HSDK: hsdk-cmd: use map arg in
5+
env_read_validate_core
6+
7+
Signed-off-by: Eugeniy Paltsev <[email protected]>
8+
---
9+
board/synopsys/hsdk/hsdk-cmd.c | 6 +++---
10+
1 file changed, 3 insertions(+), 3 deletions(-)
11+
12+
diff --git a/board/synopsys/hsdk/hsdk-cmd.c b/board/synopsys/hsdk/hsdk-cmd.c
13+
index f2b2dfe252..8f25033b23 100644
14+
--- a/board/synopsys/hsdk/hsdk-cmd.c
15+
+++ b/board/synopsys/hsdk/hsdk-cmd.c
16+
@@ -373,17 +373,17 @@ static int env_read_validate_core(const struct hsdk_env_map_core *map)
17+
int ret;
18+
19+
/* Cleanup env struct first */
20+
- for (i = 0; env_map_core[i].env_name; i++) {
21+
+ for (i = 0; map[i].env_name; i++) {
22+
env_clear_core(i, map);
23+
}
24+
25+
- for (i = 0; env_map_core[i].env_name; i++) {
26+
+ for (i = 0; map[i].env_name; i++) {
27+
ret = env_read_core(i, map);
28+
if (ret)
29+
return ret;
30+
}
31+
32+
- for (i = 0; env_map_core[i].env_name; i++) {
33+
+ for (i = 0; map[i].env_name; i++) {
34+
ret = env_validate_core(i, map);
35+
if (ret)
36+
return ret;
37+
--
38+
2.11.0
39+

0 commit comments

Comments
 (0)