From patchwork Mon Mar 25 15:02:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15598 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3310B23E3E for ; Mon, 25 Mar 2013 15:02:56 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by fiordland.canonical.com (Postfix) with ESMTP id D7774A1940F for ; Mon, 25 Mar 2013 15:02:55 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fj20so11458346lab.20 for ; Mon, 25 Mar 2013 08:02:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=n3O0xTNN0dKEaTJ+IlZ/eIdItu8ycjS35plZbgxGDZQ=; b=DCQLEpsPMwfSp1FBAQn+orXRtVbf2B8Eua401fA69+c0IMwXzpul3jRFM028+lQ6Vn OTJEbClrpXs1l7wDVPryFFegugO1fioSs7segnJWgWMe4UyfMWiKVFxy/5/z5koWcXiP ZyfEmt45z5NaV4ecPmJbPBDe52n9Wyt/oNJhFrw6Yzaaq73va2nt8W18Mp6t3QhhA487 kgAb3y5HqHRr6qI8bpkttjH8wBgZxxY5wswHoSyg/ik+s1n/9WsaxIaLwkltF4jD4XXA HWEnOhaM+YcKVtYhj5u+Lpy5aS+K9OO/QMTAdLS3BrpmN9EkPIlsWR0j1KAO1xYDQEfZ shWg== X-Received: by 10.112.39.138 with SMTP id p10mr6275139lbk.31.1364223775457; Mon, 25 Mar 2013 08:02:55 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.112.147.5 with SMTP id tg5csp52502lbb; Mon, 25 Mar 2013 08:02:54 -0700 (PDT) X-Received: by 10.194.87.229 with SMTP id bb5mr18562300wjb.32.1364223774338; Mon, 25 Mar 2013 08:02:54 -0700 (PDT) Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by mx.google.com with ESMTPS id hk4si5126810wjb.181.2013.03.25.08.02.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 08:02:54 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::233; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f179.google.com with SMTP id hn17so4115435wib.0 for ; Mon, 25 Mar 2013 08:02:54 -0700 (PDT) X-Received: by 10.180.37.166 with SMTP id z6mr2101666wij.34.1364223773950; Mon, 25 Mar 2013 08:02:53 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id f1sm23002006wib.0.2013.03.25.08.02.52 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 08:02:53 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones Subject: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Date: Mon, 25 Mar 2013 15:02:37 +0000 Message-Id: <1364223758-17621-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364223758-17621-1-git-send-email-lee.jones@linaro.org> References: <1364223758-17621-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnOynrOUdCsxvETfcgDX4jLaLDecxFS5iP95kFe6x6J29pTgorzgtn1qXz0Fbg8Lw0gWo2u A recent move to send the base addresses though the PRCMU platform device resource instead of defines found in , means that dbx500 devices can no longer boot successfully when booting with Device Tree enabled. This patch ensures the addresses are obtained correctly from DT. Signed-off-by: Lee Jones --- drivers/mfd/db8500-prcmu.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 21f261b..8602bf8 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -2790,19 +2792,29 @@ static int db8500_irq_init(struct device_node *np) } static void dbx500_fw_version_init(struct platform_device *pdev, - u32 version_offset) + u32 version_offset, + struct device_node *np) { + struct device_node *tcpm_np; struct resource *res; - void __iomem *tcpm_base; + void __iomem *tcpm_base = NULL; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcpm"); if (!res) { - dev_err(&pdev->dev, - "Error: no prcmu tcpm memory region provided\n"); - return; - } - tcpm_base = ioremap(res->start, resource_size(res)); + if (np) { + tcpm_np = of_find_node_by_name(np->parent, + "prcmu-tcpm-per4"); + if (!tcpm_np) { + dev_err(&pdev->dev, + "no prcmu tcpm mem region provided\n"); + return; + } + tcpm_base = of_iomap(tcpm_np, 0); + } + } else + tcpm_base = ioremap(res->start, resource_size(res)); + if (tcpm_base != NULL) { u32 version; @@ -3154,7 +3166,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev) init_prcm_registers(); - dbx500_fw_version_init(pdev, pdata->version_offset); + dbx500_fw_version_init(pdev, pdata->version_offset, np); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm"); if (!res) { dev_err(&pdev->dev, "no prcmu tcdm region provided\n");