Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp279958pxb; Wed, 3 Feb 2021 05:34:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz/Nv8EvuSzkMn5S7umQ67dvnvQME5qfLUie1JAlCqaJeWddts6ID9dr+xcErz8Dz0YGQN X-Received: by 2002:a17:906:6d44:: with SMTP id a4mr3300363ejt.453.1612359251185; Wed, 03 Feb 2021 05:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612359251; cv=none; d=google.com; s=arc-20160816; b=H7RH/4xLPCwLvUb6RDYlHjP7wUeu5WZI0ATaZ4g+J3Yc1Asw93I31wt6+6IKSSBisW dGz7ksBQSvxG0cT2N75NeKOaBfazTtho3UTtNoCVHqnTH6xNyVRXRoebINtQMet5mH+c RPz0A5BMT5NfHZfoEBJidneSj0AK5RVmnNk4Z7LfgGD7nWL8PTzBIWmwd0TSiHkRyjy+ u0jE8xhd/Wz9Z9gEBJwFOPqH+5e5WNIO3tnqtpVIwayvtL/NTL70gdam+GqgvDhfVAgQ c1PtVp6HgTKSC2kjs0QpsrOvzxc3rZRTk9Svf/pPlSly6EZnA/WqKeNd528gzvWzJRTo bSOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=xmWG2/QcWKX7a1G8ep3pUy/+VPF9tb2QBaCgaAdjZ4k=; b=Mf8KPCZsdV4wxkBbK9+sTsCjjEl8wIe0QyQoTfH8O5ab+Y0wwTs0yTSggqwOnIN+68 8nveMZO0Wzl4O2a79/J57yO2baBr2F0PvOC5cwvYQntaN5UEYFzDv8II+VxRuXIWwUgf Ir9fmWpEivmljhKV954dJ3BjFpXKjOcXyWwO1Nv0MG6rw5ODSBh9goUpRGufjd3dFWwa evviB32x0foPyeq7rfXxruIJeJpvJUHCwx3w2FoYav4xgv8koFEkspNsCauJXGcZkcQ9 Jj5YB90Iv40qrup2FAXQNcuQkedV57bY9ygMMYhnht4ZbVRpa66LF8h77Kf3fE4z8pzS 9PMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si1297577ejh.295.2021.02.03.05.33.45; Wed, 03 Feb 2021 05:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbhBCNah (ORCPT + 99 others); Wed, 3 Feb 2021 08:30:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbhBCNa1 (ORCPT ); Wed, 3 Feb 2021 08:30:27 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB384C061573; Wed, 3 Feb 2021 05:29:30 -0800 (PST) Received: from [2a04:4540:1401:2ac::c66] by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1l7IDn-00017Z-Rx; Wed, 03 Feb 2021 14:29:27 +0100 Subject: Re: [PATCH] MIPS: ralink: manage low reset lines To: Sander Vanheule , linux-mips@vger.kernel.org Cc: Thomas Bogendoerfer , linux-kernel@vger.kernel.org References: <20210203092140.12458-1-sander@svanheule.net> From: John Crispin Message-ID: Date: Wed, 3 Feb 2021 14:29:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210203092140.12458-1-sander@svanheule.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.02.21 10:21, Sander Vanheule wrote: > Reset lines with indices smaller than 8 are currently considered invalid > by the rt2880-reset reset controller. > > The MT7621 SoC uses a number of these low reset lines. The DTS defines > reset lines "hsdma", "fe", and "mcm" with respective values 5, 6, and 2. > As a result of the above restriction, these resets cannot be asserted or > de-asserted by the reset controller. In cases where the bootloader does > not de-assert these lines, this results in e.g. the MT7621's internal > switch staying in reset. > > Change the reset controller to only ignore the system reset, so all > reset lines with index greater than 0 are considered valid. > > Signed-off-by: Sander Vanheule Acked-by: John Crispin > --- > This patch was tested on a TP-Link EAP235-Wall, with an MT7621DA SoC. > The bootloader on this device would leave reset line 2 ("mcm") asserted, > which caused the internal switch to be unresponsive on an uninterrupted > boot from flash. > > When tftpboot was used in the bootloader to load an initramfs, it did > initialise the internal switch, and cleared the mcm reset line. In this > case the switch could be used from the OS. With this patch applied, the > switch works both in an initramfs, and when (cold) booting from flash. > > arch/mips/ralink/reset.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/ralink/reset.c b/arch/mips/ralink/reset.c > index 8126f1260407..274d33078c5e 100644 > --- a/arch/mips/ralink/reset.c > +++ b/arch/mips/ralink/reset.c > @@ -27,7 +27,7 @@ static int ralink_assert_device(struct reset_controller_dev *rcdev, > { > u32 val; > > - if (id < 8) > + if (id == 0) > return -1; > > val = rt_sysc_r32(SYSC_REG_RESET_CTRL); > @@ -42,7 +42,7 @@ static int ralink_deassert_device(struct reset_controller_dev *rcdev, > { > u32 val; > > - if (id < 8) > + if (id == 0) > return -1; > > val = rt_sysc_r32(SYSC_REG_RESET_CTRL);