lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364223758-17621-3-git-send-email-lee.jones@linaro.org>
Date:	Mon, 25 Mar 2013 15:02:38 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:	arnd@...db.de, linus.walleij@...ricsson.com,
	Lee Jones <lee.jones@...aro.org>
Subject: [PATCH 3/3] mfd: db8500-prcmu: Fetch the PRCMU TCPM base address from Device Tree

A recent move to send the base addresses though the PRCMU platform
device resource instead of defines found in <mach/*>, 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 instead.

Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 drivers/mfd/db8500-prcmu.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 8602bf8..a998edc 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -3159,8 +3159,9 @@ static void db8500_prcmu_update_cpufreq(void)
  */
 static int db8500_prcmu_probe(struct platform_device *pdev)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct prcmu_pdata *pdata = dev_get_platdata(&pdev->dev);
+	struct device_node *np = pdev->dev.of_node;
+	struct device_node *tcdm_np;
 	int irq = 0, err = 0, i;
 	struct resource *res;
 
@@ -3169,11 +3170,19 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 	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");
-		return -ENOENT;
-	}
-	tcdm_base = devm_ioremap(&pdev->dev, res->start,
-			resource_size(res));
+		if (np) {
+			tcdm_np = of_find_node_by_name(np->parent,
+						       "prcmu-tcdm-per4");
+			if (!tcdm_np) {
+				dev_err(&pdev->dev,
+					"no prcmu tcdm region provided\n");
+				return -ENOENT;
+			}
+			tcdm_base = of_iomap(tcdm_np, 0);
+		}
+	} else
+		tcdm_base = devm_ioremap(&pdev->dev, res->start,
+					 resource_size(res));
 
 	/* Clean up the mailbox interrupts after pre-kernel code. */
 	writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ