Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp103282ybl; Tue, 27 Aug 2019 16:38:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE2pkCHoseOQzxA1snNhmNTXdvC5/Uh7qNKo1ZqcZ2usE4jIrJ5QN5hmCzszICuQfxXg7K X-Received: by 2002:a63:7d49:: with SMTP id m9mr922084pgn.161.1566949136916; Tue, 27 Aug 2019 16:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566949136; cv=none; d=google.com; s=arc-20160816; b=q1eeY461/AkgUUtcynGxD324kLIxH41UVingi0B7dPS1guIJal0BDtUtSiIQmU2dZ/ u7LfSgl4/DloxnzFR9N/F94IRbFFFow2enluZOnr6GffP6Xv9U9m2ECRWDYgLU8B8nXq ymdNJEYL4OqLrvdJdZNAOUQcX1sIE+T+7c47TxOB0o7WSzLKN3StHPJjrfYwgLSBCk6+ 0VMWGIzGHvsHp39z1BRbLY6LUqF7hI4uGksAwZMi2+GqtduwnmsJecLrXjJYuC+Te1kI vk9R8RuyAHgVbu4+9OfRdLheI4w8gH6soB5cQYe067V3a83CoApipveg1aQNAdDhNW8a ke0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date; bh=kKp3RU3/nr6zAi1XcHUG1q7j4xoSv+zNUf1bXZ97gqs=; b=l6GOdU1fus431MDJDlqpKICzDt0pP1invd0wP+3hjWul2lbXQON+OY3ntLlDc97ABi fywapP7l78smKz5rtYo8mf6oxcLiZKZS/xWhP3JOt3MIwsfKXMy2aR/EX7fpo30oxbs9 IRih5GmqUo2BOnJkFPE2b+Wva9SQyED0HsrJGP5hTWRNxuk6Hb7AAl8OkrAQU3x246lf 7pWiDvIHrm0idtzZNndkGsmisaXv1yIz/IQVkUbVzSeVlaWK9b9tJi4SfsX8p7e1AQ84 Qa36tNyd2MDp577tM42edrsLV+tSTzhQft6yqPdFLpHfiQP4mheW5arKY93mGsH7r3hc mu3g== ARC-Authentication-Results: i=1; mx.google.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 x17si723832pfr.167.2019.08.27.16.38.41; Tue, 27 Aug 2019 16:38:56 -0700 (PDT) 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; 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 S1726328AbfH0XhT (ORCPT + 99 others); Tue, 27 Aug 2019 19:37:19 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36032 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbfH0XhS (ORCPT ); Tue, 27 Aug 2019 19:37:18 -0400 Received: by mail-pg1-f194.google.com with SMTP id l21so332688pgm.3 for ; Tue, 27 Aug 2019 16:37:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=kKp3RU3/nr6zAi1XcHUG1q7j4xoSv+zNUf1bXZ97gqs=; b=m2HRDTLD+IpaOMJWcU+CYd5/1RdMwZ7VxLNTHhIf6nXLUxm1q0Ce3mmaVijhWt6vH5 Hio9MscsmQmJgYlffHBg9b6Phns4HKFsIumN+Lim6HlMHjhZOjRDCrbrQ5m2UUH9nDd9 /t1oigFH0k4KPpR4vDkKd7N+BGp3lCF2L4mUiiRaEneYzCtfkIGUocN5C3m9GIncbxQo nUpw/jlvn9G/SAJKCJ5ZviETAgHBSUt99RZKV04lD7fEAJnEmtHDkqkupEgmIPZXP8s3 SRpUcfT71FDSzjnLxtZLSaYOhwo2u5GS14jQSegHsd2PLHqpAe+7DDRjIZ3l/KFxAf8F tDzQ== X-Gm-Message-State: APjAAAWLVe39OXaP+1aHCoygyvq2cAI84OFzNi9TWUUc3rGJ8m75CtFX 8wykgQ1hURYhep+AI4k7NIg18ukLDg8= X-Received: by 2002:a65:6108:: with SMTP id z8mr872696pgu.289.1566949037744; Tue, 27 Aug 2019 16:37:17 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id g19sm471856pfk.0.2019.08.27.16.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 16:37:16 -0700 (PDT) Date: Tue, 27 Aug 2019 16:37:16 -0700 (PDT) X-Google-Original-Date: Tue, 27 Aug 2019 16:36:41 PDT (-0700) Subject: Re: [PATCH 08/15] riscv: provide native clint access for M-mode In-Reply-To: <20190819101648.GA29645@lst.de> CC: mark.rutland@arm.com, Christoph Hellwig , Paul Walmsley , Damien Le Moal , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: Christoph Hellwig Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Aug 2019 03:16:48 PDT (-0700), Christoph Hellwig wrote: > On Tue, Aug 13, 2019 at 05:29:58PM +0100, Mark Rutland wrote: >> > + np = of_find_compatible_node(NULL, NULL, "riscv,clint0"); >> >> Since the MMIO layout is that of the SiFive clint, the compatible string >> should be specific to that. e.g. "sifive,clint". That way it will be >> possible to distinguish it from other implementations. >> >> What exactly is the "0" suffix for? Is that a version number? >> >> If that's a CPU index, then I don't think that's the right way to encode >> this unless the programming interface actually differs across CPUs. It >> would be better to use an explicit phandle to express the affinity. > > It isn't a cpu index, I suspect a version number. These show up > in a lot of the early RISC-V DTs coming from the UCB/SiFive sphere. > They've now spread everywhere unfortunately. clint0 would be version 0 of the clint, with is the core-local interrupt controller in rocket chip. It should be "sifive,clint-1.0.0", not "riscv,clint0", as it's a SiFive widget. Unfortunately there are a lot of legacy device trees floating around, but I'm only considering what's been upstream to be actually part of the spec. In this case the code should match on a "sifive,clint-1.0.0", and the device trees should be fixed up to match. We match on "riscv,plic0" for legacy systems, and I guess it makes sense to do something similar here.