From patchwork Mon Apr 21 15:35:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 4025421 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31BB1BFF02 for ; Mon, 21 Apr 2014 15:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56ED3202A7 for ; Mon, 21 Apr 2014 15:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7206C201ED for ; Mon, 21 Apr 2014 15:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbaDUPfp (ORCPT ); Mon, 21 Apr 2014 11:35:45 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:64148 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751649AbaDUPfo (ORCPT ); Mon, 21 Apr 2014 11:35:44 -0400 Received: from 99-127-230-128.lightspeed.sntcca.sbcglobal.net ([99.127.230.128] helo=atomide.com) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1WcGG0-000CBL-5p; Mon, 21 Apr 2014 15:35:44 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 99.127.230.128 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/s+ROHkOE6Liw2HQY36Dh7 Date: Mon, 21 Apr 2014 08:35:40 -0700 From: Tony Lindgren To: Joachim Eastwood Cc: linux-omap@vger.kernel.org Subject: Re: [PATCH] ARM: dts: Correct offset in OMAP4_WKUP_IOPAD macro Message-ID: <20140421153539.GB23945@atomide.com> References: <1397924056-6462-1-git-send-email-manabian@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Joachim Eastwood [140419 09:25]: > On 19 April 2014 18:14, Joachim Eastwood wrote: > > This was introduced in 43a348ea53eb5fd79 but hasn't caused > > any harm since it don't have any users yet. > > Or maybe I am confused about this macro. > > Tony which offset from the OMAP4 TRM should be used? > > Under section 18.6.8 there are is a column with address offset. Is > this the number you want in the macro? Oh I see, the offsets in the TRM in this case are from the base of the wkup module padconf base instead of listing the physical address for the register. Ideally the value would be what the documentation lists in the "Table 18-9. Device Wake-Up Control Module Pad Configuration Register Fields" with 2 added to it for the upper registers as we're using 16-bit register address. In any case something that's relatively easy to verify against the documentation. But that seems to vary between the physical address and the offset, so we need to specify some mask there. Something like below (untested) should do the trick as long as we never have padconf reg areas larger than 0xfff. We may want to allow defining a custom mask for the macro if needed depending how the documentation is defining the mux tables for. --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -51,9 +51,9 @@ /* * Macros to allow using the absolute physical address instead of the - * padconf registers instead of the offset from padconf base. + * padconf register offset from padconf register base. */ -#define OMAP_IOPAD_OFFSET(pa, offset) (((pa) & 0xffff) - (offset)) +#define OMAP_IOPAD_OFFSET(pa, offset) (((pa) & 0xfff) - ((offset) & 0xfff)) #define OMAP2420_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0030) (val) #define OMAP2430_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val)