Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 2015 15:08:57 +0300
From:      Jukka Ukkonen <jau789@gmail.com>
To:        sparvu@kronometrix.org
Cc:        freebsd-arm@FreeBSD.org
Subject:   Re: RBPI2 ds1307 rtc kernel panic
Message-ID:  <5607DC59.5050509@gmail.com>
In-Reply-To: <5607C63D.2010203@kronometrix.org>
References:  <5607C63D.2010203@kronometrix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020705080105050600090706
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit

On 09/27/15 13:34, Stefan Parvu wrote:
> 
> Im seeing kernel panics after I have compiled support for DS1307 RTC
> device on RBPI2 hardware:
> 
> panic: sleepq_add: td 0xc395b000 to sleep on wchan 0xc39fa380 with
> sleeping prohibited
> 
> The system here:
> 
> iichb0: <BCM2708/2835 BSC controller> mem 0x205000-0x20501f irq 61 on
> simplebus0
> iicbus0: <OFW I2C bus> on iichb0
> iic0: <I2C generic I/O> on iicbus0
> iichb1: <BCM2708/2835 BSC controller> mem 0x804000-0x80401f irq 61 on
> simplebus0
> iicbus1: <OFW I2C bus> on iichb1
> iic1: <I2C generic I/O> on iicbus1
> ds13070: <Maxim DS1307 RTC> at addr 0xd0 on iicbus1
> 
> 
> FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r288098: Thu Aug 20
> 04:00:38 UTC 2015     root@rpi2:/usr/obj/usr/src/sys/KPI2  arm
> 
> 
> I have compiled the kernel by Vadim's procedure [1] but modified for
> RBPI2: bcm2836.dtsi:  https://github.com/vzaigrin/ds1307/issues/1
> 
> Anyone any ideas why the crash ?
> Many thanks
> 
> [1]
> https://vzaigrin.wordpress.com/2015/08/04/real-time-clock-on-raspberry-pi-with-freebsd-11/
> 


Hi Stefan!

I have used a different chip (Maxim ds3231), but I guess
the process should be much the same for your chip.

In my kernel configuration (sys/arm/conf/RPI-B) I have
added this line ...

device		ds3231

in your case this should become

device		ds1307

In the DTS file (sys/boot/fdt/dts/arm/rpi.dts) I added
the attached patch.
In your case you should of course change the name of
the chip in the DTS to ds1307 as well.

The same changes work also for a ds3231 on RPI2.
I have successfully equipped both my RPI-B and my PRI2
with the ds3231 chip. For RPI2 the files to modify are
- sys/arm/conf/RPI2 and
- sys/boot/fdt/dts/arm/rpi2.dts

I hope this helps.

Cheers,
--jau


--------------020705080105050600090706
Content-Type: text/x-patch;
 name="RPI-B-dts-ds3231.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="RPI-B-dts-ds3231.patch"

Index: src.head/sys/boot/fdt/dts/arm/rpi.dts
===================================================================
--- sys/boot/fdt/dts/arm/rpi.dts	(revision 288306)
+++ sys/boot/fdt/dts/arm/rpi.dts	(working copy)
@@ -292,6 +292,17 @@
 				broadcom,function = "ALT3";
 			};
 		};
+
+		bsc1 {
+			#address-cells = <0x1>;
+			#size-cells = <0x0>;
+
+			rtc {
+				compatible = "maxim,ds3231";
+				reg = <0xd0>;
+			};
+		};
+
 		usb {
 			hub {
 				compatible = "usb,hub", "usb,device";

--------------020705080105050600090706--



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