summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0009-AST2600-Disable-DMA-arbitration-options-on-MAC1-and-.patch
blob: f47092eaaeeed5f987c9d372c844ac0cb3554cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From f1bfa10fefa992c7032e0c32647543bb2a8dc90f Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Tue, 31 Mar 2020 13:28:31 -0700
Subject: [PATCH] AST2600: Disable DMA arbitration options on MAC1 and MAC2

Aspeed added 2 new options to DMA arbitration in AST2600A1 MAC1
and MAC2 but it has a bug in A1 so it might cause the MAC hang if
we enable these 2 new options.
Option 1: Round Robin, register MAC58[27]
Option 2: Tx Valid, register MAC58[28]

So this commit disables options above.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
 arch/arm/mach-aspeed/ast2600/platform.S | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/mach-aspeed/ast2600/platform.S b/arch/arm/mach-aspeed/ast2600/platform.S
index 997670b66bdc..6b447845fe26 100644
--- a/arch/arm/mach-aspeed/ast2600/platform.S
+++ b/arch/arm/mach-aspeed/ast2600/platform.S
@@ -57,6 +57,12 @@
 #define AST_FMC_WDT1_CTRL_MODE	(AST_FMC_BASE + 0x060)
 #define AST_FMC_WDT2_CTRL_MODE	(AST_FMC_BASE + 0x064)
 
+#define AST_MAC1_BASE		(0x1E660000)
+#define AST_MAC1_CTRL2		(AST_MAC1_BASE + 0x058)
+
+#define AST_MAC2_BASE		(0x1E680000)
+#define AST_MAC2_CTRL2		(AST_MAC2_BASE + 0x058)
+
 #define AST_GPIO_BASE		(0x1E780000)
 #define AST_GPIOYZ_DATA_VALUE	(AST_GPIO_BASE + 0x1E0)
 
@@ -229,6 +235,18 @@ wait_lock:
 	b 1f
 
 0:
+	/* disable DMA arbitration on MAC1 (A1 bug) */
+	ldr	r0, =AST_MAC1_CTRL2
+	ldr	r1, [r0]
+	orr	r1, #0x18000000
+	str	r1, [r0]
+
+	/* disable DMA arbitration on MAC2 (A1 bug) */
+	ldr	r0, =AST_MAC2_CTRL2
+	ldr	r1, [r0]
+	orr	r1, #0x18000000
+	str	r1, [r0]
+
 	/* LPC/eSPI mode selection (A1 only) */
 	ldr	r0, =AST_GPIOYZ_DATA_VALUE
 	ldr	r0, [r0]
-- 
2.17.1