Compare commits
1 Commits
updates
...
9087b00cd2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9087b00cd2 |
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,12 +0,0 @@
|
||||
/_build/lib
|
||||
/_build/vmlinuz
|
||||
/_build/vmlinuz.config
|
||||
/_build/u-boot-rockchip.bin
|
||||
/_build/dtbs
|
||||
/_build/*.dtb
|
||||
/_build/gokr-rebuild*
|
||||
/_build/overlays
|
||||
/_build/Dockerfile
|
||||
/_build/src_build
|
||||
/_build/*.tar.gz
|
||||
/_build/*.tar.xz
|
||||
@@ -1,45 +1,13 @@
|
||||
CONFIG_IPV6=y
|
||||
# Compile in debug logging
|
||||
# CONFIG_DYNAMIC_DEBUG=y
|
||||
|
||||
# Speed up boot and processing in general
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
CONFIG_DEBUG_KERNEL=n
|
||||
|
||||
# Syn flood protection. Configurable in /proc
|
||||
CONFIG_SYN_COOKIES=y
|
||||
|
||||
# I use btrfs
|
||||
CONFIG_BTRFS_FS=y
|
||||
CONFIG_BTRFS_FS_POSIX_ACL=y
|
||||
|
||||
# NTFS
|
||||
CONFIG_NTFS3_FS=y
|
||||
|
||||
CONFIG_XFS_FS=y
|
||||
CONFIG_BCACHE=y
|
||||
|
||||
# Energy efficiency over performance
|
||||
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
|
||||
# For Squashfs (root file system):
|
||||
CONFIG_SQUASHFS=y
|
||||
CONFIG_SQUASHFS_FILE_CACHE=y
|
||||
CONFIG_SQUASHFS_XATTR=y
|
||||
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||
CONFIG_SQUASHFS_ZSTD=y
|
||||
CONFIG_SQUASHFS_ZLIB=y
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
|
||||
|
||||
# Support video decoding
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_VIDEO_ROCKCHIP_IEP=y
|
||||
CONFIG_VIDEO_ROCKCHIP_VDEC=y
|
||||
|
||||
# I added the patch for it
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG=y
|
||||
|
||||
CONFIG_DRM=y
|
||||
# For a console on HDMI:
|
||||
# # TODO: the simpledrm driver just does not work for me. the ASRock logo never disappears from HDMI
|
||||
# # [ 0.364059] [drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0
|
||||
@@ -67,178 +35,36 @@ CONFIG_FUSE_FS=y
|
||||
CONFIG_NETFILTER_NETLINK_QUEUE=y
|
||||
CONFIG_XFRM_USER=y
|
||||
|
||||
# Enable the RK3588 CPU
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_CPU_RK3588=y
|
||||
|
||||
# Enable all the ROCKCHIP options TODO are some of these even used???
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP2=y
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP=y
|
||||
CONFIG_HW_RANDOM_ROCKCHIP=y
|
||||
CONFIG_MFD_RK8XX_I2C=y
|
||||
CONFIG_MFD_RK8XX_SPI=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_NVMEM_ROCKCHIP_EFUSE=y
|
||||
CONFIG_NVMEM_ROCKCHIP_OTP=y
|
||||
CONFIG_PCIE_ROCKCHIP_HOST=y
|
||||
CONFIG_PHY_ROCKCHIP_DP=y
|
||||
CONFIG_PHY_ROCKCHIP_DPHY_RX0=y
|
||||
CONFIG_PHY_ROCKCHIP_EMMC=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_HDMI=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
|
||||
CONFIG_PHY_ROCKCHIP_PCIE=y
|
||||
CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX=y
|
||||
CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
CONFIG_PHY_ROCKCHIP_USB=y
|
||||
CONFIG_PHY_ROCKCHIP_USBDP=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
CONFIG_ROCKCHIP_IOMMU=y
|
||||
CONFIG_ROCKCHIP_MBOX=y
|
||||
CONFIG_ROCKCHIP_PHY=y
|
||||
CONFIG_ROCKCHIP_PM_DOMAINS=y
|
||||
CONFIG_ROCKCHIP_THERMAL=y
|
||||
CONFIG_SPI_ROCKCHIP=y
|
||||
CONFIG_SPI_ROCKCHIP_SFC=y
|
||||
CONFIG_VIDEO_ROCKCHIP_VDEC2=y
|
||||
|
||||
# Rockchip MMC
|
||||
CONFIG_MMC_DW=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
# Fan control?
|
||||
CONFIG_REGULATOR_FAN53555=y
|
||||
CONFIG_REGULATOR_FAN53200=y
|
||||
|
||||
# Not Needed???
|
||||
CONFIG_RTC_DRV_RK808=y
|
||||
# CM3588 RTC driver
|
||||
CONFIG_RTC_DRV_HYM8563=y
|
||||
|
||||
# Shouldn't this be done elsewhere?
|
||||
CONFIG_CMDLINE="console=ttyAMA0"
|
||||
|
||||
# This is what friendlyelec has
|
||||
CONFIG_HZ_300=y
|
||||
|
||||
# Quad core CPU
|
||||
CONFIG_NR_CPUS=8
|
||||
|
||||
# Power button
|
||||
CONFIG_PINCTRL_RK805=y
|
||||
CONFIG_INPUT_RK805_PWRKEY=y
|
||||
|
||||
# Needed to ensure DWMAC_ROCKCHIP is built, which is needed for Ethernet..... probabl
|
||||
CONFIG_STMMAC_ETH=y
|
||||
CONFIG_STMMAC_PLATFORM=y
|
||||
CONFIG_DWMAC_GENERIC=y
|
||||
CONFIG_DWMAC_ROCKCHIP=y
|
||||
|
||||
# cm3588 ethernet driver
|
||||
CONFIG_REALTEK_PHY=y
|
||||
CONFIG_R8169=y
|
||||
CONFIG_R8169_LEDS=y
|
||||
|
||||
# Try to enable HDMI out
|
||||
CONFIG_DRM_ROCKCHIP=y
|
||||
CONFIG_ROCKCHIP_VOP2=y
|
||||
CONFIG_ROCKCHIP_DW_HDMI=y
|
||||
CONFIG_ROCKCHIP_DW_HDMI_QP=y
|
||||
CONFIG_DRM_PANTHOR=y
|
||||
# Needed for V4L
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_V4L_PLATFORM_DRIVERS=y
|
||||
CONFIG_V4L_MEM2MEM_DRIVERS=y
|
||||
CONFIG_VIDEO_ROCKCHIP_VDEC=y
|
||||
CONFIG_VIDEO_ROCKCHIP_RGA=y
|
||||
CONFIG_VIDEO_HANTRO=y
|
||||
CONFIG_VIDEO_HANTRO_ROCKCHIP=y
|
||||
|
||||
#Maybe needed
|
||||
CONFIG_VIDEO_MUX=y
|
||||
CONFIG_VIDEO_ROCKCHIP_ISP1=y
|
||||
CONFIG_VIDEO_ROCKCHIP_IEP=y
|
||||
|
||||
# USB Stuff??
|
||||
CONFIG_TYPEC=y
|
||||
CONFIG_USB_DWC3_ULPI=y
|
||||
CONFIG_USB_DWC3_DUAL_ROLE=y
|
||||
|
||||
# Possibly used for gpu acceleration
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_SYSTEM=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
|
||||
|
||||
# Try to enable sound
|
||||
CONFIG_SND_SOC_RT5616=y
|
||||
|
||||
# For podman:
|
||||
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_VETH=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
CONFIG_BRIDGE=y
|
||||
CONFIG_IP6_NF_IPTABLES=y
|
||||
CONFIG_IP_NF_IPTABLES=y
|
||||
CONFIG_IP_NF_NAT=y
|
||||
CONFIG_IP_NF_TARGET_MASQUERADE=y
|
||||
CONFIG_NETFILTER=y
|
||||
CONFIG_NETFILTER_ADVANCED=y
|
||||
CONFIG_NETFILTER_XT_MARK=y
|
||||
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
|
||||
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
|
||||
CONFIG_NETFILTER_XTABLES=y
|
||||
CONFIG_NF_CONNTRACK=y
|
||||
CONFIG_NF_CONNTRACK_SECMARK=y
|
||||
CONFIG_NF_CT_NETLINK=y
|
||||
CONFIG_NF_FLOW_TABLE=y
|
||||
CONFIG_NF_FLOW_TABLE_INET=y
|
||||
CONFIG_NF_LOG_SYSLOG=y
|
||||
CONFIG_NF_MASQUERADE=y
|
||||
CONFIG_NF_NAT=y
|
||||
CONFIG_NF_NAT_IPV4=y
|
||||
CONFIG_NF_NAT_MASQUERADE=y
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV4=y
|
||||
CONFIG_NF_NAT_REDIRECT=y
|
||||
# For nftables:
|
||||
CONFIG_NF_TABLES=y
|
||||
CONFIG_NF_TABLES_INET=y
|
||||
CONFIG_NF_TABLES_IPV4=y
|
||||
CONFIG_NF_TABLES_IPV6=y
|
||||
CONFIG_NF_TABLES_NETDEV=y
|
||||
CONFIG_NFT_CHAIN_NAT_IPV4=y
|
||||
CONFIG_NFT_CHAIN_ROUTE_IPV4=y
|
||||
CONFIG_NFT_CHAIN_ROUTE_IPV6=y
|
||||
CONFIG_NFT_COMPAT=y
|
||||
CONFIG_NFT_COUNTER=y
|
||||
CONFIG_NFT_CT=y
|
||||
CONFIG_NFT_DUP_IPV4=y
|
||||
CONFIG_NFT_DUP_IPV6=y
|
||||
CONFIG_NF_NAT_IPV4=y
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV4=y
|
||||
CONFIG_NFT_PAYLOAD=y
|
||||
CONFIG_NFT_EXTHDR=y
|
||||
CONFIG_NFT_FIB_INET=y
|
||||
CONFIG_NFT_FIB_IPV4=y
|
||||
CONFIG_NFT_FIB_IPV6=y
|
||||
CONFIG_NFT_FIB_NETDEV=y
|
||||
CONFIG_NFT_META=y
|
||||
CONFIG_NFT_CT=y
|
||||
CONFIG_NFT_RBTREE=y
|
||||
CONFIG_NFT_HASH=y
|
||||
CONFIG_NFT_LIMIT=y
|
||||
CONFIG_NFT_COUNTER=y
|
||||
CONFIG_NFT_LOG=y
|
||||
CONFIG_NFT_LIMIT=y
|
||||
CONFIG_NFT_NAT=y
|
||||
CONFIG_NFT_COMPAT=y
|
||||
CONFIG_NFT_MASQ=y
|
||||
CONFIG_NFT_MASQ_IPV4=y
|
||||
CONFIG_NFT_META=y
|
||||
CONFIG_NFT_NAT=y
|
||||
CONFIG_NFT_OBJREF=y
|
||||
CONFIG_NFT_PAYLOAD=y
|
||||
CONFIG_NFT_RBTREE=y
|
||||
CONFIG_NFT_REDIR=y
|
||||
CONFIG_NFT_REJECT=y
|
||||
CONFIG_NFT_REJECT_INET=y
|
||||
CONFIG_NF_TABLES_IPV4=y
|
||||
CONFIG_NFT_REJECT_IPV4=y
|
||||
CONFIG_NFT_REJECT_NETDEV=y
|
||||
CONFIG_NFT_CHAIN_ROUTE_IPV4=y
|
||||
CONFIG_NFT_CHAIN_NAT_IPV4=y
|
||||
CONFIG_NF_TABLES_IPV6=y
|
||||
CONFIG_NFT_CHAIN_ROUTE_IPV6=y
|
||||
CONFIG_NFT_OBJREF=y
|
||||
CONFIG_NFT_DUP_IPV4=y
|
||||
CONFIG_NFT_FIB_IPV4=y
|
||||
CONFIG_NFT_DUP_IPV6=y
|
||||
CONFIG_NFT_FIB_IPV6=y
|
||||
|
||||
# Explicitly disable nftables helper modules to prevent NAT slipstreaming attacks:
|
||||
# https://samy.pl/slipstream/
|
||||
@@ -266,6 +92,26 @@ CONFIG_NVME_MULTIPATH=y
|
||||
CONFIG_NVME_HWMON=y
|
||||
CONFIG_NVME_TARGET_PASSTHRU=y
|
||||
|
||||
# For https://www.fs.com/products/75602.html and https://www.fs.com/products/75603.html network cards:
|
||||
CONFIG_I40E=y
|
||||
|
||||
# For Intel E810 series network cards:
|
||||
CONFIG_ICE=y
|
||||
|
||||
# For Broadcom 57414 10/25 Gbit/s network card:
|
||||
CONFIG_BNXT=y
|
||||
|
||||
# For Mellanox ConnectX-4 25 Gbit/s network cards:
|
||||
CONFIG_MLX5_EN=y
|
||||
CONFIG_MLX5_CORE=y
|
||||
CONFIG_MLX5_CORE_EN=y
|
||||
CONFIG_MLX5_INFINIBAND=n
|
||||
|
||||
# For apu2c4 ethernet ports
|
||||
CONFIG_IGB=y
|
||||
|
||||
# For Intel I225 ethernet ports (ASRock B550 Taichi):
|
||||
CONFIG_IGC=y
|
||||
|
||||
# For /proc/config.gz
|
||||
CONFIG_IKCONFIG=y
|
||||
@@ -274,6 +120,8 @@ CONFIG_IKCONFIG_PROC=y
|
||||
# For kexec
|
||||
CONFIG_KEXEC_FILE=y
|
||||
|
||||
# For apu2c4 watchdog
|
||||
CONFIG_SP5100_TCO=y
|
||||
|
||||
# For WireGuard
|
||||
CONFIG_NET_UDP_TUNNEL=y
|
||||
@@ -285,33 +133,46 @@ CONFIG_NET_SCH_TBF=y
|
||||
# For measuring CPU temperature:
|
||||
CONFIG_SENSORS_K10TEMP=y
|
||||
|
||||
# For measuring non-CPU temperature and fan speeds: Crashes on cm3588
|
||||
# CONFIG_SENSORS_NCT6683=y
|
||||
|
||||
# For Corsair Commander Pro fan controller:
|
||||
CONFIG_SENSORS_CORSAIR_CPRO=y
|
||||
|
||||
# For iproute2’s ss(8):
|
||||
# CONFIG_INET_DIAG=y
|
||||
# CONFIG_UNIX_DIAG=y
|
||||
# CONFIG_PACKET_DIAG=y # ss
|
||||
CONFIG_INET_DIAG=y
|
||||
|
||||
# For macvlan ethernet devices:
|
||||
CONFIG_MACVLAN=y
|
||||
|
||||
# For virtio drivers (for qemu):
|
||||
#CONFIG_VIRTIO_PCI=y
|
||||
#CONFIG_VIRTIO_BALLOON=y
|
||||
#CONFIG_VIRTIO_BLK=y
|
||||
#CONFIG_VIRTIO_NET=y
|
||||
#CONFIG_VIRTIO=y
|
||||
#CONFIG_VIRTIO_RING=y
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VIRTIO_BALLOON=y
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
CONFIG_VIRTIO_NET=y
|
||||
CONFIG_VIRTIO=y
|
||||
CONFIG_VIRTIO_RING=y
|
||||
# For watchdog within qemu:
|
||||
#CONFIG_I6300ESB_WDT=y
|
||||
CONFIG_I6300ESB_WDT=y
|
||||
|
||||
# For running KVM-accelerated qemu VMs:
|
||||
#CONFIG_KVM=y
|
||||
#CONFIG_KVM_INTEL=y
|
||||
#CONFIG_KVM_AMD=y
|
||||
#CONFIG_KVM_AMD_SEV=y
|
||||
CONFIG_KVM=y
|
||||
CONFIG_KVM_INTEL=y
|
||||
CONFIG_KVM_AMD=y
|
||||
CONFIG_KVM_AMD_SEV=y
|
||||
|
||||
# For bridge ethernet devices:
|
||||
CONFIG_BRIDGE=y
|
||||
|
||||
CONFIG_EFIVAR_FS=y
|
||||
|
||||
# For Ryzen CPUs:
|
||||
CONFIG_X86_AMD_PLATFORM_DEVICE=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_X86_POWERNOW_K8=y
|
||||
CONFIG_X86_AMD_FREQ_SENSITIVITY=y
|
||||
|
||||
# Include hardware interrupt CPU usage in /proc/stat CPU time reporting:
|
||||
CONFIG_IRQ_TIME_ACCOUNTING=y
|
||||
|
||||
@@ -324,7 +185,19 @@ CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_BPF=y
|
||||
CONFIG_SOCK_CGROUP_DATA=y
|
||||
CONFIG_NET_SOCK_MSG=y
|
||||
|
||||
# For podman:
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_BRIDGE=y
|
||||
CONFIG_VETH=y
|
||||
CONFIG_NETFILTER_ADVANCED=y
|
||||
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
|
||||
CONFIG_IP_NF_NAT=y
|
||||
CONFIG_IP_NF_TARGET_MASQUERADE=y
|
||||
CONFIG_NETFILTER_XT_NAT=y
|
||||
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
|
||||
CONFIG_NETFILTER_XT_MARK=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
|
||||
# Enable TCP BBR as default congestion control
|
||||
CONFIG_TCP_CONG_BBR=y
|
||||
@@ -366,31 +239,289 @@ CONFIG_WERROR=n
|
||||
CONFIG_KERNEL_ZSTD=y
|
||||
|
||||
# For qemu -M microvm quick boots:
|
||||
#CONFIG_VIRTIO_MMIO=y
|
||||
CONFIG_VIRTIO_MMIO=y
|
||||
|
||||
# Relevant for rk3588????
|
||||
# CONFIG_HW_RANDOM_VIRTIO=y
|
||||
# CONFIG_XEN_VIRTIO=y
|
||||
# CONFIG_VIRTIO_IOMMU=y
|
||||
CONFIG_HW_RANDOM_VIRTIO=y
|
||||
CONFIG_XEN_VIRTIO=y
|
||||
CONFIG_VIRTIO_IOMMU=y
|
||||
|
||||
# for easy sandboxing with go-landlock
|
||||
CONFIG_SECURITY_LANDLOCK=y
|
||||
|
||||
# ???????
|
||||
CONFIG_IPV6_MULTIPLE_TABLES=y
|
||||
CONFIG_NF_SOCKET_IPV6=y
|
||||
CONFIG_NETLINK_DIAG=y
|
||||
CONFIG_INET_DIAG_DESTROY=y
|
||||
|
||||
# Serial port drivers
|
||||
CONFIG_SERIAL_CORE=y
|
||||
CONFIG_SERIAL_CORE_CONSOLE=y
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_DW=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
# More AWS stuff:
|
||||
CONFIG_ENA_ETHERNET=y
|
||||
CONFIG_RANDOM_TRUST_CPU=y
|
||||
CONFIG_RANDOM_TRUST_BOOTLOADER=y
|
||||
|
||||
# For older AWS:
|
||||
CONFIG_XEN=y
|
||||
CONFIG_XEN_DOM0=y
|
||||
CONFIG_XEN_PRIVILEGED_GUEST=y
|
||||
CONFIG_XEN_PVHVM=y
|
||||
|
||||
# for easy sandboxing with go-landlock
|
||||
CONFIG_SECURITY_LANDLOCK=y
|
||||
|
||||
# Speed up boot and processing in general
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
CONFIG_DEBUG_KERNEL=n
|
||||
|
||||
# Enable the RK3588 CPU
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_CPU_RK3588=y
|
||||
|
||||
# Enable all the ROCKCHIP options
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP2=y
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP=y
|
||||
CONFIG_HW_RANDOM_ROCKCHIP=y
|
||||
CONFIG_MFD_RK8XX_I2C=y
|
||||
CONFIG_MFD_RK8XX_SPI=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_NVMEM_ROCKCHIP_EFUSE=y
|
||||
CONFIG_NVMEM_ROCKCHIP_OTP=y
|
||||
CONFIG_PCIE_ROCKCHIP_HOST=y
|
||||
CONFIG_PHY_ROCKCHIP_DP=y
|
||||
CONFIG_PHY_ROCKCHIP_DPHY_RX0=y
|
||||
CONFIG_PHY_ROCKCHIP_EMMC=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_HDMI=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
|
||||
CONFIG_PHY_ROCKCHIP_PCIE=y
|
||||
CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX=y
|
||||
CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
CONFIG_PHY_ROCKCHIP_USB=y
|
||||
CONFIG_PHY_ROCKCHIP_USBDP=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
CONFIG_ROCKCHIP_IOMMU=y
|
||||
CONFIG_ROCKCHIP_MBOX=y
|
||||
CONFIG_ROCKCHIP_PHY=y
|
||||
CONFIG_ROCKCHIP_PM_DOMAINS=y
|
||||
CONFIG_ROCKCHIP_THERMAL=y
|
||||
CONFIG_SND_SOC_RK3328=y
|
||||
CONFIG_SPI_ROCKCHIP=y
|
||||
CONFIG_SPI_ROCKCHIP_SFC=y
|
||||
CONFIG_VIDEO_ROCKCHIP_VDEC2=y
|
||||
|
||||
# CM3588 RTC driver
|
||||
CONFIG_RTC_DRV_RK808=y
|
||||
|
||||
# Shouldn't this be done elsewhere?
|
||||
CONFIG_CMDLINE="console=ttyAMA0"
|
||||
|
||||
# This is what friendlyelec has
|
||||
CONFIG_HZ_300=y
|
||||
|
||||
# Quad core CPU
|
||||
CONFIG_NR_CPUS=8
|
||||
|
||||
# Power button
|
||||
CONFIG_PINCTRL_RK805=y
|
||||
CONFIG_INPUT_RK805_PWRKEY=y
|
||||
|
||||
# Needed to ensure DWMAC_ROCKCHIP is built, which is needed for Ethernet
|
||||
CONFIG_STMMAC_ETH=y
|
||||
CONFIG_STMMAC_PLATFORM=y
|
||||
CONFIG_DWMAC_GENERIC=y
|
||||
CONFIG_DWMAC_ROCKCHIP=y
|
||||
|
||||
# Ethernet driver
|
||||
CONFIG_REALTEK_PHY=y
|
||||
CONFIG_R8169=y
|
||||
|
||||
# Try to enable HDMI out
|
||||
CONFIG_DRM_ROCKCHIP=y
|
||||
|
||||
|
||||
CONFIG_CRYPTO_DEV_ROCKCHIP2=y
|
||||
CONFIG_HW_RANDOM_ROCKCHIP=y
|
||||
CONFIG_VIDEO_ROCKCHIP_VDEC2=y
|
||||
|
||||
CONFIG_MKISS=y
|
||||
CONFIG_6PACK=y
|
||||
CONFIG_BPQETHER=y
|
||||
CONFIG_BAYCOM_SER_FDX=y
|
||||
CONFIG_BAYCOM_SER_HDX=y
|
||||
CONFIG_YAM=y
|
||||
CONFIG_USB_RTL8150=y
|
||||
CONFIG_USB_RTL8152=y
|
||||
|
||||
|
||||
CONFIG_AD525X_DPOT=y
|
||||
CONFIG_AD525X_DPOT_I2C=y
|
||||
CONFIG_AD525X_DPOT_SPI=y
|
||||
|
||||
# Try to enable sound
|
||||
CONFIG_SND_SOC_ROCKCHIP=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_DLP_PCM=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_I2S=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_PDM=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_SAI=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_SPDIF=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_SPDIFRX=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_VAD=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_MAX98090=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_MULTICODECS=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_RT5645=y
|
||||
CONFIG_SND_SOC_ROCKCHIP_HDMI=y
|
||||
|
||||
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_OVERLAY_FS_INDEX=y
|
||||
|
||||
|
||||
# # disable other arches
|
||||
CONFIG_ARCH_ACTIONS=n
|
||||
CONFIG_ARCH_AIROHA=n
|
||||
CONFIG_ARCH_ALPINE=n
|
||||
CONFIG_ARCH_APPLE=n
|
||||
CONFIG_ARCH_BCM2835=n
|
||||
CONFIG_ARCH_BCM=n
|
||||
CONFIG_ARCH_BCM_IPROC=n
|
||||
CONFIG_ARCH_BCMBCA=n
|
||||
CONFIG_ARCH_BERLIN=n
|
||||
CONFIG_ARCH_BRCMSTB=n
|
||||
CONFIG_ARCH_EXYNOS=n
|
||||
CONFIG_ARCH_HISI=n
|
||||
CONFIG_ARCH_INTEL_SOCFPGA=n
|
||||
CONFIG_ARCH_K3=n
|
||||
CONFIG_ARCH_KEEMBAY=n
|
||||
CONFIG_ARCH_LAYERSCAPE=n
|
||||
CONFIG_ARCH_LG1K=n
|
||||
CONFIG_ARCH_MA35=n
|
||||
CONFIG_ARCH_MEDIATEK=n
|
||||
CONFIG_ARCH_MESON=n
|
||||
CONFIG_ARCH_MVEBU=n
|
||||
CONFIG_ARCH_MXC=n
|
||||
CONFIG_ARCH_NPCM=n
|
||||
CONFIG_ARCH_NXP=n
|
||||
CONFIG_ARCH_QCOM=n
|
||||
CONFIG_ARCH_R8A774A1=n
|
||||
CONFIG_ARCH_R8A774B1=n
|
||||
CONFIG_ARCH_R8A774C0=n
|
||||
CONFIG_ARCH_R8A774E1=n
|
||||
CONFIG_ARCH_R8A77951=n
|
||||
CONFIG_ARCH_R8A77960=n
|
||||
CONFIG_ARCH_R8A77961=n
|
||||
CONFIG_ARCH_R8A77965=n
|
||||
CONFIG_ARCH_R8A77970=n
|
||||
CONFIG_ARCH_R8A77980=n
|
||||
CONFIG_ARCH_R8A77990=n
|
||||
CONFIG_ARCH_R8A77995=n
|
||||
CONFIG_ARCH_R8A779A0=n
|
||||
CONFIG_ARCH_R8A779F0=n
|
||||
CONFIG_ARCH_R8A779G0=n
|
||||
CONFIG_ARCH_R8A779H0=n
|
||||
CONFIG_ARCH_R9A07G043=n
|
||||
CONFIG_ARCH_R9A07G044=n
|
||||
CONFIG_ARCH_R9A07G054=n
|
||||
CONFIG_ARCH_R9A08G045=n
|
||||
CONFIG_ARCH_R9A09G011=n
|
||||
CONFIG_ARCH_R9A09G057=n
|
||||
CONFIG_ARCH_REALTEK=n
|
||||
CONFIG_ARCH_RENESAS=n
|
||||
CONFIG_ARCH_S32=n
|
||||
CONFIG_ARCH_SEATTLE=n
|
||||
CONFIG_ARCH_SPARX5=n
|
||||
CONFIG_ARCH_SPRD=n
|
||||
CONFIG_ARCH_STM32=n
|
||||
CONFIG_ARCH_SUNXI=n
|
||||
CONFIG_ARCH_SYNQUACER=n
|
||||
CONFIG_ARCH_TEGRA=n
|
||||
CONFIG_ARCH_TEGRA_132_SOC=n
|
||||
CONFIG_ARCH_TEGRA_186_SOC=n
|
||||
CONFIG_ARCH_TEGRA_194_SOC=n
|
||||
CONFIG_ARCH_TEGRA_210_SOC=n
|
||||
CONFIG_ARCH_TEGRA_234_SOC=n
|
||||
CONFIG_ARCH_TESLA_FSD=n
|
||||
CONFIG_ARCH_THUNDER2=n
|
||||
CONFIG_ARCH_THUNDER=n
|
||||
CONFIG_ARCH_UNIPHIER=n
|
||||
CONFIG_ARCH_VEXPRESS=n
|
||||
CONFIG_ARCH_VISCONTI=n
|
||||
CONFIG_ARCH_XGENE=n
|
||||
CONFIG_ARCH_ZYNQMP=n
|
||||
|
||||
CONFIG_GOOGLE_FIRMWARE=n
|
||||
|
||||
CONFIG_ATA=n
|
||||
|
||||
CONFIG_MD=n
|
||||
|
||||
|
||||
CONFIG_NET_VENDOR_3COM=n
|
||||
CONFIG_NET_VENDOR_ADAPTEC=n
|
||||
CONFIG_NET_VENDOR_AGERE=n
|
||||
CONFIG_NET_VENDOR_ALACRITECH=n
|
||||
CONFIG_NET_VENDOR_ALTEON=n
|
||||
CONFIG_NET_VENDOR_AMAZON=n
|
||||
CONFIG_NET_VENDOR_AMD=n
|
||||
CONFIG_NET_VENDOR_AQUANTIA=n
|
||||
CONFIG_NET_VENDOR_ARC=n
|
||||
CONFIG_NET_VENDOR_ASIX=n
|
||||
CONFIG_NET_VENDOR_ATHEROS=n
|
||||
CONFIG_NET_VENDOR_CADENCE=n
|
||||
CONFIG_NET_VENDOR_CAVIUM=n
|
||||
CONFIG_NET_VENDOR_CHELSIO=n
|
||||
CONFIG_NET_VENDOR_CISCO=n
|
||||
CONFIG_NET_VENDOR_CORTINA=n
|
||||
CONFIG_NET_VENDOR_DAVICOM=n
|
||||
CONFIG_NET_VENDOR_DEC=n
|
||||
CONFIG_NET_VENDOR_DLINK=n
|
||||
CONFIG_NET_VENDOR_EMULEX=n
|
||||
CONFIG_NET_VENDOR_ENGLEDER=n
|
||||
CONFIG_NET_VENDOR_EZCHIP=n
|
||||
CONFIG_NET_VENDOR_FUNGIBLE=n
|
||||
CONFIG_NET_VENDOR_GOOGLE=n
|
||||
CONFIG_NET_VENDOR_HISILICON=n
|
||||
CONFIG_NET_VENDOR_HUAWEI=n
|
||||
CONFIG_NET_VENDOR_I825XX=n
|
||||
CONFIG_NET_VENDOR_INTEL=n
|
||||
CONFIG_NET_VENDOR_ADI=n
|
||||
CONFIG_NET_VENDOR_LITEX=n
|
||||
CONFIG_NET_VENDOR_MARVELL=n
|
||||
CONFIG_NET_VENDOR_MELLANOX=n
|
||||
CONFIG_NET_VENDOR_MICREL=n
|
||||
CONFIG_NET_VENDOR_MICROCHIP=n
|
||||
CONFIG_NET_VENDOR_MICROSEMI=n
|
||||
CONFIG_NET_VENDOR_MICROSOFT=n
|
||||
CONFIG_NET_VENDOR_MnRI=n
|
||||
CONFIG_NET_VENDOR_NI=n
|
||||
CONFIG_NET_VENDOR_NATSEMI=n
|
||||
CONFIG_NET_VENDOR_NETERION=n
|
||||
CONFIG_NET_VENDOR_NETRONOME=n
|
||||
CONFIG_NET_VENDOR_8390=n
|
||||
CONFIG_NET_VENDOR_NVIDIA=n
|
||||
CONFIG_NET_VENDOR_OKI=n
|
||||
CONFIG_NET_VENDOR_PACKET_ENGINES=n
|
||||
CONFIG_NET_VENDOR_PENSANDO=n
|
||||
CONFIG_NET_VENDOR_QLOGIC=n
|
||||
CONFIG_NET_VENDOR_BROCADE=n
|
||||
CONFIG_NET_VENDOR_QUALCOMM=n
|
||||
CONFIG_NET_VENDOR_RDC=n
|
||||
CONFIG_NET_VENDOR_BROADCOM=n
|
||||
CONFIG_NET_VENDOR_RENESAS=n
|
||||
CONFIG_NET_VENDOR_ROCKER=n
|
||||
CONFIG_NET_VENDOR_SAMSUNG=n
|
||||
CONFIG_NET_VENDOR_SEEQ=n
|
||||
CONFIG_NET_VENDOR_SILAN=n
|
||||
CONFIG_NET_VENDOR_SIS=n
|
||||
CONFIG_NET_VENDOR_SOLARFLARE=n
|
||||
CONFIG_NET_VENDOR_SMSC=n
|
||||
CONFIG_NET_VENDOR_SOCIONEXT=n
|
||||
CONFIG_NET_VENDOR_STMICRO=n
|
||||
CONFIG_NET_VENDOR_SUN=n
|
||||
CONFIG_NET_VENDOR_SnNOPSnS=n
|
||||
CONFIG_NET_VENDOR_TEHUTI=n
|
||||
CONFIG_NET_VENDOR_TI=n
|
||||
CONFIG_NET_VENDOR_VERTEXCOM=n
|
||||
CONFIG_NET_VENDOR_VIA=n
|
||||
CONFIG_NET_VENDOR_WANGXUN=n
|
||||
CONFIG_NET_VENDOR_WIZNET=n
|
||||
CONFIG_NET_VENDOR_XILINX=n
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Doe <john.doe@somewhere.on.planet>
|
||||
Date: Wed, 14 Aug 2024 16:33:07 +0000
|
||||
Subject: rockchip64: edge: 6.10.5 drv:spi:spidev remove warnings
|
||||
|
||||
Signed-off-by: John Doe <john.doe@somewhere.on.planet>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -703,6 +703,7 @@ static const struct class spidev_class = {
|
||||
* spidev_dt_ids array below. Both arrays are kept in the same ordering.
|
||||
*/
|
||||
static const struct spi_device_id spidev_spi_ids[] = {
|
||||
+ { .name = "spi-dev" },
|
||||
{ .name = /* abb */ "spi-sensor" },
|
||||
{ .name = /* cisco */ "spi-petra" },
|
||||
{ .name = /* dh */ "dhcom-board" },
|
||||
@@ -736,6 +737,7 @@ static int spidev_of_check(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct of_device_id spidev_dt_ids[] = {
|
||||
+ { .compatible = "armbian,spi-dev", .data = &spidev_of_check },
|
||||
{ .compatible = "abb,spi-sensor", .data = &spidev_of_check },
|
||||
{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
|
||||
{ .compatible = "dh,dhcom-board", .data = &spidev_of_check },
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Medvedev <redrathnure@gmail.com>
|
||||
Date: Mon, 1 Jan 2024 21:50:10 +0000
|
||||
Subject: HDMI EDID records for 800x480 resolution (a MKS IPS50 screen and
|
||||
similar)
|
||||
|
||||
---
|
||||
drivers/gpu/drm/drm_edid.c | 12 +++++++++-
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 1 +
|
||||
drivers/video/hdmi.c | 2 ++
|
||||
include/linux/hdmi.h | 1 +
|
||||
4 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/drm_edid.c
|
||||
+++ b/drivers/gpu/drm/drm_edid.c
|
||||
@@ -1561,6 +1561,16 @@ static const struct drm_display_mode edid_cea_modes_193[] = {
|
||||
4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
|
||||
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
|
||||
+ /* 220 - 800x480@60Hz 5:3 */
|
||||
+ { DRM_MODE("800x480", DRM_MODE_TYPE_DRIVER, 30240, 800, 850,
|
||||
+ 920, 960, 0, 480, 510, 513, 525, 0,
|
||||
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_5_3, },
|
||||
+ /* 221 - 800x480@60Hz 5:3, MKS IPS50 */
|
||||
+ { DRM_MODE("800x480", DRM_MODE_TYPE_DRIVER, 30240, 800, 850,
|
||||
+ 950, 960, 0, 480, 510, 513, 525, 0,
|
||||
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_5_3, },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -4236,7 +4246,7 @@ static bool drm_edid_has_cta_extension(const struct drm_edid *drm_edid)
|
||||
static __always_inline const struct drm_display_mode *cea_mode_for_vic(u8 vic)
|
||||
{
|
||||
BUILD_BUG_ON(1 + ARRAY_SIZE(edid_cea_modes_1) - 1 != 127);
|
||||
- BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 219);
|
||||
+ BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 221);
|
||||
|
||||
if (vic >= 1 && vic < 1 + ARRAY_SIZE(edid_cea_modes_1))
|
||||
return &edid_cea_modes_1[vic - 1];
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -295,6 +295,7 @@ static const struct pre_pll_config pre_pll_cfg_table[] = {
|
||||
{ 25175000, 31468750, 1, 41, 0, 3, 3, 1, 3, 3, 4, 0, 0xf5554f},
|
||||
{ 27000000, 27000000, 1, 36, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
{ 27000000, 33750000, 1, 45, 0, 3, 3, 1, 3, 3, 4, 0, 0x0},
|
||||
+ { 30240000, 30240000, 5, 504, 3, 2, 2, 20, 4, 2, 2, 0, 0x0}, // Non standard screens like MKS IPS50
|
||||
{ 31500000, 31500000, 1, 42, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
{ 31500000, 39375000, 1, 105, 1, 3, 3, 10, 0, 3, 4, 0, 0x0},
|
||||
{ 33750000, 33750000, 1, 45, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/video/hdmi.c
|
||||
+++ b/drivers/video/hdmi.c
|
||||
@@ -1087,6 +1087,8 @@ hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
|
||||
return "64:27";
|
||||
case HDMI_PICTURE_ASPECT_256_135:
|
||||
return "256:135";
|
||||
+ case HDMI_PICTURE_ASPECT_5_3:
|
||||
+ return "5:3";
|
||||
case HDMI_PICTURE_ASPECT_RESERVED:
|
||||
return "Reserved";
|
||||
}
|
||||
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/hdmi.h
|
||||
+++ b/include/linux/hdmi.h
|
||||
@@ -108,6 +108,7 @@ enum hdmi_picture_aspect {
|
||||
HDMI_PICTURE_ASPECT_16_9,
|
||||
HDMI_PICTURE_ASPECT_64_27,
|
||||
HDMI_PICTURE_ASPECT_256_135,
|
||||
+ HDMI_PICTURE_ASPECT_5_3,
|
||||
HDMI_PICTURE_ASPECT_RESERVED,
|
||||
};
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: paolo <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 17 Jan 2021 10:20:21 +0000
|
||||
Subject: [ARCHEOLOGY] Adding pll hdmi timing to rockchip64-dev too
|
||||
|
||||
> X-Git-Archeology: > recovered message: > Fixed rk3328 mali node, shortening memory range to 0x30000 as per-stated in official documentation
|
||||
> X-Git-Archeology: - Revision 3a037e899b06452043e23cd2a17f40fe1a932c5f: https://github.com/armbian/build/commit/3a037e899b06452043e23cd2a17f40fe1a932c5f
|
||||
> X-Git-Archeology: Date: Sun, 17 Jan 2021 10:20:21 +0000
|
||||
> X-Git-Archeology: From: paolo <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: Adding pll hdmi timing to rockchip64-dev too
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e7377248b3cae186e24e2be781cd3365b43246f0: https://github.com/armbian/build/commit/e7377248b3cae186e24e2be781cd3365b43246f0
|
||||
> X-Git-Archeology: Date: Thu, 22 Jul 2021 00:15:54 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Second part of EDGE bumping to 5.13.y (#3045)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 744ea89a589d62cb6f409baab60fc6664520bc39: https://github.com/armbian/build/commit/744ea89a589d62cb6f409baab60fc6664520bc39
|
||||
> X-Git-Archeology: Date: Wed, 08 Sep 2021 17:51:34 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bumping EDGE kernel to 5.14.y (#3125)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e: https://github.com/armbian/build/commit/dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e
|
||||
> X-Git-Archeology: Date: Tue, 09 Nov 2021 18:06:34 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump imx6, xu4, rockchip64 and jetson-nano to 5.15 (#3238)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 71 ++++++++++
|
||||
1 file changed, 71 insertions(+)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -465,6 +465,77 @@ static const struct pre_pll_config pre_pll_cfg_table[] = {
|
||||
{594000000, 297000000, 1, 99, 0, 1, 1, 1, 0, 1, 1, 0, 0x0},
|
||||
{594000000, 371250000, 4, 495, 0, 3, 1, 1, 3, 0, 0, 1, 0x0},
|
||||
{594000000, 594000000, 1, 99, 0, 2, 0, 1, 0, 1, 1, 0, 0x0},
|
||||
+ { 25175000, 25175000, 30, 1007, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 31500000, 31500000, 1, 21, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 33750000, 33750000, 1, 45, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 35500000, 35500000, 3, 71, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 36000000, 36000000, 1, 12, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 49500000, 49500000, 1, 33, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 50000000, 50000000, 3, 50, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 56250000, 56250000, 1, 75, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 65000000, 65000000, 3, 65, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 68250000, 68250000, 1, 91, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 71000000, 71000000, 3, 71, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 72000000, 72000000, 1, 24, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 73250000, 73250000, 3, 293, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 75000000, 75000000, 1, 25, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 78750000, 78750000, 1, 105, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 79500000, 79500000, 1, 53, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 83500000, 83500000, 3, 167, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 85500000, 85500000, 1, 57, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 88750000, 88750000, 3, 355, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 94500000, 94500000, 1, 63, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {101000000, 101000000, 3, 101, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {102250000, 102250000, 3, 409, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {106500000, 106500000, 1, 71, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {108000000, 108000000, 1, 36, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {115500000, 115500000, 1, 77, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {117500000, 117500000, 3, 235, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {119000000, 119000000, 3, 119, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {121750000, 121750000, 3, 487, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {122500000, 122500000, 3, 245, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {135000000, 135000000, 1, 45, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {136750000, 136750000, 3, 547, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {140250000, 140250000, 1, 187, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {146250000, 146250000, 1, 195, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {148250000, 148250000, 3, 593, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {154000000, 154000000, 3, 154, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {156000000, 156000000, 1, 52, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {156750000, 156750000, 1, 209, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {157000000, 157000000, 3, 157, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {157500000, 157500000, 1, 105, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {162000000, 162000000, 1, 54, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {175500000, 175500000, 1, 117, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {179500000, 179500000, 3, 359, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {182750000, 182750000, 3, 731, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {187000000, 187000000, 3, 187, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {187250000, 187250000, 3, 749, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {189000000, 189000000, 1, 63, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {193250000, 193250000, 3, 773, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {202500000, 202500000, 1, 135, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {204750000, 204750000, 1, 273, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {208000000, 208000000, 3, 208, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {214750000, 214750000, 3, 859, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {218250000, 218250000, 1, 291, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {229500000, 229500000, 1, 153, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {234000000, 234000000, 1, 78, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {241500000, 241500000, 1, 161, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {245250000, 245250000, 1, 327, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {245500000, 245500000, 3, 491, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {261000000, 261000000, 1, 87, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {268250000, 268250000, 3, 1073, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {268500000, 268500000, 1, 179, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {281250000, 281250000, 1, 375, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {288000000, 288000000, 1, 96, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {312250000, 312250000, 3, 1249, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {317000000, 317000000, 3, 317, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {333250000, 333250000, 3, 1333, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {348500000, 348500000, 3, 697, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {356500000, 356500000, 3, 713, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {380500000, 380500000, 3, 761, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {443250000, 443250000, 1, 591, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {505250000, 505250000, 3, 2021, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {552750000, 552750000, 1, 737, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 14 Jan 2024 11:53:20 +0100
|
||||
Subject: rockchip64: add TRNG to existing crypto v1 driver
|
||||
|
||||
original patch source: https://patchwork.kernel.org/project/linux-rockchip/patch/20230707115242.3411259-1-clabbe@baylibre.com/
|
||||
---
|
||||
drivers/crypto/Kconfig | 8 +
|
||||
drivers/crypto/rockchip/Makefile | 1 +
|
||||
drivers/crypto/rockchip/rk3288_crypto.c | 18 +-
|
||||
drivers/crypto/rockchip/rk3288_crypto.h | 18 ++
|
||||
drivers/crypto/rockchip/rk3288_crypto_ahash.c | 2 +
|
||||
drivers/crypto/rockchip/rk3288_crypto_skcipher.c | 2 +
|
||||
drivers/crypto/rockchip/rk3288_crypto_trng.c | 92 ++++++++++
|
||||
7 files changed, 140 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/Kconfig
|
||||
+++ b/drivers/crypto/Kconfig
|
||||
@@ -707,6 +707,14 @@ config CRYPTO_DEV_ROCKCHIP
|
||||
This driver interfaces with the hardware crypto accelerator.
|
||||
Supporting cbc/ecb chainmode, and aes/des/des3_ede cipher mode.
|
||||
|
||||
+config CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ bool "Support for Rockchip TRNG"
|
||||
+ depends on CRYPTO_DEV_ROCKCHIP
|
||||
+ select HW_RANDOM
|
||||
+ help
|
||||
+ Select this option if you want to provide kernel-side support for
|
||||
+ the True Random Number Generator found in the Crypto IP.
|
||||
+
|
||||
config CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
bool "Enable Rockchip crypto stats"
|
||||
depends on CRYPTO_DEV_ROCKCHIP
|
||||
diff --git a/drivers/crypto/rockchip/Makefile b/drivers/crypto/rockchip/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/Makefile
|
||||
+++ b/drivers/crypto/rockchip/Makefile
|
||||
@@ -3,3 +3,4 @@ obj-$(CONFIG_CRYPTO_DEV_ROCKCHIP) += rk_crypto.o
|
||||
rk_crypto-objs := rk3288_crypto.o \
|
||||
rk3288_crypto_skcipher.o \
|
||||
rk3288_crypto_ahash.o
|
||||
+rk_crypto-$(CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG) += rk3288_crypto_trng.o
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
@@ -47,15 +47,18 @@ static const struct rk_variant rk3288_variant = {
|
||||
.num_clks = 4,
|
||||
.rkclks = {
|
||||
{ "sclk", 150000000},
|
||||
- }
|
||||
+ },
|
||||
+ .trng = false,
|
||||
};
|
||||
|
||||
static const struct rk_variant rk3328_variant = {
|
||||
.num_clks = 3,
|
||||
+ .trng = false,
|
||||
};
|
||||
|
||||
static const struct rk_variant rk3399_variant = {
|
||||
.num_clks = 3,
|
||||
+ .trng = true,
|
||||
};
|
||||
|
||||
static int rk_crypto_get_clks(struct rk_crypto_info *dev)
|
||||
@@ -201,6 +204,10 @@ static int rk_crypto_debugfs_show(struct seq_file *seq, void *v)
|
||||
seq_printf(seq, "%s %s requests: %lu\n",
|
||||
dev_driver_string(dd->dev), dev_name(dd->dev),
|
||||
dd->nreq);
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ seq_printf(seq, "HWRNG: %lu %lu\n",
|
||||
+ dd->hwrng_stat_req, dd->hwrng_stat_bytes);
|
||||
+#endif
|
||||
}
|
||||
spin_unlock(&rocklist.lock);
|
||||
|
||||
@@ -395,6 +402,10 @@ static int rk_crypto_probe(struct platform_device *pdev)
|
||||
dev_err(dev, "Fail to register crypto algorithms");
|
||||
goto err_register_alg;
|
||||
}
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ if (crypto_info->variant->trng)
|
||||
+ rk3288_hwrng_register(crypto_info);
|
||||
+#endif
|
||||
|
||||
register_debugfs(crypto_info);
|
||||
}
|
||||
@@ -425,6 +436,11 @@ static void rk_crypto_remove(struct platform_device *pdev)
|
||||
#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
debugfs_remove_recursive(rocklist.dbgfs_dir);
|
||||
#endif
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ if (crypto_tmp->variant->trng)
|
||||
+ rk3288_hwrng_unregister(crypto_tmp);
|
||||
+#endif
|
||||
+
|
||||
rk_crypto_unregister();
|
||||
}
|
||||
rk_crypto_pm_exit(crypto_tmp);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto.h b/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha2.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
+#include <linux/hw_random.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/scatterlist.h>
|
||||
@@ -180,6 +181,16 @@
|
||||
#define RK_CRYPTO_HASH_DOUT_6 0x01a4
|
||||
#define RK_CRYPTO_HASH_DOUT_7 0x01a8
|
||||
|
||||
+#define RK_CRYPTO_TRNG_CTRL 0x0200
|
||||
+#define RK_CRYPTO_OSC_ENABLE BIT(16)
|
||||
+#define RK_CRYPTO_TRNG_DOUT_0 0x0204
|
||||
+/* sample < 1000 lead to 100% failure on rngtest,
|
||||
+ * using more than 1200 does not increase success.
|
||||
+ */
|
||||
+#define RK_CRYPTO_RNG_SAMPLE 1200
|
||||
+
|
||||
+#define RK_CRYPTO_MAX_TRNG_BYTE 32
|
||||
+
|
||||
#define CRYPTO_READ(dev, offset) \
|
||||
readl_relaxed(((dev)->reg + (offset)))
|
||||
#define CRYPTO_WRITE(dev, offset, val) \
|
||||
@@ -209,6 +220,7 @@ struct rk_clks {
|
||||
struct rk_variant {
|
||||
int num_clks;
|
||||
struct rk_clks rkclks[RK_MAX_CLKS];
|
||||
+ bool trng;
|
||||
};
|
||||
|
||||
struct rk_crypto_info {
|
||||
@@ -219,11 +231,15 @@ struct rk_crypto_info {
|
||||
struct reset_control *rst;
|
||||
void __iomem *reg;
|
||||
int irq;
|
||||
+ struct mutex lock;
|
||||
+ struct hwrng hwrng;
|
||||
const struct rk_variant *variant;
|
||||
unsigned long nreq;
|
||||
struct crypto_engine *engine;
|
||||
struct completion complete;
|
||||
int status;
|
||||
+ unsigned long hwrng_stat_req;
|
||||
+ unsigned long hwrng_stat_bytes;
|
||||
};
|
||||
|
||||
/* the private variable of hash */
|
||||
@@ -283,3 +299,5 @@ extern struct rk_crypto_tmp rk_ahash_md5;
|
||||
|
||||
struct rk_crypto_info *get_rk_crypto(void);
|
||||
#endif
|
||||
+int rk3288_hwrng_register(struct rk_crypto_info *rk);
|
||||
+void rk3288_hwrng_unregister(struct rk_crypto_info *rk);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
@@ -298,6 +298,7 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
|
||||
goto theend;
|
||||
}
|
||||
|
||||
+ mutex_lock(&rkc->lock);
|
||||
rk_ahash_reg_init(areq, rkc);
|
||||
|
||||
while (sg) {
|
||||
@@ -332,6 +333,7 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
|
||||
}
|
||||
|
||||
theend:
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
pm_runtime_put_autosuspend(rkc->dev);
|
||||
|
||||
rk_hash_unprepare(engine, breq);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
@@ -363,6 +363,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
|
||||
}
|
||||
}
|
||||
err = 0;
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
rk_cipher_hw_init(rkc, areq);
|
||||
if (ivsize) {
|
||||
if (ivsize == DES_BLOCK_SIZE)
|
||||
@@ -378,6 +379,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
|
||||
crypto_dma_start(rkc, sgs, sgd, todo / 4);
|
||||
wait_for_completion_interruptible_timeout(&rkc->complete,
|
||||
msecs_to_jiffies(2000));
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
if (!rkc->status) {
|
||||
dev_err(rkc->dev, "DMA timeout\n");
|
||||
err = -EFAULT;
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_trng.c b/drivers/crypto/rockchip/rk3288_crypto_trng.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_trng.c
|
||||
@@ -0,0 +1,92 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * rk3288_crypto_trng.c - hardware cryptographic offloader for rockchip
|
||||
+ *
|
||||
+ * Copyright (C) 2022-2023 Corentin Labbe <clabbe@baylibre.com>
|
||||
+ *
|
||||
+ * This file handle the TRNG
|
||||
+ */
|
||||
+#include "rk3288_crypto.h"
|
||||
+#include <linux/hw_random.h>
|
||||
+#include <linux/iopoll.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
+
|
||||
+static int rk3288_trng_read(struct hwrng *hwrng, void *data, size_t max, bool wait)
|
||||
+{
|
||||
+ struct rk_crypto_info *rk;
|
||||
+ unsigned int todo;
|
||||
+ int err = 0;
|
||||
+ int i;
|
||||
+ u32 v;
|
||||
+
|
||||
+ rk = container_of(hwrng, struct rk_crypto_info, hwrng);
|
||||
+
|
||||
+ todo = min_t(size_t, max, RK_CRYPTO_MAX_TRNG_BYTE);
|
||||
+
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
+ rk->hwrng_stat_req++;
|
||||
+ rk->hwrng_stat_bytes += todo;
|
||||
+#endif
|
||||
+
|
||||
+ err = pm_runtime_resume_and_get(rk->dev);
|
||||
+ if (err < 0)
|
||||
+ goto err_pm;
|
||||
+
|
||||
+ mutex_lock(&rk->lock);
|
||||
+
|
||||
+#define HIWORD_UPDATE(val, mask, shift) \
|
||||
+ ((val) << (shift) | (mask) << ((shift) + 16))
|
||||
+ v = RK_CRYPTO_OSC_ENABLE | RK_CRYPTO_RNG_SAMPLE;
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_TRNG_CTRL, v);
|
||||
+
|
||||
+ v = HIWORD_UPDATE(RK_CRYPTO_TRNG_START, RK_CRYPTO_TRNG_START, 0);
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_CTRL, v);
|
||||
+ wmb();
|
||||
+
|
||||
+ err = readl_poll_timeout(rk->reg + RK_CRYPTO_CTRL, v,
|
||||
+ !(v & RK_CRYPTO_TRNG_START),
|
||||
+ 100, 2000);
|
||||
+ if (err) {
|
||||
+ dev_err(rk->dev, "HWRNG read timeout");
|
||||
+ goto readfail;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < todo / 4; i++) {
|
||||
+ v = readl(rk->reg + RK_CRYPTO_TRNG_DOUT_0 + i * 4);
|
||||
+ put_unaligned_le32(v, data + i * 4);
|
||||
+ }
|
||||
+
|
||||
+ err = todo;
|
||||
+
|
||||
+ v = HIWORD_UPDATE(0, RK_CRYPTO_TRNG_START, 0);
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_CTRL, v);
|
||||
+
|
||||
+readfail:
|
||||
+ mutex_unlock(&rk->lock);
|
||||
+
|
||||
+ pm_runtime_put(rk->dev);
|
||||
+
|
||||
+err_pm:
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+int rk3288_hwrng_register(struct rk_crypto_info *rk)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ dev_info(rk->dev, "Register TRNG with sample=%d\n", RK_CRYPTO_RNG_SAMPLE);
|
||||
+
|
||||
+ rk->hwrng.name = "Rockchip rk3288 TRNG";
|
||||
+ rk->hwrng.read = rk3288_trng_read;
|
||||
+ rk->hwrng.quality = 300;
|
||||
+
|
||||
+ ret = hwrng_register(&rk->hwrng);
|
||||
+ if (ret)
|
||||
+ dev_err(rk->dev, "Fail to register the TRNG\n");
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+void rk3288_hwrng_unregister(struct rk_crypto_info *rk)
|
||||
+{
|
||||
+ hwrng_unregister(&rk->hwrng);
|
||||
+}
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
Date: Wed, 21 Jul 2021 20:59:39 +0000
|
||||
Subject: Disable MTU validation
|
||||
|
||||
This patch reverts: https://github.com/torvalds/linux/commit/eaf4fac478077d4ed57cbca2c044c4b58a96bd98
|
||||
|
||||
It works around following issues:
|
||||
- no way to change MTU (tx_fifo_size is reported as 0 for Rockchip's dwmac)
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ----------
|
||||
1 file changed, 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -5846,27 +5846,15 @@ static void stmmac_set_rx_mode(struct net_device *dev)
|
||||
static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
- int txfifosz = priv->plat->tx_fifo_size;
|
||||
struct stmmac_dma_conf *dma_conf;
|
||||
const int mtu = new_mtu;
|
||||
int ret;
|
||||
|
||||
- if (txfifosz == 0)
|
||||
- txfifosz = priv->dma_cap.tx_fifo_size;
|
||||
-
|
||||
- txfifosz /= priv->plat->tx_queues_to_use;
|
||||
-
|
||||
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
||||
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- new_mtu = STMMAC_ALIGN(new_mtu);
|
||||
-
|
||||
- /* If condition true, FIFO is too small or MTU too large */
|
||||
- if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
||||
- return -EINVAL;
|
||||
-
|
||||
if (netif_running(dev)) {
|
||||
netdev_dbg(priv->dev, "restarting interface to change its MTU\n");
|
||||
/* Try to allocate the new DMA conf with the new mtu */
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SuperKali <hello@superkali.me>
|
||||
Date: Fri, 7 Mar 2025 15:06:42 +0000
|
||||
Subject: drm/rockchip: Set dma mask to 64 bit
|
||||
|
||||
The vop mmu support translate physical address upper 4 GB to iova
|
||||
below 4 GB. So set dma mask to 64 bit to indicate we support address
|
||||
> 4GB.
|
||||
|
||||
This can avoid warnging message like this on some boards with DDR
|
||||
> 4 GB:
|
||||
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 0 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 0 (slots)
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
@@ -472,7 +472,9 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static void rockchip_drm_platform_remove(struct platform_device *pdev)
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yannick Adam <yannick.adam@gmail.com>
|
||||
Date: Tue, 14 Apr 2020 17:15:09 +0200
|
||||
Subject: [ARCHEOLOGY] Enable es8316 on RockPi4 (#1885)
|
||||
|
||||
> X-Git-Archeology: - Revision 454038a50d1d24e636626213ad65b3463d632aa0: https://github.com/armbian/build/commit/454038a50d1d24e636626213ad65b3463d632aa0
|
||||
> X-Git-Archeology: Date: Tue, 14 Apr 2020 17:15:09 +0200
|
||||
> X-Git-Archeology: From: Yannick Adam <yannick.adam@gmail.com>
|
||||
> X-Git-Archeology: Subject: Enable es8316 on RockPi4 (#1885)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision bd486c75623e75bdf2bdcaf09dc5a0affe9706c1: https://github.com/armbian/build/commit/bd486c75623e75bdf2bdcaf09dc5a0affe9706c1
|
||||
> X-Git-Archeology: Date: Tue, 14 Apr 2020 20:14:24 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Enable es8316 on RockPi4 for Rockchip64 current too https://github.com/armbian/build/pull/1885
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e7377248b3cae186e24e2be781cd3365b43246f0: https://github.com/armbian/build/commit/e7377248b3cae186e24e2be781cd3365b43246f0
|
||||
> X-Git-Archeology: Date: Thu, 22 Jul 2021 00:15:54 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Second part of EDGE bumping to 5.13.y (#3045)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 744ea89a589d62cb6f409baab60fc6664520bc39: https://github.com/armbian/build/commit/744ea89a589d62cb6f409baab60fc6664520bc39
|
||||
> X-Git-Archeology: Date: Wed, 08 Sep 2021 17:51:34 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bumping EDGE kernel to 5.14.y (#3125)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e: https://github.com/armbian/build/commit/dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e
|
||||
> X-Git-Archeology: Date: Tue, 09 Nov 2021 18:06:34 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump imx6, xu4, rockchip64 and jetson-nano to 5.15 (#3238)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6b490e16944b30ff69bf9c13678905187df0d9d4: https://github.com/armbian/build/commit/6b490e16944b30ff69bf9c13678905187df0d9d4
|
||||
> X-Git-Archeology: Date: Tue, 11 Jan 2022 15:26:11 +0100
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: move kernel edge to 5.16 (#3387)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision f52a4193d02ef88333ba117c68d49486dfd7ff41: https://github.com/armbian/build/commit/f52a4193d02ef88333ba117c68d49486dfd7ff41
|
||||
> X-Git-Archeology: Date: Sun, 20 Mar 2022 22:58:21 +0100
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: Adding Pine64 Quartz64a as WIP target (#3539)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0afe24c95729044910e0b3f84dc5500bcdc6524c: https://github.com/armbian/build/commit/0afe24c95729044910e0b3f84dc5500bcdc6524c
|
||||
> X-Git-Archeology: Date: Sun, 24 Apr 2022 22:33:47 +0200
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: move kernel media edge to 5.17 (#3704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
sound/soc/codecs/es8316.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/sound/soc/codecs/es8316.c
|
||||
+++ b/sound/soc/codecs/es8316.c
|
||||
@@ -732,7 +732,7 @@ static void es8316_disable_jack_detect(struct snd_soc_component *component)
|
||||
snd_soc_component_update_bits(component, ES8316_GPIO_DEBOUNCE,
|
||||
ES8316_GPIO_ENABLE_INTERRUPT, 0);
|
||||
|
||||
- if (es8316->jack->status & SND_JACK_MICROPHONE) {
|
||||
+ if (es8316->jack && (es8316->jack->status & SND_JACK_MICROPHONE)) {
|
||||
es8316_disable_micbias_for_mic_gnd_short_detect(component);
|
||||
snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0);
|
||||
}
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 17 Feb 2019 22:14:38 +0000
|
||||
Subject: mmc: core: set initial signal voltage on power off
|
||||
|
||||
Some boards have SD card connectors where the power rail cannot be switched
|
||||
off by the driver. If the card has not been power cycled, it may still be
|
||||
using 1.8V signaling after a warm re-boot. Bootroms expecting 3.3V signaling
|
||||
will fail to boot from a UHS card that continue to use 1.8V signaling.
|
||||
|
||||
Set initial signal voltage in mmc_power_off() to allow re-boot to function.
|
||||
|
||||
This fixes re-boot with UHS cards on Asus Tinker Board (Rockchip RK3288),
|
||||
same issue have been seen on some Rockchip RK3399 boards.
|
||||
|
||||
I am sending this as a RFC because I have no insights into SD/MMC subsystem,
|
||||
this change fix a re-boot issue on my boards and does not break emmc/sdio.
|
||||
Is this an acceptable workaround? Any advice is appreciated.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/mmc/core/core.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mmc/core/core.c
|
||||
+++ b/drivers/mmc/core/core.c
|
||||
@@ -1373,6 +1373,14 @@ void mmc_power_off(struct mmc_host *host)
|
||||
if (host->ios.power_mode == MMC_POWER_OFF)
|
||||
return;
|
||||
|
||||
+ mmc_set_initial_signal_voltage(host);
|
||||
+
|
||||
+ /*
|
||||
+ * This delay should be sufficient to allow the power supply
|
||||
+ * to reach the minimum voltage.
|
||||
+ */
|
||||
+ mmc_delay(host->ios.power_delay_ms);
|
||||
+
|
||||
mmc_pwrseq_power_off(host);
|
||||
|
||||
host->ios.clock = 0;
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sat, 6 Apr 2024 15:40:30 +0200
|
||||
Subject: hdmi timing core changes and fixes
|
||||
|
||||
---
|
||||
drivers/clk/rockchip/clk-rk3399.c | 49 ++++++++--
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 +--
|
||||
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 42 ++++++++
|
||||
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 7 ++
|
||||
4 files changed, 97 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/rockchip/clk-rk3399.c
|
||||
+++ b/drivers/clk/rockchip/clk-rk3399.c
|
||||
@@ -105,6 +105,39 @@ static struct rockchip_pll_rate_table rk3399_pll_rates[] = {
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
+static struct rockchip_pll_rate_table rk3399_vpll_rates[] = {
|
||||
+ /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */
|
||||
+ RK3036_PLL_RATE( 594000000, 1, 74, 3, 1, 0, 4194304), /* vco = 1782000000 fout = 594000000 */
|
||||
+ RK3036_PLL_RATE( 593406592, 1, 74, 3, 1, 0, 2949838), /* vco = 1780219777 fout = 593406592.36908 */
|
||||
+ RK3036_PLL_RATE( 319750000, 1, 79, 6, 1, 0, 15728640), /* vco = 1918500000 fout = 319750000 */
|
||||
+ RK3036_PLL_RATE( 297000000, 1, 74, 6, 1, 0, 4194304), /* vco = 1782000000 fout = 297000000 */
|
||||
+ RK3036_PLL_RATE( 296703296, 1, 74, 6, 1, 0, 2949838), /* vco = 1780219777 fout = 296703296.18454 */
|
||||
+ RK3036_PLL_RATE( 241500000, 1, 60, 6, 1, 0, 6291456), /* vco = 1449000000 fout = 241500000 */
|
||||
+ RK3036_PLL_RATE( 162000000, 1, 67, 5, 2, 0, 8388608), /* vco = 1620000000 fout = 162000000 */
|
||||
+ RK3036_PLL_RATE( 148500000, 1, 74, 6, 2, 0, 4194304), /* vco = 1782000000 fout = 148500000*/
|
||||
+ RK3036_PLL_RATE( 148351648, 1, 74, 6, 2, 0, 2949838), /* vco = 1780219777 fout = 148351648.09227 */
|
||||
+ RK3036_PLL_RATE( 136750000, 1, 68, 2, 6, 0, 6291456), /* vco = 1641000000 fout = 136750000 */
|
||||
+ RK3036_PLL_RATE( 135000000, 1, 56, 5, 2, 0, 4194304), /* vco = 1350000000 fout = 135000000 */
|
||||
+ RK3036_PLL_RATE( 119000000, 1, 59, 6, 2, 0, 8388608), /* vco = 1428000000 fout = 119000000 */
|
||||
+ RK3036_PLL_RATE( 108000000, 1, 63, 7, 2, 1, 0), /* vco = 1512000000 fout = 108000000 */
|
||||
+ RK3036_PLL_RATE( 106500000, 1, 62, 7, 2, 0, 2097152), /* vco = 1491000000 fout = 106500000 */
|
||||
+ RK3036_PLL_RATE( 88750000, 1, 55, 5, 3, 0, 7864320), /* vco = 1331250000 fout = 88750000 */
|
||||
+ RK3036_PLL_RATE( 85500000, 1, 57, 4, 4, 1, 0), /* vco = 1368000000 fout = 85500000 */
|
||||
+ RK3036_PLL_RATE( 78750000, 1, 59, 6, 3, 0, 1048576), /* vco = 1417500000 fout = 78750000 */
|
||||
+ RK3036_PLL_RATE( 74250000, 1, 74, 6, 4, 0, 4194304), /* vco = 1782000000 fout = 74250000 */
|
||||
+ RK3036_PLL_RATE( 74175824, 1, 74, 6, 4, 0, 2949838), /* vco = 1780219777 fout = 74175824.046135 */
|
||||
+ RK3036_PLL_RATE( 71000000, 1, 71, 6, 4, 1, 0), /* vco = 1704000000 fout = 71000000 */
|
||||
+ RK3036_PLL_RATE( 65000000, 1, 65, 6, 4, 0, 0), /* vco = 1560000000 fout = 65000000 */
|
||||
+ RK3036_PLL_RATE( 59340659, 1, 59, 6, 4, 0, 5715310), /* vco = 1424175816 fout = 59340659.022331 */
|
||||
+ RK3036_PLL_RATE( 54000000, 1, 63, 7, 4, 1, 0), /* vco = 1512000000 fout = 54000000 */
|
||||
+ RK3036_PLL_RATE( 49500000, 1, 72, 5, 7, 0, 3145728), /* vco = 1732500000 fout = 49500000 */
|
||||
+ RK3036_PLL_RATE( 40000000, 1, 70, 7, 6, 1, 0), /* vco = 1680000000 fout = 40000000 */
|
||||
+ RK3036_PLL_RATE( 31500000, 1, 55, 7, 6, 0, 2097152), /* vco = 1323000000 fout = 31500000 */
|
||||
+ RK3036_PLL_RATE( 27000000, 1, 55, 7, 7, 0, 2097152), /* vco = 1323000000 fout = 27000000 */
|
||||
+ RK3036_PLL_RATE( 26973026, 1, 55, 7, 7, 0, 1173214), /* vco = 1321678296 fout = 26973026.450799 */
|
||||
+ { /* sentinel */ },
|
||||
+};
|
||||
+
|
||||
/* CRU parents */
|
||||
PNAME(mux_pll_p) = { "xin24m", "xin32k" };
|
||||
|
||||
@@ -123,7 +156,7 @@ PNAME(mux_ddrclk_p) = { "clk_ddrc_lpll_src",
|
||||
PNAME(mux_aclk_cci_p) = { "cpll_aclk_cci_src",
|
||||
"gpll_aclk_cci_src",
|
||||
"npll_aclk_cci_src",
|
||||
- "vpll_aclk_cci_src" };
|
||||
+ "prevent:vpll" };
|
||||
PNAME(mux_cci_trace_p) = { "cpll_cci_trace",
|
||||
"gpll_cci_trace" };
|
||||
PNAME(mux_cs_p) = { "cpll_cs", "gpll_cs",
|
||||
@@ -149,10 +182,12 @@ PNAME(mux_pll_src_cpll_gpll_npll_upll_24m_p) = { "cpll", "gpll", "npll",
|
||||
PNAME(mux_pll_src_cpll_gpll_npll_ppll_upll_24m_p) = { "cpll", "gpll", "npll",
|
||||
"ppll", "upll", "xin24m" };
|
||||
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "cpll", "gpll" };
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "vpll", "cpll", "gpll",
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "prevent:vpll", "cpll", "gpll" };
|
||||
+PNAME(vop0_mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "prevent:cpll", "prevent:gpll" };
|
||||
+
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "prevent:vpll", "cpll", "gpll",
|
||||
"npll" };
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "vpll", "cpll", "gpll",
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "prevent:vpll", "cpll", "gpll",
|
||||
"xin24m" };
|
||||
|
||||
PNAME(mux_dclk_vop0_p) = { "dclk_vop0_div",
|
||||
@@ -229,7 +264,7 @@ static struct rockchip_pll_clock rk3399_pll_clks[] __initdata = {
|
||||
[npll] = PLL(pll_rk3399, PLL_NPLL, "npll", mux_pll_p, 0, RK3399_PLL_CON(40),
|
||||
RK3399_PLL_CON(43), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_pll_rates),
|
||||
[vpll] = PLL(pll_rk3399, PLL_VPLL, "vpll", mux_pll_p, 0, RK3399_PLL_CON(48),
|
||||
- RK3399_PLL_CON(51), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_pll_rates),
|
||||
+ RK3399_PLL_CON(51), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_vpll_rates),
|
||||
};
|
||||
|
||||
static struct rockchip_pll_clock rk3399_pmu_pll_clks[] __initdata = {
|
||||
@@ -279,7 +314,7 @@ static struct rockchip_clk_branch rk3399_uart4_pmu_fracmux __initdata =
|
||||
RK3399_PMU_CLKSEL_CON(5), 8, 2, MFLAGS);
|
||||
|
||||
static struct rockchip_clk_branch rk3399_dclk_vop0_fracmux __initdata =
|
||||
- MUX(DCLK_VOP0, "dclk_vop0", mux_dclk_vop0_p, CLK_SET_RATE_PARENT,
|
||||
+ MUX(DCLK_VOP0, "dclk_vop0", mux_dclk_vop0_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
RK3399_CLKSEL_CON(49), 11, 1, MFLAGS);
|
||||
|
||||
static struct rockchip_clk_branch rk3399_dclk_vop1_fracmux __initdata =
|
||||
@@ -1162,7 +1197,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
|
||||
GATE(HCLK_VOP0_NOC, "hclk_vop0_noc", "hclk_vop0_pre", CLK_IGNORE_UNUSED,
|
||||
RK3399_CLKGATE_CON(28), 0, GFLAGS),
|
||||
|
||||
- COMPOSITE(DCLK_VOP0_DIV, "dclk_vop0_div", mux_pll_src_vpll_cpll_gpll_p, 0,
|
||||
+ COMPOSITE(DCLK_VOP0_DIV, "dclk_vop0_div", vop0_mux_pll_src_vpll_cpll_gpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
RK3399_CLKSEL_CON(49), 8, 2, MFLAGS, 0, 8, DFLAGS,
|
||||
RK3399_CLKGATE_CON(10), 12, GFLAGS),
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -70,15 +70,15 @@ static const u16 csc_coeff_rgb_out_eitu709[3][4] = {
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_in_eitu601[3][4] = {
|
||||
- { 0x2591, 0x1322, 0x074b, 0x0000 },
|
||||
- { 0x6535, 0x2000, 0x7acc, 0x0200 },
|
||||
- { 0x6acd, 0x7534, 0x2000, 0x0200 }
|
||||
+ { 0x2040, 0x1080, 0x0640, 0x0040 },
|
||||
+ { 0xe880, 0x1c00, 0xfb80, 0x0200 },
|
||||
+ { 0xed80, 0xf680, 0x1c00, 0x0200 }
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_in_eitu709[3][4] = {
|
||||
- { 0x2dc5, 0x0d9b, 0x049e, 0x0000 },
|
||||
- { 0x62f0, 0x2000, 0x7d11, 0x0200 },
|
||||
- { 0x6756, 0x78ab, 0x2000, 0x0200 }
|
||||
+ { 0x2740, 0x0bc0, 0x0400, 0x0040 },
|
||||
+ { 0xe680, 0x1c00, 0xfd80, 0x0200 },
|
||||
+ { 0xea40, 0xf980, 0x1c00, 0x0200 }
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_full_to_rgb_limited[3][4] = {
|
||||
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
@@ -177,6 +177,46 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = {
|
||||
}
|
||||
};
|
||||
|
||||
+static const struct dw_hdmi_mpll_config rockchip_mpll_cfg_420[] = {
|
||||
+ {
|
||||
+ 30666000, {
|
||||
+ { 0x00b7, 0x0000 },
|
||||
+ { 0x2157, 0x0000 },
|
||||
+ { 0x40f7, 0x0000 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 92000000, {
|
||||
+ { 0x00b7, 0x0000 },
|
||||
+ { 0x2143, 0x0001 },
|
||||
+ { 0x40a3, 0x0001 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 184000000, {
|
||||
+ { 0x0073, 0x0001 },
|
||||
+ { 0x2146, 0x0002 },
|
||||
+ { 0x4062, 0x0002 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 340000000, {
|
||||
+ { 0x0052, 0x0003 },
|
||||
+ { 0x214d, 0x0003 },
|
||||
+ { 0x4065, 0x0003 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 600000000, {
|
||||
+ { 0x0041, 0x0003 },
|
||||
+ { 0x3b4d, 0x0003 },
|
||||
+ { 0x5a65, 0x0003 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ ~0UL, {
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ },
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = {
|
||||
/* pixelclk bpp8 bpp10 bpp12 */
|
||||
{
|
||||
@@ -338,6 +378,8 @@ static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
|
||||
|
||||
dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display);
|
||||
|
||||
+ dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display);
|
||||
+
|
||||
return phy_power_on(hdmi->phy);
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
@@ -765,6 +765,7 @@ static const struct vop_intr rk3288_vop_intr = {
|
||||
static const struct vop_data rk3288_vop = {
|
||||
.version = VOP_VERSION(3, 1),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 3840, 2160 },
|
||||
.intr = &rk3288_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -872,6 +873,7 @@ static const struct vop_misc rk3368_misc = {
|
||||
|
||||
static const struct vop_data rk3368_vop = {
|
||||
.version = VOP_VERSION(3, 2),
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3368_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -894,6 +896,7 @@ static const struct vop_intr rk3366_vop_intr = {
|
||||
|
||||
static const struct vop_data rk3366_vop = {
|
||||
.version = VOP_VERSION(3, 4),
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1047,6 +1050,7 @@ static const struct vop_afbc rk3399_vop_afbc = {
|
||||
static const struct vop_data rk3399_vop_big = {
|
||||
.version = VOP_VERSION(3, 5),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3399_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1075,6 +1079,7 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = {
|
||||
|
||||
static const struct vop_data rk3399_vop_lit = {
|
||||
.version = VOP_VERSION(3, 6),
|
||||
+ .max_output = { 2560, 1600 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3399_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1097,6 +1102,7 @@ static const struct vop_win_data rk3228_vop_win_data[] = {
|
||||
static const struct vop_data rk3228_vop = {
|
||||
.version = VOP_VERSION(3, 7),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1169,6 +1175,7 @@ static const struct vop_win_data rk3328_vop_win_data[] = {
|
||||
static const struct vop_data rk3328_vop = {
|
||||
.version = VOP_VERSION(3, 8),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3328_vop_intr,
|
||||
.common = &rk3328_common,
|
||||
.modeset = &rk3328_modeset,
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 12 Jan 2025 12:39:03 +0100
|
||||
Subject: rockchip: increase SPDIF max burst value to maximum
|
||||
|
||||
---
|
||||
sound/soc/rockchip/rockchip_spdif.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/sound/soc/rockchip/rockchip_spdif.c
|
||||
+++ b/sound/soc/rockchip/rockchip_spdif.c
|
||||
@@ -329,7 +329,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
|
||||
|
||||
spdif->playback_dma_data.addr = res->start + SPDIF_SMPDR;
|
||||
spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
|
||||
- spdif->playback_dma_data.maxburst = 4;
|
||||
+ spdif->playback_dma_data.maxburst = 8;
|
||||
|
||||
spdif->dev = &pdev->dev;
|
||||
dev_set_drvdata(&pdev->dev, spdif);
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
Date: Mon, 21 Aug 2017 08:54:53 +0200
|
||||
Subject: [ARCHEOLOGY] Increasing DMA block memory allocation to 2048k on all
|
||||
relevant kernels.
|
||||
|
||||
> X-Git-Archeology: > recovered message: > https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
|
||||
> X-Git-Archeology: - Revision 908bb199ec2defd77f7f05d2016980abf100d627: https://github.com/armbian/build/commit/908bb199ec2defd77f7f05d2016980abf100d627
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 08:54:53 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels.
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a3cf7b74858e1f862db8ca238bd44f6406be6662: https://github.com/armbian/build/commit/a3cf7b74858e1f862db8ca238bd44f6406be6662
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 17:52:29 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Revert "Increasing DMA block memory allocation to 2048k on all relevant kernels."
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2be21aad5dc965b3bc67e136a1e1170119d60f74: https://github.com/armbian/build/commit/2be21aad5dc965b3bc67e136a1e1170119d60f74
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 17:52:48 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels. https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision b3d2bd4864d89ce032344051e6ced2ba9371084b: https://github.com/armbian/build/commit/b3d2bd4864d89ce032344051e6ced2ba9371084b
|
||||
> X-Git-Archeology: Date: Wed, 30 Aug 2017 05:42:08 +0000
|
||||
> X-Git-Archeology: From: Tonymac32 <tonymckahan@gmail.com>
|
||||
> X-Git-Archeology: Subject: Meson64 Dev increase DMA block memory allocation
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2c59bb9934b749b5df74d4134cd393dc24fd5160: https://github.com/armbian/build/commit/2c59bb9934b749b5df74d4134cd393dc24fd5160
|
||||
> X-Git-Archeology: Date: Mon, 18 Sep 2017 12:06:30 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Lepotato. Added NEXT, added patches from C2 NEXT, au, config update, removed deprecated patches, ...
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 13e94e58f04be27db51d18b7dac1d15a1864b79e: https://github.com/armbian/build/commit/13e94e58f04be27db51d18b7dac1d15a1864b79e
|
||||
> X-Git-Archeology: Date: Fri, 27 Oct 2017 16:14:21 +0300
|
||||
> X-Git-Archeology: From: zador-blood-stained <zador-blood-stained@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Remove random executable bits from patch files
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2c08ec8f5a210de35f9482f482ac01ea15381792: https://github.com/armbian/build/commit/2c08ec8f5a210de35f9482f482ac01ea15381792
|
||||
> X-Git-Archeology: Date: Thu, 24 May 2018 13:32:29 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Merge sunxi family into stable
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 7d2f3af08f23049c91c88eec5062613bbfbc85d4: https://github.com/armbian/build/commit/7d2f3af08f23049c91c88eec5062613bbfbc85d4
|
||||
> X-Git-Archeology: Date: Thu, 24 May 2018 15:44:15 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Merging Rockchip family
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 99a34c7be1e342247a981f99c7930ee73c144f3e: https://github.com/armbian/build/commit/99a34c7be1e342247a981f99c7930ee73c144f3e
|
||||
> X-Git-Archeology: Date: Tue, 26 Jun 2018 12:47:49 +0000
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Move Odroid C2 from 4.14.y to 4.16.y, added patch for ethernet, DEV to master, both tested ... not perfect but in a better condition.
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision fcb85f17675990514d8fadc905e6ccc3bded7138: https://github.com/armbian/build/commit/fcb85f17675990514d8fadc905e6ccc3bded7138
|
||||
> X-Git-Archeology: Date: Thu, 28 Jun 2018 08:27:08 +0000
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Major Amlogic RFC and cleanup
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision c57ebd663cf1b15ad193d4a761f9c044ba3b2acf: https://github.com/armbian/build/commit/c57ebd663cf1b15ad193d4a761f9c044ba3b2acf
|
||||
> X-Git-Archeology: Date: Tue, 17 Jul 2018 16:11:07 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: - attach Odroid XU4 4.14.y back to Hardkernel kernel branch
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a26ccdee627f1fa27b3285e3840434cddb5aae62: https://github.com/armbian/build/commit/a26ccdee627f1fa27b3285e3840434cddb5aae62
|
||||
> X-Git-Archeology: Date: Wed, 07 Nov 2018 11:11:51 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [odroid xu4] Drop kernel 3.10.y, default -> offical 4.14.y, next = vanilla 4.19.y http://ix.io/1rcZ & dev = n/a
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81: https://github.com/armbian/build/commit/a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81
|
||||
> X-Git-Archeology: Date: Fri, 18 Jan 2019 20:10:35 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [ odroidxu4 ] Reverting NEXT back to stock 4.14.y due to many troubles, DEV = 4.19.y
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 79c1c2781915c59bd24576af92b9dbe57da24fac: https://github.com/armbian/build/commit/79c1c2781915c59bd24576af92b9dbe57da24fac
|
||||
> X-Git-Archeology: Date: Fri, 17 May 2019 10:46:57 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [ odroidxu4 dev ] Move to 5.1.y
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 150ac0c2afa147d9e3b036c8ecd8238fe5648cf3: https://github.com/armbian/build/commit/150ac0c2afa147d9e3b036c8ecd8238fe5648cf3
|
||||
> X-Git-Archeology: Date: Tue, 19 Nov 2019 23:25:39 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Remove K<4, change branches, new features (#1586)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5: https://github.com/armbian/build/commit/4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5
|
||||
> X-Git-Archeology: Date: Wed, 02 Sep 2020 23:22:09 +0200
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switched rockchip64 curent to kernel 5.8.y (#2175)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e4d413b9166e3633b40fb23382fb1045b9d0e315: https://github.com/armbian/build/commit/e4d413b9166e3633b40fb23382fb1045b9d0e315
|
||||
> X-Git-Archeology: Date: Tue, 26 Mar 2024 13:46:35 +0100
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.8
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 69ca2492628b2aae217c33fde921b3840851eb14: https://github.com/armbian/build/commit/69ca2492628b2aae217c33fde921b3840851eb14
|
||||
> X-Git-Archeology: Date: Wed, 05 Jun 2024 22:18:24 +0200
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.9
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 4ae0a958146810117050d0dbd359b99691a0fa0c: https://github.com/armbian/build/commit/4ae0a958146810117050d0dbd359b99691a0fa0c
|
||||
> X-Git-Archeology: Date: Mon, 22 Jul 2024 19:17:52 +0200
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.10
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
kernel/dma/pool.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/kernel/dma/pool.c
|
||||
+++ b/kernel/dma/pool.c
|
||||
@@ -189,13 +189,11 @@ static int __init dma_atomic_pool_init(void)
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
- * If coherent_pool was not used on the command line, default the pool
|
||||
- * sizes to 128KB per 1GB of memory, min 128KB, max MAX_PAGE_ORDER.
|
||||
+ * Always use 2MiB as default pool size.
|
||||
+ * See: https://forum.armbian.com/topic/4811-uas-mainline-kernel-coherent-pool-memory-size/
|
||||
*/
|
||||
if (!atomic_pool_size) {
|
||||
- unsigned long pages = totalram_pages() / (SZ_1G / SZ_128K);
|
||||
- pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
|
||||
- atomic_pool_size = max_t(size_t, pages << PAGE_SHIFT, SZ_128K);
|
||||
+ atomic_pool_size = SZ_2M;
|
||||
}
|
||||
INIT_WORK(&atomic_pool_work, atomic_pool_work_fn);
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,421 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 12 Jan 2025 12:36:50 +0100
|
||||
Subject: pl330: fix dma engine periodic transfers
|
||||
|
||||
---
|
||||
drivers/dma/pl330.c | 277 +++++++---
|
||||
1 file changed, 186 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -239,6 +239,7 @@ enum pl330_byteswap {
|
||||
|
||||
#define BYTE_TO_BURST(b, ccr) ((b) / BRST_SIZE(ccr) / BRST_LEN(ccr))
|
||||
#define BURST_TO_BYTE(c, ccr) ((c) * BRST_SIZE(ccr) * BRST_LEN(ccr))
|
||||
+#define BYTE_MOD_BURST_LEN(b, ccr) (((b) / BRST_SIZE(ccr)) % BRST_LEN(ccr))
|
||||
|
||||
/*
|
||||
* With 256 bytes, we can do more than 2.5MB and 5MB xfers per req
|
||||
@@ -455,9 +456,6 @@ struct dma_pl330_chan {
|
||||
enum dma_data_direction dir;
|
||||
struct dma_slave_config slave_config;
|
||||
|
||||
- /* for cyclic capability */
|
||||
- bool cyclic;
|
||||
-
|
||||
/* for runtime pm tracking */
|
||||
bool active;
|
||||
};
|
||||
@@ -545,6 +543,10 @@ struct dma_pl330_desc {
|
||||
unsigned peri:5;
|
||||
/* Hook to attach to DMAC's list of reqs with due callback */
|
||||
struct list_head rqd;
|
||||
+
|
||||
+ /* For cyclic capability */
|
||||
+ bool cyclic;
|
||||
+ size_t num_periods;
|
||||
};
|
||||
|
||||
struct _xfer_spec {
|
||||
@@ -1368,6 +1370,108 @@ static inline int _loop(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[],
|
||||
return off;
|
||||
}
|
||||
|
||||
+static int _period(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[],
|
||||
+ unsigned long bursts, const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ unsigned int lcnt1, ljmp1;
|
||||
+ int cyc, off = 0, num_dregs = 0;
|
||||
+ struct _arg_LPEND lpend;
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+
|
||||
+ if (bursts > 256) {
|
||||
+ lcnt1 = 256;
|
||||
+ cyc = bursts / 256;
|
||||
+ } else {
|
||||
+ lcnt1 = bursts;
|
||||
+ cyc = 1;
|
||||
+ }
|
||||
+
|
||||
+ /* loop1 */
|
||||
+ off += _emit_LP(dry_run, &buf[off], 1, lcnt1);
|
||||
+ ljmp1 = off;
|
||||
+ off += _bursts(pl330, dry_run, &buf[off], pxs, cyc);
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmp1;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ /* remainder */
|
||||
+ lcnt1 = bursts - (lcnt1 * cyc);
|
||||
+
|
||||
+ if (lcnt1) {
|
||||
+ off += _emit_LP(dry_run, &buf[off], 1, lcnt1);
|
||||
+ ljmp1 = off;
|
||||
+ off += _bursts(pl330, dry_run, &buf[off], pxs, 1);
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmp1;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+ }
|
||||
+
|
||||
+ num_dregs = BYTE_MOD_BURST_LEN(x->bytes, pxs->ccr);
|
||||
+
|
||||
+ if (num_dregs) {
|
||||
+ off += _dregs(pl330, dry_run, &buf[off], pxs, num_dregs);
|
||||
+ off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr);
|
||||
+ }
|
||||
+
|
||||
+ off += _emit_SEV(dry_run, &buf[off], ev);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
+static inline int _loop_cyclic(struct pl330_dmac *pl330, unsigned int dry_run,
|
||||
+ u8 buf[], unsigned long bursts,
|
||||
+ const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ int off, periods, residue, i;
|
||||
+ unsigned int lcnt0, ljmp0, ljmpfe;
|
||||
+ struct _arg_LPEND lpend;
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+
|
||||
+ off = 0;
|
||||
+ ljmpfe = off;
|
||||
+ lcnt0 = pxs->desc->num_periods;
|
||||
+ periods = 1;
|
||||
+
|
||||
+ while (lcnt0 > 256) {
|
||||
+ periods++;
|
||||
+ lcnt0 = pxs->desc->num_periods / periods;
|
||||
+ }
|
||||
+
|
||||
+ residue = pxs->desc->num_periods % periods;
|
||||
+
|
||||
+ /* forever loop */
|
||||
+ off += _emit_MOV(dry_run, &buf[off], SAR, x->src_addr);
|
||||
+ off += _emit_MOV(dry_run, &buf[off], DAR, x->dst_addr);
|
||||
+
|
||||
+ /* loop0 */
|
||||
+ off += _emit_LP(dry_run, &buf[off], 0, lcnt0);
|
||||
+ ljmp0 = off;
|
||||
+
|
||||
+ for (i = 0; i < periods; i++)
|
||||
+ off += _period(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 0;
|
||||
+ lpend.bjump = off - ljmp0;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ for (i = 0; i < residue; i++)
|
||||
+ off += _period(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = true;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmpfe;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
static inline int _setup_loops(struct pl330_dmac *pl330,
|
||||
unsigned dry_run, u8 buf[],
|
||||
const struct _xfer_spec *pxs)
|
||||
@@ -1407,6 +1511,21 @@ static inline int _setup_xfer(struct pl330_dmac *pl330,
|
||||
return off;
|
||||
}
|
||||
|
||||
+static inline int _setup_xfer_cyclic(struct pl330_dmac *pl330,
|
||||
+ unsigned int dry_run, u8 buf[],
|
||||
+ const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+ u32 ccr = pxs->ccr;
|
||||
+ unsigned long bursts = BYTE_TO_BURST(x->bytes, ccr);
|
||||
+ int off = 0;
|
||||
+
|
||||
+ /* Setup Loop(s) */
|
||||
+ off += _loop_cyclic(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* A req is a sequence of one or more xfer units.
|
||||
* Returns the number of bytes taken to setup the MC for the req.
|
||||
@@ -1424,12 +1543,17 @@ static int _setup_req(struct pl330_dmac *pl330, unsigned dry_run,
|
||||
/* DMAMOV CCR, ccr */
|
||||
off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr);
|
||||
|
||||
- off += _setup_xfer(pl330, dry_run, &buf[off], pxs);
|
||||
+ if (!pxs->desc->cyclic) {
|
||||
+ off += _setup_xfer(pl330, dry_run, &buf[off], pxs);
|
||||
|
||||
- /* DMASEV peripheral/event */
|
||||
- off += _emit_SEV(dry_run, &buf[off], thrd->ev);
|
||||
- /* DMAEND */
|
||||
- off += _emit_END(dry_run, &buf[off]);
|
||||
+ /* DMASEV peripheral/event */
|
||||
+ off += _emit_SEV(dry_run, &buf[off], thrd->ev);
|
||||
+ /* DMAEND */
|
||||
+ off += _emit_END(dry_run, &buf[off]);
|
||||
+ } else {
|
||||
+ off += _setup_xfer_cyclic(pl330, dry_run, &buf[off],
|
||||
+ pxs, thrd->ev);
|
||||
+ }
|
||||
|
||||
return off;
|
||||
}
|
||||
@@ -1703,15 +1827,17 @@ static int pl330_update(struct pl330_dmac *pl330)
|
||||
|
||||
/* Detach the req */
|
||||
descdone = thrd->req[active].desc;
|
||||
- thrd->req[active].desc = NULL;
|
||||
-
|
||||
- thrd->req_running = -1;
|
||||
-
|
||||
- /* Get going again ASAP */
|
||||
- pl330_start_thread(thrd);
|
||||
-
|
||||
- /* For now, just make a list of callbacks to be done */
|
||||
- list_add_tail(&descdone->rqd, &pl330->req_done);
|
||||
+ if (descdone) {
|
||||
+ if (!descdone->cyclic) {
|
||||
+ thrd->req[active].desc = NULL;
|
||||
+ thrd->req_running = -1;
|
||||
+ /* Get going again ASAP */
|
||||
+ pl330_start_thread(thrd);
|
||||
+ }
|
||||
+
|
||||
+ /* For now, just make a list of callbacks to be done */
|
||||
+ list_add_tail(&descdone->rqd, &pl330->req_done);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2076,12 +2202,25 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
spin_lock_irqsave(&pch->lock, flags);
|
||||
|
||||
/* Pick up ripe tomatoes */
|
||||
- list_for_each_entry_safe(desc, _dt, &pch->work_list, node)
|
||||
+ list_for_each_entry_safe(desc, _dt, &pch->work_list, node) {
|
||||
if (desc->status == DONE) {
|
||||
- if (!pch->cyclic)
|
||||
+ if (!desc->cyclic) {
|
||||
dma_cookie_complete(&desc->txd);
|
||||
- list_move_tail(&desc->node, &pch->completed_list);
|
||||
+ list_move_tail(&desc->node, &pch->completed_list);
|
||||
+ } else {
|
||||
+ struct dmaengine_desc_callback cb;
|
||||
+
|
||||
+ desc->status = BUSY;
|
||||
+ dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
+
|
||||
+ if (dmaengine_desc_callback_valid(&cb)) {
|
||||
+ spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ dmaengine_desc_callback_invoke(&cb, NULL);
|
||||
+ spin_lock_irqsave(&pch->lock, flags);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
|
||||
/* Try to submit a req imm. next to the last completed cookie */
|
||||
fill_queue(pch);
|
||||
@@ -2107,20 +2246,8 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
|
||||
dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
|
||||
- if (pch->cyclic) {
|
||||
- desc->status = PREP;
|
||||
- list_move_tail(&desc->node, &pch->work_list);
|
||||
- if (power_down) {
|
||||
- pch->active = true;
|
||||
- spin_lock(&pch->thread->dmac->lock);
|
||||
- pl330_start_thread(pch->thread);
|
||||
- spin_unlock(&pch->thread->dmac->lock);
|
||||
- power_down = false;
|
||||
- }
|
||||
- } else {
|
||||
- desc->status = FREE;
|
||||
- list_move_tail(&desc->node, &pch->dmac->desc_pool);
|
||||
- }
|
||||
+ desc->status = FREE;
|
||||
+ list_move_tail(&desc->node, &pch->dmac->desc_pool);
|
||||
|
||||
dma_descriptor_unmap(&desc->txd);
|
||||
|
||||
@@ -2168,7 +2295,6 @@ static int pl330_alloc_chan_resources(struct dma_chan *chan)
|
||||
spin_lock_irqsave(&pl330->lock, flags);
|
||||
|
||||
dma_cookie_init(chan);
|
||||
- pch->cyclic = false;
|
||||
|
||||
pch->thread = pl330_request_channel(pl330);
|
||||
if (!pch->thread) {
|
||||
@@ -2367,8 +2493,7 @@ static void pl330_free_chan_resources(struct dma_chan *chan)
|
||||
pl330_release_channel(pch->thread);
|
||||
pch->thread = NULL;
|
||||
|
||||
- if (pch->cyclic)
|
||||
- list_splice_tail_init(&pch->work_list, &pch->dmac->desc_pool);
|
||||
+ list_splice_tail_init(&pch->work_list, &pch->dmac->desc_pool);
|
||||
|
||||
spin_unlock_irqrestore(&pl330->lock, flags);
|
||||
pm_runtime_mark_last_busy(pch->dmac->ddma.dev);
|
||||
@@ -2431,7 +2556,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||
|
||||
/* Check in pending list */
|
||||
list_for_each_entry(desc, &pch->work_list, node) {
|
||||
- if (desc->status == DONE)
|
||||
+ if (desc->status == DONE && !desc->cyclic)
|
||||
transferred = desc->bytes_requested;
|
||||
else if (running && desc == running)
|
||||
transferred =
|
||||
@@ -2516,10 +2641,7 @@ static dma_cookie_t pl330_tx_submit(struct dma_async_tx_descriptor *tx)
|
||||
/* Assign cookies to all nodes */
|
||||
while (!list_empty(&last->node)) {
|
||||
desc = list_entry(last->node.next, struct dma_pl330_desc, node);
|
||||
- if (pch->cyclic) {
|
||||
- desc->txd.callback = last->txd.callback;
|
||||
- desc->txd.callback_param = last->txd.callback_param;
|
||||
- }
|
||||
+
|
||||
desc->last = false;
|
||||
|
||||
dma_cookie_assign(&desc->txd);
|
||||
@@ -2622,6 +2744,9 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
|
||||
desc->peri = peri_id ? pch->chan.chan_id : 0;
|
||||
desc->rqcfg.pcfg = &pch->dmac->pcfg;
|
||||
|
||||
+ desc->cyclic = false;
|
||||
+ desc->num_periods = 1;
|
||||
+
|
||||
dma_async_tx_descriptor_init(&desc->txd, &pch->chan);
|
||||
|
||||
return desc;
|
||||
@@ -2685,12 +2810,10 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
size_t period_len, enum dma_transfer_direction direction,
|
||||
unsigned long flags)
|
||||
{
|
||||
- struct dma_pl330_desc *desc = NULL, *first = NULL;
|
||||
+ struct dma_pl330_desc *desc = NULL;
|
||||
struct dma_pl330_chan *pch = to_pchan(chan);
|
||||
- struct pl330_dmac *pl330 = pch->dmac;
|
||||
- unsigned int i;
|
||||
- dma_addr_t dst;
|
||||
- dma_addr_t src;
|
||||
+ dma_addr_t dst = 0;
|
||||
+ dma_addr_t src = 0;
|
||||
|
||||
if (len % period_len != 0)
|
||||
return NULL;
|
||||
@@ -2706,33 +2829,14 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
if (!pl330_prep_slave_fifo(pch, direction))
|
||||
return NULL;
|
||||
|
||||
- for (i = 0; i < len / period_len; i++) {
|
||||
- desc = pl330_get_desc(pch);
|
||||
- if (!desc) {
|
||||
- unsigned long iflags;
|
||||
-
|
||||
- dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
- __func__, __LINE__);
|
||||
-
|
||||
- if (!first)
|
||||
- return NULL;
|
||||
-
|
||||
- spin_lock_irqsave(&pl330->pool_lock, iflags);
|
||||
-
|
||||
- while (!list_empty(&first->node)) {
|
||||
- desc = list_entry(first->node.next,
|
||||
- struct dma_pl330_desc, node);
|
||||
- list_move_tail(&desc->node, &pl330->desc_pool);
|
||||
- }
|
||||
-
|
||||
- list_move_tail(&first->node, &pl330->desc_pool);
|
||||
-
|
||||
- spin_unlock_irqrestore(&pl330->pool_lock, iflags);
|
||||
-
|
||||
- return NULL;
|
||||
- }
|
||||
+ desc = pl330_get_desc(pch);
|
||||
+ if (!desc) {
|
||||
+ dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
+ __func__, __LINE__);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
- switch (direction) {
|
||||
+ switch (direction) {
|
||||
case DMA_MEM_TO_DEV:
|
||||
desc->rqcfg.src_inc = 1;
|
||||
desc->rqcfg.dst_inc = 0;
|
||||
@@ -2746,27 +2850,18 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
dst = dma_addr;
|
||||
break;
|
||||
default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- desc->rqtype = direction;
|
||||
- desc->rqcfg.brst_size = pch->burst_sz;
|
||||
- desc->rqcfg.brst_len = pch->burst_len;
|
||||
- desc->bytes_requested = period_len;
|
||||
- fill_px(&desc->px, dst, src, period_len);
|
||||
-
|
||||
- if (!first)
|
||||
- first = desc;
|
||||
- else
|
||||
- list_add_tail(&desc->node, &first->node);
|
||||
-
|
||||
- dma_addr += period_len;
|
||||
+ break;
|
||||
}
|
||||
|
||||
- if (!desc)
|
||||
- return NULL;
|
||||
+ desc->rqtype = direction;
|
||||
+ desc->rqcfg.brst_size = pch->burst_sz;
|
||||
+ desc->rqcfg.brst_len = pch->burst_len;
|
||||
+ desc->bytes_requested = len;
|
||||
+ fill_px(&desc->px, dst, src, period_len);
|
||||
|
||||
- pch->cyclic = true;
|
||||
+ desc->cyclic = true;
|
||||
+ desc->num_periods = len / period_len;
|
||||
+ desc->txd.flags = flags;
|
||||
|
||||
return &desc->txd;
|
||||
}
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Thu, 23 Jan 2025 20:23:50 +0100
|
||||
Subject: rockchip/64: pl330 - add support for interleaved transfers
|
||||
|
||||
original source: https://patchwork.kernel.org/project/linux-rockchip/cover/1712150304-60832-1-git-send-email-sugar.zhang@rock-chips.com/
|
||||
---
|
||||
drivers/dma/pl330.c | 168 +++++++++-
|
||||
include/linux/dmaengine.h | 1 +
|
||||
2 files changed, 163 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -543,6 +543,8 @@ struct dma_pl330_desc {
|
||||
unsigned peri:5;
|
||||
/* Hook to attach to DMAC's list of reqs with due callback */
|
||||
struct list_head rqd;
|
||||
+ /* interleaved size */
|
||||
+ struct data_chunk sgl;
|
||||
|
||||
/* For cyclic capability */
|
||||
bool cyclic;
|
||||
@@ -579,6 +581,22 @@ static inline u32 get_revision(u32 periph_id)
|
||||
return (periph_id >> PERIPH_REV_SHIFT) & PERIPH_REV_MASK;
|
||||
}
|
||||
|
||||
+static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
|
||||
+ enum pl330_dst da, u16 val)
|
||||
+{
|
||||
+ if (dry_run)
|
||||
+ return SZ_DMAADDH;
|
||||
+
|
||||
+ buf[0] = CMD_DMAADDH;
|
||||
+ buf[0] |= (da << 1);
|
||||
+ *((__le16 *)&buf[1]) = cpu_to_le16(val);
|
||||
+
|
||||
+ PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n",
|
||||
+ da == 1 ? "DA" : "SA", val);
|
||||
+
|
||||
+ return SZ_DMAADDH;
|
||||
+}
|
||||
+
|
||||
static inline u32 _emit_END(unsigned dry_run, u8 buf[])
|
||||
{
|
||||
if (dry_run)
|
||||
@@ -1189,7 +1207,7 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330,
|
||||
const struct _xfer_spec *pxs, int cyc,
|
||||
enum pl330_cond cond)
|
||||
{
|
||||
- int off = 0;
|
||||
+ int off = 0, i = 0, burstn = 1;
|
||||
|
||||
/*
|
||||
* do FLUSHP at beginning to clear any stale dma requests before the
|
||||
@@ -1197,12 +1215,36 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330,
|
||||
*/
|
||||
if (!(pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP))
|
||||
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
|
||||
+
|
||||
+ if (pxs->desc->sgl.size) {
|
||||
+ WARN_ON(BYTE_MOD_BURST_LEN(pxs->desc->sgl.size, pxs->ccr));
|
||||
+ burstn = BYTE_TO_BURST(pxs->desc->sgl.size, pxs->ccr);
|
||||
+ }
|
||||
+
|
||||
while (cyc--) {
|
||||
- off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
|
||||
- off += _emit_load(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
- pxs->desc->peri);
|
||||
- off += _emit_store(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
- pxs->desc->peri);
|
||||
+ for (i = 0; i < burstn; i++) {
|
||||
+ off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
|
||||
+ off += _emit_load(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
+ pxs->desc->peri);
|
||||
+ off += _emit_store(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
+ pxs->desc->peri);
|
||||
+ }
|
||||
+
|
||||
+ switch (pxs->desc->rqtype) {
|
||||
+ case DMA_DEV_TO_MEM:
|
||||
+ if (pxs->desc->sgl.dst_icg)
|
||||
+ off += _emit_ADDH(dry_run, &buf[off], DST,
|
||||
+ pxs->desc->sgl.dst_icg);
|
||||
+ break;
|
||||
+ case DMA_MEM_TO_DEV:
|
||||
+ if (pxs->desc->sgl.src_icg)
|
||||
+ off += _emit_ADDH(dry_run, &buf[off], SRC,
|
||||
+ pxs->desc->sgl.src_icg);
|
||||
+ break;
|
||||
+ default:
|
||||
+ WARN_ON(1);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
return off;
|
||||
@@ -1483,6 +1525,9 @@ static inline int _setup_loops(struct pl330_dmac *pl330,
|
||||
BRST_SIZE(ccr);
|
||||
int off = 0;
|
||||
|
||||
+ if (pxs->desc->sgl.size)
|
||||
+ bursts = x->bytes / pxs->desc->sgl.size;
|
||||
+
|
||||
while (bursts) {
|
||||
c = bursts;
|
||||
off += _loop(pl330, dry_run, &buf[off], &c, pxs);
|
||||
@@ -2743,6 +2788,9 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
|
||||
|
||||
desc->peri = peri_id ? pch->chan.chan_id : 0;
|
||||
desc->rqcfg.pcfg = &pch->dmac->pcfg;
|
||||
+ desc->sgl.size = 0;
|
||||
+ desc->sgl.src_icg = 0;
|
||||
+ desc->sgl.dst_icg = 0;
|
||||
|
||||
desc->cyclic = false;
|
||||
desc->num_periods = 1;
|
||||
@@ -2866,6 +2914,110 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
return &desc->txd;
|
||||
}
|
||||
|
||||
+static struct dma_async_tx_descriptor *pl330_prep_interleaved_dma(
|
||||
+ struct dma_chan *chan, struct dma_interleaved_template *xt,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ struct dma_pl330_desc *desc = NULL, *first = NULL;
|
||||
+ struct dma_pl330_chan *pch = to_pchan(chan);
|
||||
+ struct pl330_dmac *pl330 = pch->dmac;
|
||||
+ unsigned int i;
|
||||
+ dma_addr_t dst;
|
||||
+ dma_addr_t src;
|
||||
+ size_t size, src_icg, dst_icg, period_bytes, buffer_bytes, full_period_bytes;
|
||||
+ size_t nump = 0, numf = 0;
|
||||
+
|
||||
+ if (!xt->numf || !xt->sgl[0].size || xt->frame_size != 1)
|
||||
+ return NULL;
|
||||
+ nump = xt->nump;
|
||||
+ numf = xt->numf;
|
||||
+ size = xt->sgl[0].size;
|
||||
+ period_bytes = size * nump;
|
||||
+ buffer_bytes = size * numf;
|
||||
+
|
||||
+ if (flags & DMA_PREP_REPEAT && (!nump || (numf % nump)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ src_icg = dmaengine_get_src_icg(xt, &xt->sgl[0]);
|
||||
+ dst_icg = dmaengine_get_dst_icg(xt, &xt->sgl[0]);
|
||||
+
|
||||
+ pl330_config_write(chan, &pch->slave_config, xt->dir);
|
||||
+
|
||||
+ if (!pl330_prep_slave_fifo(pch, xt->dir))
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (i = 0; i < numf / nump; i++) {
|
||||
+ desc = pl330_get_desc(pch);
|
||||
+ if (!desc) {
|
||||
+ unsigned long iflags;
|
||||
+
|
||||
+ dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
+ __func__, __LINE__);
|
||||
+
|
||||
+ if (!first)
|
||||
+ return NULL;
|
||||
+
|
||||
+ spin_lock_irqsave(&pl330->pool_lock, iflags);
|
||||
+
|
||||
+ while (!list_empty(&first->node)) {
|
||||
+ desc = list_entry(first->node.next,
|
||||
+ struct dma_pl330_desc, node);
|
||||
+ list_move_tail(&desc->node, &pl330->desc_pool);
|
||||
+ }
|
||||
+
|
||||
+ list_move_tail(&first->node, &pl330->desc_pool);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&pl330->pool_lock, iflags);
|
||||
+
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ switch (xt->dir) {
|
||||
+ case DMA_MEM_TO_DEV:
|
||||
+ desc->rqcfg.src_inc = 1;
|
||||
+ desc->rqcfg.dst_inc = 0;
|
||||
+ src = xt->src_start + period_bytes * i;
|
||||
+ dst = pch->fifo_dma;
|
||||
+ full_period_bytes = (size + src_icg) * nump;
|
||||
+ break;
|
||||
+ case DMA_DEV_TO_MEM:
|
||||
+ desc->rqcfg.src_inc = 0;
|
||||
+ desc->rqcfg.dst_inc = 1;
|
||||
+ src = pch->fifo_dma;
|
||||
+ dst = xt->dst_start + period_bytes * i;
|
||||
+ full_period_bytes = (size + dst_icg) * nump;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ desc->rqtype = xt->dir;
|
||||
+ desc->rqcfg.brst_size = pch->burst_sz;
|
||||
+ desc->rqcfg.brst_len = pch->burst_len;
|
||||
+ desc->bytes_requested = full_period_bytes;
|
||||
+ desc->sgl.size = size;
|
||||
+ desc->sgl.src_icg = src_icg;
|
||||
+ desc->sgl.dst_icg = dst_icg;
|
||||
+ fill_px(&desc->px, dst, src, period_bytes);
|
||||
+
|
||||
+ if (!first)
|
||||
+ first = desc;
|
||||
+ else
|
||||
+ list_add_tail(&desc->node, &first->node);
|
||||
+ }
|
||||
+
|
||||
+ if (!desc)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (flags & DMA_PREP_REPEAT)
|
||||
+ desc->cyclic = true;
|
||||
+
|
||||
+ dev_dbg(chan->device->dev, "size: %zu, src_icg: %zu, dst_icg: %zu, nump: %zu, numf: %zu\n",
|
||||
+ size, src_icg, dst_icg, nump, numf);
|
||||
+
|
||||
+ return &desc->txd;
|
||||
+}
|
||||
+
|
||||
static struct dma_async_tx_descriptor *
|
||||
pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
|
||||
dma_addr_t src, size_t len, unsigned long flags)
|
||||
@@ -3221,12 +3373,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
dma_cap_set(DMA_SLAVE, pd->cap_mask);
|
||||
dma_cap_set(DMA_CYCLIC, pd->cap_mask);
|
||||
dma_cap_set(DMA_PRIVATE, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_INTERLEAVE, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_REPEAT, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_LOAD_EOT, pd->cap_mask);
|
||||
}
|
||||
|
||||
pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
|
||||
pd->device_free_chan_resources = pl330_free_chan_resources;
|
||||
pd->device_prep_dma_memcpy = pl330_prep_dma_memcpy;
|
||||
pd->device_prep_dma_cyclic = pl330_prep_dma_cyclic;
|
||||
+ pd->device_prep_interleaved_dma = pl330_prep_interleaved_dma;
|
||||
pd->device_tx_status = pl330_tx_status;
|
||||
pd->device_prep_slave_sg = pl330_prep_slave_sg;
|
||||
pd->device_config = pl330_config;
|
||||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/dmaengine.h
|
||||
+++ b/include/linux/dmaengine.h
|
||||
@@ -156,6 +156,7 @@ struct dma_interleaved_template {
|
||||
bool src_sgl;
|
||||
bool dst_sgl;
|
||||
size_t numf;
|
||||
+ size_t nump;
|
||||
size_t frame_size;
|
||||
struct data_chunk sgl[];
|
||||
};
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 26 Jan 2025 14:49:18 +0100
|
||||
Subject: increase pl330 microcode buffer size
|
||||
|
||||
suggestion comes from the scatter/gather functionality as
|
||||
proposed here: https://github.com/radxa/kernel/commit/ec0b65dbc59793426b6dc7af06ab6675f4a24940
|
||||
---
|
||||
drivers/dma/pl330.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -247,7 +247,7 @@ enum pl330_byteswap {
|
||||
* For typical scenario, at 1word/burst, 10MB and 20MB xfers per req
|
||||
* should be enough for P<->M and M<->M respectively.
|
||||
*/
|
||||
-#define MCODE_BUFF_PER_REQ 256
|
||||
+#define MCODE_BUFF_PER_REQ 512
|
||||
|
||||
/* Use this _only_ to wait on transient states */
|
||||
#define UNTIL(t, s) while (!(_state(t) & (s))) cpu_relax();
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sugar Zhang <sugar.zhang@rock-chips.com>
|
||||
Date: Sat, 26 Mar 2022 18:01:21 +0800
|
||||
Subject: dmaengine: pl330: Fix unbalanced runtime PM
|
||||
|
||||
This driver use runtime PM autosuspend mechanism to manager clk.
|
||||
|
||||
pm_runtime_use_autosuspend(&adev->dev);
|
||||
pm_runtime_set_autosuspend_delay(&adev->dev, PL330_AUTOSUSPEND_DELAY);
|
||||
|
||||
So, after ref count reached to zero, it will enter suspend
|
||||
after the delay time elapsed.
|
||||
|
||||
The unbalanced PM:
|
||||
|
||||
* May cause dmac the next start failed.
|
||||
* May cause dmac read unexpected state.
|
||||
* May cause dmac stall if power down happen at the middle of the transfer.
|
||||
e.g. may lose ack from AXI bus and stall.
|
||||
|
||||
Considering the following situation:
|
||||
|
||||
DMA TERMINATE TASKLET ROUTINE
|
||||
| |
|
||||
| issue_pending
|
||||
| |
|
||||
| pch->active = true
|
||||
| pm_runtime_get
|
||||
pm_runtime_put(if active) |
|
||||
pch->active = false |
|
||||
| work_list empty
|
||||
| |
|
||||
| pm_runtime_put(force)
|
||||
| |
|
||||
|
||||
At this point, it's unbalanced(1 get / 2 put).
|
||||
|
||||
After this patch:
|
||||
|
||||
DMA TERMINATE TASKLET ROUTINE
|
||||
| |
|
||||
| issue_pending
|
||||
| |
|
||||
| pch->active = true
|
||||
| pm_runtime_get
|
||||
pm_runtime_put(if active) |
|
||||
pch->active = false |
|
||||
| work_list empty
|
||||
| |
|
||||
| pm_runtime_put(if active)
|
||||
| |
|
||||
|
||||
Now, it's balanced(1 get / 1 put).
|
||||
|
||||
Fixes:
|
||||
commit 5c9e6c2b2ba3 ("dmaengine: pl330: Fix runtime PM support for terminated transfers")
|
||||
commit ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")
|
||||
|
||||
Change-Id: Ib1feb508c16afb4bc9ced0c3660f2b6b4a19c068
|
||||
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
|
||||
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
|
||||
---
|
||||
drivers/dma/pl330.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -2274,7 +2274,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
spin_lock(&pch->thread->dmac->lock);
|
||||
_stop(pch->thread);
|
||||
spin_unlock(&pch->thread->dmac->lock);
|
||||
- power_down = true;
|
||||
+ power_down = pch->active;
|
||||
pch->active = false;
|
||||
} else {
|
||||
/* Make sure the PL330 Channel thread is active */
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 16 Feb 2025 11:15:55 +0100
|
||||
Subject: pl330: fix buffer underrun with cyclic dma
|
||||
|
||||
userspace applications (notably, pulseaudio) were
|
||||
suffering frequent buffer underruns when cyclic DMA
|
||||
was handled by controller itself. This patch fixes
|
||||
the buffer underruns avoiding to juggle with the
|
||||
descriptor state, keeping it in BUSY state as long
|
||||
as it is actual transfer is progressing.
|
||||
---
|
||||
drivers/dma/pl330.c | 24 +++++-----
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -1737,11 +1737,11 @@ static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err)
|
||||
if (!pch)
|
||||
return;
|
||||
|
||||
- spin_lock_irqsave(&pch->lock, flags);
|
||||
-
|
||||
- desc->status = DONE;
|
||||
-
|
||||
- spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ if (!desc->cyclic) {
|
||||
+ spin_lock_irqsave(&pch->lock, flags);
|
||||
+ desc->status = DONE;
|
||||
+ spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ }
|
||||
|
||||
tasklet_schedule(&pch->task);
|
||||
}
|
||||
@@ -2248,23 +2248,23 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
|
||||
/* Pick up ripe tomatoes */
|
||||
list_for_each_entry_safe(desc, _dt, &pch->work_list, node) {
|
||||
- if (desc->status == DONE) {
|
||||
- if (!desc->cyclic) {
|
||||
- dma_cookie_complete(&desc->txd);
|
||||
- list_move_tail(&desc->node, &pch->completed_list);
|
||||
- } else {
|
||||
- struct dmaengine_desc_callback cb;
|
||||
|
||||
+ if (desc->cyclic) {
|
||||
+ if (desc->status == BUSY || desc->status == DONE) {
|
||||
+ struct dmaengine_desc_callback cb;
|
||||
desc->status = BUSY;
|
||||
dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
-
|
||||
if (dmaengine_desc_callback_valid(&cb)) {
|
||||
spin_unlock_irqrestore(&pch->lock, flags);
|
||||
dmaengine_desc_callback_invoke(&cb, NULL);
|
||||
spin_lock_irqsave(&pch->lock, flags);
|
||||
}
|
||||
}
|
||||
+ } else if (desc->status == DONE) {
|
||||
+ dma_cookie_complete(&desc->txd);
|
||||
+ list_move_tail(&desc->node, &pch->completed_list);
|
||||
}
|
||||
+
|
||||
}
|
||||
|
||||
/* Try to submit a req imm. next to the last completed cookie */
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Szczepanik <piter75@gmail.com>
|
||||
Date: Sun, 24 Jan 2021 16:14:06 +0100
|
||||
Subject: add possibility of disabling rk808-rtc
|
||||
|
||||
To disable rk808-rtc driver from loading for specific board
|
||||
add the following stanza to rk808 node in device tree:
|
||||
|
||||
rtc {
|
||||
compatible = "rk808-rtc";
|
||||
status = "disabled";
|
||||
}
|
||||
|
||||
This is needed for roc-rk3399-pc plus (a.k.a. Station P1).
|
||||
Without the change rk808's rtc is initialised and used for time keeping
|
||||
although there is another rtc (hym8563) that should be actually used.
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
---
|
||||
drivers/mfd/mfd-core.c | 2 +-
|
||||
drivers/mfd/rk8xx-core.c | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mfd/mfd-core.c
|
||||
+++ b/drivers/mfd/mfd-core.c
|
||||
@@ -209,7 +209,7 @@ static int mfd_add_device(struct device *parent, int id,
|
||||
|
||||
match:
|
||||
if (!pdev->dev.of_node)
|
||||
- pr_warn("%s: Failed to locate of_node [id: %d]\n",
|
||||
+ pr_debug("%s: Failed to locate of_node [id: %d]\n",
|
||||
cell->name, platform_id);
|
||||
}
|
||||
|
||||
diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mfd/rk8xx-core.c
|
||||
+++ b/drivers/mfd/rk8xx-core.c
|
||||
@@ -134,6 +134,7 @@ static const struct mfd_cell rk818s[] = {
|
||||
{ .name = "rk808-regulator", },
|
||||
{
|
||||
.name = "rk808-rtc",
|
||||
+ .of_compatible = "rk808-rtc",
|
||||
.num_resources = ARRAY_SIZE(rtc_resources),
|
||||
.resources = rtc_resources,
|
||||
},
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Szczepanik <piter75@gmail.com>
|
||||
Date: Tue, 2 Mar 2021 21:07:22 +0100
|
||||
Subject: allows to change the way that BUCK1 and BUCK2 of rk808 PMIC
|
||||
|
||||
This patch allows to change the way that BUCK1 and BUCK2 of rk808 PMIC set voltage.
|
||||
|
||||
It allows to change the hardcoded max. 100mV per one change
|
||||
to any multiple of 12.5mV while keeping the 100mV default.
|
||||
|
||||
It was observed that making the steps smaller (eg. 50mV = 4 * 12.5mV)
|
||||
makes the NanoPi M4V2 running stable.
|
||||
|
||||
One can configure the max number of steps per single change using
|
||||
the "max-buck-steps-per-change" property of rk808 node in device tree.
|
||||
|
||||
Below example ensures that voltage is not changed in jumps larger than 50mV:
|
||||
|
||||
&rk808 {
|
||||
max-buck-steps-per-change = <4>;
|
||||
}
|
||||
|
||||
Be aware that changing this parameter affects the time taken to switch between
|
||||
OPPs of LiTTLE cores of rk3399.
|
||||
|
||||
For overclocked LiTTLE cores with base 408MHz @ 0.825V
|
||||
and max. 1.5GHz @ 1.2V it will take 7 steps of 50mV (at least 65uS each - caused by i2c),
|
||||
the final 25mV step and 1uS to settle: 7 x 65uS + 1uS = 456uS.
|
||||
|
||||
With default setting it would be 3 steps of 100mV (at least 65uS each - caused by i2c),
|
||||
the final 75mV step and 1uS to settle: 3 x 65uS + 1uS = 196uS.
|
||||
|
||||
- rpardini: fix 'client_dev' -> 'dev' (for '->of_node') for 6.5.y
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||||
---
|
||||
drivers/regulator/rk808-regulator.c | 17 +++++++---
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/rk808-regulator.c
|
||||
+++ b/drivers/regulator/rk808-regulator.c
|
||||
@@ -207,6 +207,7 @@ struct rk8xx_register_bit {
|
||||
|
||||
struct rk808_regulator_data {
|
||||
struct gpio_desc *dvs_gpio[2];
|
||||
+ unsigned max_buck_steps_per_change;
|
||||
};
|
||||
|
||||
static const struct linear_range rk808_ldo3_voltage_ranges[] = {
|
||||
@@ -419,7 +420,8 @@ static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev)
|
||||
}
|
||||
|
||||
static int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev,
|
||||
- unsigned sel)
|
||||
+ unsigned sel,
|
||||
+ int max_steps)
|
||||
{
|
||||
int ret, delta_sel;
|
||||
unsigned int old_sel, tmp, val, mask = rdev->desc->vsel_mask;
|
||||
@@ -438,8 +440,8 @@ static int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev,
|
||||
* the risk of overshoot. Put it into a multi-step, can effectively
|
||||
* avoid this problem, a step is 100mv here.
|
||||
*/
|
||||
- while (delta_sel > MAX_STEPS_ONE_TIME) {
|
||||
- old_sel += MAX_STEPS_ONE_TIME;
|
||||
+ while (delta_sel > max_steps) {
|
||||
+ old_sel += max_steps;
|
||||
val = old_sel << (ffs(mask) - 1);
|
||||
val |= tmp;
|
||||
|
||||
@@ -473,12 +475,13 @@ static int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev,
|
||||
struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
|
||||
int id = rdev_get_id(rdev);
|
||||
struct gpio_desc *gpio = pdata->dvs_gpio[id];
|
||||
+ int max_steps = pdata->max_buck_steps_per_change;
|
||||
unsigned int reg = rdev->desc->vsel_reg;
|
||||
unsigned old_sel;
|
||||
int ret, gpio_level;
|
||||
|
||||
if (!gpio)
|
||||
- return rk808_buck1_2_i2c_set_voltage_sel(rdev, sel);
|
||||
+ return rk808_buck1_2_i2c_set_voltage_sel(rdev, sel, max_steps);
|
||||
|
||||
gpio_level = gpiod_get_value(gpio);
|
||||
if (gpio_level == 0) {
|
||||
@@ -1860,6 +1863,12 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map
|
||||
gpiod_is_active_low(pdata->dvs_gpio[i]) ? 0 : tmp);
|
||||
}
|
||||
|
||||
+ tmp = of_property_read_u32(dev->of_node, "max-buck-steps-per-change", &pdata->max_buck_steps_per_change);
|
||||
+ if (tmp) {
|
||||
+ pdata->max_buck_steps_per_change = MAX_STEPS_ONE_TIME;
|
||||
+ }
|
||||
+ dev_info(dev, "max buck steps per change: %d\n", pdata->max_buck_steps_per_change);
|
||||
+
|
||||
dt_parse_end:
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
--
|
||||
Armbian
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
Date: Thu, 4 Sep 2025 15:35:22 +0800
|
||||
Subject: media: rkvdec: remove vb2_is_busy check in rkvdec_s_ctrl
|
||||
|
||||
This check will case green screen when playing videos with
|
||||
chromium. rkvdec driver seems to be the only decoder driver
|
||||
that have this check. Further investigation is needed.
|
||||
---
|
||||
drivers/media/platform/rockchip/rkvdec/rkvdec.c | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
|
||||
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
|
||||
@@ -186,7 +186,6 @@ static int rkvdec_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
|
||||
const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc;
|
||||
enum rkvdec_image_fmt image_fmt;
|
||||
- struct vb2_queue *vq;
|
||||
|
||||
/* Check if this change requires a capture format reset */
|
||||
if (!desc->ops->get_image_fmt)
|
||||
@@ -194,11 +193,6 @@ static int rkvdec_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
|
||||
image_fmt = desc->ops->get_image_fmt(ctx, ctrl);
|
||||
if (rkvdec_image_fmt_changed(ctx, image_fmt)) {
|
||||
- vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
|
||||
- V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
|
||||
- if (vb2_is_busy(vq))
|
||||
- return -EBUSY;
|
||||
-
|
||||
ctx->image_fmt = image_fmt;
|
||||
rkvdec_reset_decoded_fmt(ctx);
|
||||
}
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: amazingfate <liujianfeng1994@gmail.com>
|
||||
Date: Fri, 21 Jun 2024 16:32:55 +0800
|
||||
Subject: media: v4l2-core: Initialize h264 frame_mbs_only_flag as 1
|
||||
|
||||
---
|
||||
drivers/media/v4l2-core/v4l2-ctrls-core.c | 13 ++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
@@ -111,6 +111,7 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
||||
struct v4l2_ctrl_vp9_frame *p_vp9_frame;
|
||||
struct v4l2_ctrl_fwht_params *p_fwht_params;
|
||||
struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
|
||||
+ struct v4l2_ctrl_h264_sps *p_h264_sps;
|
||||
struct v4l2_ctrl_av1_sequence *p_av1_sequence;
|
||||
void *p = ptr.p + idx * ctrl->elem_size;
|
||||
|
||||
@@ -179,6 +180,18 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
||||
*/
|
||||
memset(p_h264_scaling_matrix, 16, sizeof(*p_h264_scaling_matrix));
|
||||
break;
|
||||
+ case V4L2_CTRL_TYPE_H264_SPS:
|
||||
+ p_h264_sps = p;
|
||||
+ /*
|
||||
+ * Without V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY,
|
||||
+ * frame_mbs_only_flag set to 0 will translate to a miniumum
|
||||
+ * height of 32 (see H.264 specification 7-8). Some driver may
|
||||
+ * have a minimum size lower then 32, which would fail
|
||||
+ * validation with the SPS value. Set this flag, so that there
|
||||
+ * is now doubling in the height, allowing a valid default.
|
||||
+ */
|
||||
+ p_h264_sps->flags = V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: amazingfate <liujianfeng1994@gmail.com>
|
||||
Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
Subject: [ARCHEOLOGY] rockchip64-edge: disable hantro g1 h264 decoder on
|
||||
rk356x
|
||||
|
||||
> X-Git-Archeology: - Revision d5cb0d6732f7ab06f34ee6ce18ed6bef266c3c4a: https://github.com/armbian/build/commit/d5cb0d6732f7ab06f34ee6ce18ed6bef266c3c4a
|
||||
> X-Git-Archeology: Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64-edge: disable hantro g1 h264 decoder on rk356x
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 2 +-
|
||||
drivers/media/platform/verisilicon/hantro_drv.c | 1 -
|
||||
drivers/media/platform/verisilicon/hantro_hw.h | 1 -
|
||||
drivers/media/platform/verisilicon/rockchip_vpu_hw.c | 21 ++--------
|
||||
4 files changed, 4 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1242,7 +1242,7 @@ rknn_mmu_2: iommu@fdad9000 {
|
||||
};
|
||||
|
||||
vpu121: video-codec@fdb50000 {
|
||||
- compatible = "rockchip,rk3588-vpu121", "rockchip,rk3568-vpu";
|
||||
+ compatible = "rockchip,rk3588-vpu121", "rockchip,rk3328-vpu";
|
||||
reg = <0x0 0xfdb50000 0x0 0x800>;
|
||||
interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-names = "vdpu";
|
||||
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
@@ -718,7 +718,6 @@ static const struct of_device_id of_hantro_match[] = {
|
||||
{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3568-vepu", .data = &rk3568_vepu_variant, },
|
||||
- { .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vepu_variant, },
|
||||
{ .compatible = "rockchip,rk3588-av1-vpu", .data = &rk3588_vpu981_variant, },
|
||||
#endif
|
||||
diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
+++ b/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
@@ -413,7 +413,6 @@ extern const struct hantro_variant rk3288_vpu_variant;
|
||||
extern const struct hantro_variant rk3328_vpu_variant;
|
||||
extern const struct hantro_variant rk3399_vpu_variant;
|
||||
extern const struct hantro_variant rk3568_vepu_variant;
|
||||
-extern const struct hantro_variant rk3568_vpu_variant;
|
||||
extern const struct hantro_variant rk3588_vpu981_variant;
|
||||
extern const struct hantro_variant sama5d4_vdec_variant;
|
||||
extern const struct hantro_variant sunxi_vpu_variant;
|
||||
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
+++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
@@ -724,10 +724,9 @@ const struct hantro_variant rk3288_vpu_variant = {
|
||||
|
||||
const struct hantro_variant rk3328_vpu_variant = {
|
||||
.dec_offset = 0x400,
|
||||
- .dec_fmts = rockchip_vdpu2_dec_fmts,
|
||||
- .num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts),
|
||||
- .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
|
||||
- HANTRO_H264_DECODER,
|
||||
+ .dec_fmts = rk3399_vpu_dec_fmts,
|
||||
+ .num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
|
||||
+ .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER,
|
||||
.codec_ops = rk3399_vpu_codec_ops,
|
||||
.irqs = rockchip_vdpu2_irqs,
|
||||
.num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
|
||||
@@ -771,20 +770,6 @@ const struct hantro_variant rk3568_vepu_variant = {
|
||||
.num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
|
||||
};
|
||||
|
||||
-const struct hantro_variant rk3568_vpu_variant = {
|
||||
- .dec_offset = 0x400,
|
||||
- .dec_fmts = rockchip_vdpu2_dec_fmts,
|
||||
- .num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts),
|
||||
- .codec = HANTRO_MPEG2_DECODER |
|
||||
- HANTRO_VP8_DECODER | HANTRO_H264_DECODER,
|
||||
- .codec_ops = rk3399_vpu_codec_ops,
|
||||
- .irqs = rockchip_vdpu2_irqs,
|
||||
- .num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
|
||||
- .init = rockchip_vpu_hw_init,
|
||||
- .clk_names = rockchip_vpu_clk_names,
|
||||
- .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
|
||||
-};
|
||||
-
|
||||
const struct hantro_variant px30_vpu_variant = {
|
||||
.enc_offset = 0x0,
|
||||
.enc_fmts = rockchip_vpu_enc_fmts,
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Doe <john.doe@somewhere.on.planet>
|
||||
Date: Sat, 30 Aug 2025 14:20:46 +0800
|
||||
Subject: net: ethernet: realtek: add r8169 LED configuration from OF
|
||||
|
||||
Signed-off-by: retro98boy <retro98boy@qq.com>
|
||||
---
|
||||
drivers/net/ethernet/realtek/r8169_main.c | 11 ++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
||||
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/in.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/ip.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
@@ -2382,6 +2383,15 @@ void r8169_apply_firmware(struct rtl8169_private *tp)
|
||||
}
|
||||
}
|
||||
|
||||
+static void rtl8168_led_of_init(struct rtl8169_private *tp)
|
||||
+{
|
||||
+ struct device *d = tp_to_dev(tp);
|
||||
+ u32 val;
|
||||
+
|
||||
+ if (!of_property_read_u32(d->of_node, "realtek,led-data", &val))
|
||||
+ RTL_W16(tp, LED_CTRL, val);
|
||||
+}
|
||||
+
|
||||
static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
|
||||
{
|
||||
/* Adjust EEE LED frequency */
|
||||
@@ -3399,6 +3409,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
|
||||
rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
|
||||
|
||||
rtl8168_config_eee_mac(tp);
|
||||
+ rtl8168_led_of_init(tp);
|
||||
|
||||
RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN);
|
||||
RTL_W8(tp, MISC_1, RTL_R8(tp, MISC_1) & ~PFM_D3COLD_EN);
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,597 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Rock Shen <rock_shen@asus.com>
|
||||
Date: Tue, 27 Apr 2021 11:13:25 +0800
|
||||
Subject: regulator: add fan53200 regulator driver for Tinkerboard-2
|
||||
|
||||
1. Add fan53200 regulator support for vdd_cpu_b & vdd_gpu
|
||||
2. By Tinker2 HW design, Vsel gpio pin polarity was reversed, switch
|
||||
sleep_reg & vol_reg at fan53200_voltages_setup_fairchild
|
||||
3. Use vsel0 as suspend source, vsel1 as normal source
|
||||
|
||||
- rpardini: hammered .probe and probe_type = PROBE_PREFER_ASYNCHRONOUS to
|
||||
work on 6.6.y, after https://lore.kernel.org/all/20230505220218.1239542-1-u.kleine-koenig@pengutronix.de/
|
||||
|
||||
Signed-off-by: Rock Shen <rock_shen@asus.com>
|
||||
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||||
---
|
||||
arch/arm64/configs/defconfig | 1 +
|
||||
drivers/regulator/Kconfig | 11 +
|
||||
drivers/regulator/Makefile | 1 +
|
||||
drivers/regulator/fan53200.c | 520 ++++++++++
|
||||
4 files changed, 533 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -810,6 +810,7 @@ CONFIG_REGULATOR_BD9571MWV=y
|
||||
CONFIG_REGULATOR_CROS_EC=y
|
||||
CONFIG_REGULATOR_DA9211=m
|
||||
CONFIG_REGULATOR_FAN53555=y
|
||||
+CONFIG_REGULATOR_FAN53200=y
|
||||
CONFIG_REGULATOR_GPIO=y
|
||||
CONFIG_REGULATOR_HI6421V530=y
|
||||
CONFIG_REGULATOR_HI655X=y
|
||||
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/Kconfig
|
||||
+++ b/drivers/regulator/Kconfig
|
||||
@@ -440,6 +440,17 @@ config REGULATOR_FAN53880
|
||||
(PMIC), it is controlled by I2C and provides one BUCK, one BOOST
|
||||
and four LDO outputs.
|
||||
|
||||
+config REGULATOR_FAN53200
|
||||
+ tristate "Fairchild FAN53200 Regulator"
|
||||
+ depends on I2C
|
||||
+ select REGMAP_I2C
|
||||
+ help
|
||||
+ This driver supports Fairchild FAN53200 Digitally Programmable
|
||||
+ TinyBuck Regulator. The FAN53200 is a step-down switching voltage
|
||||
+ regulator that delivers a digitally programmable output from an
|
||||
+ input voltage supply of 2.5V to 5.5V. The output voltage is
|
||||
+ programmed through an I2C interface.
|
||||
+
|
||||
config REGULATOR_GPIO
|
||||
tristate "GPIO regulator support"
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/Makefile
|
||||
+++ b/drivers/regulator/Makefile
|
||||
@@ -52,6 +52,7 @@ obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
|
||||
obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
|
||||
obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
|
||||
obj-$(CONFIG_REGULATOR_FAN53880) += fan53880.o
|
||||
+obj-$(CONFIG_REGULATOR_FAN53555) += fan53200.o
|
||||
obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_HI6421V530) += hi6421v530-regulator.o
|
||||
diff --git a/drivers/regulator/fan53200.c b/drivers/regulator/fan53200.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/regulator/fan53200.c
|
||||
@@ -0,0 +1,520 @@
|
||||
+/*
|
||||
+ * FAN53200 Fairchild Digitally Programmable TinyBuck Regulator Driver.
|
||||
+ *
|
||||
+ * Supported Part Numbers:
|
||||
+ * FAN53200UC35X/44X
|
||||
+ *
|
||||
+ * Copyright (c) 2021 ASUSTeK Computer Inc.
|
||||
+ * Rock Shen <rock_shen@asus.com>
|
||||
+ *
|
||||
+ * This package is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/param.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regulator/driver.h>
|
||||
+#include <linux/regulator/machine.h>
|
||||
+#include <linux/regulator/of_regulator.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/of_gpio.h>
|
||||
+
|
||||
+/* Voltage setting */
|
||||
+#define FAN53200_VSEL0 0x00
|
||||
+#define FAN53200_VSEL1 0x01
|
||||
+
|
||||
+/* Control register */
|
||||
+#define FAN53200_CONTROL 0x02
|
||||
+/* IC Type */
|
||||
+#define FAN53200_ID1 0x03
|
||||
+/* IC mask version */
|
||||
+#define FAN53200_ID2 0x04
|
||||
+
|
||||
+/* VSEL bit definitions */
|
||||
+#define VSEL_BUCK_EN (1 << 7)
|
||||
+#define VSEL_MODE (1 << 6)
|
||||
+#define VSEL_NSEL_MASK 0x3F
|
||||
+/* Chip ID and Verison */
|
||||
+#define DIE_ID 0x0F /* ID1 */
|
||||
+#define DIE_REV 0x0F /* ID2 */
|
||||
+/* Control bit definitions */
|
||||
+#define CTL_OUTPUT_DISCHG (1 << 7)
|
||||
+#define CTL_SLEW_MASK (0x7 << 4)
|
||||
+#define CTL_SLEW_SHIFT 4
|
||||
+#define CTL_RESET (1 << 2)
|
||||
+
|
||||
+#define TCS_VSEL_NSEL_MASK 0x7f
|
||||
+#define TCS_VSEL0_MODE (1 << 7)
|
||||
+#define TCS_VSEL1_MODE (1 << 6)
|
||||
+
|
||||
+#define TCS_SLEW_SHIFT 3
|
||||
+#define TCS_SLEW_MASK (0x3 < 3)
|
||||
+
|
||||
+#define FAN53200_NVOLTAGES 64 /* Numbers of voltages */
|
||||
+
|
||||
+enum fan53200_vendor {
|
||||
+ FAN53200_VENDOR_FAIRCHILD = 0,
|
||||
+};
|
||||
+
|
||||
+/* VSEL ID */
|
||||
+enum {
|
||||
+ FAN53200_VSEL_ID_0 = 0,
|
||||
+ FAN53200_VSEL_ID_1,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ FAN53200_CHIP_ID_00 = 0x8001,
|
||||
+ FAN53200_CHIP_ID_01 = 0x8101,
|
||||
+};
|
||||
+
|
||||
+struct fan53200_platform_data {
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ unsigned int slew_rate;
|
||||
+ /* Sleep VSEL ID */
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+};
|
||||
+
|
||||
+struct fan53200_device_info {
|
||||
+ enum fan53200_vendor vendor;
|
||||
+ struct regmap *regmap;
|
||||
+ struct device *dev;
|
||||
+ struct regulator_desc desc;
|
||||
+ struct regulator_dev *rdev;
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ /* IC Type and Rev */
|
||||
+ int chip_id;
|
||||
+ int chip_rev;
|
||||
+ /* Voltage setting register */
|
||||
+ unsigned int vol_reg;
|
||||
+ unsigned int sleep_reg;
|
||||
+ unsigned int mode_reg;
|
||||
+ unsigned int vol_mask;
|
||||
+ unsigned int mode_mask;
|
||||
+ unsigned int slew_reg;
|
||||
+ unsigned int slew_mask;
|
||||
+ unsigned int slew_shift;
|
||||
+ /* Voltage range and step(linear) */
|
||||
+ unsigned int vsel_min;
|
||||
+ unsigned int vsel_step;
|
||||
+ unsigned int n_voltages;
|
||||
+ /* Voltage slew rate limiting */
|
||||
+ unsigned int slew_rate;
|
||||
+ /* Sleep voltage cache */
|
||||
+ unsigned int sleep_vol_cache;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+};
|
||||
+
|
||||
+static unsigned int fan53200_map_mode(unsigned int mode)
|
||||
+{
|
||||
+ return mode == REGULATOR_MODE_FAST ?
|
||||
+ REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_voltage(struct regulator_dev *rdev, int uV)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (di->sleep_vol_cache == uV)
|
||||
+ return 0;
|
||||
+ ret = regulator_map_voltage_linear(rdev, uV, uV);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ ret = regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ di->vol_mask, ret);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ /* Cache the sleep voltage setting.
|
||||
+ * Might not be the real voltage which is rounded */
|
||||
+ di->sleep_vol_cache = uV;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, !di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->vol_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->vol_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_is_enabled(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ if (di->sleep_vsel_id)
|
||||
+ return !gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ else
|
||||
+ return gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->vol_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & VSEL_BUCK_EN)
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_mode(struct regulator_dev *rdev, unsigned int mode)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ switch (mode) {
|
||||
+ case REGULATOR_MODE_FAST:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg,
|
||||
+ di->mode_mask, di->mode_mask);
|
||||
+ break;
|
||||
+ case REGULATOR_MODE_NORMAL:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg, di->mode_mask, 0);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static unsigned int fan53200_get_mode(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->mode_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & di->mode_mask)
|
||||
+ return REGULATOR_MODE_FAST;
|
||||
+ else
|
||||
+ return REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static const int slew_rates[] = {
|
||||
+ 80000,
|
||||
+ 40000,
|
||||
+ 20000,
|
||||
+ 10000,
|
||||
+ 5000,
|
||||
+ 2500,
|
||||
+ 1250,
|
||||
+ 625,
|
||||
+};
|
||||
+
|
||||
+static int fan53200_set_ramp(struct regulator_dev *rdev, int ramp)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int regval = -1, i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(slew_rates); i++) {
|
||||
+ if (ramp <= slew_rates[i])
|
||||
+ regval = i;
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (regval < 0) {
|
||||
+ dev_err(di->dev, "unsupported ramp value %d\n", ramp);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->slew_reg,
|
||||
+ di->slew_mask, regval << di->slew_shift);
|
||||
+}
|
||||
+
|
||||
+static struct regulator_ops fan53200_regulator_ops = {
|
||||
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
|
||||
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
|
||||
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
|
||||
+ .map_voltage = regulator_map_voltage_linear,
|
||||
+ .list_voltage = regulator_list_voltage_linear,
|
||||
+ .set_suspend_voltage = fan53200_set_suspend_voltage,
|
||||
+ .enable = fan53200_set_enable,
|
||||
+ .disable = fan53200_set_disable,
|
||||
+ .is_enabled = fan53200_is_enabled,
|
||||
+ .set_mode = fan53200_set_mode,
|
||||
+ .get_mode = fan53200_get_mode,
|
||||
+ .set_ramp_delay = fan53200_set_ramp,
|
||||
+ .set_suspend_enable = fan53200_set_suspend_enable,
|
||||
+ .set_suspend_disable = fan53200_set_suspend_disable,
|
||||
+};
|
||||
+
|
||||
+static int fan53200_voltages_setup_fairchild(struct fan53200_device_info *di)
|
||||
+{
|
||||
+
|
||||
+ if (di->sleep_vsel_id) {
|
||||
+ di->sleep_reg = FAN53200_VSEL0;
|
||||
+ di->vol_reg = FAN53200_VSEL1;
|
||||
+ } else {
|
||||
+ di->sleep_reg = FAN53200_VSEL1;
|
||||
+ di->vol_reg = FAN53200_VSEL0;
|
||||
+ }
|
||||
+
|
||||
+ /* Init voltage range and step */
|
||||
+ di->vsel_min = 600000;
|
||||
+ di->vsel_step = 12500;
|
||||
+ di->vol_mask = VSEL_NSEL_MASK;
|
||||
+ di->mode_reg = di->vol_reg;
|
||||
+ di->mode_mask = VSEL_MODE;
|
||||
+ di->slew_reg = FAN53200_CONTROL;
|
||||
+ di->slew_mask = CTL_SLEW_MASK;
|
||||
+ di->slew_shift = CTL_SLEW_SHIFT;
|
||||
+ di->n_voltages = FAN53200_NVOLTAGES;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* For 00,01,03,05 options:
|
||||
+ * VOUT = 0.60V + NSELx * 10mV, from 0.60 to 1.23V.
|
||||
+ * For 04 option:
|
||||
+ * VOUT = 0.603V + NSELx * 12.826mV, from 0.603 to 1.411V.
|
||||
+ * */
|
||||
+static int fan53200_device_setup(struct fan53200_device_info *di,
|
||||
+ struct fan53200_platform_data *pdata)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ret = fan53200_voltages_setup_fairchild(di);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_regulator_register(struct fan53200_device_info *di,
|
||||
+ struct regulator_config *config)
|
||||
+{
|
||||
+ struct regulator_desc *rdesc = &di->desc;
|
||||
+
|
||||
+ rdesc->name = "fan53200-reg";
|
||||
+ rdesc->supply_name = "vin";
|
||||
+ rdesc->ops = &fan53200_regulator_ops;
|
||||
+ rdesc->type = REGULATOR_VOLTAGE;
|
||||
+ rdesc->n_voltages = di->n_voltages;
|
||||
+ rdesc->enable_reg = di->vol_reg;
|
||||
+ rdesc->enable_mask = VSEL_BUCK_EN;
|
||||
+ rdesc->min_uV = di->vsel_min;
|
||||
+ rdesc->uV_step = di->vsel_step;
|
||||
+ rdesc->vsel_reg = di->vol_reg;
|
||||
+ rdesc->vsel_mask = di->vol_mask;
|
||||
+ rdesc->owner = THIS_MODULE;
|
||||
+ rdesc->enable_time = 400;
|
||||
+
|
||||
+ di->rdev = devm_regulator_register(di->dev, &di->desc, config);
|
||||
+ return PTR_ERR_OR_ZERO(di->rdev);
|
||||
+}
|
||||
+
|
||||
+static const struct regmap_config fan53200_regmap_config = {
|
||||
+ .reg_bits = 8,
|
||||
+ .val_bits = 8,
|
||||
+};
|
||||
+
|
||||
+static struct fan53200_platform_data *fan53200_parse_dt(struct device *dev,
|
||||
+ struct device_node *np,
|
||||
+ const struct regulator_desc *desc)
|
||||
+{
|
||||
+ struct fan53200_platform_data *pdata;
|
||||
+ int ret, flag;
|
||||
+ u32 tmp;
|
||||
+
|
||||
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||
+ if (!pdata)
|
||||
+ return NULL;
|
||||
+
|
||||
+ pdata->regulator = of_get_regulator_init_data(dev, np, desc);
|
||||
+ pdata->regulator->constraints.initial_state = PM_SUSPEND_MEM;
|
||||
+
|
||||
+ ret = of_property_read_u32(np, "fcs,suspend-voltage-selector",
|
||||
+ &tmp);
|
||||
+ if (!ret)
|
||||
+ pdata->sleep_vsel_id = tmp;
|
||||
+
|
||||
+ if (pdata->sleep_vsel_id)
|
||||
+ flag = GPIOD_OUT_LOW;
|
||||
+ else
|
||||
+ flag = GPIOD_OUT_HIGH;
|
||||
+
|
||||
+ pdata->vsel_gpio =
|
||||
+ devm_gpiod_get_index_optional(dev, "vsel", 0,
|
||||
+ flag);
|
||||
+ if (IS_ERR(pdata->vsel_gpio)) {
|
||||
+ ret = PTR_ERR(pdata->vsel_gpio);
|
||||
+ dev_err(dev, "failed to get vesl gpio (%d)\n", ret);
|
||||
+ }
|
||||
+
|
||||
+ return pdata;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id fan53200_dt_ids[] = {
|
||||
+ {
|
||||
+ .compatible = "fcs,fan53200",
|
||||
+ .data = (void *)FAN53200_VENDOR_FAIRCHILD,
|
||||
+ },
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, fan53200_dt_ids);
|
||||
+
|
||||
+static int fan53200_regulator_probe(struct i2c_client *client)
|
||||
+{
|
||||
+ const struct i2c_device_id *id = i2c_client_get_device_id(client);
|
||||
+ struct device_node *np = client->dev.of_node;
|
||||
+ struct fan53200_device_info *di;
|
||||
+ struct fan53200_platform_data *pdata;
|
||||
+ struct regulator_config config = { };
|
||||
+ unsigned int val;
|
||||
+ int ret;
|
||||
+
|
||||
+ di = devm_kzalloc(&client->dev, sizeof(struct fan53200_device_info),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!di)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ di->desc.of_map_mode = fan53200_map_mode;
|
||||
+
|
||||
+ pdata = dev_get_platdata(&client->dev);
|
||||
+ if (!pdata)
|
||||
+ pdata = fan53200_parse_dt(&client->dev, np, &di->desc);
|
||||
+
|
||||
+ if (!pdata || !pdata->regulator) {
|
||||
+ dev_err(&client->dev, "Platform data not found!\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ di->vsel_gpio = pdata->vsel_gpio;
|
||||
+ di->sleep_vsel_id = pdata->sleep_vsel_id;
|
||||
+
|
||||
+ di->regulator = pdata->regulator;
|
||||
+ if (client->dev.of_node) {
|
||||
+ const struct of_device_id *match;
|
||||
+
|
||||
+ match = of_match_device(of_match_ptr(fan53200_dt_ids),
|
||||
+ &client->dev);
|
||||
+ if (!match)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ di->vendor = (unsigned long) match->data;
|
||||
+ } else {
|
||||
+ /* if no ramp constraint set, get the pdata ramp_delay */
|
||||
+ if (!di->regulator->constraints.ramp_delay) {
|
||||
+ int slew_idx = (pdata->slew_rate & 0x7)
|
||||
+ ? pdata->slew_rate : 0;
|
||||
+
|
||||
+ di->regulator->constraints.ramp_delay
|
||||
+ = slew_rates[slew_idx];
|
||||
+ }
|
||||
+
|
||||
+ di->vendor = id->driver_data;
|
||||
+ }
|
||||
+
|
||||
+ di->regmap = devm_regmap_init_i2c(client, &fan53200_regmap_config);
|
||||
+ if (IS_ERR(di->regmap)) {
|
||||
+ dev_err(&client->dev, "Failed to allocate regmap!\n");
|
||||
+ return PTR_ERR(di->regmap);
|
||||
+ }
|
||||
+ di->dev = &client->dev;
|
||||
+ i2c_set_clientdata(client, di);
|
||||
+ /* Get chip ID */
|
||||
+ ret = regmap_read(di->regmap, FAN53200_ID1, &val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to get chip ID!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ di->chip_id = val & DIE_ID;
|
||||
+ /* Get chip revision */
|
||||
+ ret = regmap_read(di->regmap, FAN53200_ID2, &val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to get chip Rev!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ di->chip_rev = val & DIE_REV;
|
||||
+ dev_info(&client->dev, "FAN53200 Option[%d] Rev[%d] Detected!\n",
|
||||
+ di->chip_id, di->chip_rev);
|
||||
+ /* Device init */
|
||||
+ ret = fan53200_device_setup(di, pdata);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to setup device!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ /* Register regulator */
|
||||
+ config.dev = di->dev;
|
||||
+ config.init_data = di->regulator;
|
||||
+ config.regmap = di->regmap;
|
||||
+ config.driver_data = di;
|
||||
+ config.of_node = np;
|
||||
+
|
||||
+ ret = fan53200_regulator_register(di, &config);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(&client->dev, "Failed to register regulator!\n");
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_device_id fan53200_id[] = {
|
||||
+ {
|
||||
+ .name = "fan53200",
|
||||
+ .driver_data = FAN53200_VENDOR_FAIRCHILD
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(i2c, fan53200_id);
|
||||
+
|
||||
+static struct i2c_driver fan53200_regulator_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "fan53200-regulator",
|
||||
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
||||
+ .of_match_table = of_match_ptr(fan53200_dt_ids),
|
||||
+ },
|
||||
+ .probe = fan53200_regulator_probe,
|
||||
+ .id_table = fan53200_id,
|
||||
+};
|
||||
+
|
||||
+module_i2c_driver(fan53200_regulator_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Rock Shen <rock_shen@asus.com>");
|
||||
+MODULE_DESCRIPTION("FAN53200 regulator driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 16:09:35 +0200
|
||||
Subject: math.h: add DIV_ROUND_UP_NO_OVERFLOW
|
||||
|
||||
Add a new DIV_ROUND_UP helper, which cannot overflow when
|
||||
big numbers are being used.
|
||||
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
include/linux/math.h | 11 ++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/include/linux/math.h b/include/linux/math.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/math.h
|
||||
+++ b/include/linux/math.h
|
||||
@@ -48,6 +48,17 @@
|
||||
|
||||
#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
|
||||
|
||||
+/**
|
||||
+ * DIV_ROUND_UP_NO_OVERFLOW - divide two numbers and always round up
|
||||
+ * @n: numerator / dividend
|
||||
+ * @d: denominator / divisor
|
||||
+ *
|
||||
+ * This functions does the same as DIV_ROUND_UP, but internally uses a
|
||||
+ * division and a modulo operation instead of math tricks. This way it
|
||||
+ * avoids overflowing when handling big numbers.
|
||||
+ */
|
||||
+#define DIV_ROUND_UP_NO_OVERFLOW(n, d) (((n) / (d)) + !!((n) % (d)))
|
||||
+
|
||||
#define DIV_ROUND_DOWN_ULL(ll, d) \
|
||||
({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; })
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 16:13:50 +0200
|
||||
Subject: clk: divider: Fix divisor masking on 64 bit platforms
|
||||
|
||||
The clock framework handles clock rates as "unsigned long", so u32 on
|
||||
32-bit architectures and u64 on 64-bit architectures.
|
||||
|
||||
The current code casts the dividend to u64 on 32-bit to avoid a
|
||||
potential overflow. For example DIV_ROUND_UP(3000000000, 1500000000)
|
||||
= (3.0G + 1.5G - 1) / 1.5G = = OVERFLOW / 1.5G, which has been
|
||||
introduced in commit 9556f9dad8f5 ("clk: divider: handle integer overflow
|
||||
when dividing large clock rates").
|
||||
|
||||
On 64 bit platforms this masks the divisor, so that only the lower
|
||||
32 bit are used. Thus requesting a frequency >= 4.3GHz results
|
||||
in incorrect values. For example requesting 4300000000 (4.3 GHz) will
|
||||
effectively request ca. 5 MHz. Requesting clk_round_rate(clk, ULONG_MAX)
|
||||
is a bit of a special case, since that still returns correct values as
|
||||
long as the parent clock is below 8.5 GHz.
|
||||
|
||||
Fix this by switching to DIV_ROUND_UP_NO_OVERFLOW, which cannot
|
||||
overflow. This avoids any requirements on the arguments (except
|
||||
that divisor should not be 0 obviously).
|
||||
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
drivers/clk/clk-divider.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/clk-divider.c
|
||||
+++ b/drivers/clk/clk-divider.c
|
||||
@@ -226,7 +226,7 @@ static int _div_round_up(const struct clk_div_table *table,
|
||||
unsigned long parent_rate, unsigned long rate,
|
||||
unsigned long flags)
|
||||
{
|
||||
- int div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ int div = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO)
|
||||
div = __roundup_pow_of_two(div);
|
||||
@@ -243,7 +243,7 @@ static int _div_round_closest(const struct clk_div_table *table,
|
||||
int up, down;
|
||||
unsigned long up_rate, down_rate;
|
||||
|
||||
- up = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ up = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
down = parent_rate / rate;
|
||||
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO) {
|
||||
@@ -458,7 +458,7 @@ int divider_get_val(unsigned long rate, unsigned long parent_rate,
|
||||
{
|
||||
unsigned int div, value;
|
||||
|
||||
- div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ div = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
|
||||
if (!_is_valid_div(table, div, flags))
|
||||
return -EINVAL;
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 18:09:57 +0200
|
||||
Subject: clk: composite: replace open-coded abs_diff()
|
||||
|
||||
Replace the open coded abs_diff() with the existing helper function.
|
||||
|
||||
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
drivers/clk/clk-composite.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/clk-composite.c
|
||||
+++ b/drivers/clk/clk-composite.c
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
+#include <linux/math.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
static u8 clk_composite_get_parent(struct clk_hw *hw)
|
||||
@@ -119,10 +120,7 @@ static int clk_composite_determine_rate(struct clk_hw *hw,
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
- if (req->rate >= tmp_req.rate)
|
||||
- rate_diff = req->rate - tmp_req.rate;
|
||||
- else
|
||||
- rate_diff = tmp_req.rate - req->rate;
|
||||
+ rate_diff = abs_diff(req->rate, tmp_req.rate);
|
||||
|
||||
if (!rate_diff || !req->best_parent_hw
|
||||
|| best_rate_diff > rate_diff) {
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Riek <jjriek@verizon.net>
|
||||
Date: Thu, 22 Aug 2024 22:32:47 -0400
|
||||
Subject: arm64: dts: rockchip: Enable automatic fan control on the Turing RK1
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi | 32 +++++++++-
|
||||
1 file changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
|
||||
@@ -23,7 +23,7 @@ aliases {
|
||||
|
||||
fan: pwm-fan {
|
||||
compatible = "pwm-fan";
|
||||
- cooling-levels = <0 25 95 145 195 255>;
|
||||
+ cooling-levels = <0 120 150 180 210 240 255>;
|
||||
fan-supply = <&vcc5v0_sys>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pwm0m2_pins &fan_int>;
|
||||
@@ -268,6 +268,36 @@ map5 {
|
||||
};
|
||||
};
|
||||
|
||||
+&package_thermal {
|
||||
+ polling-delay = <1000>;
|
||||
+
|
||||
+ trips {
|
||||
+ package_fan0: package-fan0 {
|
||||
+ temperature = <55000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "active";
|
||||
+ };
|
||||
+
|
||||
+ package_fan1: package-fan1 {
|
||||
+ temperature = <65000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "active";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ cooling-maps {
|
||||
+ map1 {
|
||||
+ trip = <&package_fan0>;
|
||||
+ cooling-device = <&fan THERMAL_NO_LIMIT 1>;
|
||||
+ };
|
||||
+
|
||||
+ map2 {
|
||||
+ trip = <&package_fan1>;
|
||||
+ cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&pcie2x1l1 {
|
||||
linux,pci-domain = <1>;
|
||||
pinctrl-names = "default";
|
||||
--
|
||||
Armbian
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ricardo Pardini <ricardo@pardini.net>
|
||||
Date: Mon, 20 Oct 2025 21:29:13 +0200
|
||||
Subject: arm64: dts: rockchip: Enable the NPU on CM3588
|
||||
|
||||
Enable the NPU on FriendlyElec CM3588;
|
||||
vdd_npu_s0 was already in place.
|
||||
|
||||
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi | 34 ++++++++++
|
||||
1 file changed, 34 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi
|
||||
@@ -264,6 +264,10 @@ &pd_gpu {
|
||||
domain-supply = <&vdd_gpu_s0>;
|
||||
};
|
||||
|
||||
+&pd_npu {
|
||||
+ domain-supply = <&vdd_npu_s0>;
|
||||
+};
|
||||
+
|
||||
&pinctrl {
|
||||
gpio-leds {
|
||||
led_sys_pin: led-sys-pin {
|
||||
@@ -294,6 +298,36 @@ sd_s0_pwr: sd-s0-pwr {
|
||||
};
|
||||
};
|
||||
|
||||
+&rknn_core_0 {
|
||||
+ npu-supply = <&vdd_npu_s0>;
|
||||
+ sram-supply = <&vdd_npu_s0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&rknn_core_1 {
|
||||
+ npu-supply = <&vdd_npu_s0>;
|
||||
+ sram-supply = <&vdd_npu_s0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&rknn_core_2 {
|
||||
+ npu-supply = <&vdd_npu_s0>;
|
||||
+ sram-supply = <&vdd_npu_s0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&rknn_mmu_0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&rknn_mmu_1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&rknn_mmu_2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&saradc {
|
||||
vref-supply = <&avcc_1v8_s0>;
|
||||
status = "okay";
|
||||
--
|
||||
Armbian
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +1 @@
|
||||
0001-gokrazy-logo.patch
|
||||
drv-spi-spidev-remove-warnings.patch
|
||||
general-add-hdmi-mks-ips50-resolutions.patch
|
||||
general-add-pll-hdmi-timings.patch
|
||||
general-cryptov1-trng.patch
|
||||
general-disable-mtu-validation.patch
|
||||
general-drm-rockchip-Set-dma-mask-to-64-bit.patch
|
||||
general-fix-es8316-kernel-panic.patch
|
||||
general-fix-mmc-signal-voltage-before-reboot.patch
|
||||
general-hdmi-clock-fixes.patch
|
||||
general-increase-spdif-dma-burst.patch
|
||||
general-increasing_DMA_block_memory_allocation_to_2048.patch
|
||||
general-pl330-01-fix-periodic-transfers.patch
|
||||
general-pl330-02-add-support-for-interleaved-transfers.patch
|
||||
general-pl330-04-bigger-mcode-buffer.patch
|
||||
general-pl330-05-fix-unbalanced-power-down.patch
|
||||
general-pl330-06-fix-buffer-underruns.patch
|
||||
general-possibility-of-disabling-rk808-rtc.patch
|
||||
general-rk808-configurable-switch-voltage-steps.patch
|
||||
general-v4l2-iep-driver.patch
|
||||
media-0001-Add-rkvdec-Support-v5.patch
|
||||
media-0002-media-rkvdec-remove-vb2_is_busy-check-in-rkvdec_s_ct.patch
|
||||
media-0002-v4l2-core-Initialize-h264-frame_mbs_only_flag-.patch
|
||||
media-0003-rk3568-disable-hantro-h264.patch
|
||||
net-ethernet-realtek-add-r8169-LED-configuration-from-OF.patch
|
||||
regulator-add-fan53200-driver.patch
|
||||
rk3588-0010-fix-clk-divisions.patch
|
||||
rk3588-1063-arm64-dts-rockchip-Enable-automatic-fan-control-on-t.patch
|
||||
rk3588-1201-arm64-dts-rockchip-Enable-the-NPU-on-CM3588.patch
|
||||
rk35xx-montjoie-crypto-v2-rk35xx.patch
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.18.6.tar.xz
|
||||
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.14.tar.xz
|
||||
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -10,16 +9,15 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const ubootRev = "a3cd0b4c632fff0f39013efebd419356eb6b4064"
|
||||
const ubootTS = 1723759665
|
||||
const trustedRepoRev = "a4e2a9f16d5c4620cd824294ef91a198fd276c80"
|
||||
|
||||
const (
|
||||
uBootRepo = "https://github.com/u-boot/u-boot"
|
||||
ubootRev = "ff498a3c5efb424accc1d825cc45cede2540ca13"
|
||||
trustedFirmwareRepo = "https://github.com/ARM-software/arm-trusted-firmware"
|
||||
trustedRepoRev = "6251d6ed1ffa7080edc55fa75f525e19ecf5edbd"
|
||||
rkbinRepo = "https://github.com/friendlyarm/rkbin"
|
||||
rkbinRev = "nanopi6"
|
||||
)
|
||||
|
||||
func applyPatches(srcdir, t string) error {
|
||||
@@ -48,43 +46,30 @@ func applyPatches(srcdir, t string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func compile(ubootDir, trustedFirmwareDir string) error {
|
||||
func compile(trustedFirmwareDir string) error {
|
||||
defconfig := exec.Command("make", "ARCH=arm64", "cm3588-nas-rk3588_defconfig")
|
||||
defconfig.Stdout = os.Stdout
|
||||
defconfig.Stderr = os.Stderr
|
||||
defconfig.Dir = ubootDir
|
||||
if err := defconfig.Run(); err != nil {
|
||||
return fmt.Errorf("make defconfig: %v", err)
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(filepath.Join(ubootDir, ".config"), os.O_RDWR|os.O_APPEND, 0o755)
|
||||
f, err := os.OpenFile(".config", os.O_RDWR|os.O_APPEND, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := f.Write([]byte(`
|
||||
CONFIG_CMD_SETEXPR=y
|
||||
CONFIG_CMD_SETEXPR_FMT=y
|
||||
CONFIG_BOOTCOMMAND="setenv bootmeths script; bootflow scan -lb"
|
||||
`)); err != nil {
|
||||
if _, err := f.Write([]byte("CONFIG_CMD_SETEXPR=y\nCONFIG_CMD_SETEXPR_FMT=y\n")); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd := exec.Command("git", "show", "-s", "--date=unix", "--pretty=format:%ad", "HEAD")
|
||||
cmd.Dir = ubootDir
|
||||
output, err := cmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to get date of git repo: %w", err)
|
||||
}
|
||||
|
||||
make := exec.Command("make", "-j"+strconv.Itoa(runtime.NumCPU()))
|
||||
make.Dir = ubootDir
|
||||
make.Env = append(os.Environ(),
|
||||
"ARCH=arm64",
|
||||
"CROSS_COMPILE=aarch64-linux-gnu-",
|
||||
"SOURCE_DATE_EPOCH="+strings.TrimSpace(string(output)),
|
||||
"SOURCE_DATE_EPOCH="+strconv.Itoa(ubootTS),
|
||||
fmt.Sprintf("BL31=%s/build/rk3588/release/bl31/bl31.elf", trustedFirmwareDir),
|
||||
fmt.Sprintf("ROCKCHIP_TPL=%s","/usr/src/uboot.patches/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin"),
|
||||
)
|
||||
@@ -97,14 +82,13 @@ CONFIG_BOOTCOMMAND="setenv bootmeths script; bootflow scan -lb"
|
||||
return nil
|
||||
}
|
||||
|
||||
func generateBootScr(ubootDir, bootCmdPath string) error {
|
||||
mkimage := exec.Command(filepath.Join(ubootDir, "./tools/mkimage"), "-A", "arm", "-T", "script", "-C", "none", "-d", bootCmdPath, "boot.scr")
|
||||
func generateBootScr(bootCmdPath string) error {
|
||||
mkimage := exec.Command("./tools/mkimage", "-A", "arm", "-T", "script", "-C", "none", "-d", bootCmdPath, "boot.scr")
|
||||
mkimage.Env = append(os.Environ(),
|
||||
"ARCH=arm64",
|
||||
"CROSS_COMPILE=aarch64-linux-gnu-",
|
||||
"SOURCE_DATE_EPOCH=1600000000",
|
||||
)
|
||||
mkimage.Dir = ubootDir
|
||||
mkimage.Stdout = os.Stdout
|
||||
mkimage.Stderr = os.Stderr
|
||||
if err := mkimage.Run(); err != nil {
|
||||
@@ -141,38 +125,32 @@ func copyFile(dest, src string) error {
|
||||
return out.Close()
|
||||
}
|
||||
|
||||
func clone(dir string, repo string, rev string) error {
|
||||
err := os.Mkdir(dir, 0o777)
|
||||
if err != nil && !errors.Is(err, os.ErrExist) {
|
||||
func main() {
|
||||
ubootDir, err := os.MkdirTemp("", "u-boot")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var commands = [][]string{
|
||||
|
||||
trustedFirmwareDir, err := os.MkdirTemp("", "arm-trusted-firmware")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
for _, cmd := range [][]string{
|
||||
{"git", "init"},
|
||||
{"git", "remote", "add", "origin", repo},
|
||||
{"git", "fetch", "--depth=1", "origin", rev},
|
||||
{"git", "remote", "add", "origin", trustedFirmwareRepo},
|
||||
{"git", "fetch", "--depth=1", "origin", trustedRepoRev},
|
||||
{"git", "checkout", "FETCH_HEAD"},
|
||||
}
|
||||
if _, err = os.Stat(filepath.Join(dir, ".git")); err == nil {
|
||||
commands = commands[2:]
|
||||
}
|
||||
for _, cmd := range commands {
|
||||
} {
|
||||
log.Printf("Running %s", cmd)
|
||||
cmdObj := exec.Command(cmd[0], cmd[1:]...)
|
||||
cmdObj.Stdout = os.Stdout
|
||||
cmdObj.Stderr = os.Stderr
|
||||
cmdObj.Dir = dir
|
||||
cmdObj.Dir = trustedFirmwareDir
|
||||
if err := cmdObj.Run(); err != nil {
|
||||
return err
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func compileATF() string {
|
||||
trustedFirmwareDir, _ := filepath.Abs("arm-trusted-firmware")
|
||||
if err := clone(trustedFirmwareDir, trustedFirmwareRepo, trustedRepoRev); err != nil {
|
||||
log.Fatal("Failed to clone Trusted Firmware:", err)
|
||||
}
|
||||
|
||||
log.Printf("applying patches")
|
||||
if err := applyPatches(trustedFirmwareDir, "atf"); err != nil {
|
||||
@@ -190,45 +168,33 @@ func compileATF() string {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
return trustedFirmwareDir
|
||||
|
||||
var bootCmdPath string
|
||||
if p, err := filepath.Abs("uboot.patches/boot.cmd"); err != nil {
|
||||
log.Fatal(err)
|
||||
} else {
|
||||
bootCmdPath = p
|
||||
}
|
||||
|
||||
func downloadRKbin() string {
|
||||
var err error = nil
|
||||
rkbinDir, _ := filepath.Abs("rkbin")
|
||||
|
||||
if err = clone(rkbinDir, rkbinRepo, rkbinRev); err != nil {
|
||||
log.Fatal("Failed to clone rkbin Firmware:", err)
|
||||
}
|
||||
|
||||
log.Printf("applying patches")
|
||||
if err := applyPatches(rkbinDir, "rkbin"); err != nil {
|
||||
if err := os.Chdir(ubootDir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return rkbinDir
|
||||
}
|
||||
|
||||
func indockerMain() {
|
||||
|
||||
srcFiles, err := filepath.Glob("/usr/_src/*")
|
||||
if err != nil {
|
||||
log.Fatalf("failed to find source files: %v", err)
|
||||
}
|
||||
for _, fileName := range srcFiles {
|
||||
cmdObj := exec.Command("cp", "-r", "-t", "/usr/src", fileName)
|
||||
for _, cmd := range [][]string{
|
||||
{"git", "init"},
|
||||
{"git", "remote", "add", "origin", uBootRepo},
|
||||
{"git", "fetch", "--depth=1", "origin", ubootRev},
|
||||
{"git", "checkout", "FETCH_HEAD"},
|
||||
} {
|
||||
log.Printf("Running %s", cmd)
|
||||
cmdObj := exec.Command(cmd[0], cmd[1:]...)
|
||||
cmdObj.Stdout = os.Stdout
|
||||
cmdObj.Stderr = os.Stderr
|
||||
cmdObj.Dir = ubootDir
|
||||
if err := cmdObj.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
rkbinDir := compileATF()
|
||||
bootCmdPath, _ := filepath.Abs("uboot.patches/boot.cmd")
|
||||
|
||||
ubootDir, _ := filepath.Abs("u-boot")
|
||||
if err := clone(ubootDir, uBootRepo, ubootRev); err != nil {
|
||||
log.Fatal("Failed to clone uboot repo:", err)
|
||||
}
|
||||
|
||||
log.Printf("applying patches")
|
||||
if err := applyPatches(ubootDir, "uboot"); err != nil {
|
||||
@@ -236,23 +202,23 @@ func indockerMain() {
|
||||
}
|
||||
|
||||
log.Printf("compiling uboot")
|
||||
if err := compile(ubootDir, rkbinDir); err != nil {
|
||||
if err := compile(trustedFirmwareDir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Printf("generating boot.scr")
|
||||
if err := generateBootScr(ubootDir, bootCmdPath); err != nil {
|
||||
if err := generateBootScr(bootCmdPath); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
for _, copyCfg := range []struct {
|
||||
dest, src string
|
||||
}{
|
||||
{"boot.scr", "u-boot/boot.scr"},
|
||||
{"u-boot-rockchip.bin", "u-boot/u-boot-rockchip.bin"},
|
||||
{"boot.scr", "boot.scr"},
|
||||
{"u-boot-rockchip.bin", "u-boot-rockchip.bin"},
|
||||
} {
|
||||
if err := copyFile(filepath.Join("/tmp/buildresult", copyCfg.dest), copyCfg.src); err != nil {
|
||||
log.Fatal("indocker ", err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,374 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
firmware = []string{"arm/mali/arch10.8/mali_csffw.bin", "rtl_nic/rtl8125b-2.fw"}
|
||||
firmwareDir, _ = filepath.Abs("firmware")
|
||||
)
|
||||
|
||||
func downloadKernel(latest string) error {
|
||||
if _, err := os.Stat(filepath.Base(latest)); err == nil {
|
||||
return nil
|
||||
}
|
||||
out, err := os.Create(filepath.Base(latest))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer out.Close()
|
||||
if kernel, err := os.Open("/tmp/buildresult/" + filepath.Base(latest)); err == nil {
|
||||
defer kernel.Close()
|
||||
if _, err := io.Copy(out, kernel); err != nil {
|
||||
return err
|
||||
}
|
||||
return out.Close()
|
||||
}
|
||||
resp, err := http.Get(latest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if got, want := resp.StatusCode, http.StatusOK; got != want {
|
||||
return fmt.Errorf("unexpected HTTP status code for %s: got %d, want %d", latest, got, want)
|
||||
}
|
||||
if _, err := io.Copy(out, resp.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
return out.Close()
|
||||
}
|
||||
|
||||
func downloadWhence() (map[string]string, error) {
|
||||
whenceMap := make(map[string]string)
|
||||
uri := "https://gitlab.com/api/v4/projects/48890189/repository/files/WHENCE/raw?ref=main"
|
||||
resp, err := http.Get(uri)
|
||||
if err != nil {
|
||||
return whenceMap, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
whenceBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return whenceMap, err
|
||||
}
|
||||
whence := strings.Split(string(whenceBytes), "\n")
|
||||
for _, line := range whence {
|
||||
if file, ok := strings.CutPrefix(line, "File: "); ok {
|
||||
whenceMap[file] = file
|
||||
}
|
||||
if file, ok := strings.CutPrefix(line, "RawFile: "); ok {
|
||||
whenceMap[file] = file
|
||||
}
|
||||
if l, ok := strings.CutPrefix(line, "Link: "); ok {
|
||||
if link, file, ok := strings.Cut(l, " -> "); ok {
|
||||
dest := filepath.Join(filepath.Dir(link), file)
|
||||
whenceMap[link] = dest
|
||||
}
|
||||
}
|
||||
}
|
||||
return whenceMap, nil
|
||||
}
|
||||
|
||||
func downloadFirmware() ([]string, error) {
|
||||
firmwarePaths := make([]string, 0, len(firmware))
|
||||
whence, err := downloadWhence()
|
||||
if err != nil {
|
||||
return firmwarePaths, err
|
||||
}
|
||||
for _, f := range firmware {
|
||||
folder := filepath.Dir(f)
|
||||
path, ok := whence[f]
|
||||
if !ok {
|
||||
return firmwarePaths, fmt.Errorf("firmware %q not found", f)
|
||||
}
|
||||
|
||||
firmwarePaths = append(firmwarePaths, f)
|
||||
|
||||
log.Printf("downloading firmware: %q to %q", path, f)
|
||||
|
||||
os.MkdirAll(filepath.Join("firmware", folder), 0o777)
|
||||
out, err := os.Create(filepath.Join("firmware", f))
|
||||
if err != nil {
|
||||
return firmwarePaths, err
|
||||
}
|
||||
defer out.Close()
|
||||
uri := "https://gitlab.com/api/v4/projects/48890189/repository/files/" + url.PathEscape(path) + "/raw?ref=main"
|
||||
resp, err := http.Get(uri)
|
||||
if err != nil {
|
||||
return firmwarePaths, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if got, want := resp.StatusCode, http.StatusOK; got != want {
|
||||
return firmwarePaths, fmt.Errorf("unexpected HTTP status code for %s: got %d, want %d", uri, got, want)
|
||||
}
|
||||
if _, err := io.Copy(out, resp.Body); err != nil {
|
||||
return firmwarePaths, err
|
||||
}
|
||||
if err := out.Close(); err != nil {
|
||||
return firmwarePaths, err
|
||||
}
|
||||
resp.Body.Close()
|
||||
}
|
||||
return firmwarePaths, nil
|
||||
}
|
||||
|
||||
func applyPatches(srcdir string) error {
|
||||
patches, err := filepath.Glob("*.patch")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, patch := range patches {
|
||||
log.Printf("applying patch %q", patch)
|
||||
f, err := os.Open(patch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
cmd := exec.Command("patch", "-p1")
|
||||
cmd.Dir = srcdir
|
||||
cmd.Stdin = f
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
f.Close()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func compile(cross, flavor string, firmwarePaths []string) error {
|
||||
defconfig := exec.Command("make", "ARCH="+os.Getenv("ARCH"), "defconfig")
|
||||
if flavor == "defconfig" {
|
||||
defconfig = exec.Command("make", "ARCH="+os.Getenv("ARCH"), "olddefconfig")
|
||||
cpConfig := exec.Command("cp", "/usr/_src/defconfig", ".config")
|
||||
cpConfig.Stdout = os.Stdout
|
||||
cpConfig.Stderr = os.Stderr
|
||||
if err := cpConfig.Run(); err != nil {
|
||||
return fmt.Errorf("make cpConfig: %v", err)
|
||||
}
|
||||
} else if flavor == "raspberrypi" {
|
||||
// TODO(https://github.com/gokrazy/gokrazy/issues/223): is it
|
||||
// necessary/desirable to switch to bcm2712_defconfig?
|
||||
defconfig = exec.Command("make", "ARCH=arm64", "bcm2711_defconfig")
|
||||
} else if strings.HasSuffix(flavor, "_defconfig") {
|
||||
defconfig = exec.Command("make", "ARCH="+os.Getenv("ARCH"), flavor)
|
||||
}
|
||||
|
||||
defconfig.Stdout = os.Stdout
|
||||
defconfig.Stderr = os.Stderr
|
||||
if err := defconfig.Run(); err != nil {
|
||||
return fmt.Errorf("make defconfig: %v", err)
|
||||
}
|
||||
|
||||
// Change answers from mod to no if possible, i.e. disable all modules so
|
||||
// that we end up with a minimal set of modules (from the config addendum).
|
||||
mod2noconfig := exec.Command("make", "mod2noconfig")
|
||||
mod2noconfig.Stdout = os.Stdout
|
||||
mod2noconfig.Stderr = os.Stderr
|
||||
if err := mod2noconfig.Run(); err != nil {
|
||||
return fmt.Errorf("make mod2noconfig: %v", err)
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(".config", os.O_APPEND|os.O_WRONLY, 0o644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
addendum, err := os.ReadFile("/usr/src/config.addendum.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := f.Write(addendum); err != nil {
|
||||
return err
|
||||
}
|
||||
if len(firmwarePaths) > 0 {
|
||||
fmt.Fprintf(f, "CONFIG_EXTRA_FIRMWARE=%q\n", strings.Join(firmwarePaths, " "))
|
||||
fmt.Fprintf(f, "CONFIG_EXTRA_FIRMWARE_DIR=%q\n", firmwareDir)
|
||||
}
|
||||
|
||||
if err := f.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
olddefconfig := exec.Command("make", "olddefconfig")
|
||||
olddefconfig.Stdout = os.Stdout
|
||||
olddefconfig.Stderr = os.Stderr
|
||||
if err := olddefconfig.Run(); err != nil {
|
||||
return fmt.Errorf("make olddefconfig: %v", err)
|
||||
}
|
||||
|
||||
env := append(os.Environ(),
|
||||
"KBUILD_BUILD_USER=gokrazy",
|
||||
"KBUILD_BUILD_HOST=docker",
|
||||
"KBUILD_BUILD_TIMESTAMP=Wed Mar 1 20:57:29 UTC 2017",
|
||||
)
|
||||
make := exec.Command("make", "bzImage", "modules", "-j"+strconv.Itoa(runtime.NumCPU()))
|
||||
if cross == "arm64" {
|
||||
make = exec.Command("make", "Image.gz", "dtbs", "modules", "-j"+strconv.Itoa(runtime.NumCPU()))
|
||||
}
|
||||
make.Env = env
|
||||
make.Stdout = os.Stdout
|
||||
make.Stderr = os.Stderr
|
||||
if err := make.Run(); err != nil {
|
||||
return fmt.Errorf("make: %v", err)
|
||||
}
|
||||
|
||||
make = exec.Command("make", "INSTALL_MOD_PATH=/tmp/buildresult", "modules_install", "-j"+strconv.Itoa(runtime.NumCPU()))
|
||||
make.Env = env
|
||||
make.Stdout = os.Stdout
|
||||
make.Stderr = os.Stderr
|
||||
if err := make.Run(); err != nil {
|
||||
return fmt.Errorf("make: %v", err)
|
||||
}
|
||||
|
||||
make = exec.Command("make", "INSTALL_DTBS_PATH=/tmp/buildresult/dtbs", "dtbs_install", "-j"+strconv.Itoa(runtime.NumCPU()))
|
||||
make.Env = env
|
||||
make.Stdout = os.Stdout
|
||||
make.Stderr = os.Stderr
|
||||
if err := make.Run(); err != nil {
|
||||
return fmt.Errorf("make: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func indockerMain() {
|
||||
cross := flag.String("cross",
|
||||
"",
|
||||
"if non-empty, cross-compile for the specified arch (one of 'arm64')")
|
||||
|
||||
flavor := flag.String("flavor",
|
||||
"vanilla",
|
||||
"which kernel flavor to build. one of vanilla (kernel.org) or raspberrypi (https://github.com/raspberrypi/linux/tags)")
|
||||
persistent := flag.Bool("persistent", false, "Mounts a folder into the docker container to persist kernel source for debugging")
|
||||
|
||||
flag.Parse()
|
||||
latest := flag.Arg(0)
|
||||
if latest == "" {
|
||||
log.Fatalf("syntax: %s <upstream-URL>", os.Args[0])
|
||||
}
|
||||
log.Printf("downloading kernel source: %s", latest)
|
||||
err := downloadKernel(latest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
srcdir := strings.TrimSuffix(filepath.Base(latest), ".tar.gz")
|
||||
srcdir = strings.TrimSuffix(srcdir, ".tar.xz")
|
||||
if *flavor != "vanilla" && strings.HasPrefix(latest, "https://github.com/") {
|
||||
s := strings.SplitN(latest, "/", 6)
|
||||
if len(s) < 6 {
|
||||
srcdir = "linux-" + srcdir
|
||||
} else {
|
||||
srcdir = s[4] + "-" + srcdir
|
||||
}
|
||||
}
|
||||
|
||||
if *persistent {
|
||||
if _, err = os.Stat(srcdir); err == nil {
|
||||
err = os.ErrExist
|
||||
} else {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
unpacked := false
|
||||
if err == nil {
|
||||
log.Printf("unpacking kernel source")
|
||||
untar := exec.Command("tar", "xf", filepath.Base(latest))
|
||||
untar.Stdout = os.Stdout
|
||||
untar.Stderr = os.Stderr
|
||||
if err := untar.Run(); err != nil {
|
||||
log.Fatalf("untar: %v", err)
|
||||
}
|
||||
unpacked = true
|
||||
}
|
||||
srcFiles, err := filepath.Glob("/usr/_src/*")
|
||||
if err != nil {
|
||||
log.Fatalf("failed to find source files: %v", err)
|
||||
}
|
||||
for _, fileName := range srcFiles {
|
||||
file, err := os.OpenFile(fileName, os.O_CREATE|os.O_RDWR, 0o644)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to open source file for writing: %s", filepath.Base(fileName))
|
||||
}
|
||||
newFile, err := os.OpenFile(filepath.Base(fileName), os.O_CREATE|os.O_RDWR, 0o644)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to open source file for writing: %s", filepath.Base(fileName))
|
||||
}
|
||||
_, err = io.Copy(newFile, file)
|
||||
if err != nil {
|
||||
log.Fatalf("Error when copying file %v: %v", fileName, err)
|
||||
}
|
||||
file.Close()
|
||||
newFile.Close()
|
||||
}
|
||||
|
||||
log.Printf("applying patches")
|
||||
if unpacked {
|
||||
if err := applyPatches(srcdir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
firmwarePaths, err := downloadFirmware()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.Chdir(srcdir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if *cross == "arm64" {
|
||||
log.Printf("exporting ARCH=arm64, CROSS_COMPILE=aarch64-linux-gnu-")
|
||||
os.Setenv("ARCH", "arm64")
|
||||
os.Setenv("CROSS_COMPILE", "aarch64-linux-gnu-")
|
||||
}
|
||||
|
||||
log.Printf("compiling kernel")
|
||||
if err := compile(*cross, *flavor, firmwarePaths); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if *cross == "arm64" {
|
||||
if err := copyFile("/tmp/buildresult/vmlinuz", "arch/arm64/boot/Image"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := copyFile("/tmp/buildresult/vmlinuz.config", ".config"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
dtbos, err := filepath.Glob("arch/arm64/boot/dts/overlays/*.dtbo")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if _, err = os.Stat("arch/arm64/boot/dts/overlays/overlay_map.dtb"); err == nil {
|
||||
dtbos = append(dtbos, "arch/arm64/boot/dts/overlays/overlay_map.dtb")
|
||||
}
|
||||
if err := os.MkdirAll("/tmp/buildresult/overlays", 0o755); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, fn := range dtbos {
|
||||
if err := copyFile(filepath.Join("/tmp/buildresult/overlays/", filepath.Base(fn)), fn); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err := copyFile("/tmp/buildresult/vmlinuz", "arch/x86/boot/bzImage"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,353 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
const dockerFileContents = `
|
||||
FROM docker.io/library/debian:trixie
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
{{ if (eq .Cross "arm64") -}}
|
||||
crossbuild-essential-arm64 \
|
||||
{{ end -}}
|
||||
build-essential bc libssl-dev bison flex libelf-dev ncurses-dev ca-certificates zstd kmod python3 git
|
||||
|
||||
COPY gokr-rebuild-kernel /usr/bin/gokr-rebuild-kernel
|
||||
COPY config.addendum.txt /usr/_src/config.addendum.txt
|
||||
COPY defconfig /usr/_src/defconfig
|
||||
COPY config.addendum.txt /usr/_src/.config
|
||||
COPY config.addendum.txt /usr/src/.config
|
||||
{{- range $idx, $path := .Patches }}
|
||||
COPY patch/{{ $path }} /usr/_src/{{ $path }}
|
||||
{{- end }}
|
||||
|
||||
RUN echo 'builduser:x:{{ .Uid }}:{{ .Gid }}:nobody:/:/bin/sh' >> /etc/passwd && \
|
||||
chown -R {{ .Uid }}:{{ .Gid }} /usr/src /usr/_src
|
||||
|
||||
USER builduser
|
||||
WORKDIR /usr/src
|
||||
ENV GOKRAZY_IN_DOCKER=1
|
||||
ENTRYPOINT ["/usr/bin/gokr-rebuild-kernel"]
|
||||
`
|
||||
|
||||
var dockerFileTmpl = template.Must(template.New("dockerfile").
|
||||
Funcs(map[string]interface{}{
|
||||
"basename": func(path string) string {
|
||||
return filepath.Base(path)
|
||||
},
|
||||
}).
|
||||
Parse(dockerFileContents))
|
||||
|
||||
func copyFile(dest, src string) error {
|
||||
log.Printf("copyFile(dest=%s, src=%s)", dest, src)
|
||||
out, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
in, err := os.Open(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer in.Close()
|
||||
|
||||
n, err := io.Copy(out, in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf(" -> %d bytes copied", n)
|
||||
|
||||
st, err := in.Stat()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := out.Chmod(st.Mode()); err != nil {
|
||||
return err
|
||||
}
|
||||
return out.Close()
|
||||
}
|
||||
|
||||
func find(filename string) (string, error) {
|
||||
if _, err := os.Stat(filename); err == nil {
|
||||
return filename, nil
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("could not find file %q", filename)
|
||||
}
|
||||
|
||||
func getContainerExecutable() (string, error) {
|
||||
// Probe podman first, because the docker binary might actually
|
||||
// be a thin podman wrapper with podman behavior.
|
||||
choices := []string{"podman", "docker"}
|
||||
for _, exe := range choices {
|
||||
p, err := exec.LookPath(exe)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
resolved, err := filepath.EvalSymlinks(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return resolved, nil
|
||||
}
|
||||
return "", fmt.Errorf("none of %v found in $PATH", choices)
|
||||
}
|
||||
|
||||
func rebuildKernel() error {
|
||||
overwriteContainerExecutable := flag.String("overwrite_container_executable",
|
||||
"",
|
||||
"E.g. docker or podman to overwrite the automatically detected container executable")
|
||||
|
||||
keepBuildContainer := flag.Bool("keep_build_container",
|
||||
false,
|
||||
"do not delete build container after building the kernel")
|
||||
|
||||
cross := flag.String("cross",
|
||||
"arm64",
|
||||
"if non-empty, cross-compile for the specified arch (one of 'arm64')")
|
||||
persistent := flag.Bool("persistent", false, "Mounts a folder into the docker container to persist kernel source for debugging")
|
||||
|
||||
flavor := flag.String("flavor",
|
||||
"vanilla",
|
||||
"which kernel flavor to build. one of vanilla (kernel.org) or raspberrypi (https://github.com/raspberrypi/linux/tags)")
|
||||
|
||||
dtbs := flag.String("dtbs",
|
||||
"raspberrypi",
|
||||
"which device tree files (.dtb files) to copy. 'raspberrypi' or empty")
|
||||
_ = dtbs
|
||||
flag.Parse()
|
||||
|
||||
if *cross != "" && *cross != "arm64" {
|
||||
return fmt.Errorf("invalid -cross value %q: expected one of 'arm64'")
|
||||
}
|
||||
|
||||
abs, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !strings.HasSuffix(strings.TrimSuffix(abs, "/"), "/_build") {
|
||||
return fmt.Errorf("gokr-rebuild-kernel is not run from a _build directory")
|
||||
}
|
||||
|
||||
series, err := os.ReadFile("series")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
patches := strings.Split(strings.TrimSpace(string(series)), "\n")
|
||||
|
||||
executable, err := getContainerExecutable()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if *overwriteContainerExecutable != "" {
|
||||
executable = *overwriteContainerExecutable
|
||||
}
|
||||
|
||||
execName := filepath.Base(executable)
|
||||
|
||||
for _, filename := range patches {
|
||||
_, err := find("patch/" + filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
kernelPath, err := filepath.Abs("../vmlinuz")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
libPath, err := filepath.Abs("../lib")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := find("config.addendum.txt"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
upstreamURL, err := os.ReadFile("upstream-url.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
upstreamURL = bytes.TrimSpace(upstreamURL)
|
||||
|
||||
dockerFile, err := os.Create("Dockerfile")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := dockerFileTmpl.Execute(dockerFile, struct {
|
||||
Uid string
|
||||
Gid string
|
||||
Patches []string
|
||||
Cross string
|
||||
}{
|
||||
Uid: u.Uid,
|
||||
Gid: u.Gid,
|
||||
Patches: patches,
|
||||
Cross: *cross,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := dockerFile.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Printf("building %s container for kernel compilation", execName)
|
||||
|
||||
dockerBuild := exec.Command(execName,
|
||||
"build",
|
||||
// "--platform=linux/amd64",
|
||||
"--rm=true",
|
||||
"--tag=gokr-rebuild-kernel",
|
||||
".")
|
||||
dockerBuild.Stdout = os.Stdout
|
||||
dockerBuild.Stderr = os.Stderr
|
||||
log.Printf("%v", dockerBuild.Args)
|
||||
if err := dockerBuild.Run(); err != nil {
|
||||
return fmt.Errorf("%s build: %v (cmd: %v)", execName, err, dockerBuild.Args)
|
||||
}
|
||||
|
||||
log.Printf("compiling kernel")
|
||||
|
||||
var dockerRun *exec.Cmd
|
||||
|
||||
dockerArgs := []string{
|
||||
"run",
|
||||
// "--platform=linux/amd64",
|
||||
"--volume", abs + ":/tmp/buildresult:Z",
|
||||
}
|
||||
kernelName := path.Base(string(upstreamURL))
|
||||
_, err = os.Stat(kernelName)
|
||||
log.Printf("Check for downloaded kernel %s: %v", kernelName, err)
|
||||
if err == nil {
|
||||
absKernelName, _ := filepath.Abs(kernelName)
|
||||
dockerArgs = append(dockerArgs, "--volume", absKernelName+":/usr/src/"+kernelName)
|
||||
}
|
||||
if *persistent {
|
||||
err = os.MkdirAll("./src_build", 0o777)
|
||||
srcBuild, _ := filepath.Abs("./src_build")
|
||||
if err != nil {
|
||||
log.Fatal("Failed to create ./src_build", err)
|
||||
}
|
||||
dockerArgs = append(dockerArgs, "-v", srcBuild+":/usr/src")
|
||||
} else {
|
||||
dockerArgs = append(dockerArgs, fmt.Sprintf("--mount=type=tmpfs,tmpfs-size=%d%s,destination=%s,U", 5, "G", "/usr/src")) // Ramfs for faster build.... maybe
|
||||
}
|
||||
|
||||
if !*keepBuildContainer {
|
||||
dockerArgs = append(dockerArgs, "--rm")
|
||||
}
|
||||
if execName == "podman" {
|
||||
dockerArgs = append(dockerArgs, "--userns=keep-id")
|
||||
}
|
||||
dockerArgs = append(dockerArgs,
|
||||
"gokr-rebuild-kernel",
|
||||
"-cross="+*cross,
|
||||
"-flavor="+*flavor,
|
||||
fmt.Sprintf("-persistent=%v", *persistent),
|
||||
strings.TrimSpace(string(upstreamURL)))
|
||||
|
||||
dockerRun = exec.Command(executable, dockerArgs...)
|
||||
|
||||
dockerRun.Stdout = os.Stdout
|
||||
dockerRun.Stderr = os.Stderr
|
||||
log.Printf("%v", dockerRun.Args)
|
||||
if err := dockerRun.Run(); err != nil {
|
||||
return fmt.Errorf("%s run: %v (cmd: %v)", execName, err, dockerRun.Args)
|
||||
}
|
||||
|
||||
if err := copyFile(kernelPath, "vmlinuz"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := copyFile(kernelPath+".config", "vmlinuz.config"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove symlinks that only work when source/build directory are present
|
||||
for _, subdir := range []string{"build", "source"} {
|
||||
matches, err := filepath.Glob(filepath.Join("lib/modules", "*", subdir))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, match := range matches {
|
||||
log.Printf("removing build/source symlink %s", match)
|
||||
if err := os.Remove(match); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// replace kernel modules directory
|
||||
rm := exec.Command("rm", "-rf", filepath.Join(libPath, "modules"))
|
||||
rm.Stdout = os.Stdout
|
||||
rm.Stderr = os.Stderr
|
||||
log.Printf("%v", rm.Args)
|
||||
if err := rm.Run(); err != nil {
|
||||
return fmt.Errorf("%v: %v", rm.Args, err)
|
||||
}
|
||||
cp := exec.Command("cp", "-r", filepath.Join("lib/modules"), libPath)
|
||||
cp.Stdout = os.Stdout
|
||||
cp.Stderr = os.Stderr
|
||||
log.Printf("%v", cp.Args)
|
||||
if err := cp.Run(); err != nil {
|
||||
return fmt.Errorf("%v: %v", cp.Args, err)
|
||||
}
|
||||
|
||||
if *cross == "arm64" {
|
||||
if *flavor == "raspberrypi" {
|
||||
// replace overlays directory
|
||||
overlaysPath, err := find("../overlays")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rm = exec.Command("rm", "-rf", overlaysPath)
|
||||
rm.Stdout = os.Stdout
|
||||
rm.Stderr = os.Stderr
|
||||
log.Printf("%v", rm.Args)
|
||||
if err := rm.Run(); err != nil {
|
||||
log.Printf("%v: %v", rm.Args, err)
|
||||
}
|
||||
cp = exec.Command("cp", "-r", "overlays", overlaysPath)
|
||||
cp.Stdout = os.Stdout
|
||||
cp.Stderr = os.Stderr
|
||||
log.Printf("%v", cp.Args)
|
||||
if err := cp.Run(); err != nil {
|
||||
return fmt.Errorf("%v: %v", cp.Args, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
if os.Getenv("GOKRAZY_IN_DOCKER") == "1" {
|
||||
indockerMain()
|
||||
} else {
|
||||
if err := rebuildKernel(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -13,24 +14,22 @@ import (
|
||||
)
|
||||
|
||||
const dockerFileContents = `
|
||||
FROM docker.io/library/debian:trixie
|
||||
FROM debian:buster
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential crossbuild-essential-arm64 bc libssl-dev bison flex git python3 python3-setuptools swig python3-dev python3-pyelftools uuid-dev libgnutls28-dev
|
||||
RUN apt-get install -y device-tree-compiler
|
||||
RUN apt-get update && apt-get install -y crossbuild-essential-arm64 bc libssl-dev bison flex git python3 python3-setuptools swig python3-dev python3-pyelftools uuid-dev libgnutls28-dev
|
||||
|
||||
COPY gokr-build-uboot /usr/bin/gokr-build-uboot
|
||||
RUN mkdir -p /usr/_src/atf.patches
|
||||
RUN mkdir -p /usr/_src/uboot.patches
|
||||
RUN mkdir -p /usr/src/atf.patches
|
||||
RUN mkdir -p /usr/src/uboot.patches
|
||||
{{- range $idx, $path := .Patches }}
|
||||
COPY {{ $path }} /usr/_src/{{ $path }}
|
||||
COPY {{ $path }} /usr/src/{{ $path }}
|
||||
{{- end }}
|
||||
|
||||
RUN echo 'builduser:x:{{ .Uid }}:{{ .Gid }}:nobody:/:/bin/sh' >> /etc/passwd && \
|
||||
chown -R {{ .Uid }}:{{ .Gid }} /usr/src /usr/_src
|
||||
chown -R {{ .Uid }}:{{ .Gid }} /usr/src
|
||||
|
||||
USER builduser
|
||||
WORKDIR /usr/src
|
||||
ENV GOKRAZY_IN_DOCKER=1
|
||||
ENTRYPOINT /usr/bin/gokr-build-uboot
|
||||
`
|
||||
|
||||
@@ -44,15 +43,49 @@ var dockerFileTmpl = template.Must(template.New("dockerfile").
|
||||
|
||||
var ubootPatchFiles = []string{
|
||||
"uboot.patches/boot.cmd",
|
||||
"uboot.patches/rk3588_bl31_v1.46.elf",
|
||||
"uboot.patches/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin",
|
||||
"uboot.patches/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.17.bin",
|
||||
}
|
||||
var atfPatchFiles = []string{
|
||||
"atf.patches/feat-rk3588-support-rk3588.patch",
|
||||
"atf.patches/rk3588-enable-crypto-function.patch",
|
||||
"atf.patches/feat-rockchip-support-SCMI-for-clock-reset-domain.patch",
|
||||
}
|
||||
|
||||
var atfPatchFiles = []string{
|
||||
// "atf.patches/feat-rk3588-support-rk3588.patch",
|
||||
// "atf.patches/rk3588-enable-crypto-function.patch",
|
||||
// "atf.patches/feat-rockchip-support-SCMI-for-clock-reset-domain.patch",
|
||||
func copyFile(dest, src string) error {
|
||||
out, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
in, err := os.Open(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer in.Close()
|
||||
|
||||
if _, err := io.Copy(out, in); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
st, err := in.Stat()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := out.Chmod(st.Mode()); err != nil {
|
||||
return err
|
||||
}
|
||||
return out.Close()
|
||||
}
|
||||
|
||||
var gopath = mustGetGopath()
|
||||
|
||||
func mustGetGopath() string {
|
||||
gopathb, err := exec.Command("go", "env", "GOPATH").Output()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
return strings.TrimSpace(string(gopathb))
|
||||
}
|
||||
|
||||
func find(filename string) (string, error) {
|
||||
@@ -60,7 +93,12 @@ func find(filename string) (string, error) {
|
||||
return filename, nil
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("could not find file %q", filename)
|
||||
path := filepath.Join(gopath, "src", "gitea.narnian.us", "lordwelch", "gokrazy-cm3588-kernel", filename)
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
return path, nil
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("could not find file %q (looked in . and %s)", filename, path)
|
||||
}
|
||||
|
||||
func getContainerExecutable() (string, error) {
|
||||
@@ -81,24 +119,15 @@ func getContainerExecutable() (string, error) {
|
||||
return "", fmt.Errorf("none of %v found in $PATH", choices)
|
||||
}
|
||||
|
||||
func rebuildUboot() {
|
||||
overwriteContainerExecutable := flag.String("overwrite_container_executable",
|
||||
func main() {
|
||||
var overwriteContainerExecutable = flag.String("overwrite_container_executable",
|
||||
"",
|
||||
"E.g. docker or podman to overwrite the automatically detected container executable")
|
||||
persistent := flag.Bool("persistent", false, "Mounts a folder into the docker container to persist u-boot source for debugging")
|
||||
flag.Parse()
|
||||
executable, err := getContainerExecutable()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
abs, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if !strings.HasSuffix(strings.TrimSuffix(abs, "/"), "/_build") {
|
||||
log.Fatalf("gokr-rebuild-uboot is not run from a _build directory")
|
||||
}
|
||||
if *overwriteContainerExecutable != "" {
|
||||
executable = *overwriteContainerExecutable
|
||||
}
|
||||
@@ -111,15 +140,15 @@ func rebuildUboot() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmp)
|
||||
exePath, err := os.Executable()
|
||||
if err != nil {
|
||||
log.Fatal("Unable to find current executable", err)
|
||||
|
||||
cmd := exec.Command("go", "build", "-o", tmp, "gitea.narnian.us/lordwelch/gokrazy-cm3588-kernel/cmd/gokr-build-uboot")
|
||||
cmd.Env = append(os.Environ(), "GOOS=linux", "CGO_ENABLED=0")
|
||||
cmd.Stderr = os.Stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Fatalf("%v: %v", cmd.Args, err)
|
||||
}
|
||||
|
||||
buildPath := filepath.Join(tmp, "gokr-build-uboot")
|
||||
err = copyFile(buildPath, exePath)
|
||||
if err != nil {
|
||||
log.Fatal("Unable to copy executable for docker", err)
|
||||
}
|
||||
|
||||
var patchPaths []string
|
||||
|
||||
@@ -131,7 +160,7 @@ func rebuildUboot() {
|
||||
patchPaths = append(patchPaths, path)
|
||||
}
|
||||
|
||||
err = os.MkdirAll(filepath.Join(tmp, "uboot.patches"), 0o750)
|
||||
err = os.MkdirAll(filepath.Join(tmp, "uboot.patches"), 0750)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -143,6 +172,7 @@ func rebuildUboot() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
patchPaths = patchPaths[0:0]
|
||||
for _, filename := range atfPatchFiles {
|
||||
path, err := find(filename)
|
||||
@@ -152,7 +182,8 @@ func rebuildUboot() {
|
||||
patchPaths = append(patchPaths, path)
|
||||
}
|
||||
|
||||
err = os.MkdirAll(filepath.Join(tmp, "atf.patches"), 0o750)
|
||||
|
||||
err = os.MkdirAll(filepath.Join(tmp, "atf.patches"), 0750)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -193,7 +224,7 @@ func rebuildUboot() {
|
||||
|
||||
log.Printf("building %s container for uboot compilation", execName)
|
||||
|
||||
dockerBuild := exec.Command(executable,
|
||||
dockerBuild := exec.Command(execName,
|
||||
"build",
|
||||
"--rm=true",
|
||||
"--tag=gokr-rebuild-uboot",
|
||||
@@ -208,26 +239,20 @@ func rebuildUboot() {
|
||||
log.Printf("compiling uboot")
|
||||
|
||||
var dockerRun *exec.Cmd
|
||||
dockerArgs := []string{
|
||||
"run",
|
||||
// "--platform=linux/amd64",
|
||||
"--volume", tmp + ":/tmp/buildresult:Z",
|
||||
}
|
||||
if *persistent {
|
||||
err = os.MkdirAll("./src_build", 0o777)
|
||||
srcBuild, _ := filepath.Abs("./src_build")
|
||||
if err != nil {
|
||||
log.Fatal("Failed to create ./src_build", err)
|
||||
}
|
||||
dockerArgs = append(dockerArgs, "-v", srcBuild+":/usr/src")
|
||||
} else {
|
||||
dockerArgs = append(dockerArgs, fmt.Sprintf("--mount=type=tmpfs,tmpfs-size=%d%s,destination=%s,U", 5, "G", "/usr/src")) // Ramfs for faster build.... maybe
|
||||
}
|
||||
if execName == "podman" {
|
||||
dockerArgs = append(dockerArgs, "--userns=keep-id")
|
||||
dockerRun = exec.Command(executable,
|
||||
"run",
|
||||
"--userns=keep-id",
|
||||
"--rm",
|
||||
"--volume", tmp+":/tmp/buildresult:Z",
|
||||
"gokr-rebuild-uboot")
|
||||
} else {
|
||||
dockerRun = exec.Command(executable,
|
||||
"run",
|
||||
"--rm",
|
||||
"--volume", tmp+":/tmp/buildresult:Z",
|
||||
"gokr-rebuild-uboot")
|
||||
}
|
||||
dockerArgs = append(dockerArgs, "gokr-rebuild-uboot")
|
||||
dockerRun = exec.Command(executable, dockerArgs...)
|
||||
dockerRun.Dir = tmp
|
||||
dockerRun.Stdout = os.Stdout
|
||||
dockerRun.Stderr = os.Stderr
|
||||
@@ -235,19 +260,12 @@ func rebuildUboot() {
|
||||
log.Fatalf("%s run: %v (cmd: %v)", execName, err, dockerRun.Args)
|
||||
}
|
||||
|
||||
if err := copyFile("../boot.scr", "boot.scr"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := copyFile("../u-boot-rockchip.bin", "u-boot-rockchip.bin"); err != nil {
|
||||
for _, filename := range []string{
|
||||
"boot.scr",
|
||||
"u-boot-rockchip.bin",
|
||||
} {
|
||||
if err := copyFile(filename, filepath.Join(tmp, filename)); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
if os.Getenv("GOKRAZY_IN_DOCKER") == "1" {
|
||||
indockerMain()
|
||||
} else {
|
||||
rebuildUboot()
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,9 +0,0 @@
|
||||
# Aliases extracted from modules themselves.
|
||||
alias of:N*T*Cbrcm,iproc-sba-v2C* bcm_sba_raid
|
||||
alias of:N*T*Cbrcm,iproc-sba-v2 bcm_sba_raid
|
||||
alias of:N*T*Cbrcm,iproc-sbaC* bcm_sba_raid
|
||||
alias of:N*T*Cbrcm,iproc-sba bcm_sba_raid
|
||||
alias of:N*T*Csophgo,sg2044-dwmacC* dwmac_sophgo
|
||||
alias of:N*T*Csophgo,sg2044-dwmac dwmac_sophgo
|
||||
alias of:N*T*Csophgo,sg2042-dwmacC* dwmac_sophgo
|
||||
alias of:N*T*Csophgo,sg2042-dwmac dwmac_sophgo
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
kernel/drivers/dma/bcm-sba-raid.ko:
|
||||
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.ko:
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
kernel/drivers/dma/bcm-sba-raid.ko
|
||||
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.ko
|
||||
@@ -1 +0,0 @@
|
||||
# Soft dependencies extracted from modules themselves.
|
||||
@@ -1 +0,0 @@
|
||||
# Aliases for symbols, used by symbol_request().
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
# Weak dependencies extracted from modules themselves.
|
||||
Binary file not shown.
Binary file not shown.
9503
vmlinuz.config
9503
vmlinuz.config
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user