Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318AbdLKOiR (ORCPT ); Mon, 11 Dec 2017 09:38:17 -0500 Received: from webbox1416.server-home.net ([77.236.96.61]:51239 "EHLO webbox1416.server-home.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdLKOiQ (ORCPT ); Mon, 11 Dec 2017 09:38:16 -0500 From: Alexander Stein To: Rasmus Villemoes Cc: Marc Zyngier , Thomas Gleixner , Jason Cooper , Rob Herring , Mark Rutland , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [RFC] irqchip: add support for LS1021A external interrupt lines Date: Mon, 11 Dec 2017 15:38:13 +0100 Message-ID: <2302267.dSSx8ic0iv@ws-stein> In-Reply-To: <7badefae-a952-7839-0bfe-dcd09ea1204f@prevas.dk> References: <48d2d08c-c57a-ce49-5958-0fd5ad4a2dc7@arm.com> <42019fb5-393a-08b0-924d-bf1a97e078fe@prevas.dk> <7badefae-a952-7839-0bfe-dcd09ea1204f@prevas.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1062 Lines: 22 On Monday, December 11, 2017, 3:06:52 PM CET Rasmus Villemoes wrote: > On 2017-12-11 14:45, Rasmus Villemoes wrote: > > On 2017-12-11 11:02, Alexander Stein wrote: > > > >> Oh, and what is the content of register SCFG_SCFGREVCR? > > > > Good point. On my board it's 0xffffffff, set even before U-boot starts, > > and lots board support code in U-boot expects this. I can't immediately > > find examples in the linux source code that actually writes to the scfg, > > Not a write, but we do already implicitly assume SCFG_SCFGREVCR is set > to all-ones: In drivers/pci/dwc/pci-layerscape.c, bits which are > numbered 6-11 in the reference manual are extracted with a regmap_read() > followed by a left-shift by 20 and mask with 0x3f. That's consistent > with me setting bit 0 (reference manual enumeration) using 1U<<31. We set SCFG_SCFGREVCR to all-ones too, even before u-boot in rcw. Problem is, this bit-reversal is only valid for SCFG. It's a shame, but at least add a comment in the code you expect SCFG_SCFGREVCR as 0xffffffff. Best regards, Alexander