Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2013 00:07:48 +0900
From:      "Daisuke Aoyama" <aoyama@peach.ne.jp>
To:        "Roel Bouwman" <roel@bouwman.net>, <freebsd-arm@freebsd.org>
Subject:   Re: FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr)
Message-ID:  <2678A4FBD40C409F9183A48F449C300F@ad.peach.ne.jp>
In-Reply-To: <20130110123605.GC31212@shuttle.bouwman.net>
References:  <20130109205029.GB3090@shuttle.bouwman.net> <1E4F692C2E774A5C9ED66CE1A502C261@ad.peach.ne.jp> <20130110123605.GC31212@shuttle.bouwman.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0559_01CDEF8F.B0AAFC90
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit

Hi,

> On Thu, Jan 10, 2013 at 06:23:10AM +0900, you (Daisuke Aoyama) wrote the following:
>> After recovery, download new kernel then replace old one.
>> 
>> # fetch http://www.peach.ne.jp/archives/rpi/kernel/kernel-20130110.gz
> 
> This kernel has exactly the same issue:
> 
> FreeBSD 10.0-CURRENT #0 r244906M: Thu Jan 10 05:49:56 JST 2013
>    aoyama@fbs.local:/usr/obj-rpi-clang/arm.armv6/usr/src/sys/RPI-B-test13 arm
> ...
> Starting file system checks:
> ** SU+J Recovering /dev/mmcsd0s2a
> ** Reading 8388608 byte journal from inode 4.
> ** Building prid 65 (fsck_ufs), uid 0: exited on signal 11
> ecovery table.
> panic: Bad link elm 0xc10e3dc8 next->prev != elm

It seems READ DMA is still broken.
How about this one?

http://www.peach.ne.jp/archives/rpi/kernel/kernel-p1-20130110.gz

The source fix is attached in this mail.

Thanks,
-- 
Daisuke Aoyama
 
------=_NextPart_000_0559_01CDEF8F.B0AAFC90
Content-Type: application/octet-stream;
	name="dmafix-20130101.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="dmafix-20130101.patch"

--- bcm2835_sdhci.c-20130110	2013-01-10 05:26:42.000000000 +0900=0A=
+++ bcm2835_sdhci.c	2013-01-10 23:49:13.000000000 +0900=0A=
@@ -302,6 +302,13 @@=0A=
 		bcm2835_asm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS,=0A=
 					  SDHCI_INT_DATA_END);=0A=
 =0A=
+		/* drain write buffer if READ case */=0A=
+		if (slot->curcmd->data->flags & MMC_DATA_READ) {=0A=
+			isb(); dsb(); /* memory barrier */=0A=
+			bcm2835_dma_wb_range(slot->curcmd->data->data,=0A=
+					     slot->curcmd->data->len);=0A=
+		}=0A=
+=0A=
 		/* enable INT */=0A=
 		slot->intmask |=3D SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL=0A=
 				| SDHCI_INT_DATA_END;=0A=
@@ -586,6 +593,12 @@=0A=
 			    & SDHCI_DATA_AVAILABLE) {=0A=
 				bcm_sdhci_read_pio(slot);=0A=
 			}=0A=
+			/* drain write buffer if READ && DMA+PIO case */=0A=
+			if (slot->curcmd->data->len >=3D 512) {=0A=
+				isb(); dsb(); /* memory barrier */=0A=
+				bcm2835_dma_wb_range(slot->curcmd->data->data,=0A=
+						     slot->curcmd->data->len);=0A=
+			}=0A=
 		} else {=0A=
 			if (bcm2835_asm_sdhci_read_4(bus, slot, SDHCI_PRESENT_STATE)=0A=
 			    & SDHCI_SPACE_AVAILABLE) {=0A=
@@ -602,9 +615,14 @@=0A=
 =0A=
 	/* Now use DMA transfer */=0A=
 #ifdef DMA_DEBUG=0A=
-	printf("DMA transfer (left=3D%d,len=3D%d)\n", left, =
slot->curcmd->data->len);=0A=
-	reg =3D bcm2835_asm_sdhci_read_4(bus, slot, SDHCI_INT_STATUS);=0A=
-	printf("reg=3D%x\n", reg);=0A=
+	{=0A=
+		volatile uint32_t reg;=0A=
+		printf("DMA transfer %s (left=3D%d,len=3D%d)\n",=0A=
+		       (slot->curcmd->data->flags & MMC_DATA_READ) ? "read" : "write",=0A=
+		       left, slot->curcmd->data->len);=0A=
+		reg =3D bcm2835_asm_sdhci_read_4(bus, slot, SDHCI_INT_STATUS);=0A=
+		printf("reg=3D%x\n", reg);=0A=
+	}=0A=
 #endif=0A=
 =0A=
 	/* Disable INT */=0A=

------=_NextPart_000_0559_01CDEF8F.B0AAFC90--




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