From patchwork Mon Jun 22 12:27:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 1314337 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=selector1 header.b=abbJCAPd; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r7x42yPKz9sRW for ; Mon, 22 Jun 2020 22:28:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A38A8179A; Mon, 22 Jun 2020 14:28:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="abbJCAPd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 17D2881CA6; Mon, 22 Jun 2020 14:28:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::61b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 531D9814A4 for ; Mon, 22 Jun 2020 14:28:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sagar.kadam@sifive.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d8ukr6xW0p8YdGSWuW7ED5E4SzXThKPO+12h+WAsjLBW+GQ5Ai59CnJmOhgGgePSYJyNCBOZGN8guW0kHLTWMJdhbRFZtcaCHSteUkSlPujQz0idtGWmdElfDW9elvxED/0Rpw97gjt4jwnbPa4+VF+y+1GpAC7yNUQMKXQ5ztgzxvj8kb/vfbiaoCmHIuroMSycQoy1f4xBACKhWuIiUe2cSqy7tKG0G6v7cVI5ROzS6QT5z62+pTjx7T6AHP7y7BKJtekIdoPibfGg937mQXsHvcOGPnaTjCXZjDW67a4F5M77wAvF2lEErAxy+F6Jqgn9OwGLm90xvyvstSWcUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xMJvwvkL9cUpz4uerScCo3lKZOgjpA5njQD+4dyUzts=; b=Jz900MRBuA+1tzJpDNG+37ZkQ+TyppfrMklCa7bjeMCk03P/WqeFmMzaOT5dTlQHE2wh3Nl2s+oBYbXb9ZjxVPyaKNcq9eaV+J74NSR4Y/fta2ig5SFzdpkuQcj2brtHwWjddUo+e42lJEjxHoFQuCFPpJyUttO1YTK3+AtzKFW7X2aw4/jKcukZaOvPO8+jyx2VjhKoQv0V/AM7PmzT3pn53n08/6XZUhYgTbRDBzdaFD8n6LcLGYIvCtojhgsLZaWgGUTvEn2XKVR7pSZosINeXCkXfVdhi1U+Z2i2i0BEamDcT7Bu0GLNKPNCosQhCn8dwgeg0xKXsZ8gAy6XSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sifive.com; dmarc=pass action=none header.from=sifive.com; dkim=pass header.d=sifive.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xMJvwvkL9cUpz4uerScCo3lKZOgjpA5njQD+4dyUzts=; b=abbJCAPdZ9JS6qIRCpoXLg5fvBQVTwDxSYAyLbwrZsZuK5MAPlKldrwFimppRIbhwp1kp4zZbmOgcW3j27WBToWTsQ28B1mJXM0hSNVTYhp57tcqqXfj0mnlhBUyX90s8a+omnkMOF6MNQbGrJwAN+Rx8Q3jY06VLzYXkc5UGX4= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=sifive.com; Received: from BN8PR13MB2611.namprd13.prod.outlook.com (2603:10b6:408:81::17) by BN6PR13MB3107.namprd13.prod.outlook.com (2603:10b6:405:7d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10; Mon, 22 Jun 2020 12:28:08 +0000 Received: from BN8PR13MB2611.namprd13.prod.outlook.com ([fe80::c1d9:f4ee:80ab:de83]) by BN8PR13MB2611.namprd13.prod.outlook.com ([fe80::c1d9:f4ee:80ab:de83%6]) with mapi id 15.20.3131.018; Mon, 22 Jun 2020 12:28:08 +0000 From: Sagar Shrikant Kadam To: u-boot@lists.denx.de Cc: rick@andestech.com, paul.walmsley@sifive.com, palmer@dabbelt.com, anup.patel@wdc.com, atish.patra@wdc.com, lukma@denx.de, pragnesh.patel@sifive.com, jagan@amarulasolutions.com, bmeng.cn@gmail.com, sjg@chromium.org, twoerner@gmail.com, patrick@blueri.se, festevam@gmail.com, weijie.gao@mediatek.com, Eugeniy.Paltsev@synopsys.com, Sagar Shrikant Kadam Subject: [PATCH 0/5] add DM based reset driver for SiFive SoC's Date: Mon, 22 Jun 2020 05:27:51 -0700 Message-Id: <1592828876-7724-1-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: BYAPR21CA0011.namprd21.prod.outlook.com (2603:10b6:a03:114::21) To BN8PR13MB2611.namprd13.prod.outlook.com (2603:10b6:408:81::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from gamma07.internal.sifive.com (64.62.193.194) by BYAPR21CA0011.namprd21.prod.outlook.com (2603:10b6:a03:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.2 via Frontend Transport; Mon, 22 Jun 2020 12:28:06 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [64.62.193.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b8d14de-a588-45b5-05cc-08d816a7b821 X-MS-TrafficTypeDiagnostic: BN6PR13MB3107: X-LD-Processed: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:747; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wf/eo0UrQFWpY49zaMGemrAA3ZU4TSknDPLQCf0U1wAAJ9CxkHfphJdnTjHAa1umQvoSrWLFvOulqXmputnLfmoKJMfSSBR4VtHTpOmxcF+guBbBuStdZcmZTXpgiceKrs22lxlFB8OA81vQrMMgN4NCqYSmeSNCde6+/mW9NMw1qfBi0rab5Y7PmcxxuyUFGA0le2khhf4k3LjSEzXOb4ssLhMy6Ju3EFkWmUTZQDv/NPbifINCsEDVwweOjtZT5lYIDMOiLArP6wbed+BUBIftFTdJz/drMgpXttvlzmfET6f3vs2XlD4Ay5tm27i1gWcwydWArU5RaKo8mRHFnRrZi/iXsiF0gR+J0XogybZ2atsIt0kNzv5B2TJUWEJJqlqcJhtDoGRrcdVcwDvZVg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR13MB2611.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(6029001)(39840400004)(396003)(366004)(136003)(346002)(376002)(966005)(2906002)(16526019)(186003)(4326008)(4743002)(107886003)(26005)(7696005)(316002)(7416002)(478600001)(52116002)(36756003)(8936002)(6486002)(86362001)(6916009)(5660300002)(8676002)(956004)(2616005)(83080400001)(66946007)(66556008)(66476007)(6666004)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kTz5PEKa39Is8UxrVSmw3trzLUrhj6Av3H9eZA3MSkLrbCXzOLq43WOBlLwpv0S97kkndqgbJD3Bvf1HRR0t873uLH29LZCrhisEYaglHt8n8crPNSJJ8vDm39ENpit9usvEfh1jtwR+P87A++yXRkaAPwdKkkzcM6rTh3AVJtew7aXcFXga/jvpRLWEmAWv46lgxNg4HnUQYkcIPmiMj7bO3gQNOl6uQqJ9dEFUeTM5par82+yJJmXPJADe2srBj6iuD6uQDrQXU517pWQ+/cbHiXSL7BVTx11D6OYSUJ5E7mUX+377L//bLNWP0HIGS2rIMfXA+dNiPKW7OVU/2FvQ8SNS+wKqSezMRqK1xJbrw/s7fj7EP6cExgdGMXMJA1XoWlq1BU/iZG14ML3/i0fGXE110q/9sMElhOsagdwxBjJZ9AOFPGqhavz1XNUeGjv97SGG5JPr97Lo8V+tNCIBPguXC1AlWeKr7dUIGBU= X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b8d14de-a588-45b5-05cc-08d816a7b821 X-MS-Exchange-CrossTenant-AuthSource: BN8PR13MB2611.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 12:28:08.0724 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7Mj6FAOSr9f03Uf3dAwBXdKtkAb0C7f7XxZIW4D9/gaWQU4+x6xFtmGn5A3jF65PApTZ5MPX/9CY4UAUiQWMJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR13MB3107 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The FU540-C000 support in U-Boot is missing DM based reset driver, and is handling reset's to sub-system within the prci driver itself. The series here adds a generic DM reset driver for SiFive SoC's so as to leverage the U-Boot's reset framework and binds the reset driver with prci driver. The PRCI driver takes care of triggering the consumers reset signals appropriately. Patch 1: Add necessary dt indexes for device reset register. Patch 2: Update macro's to use common dt indexes from binding header. Patch 3: Add reset producer and consumer entries within the device tree. Patch 4: Add reset dm driver and bind it within prci module. Patch 5: Add Kconfig, Makefile entries and enable the driver This series is based on mainline U-Boot commit 2b8692bac1e8 ("Merge tag 'efi-2020-07-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi") Sagar Shrikant Kadam (5): dt-bindings: prci: add indexes for reset signals available in prci fu540: prci: use common reset indexes defined in binding header fu540: dtsi: add reset producer and consumer entries sifive: reset: add DM based reset driver for SiFive SoC's configs: reset: fu540: enable dm reset framework for SiFive SoC arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 +++ arch/riscv/include/asm/arch-fu540/reset.h | 13 +++ configs/sifive_fu540_defconfig | 2 + drivers/clk/sifive/fu540-prci.c | 89 +++++++++++++------ drivers/reset/Kconfig | 9 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-sifive.c | 118 ++++++++++++++++++++++++++ include/dt-bindings/clock/sifive-fu540-prci.h | 8 ++ 8 files changed, 225 insertions(+), 25 deletions(-) create mode 100644 arch/riscv/include/asm/arch-fu540/reset.h create mode 100644 drivers/reset/reset-sifive.c