Dear all,
Finally I got around to checking out the Torizon rev 6 (which is Linux 5.15), and the RV-3028 driver is now updated with lots of features, and completely built into the kernel. Life is a lot easier than before, there is no need to get Torizoncore builder to install a module or tool chain.
So here is an example overlay for the rv3028
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,colibri-imx8x";
};
&i2c1 {
status = "okay";
rtc_i2c: rv3028@52 {
compatible = "microcrystal,rv3028";
reg = <0x52>;
status = "okay";
/* pinctrl-0 = <&rtc_nint_pins>; commented out - not for our board
interrupts-extended = <&gpio1 XX GPIO_ACTIVE_HIGH>; */
trickle-resistor-ohms = <3000>;
};
};
/* This is for the interrupt pin, not wired up on our board
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog0>, <&pinctrl_hog1>, <&pinctrl_hog2>,
<&pinctrl_ext_io0>, <&pinctrl_lpspi2_cs2>;
colibri-imx8qxp {
pinctrl_pwroff: pwroff {
fsl,pins = <
IMX8QXP_QSPI0B_X 0x20 /* SODIMM X */
>;
};
};
};
*/
This was tested with a Torizoncore builder build process with the following YAML file
input:
easy-installer:
local: images/torizon-core-docker-colibri-imx8x-Tezi_6.3.0+build.4.tar
customization:
splash-screen: splash/splash.png
device-tree:
include-dirs:
- linux/include
custom: linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dts
overlays:
clear: true
add:
# Assign the RTC to the I2C-17
- custom_overlays/real_time_clock_rv_3028.dts
# Enable the parallel RGB interface on Colibri iMX8X.
- device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts
output:
easy-installer:
local: images/torizon-core-docker-colibri-imx8x-Tezi_6.3.0-HBL
name: "Torizon HBL CoaguScan"
description: "Custom Linux OS rev5.15"
The system was booted up and the message log was examined.
torizon@colibri-imx8x-07021234:~$ dmesg | grep rv3028
[ 7.887776] rtc-rv3028 1-0052: registered as rtc0
A bit more of a proper test. We set the clock, show the clock and see what the device did.
torizon@colibri-imx8x-07021199:~$ sudo hwclock --systohc
torizon@colibri-imx8x-07021199:~$ sudo hwclock --show
2023-09-30 17:25:31.964454+00:00
torizon@colibri-imx8x-07021199:~$ sudo hwclock --show --verbose
hwclock from util-linux 2.37.4
System Time: 1696094746.703475
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1696094723 seconds after 1969
Last calibration done at 1696094723 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2023/09/30 17:25:47
Hw clock time : 2023/09/30 17:25:47 = 1696094747 seconds since 1969
Time since last adjustment is 24 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2023-09-30 17:25:46.699795+00:00
torizon@colibri-imx8x-07021199:~$
All good. Now for a nice lay down.
Yours Truly
Fat Linux