From 29e92f42312fb89402af43a9d7b5dd70c7c2a0c8 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 17 Nov 2020 10:49:01 +0100 Subject: [PATCH] Add on-board RTC support for ODROID-N2+ (#999) Make the NXP PCF8563TS on-board RTC the primary RTC of the system. --- .../board/hardkernel/kernel-amlogic.config | 2 +- ...ts-meson-add-RTC-to-ODROID-N2-boards.patch | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-add-RTC-to-ODROID-N2-boards.patch diff --git a/buildroot-external/board/hardkernel/kernel-amlogic.config b/buildroot-external/board/hardkernel/kernel-amlogic.config index 742b6a24e..1aac72e9e 100644 --- a/buildroot-external/board/hardkernel/kernel-amlogic.config +++ b/buildroot-external/board/hardkernel/kernel-amlogic.config @@ -4954,7 +4954,7 @@ CONFIG_RTC_DRV_RK808=m # CONFIG_RTC_DRV_PCF8523 is not set # CONFIG_RTC_DRV_PCF85063 is not set # CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set +CONFIG_RTC_DRV_PCF8563=y # CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_M41T80 is not set # CONFIG_RTC_DRV_BQ32K is not set diff --git a/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-add-RTC-to-ODROID-N2-boards.patch b/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-add-RTC-to-ODROID-N2-boards.patch new file mode 100644 index 000000000..8ac092b52 --- /dev/null +++ b/buildroot-external/board/hardkernel/patches/linux/0008-arm64-dts-meson-add-RTC-to-ODROID-N2-boards.patch @@ -0,0 +1,52 @@ +From 75b8900d6750fa9d44546219a9b925c5df73a985 Mon Sep 17 00:00:00 2001 +Message-Id: <75b8900d6750fa9d44546219a9b925c5df73a985.1605564817.git.stefan@agner.ch> +In-Reply-To: <734f52f38625ce29c964517255538b3b0b546e8d.1605564817.git.stefan@agner.ch> +References: <734f52f38625ce29c964517255538b3b0b546e8d.1605564817.git.stefan@agner.ch> +From: Stefan Agner +Date: Mon, 16 Nov 2020 23:11:02 +0100 +Subject: [PATCH 8/8] arm64: dts: meson: add RTC to ODROID-N2 boards + +All ODROID-N2 boards come with a NXP PCF8563TS RTC connected to I2C bus +3. This is the RTC which is connected to the on-board RTC backup battery. +Use it as primary RTC. + +Signed-off-by: Stefan Agner +--- + .../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +index 6982632ae646..40390feba053 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +@@ -13,6 +13,8 @@ / { + aliases { + serial0 = &uart_AO; + ethernet0 = ðmac; ++ rtc0 = &board_rtc; ++ rtc1 = &vrtc; + }; + + dioo2133: audio-amplifier-0 { +@@ -471,6 +473,18 @@ hdmi_tx_tmds_out: endpoint { + }; + }; + ++&i2c3 { ++ status = "okay"; ++ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; ++ pinctrl-names = "default"; ++ clock-frequency = <400000>; ++ ++ board_rtc: rtc@51 { ++ compatible = "nxp,pcf8563"; ++ reg = <0x51>; ++ }; ++}; ++ + &ir { + status = "okay"; + pinctrl-0 = <&remote_input_ao_pins>; +-- +2.29.2 +