UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
10,280 Views
Registered: ‎03-20-2008

Help! Unable to open rtc device (rtc0)

Hi all,

I'm gettingstart with my first custom Zynq board.

I add an external RTC chip(DS3231SN) to the I2C0 of Zynq, but it encounters an error after Linux starts up.

It shows as follow:

drivers/rtc/hctosys.c: unable to open rtc device (rtc0).

 

I don't know how to modity the device tree file.

 

Thanks a lot!

0 Kudos
3 Replies
Adventurer
Adventurer
10,274 Views
Registered: ‎03-20-2008

Re: Help! Unable to open rtc device (rtc0)

I add some lines to device tree file(based on zynq_zed.dts) and the RTC works well now.

 

   ps7_i2c_0: ps7-i2c@e0004000 {
   bus-id = <0>;
   compatible = "xlnx,ps7-i2c-1.00.a";
   i2c-clk = <400000>;
   i2c-reset = "";
   input-clk = <111111115>;
   interrupt-parent = <&gic>;
   interrupts = < 0 25 4 >;
   reg = < 0xe0004000 0x1000 >;

   #address-cells = <1>;
   #size-cells = <0>;
   rtc@68 {
     compatible = "dallas/maxim,ds1307";
     reg = <0x68>;
   };

 

0 Kudos
Highlighted
Visitor lanek83
Visitor
9,169 Views
Registered: ‎07-23-2014

Re: Help! Unable to open rtc device (rtc0)

This post is 1 year old and it appears you haven't visited this forum for a while but I will ask anyway in case anyone can help.

 

I am trying to get the same DS3231 RTC working using PetaLinux 2014.2 but have had not success so far.

 

Are you able to share your kernel config file? 

 

Currently our device tree is as follows:

 

ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
clock-frequency = <400000>;
clocks = <&clkc 38>;
compatible = "cdns,i2c-r1p10";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 25 4>;
reg = <0xe0004000 0x1000>;
xlnx,has-interrupt = <0x0>;
xlnx,i2c-reset = "";
rtc:rtc@68 {
compatible = "dallas,ds1307";
reg = <0x68>;
};
} ;

 

One difference I can see is that we are using using the Cadence I2C driver whereas you appear to be using the Xilinx I2C driver. When the Xilinx I2C driver is used in our case, nothing appears when running i2cdetect -l or in /sys/bus/i2c/devices/ but the Cadence driver appears to be working. However, the RTC won't map to the i2c bus and i2cdetect -r 0 shows nothing connected.

0 Kudos
Adventurer
Adventurer
9,141 Views
Registered: ‎03-20-2008

Re: Help! Unable to open rtc device (rtc0)

Attached is the kernel config file.

Wish good luck!

0 Kudos