kernel: bump 5.4 to 5.4.99
[openwrt/openwrt.git] / target / linux / ramips / patches-5.4 / 0123-mips-ralink-manage-low-reset-lines.patch
1 From 3f9ef7785a9cd69cb75f5e2ea4ca79a24752e496 Mon Sep 17 00:00:00 2001
2 From: Sander Vanheule <sander@svanheule.net>
3 Date: Wed, 3 Feb 2021 10:21:41 +0100
4 Subject: MIPS: ralink: manage low reset lines
5
6 Reset lines with indices smaller than 8 are currently considered invalid
7 by the rt2880-reset reset controller.
8
9 The MT7621 SoC uses a number of these low reset lines. The DTS defines
10 reset lines "hsdma", "fe", and "mcm" with respective values 5, 6, and 2.
11 As a result of the above restriction, these resets cannot be asserted or
12 de-asserted by the reset controller. In cases where the bootloader does
13 not de-assert these lines, this results in e.g. the MT7621's internal
14 switch staying in reset.
15
16 Change the reset controller to only ignore the system reset, so all
17 reset lines with index greater than 0 are considered valid.
18
19 Signed-off-by: Sander Vanheule <sander@svanheule.net>
20 Acked-by: John Crispin <john@phrozen.org>
21 Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
22 ---
23 arch/mips/ralink/reset.c | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26 --- a/arch/mips/ralink/reset.c
27 +++ b/arch/mips/ralink/reset.c
28 @@ -27,7 +27,7 @@ static int ralink_assert_device(struct r
29 {
30 u32 val;
31
32 - if (id < 8)
33 + if (id == 0)
34 return -1;
35
36 val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
37 @@ -42,7 +42,7 @@ static int ralink_deassert_device(struct
38 {
39 u32 val;
40
41 - if (id < 8)
42 + if (id == 0)
43 return -1;
44
45 val = rt_sysc_r32(SYSC_REG_RESET_CTRL);