Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2018 18:30:25 +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: r329463 - head/sys/arm/allwinner
Message-ID:  <201802171830.w1HIUPKb078725@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Sat Feb 17 18:30:25 2018
New Revision: 329463
URL: https://svnweb.freebsd.org/changeset/base/329463

Log:
  aw_mmc: Only change the clock if it has really changed
  
  This also seems to fix problem when booting Pine64 from the mmc.
  
  Tested On:	Pine64
  Tested On:	Pine64-LTS

Modified:
  head/sys/arm/allwinner/aw_mmc.c

Modified: head/sys/arm/allwinner/aw_mmc.c
==============================================================================
--- head/sys/arm/allwinner/aw_mmc.c	Sat Feb 17 18:00:01 2018	(r329462)
+++ head/sys/arm/allwinner/aw_mmc.c	Sat Feb 17 18:30:25 2018	(r329463)
@@ -117,6 +117,7 @@ struct aw_mmc_softc {
 	int32_t			aw_vdd;
 	regulator_t		aw_reg_vmmc;
 	regulator_t		aw_reg_vqmmc;
+	unsigned int		aw_clock;
 
 	/* Fields required for DMA access. */
 	bus_addr_t	  	aw_dma_desc_phys;
@@ -939,8 +940,8 @@ aw_mmc_update_ios(device_t bus, device_t child)
 		reg &= ~AW_MMC_CTRL_DDR_MOD_SEL;
 	AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg);
 
-	if (ios->clock) {
-		clock = ios->clock;
+	if (ios->clock && ios->clock != sc->aw_clock) {
+		sc->aw_clock = clock = ios->clock;
 
 		/* Disable clock */
 		error = aw_mmc_update_clock(sc, 0);



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