From owner-freebsd-arm@FreeBSD.ORG Tue Apr 29 21:38:23 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2CE3B4 for ; Tue, 29 Apr 2014 21:38:23 +0000 (UTC) Received: from nm10-vm4.access.bullet.mail.bf1.yahoo.com (nm10-vm4.access.bullet.mail.bf1.yahoo.com [216.109.114.211]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 634471C83 for ; Tue, 29 Apr 2014 21:38:23 +0000 (UTC) Received: from [66.196.81.163] by nm10.access.bullet.mail.bf1.yahoo.com with NNFMP; 29 Apr 2014 21:35:34 -0000 Received: from [98.139.244.52] by tm9.access.bullet.mail.bf1.yahoo.com with NNFMP; 29 Apr 2014 21:35:34 -0000 Received: from [127.0.0.1] by smtp114.sbc.mail.bf1.yahoo.com with NNFMP; 29 Apr 2014 21:35:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1398807333; bh=lmRbZvWQgHloF53eFkDDHu/xccBx971NwXUlxKMDZgU=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type; b=Je9m8mynYl9wOoV6pG5eO88qKHk7RxDGPmimbhaSwRlkzs7IdfcSrGmgp9z4O7R++fdlaps9cck3hNN6pfoZoVAsxVjDBHff/3cz4Cnl0C4SIGLbz7DAu1DiNkhwUiaP8zp+Fmm2UFknxFeAtEVrXc83svpPFtAChxB/eEuuwXQ= X-Yahoo-Newman-Id: 991668.79757.bm@smtp114.sbc.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: y3gRkWYVM1kYWRf.gBOApm7Pyfy7SN1uhm45NtB3GFklw70 3EMwycgCAQSf3wS2WEyFx.oJluopQa4JDlZ7MNA6kcKc6U7Ta.CFO.Hi5w0p KUBDdhNHHEamVaJjinTIyj7em5hVJCyF_bhx5c9S_SbugAFSvGXBfCag8mR0 556TQcjzs0z85qn2hr17jSuRuwrRBc.pAIR6GmaqO7tcxCpi08u.9A9r1l1e NlMze0Imw0ppd7Rwjju4mbJ9YrI0esWrgBObNCwvAyex8bpLdQKGUzwJPsLB Ixlim32aj.4.8LUR_sL0NJ.OdgUqbtp3fmHCLNe.50log2esEGJV0_2yxpWm s8646906hpaq3JELfhJYe5u1JT99exgf6Wp7GcevdV2RSDasD0nTyF.S1Cs2 T_tnmbuN5JZqPy.EzMBzqnOUljPqNOX1hOtAoliPygkvloxVtBs672ovBFc7 b66s1gL8QOD2Tw4XkxQo0Y484kK8klkSZI2gnsGaED7QMy_gd7TedJIAZYGH KCJDa_NuU0MBq7YKQZH8E8psbdk7SmXo_SVsaJccUEsGO3j99HJE- X-Yahoo-SMTP: tUxoRneswBA21azLM.3ybMESf0mC2bFhTbmt0VU5ervH0kqi5lo- X-Rocket-Received: from [192.168.1.9] (ThomasSkibo@71.139.160.145 with plain [98.139.221.42]) by smtp114.sbc.mail.bf1.yahoo.com with SMTP; 29 Apr 2014 14:35:33 -0700 PDT Message-ID: <53601B1D.2090702@sbcglobal.net> Date: Tue, 29 Apr 2014 14:35:25 -0700 From: Thomas Skibo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: freebsd-arm Subject: sdhci_fdt ignores clock-frequency property in .dtb Content-Type: multipart/mixed; boundary="------------080304000006030203030304" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 21:38:23 -0000 This is a multi-part message in MIME format. --------------080304000006030203030304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Another Zynq bug-fix. One Zynq board out there needs to set this property or else the SD card gets clocked too fast. Thanks, -- -------- Thomas Skibo ThomasSkibo@sbcglobal.net --------------080304000006030203030304 Content-Type: text/plain; charset=UTF-8; name="patch.sdhci_fdt.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.sdhci_fdt.txt" Index: sys/dev/sdhci/sdhci_fdt.c =================================================================== --- sys/dev/sdhci/sdhci_fdt.c (revision 264766) +++ sys/dev/sdhci/sdhci_fdt.c (working copy) @@ -66,6 +66,7 @@ device_t dev; /* Controller device */ u_int quirks; /* Chip specific quirks */ u_int caps; /* If we override SDHCI_CAPABILITIES */ + uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ @@ -156,6 +157,7 @@ sc->quirks = 0; sc->num_slots = 1; + sc->max_clk = 0; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -170,11 +172,14 @@ node = ofw_bus_get_node(dev); - /* Allow dts to patch quirks and slots. */ - if ((OF_getprop(node, "quirks", &cid, sizeof(cid))) > 0) - sc->quirks = fdt32_to_cpu(cid); - if ((OF_getprop(node, "num-slots", &cid, sizeof(cid))) > 0) - sc->num_slots = fdt32_to_cpu(cid); + /* Allow dts to patch quirks, slots, and clock frequency. */ + if ((OF_getencprop(node, "quirks", &cid, sizeof(cid))) > 0) + sc->quirks = cid; + if ((OF_getencprop(node, "num-slots", &cid, sizeof(cid))) > 0) + sc->num_slots = cid; + if ((OF_getencprop(node, "clock-frequency", &cid, sizeof(cid))) > 0) + sc->max_clk = cid; + return (0); } @@ -214,6 +219,7 @@ slot->quirks = sc->quirks; slot->caps = sc->caps; + slot->max_clk = sc->max_clk; if (sdhci_init_slot(dev, slot, i) != 0) continue; --------------080304000006030203030304--