Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2458502ybc; Sun, 24 Nov 2019 21:59:25 -0800 (PST) X-Google-Smtp-Source: APXvYqz7RHDmHHA2fKs9TC9qQ+c5JAywa9zblJLUzlG6LkMxdppRxIeXpx/QqUedSnr4AaX3iZch X-Received: by 2002:a50:d756:: with SMTP id i22mr16597475edj.24.1574661565199; Sun, 24 Nov 2019 21:59:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1574661565; cv=pass; d=google.com; s=arc-20160816; b=TZXXlRUH++pHgF+k6G7n9+FS4NjFM53xK15opHq+lc6SHHENLVNWIbDY2niX3oz/eP SA8wyDuiEfyfFl9U9l/HR6CAiAlLw4M7Xs4LlDWRTMZAKTS5/BLyOpy0jcHJhkP7gfXb TFr9DbzRiZ3GDADdjdXPvbdQ7n8XvnE3T/gu5Z3HNfTaibLp2bO/QdgC7E2Yp4mnRj1v ugs3gdQC2CQYPhzk0HYmykp74JctRhnov3gvueun/UGXsRd1RvhiT+wi4sN/yjByRFUo XpjpXt2a5xmzI3gbQGuVOGN5CYquBOV/AoFWDlWIwuvSRTn6WyO6zw6VKxckU9bby2SF oq4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=/oGUqIma0DRISkcM1XRPGcZzb/uCEiVF+OqbnloLsiE=; b=eUn9iUMXsGM8VFFpTVyEX6TP1gd3RJV8LzIFoW7o4rdeoxzd93NuIpD+GELt+M5kBd TAl/vmopD7XU64+8jZYIjcnJdtlSkwQ5wF9tI7m+PsyvDltJ7F3LTg9MVrhqdOrpRU1L ljcavosef9gFOD5EhVLdf0E49TEq+/wzIW388j2WvRvsA9+mq4cnGk4Kg6WLiCB7Bjjz EaUTOdj4tvLmDAGjtrBmfxqvf+El/alFbE7zhDZBUq5gEaIFiad4KXQuN6S68CNSLco/ FUChuSk2rbE2dW2Z+g1EidlmreA0KbluOqanbmV4Qz5pGBqJDe2xGh4fTntV2AlAT+bu X4lg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=selector1 header.b=a71NqHFZ; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si3899958ejr.94.2019.11.24.21.59.01; Sun, 24 Nov 2019 21:59:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=selector1 header.b=a71NqHFZ; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725940AbfKYF6C (ORCPT + 99 others); Mon, 25 Nov 2019 00:58:02 -0500 Received: from mail-eopbgr690051.outbound.protection.outlook.com ([40.107.69.51]:8004 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725468AbfKYF6C (ORCPT ); Mon, 25 Nov 2019 00:58:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KN+R9+mxIZYpsA7T3MQf+TRQSppMQtvcvb0r8kyurrXqdwMaDpF4+ZcRGRQwqRA/e/oPHdZuw9ZyzaI/lA8Du1QKJCxBcGvfMgjPl73jAn0SjxbzitZ63nMF60uvw1oweTCqbEMzYhAwW6SIwJ4oeLPD+7jKAeGdVVEe6Kne9x/eaiaOXWupyb2OkDMMYPSv6i1+HkFvWPqQ9Nr1WZKjCiz0U7vrdn/RRghCsmhZaNLWnCe8bOJBk3O7QMDUQLUZIz7vgRyHttW89YbjJZsInxncHxcwC9CTuBkc1NUhPjPXvzd4F3GR5qVcFw3Tu8v5X0nwt/A4Vdj+TXPT5jtpqA== 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=/oGUqIma0DRISkcM1XRPGcZzb/uCEiVF+OqbnloLsiE=; b=BOV5wvC34R3nucOUOABg10X66/AfSqqJ3AgkE37CzOiiES/SPJY9gtc8g8ngOptOPvxRFI1Ri3MJJJGrB/zAZBjHXmdLEC0PLtGWl8eUjD8i2dzGKaz/0xXbFJQI6nm72PJYUyWmsDYLbP2qMuKHCM5FiW6UDxooqOVUY4VfkDsum36zPmGCduHC5CpHIAlmN+s2CzQk6JOZhzQgzr84qwDmBJFCyUbbPAk701BnONgsRW5zQJ3o5iBcN8Gq9g9wXOoBYVEf5/0T+LxJhY7XrG8zlIUZNginEwA1C01tVOxSFvHb1MlbWJMohWhxVOxPBbZJzNs7hWBfhDIESDlk7A== 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=/oGUqIma0DRISkcM1XRPGcZzb/uCEiVF+OqbnloLsiE=; b=a71NqHFZNtbPk3dsnguT92cn4j4OySsEDo+Na4lFZ76PbJUyiwrGuLywXZUJazl2Zn+qwN9x1rzwMVpg+Ve4rwft3DUmFIJui/GCjLlMA/Y4GIDg0KtIuW/PBqpAKhsKk7bI+YStWmt6K1gVex/1O7sErVxFP4XlgOM7MPYah1A= Received: from MN2PR13MB3374.namprd13.prod.outlook.com (10.255.236.83) by MN2PR13MB2622.namprd13.prod.outlook.com (20.178.254.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.10; Mon, 25 Nov 2019 05:57:41 +0000 Received: from MN2PR13MB3374.namprd13.prod.outlook.com ([fe80::4481:4560:7083:e4c6]) by MN2PR13MB3374.namprd13.prod.outlook.com ([fe80::4481:4560:7083:e4c6%7]) with mapi id 15.20.2495.014; Mon, 25 Nov 2019 05:57:41 +0000 From: Yash Shah To: "linus.walleij@linaro.org" , "bgolaszewski@baylibre.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "palmer@dabbelt.com" , "Paul Walmsley ( Sifive)" CC: "aou@eecs.berkeley.edu" , "tglx@linutronix.de" , "jason@lakedaemon.net" , "maz@kernel.org" , "bmeng.cn@gmail.com" , "atish.patra@wdc.com" , Sagar Kadam , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Sachin Ghadi , Yash Shah Subject: [PATCH v3 0/6] GPIO & Hierarchy IRQ support for HiFive Unleashed Thread-Topic: [PATCH v3 0/6] GPIO & Hierarchy IRQ support for HiFive Unleashed Thread-Index: AQHVo1U/2ljv661YTECJb4nJUTETbQ== Date: Mon, 25 Nov 2019 05:57:41 +0000 Message-ID: <1574661437-28486-1-git-send-email-yash.shah@sifive.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0053.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::17) To MN2PR13MB3374.namprd13.prod.outlook.com (2603:10b6:208:162::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yash.shah@sifive.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [114.143.65.226] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3bb8af75-4b7f-4f7c-997a-08d7716c621a x-ms-traffictypediagnostic: MN2PR13MB2622: 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:8882; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6029001)(136003)(376002)(346002)(366004)(396003)(39840400004)(189003)(199004)(186003)(966005)(6436002)(2906002)(316002)(14454004)(7416002)(54906003)(4326008)(6306002)(71190400001)(2616005)(50226002)(8936002)(110136005)(478600001)(6512007)(6116002)(8676002)(36756003)(3846002)(25786009)(81156014)(44832011)(305945005)(5660300002)(52116002)(14444005)(256004)(26005)(81166006)(71200400001)(6506007)(386003)(2501003)(6636002)(66446008)(66556008)(86362001)(66946007)(102836004)(99286004)(6486002)(7736002)(107886003)(64756008)(66476007)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR13MB2622;H:MN2PR13MB3374.namprd13.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:3; received-spf: None (protection.outlook.com: sifive.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ibNjMQFMNrY8ZAbHle0+Yup9NsDK6TNtww5Xjo+avVxpmyA8tIuf6THRrQnLmiJxkmqH86Ribwk3NIDXYFLtqFhXidBOnxElLCIyZd328dYdSOFviIJfA7i+YJ8u15c0+IWBqYrOugnwhBzCpMO/TecccEHPsz8TCZM0+DZLBKlZVR0SXq0V/NsNgjgJOqMTp7aWpd8BUM+QikrgOJAVX9N9wHdkXpCMMIlBgTrscyg8g1Dk4me34ft61w3OOjPatVSwL2qgWnmfhB7nWvJPOk0yo0rr5q8+ld7+tkSSLuzNxWJBngoH27jK7ehDrhN8WrJ0JVXsU8wtARcB2M0sXza7OxGRfkB3nLOmcLxUXgGFH27bTWDVowYw5yMuBKLyd2tcY5k7qX06kClNtMtWyRdHCDehl/ZP9ooTk130WknT8lrlavqYpgtfVLWGTmJ3COYuZ2zFPRvGzAGv4BN20sFQd5OJ7/ubDMXWtqxPj4U= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bb8af75-4b7f-4f7c-997a-08d7716c621a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 05:57:41.5489 (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: a1FANDnilxOFDVGbC2X/bWYpIxpmV9vWDmGD7hOwk+lEqYvFDp0KZMb8M851QY9Hf1bTq+qkTUQtftjTbiw2Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB2622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds GPIO drivers, DT documentation and DT nodes for HiFive Unleashed board. The gpio patches are mostly based on Wesley's patch= . The patchset also adds hierarchy irq domain support as it is required by th= is gpio driver. It also includes the irqdomain patch to introduce irq_domain_translate_onecell() and irq-nvic driver patch to use this newly introduced function. This patchset is based on Linux 5.4-rc6 and tested on HiFive Unleashed boar= d Changes: v3 vs v2: - Include patch for irq-nvic driver to use irq_domain_translate_onecell - Remove unnecessary inclusion of header files - Use a single prefix for all symbols in this driver - Rename the "enabled" field of struct sifive_gpio to "irq_state" - Remove unused variables and locking from probe() - Other minor changes v2 vs v1: - Add patch to introduce irq_domain_translate_onecell() and use it in the sifive PLIC driver - Drop the usage of own locks, instead use internal bgpio_locks - Consistently use regmap for register access throughout the gpio code - Convert the GPIO DT documentation into a json schema - Other minor changes based upon feedback received on v1 v1 vs RFC: Incorporated below changes as suggested by Linus Walleij on RFC version of = this patchset[0] - Dropped PWM patches as they are already merged. - Include "GPIO_GENERIC" and "REGMAP_MMIO" in Kconfig select option - Remove unwanted inclusion of header files - Use regmap MMIO instead of customised sifive_assign_bit() - Use GPIOLIB_GENERIC and bgpio_init() to set up the accessors - Use hierarchical irqdomain [0] https://lore.kernel.org/linux-riscv/20181010123519.RVexDppaPFpIWl7QU_hp= P8tc5qqWPJgeuLYn0FaGbeQ@z/ Yash Shah (6): genirq: introduce irq_domain_translate_onecell irqchip: nvic: Use irq_domain_translate_onecell instead of custom func irqchip: sifive: Support hierarchy irq domain gpio: sifive: Add DT documentation for SiFive GPIO gpio: sifive: Add GPIO driver for SiFive SoCs riscv: dts: Add DT support for SiFive FU540 GPIO driver .../devicetree/bindings/gpio/gpio-sifive.yaml | 69 ++++++ arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 14 +- .../riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 4 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-sifive.c | 252 +++++++++++++++++= ++++ drivers/irqchip/Kconfig | 1 + drivers/irqchip/irq-nvic.c | 15 +- drivers/irqchip/irq-sifive-plic.c | 30 ++- include/linux/irqdomain.h | 5 + kernel/irq/irqdomain.c | 17 ++ 11 files changed, 399 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-sifive.yaml create mode 100644 drivers/gpio/gpio-sifive.c --=20 2.7.4