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
|
|
|
Subject: [PATCH 609/625] Baikal-M: video unit driver
|
|
|
|
|
2022-03-17 10:23:10 +03:00
|
|
|
Update for 5.15.28
|
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
|
|
|
|
|
|
|
diff --git a/drivers/gpu/drm/baikal/baikal_vdu_encoder.c b/drivers/gpu/drm/baikal/baikal_vdu_encoder.c
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/drivers/gpu/drm/baikal/baikal_vdu_encoder.c
|
|
|
|
@@ -0,0 +1,51 @@
|
|
|
|
+/*
|
|
|
|
+ * Copyright (C) 2019-2020 Baikal Electronics JSC
|
|
|
|
+ *
|
|
|
|
+ * Author: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
|
|
|
|
+ *
|
|
|
|
+ * Parts of this file were based on sources as follows:
|
|
|
|
+ *
|
|
|
|
+ * Copyright (c) 2006-2008 Intel Corporation
|
|
|
|
+ * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
|
|
|
|
+ * Copyright (C) 2011 Texas Instruments
|
|
|
|
+ * (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
|
|
|
|
+ *
|
|
|
|
+ * This program is free software and is provided to you under the terms of the
|
|
|
|
+ * GNU General Public License version 2 as published by the Free Software
|
|
|
|
+ * Foundation, and any use by you of this program is subject to the terms of
|
|
|
|
+ * such GNU licence.
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * baikal_vdu_encoder.c
|
|
|
|
+ * Implementation of the encoder functions for Baikal Electronics BE-M1000 VDU driver
|
|
|
|
+ */
|
|
|
|
+#include <linux/version.h>
|
|
|
|
+#include <linux/shmem_fs.h>
|
|
|
|
+#include <linux/dma-buf.h>
|
|
|
|
+
|
|
|
|
+#include <drm/drm_crtc_helper.h>
|
|
|
|
+
|
|
|
|
+#include "baikal_vdu_drm.h"
|
|
|
|
+
|
|
|
|
+const struct drm_encoder_funcs baikal_vdu_encoder_funcs = {
|
|
|
|
+ .destroy = drm_encoder_cleanup,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+int baikal_vdu_encoder_init(struct drm_device *dev)
|
|
|
|
+{
|
|
|
|
+ struct baikal_vdu_private *priv = dev->dev_private;
|
|
|
|
+ struct drm_encoder *encoder = &priv->encoder;
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ ret = drm_encoder_init(dev, encoder, &baikal_vdu_encoder_funcs,
|
|
|
|
+ DRM_MODE_ENCODER_NONE, NULL);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+
|
|
|
|
+ encoder->crtc = &priv->crtc;
|
|
|
|
+ encoder->possible_crtcs = BIT(drm_crtc_index(encoder->crtc));
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
diff --git a/drivers/gpu/drm/baikal/baikal_vdu_gem.c b/drivers/gpu/drm/baikal/baikal_vdu_gem.c
|
|
|
|
new file mode 100644
|
|
|
|
index 000000000000..b07566caf12c
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/drivers/gpu/drm/baikal/baikal_vdu_gem.c
|
|
|
|
@@ -0,0 +1,37 @@
|
|
|
|
+/*
|
|
|
|
+ * Copyright (C) 2019-2020 Baikal Electronics JSC
|
|
|
|
+ *
|
|
|
|
+ * Author: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
|
|
|
|
+ *
|
|
|
|
+ * Parts of this file were based on sources as follows:
|
|
|
|
+ *
|
|
|
|
+ * Copyright (c) 2006-2008 Intel Corporation
|
|
|
|
+ * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
|
|
|
|
+ * Copyright (C) 2011 Texas Instruments
|
|
|
|
+ * (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
|
|
|
|
+ *
|
|
|
|
+ * This program is free software and is provided to you under the terms of the
|
|
|
|
+ * GNU General Public License version 2 as published by the Free Software
|
|
|
|
+ * Foundation, and any use by you of this program is subject to the terms of
|
|
|
|
+ * such GNU licence.
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * baikal_vdu_gem.c
|
|
|
|
+ * Implementation of the GEM functions for Baikal Electronics BE-M1000 VDU driver
|
|
|
|
+ */
|
|
|
|
+#include <linux/version.h>
|
|
|
|
+#include <linux/shmem_fs.h>
|
|
|
|
+#include <linux/dma-buf.h>
|
|
|
|
+#include <drm/drm_crtc_helper.h>
|
|
|
|
+#include <drm/drm_gem_cma_helper.h>
|
|
|
|
+#include "baikal_vdu_drm.h"
|
|
|
|
+
|
|
|
|
+int baikal_vdu_dumb_create(struct drm_file *file_priv,
|
|
|
|
+ struct drm_device *dev, struct drm_mode_create_dumb *args)
|
|
|
|
+{
|
|
|
|
+ args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
|
|
|
|
+
|
|
|
|
+ return drm_gem_cma_dumb_create_internal(file_priv, dev, args);
|
|
|
|
+}
|