NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60311: eMMC not powering up (used to work)



The following reply was made to PR kern/60311; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/60311: eMMC not powering up (used to work)
Date: Fri, 5 Jun 2026 22:49:58 +0200

 There are two separate issues here.
 
 First is solved by a patch suggested by Jared and only affects -current:
 
 Do not clear the SD Bus Power bit for Rockchip "RKCP0D40" sdhc controllers
 
 Index: sys/dev/acpi/sdhc_acpi.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/acpi/sdhc_acpi.c,v
 retrieving revision 1.22
 diff -u -p -r1.22 sdhc_acpi.c
 --- sys/dev/acpi/sdhc_acpi.c	17 Aug 2024 07:00:35 -0000	1.22
 +++ sys/dev/acpi/sdhc_acpi.c	5 Jun 2026 20:45:23 -0000
 @@ -108,6 +108,7 @@ static const struct sdhc_acpi_slot {
  	{ .hid = "RKCP0D40",		 .type = SLOT_TYPE_SD,
  					 .flags = SDHC_FLAG_32BIT_ACCESS |
  						  SDHC_FLAG_8BIT_MODE |
 +						  SDHC_FLAG_NO_PWR0 |
  						  SDHC_FLAG_SINGLE_POWER_WRITE },
  
  	/* Generic IDs last */
 
 
 With this patch my machine reliably detects the eMMC, but only if options
 DIAGNOSTIC is defined.
 
 Fix suggested by mlelstv. This also affects netbsd-10 and netbsd-11.
 
 When we see an error from the host controller, delay the soft reset by 100us.
 
 Index: sys/dev/sdmmc/sdhc.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/sdmmc/sdhc.c,v
 retrieving revision 1.125
 diff -u -p -r1.125 sdhc.c
 --- sys/dev/sdmmc/sdhc.c	9 Jan 2026 22:54:34 -0000	1.125
 +++ sys/dev/sdmmc/sdhc.c	5 Jun 2026 20:37:48 -0000
 @@ -2356,8 +2356,10 @@ sdhc_wait_intr(struct sdhc_host *hp, int
  
  	if (nointr ||
  	    (ISSET(status, SDHC_ERROR_INTERRUPT) && error)) {
 -		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED))
 +		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
 +			sdmmc_delay(100);
  			(void)sdhc_soft_reset(hp, SDHC_RESET_CMD|SDHC_RESET_DAT);
 +		}
  		hp->intr_error_status = 0;
  		status = 0;
  	}
 
 Without this second part I get random failures (differing between cold
 boot and also changing after soft reboot). The most populare failures is
 "unknown MMC version 6".
 
 
 With both of thes changes my machine reliably detects the eMMC, with and
 without options DIAGNOSTIC.
 
 Martin
 



Home | Main Index | Thread Index | Old Index