From owner-svn-src-head@freebsd.org Thu May 31 15:41:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4350EEF9CD0; Thu, 31 May 2018 15:41:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8A846DA05; Thu, 31 May 2018 15:41:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB3981C205; Thu, 31 May 2018 15:41:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4VFfuWY060379; Thu, 31 May 2018 15:41:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4VFfuiW060378; Thu, 31 May 2018 15:41:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805311541.w4VFfuiW060378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 31 May 2018 15:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334436 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 334436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2018 15:41:57 -0000 Author: manu Date: Thu May 31 15:41:56 2018 New Revision: 334436 URL: https://svnweb.freebsd.org/changeset/base/334436 Log: aw_mmc: Get max-frequency from the dtb If a max-frequency is supplied in the dtb use it, otherwise fallback to a default one of 52Mhz. Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Thu May 31 15:41:00 2018 (r334435) +++ head/sys/arm/allwinner/aw_mmc.c Thu May 31 15:41:56 2018 (r334436) @@ -182,7 +182,7 @@ aw_mmc_attach(device_t dev) struct aw_mmc_softc *sc; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *tree; - uint32_t bus_width; + uint32_t bus_width, max_freq; phandle_t node; int error; @@ -277,7 +277,12 @@ aw_mmc_attach(device_t dev) } sc->aw_host.f_min = 400000; - sc->aw_host.f_max = 52000000; + + if (OF_getencprop(node, "max-frequency", &max_freq, + sizeof(uint32_t)) <= 0) + max_freq = 52000000; + sc->aw_host.f_max = max_freq; + sc->aw_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->aw_host.caps = MMC_CAP_HSPEED | MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR50 |