kernel-5.15/0621-baikal_clk-compatibility-with-SDK-M-5.1-firmware.patch
Mikhail Novosyolov 839b6a86b6 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:35:50 +03:00

38 lines
1.2 KiB
Diff

From 3a2d37d8f2aacdd8711f0f90a4c04d75eccd7a1f Mon Sep 17 00:00:00 2001
From: Alexey Sheplyakov <asheplyakov@altlinux.org>
Date: Fri, 19 Feb 2021 12:38:34 +0400
Subject: [PATCH 621/625] baikal_clk: compatibility with SDK-M 5.1 firmware
Without this patch the kernel seems to locks up within 10 -- 20 seconds
after the boot on a board with firmware from SDK-M 5.1
baikal_clk_set_rate: fixed parent rate calculation (from SDK-M 4.4)
---
drivers/clk/baikal/clk-baikal.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/baikal/clk-baikal.c b/drivers/clk/baikal/clk-baikal.c
index ddf1d328eeaf..d9709322b2ee 100644
--- a/drivers/clk/baikal/clk-baikal.c
+++ b/drivers/clk/baikal/clk-baikal.c
@@ -181,11 +181,15 @@ static int baikal_clk_set_rate(struct clk_hw *hw, unsigned long rate,
struct arm_smccc_res res;
struct baikal_clk_cmu *pclk = to_baikal_cmu(hw);
uint32_t cmd;
+ unsigned long parent;
- if (pclk->is_clk_ch)
+ if (pclk->is_clk_ch) {
cmd = CMU_CLK_CH_SET_RATE;
- else
+ parent = pclk->parent;
+ } else {
cmd = CMU_PLL_SET_RATE;
+ parent = parent_rate;
+ }
pr_debug("[%s, %x:%d:%s] %s, %ld\n",
pclk->name,
--
2.31.1