svn commit: r349728 - in head/sys: arm/amlogic/aml8726 dev/mmc/host mips/ingenic

Warner Losh imp at FreeBSD.org
Thu Jul 4 14:15:05 UTC 2019


Author: imp
Date: Thu Jul  4 14:15:04 2019
New Revision: 349728
URL: https://svnweb.freebsd.org/changeset/base/349728

Log:
  Implement missing MMCBR ivars
  
  All MMCBR bridges have to implement all the MMCBR variables. This
  implements them for everybody that currently doesn't.
  
  A common routine for this should be written.

Modified:
  head/sys/arm/amlogic/aml8726/aml8726_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/mips/ingenic/jz4780_mmc.c

Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_mmc.c	Thu Jul  4 14:04:08 2019	(r349727)
+++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c	Thu Jul  4 14:15:04 2019	(r349728)
@@ -965,15 +965,26 @@ aml8726_mmc_read_ivar(device_t bus, device_t child,
 	case MMCBR_IVAR_POWER_MODE:
 		*(int *)result = sc->host.ios.power_mode;
 		break;
+	case MMCBR_IVAR_RETUNE_REQ:
+		*(int *)result = return_req_none;
 	case MMCBR_IVAR_VDD:
 		*(int *)result = sc->host.ios.vdd;
 		break;
+	case MMCBR_IVAR_VCCQ:
+		*result = sc->sc_host.ios.vccq;
+		break;
 	case MMCBR_IVAR_CAPS:
 		*(int *)result = sc->host.caps;
 		break;
+	case MMCBR_IVAR_TIMING:
+		*(int *)result = sc->sc_host.ios.timing;
+		break;
 	case MMCBR_IVAR_MAX_DATA:
 		*(int *)result = AML_MMC_MAX_DMA / MMC_SECTOR_SIZE;
 		break;
+	case MMCBR_IVAR_MAX_BUSY_TIMEOUT:
+		*(int *)result = 1000000;	/* 1s max */
+		break;
 	default:
 		return (EINVAL);
 	}
@@ -1011,6 +1022,12 @@ aml8726_mmc_write_ivar(device_t bus, device_t child,
 		break;
 	case MMCBR_IVAR_VDD:
 		sc->host.ios.vdd = value;
+		break;
+	case MMCBR_IVAR_VCCQ:
+		sc->sc_host.ios.vccq = value;
+		break;
+	case MMCBR_IVAR_TIMING:
+		sc->sc_host.ios.timing = value;
 		break;
 	/* These are read-only */
 	case MMCBR_IVAR_CAPS:

Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c	Thu Jul  4 14:04:08 2019	(r349727)
+++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c	Thu Jul  4 14:15:04 2019	(r349728)
@@ -1245,15 +1245,27 @@ aml8726_sdxc_read_ivar(device_t bus, device_t child,
 	case MMCBR_IVAR_POWER_MODE:
 		*(int *)result = sc->host.ios.power_mode;
 		break;
+	case MMCBR_IVAR_RETUNE_REQ:
+		*(int *)result = return_req_none;
+		break;
 	case MMCBR_IVAR_VDD:
 		*(int *)result = sc->host.ios.vdd;
 		break;
+	case MMCBR_IVAR_VCCQ:
+		*result = sc->host.ios.vccq;
+		break;
 	case MMCBR_IVAR_CAPS:
 		*(int *)result = sc->host.caps;
 		break;
+	case MMCBR_IVAR_TIMING:
+		*(int *)result = sc->host.ios.timing;
+		break;
 	case MMCBR_IVAR_MAX_DATA:
 		*(int *)result = AML_SDXC_MAX_DMA / MMC_SECTOR_SIZE;
 		break;
+	case MMCBR_IVAR_MAX_BUSY_TIMEOUT:
+		*(int *)result = 1000000;	/* 1s max */
+		break;
 	default:
 		return (EINVAL);
 	}
@@ -1291,6 +1303,12 @@ aml8726_sdxc_write_ivar(device_t bus, device_t child,
 		break;
 	case MMCBR_IVAR_VDD:
 		sc->host.ios.vdd = value;
+		break;
+	case MMCBR_IVAR_VCCQ:
+		sc->host.ios.vccq = value;
+		break;
+	case MMCBR_IVAR_TIMING:
+		sc->host.ios.timing = value;
 		break;
 	/* These are read-only */
 	case MMCBR_IVAR_CAPS:

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c	Thu Jul  4 14:04:08 2019	(r349727)
+++ head/sys/dev/mmc/host/dwmmc.c	Thu Jul  4 14:15:04 2019	(r349728)
@@ -1091,6 +1091,9 @@ dwmmc_read_ivar(device_t bus, device_t child, int whic
 	case MMCBR_IVAR_VDD:
 		*(int *)result = sc->host.ios.vdd;
 		break;
+	case MMCBR_IVAR_VCCQ:
+		*(int *)result = sc->host.ios.vccq;
+		break;
 	case MMCBR_IVAR_CAPS:
 		*(int *)result = sc->host.caps;
 		break;
@@ -1141,10 +1144,8 @@ dwmmc_write_ivar(device_t bus, device_t child, int whi
 	case MMCBR_IVAR_TIMING:
 		sc->host.ios.timing = value;
 		break;
-
-	/* Not handled */
 	case MMCBR_IVAR_VCCQ:
-		return (0);
+		sc->sc_host.ios.vccq = value;
 		break;
 	/* These are read-only */
 	case MMCBR_IVAR_CAPS:

Modified: head/sys/mips/ingenic/jz4780_mmc.c
==============================================================================
--- head/sys/mips/ingenic/jz4780_mmc.c	Thu Jul  4 14:04:08 2019	(r349727)
+++ head/sys/mips/ingenic/jz4780_mmc.c	Thu Jul  4 14:15:04 2019	(r349728)
@@ -774,17 +774,26 @@ jz4780_mmc_read_ivar(device_t bus, device_t child, int
 	case MMCBR_IVAR_POWER_MODE:
 		*(int *)result = sc->sc_host.ios.power_mode;
 		break;
+	case MMCBR_IVAR_RETUNE_REQ:
+		*(int *)result = return_req_none;
+		break;
 	case MMCBR_IVAR_VDD:
 		*(int *)result = sc->sc_host.ios.vdd;
 		break;
+	case MMCBR_IVAR_VCCQ:
+		*result = sc->sc_host.ios.vccq;
+		break;
 	case MMCBR_IVAR_CAPS:
 		*(int *)result = sc->sc_host.caps;
 		break;
+	case MMCBR_IVAR_TIMING:
+		*(int *)result = sc->sc_host.ios.timing;
+		break;
 	case MMCBR_IVAR_MAX_DATA:
 		*(int *)result = 65535;
 		break;
-	case MMCBR_IVAR_TIMING:
-		*(int *)result = sc->sc_host.ios.timing;
+	case MMCBR_IVAR_MAX_BUSY_TIMEOUT:
+		*(int *)result = 1000000;	/* 1s max */
 		break;
 	}
 
@@ -824,6 +833,9 @@ jz4780_mmc_write_ivar(device_t bus, device_t child, in
 		break;
 	case MMCBR_IVAR_VDD:
 		sc->sc_host.ios.vdd = value;
+		break;
+	case MMCBR_IVAR_VCCQ:
+		sc->sc_host.ios.vccq = value;
 		break;
 	case MMCBR_IVAR_TIMING:
 		sc->sc_host.ios.timing = value;


More information about the svn-src-all mailing list