Hi Josh,
I use maaxboard board (not mini, not nano)
the M41T93 spi rtc works well in kernel 4.14(yocto sumo branch) , I showed here before: Enable the SPI port on MaaxBoard?
but
I need to add M41T93 spi rtc chip in yocto zeus branch(kernel 5.4),but I find the maaxboard-extended-gpio.dtsi is different with maaxboard-nano-extended-gpio.dtsi.
the maaxboard-extended-gpio.dtsi file still keeps the gpio for old settings , I thought the zeus did not support maaxboard now, so I need to modify it similar to maaxboard-nano-extended-gpio.dtsi.
so I change the ecspi part as the below patch file(see attached file,001-spi-real-time-M41T93.patch, I change kernel config,I can find the /dev/rtc0, I removed snvs_rtc),but unfortunately the spi rtc still not work!
How to change the dtsi in kerenel 5.4? I think maaxboard nano work well, I just follow it to modify maaxboard .dtsi file similiarly . the spi rtc should work.
Thank you very much.
my full patch file:
diff -Naur ori/arch/arm64/boot/dts/freescale/imx8mq.dtsi patches/arch/arm64/boot/dts/freescale/imx8mq.dtsi
--- ori/arch/arm64/boot/dts/freescale/imx8mq.dtsi 2021-04-15 12:55:28.039009295 -0400
+++ patches/arch/arm64/boot/dts/freescale/imx8mq.dtsi 2021-04-15 16:33:48.243133485 -0400
@@ -591,15 +591,6 @@
compatible = "fsl,sec-v4.0-mon", "syscon", "simple-mfd";
reg = <0x30370000 0x10000>;
- snvs_rtc: snvs-rtc-lp{
- compatible = "fsl,sec-v4.0-mon-rtc-lp";
- regmap =<&snvs>;
- offset = <0x34>;
- interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk IMX8MQ_CLK_SNVS_ROOT>;
- clock-names = "snvs-rtc";
- };
snvs_pwrkey: snvs-powerkey {
compatible = "fsl,sec-v4.0-pwrkey";
@@ -832,7 +823,7 @@
clocks = <&clk IMX8MQ_CLK_ECSPI1_ROOT>,
<&clk IMX8MQ_CLK_ECSPI1_ROOT>;
clock-names = "ipg", "per";
- status = "disabled";
+ status = "enabled";
};
ecspi2: spi@30830000 {
diff -Naur ori/arch/arm64/boot/dts/freescale/maaxboard-extended-gpio.dtsi patches/arch/arm64/boot/dts/freescale/maaxboard-extended-gpio.dtsi
--- ori/arch/arm64/boot/dts/freescale/maaxboard-extended-gpio.dtsi 2021-04-08 14:58:09.820015901 -0400
+++ patches/arch/arm64/boot/dts/freescale/maaxboard-extended-gpio.dtsi 2021-04-19 13:57:18.993139208 -0400
@@ -37,10 +37,15 @@
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
- MX8MQ_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x16
- MX8MQ_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI 0x16
- MX8MQ_IOMUXC_ECSPI1_MISO_ECSPI1_MISO 0x16
- MX8MQ_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK 0x1816
+ MX8MQ_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI 0x82
+ MX8MQ_IOMUXC_ECSPI1_MISO_ECSPI1_MISO 0x82
+ MX8MQ_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK 0x82
+ >;
+ };
+
+ pinctrl_ecspi1_cs: ecspi1cs {
+ fsl,pins = <
+ MX8MQ_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x40000
>;
};
@@ -90,10 +95,19 @@
&ecspi1{
fsl,spi-num-chipselects = < 1 >;
- cs-gpios = <&gpio5 13 0 > ;
+ cs-gpios = <&gpio5 9 0 > ;
pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_ecspi1 >;
+ pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
status = "okay";
+ #address-cells=<1>;
+ #size-cells=<0>;
+ rtc@0x00{
+ #address-cellss=<1>;
+ #size-cells=<1>;
+ compatible = "rtc-m41t93";
+ spi-max-frequency = <5000000>;
+ reg = <0>;
+ };
};
&i2c2 {
73,1 Bot