From patchwork Thu Jun 25 12:25:36 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: 1316866 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=iBsQ4oHk; 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 49szl613Xdz9sRW for ; Thu, 25 Jun 2020 22:26:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35D4881FFD; Thu, 25 Jun 2020 14:26:05 +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="iBsQ4oHk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A298781FEE; Thu, 25 Jun 2020 14:26:01 +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-bn8nam12on20629.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::629]) (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 D7DD881EBF for ; Thu, 25 Jun 2020 14:25:57 +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=QAoVZFsty0Yvc3UFJu5WO4z5hoDPu0b+z5/uD2s1MaqMdAOtBxqy9W2g1MRpPtcGBQTgPBvU/AG2e1Cz4TTTdoR9+FVBQnnPxfclspWHMUIPiPMG8dHBH22Fl3tT8C83EKG3MUZi8iyFHcpUrE//hEvREvssMw9xHtOYpUjXrfmwncgG0459MBphSrQZWEV8bHZMPlKPOza2K1BKkrGk4HYBDKsIAjDxKAwlXtla76GoJyhY9DCO9R3xtEelD0oi0mK1/s6fXTq95X0CLbirvUOcJwJwFj/baRfUJqC1UEHByW6zQcJtGC6SQjFPdhfO2tCtcOntNKiPCOMYE+RQNQ== 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=J+XVCwLgMkqm/Zbocugha1vyhei5VyFMbih6Ox/nbwE=; b=aCd4Uj8OTzV4OGRMFhLX9I16D+Xp5srJ2xBQej1+9fca9oHo33VJE9Ju+MHPqpSdC3XcA+6909CgtNiEi0oYV8z6b8THqoGbnW579mdBBtwlL/wgSIUSD08ZeuWIQLorLk/UwDKdMSL805bEeMO23t1NjWokqPwUG1bAi59c+FbhVnCaTUTvlvRee8WSElEJjW1ALMOyQfB+DnZ9j3P4SH1qdHye+UbaM62bSoMlCZhpRK6NuPVMKaMX1RGumVZUBAmZ1QpGe1SJAGX0nmm6alcMi01Dl6kZeQUGBTogWthDR4QbWu9VFYVN/g9KPbfZ7X1Wy3k7VoE9u8gsZGEUkg== 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=J+XVCwLgMkqm/Zbocugha1vyhei5VyFMbih6Ox/nbwE=; b=iBsQ4oHkknh7BeEggz0U88/X+rZ0eqkd6l67bQQqyjZ5oK4KVEjKCd7t6EdIQ+lul44AfARXZb7AqFDZY2LR1Js4xHcFtt0tsLlsfazqoPZpEiWySwT/xgdNbNs2MTivrSo5k5Sjv4OllpD5trFVIvyH4ZRgeRkmiEZCJ4WLDmI= 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 BN8PR13MB2770.namprd13.prod.outlook.com (2603:10b6:408:8b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.12; Thu, 25 Jun 2020 12:25:55 +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.3153.010; Thu, 25 Jun 2020 12:25:55 +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, bin.meng@windriver.com, jagan@amarulasolutions.com, sjg@chromium.org, twoerner@gmail.com, Eugeniy.Paltsev@synopsys.com, patrick@blueri.se, weijie.gao@mediatek.com, festevam@gmail.com, Sagar Shrikant Kadam Subject: [PATCH v2 0/5] add DM based reset driver for SiFive SoC's Date: Thu, 25 Jun 2020 05:25:36 -0700 Message-Id: <1593087941-16872-1-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: BYAPR11CA0090.namprd11.prod.outlook.com (2603:10b6:a03:f4::31) 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 BYAPR11CA0090.namprd11.prod.outlook.com (2603:10b6:a03:f4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3131.21 via Frontend Transport; Thu, 25 Jun 2020 12:25:53 +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: a17d5a50-3eac-41de-733c-08d81902e822 X-MS-TrafficTypeDiagnostic: BN8PR13MB2770: 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: 0445A82F82 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nFpZ+xxg5fgNlIvM2nOsXM5Xcf+OKXh7dpJYqK7bi6CZyQnHKGmgdZQN+7/RKFvhNb5gbB+eFDBSqRtpVZdPx32a7Wdfdi9+6At11YDUeXCcNXElm0cWP99QhxWlK0W4ChPzSK0rST0IrjUZ9kTPdW6jmVF8DQ70kLfoykzd6za6amfwt31WKlzrrGWEu6tysAOFDnUubeICpJgixj0AQywXEFckMg0ouP5cJWC/qmMF7AkLQ/wo1p1OWmOLX9hTbRaE2+Qnma9GDNBp1qp+sw7rdygPxQgYonjSe9w3dUixR3DLctblpqtkTQN2mhS1bibOuRoWnwxOO5RwSOAKpWsgcTL0pb8AX+i8zJrIB6H/kICP7kH7g0QDEEcDM8IxYDpo9qBoWO2m2gFVUqc68Q== 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)(396003)(136003)(346002)(366004)(39850400004)(376002)(7416002)(316002)(4326008)(6486002)(52116002)(7696005)(36756003)(8676002)(4001150100001)(66476007)(66556008)(4743002)(66946007)(478600001)(6916009)(966005)(86362001)(6666004)(2906002)(83380400001)(5660300002)(83080400001)(8936002)(26005)(956004)(186003)(107886003)(2616005)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EHnkGT/QZvndEJvz1v7hn/n0blgGRgYbc/oDkNPfCrkY9gUP404noFVEFGN+vxnGbZiB01G298110tLv7/IIZHSfUpVCIoqRFD3hKohaldmTwwQfSuT7Ys4l1Y8d6vW6X84m3Ka3nTX+VgU3t2PLCBNePITl0PUXd96FroQYJ6tDK2fq/NFz3CSolUJWduZ0orHUW8GN678RFGPD5X9FhDKVPZYsgBduBEDBorOPVCdNivw5eYYdN7l73B2hfijTwaJlniM5xQcT/XFyO74iEeu6QmcQlOfvDDuh5eHbrP+wTfboF8EzE0QGVHopp/WShZ8MPLtJWKwSVnaZNRRJo1M5rqpww+3nE5/0fp5vZ7xyynnrobGmQbwQUJt9rDHSdyOIxs6/5FRCOC8MDfpZB7/vrV3xPI1UPuh3WdMpqXdYy5Fln1ozdk2R4f6JvdaQGSPGISXMTc7dU19R7mrWM/rIsm6bQOQ3yKzPkYr5bSgllg2dzgjqrNoFfoM+8U7R X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: a17d5a50-3eac-41de-733c-08d81902e822 X-MS-Exchange-CrossTenant-AuthSource: BN8PR13MB2611.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2020 12:25:55.0274 (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: DRtRs89fzkanPCCQBlQVO0R64Wdx2L/IQ1Uz/eiWxlh6Y0tk8+jL8XVaLGdfeylexbpywI0VyMvw1XNjJxKTgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR13MB2770 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 922c6d5d0090 ("Merge tag 'mmc-2020-6-24' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc") History: ========================== V2: -Removed extra character in commit log of 2nd patch V1: -Base version. 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