Port-arm archive

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

Re: sdmmc on Kirkwood?



On Fri, Feb 01, 2019 at 05:51:18AM +0000, John Klos wrote:
> I have a number of PogoPlugs running as NAT routers, DNS servers, et cetera.
> I've hardly had to touch them - they just run forever. I decided to update
> one of them to netbsd-8 from a week ago. This one is a PogoPlug v4 with a
> SATA port, with root on a SATA SSD.
> 
> Even though it has been compiled with MVSDIO_MAX_CLOCK="(19 * 1000)", and
> even though there's no SD card in the slot, dmesg shows a constant stream of
> the following with a continuous 10% system load:
> 
> sdmmc0: sdmmc_mem_enable failed with error 60
> 
> Inserting an SD card brings the system load to about 95%, and the machine
> runs noticeably slower. The error messages stay the same - no SD card is
> recognized.
> 
> Does anyone have any thoughts about what might've changed to cause this
> issue, or what I can try to see about fixing it?
> 
> Thanks,
> John


Try (portions of) this (attached) patch.  Works for me on a Pogoplug V4
A3.

	Jonathan Kollasch
Index: sys/arch/arm/marvell/kirkwood.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/marvell/kirkwood.c,v
retrieving revision 1.10
diff -d -u -a -p -r1.10 kirkwood.c
--- sys/arch/arm/marvell/kirkwood.c	7 Jan 2017 16:19:28 -0000	1.10
+++ sys/arch/arm/marvell/kirkwood.c	1 Feb 2019 12:50:04 -0000
@@ -142,6 +142,14 @@ kirkwood_bootstrap(vaddr_t iobase)
 	gpp_irqbase = 96;	/* Main Low(32) + High(32) + Bridge(32) */
 #endif
 
+
+#ifdef POGOPLUG_V4_A3
+#define MPPREG(x) (*(volatile uint32_t *)(iobase + KIRKWOOD_MPP_BASE + (x)))
+	/* SD card fix */
+	MPPREG(4) = (MPPREG(4) & ~0xffff0000) | 0x11110000;
+	MPPREG(8) = (MPPREG(8) & ~0x000000ff) | 0x00000011;
+#endif
+
 	kirkwood_getclks(iobase);
 	mvsoc_clkgating = kirkwood_clkgating;
 }
Index: sys/arch/evbarm/conf/POGO
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/conf/POGO,v
retrieving revision 1.4
diff -d -u -a -p -r1.4 POGO
--- sys/arch/evbarm/conf/POGO	25 Nov 2017 04:53:24 -0000	1.4
+++ sys/arch/evbarm/conf/POGO	1 Feb 2019 12:50:04 -0000
@@ -2,6 +2,8 @@
 
 include "arch/evbarm/conf/SHEEVAPLUG"
 
+#no mvsdio
+
 no options	COMPAT_OSSAUDIO
 no options	COMPAT_LINUX
 no options	DIAGNOSTIC
@@ -37,10 +39,10 @@ no spkr* at audio?
 no config netbsd
 
 # Use ld0a for SD slot in Mobile and v4 or sd0a for USB disk
-config netbsd root on ld0a type ffs
+config netbsd root on mvgbe0
 
 # Uncomment these for PogoPlug v4. Note that MVSDIO_MAX_CLOCK is mandatory
-options 	MVSDIO_MAX_CLOCK="(19 * 1000)"
+options 	MVSDIO_MAX_CLOCK="(25 * 1000)"
 xhci*		at pci? dev ? function ?	# eXtensible Host Controller
 usb*		at xhci?
 
@@ -62,3 +64,5 @@ options 		BPFJIT
 pseudo-device		tun			# network tunneling over tty
 pseudo-device		gre			# generic L3 over IP tunnel
 pseudo-device		gif			# IPv[46] over IPv[46] tunnel (RFC 1933)
+
+options POGOPLUG_V4_A3


Home | Main Index | Thread Index | Old Index