Skip to contentSkip to conversation

kmeta BSP for nanopi-m4

PATCH Applied Yann Dirson 2 participants 9 messages Apr 26, 2021 – May 4, 2021 Arm Rockchip

v4 of 7 Applied Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover kmeta BSP for nanopi-m4

From: Yann Dirson <[email protected]>

Changes in v4:
- install our bsp files in bsp/rockchip/ rather than directly in bsp/
- also add "serial" to MACHINE_FEATURES

Changes in v3:
- relocate the bsp files into files/ so we don't have to add linux-yocto/ to FILESEXTRAPATHS for all other kernels
- removed the "don't force KCONFIG_MODE to alldefconfig" (not needed finally, and causing interferences in default setup)
- add "usbhost" to MACHINE_FEATURES to enable lsusb and friends
- better hardware coverage (though still no wifi/bt/audio, and buggy hdmi)

The Wifi/BT support requires firmware, to be properly packaged; BT support itself is still buggy in mainline; audio jack requires a couple of patches; HDMI requires at the very least a DTS patch, and LibreELEC maintains a "latest and greatest" DRM patchset, but it can conflicts with some patches in default kmeta.

Yann Dirson (3):
NanoPi-M4: let all variants use the same KMACHINE type
NanoPi-M4: declare "usbhost" and "serial" in MACHINE_FEATURES
linux-yocto: add an initial NanoPi-M4 BSP

 conf/machine/include/nanopi-m4.inc            |  3 +
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  7 ++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  7 ++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 15 ++++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 71 +++++++++++++++++++
 .../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 ++
 10 files changed, 175 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
Signature · 1 line
2.30.2
#1 lore raw

PATCH v4 1/3 NanoPi-M4: let all variants use the same KMACHINE type

From: Yann Dirson <[email protected]>

This will allow us to define a single set of kernel BSP for all variants of the board (which only need to differ in u-boot dts).

---
 conf/machine/include/nanopi-m4.inc | 1 +
 1 file changed, 1 insertion(+)
conf/machine/include/nanopi-m4.inc +1 -0
index 74cdae8..603160f 100644
@@ -3,6 +3,7 @@
 
 require rk3399.inc
 
+KMACHINE = "nanopi-m4"
 KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-m4.dtb"
 
 RK_BOOT_DEVICE = "mmcblk1"
Signature · 1 line
2.30.2
#2 lore raw

Re: [meta-rockchip][PATCH v4 1/3] NanoPi-M4: let all variants use the same KMACHINE type

Quoted 6 lines · On Mon 2021-04-26 @ 04:58:08 PM, [email protected] wrote:

From: Yann Dirson <[email protected]>

This will allow us to define a single set of kernel BSP for all variants of the board (which only need to differ in u-boot dts).

applied to master, thanks!

#3 lore raw

PATCH v4 2/3 NanoPi-M4: declare "usbhost" and "serial" in MACHINE_FEATURES

In reply to Yann Dirson

From: Yann Dirson <[email protected]>

---
 conf/machine/include/nanopi-m4.inc | 2 ++
 1 file changed, 2 insertions(+)
conf/machine/include/nanopi-m4.inc +2 -0
index 603160f..a14b705 100644
@@ -3,6 +3,8 @@
 
 require rk3399.inc
 
+MACHINE_FEATURES += "usbhost serial"
+
 KMACHINE = "nanopi-m4"
 KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-m4.dtb"
 
Signature · 1 line
2.30.2
#5 lore raw

PATCH v4 3/3 linux-yocto: add an initial NanoPi-M4 BSP

In reply to Yann Dirson

From: Yann Dirson <[email protected]>

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

---
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  7 ++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  7 ++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 15 ++++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 71 +++++++++++++++++++
 .../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, 172 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
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc new file +7 -0
new file mode 100644
index 0000000..5c74d6b
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard/standard.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc new file +7 -0
new file mode 100644
index 0000000..6e94d6a
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE tiny
+define KARCH arm
+
+include ktypes/tiny/tiny.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +15 -0
new file mode 100644
index 0000000..7802ab3
@@ -0,0 +1,15 @@
+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
+
+# AP6356S
+CONFIG_BT_BCM=m
+CONFIG_BT_HCIUART_BCM=y
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc new file +5 -0
new file mode 100644
index 0000000..f4267aa
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware nanopi-m4.cfg
+
+include rk3399.scc
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +71 -0

71 lines not on this page · raw message

recipes-kernel/linux/files/bsp/rockchip/rk3399.scc new file +5 -0
new file mode 100644
index 0000000..9b1a88e
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rk3399.cfg
+
+include rockchip.scc
recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg new file +50 -0

50 lines not on this page · raw message

recipes-kernel/linux/files/bsp/rockchip/rockchip.scc new file +6 -0
new file mode 100644
index 0000000..800f105
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rockchip.cfg
+
+include cfg/dmaengine.scc
+include features/mmc/mmc-block.cfg
recipes-kernel/linux/linux-yocto%.bbappend +6 -0
index 7702e3f..9658681 100644
@@ -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"
Signature · 1 line
2.30.2
#6 lore raw

Re: [meta-rockchip][PATCH v4 3/3] linux-yocto: add an initial NanoPi-M4 BSP

Quoted 89 lines · On Mon 2021-04-26 @ 04:58:10 PM, [email protected] wrote:

From: Yann Dirson <[email protected]>

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

---
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  7 ++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  7 ++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 15 ++++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 71 +++++++++++++++++++
 .../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, 172 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
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc new file +7 -0
new file mode 100644
index 0000000..5c74d6b
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard/standard.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc new file +7 -0
new file mode 100644
index 0000000..6e94d6a
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE tiny
+define KARCH arm
+
+include ktypes/tiny/tiny.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +5 -0
new file mode 100644
index 0000000..7802ab3
@@ -0,0 +1,15 @@
+CONFIG_MFD_RK808=y
+CONFIG_COMMON_CLK_RK808=y
+
+CONFIG_REGULATOR_RK808=y
+CONFIG_REGULATOR_FAN53555=y

recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg line 15

Quoted 10 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +10 -0
+
+CONFIG_MMC_BLOCK=y
+CONFIG_PWRSEQ_SIMPLE=y
+
+# RTL8211E
+CONFIG_REALTEK_PHY=m
+
+# AP6356S
+CONFIG_BT_BCM=m
+CONFIG_BT_HCIUART_BCM=y

It looks to me as though the BRCMFMAC kernel config option needs to be enabled to support the AP6256S? I don't see that being enabled, does it end up being pulled in by default or as a result of the above two settings?

Quoted 48 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc new file +5 -0
new file mode 100644
index 0000000..f4267aa
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware nanopi-m4.cfg
+
+include rk3399.scc
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +31 -0
new file mode 100644
index 0000000..f5f2909
@@ -0,0 +1,71 @@
+# 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

recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg line 41

Quoted 10 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +10 -0
+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_SND_SOC_RK3288_HDMI_ANALOG=m

Oops, is enabling this RK3288 setting an oversight? Or is it needed for HDMI on the RK3399?

Quoted 126 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +30 -0
+
+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
recipes-kernel/linux/files/bsp/rockchip/rk3399.scc new file +5 -0
new file mode 100644
index 0000000..9b1a88e
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rk3399.cfg
+
+include rockchip.scc
recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg new file +50 -0
new file mode 100644
index 0000000..05a397d
@@ -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
recipes-kernel/linux/files/bsp/rockchip/rockchip.scc new file +6 -0
new file mode 100644
index 0000000..800f105
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rockchip.cfg
+
+include cfg/dmaengine.scc
+include features/mmc/mmc-block.cfg
recipes-kernel/linux/linux-yocto%.bbappend +6 -0
index 7702e3f..9658681 100644
@@ -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"
Signature · 1 line
2.30.2
#7 lore raw

Re: [meta-rockchip][PATCH v4 3/3] linux-yocto: add an initial NanoPi-M4 BSP

Quoted 294 lines · Trevor Woerner
Quoted 89 lines · On Mon 2021-04-26 @ 04:58:10 PM, [email protected] wrote:

From: Yann Dirson <[email protected]>

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

---
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  7 ++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  7 ++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 15 ++++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 71 +++++++++++++++++++
 .../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, 172 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
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc new file +7 -0
new file mode 100644
index 0000000..5c74d6b
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard/standard.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc new file +7 -0
new file mode 100644
index 0000000..6e94d6a
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE tiny
+define KARCH arm
+
+include ktypes/tiny/tiny.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +5 -0
new file mode 100644
index 0000000..7802ab3
@@ -0,0 +1,15 @@
+CONFIG_MFD_RK808=y
+CONFIG_COMMON_CLK_RK808=y
+
+CONFIG_REGULATOR_RK808=y
+CONFIG_REGULATOR_FAN53555=y

recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg line 15

Quoted 10 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +10 -0
+
+CONFIG_MMC_BLOCK=y
+CONFIG_PWRSEQ_SIMPLE=y
+
+# RTL8211E
+CONFIG_REALTEK_PHY=m
+
+# AP6356S
+CONFIG_BT_BCM=m
+CONFIG_BT_HCIUART_BCM=y

It looks to me as though the BRCMFMAC kernel config option needs to be enabled to support the AP6256S? I don't see that being enabled, does it end up being pulled in by default or as a result of the above two settings?

Quoted 48 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc new file +5 -0
new file mode 100644
index 0000000..f4267aa
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware nanopi-m4.cfg
+
+include rk3399.scc
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +31 -0
new file mode 100644
index 0000000..f5f2909
@@ -0,0 +1,71 @@
+# 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

recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg line 41

Quoted 10 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +10 -0
+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_SND_SOC_RK3288_HDMI_ANALOG=m

Oops, is enabling this RK3288 setting an oversight? Or is it needed for HDMI on the RK3399?

Quoted 126 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +30 -0
+
+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
recipes-kernel/linux/files/bsp/rockchip/rk3399.scc new file +5 -0
new file mode 100644
index 0000000..9b1a88e
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rk3399.cfg
+
+include rockchip.scc
recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg new file +50 -0
new file mode 100644
index 0000000..05a397d
@@ -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
recipes-kernel/linux/files/bsp/rockchip/rockchip.scc new file +6 -0
new file mode 100644
index 0000000..800f105
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rockchip.cfg
+
+include cfg/dmaengine.scc
+include features/mmc/mmc-block.cfg
recipes-kernel/linux/linux-yocto%.bbappend +6 -1
index 7702e3f..9658681 100644
@@ -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

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech
#8 lore raw

Re: [meta-rockchip][PATCH v4 3/3] linux-yocto: add an initial NanoPi-M4 BSP

In reply to Trevor Woerner

(sorry, previous answer _is_ empty, wrong button)

Quoted 97 lines · Trevor Woerner
Quoted 95 lines · On Mon 2021-04-26 @ 04:58:10 PM, [email protected] wrote:

From: Yann Dirson <[email protected]>

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

---
 .../files/bsp/rockchip/nanopi-m4-standard.scc |  7 ++
 .../files/bsp/rockchip/nanopi-m4-tiny.scc     |  7 ++
 .../linux/files/bsp/rockchip/nanopi-m4.cfg    | 15 ++++
 .../linux/files/bsp/rockchip/nanopi-m4.scc    |  5 ++
 .../linux/files/bsp/rockchip/rk3399.cfg       | 71 +++++++++++++++++++
 .../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, 172 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
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-standard.scc new file +7 -0
new file mode 100644
index 0000000..5c74d6b
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard/standard.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4-tiny.scc new file +7 -0
new file mode 100644
index 0000000..6e94d6a
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE nanopi-m4
+define KTYPE tiny
+define KARCH arm
+
+include ktypes/tiny/tiny.scc
+include nanopi-m4.scc
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +11 -0
new file mode 100644
index 0000000..7802ab3
@@ -0,0 +1,15 @@
+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
Quoted 8 lines

recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg line 15

Quoted 4 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.cfg new file +4 -0
+
+# AP6356S
+CONFIG_BT_BCM=m
+CONFIG_BT_HCIUART_BCM=y

It looks to me as though the BRCMFMAC kernel config option needs to be enabled to support the AP6256S? I don't see that being enabled, does it end up being pulled in by default or as a result of the above two settings?

Hm, good catch, I ended up not activating the AP6356S in this first patch, since it would be non-functional
without the proper firmware, and that one needs separate work. It makes sense not to include those options
at all here.

Quoted 54 lines
Quoted 54 lines
recipes-kernel/linux/files/bsp/rockchip/nanopi-m4.scc new file +5 -0
new file mode 100644
index 0000000..f4267aa
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware nanopi-m4.cfg
+
+include rk3399.scc
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +36 -0
new file mode 100644
index 0000000..f5f2909
@@ -0,0 +1,71 @@
+# 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
Quoted 8 lines

recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg line 41

Quoted 5 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +5 -0
+CONFIG_DRM_PANFROST=m
+
+# HDMI audio
+CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
+CONFIG_SND_SOC_RK3288_HDMI_ANALOG=m

Oops, is enabling this RK3288 setting an oversight? Or is it needed for HDMI on the RK3399?

I will double-check before rerolling, IIRC it is a common block used by the 3399,
whose legacy naming is just confusing.

Quoted 127 lines
Quoted 127 lines
recipes-kernel/linux/files/bsp/rockchip/rk3399.cfg new file +30 -0
+
+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
recipes-kernel/linux/files/bsp/rockchip/rk3399.scc new file +5 -0
new file mode 100644
index 0000000..9b1a88e
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rk3399.cfg
+
+include rockchip.scc
recipes-kernel/linux/files/bsp/rockchip/rockchip.cfg new file +50 -0
new file mode 100644
index 0000000..05a397d
@@ -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
recipes-kernel/linux/files/bsp/rockchip/rockchip.scc new file +6 -0
new file mode 100644
index 0000000..800f105
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: MIT
+
+kconf hardware rockchip.cfg
+
+include cfg/dmaengine.scc
+include features/mmc/mmc-block.cfg
recipes-kernel/linux/linux-yocto%.bbappend +6 -1
index 7702e3f..9658681 100644
@@ -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

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech