Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp843473pxb; Wed, 13 Jan 2021 18:05:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyrK5jteLPsJa36AdM8um/vwneyUCPOQgE4n+9lnMD44bE82sHLX16xdFmVTeuFKCPOc3d X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr4021823edb.209.1610589933738; Wed, 13 Jan 2021 18:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610589933; cv=none; d=google.com; s=arc-20160816; b=zcpUZtiXHqsjGMHaWI9gwpMXUh0EtQN4dv3p8uhlUaUbilol1tMV7CicByGIs0kQnx PRsbl4UbwT5ecVMo3hSHH1j8bXmovhNrU7FZ5DnzrbA89YpV/Xwz/X6Cm1XkToFKNejj p7pHuyr+fooeKKSIw1tMgczmhhM3wgC8AM25Pft+NiZakEjXECNZ3K+j7sfWfPyAYtpW ATp5qPJdkHRrPZzBDuqvSTBfPXodhMyS2137YNW2kfqyI8WUNcYzwRRKlK8OJaZnLllk nkoiM6/7N9JoRw0G/YPjAzhiIlvkgyUD6plEE8gapdmqaDqBN4OxXB7YOmHkB7sopQ7p ZzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/59kB1O5XIVx4wkhix0uTI9M83ghuwediLtzMt/ydBU=; b=DiR1xv+lRfOeQ8BLMD6ev8Ie1aXP4295PegUXR756CKJari2rZWl20zvEvKJ2NnDBD aBDh1yo/w8Ttd22KKNsvpkp+PdfHv3c6fMoXCYu1sBK7O7EBEfyuJ+hctP30IEzne7wS lRFo2jUDECfbku2PstFun/7CoLjJIgkkC/ti6g6hdq2FZwpbwkXTUHjrU1OQbZH0B1+L TSUPmSJ0KBHyFxAVlErXOsbEJRheSO/zVROvUNggo5KZOXcYam/Zpk1AgXhTiAWyhLZ2 P4YN4dZ5KqiZwHX49C4HpnBt4DKfleJSH/MksOvK7oFZ+KhsKCf+ZqbQ9YX52QA1V0oe RUxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hMgyZ0xW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si2018739ejs.49.2021.01.13.18.05.01; Wed, 13 Jan 2021 18:05:33 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hMgyZ0xW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728550AbhANCD7 (ORCPT + 99 others); Wed, 13 Jan 2021 21:03:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728826AbhANCDz (ORCPT ); Wed, 13 Jan 2021 21:03:55 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C7BC061575 for ; Wed, 13 Jan 2021 18:03:14 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id md11so2252011pjb.0 for ; Wed, 13 Jan 2021 18:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/59kB1O5XIVx4wkhix0uTI9M83ghuwediLtzMt/ydBU=; b=hMgyZ0xWZXRDy8tBW0qOIwh+Xe7D8eY37gm1btzh5tZbvbHil34ZvT9v/bxYeUBFQY GDmvsv/lcJ98YUN88Plde66JeOnXZyw8/rFSlei6Jdq/k8K2ft40iwR5cVBPn8qIijks WcglGx7KYHon9U9Xx1kjTDAaCWaOPYzXbZzn8qAQakbcw3AlmbBBMYhA7nrPpPx1Uq7p QF8zG0ZalqAwZ+ksqQM/xkStlgAJ7ZOyFN8/IjTw8wk4vgkmzl3lh35+wyhuoar+Hn9p WDnuv4FtVJs7wzXVk1Y+vxAULFRRWZWUat8zc4dLez2OKQKFTLhbgCcTAQoXWc1VlifE uR4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/59kB1O5XIVx4wkhix0uTI9M83ghuwediLtzMt/ydBU=; b=q8juAv8XGM+SESXRIrY9kNTc7yNoTStchpLsC4syu8l/bOWZOWlDOsJEJtvi2lVj8u +AUnKcj3ROiK3GjumTZn9NJmElA1bODgpgN87g+HUC55053iJS7COFS4tZIOR4eWjGna /EpYjyyqwGdjfuxh86yFnEI4miPK90lAQrb2dS1J6hdS6qOee3OQFz8wdJMLJZ0om9/J gkaNrn+0tflh/7RII1gPEnPKRtfF0sAQqRKn2pcwm0M/pfc8UxanCkO+bfr910Shd7Bp 8uQR+tnp7dp3CTo58wPHgusMZnHBMBCfOy/iUXA0Hd44J6DgSQVuWIAGFfwE9BzcjD/+ sP3g== X-Gm-Message-State: AOAM532Fh8ZSeLZ6qNrsW3zaj5LXAijQt5HmB8uVQKJJS2O24mvetCHU BGUlGGSBKhdOlT849RktfCI= X-Received: by 2002:a17:90b:4d09:: with SMTP id mw9mr2403589pjb.199.1610589794397; Wed, 13 Jan 2021 18:03:14 -0800 (PST) Received: from localhost (g238.115-65-210.ppp.wakwak.ne.jp. [115.65.210.238]) by smtp.gmail.com with ESMTPSA id u1sm3878281pjr.51.2021.01.13.18.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 18:03:13 -0800 (PST) Date: Thu, 14 Jan 2021 11:03:11 +0900 From: Stafford Horne To: Geert Uytterhoeven Cc: Karol Gugala , Mateusz Holenko , Gabriel Somlo , Linux Kernel Mailing List , linux-riscv Subject: Re: [PATCH v2] drivers/soc/litex: Add restart handler Message-ID: <20210114020311.GE2002709@lianli.shorne-pla.net> References: <20210104164500.1311091-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 05:49:03PM +0100, Geert Uytterhoeven wrote: > On Mon, Jan 4, 2021 at 5:45 PM Geert Uytterhoeven wrote: > > Let the LiteX SoC Controller a register a restart handler, which resets > > the LiteX SoC by writing 1 to CSR_CTRL_RESET_ADDR. > > > > Signed-off-by: Geert Uytterhoeven > > --- > > Tested with linux-on-litex-vexriscv. > > > > This patch is based on upstream, i.e. not on top of Gabriel Somlo's > > "[PATCH v5 0/4] drivers/soc/litex: support 32-bit subregisters, 64-bit > > CPUs" > > (https://lore.kernel.org/lkml/20201227161320.2194830-1-gsomlo@gmail.com/) > > Bummer, and that's why the RESET_REG_* definitions are no longer > next to the SCRATCH_REG_* definitions :-( If it helps I have accepted Gabriel's patches and put them onto for-next. https://github.com/openrisc/linux/commits/for-next I am happy to take and test a patch based on that. Or I can do the adjustments to base the patch on that myself. Let me know. -Stafford > Well, I assume that will be fixed by evolution ;-) > > > v2: > > - Rebase on top of v5.11-rc1, > > - Change reset handler priority to recommended default value of 128 > > (was 192). > > > > (v1 was not sent to a mailing list) > > --- > > drivers/soc/litex/litex_soc_ctrl.c | 33 +++++++++++++++++++++++++++--- > > 1 file changed, 30 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/soc/litex/litex_soc_ctrl.c b/drivers/soc/litex/litex_soc_ctrl.c > > index 1217cafdfd4d1d2b..d729ad50d4ffca5e 100644 > > --- a/drivers/soc/litex/litex_soc_ctrl.c > > +++ b/drivers/soc/litex/litex_soc_ctrl.c > > @@ -15,6 +15,11 @@ > > #include > > #include > > #include > > +#include > > + > > +/* reset register located at the base address */ > > +#define RESET_REG_OFF 0x00 > > +#define RESET_REG_VALUE 0x00000001 > > > > /* > > * LiteX SoC Generator, depending on the configuration, can split a single > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds