[4/4] initscripts: load RTC module (RX8025) for Ten64 board

Message ID 20221003062019.19636-5-matt@traverse.com.au
State Accepted
Commit 9745a212d4aff2b9cd50de34e30c79c624d21b3c
Headers
Series kernel: aarch64: Add support for Traverse Ten64 board |

Commit Message

Mathew McBride Oct. 3, 2022, 6:20 a.m. UTC
  For reasons I have not been able to determine, the RTC
module for the Ten64 board (rtc-rx8025) is not automatically
loaded at startup, despite every other relevant modules being
loaded.

modprobe it manually if we are on a Ten64 board.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
---
 src/initscripts/system/setclock | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Michael Tremer Oct. 4, 2022, 8:57 a.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 3 Oct 2022, at 07:20, Mathew McBride <matt@traverse.com.au> wrote:
> 
> For reasons I have not been able to determine, the RTC
> module for the Ten64 board (rtc-rx8025) is not automatically
> loaded at startup, despite every other relevant modules being
> loaded.
> 
> modprobe it manually if we are on a Ten64 board.
> 
> Signed-off-by: Mathew McBride <matt@traverse.com.au>
> ---
> src/initscripts/system/setclock | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/src/initscripts/system/setclock b/src/initscripts/system/setclock
> index b566eb716..963507f9a 100644
> --- a/src/initscripts/system/setclock
> +++ b/src/initscripts/system/setclock
> @@ -29,6 +29,14 @@ case ${1} in
> 
> 		boot_mesg "Setting system clock..."
> 
> +		FDT_COMPAT_FILE="/sys/firmware/devicetree/base/compatible"
> +		# RTC may not be automatically loaded on some
> +		# non-x86 machines
> +		if [ -f "${FDT_COMPAT_FILE}" ] && \
> +			( grep -q "traverse,ten64" "${FDT_COMPAT_FILE}" ); then
> +			modprobe rtc-rx8025
> +		fi
> +
> 		# udev not create the rtc symlink if rtc is in the kernel
> 		if [ ! -e /dev/rtc ]; then
> 			if [ -e /dev/rtc0 ]; then
> -- 
> 2.30.1
>
  

Patch

diff --git a/src/initscripts/system/setclock b/src/initscripts/system/setclock
index b566eb716..963507f9a 100644
--- a/src/initscripts/system/setclock
+++ b/src/initscripts/system/setclock
@@ -29,6 +29,14 @@  case ${1} in
 
 		boot_mesg "Setting system clock..."
 
+		FDT_COMPAT_FILE="/sys/firmware/devicetree/base/compatible"
+		# RTC may not be automatically loaded on some
+		# non-x86 machines
+		if [ -f "${FDT_COMPAT_FILE}" ] && \
+			( grep -q "traverse,ten64" "${FDT_COMPAT_FILE}" ); then
+			modprobe rtc-rx8025
+		fi
+
 		# udev not create the rtc symlink if rtc is in the kernel
 		if [ ! -e /dev/rtc ]; then
 			if [ -e /dev/rtc0 ]; then