Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1300916pxu; Mon, 23 Nov 2020 17:36:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8hQvPxKHnRCcHFZYHjOKkQTL2bGHesPl5szSyrONB2/riLb6e6C8u3HIKhw4uA9t7iHWu X-Received: by 2002:a50:d701:: with SMTP id t1mr1801749edi.177.1606181816181; Mon, 23 Nov 2020 17:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606181816; cv=none; d=google.com; s=arc-20160816; b=hrakLeX24lDPKFf2ebH76vTIUdwBkZoiehDtpZ4akMMkt3UtWgZTzhZEXc2hBMkdPq LpiNsjIGr00LlUuqg53ufg5V71NW6E6yDHhPOTWznFZ+mrtVm2Rj1JG0QYf/pv+91ZPX yIFL5mabIWDFYQSOnv0qwqOTxhxmC3VFl9hB9Uje/zIwhCKACmczfxbgNRuPNv9dG4z5 MCuvy6tLHufAHRzEnVJ+nlHbFlbav9GekSlnxjV+1shc20kCxABbVhbGgpuRKb29vCem /Zo7+w0Zgg7eWeCyCfT1A3bjKhKGl6U/hd2iqdjYC9+3uHNcLG/uJi0umViwwuG6ZFMi jTtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=sXhTe3gNjK7cua0cHnhHUT5qejiCX0GlG0BqDyzzY+4=; b=zU3UN5wr4dyJM1x+0cEr9FJHDgm5aEhf1HbTzI+Zr/7sdtEYZy3QbBIs2RGrdZm3tJ hZgdtIbKo7CWjXw0pdonc1/YNt/aJYE05dVJBjEV1u9jskF3izRHMrL7lYeMhoUp09Et +QlFkoPxv3ExmRayPonZT1dhpQUUmxcwaaRy7X4NpGZeItV1YimGyEJRklHgMdkQAehP IMVx4+1LZZ4HE/JDkh2j+KgciXv9XMbAgvw/mqibfWPf2+Yn1uUBNlb4d5eMMrG0xZR9 d5HehzgrU0a0Cr4y3YnV5+w2clktGy1eMeAbft+4cN1KwpS4SDhqbi00RvfPehhg3q+6 JZJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si7319623ejd.748.2020.11.23.17.36.33; Mon, 23 Nov 2020 17:36:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730329AbgKXBdf convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Nov 2020 20:33:35 -0500 Received: from mail-oi1-f181.google.com ([209.85.167.181]:45731 "EHLO mail-oi1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729310AbgKXBdf (ORCPT ); Mon, 23 Nov 2020 20:33:35 -0500 Received: by mail-oi1-f181.google.com with SMTP id l206so21915488oif.12; Mon, 23 Nov 2020 17:33:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZKs0epO4y0vzJkUpneM2DbUUma/iS5r6bxhuQAlnKhI=; b=sadYCxL8CN7XyLfIKVEe6Bb9jBdXBhfoDqn5x3TG8PTPVN29YB8vVht38217K6Ci5s OhTZt/3XdmaoeNe78iOf4teZX2pUQ2q57A8lC2GPgUu76+g4ITUGjZNhWBtDSqeCMoUO pwyzCe1iyLl5zm3Qr4GstTBXGrORB3v5G+efKuSFkZnQnUuaEF0Yv/jOIMjPgV03qSuD MCvW1+v97fhiRib2CpUig65rPA+i/Dj+xfle0IJeu8vTht8c3orTcYaMzoM/1BdnWFDn n/7lQLI3cZd/1awY1T+4i3qo2VOWbiF7DXXuOekmjtBwTInnJHT106N1shirc98n7AxY Ujrg== X-Gm-Message-State: AOAM531+wn5BafBQQ2lsjZWnlWuAt0peVsDqReCInEiwipJCWj7o1/Wd rLKMouoAe02sK59j6ZDvywNllzVRp10jsA== X-Received: by 2002:a54:4f90:: with SMTP id g16mr1220317oiy.24.1606181613650; Mon, 23 Nov 2020 17:33:33 -0800 (PST) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com. [209.85.167.175]) by smtp.gmail.com with ESMTPSA id s193sm8486968oos.21.2020.11.23.17.33.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Nov 2020 17:33:32 -0800 (PST) Received: by mail-oi1-f175.google.com with SMTP id o25so21997424oie.5; Mon, 23 Nov 2020 17:33:31 -0800 (PST) X-Received: by 2002:aca:a896:: with SMTP id r144mr1234282oie.154.1606181610941; Mon, 23 Nov 2020 17:33:30 -0800 (PST) MIME-Version: 1.0 References: <20201027044619.41879-1-biwen.li@oss.nxp.com> <5b1f2911-98b3-511f-404b-7d0fa44cc0c2@rasmusvillemoes.dk> <03dc38bb-b83a-7926-60dc-61152a3ac967@rasmusvillemoes.dk> In-Reply-To: From: Li Yang Date: Mon, 23 Nov 2020 19:33:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [EXT] Re: [v2 01/11] irqchip: ls-extirq: Add LS1043A, LS1088A external interrupt To: Rasmus Villemoes , "Biwen Li (OSS)" , "shawnguo@kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "Z.q. Hou" , "tglx@linutronix.de" , "jason@lakedaemon.net" , "maz@kernel.org" Cc: "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jiafei Pan , Xiaobo Xie , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 5, 2020 at 5:04 PM Leo Li wrote: > > > > > -----Original Message----- > > From: Rasmus Villemoes > > Sent: Tuesday, November 3, 2020 2:03 AM > > To: Leo Li ; Biwen Li (OSS) ; > > shawnguo@kernel.org; robh+dt@kernel.org; mark.rutland@arm.com; Z.q. > > Hou ; tglx@linutronix.de; jason@lakedaemon.net; > > maz@kernel.org > > Cc: devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Jiafei Pan > > ; Xiaobo Xie ; linux-arm- > > kernel@lists.infradead.org > > Subject: Re: [EXT] Re: [v2 01/11] irqchip: ls-extirq: Add LS1043A, LS1088A > > external interrupt > > > > On 02/11/2020 22.22, Leo Li wrote: > > >>> > > >>> Where did you get this information that the register on LS1043 and > > >>> LS1046 is bit reversed? I cannot find such information in the RM. > > >>> And does this mean all other SCFG registers are also bit reversed? > > >>> If this is some information that is not covered by the RM, we > > >>> probably should clarify it in the code and the commit message. > > >> Hi Leo, > > >> > > >> I directly use the same logic to write the bit(field IRQ0~11INTP) of > > >> the register SCFG_INTPCR in LS1043A and LS1046A. > > >> Such as, > > >> if I want to control the polarity of IRQ0(field IRQ0INTP, IRQ0 is > > >> active low) of LS1043A/LS1046A, then I just need write a value 1 << (31 - 0) > > to it. > > >> The logic depends on register's definition in LS1043A/LS1046A's RM. > > > > > > Ok. The SCFG_SCFGREVCR seems to be a one-off fixup only existed on > > LS1021. And it is mandatory to be bit_reversed according to the RM which is > > already taken care of in the RCW. So the bit reversed case should be the only > > case supported otherwise a lot of other places for SCFG access should be > > failed. > > > > > > I think we should remove the bit_reverse thing all together from the driver > > for good. This will prevent future confusion. Rasmus, what do you think? > > > > Yes, all the ls1021a-derived boards I know of do have something like > > > > # Initialize bit reverse of SCFG registers > > 09570200 ffffffff > > > > in their pre-boot-loader config file. And yes, the RM does say > > > > This register must be written 0xFFFF_FFFF as a part of > > initialization sequence before writing to any other SCFG > > register. > > > > but nowhere does it say "or else...", nor a little honest addendum "because > > we accidentally released broken silicon with this misfeature _and_ wrong > > POR value". > > Yeah. I do think they messed up at the beginning when trying to integrate the big endian registers on little endian core. It is good that we are doing it correctly in later SoCs. > > > > > Can we have an official statement from NXP stating that SCFGREVCR is a > > hardware design bug? And can you send it through a time-machine so I had it > > three years ago avoiding the whole "fsl,bit-reverse device-tree-property, no, > > read the register if you're on a ls1021a and decide" hullabaloo. > > I'm not sure if it is possible to update the related documents right now for this. But definitely it was not your fault to have introduced this in the driver due to the confusion from document. My suggestion to remove it is just to prevent this from causing more confusions in the future as this driver is used on more SoCs. Hi Biwen, Would you send a new version of this patch? Thanks. Regards, Leo