Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13960219pxu; Mon, 4 Jan 2021 09:02:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7Pm2hqkeEF2VHX54YTMk5znBEpJ/YG090AVaQQ5fNodLa01sgRHCPOK2Gd0PiJZTGfg/W X-Received: by 2002:a17:907:3312:: with SMTP id ym18mr68075058ejb.437.1609779770586; Mon, 04 Jan 2021 09:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609779770; cv=none; d=google.com; s=arc-20160816; b=syjgZAgLH8WGQ6zsBeNcotg2D4jF6BtEV6plxo1X0RI6ZCcxuDUDj8XCmJgNqhwDNU m9ABj3eqVXvHF/1bqGRiL8d1IRhIhyDqNZsOXDfV5hhGOrjO/IVKWekJSDuH4I5W0Ebj HWU1Q/ophy5lEOC+JVTdT5xzfgV1CeXAls4lTcTxWGcvGoTfGDD/NP5bl98eZY7FidWQ V5lGjvcSVI+sRF8Jl9e8gvIa5qxELM8BgG6XzcAvmaYS0SARNWJXsUDYi6hil6YcrdD3 0w6/IL2r5voX3xiKpK0EAX7F2xsbJS7F0dZ4GR2vDTxG5e+eJerEqSXO9ZcUcKCTDaHC 1h5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=7fkrQP4tLbvvA8Dq58BtGeBgLkf6qqiDBKQsJadGDrI=; b=XzAUgdm/8EiWbeY7Gc1XXcLVsidhNGmFs+2s/j5XHqImUAFSmIVuIBkYIGPbwmH3c4 bzAOg3938k043vS/riO4ZI45+yjMZoIbUA1Lv4ld9er6lu0A3z6oAizS1UOmdP2fgy4Z RU7MGPnsOLuSKTX83XVPMoXdqn7OxiSqC+xaIWlOmirUSFmcG3r3/nlGJaBwAoalyy3D WLOqvC5ZTSYVnvUtuCFqyvz7HchMlnNedXb84A0RWjXYEWv1iF5sBKPl9UvocXU0X68Z gA1ctQIMllvBoCQ/Cwx03Jssp8z7v+dyN6QjyRJwrWqYZNzLd79n27Lra0xFOGeChdy2 6ZzA== 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 h3si30173645ejk.164.2021.01.04.09.02.27; Mon, 04 Jan 2021 09:02:50 -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 S1727922AbhADQt4 (ORCPT + 99 others); Mon, 4 Jan 2021 11:49:56 -0500 Received: from mail-ot1-f52.google.com ([209.85.210.52]:45597 "EHLO mail-ot1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727715AbhADQtz (ORCPT ); Mon, 4 Jan 2021 11:49:55 -0500 Received: by mail-ot1-f52.google.com with SMTP id n42so26561560ota.12 for ; Mon, 04 Jan 2021 08:49:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7fkrQP4tLbvvA8Dq58BtGeBgLkf6qqiDBKQsJadGDrI=; b=tDKS1hRzqr0adUOxOgYF6BZifsNPT5gyeXVjdO22Zx1XBfOD4gfbKNQAGKf7AkHphk EBwPrEXhgQkJkqZ7qnUZ2fun65kxZ5T1Kp5D/7tmskhogZGc2ZC9dT1ta8cAUwe5KB2I L0wJviC4/X0Q45QjXf6dut/M56mMKKlgD3BcWfgV1lPqsVdVQ7P5XeBNt07g02MWVN3z TK1FuEapqBdlRpPWoeVN9+5hJXSUwjx0YyYihZj94KflMHSabb2UPKbicUJm007hmpnK C/cqP7UxV3Lc/QKDVPUduC9b4eM99uGmeGhm3o5k8s0u8h0BwMkyvoH+dsCS/cQHOUzX aurw== X-Gm-Message-State: AOAM531YVpWy17PAVs9xJA5RU5gkI3jTs4eb0R0Un4ORzTgAexllg7OP qnk45BAeffLmQBqMeZXEoYWIM7sFXLFwaJVT9Pc= X-Received: by 2002:a05:6830:1f5a:: with SMTP id u26mr53508152oth.250.1609778954548; Mon, 04 Jan 2021 08:49:14 -0800 (PST) MIME-Version: 1.0 References: <20210104164500.1311091-1-geert@linux-m68k.org> In-Reply-To: <20210104164500.1311091-1-geert@linux-m68k.org> From: Geert Uytterhoeven Date: Mon, 4 Jan 2021 17:49:03 +0100 Message-ID: Subject: Re: [PATCH v2] drivers/soc/litex: Add restart handler To: Karol Gugala , Mateusz Holenko Cc: Gabriel Somlo , Stafford Horne , Linux Kernel Mailing List , linux-riscv Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :-( 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