From patchwork Fri Jan 3 10:10:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3430851 Return-Path: X-Original-To: patchwork-linux-arm@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 C1C28C02DC for ; Fri, 3 Jan 2014 10:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CF79200F3 for ; Fri, 3 Jan 2014 10:13:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 656B5200D6 for ; Fri, 3 Jan 2014 10:13:48 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vz1jz-0007Kg-CN; Fri, 03 Jan 2014 10:12:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vz1jf-0003Gc-6G; Fri, 03 Jan 2014 10:12:11 +0000 Received: from mail-ee0-f50.google.com ([74.125.83.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vz1jD-00039k-Qo for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2014 10:11:44 +0000 Received: by mail-ee0-f50.google.com with SMTP id c41so6792272eek.9 for ; Fri, 03 Jan 2014 02:11:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=jjb2YATGvYT6q8r25MCif4xjsHoGMbk+vGiZrAZ6Y4o=; b=TDm9CW/ku8ZJbkRAjjcDfr13JDx+6MW5IJT3GVE7pfwp8ROvUah3cQUINqzT8x5u8r Jhv3ar/a3NfZtSHcf3aQGTLEgnrdvDi0uPCr+ZJ9LcNh/Mkh3ofacN/gvyg65jQdqWNT tJ9WA4nBE/nIDCzGRyn603o5oUuAddfRo2ycO5eu3U0BV3+WtrgqTG0JyftQ8SfJsPZS 3OPSM5kHL/vJs5GIT6dbOzyIYSiperD0d3sTfjiiVAGllavYH9fwDWlKpaq4e4N78+yy 4CS2TYZqxdHRQ6zZrgygv5dx7oLd8iv/6QiXx6e/4iqOCBZ3tXmoQvKQ/g21behumADz pNTA== X-Gm-Message-State: ALoCoQl78zVIsKTxrbR6a+WSIXKUl+Cxu/PmnmrnBlNphGCxSI+r9o48WWvJSXmOBBX+iMk8p6wW X-Received: by 10.14.218.69 with SMTP id j45mr73824539eep.22.1388743882015; Fri, 03 Jan 2014 02:11:22 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id v7sm143628701eel.2.2014.01.03.02.11.20 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 03 Jan 2014 02:11:20 -0800 (PST) From: Michal Simek To: Michal Simek , u-boot@lists.denx.de, Joe Hershberger , linux-arm-kernel@lists.infradead.org, Albert Aribaud , Tom Rini Subject: [PATCH v1 03/24] mmc: zynq: Add OF initialization support Date: Fri, 3 Jan 2014 11:10:48 +0100 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140103_051144_005107_7ED2BC22 X-CRM114-Status: GOOD ( 15.87 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable 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 Enable initialize sdhci from DTB. Signed-off-by: Michal Simek --- Changes in v1: None arch/arm/include/asm/arch-zynq/sys_proto.h | 1 + drivers/mmc/zynq_sdhci.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) -- 1.8.2.3 diff --git a/arch/arm/include/asm/arch-zynq/sys_proto.h b/arch/arm/include/asm/arch-zynq/sys_proto.h index 110de90..bb089b6 100644 --- a/arch/arm/include/asm/arch-zynq/sys_proto.h +++ b/arch/arm/include/asm/arch-zynq/sys_proto.h @@ -18,5 +18,6 @@ extern void zynq_ddrc_init(void); /* Driver extern functions */ extern int zynq_sdhci_init(u32 regbase); +extern int zynq_sdhci_of_init(const void *blob); #endif /* _SYS_PROTO_H_ */ diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 610bef5..d39cbf0 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -7,6 +7,8 @@ */ #include +#include +#include #include #include #include @@ -31,3 +33,30 @@ int zynq_sdhci_init(u32 regbase) add_sdhci(host, 52000000, 52000000 >> 9); return 0; } + +#ifdef CONFIG_OF_CONTROL +int zynq_sdhci_of_init(const void *blob) +{ + int offset = 0; + u32 ret = 0; + u32 reg; + + debug("ZYNQ SDHCI: Initialization\n"); + + do { + offset = fdt_node_offset_by_compatible(blob, offset, + "arasan,sdhci-8.9a"); + if (offset != -1) { + reg = fdtdec_get_addr(blob, offset, "reg"); + if (reg != FDT_ADDR_T_NONE) { + ret |= zynq_sdhci_init(reg); + } else { + debug("ZYNQ SDHCI: Can't get base address\n"); + return -1; + } + } + } while (offset != -1); + + return ret; +} +#endif