Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73DDDC433EF for ; Mon, 15 Nov 2021 16:19:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5871261BE1 for ; Mon, 15 Nov 2021 16:19:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236667AbhKOQWS (ORCPT ); Mon, 15 Nov 2021 11:22:18 -0500 Received: from mail-ua1-f51.google.com ([209.85.222.51]:33322 "EHLO mail-ua1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236675AbhKOQVB (ORCPT ); Mon, 15 Nov 2021 11:21:01 -0500 Received: by mail-ua1-f51.google.com with SMTP id b17so36132512uas.0; Mon, 15 Nov 2021 08:18:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MzrpV0n9zVO9H1XuqgeVs7Q9WtEYC0pbJKOVtZbpaDc=; b=c3m3eSIfYiEC0NWP16r35KBdx003YO64EM8bsbbf7l8iD4FHHpgr2vaiRk6VHd9JpL sRjDbE9nDnCeSzklRWyshd8uyJooCA0jJJ/iDdNzmCXNSZtRTxqWU4fKBExnkJDROpHX 4m7rZzy0H0TgYgDnvNTsXcX2MZpn7mXRZYMZ6RYkUWhlckJLu0DNl3q07wTzZAp798CK +1Va2QRfrYhgPgCNb6rQ08+Lsla6IAa10AooLTZ5ggg+3i9yTFm3FZeJHv7F+pgre9vF evMWGBqVHikQisQ6gbV6xNv1nJxq04vKS/d7z+0AFbaiJwzO7nu5R7dFSXpAeEwChfo+ RkCg== X-Gm-Message-State: AOAM532QC/Ux1BYrHah4EZqIFgEjNpSw8qPrPI1rlN4OcU7ZBix3TAdz QdoLCPeJexBD3Ci8ivQkuBBi6ZZimXi/7A== X-Google-Smtp-Source: ABdhPJyjBd8r6yk0+8TjqLB+l1w5Xx1fbP1OcgHYM+wbr7gXuGVd50UiW0X6hmbtKEfumh/+ffBcUA== X-Received: by 2002:a67:4347:: with SMTP id q68mr45237935vsa.40.1636993085092; Mon, 15 Nov 2021 08:18:05 -0800 (PST) Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com. [209.85.222.44]) by smtp.gmail.com with ESMTPSA id m15sm9718868vsh.31.2021.11.15.08.18.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Nov 2021 08:18:04 -0800 (PST) Received: by mail-ua1-f44.google.com with SMTP id w23so13090411uao.5; Mon, 15 Nov 2021 08:18:03 -0800 (PST) X-Received: by 2002:a67:c38f:: with SMTP id s15mr44690576vsj.50.1636993083572; Mon, 15 Nov 2021 08:18:03 -0800 (PST) MIME-Version: 1.0 References: <20211108150554.4457-1-conor.dooley@microchip.com> <20211108150554.4457-13-conor.dooley@microchip.com> <0e379411-2469-8c78-1a3f-0645579a967c@microchip.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 15 Nov 2021 17:17:52 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 12/13] riscv: icicle-kit: update microchip icicle kit device tree To: Conor Dooley Cc: Linus Walleij , Bartosz Golaszewski , Rob Herring , Jassi Brar , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alessandro Zummo , Alexandre Belloni , Mark Brown , Greg KH , Lewis Hanly , Daire.McNamara@microchip.com, Atish Patra , Ivan.Griffin@microchip.com, "open list:GPIO SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Linux I2C , linux-riscv , Linux Crypto Mailing List , linux-rtc@vger.kernel.org, linux-spi , USB list , Krzysztof Kozlowski , Bin Meng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Conor, On Mon, Nov 15, 2021 at 4:39 PM wrote: > On 10/11/2021 14:58, Geert Uytterhoeven wrote: > > On Wed, Nov 10, 2021 at 3:20 PM wrote: > >> On 09/11/2021 09:04, Geert Uytterhoeven wrote: > >>> On Mon, Nov 8, 2021 at 4:07 PM wrote: > >>>> From: Conor Dooley > >>>> > >>>> +&gpio2 { > >>>> + interrupts = >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT > >>>> + PLIC_INT_GPIO2_NON_DIRECT>; > >>> > >>> Why override interrupts in the board .dts file? > >>> Doesn't this belong in the SoC .dtsi file? > >> The interrupt setup for the gpio isnt fixed, there is an option to > >> either connect the individual gpio interrupts to the plic *or* they can > >> be connected to a per gpio controller common interrupt, and it is up to > >> the driver to read a register to determine which interrupt triggered the > >> common/NON_DIRECT interrupt. This decision is made by a write to a > >> system register in application code, which to us didn't seem like it > >> belonged in the soc .dtsi. > > > > So it is software policy? Then it doesn't belong in the board DTS either. > > The write (if was to be done) would be done by the bootloader, based on > the bitstream written to the FPGA, before even u-boot is started. By > application I meant the bootloader (or some other bare metal > application), not a program running in userspace in case that's what you > interpreted. Am I incorrect in thinking that if it is set up by the > bootloader that Linux can take it for granted? If it is to be provided by the boot loader, the boot loader should fill in the interrupts property, just like it already does (or should do, if it doesn't) for /memory and chosen/bootargs. 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