zynq i2c软核连接mcp79410RTC

1、设备树更改

IIC:i2c@0x41600000{
			compatible = "xlnx,xps-iic-2.00.a";
			interrupt-parent = <&intc>;
			interrupts = <0 34 4>;
			reg = <0x41600000 0x40000>;
			clocks = <&clkc 15>;
			#address-cells = <1>;
			#size-cells = <0>;
			mcp_rtc:rtc@6f{
				compatible = "microchip,mcp7941x";
				reg=<0x6f>;
			};
		};

2、因为mcp7941用到的驱动是rtc-ds1307,所以内核还要添加配置
Device Drivers->Real Time Clock->Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025, ISL12057
3、烧写程序后ls /dev 就会出现rtc rtc0
4、假如设置系统时间为2007年10月2日,13:49分,可以这样设置
date 100213492007
hwclock –w
如果想读出来可以运行hwclock –r

你可能感兴趣的:(ZYNQ,linux)