svn commit: r334436 - head/sys/arm/allwinner

Emmanuel Vadot manu at FreeBSD.org
Thu May 31 15:41:57 UTC 2018


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 |


More information about the svn-src-head mailing list