Skip to content

Commit 130d3e0

Browse files
committed
axs103 v1.1: Prepare for release
Signed-off-by: Alexey Brodkin <[email protected]>
1 parent f63eef7 commit 130d3e0

File tree

3 files changed

+139
-4
lines changed

3 files changed

+139
-4
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From ee5a5a51780bcb17e5240335ddfa9c98a0e6f890 Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Thu, 30 Mar 2017 19:18:30 +0300
4+
Subject: [PATCH 1/2] axs103: Clean-up smp_kick_all_cpus()
5+
6+
* Rely on default pulse polarity value
7+
* Don't mess with "multicore" value as it doesn't affect execution
8+
9+
In essence we now do a bare minimal stuff:
10+
1) Select HS38x2_1 with CORE_SEL=1 bits
11+
2) Select "manual" core start (via CREG) with START_MODE=0
12+
3) Generate cpu_start pulse with START=1
13+
14+
Signed-off-by: Alexey Brodkin <[email protected]>
15+
---
16+
board/synopsys/axs10x/axs10x.c | 12 +++++-------
17+
1 file changed, 5 insertions(+), 7 deletions(-)
18+
19+
diff --git a/board/synopsys/axs10x/axs10x.c b/board/synopsys/axs10x/axs10x.c
20+
index a5e774b2cf7b..57c790220f71 100644
21+
--- a/board/synopsys/axs10x/axs10x.c
22+
+++ b/board/synopsys/axs10x/axs10x.c
23+
@@ -61,16 +61,14 @@ void smp_kick_all_cpus(void)
24+
{
25+
/* CPU start CREG */
26+
#define AXC003_CREG_CPU_START 0xF0001400
27+
-
28+
/* Bits positions in CPU start CREG */
29+
#define BITS_START 0
30+
-#define BITS_POLARITY 8
31+
+#define BITS_START_MODE 4
32+
#define BITS_CORE_SEL 9
33+
-#define BITS_MULTICORE 12
34+
-
35+
-#define CMD (1 << BITS_MULTICORE) | (1 << BITS_CORE_SEL) | \
36+
- (1 << BITS_POLARITY) | (1 << BITS_START)
37+
38+
- writel(CMD, (void __iomem *)AXC003_CREG_CPU_START);
39+
+ int cmd = readl((void __iomem *)AXC003_CREG_CPU_START);
40+
+ cmd |= (1 << BITS_CORE_SEL) | (1 << BITS_START);
41+
+ cmd &= ~(1 << BITS_START_MODE);
42+
+ writel(cmd, (void __iomem *)AXC003_CREG_CPU_START);
43+
}
44+
#endif
45+
--
46+
2.7.4
47+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From a5fa3b17cb10ce020f8b7fe6a26c45d75f55b481 Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Fri, 31 Mar 2017 11:14:35 +0300
4+
Subject: [PATCH 2/2] axs103: Support slave core kick-start on axs103 v1.1
5+
firmware
6+
7+
In axs103 v1.1 procedure to kick-start slave cores has changed quite a bit
8+
compared t previous implementation.
9+
10+
In particular:
11+
* We used to have a generic START bit for all cores selected by CORE_SEL
12+
mask. But now we don't touch CORE_SEL at all because we have a dedicated
13+
START bit for each core:
14+
bit 0: Core 0 (master)
15+
bit 1: Core 1 (slave)
16+
* Now there's no need to select "manual" mode of core start
17+
18+
Additional challenge for us is how to tell which axs103 firmware we're
19+
dealing with. For now we'll rely on ARC core version which was bumped
20+
from 2.1c to 3.0.
21+
22+
Signed-off-by: Alexey Brodkin <[email protected]>
23+
---
24+
board/synopsys/axs10x/axs10x.c | 23 +++++++++++++++++++++--
25+
1 file changed, 21 insertions(+), 2 deletions(-)
26+
27+
diff --git a/board/synopsys/axs10x/axs10x.c b/board/synopsys/axs10x/axs10x.c
28+
index 57c790220f71..e6b69da3da7f 100644
29+
--- a/board/synopsys/axs10x/axs10x.c
30+
+++ b/board/synopsys/axs10x/axs10x.c
31+
@@ -7,6 +7,7 @@
32+
#include <common.h>
33+
#include <dwmmc.h>
34+
#include <malloc.h>
35+
+#include <asm/arcregs.h>
36+
#include "axs10x.h"
37+
38+
DECLARE_GLOBAL_DATA_PTR;
39+
@@ -66,9 +67,27 @@ void smp_kick_all_cpus(void)
40+
#define BITS_START_MODE 4
41+
#define BITS_CORE_SEL 9
42+
43+
+/*
44+
+ * In axs103 v1.1 START bits semantics has changed quite a bit.
45+
+ * We used to have a generic START bit for all cores selected by CORE_SEL mask.
46+
+ * But now we don't touch CORE_SEL at all because we have a dedicated START bit
47+
+ * for each core:
48+
+ * bit 0: Core 0 (master)
49+
+ * bit 1: Core 1 (slave)
50+
+ */
51+
+#define BITS_START_CORE1 1
52+
+
53+
+#define ARCVER_HS38_3_0 0x53
54+
+
55+
+ int core_family = read_aux_reg(ARC_AUX_IDENTITY) & 0xff;
56+
int cmd = readl((void __iomem *)AXC003_CREG_CPU_START);
57+
- cmd |= (1 << BITS_CORE_SEL) | (1 << BITS_START);
58+
- cmd &= ~(1 << BITS_START_MODE);
59+
+
60+
+ if (core_family < ARCVER_HS38_3_0) {
61+
+ cmd |= (1 << BITS_CORE_SEL) | (1 << BITS_START);
62+
+ cmd &= ~(1 << BITS_START_MODE);
63+
+ } else {
64+
+ cmd |= (1 << BITS_START_CORE1);
65+
+ }
66+
writel(cmd, (void __iomem *)AXC003_CREG_CPU_START);
67+
}
68+
#endif
69+
--
70+
2.7.4
71+

configs/snps_axs103_defconfig

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,36 @@ BR2_TARGET_ROOTFS_INITRAMFS=y
99
BR2_SYSTEM_DHCP="eth0"
1010
BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
1111

12-
# Linux headers same as kernel, a 4.9 series
13-
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
12+
# Linux headers not the same as kernel, a 4.9 series
13+
BR2_KERNEL_HEADERS_4_9=y
1414

1515
# Kernel
1616
BR2_LINUX_KERNEL=y
1717
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
18-
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.6"
18+
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.10.9"
1919
BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
2020

2121
# Bootloader
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="2016.11"
25+
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.01"
26+
BR2_TARGET_UBOOT_PATCH="board/synopsys/axs10x/patches/u-boot"
2627
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs103"
2728
BR2_TARGET_UBOOT_NEEDS_DTC=y
29+
BR2_TARGET_UBOOT_FORMAT_ELF=y
30+
31+
# Extra toolchain options for Synopsys release
32+
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
33+
BR2_PTHREAD_DEBUG=y
34+
35+
# Applications for Synopsys release
36+
BR2_PACKAGE_FB_TEST_APP=y
37+
BR2_PACKAGE_GDB=y
38+
BR2_PACKAGE_GDB_SERVER=y
39+
BR2_PACKAGE_GDB_DEBUGGER=y
40+
BR2_PACKAGE_IPERF3=y
41+
BR2_PACKAGE_MPLAYER=y
42+
BR2_PACKAGE_OPENSSH=y
43+
BR2_PACKAGE_RSYNC=y
44+
BR2_PACKAGE_RT_TESTS=y

0 commit comments

Comments
 (0)