All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann Dirson" <yann.dirson@blade-group.com>
To: yocto@yoctoproject.org
Cc: twoerner@gmail.com, Yann Dirson <yann@blade-group.com>
Subject: [meta-rockchip][PATCH v7 1/6] linux-yocto: add an initial NanoPi-M4 BSP
Date: Mon, 17 May 2021 14:19:33 +0200	[thread overview]
Message-ID: <20210517121938.207004-2-yann@blade-group.com> (raw)
In-Reply-To: <20210517121938.207004-1-yann@blade-group.com>

From: Yann Dirson <yann@blade-group.com>

This patch provides "standard" and "tiny" BSP.

There is still much work to be done in dispatching feature to individual
scc files - the more boards we can support the better it will get.
Not all SoC/board features are covered yet either (esp. Wifi/Bluetooth and
audio jack), and properly-woking HDMI still needs patches.

Tiny is not fully testable by itself, it can be minimally booted with
serial console (though still missing CONFIG_MULTIUSER for serial getty,
and CONFIG_INOTIFY_USER for proper udev operation) using:

 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
 KERNEL_FEATURES_append = "\
  ktypes/base/base.scc \
  features/debug/printk.scc \
  cfg/fs/ext4.scc \
  cfg/8250.scc \
 "

Such a tiny build is still using mainline defconfig with lots of hardware
features, and the kernel can be slimmed down even more by using:

 KBUILD_DEFCONFIG = ""

Kernel weight using default configurations:
- standard                11MB
- tiny                     5MB
- tiny with no defconfig   2.5MB

Signed-off-by: Yann Dirson <yann@blade-group.com>
---
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  8 +++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  8 +++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 11 +++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 70 +++++++++++++++++++
 .../linux/files/bsp/rockchip/rk3399.scc       |  5 ++
 .../linux/files/bsp/rockchip/rockchip.cfg     | 50 +++++++++++++
 .../linux/files/bsp/rockchip/rockchip.scc     |  6 ++
 recipes-kernel/linux/linux-yocto%.bbappend    |  6 ++
 9 files changed, 169 insertions(+)
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/rk3399.scc
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg
 create mode 100644 recipes-kernel/linux/files/bsp/rockchip/rockchip.scc

diff --git a/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc
new file mode 100644
index 0000000..7d28b2b
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE standard
+define KARCH arm
+define KMETA_EXTERNAL_BSP t
+
+include ktypes/standard/standard.scc nopatch
+include nanopi-m4.scc
diff --git a/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc
new file mode 100644
index 0000000..fe1f5b8
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE tiny
+define KARCH arm
+define KMETA_EXTERNAL_BSP t
+
+include ktypes/tiny/tiny.scc nopatch
+include nanopi-m4.scc
diff --git a/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg
new file mode 100644
index 0000000..f3a2abf
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg
@@ -0,0 +1,11 @@
+CONFIG_MFD_RK808=y
+CONFIG_COMMON_CLK_RK808=y
+
+CONFIG_REGULATOR_RK808=y
+CONFIG_REGULATOR_FAN53555=y
+
+CONFIG_MMC_BLOCK=y
+CONFIG_PWRSEQ_SIMPLE=y
+
+# RTL8211E
+CONFIG_REALTEK_PHY=m
diff --git a/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc
new file mode 100644
index 0000000..f4267aa
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware nanopi-m4.cfg
+
+include rk3399.scc
diff --git a/recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg b/recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg
new file mode 100644
index 0000000..42adfd1
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg
@@ -0,0 +1,70 @@
+# A72 errata, all past revisions
+CONFIG_ARM64_ERRATUM_1319367=y
+# A53 errata, all patched on boot when needed
+CONFIG_ARM64_ERRATUM_826319=y
+CONFIG_ARM64_ERRATUM_827319=y
+CONFIG_ARM64_ERRATUM_824069=y
+CONFIG_ARM64_ERRATUM_819472=y
+
+# cru
+CONFIG_CLK_RK3399=y
+
+CONFIG_PL330_DMA=y
+CONFIG_I2C_RK3X=y
+CONFIG_SERIAL_8250_DW=y
+
+# usb
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_TYPEC=y
+
+# ethernet
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=m
+CONFIG_STMMAC_PLATFORM=m
+CONFIG_DWMAC_ROCKCHIP=m
+CONFIG_PHYLIB=m
+
+# display
+CONFIG_ROCKCHIP_DW_HDMI=y
+CONFIG_ROCKCHIP_DW_MIPI_DSI=y
+CONFIG_ROCKCHIP_ANALOGIX_DP=y
+CONFIG_ROCKCHIP_CDN_DP=y
+CONFIG_PHY_ROCKCHIP_DP=y
+CONFIG_DRM_DW_HDMI=m
+CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
+CONFIG_DRM_DW_HDMI_CEC=m
+CONFIG_DRM_DW_MIPI_DSI=m
+CONFIG_DRM_PANFROST=m
+
+# HDMI audio
+CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
+
+CONFIG_VIDEO_DEV=m
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_ROCKCHIP_RGA=m
+
+CONFIG_V4L2_H264=m
+CONFIG_MEDIA_CONTROLLER_REQUEST_API=y
+CONFIG_VIDEO_HANTRO=m
+CONFIG_VIDEO_HANTRO_ROCKCHIP=y
+CONFIG_VIDEO_ROCKCHIP_VDEC=m
+
+# usb
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_DUAL_ROLE=y
+
+# sd/mmc
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI_OF_ARASAN=y
+
+# temperature sensors
+CONFIG_THERMAL=y
+CONFIG_THERMAL_OF=y
+CONFIG_ROCKCHIP_THERMAL=m
+CONFIG_IIO=y
+CONFIG_ROCKCHIP_SARADC=m
diff --git a/recipes-kernel/linux/files/bsp/rockchip/rk3399.scc b/recipes-kernel/linux/files/bsp/rockchip/rk3399.scc
new file mode 100644
index 0000000..9b1a88e
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/rk3399.scc
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rk3399.cfg
+
+include rockchip.scc
diff --git a/recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg b/recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg
new file mode 100644
index 0000000..05a397d
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg
@@ -0,0 +1,50 @@
+CONFIG_CPU_ISOLATION=y
+CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
+CONFIG_HZ_250=y
+CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
+
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_COMMON_CLK_ROCKCHIP=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_I2C=y
+CONFIG_FW_LOADER=y
+CONFIG_PHY_ROCKCHIP_EMMC=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_ROCKCHIP=y
+CONFIG_ROCKCHIP_IODOMAIN=y
+CONFIG_ROCKCHIP_PM_DOMAINS=y
+
+CONFIG_SPI=y
+CONFIG_SPI_ROCKCHIP=m
+
+CONFIG_PWM=y
+CONFIG_PWM_ROCKCHIP=y
+
+CONFIG_DRM_KMS_HELPER=m
+CONFIG_DRM_FBDEV_EMULATION=y
+CONFIG_ROCKCHIP_IOMMU=y
+CONFIG_DRM_ROCKCHIP=m
+CONFIG_DRM_BRIDGE=y
+
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_HDA_CODEC_HDMI=m
+CONFIG_SND_SOC_ROCKCHIP=m
+CONFIG_SND_SOC_ROCKCHIP_I2S=m
+CONFIG_SND_SOC_ROCKCHIP_SPDIF=m
+
+CONFIG_NVMEM=y
+CONFIG_ROCKCHIP_EFUSE=m
+
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_THERMAL=y
+CONFIG_HWMON=y
+CONFIG_THERMAL_HWMON=y
+
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_ROCKCHIP=m
+
+CONFIG_MMC_BLOCK_MINORS=32
diff --git a/recipes-kernel/linux/files/bsp/rockchip/rockchip.scc b/recipes-kernel/linux/files/bsp/rockchip/rockchip.scc
new file mode 100644
index 0000000..800f105
--- /dev/null
+++ b/recipes-kernel/linux/files/bsp/rockchip/rockchip.scc
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rockchip.cfg
+
+include cfg/dmaengine.scc
+include features/mmc/mmc-block.cfg
diff --git a/recipes-kernel/linux/linux-yocto%.bbappend b/recipes-kernel/linux/linux-yocto%.bbappend
index 7702e3f..9658681 100644
--- a/recipes-kernel/linux/linux-yocto%.bbappend
+++ b/recipes-kernel/linux/linux-yocto%.bbappend
@@ -1,3 +1,9 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append = "\
+ file://bsp;type=kmeta;subdir=kernel-meta \
+"
+
 COMPATIBLE_MACHINE_marsboard-rk3066 = "marsboard-rk3066"
 COMPATIBLE_MACHINE_rock2-square = "rock2-square"
 COMPATIBLE_MACHINE_radxarock = "radxarock"
-- 
2.30.2


  reply	other threads:[~2021-05-17 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 12:19 [meta-rockchip][PATCH v7 0/6] kmeta BSP for nanopi-m4 Yann Dirson
2021-05-17 12:19 ` Yann Dirson [this message]
2021-05-17 12:19 ` [meta-rockchip][PATCH v7 2/6] linux-yocto: add workaround to disable VOPL usage on HDMI Yann Dirson
2021-05-17 12:19 ` [meta-rockchip][PATCH v7 3/6] linux-firmware: import variables file for ap4356s firmware from armbian Yann Dirson
2021-05-17 12:19 ` [meta-rockchip][PATCH v7 4/6] NanoPi-M4: activate Wifi support Yann Dirson
2021-05-17 12:19 ` [meta-rockchip][PATCH v7 5/6] WIP Import rkwifibt-firmware from vendor's meta-rockchip Yann Dirson
2021-05-17 12:19 ` [meta-rockchip][PATCH v7 6/6] WIP NanoPi-M4: activate BT support Yann Dirson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210517121938.207004-2-yann@blade-group.com \
    --to=yann.dirson@blade-group.com \
    --cc=twoerner@gmail.com \
    --cc=yann@blade-group.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.