kernel-5.15/0603-efi-rtc-avoid-calling-efi.get_time-on-Baikal-M-board.patch

45 lines
1.3 KiB
Diff
Raw Normal View History

Add support of Baikal-M SoCs Information about config values was taken from: From 804820df7bcb3d53a33ecd074b1eac277e938f24 Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov <asheplyakov@altlinux.org> Date: Thu, 4 Feb 2021 19:35:14 +0400 Subject: [PATCH] config-aarch64: adjusted for Baikal-M (MBM1.0 board) * DW_APB_TIMER=y, DW_APB_TIMER_OF=y: SoC clocks * SERIAL_8250_DW=y: serial console * I2C_DESIGNWARE_CORE=y, I2C_DESIGNWARE_PLATFORM=y: BMC (board management controller) and RTC (Real Time Clock) are connected via I2C. * GPIO_DWAPB=y: device (PCIe, PHY, etc) reset/configuration * RTC_DRV_PCF2127=y: RTC compiled in so the kernel automatically sets the system time from the hardware clock * TP_BMC=y: amongst other things handles the power button * DRM_BAIKAL_VDU=m, DRM_BAIKAL_HDMI=m: video unit and HDMI transmitter * CMA_SIZE_MBYTES=256: video display unit and GPU use system RAM, hence CMA should reserve enough (contiguous) memory. Note: CMA reserves memory during very early init, hence the size has to be hard-coded into CONFIG * MALI_MIDGARD=m: GPU driver, kernel side of proprietary mali blob. Note: kernel mode code is GPLv2, so it's fine to distribute it. * SENSORS_BT1_PVT=m: hardware temperature/voltage sensors * PCI_BAIKAL=m: PCIe root complex. Compiled as a module since takes ages (60 seconds or so) to probe the hardware. If compiled in substantially increases the boot time, and machine is completely unresponsive during probing PCIe. When built as a module probing executes concurrently with other boot activities (unless booting from a PCIe device) * STMMAC_ETH=m, STMMAC_PLATFORM=m, DWMAC_BAIKAL=m: Ethernet driver
2021-06-22 16:12:03 +03:00
From 7b165ef3f844bd6a7f6edb195ba03e33291f0f8d Mon Sep 17 00:00:00 2001
From: Alexey Sheplyakov <asheplyakov@altlinux.org>
Date: Thu, 8 Oct 2020 18:31:28 +0400
Subject: [PATCH 603/625] efi-rtc: avoid calling efi.get_time on Baikal-M
boards
UEFI does NOT provide get_time at the runtime, hence calling it results
in an Oops.
(cherry picked from commit 57a5898a6f7e7c80999cb844ed2f0394b38afcbe)
---
drivers/rtc/rtc-efi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index edb64debd173..895bb07a7006 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -17,6 +17,7 @@
#include <linux/platform_device.h>
#include <linux/rtc.h>
#include <linux/efi.h>
+#include <linux/of.h>
#define EFI_ISDST (EFI_TIME_ADJUST_DAYLIGHT|EFI_TIME_IN_DAYLIGHT)
@@ -257,6 +258,14 @@ static int __init efi_rtc_probe(struct platform_device *dev)
efi_time_t eft;
efi_time_cap_t cap;
+#ifdef CONFIG_OF
+ /* efi.get_time is not always safe to call since some UEFI
+ * implementations do not privde get_time at runtime. */
+ if (of_device_is_compatible(of_root, "baikal,baikal-m")) {
+ dev_err(&dev->dev, "Baikal-M UEFI has no get_time\n");
+ return -ENODEV;
+ }
+#endif
/* First check if the RTC is usable */
if (efi.get_time(&eft, &cap) != EFI_SUCCESS)
return -ENODEV;
--
2.31.1