Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2018 15:41:56 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334436 - head/sys/arm/allwinner
Message-ID:  <201805311541.w4VFfuiW060378@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805311541.w4VFfuiW060378>