mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
bcm27xx: switch to kernel v6.1
This patch adds support for Raspberry Pi 5.
This commit is contained in:
parent
5945bf489f
commit
92238a38e6
@ -9,9 +9,9 @@ ARCH:=arm
|
||||
BOARD:=bcm27xx
|
||||
BOARDNAME:=Broadcom BCM27xx
|
||||
FEATURES:=audio boot-part display ext4 fpu gpio rootfs-part rtc squashfs usb usbgadget
|
||||
SUBTARGETS:=bcm2708 bcm2709 bcm2710 bcm2711
|
||||
SUBTARGETS:=bcm2708 bcm2709 bcm2710 bcm2711 bcm2712
|
||||
|
||||
KERNEL_PATCHVER:=5.15
|
||||
KERNEL_PATCHVER:=6.1
|
||||
|
||||
define Target/Description
|
||||
Build firmware image for Broadcom BCM27xx SoC devices.
|
||||
@ -22,7 +22,7 @@ include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
DEFAULT_PACKAGES := $(filter-out urngd,$(DEFAULT_PACKAGES))
|
||||
DEFAULT_PACKAGES += \
|
||||
bcm27xx-gpu-fw \
|
||||
bcm27xx-gpu-fw bcm27xx-utils \
|
||||
kmod-usb-hid \
|
||||
kmod-sound-core kmod-sound-arm-bcm2835 \
|
||||
kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
|
||||
|
@ -17,6 +17,7 @@ raspberrypi,3-model-b-plus |\
|
||||
raspberrypi,400 |\
|
||||
raspberrypi,4-compute-module |\
|
||||
raspberrypi,4-model-b |\
|
||||
raspberrypi,5-model-b |\
|
||||
raspberrypi,model-b |\
|
||||
raspberrypi,model-b-plus |\
|
||||
raspberrypi,model-b-rev2)
|
||||
|
@ -14,6 +14,7 @@ set_state() {
|
||||
raspberrypi,400 |\
|
||||
raspberrypi,4-compute-module |\
|
||||
raspberrypi,4-model-b |\
|
||||
raspberrypi,5-model-b |\
|
||||
raspberrypi,model-b-plus)
|
||||
status_led="led1"
|
||||
;;
|
||||
|
@ -12,6 +12,7 @@ set_preinit_iface() {
|
||||
raspberrypi,400 |\
|
||||
raspberrypi,4-compute-module |\
|
||||
raspberrypi,4-model-b |\
|
||||
raspberrypi,5-model-b |\
|
||||
raspberrypi,model-b |\
|
||||
raspberrypi,model-b-plus |\
|
||||
raspberrypi,model-b-rev2)
|
||||
|
@ -2,16 +2,20 @@
|
||||
|
||||
. /lib/upgrade/common.sh
|
||||
|
||||
BOOTPART=/dev/mmcblk0p1
|
||||
|
||||
move_config() {
|
||||
if [ -b $BOOTPART ]; then
|
||||
local partdev
|
||||
|
||||
export_bootdevice && export_partdevice partdev 1 || {
|
||||
partdev=mmcblk0p1
|
||||
}
|
||||
|
||||
if [ -b "/dev/$partdev" ]; then
|
||||
insmod nls_cp437
|
||||
insmod nls_iso8859-1
|
||||
insmod fat
|
||||
insmod vfat
|
||||
mkdir -p /boot
|
||||
mount -t vfat -o rw,noatime $BOOTPART /boot
|
||||
mount -t vfat -o rw,noatime /dev/$partdev /boot
|
||||
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
|
||||
fi
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ platform_copy_config() {
|
||||
|
||||
if export_partdevice partdev 1; then
|
||||
mkdir -p /boot
|
||||
[ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot
|
||||
[ -f "/boot/kernel*.img" ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot
|
||||
cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
|
||||
tar -C / -zxvf "$UPGRADE_BACKUP" boot/cmdline.txt boot/config.txt
|
||||
sync
|
||||
|
@ -1,5 +1,6 @@
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_ALIGNMENT_TRAP=y
|
||||
CONFIG_APERTURE_HELPERS=y
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
@ -17,9 +18,8 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_CPU_SUSPEND=y
|
||||
CONFIG_ARM_CRYPTO=y
|
||||
CONFIG_ARM_ERRATA_411920=y
|
||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
||||
CONFIG_ARM_HAS_GROUP_RELOCS=y
|
||||
CONFIG_ARM_L1_CACHE_SHIFT=5
|
||||
# CONFIG_ARM_MHU_V2 is not set
|
||||
CONFIG_ARM_PATCH_PHYS_VIRT=y
|
||||
@ -30,7 +30,6 @@ CONFIG_ARM_UNWIND=y
|
||||
CONFIG_AUTO_ZRELADDR=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
# CONFIG_BCM2711_THERMAL is not set
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_FAST_MEMCPY=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
@ -54,6 +53,9 @@ CONFIG_BLK_PM=y
|
||||
CONFIG_BRCMSTB_L2_IRQ=y
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
# CONFIG_CACHE_L2X0 is not set
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
@ -71,6 +73,7 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
@ -100,19 +103,23 @@ CONFIG_CPU_HAS_ASID=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PABRT_V6=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_THUMB_CAPABLE=y
|
||||
CONFIG_CPU_TLB_V6=y
|
||||
CONFIG_CPU_V6K=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CURRENT_POINTER_IN_TPIDRURO=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
@ -124,7 +131,6 @@ CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_OPS=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
@ -132,6 +138,7 @@ CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
@ -143,7 +150,6 @@ CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIQ=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
@ -151,8 +157,6 @@ CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
# CONFIG_FPE_FASTFPE is not set
|
||||
# CONFIG_FPE_NWFPE is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
@ -163,6 +167,8 @@ CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
@ -187,7 +193,6 @@ CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
@ -205,6 +210,7 @@ CONFIG_INPUT_MOUSEDEV=y
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQSTACKS=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
@ -228,16 +234,20 @@ CONFIG_MAILBOX=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
@ -258,7 +268,7 @@ CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_OABI_COMPAT=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
@ -274,6 +284,9 @@ CONFIG_OF_RESOLVE=y
|
||||
CONFIG_OLD_SIGACTION=y
|
||||
CONFIG_OLD_SIGSUSPEND3=y
|
||||
CONFIG_PAGE_OFFSET=0xC0000000
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PERF_USE_VMALLOC=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
@ -287,12 +300,15 @@ CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_GPIOMEM=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
@ -324,6 +340,7 @@ CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMSC_PHY=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
@ -337,6 +354,7 @@ CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
@ -360,6 +378,8 @@ CONFIG_USB_USBNET=y
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VFP=y
|
||||
CONFIG_VIDEO_DEV=y
|
||||
CONFIG_VIDEO_V4L2_I2C=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_VT_CONSOLE_SLEEP=y
|
@ -1,9 +1,9 @@
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_ALIGNMENT_TRAP=y
|
||||
CONFIG_APERTURE_HELPERS=y
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
# CONFIG_ARCH_BCM_HR2 is not set
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
@ -22,9 +22,8 @@ CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_CPU_SUSPEND=y
|
||||
CONFIG_ARM_CRYPTO=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
||||
CONFIG_ARM_HAS_GROUP_RELOCS=y
|
||||
CONFIG_ARM_L1_CACHE_SHIFT=6
|
||||
CONFIG_ARM_L1_CACHE_SHIFT_6=y
|
||||
CONFIG_ARM_LPAE=y
|
||||
@ -40,7 +39,6 @@ CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUTO_ZRELADDR=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
CONFIG_BCM2711_THERMAL=y
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
# CONFIG_BCM2835_SMI is not set
|
||||
@ -69,6 +67,9 @@ CONFIG_BRCMSTB_L2_IRQ=y
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_BROADCOM_PHY=y
|
||||
# CONFIG_CACHE_L2X0 is not set
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
@ -86,9 +87,12 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
@ -116,6 +120,7 @@ CONFIG_CPU_HAS_ASID=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PABRT_V7=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
@ -124,7 +129,6 @@ CONFIG_CPU_THUMB_CAPABLE=y
|
||||
CONFIG_CPU_TLB_V7=y
|
||||
CONFIG_CPU_V7=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
@ -136,7 +140,9 @@ CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
@ -144,8 +150,10 @@ CONFIG_CRYPTO_SEQIV=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_CURRENT_POINTER_IN_TPIDRURO=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
|
||||
CONFIG_DIMLIB=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
@ -158,7 +166,6 @@ CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_OPS=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
@ -166,6 +173,7 @@ CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
@ -177,7 +185,6 @@ CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIQ=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
@ -185,8 +192,6 @@ CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
# CONFIG_FPE_FASTFPE is not set
|
||||
# CONFIG_FPE_NWFPE is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
@ -199,6 +204,8 @@ CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
@ -234,7 +241,6 @@ CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDEN_BRANCH_PREDICTOR=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
@ -258,6 +264,7 @@ CONFIG_INPUT_MOUSEDEV=y
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQSTACKS=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
@ -285,17 +292,21 @@ CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MICROCHIP_PHY=y
|
||||
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
@ -313,6 +324,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEON=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
@ -322,7 +334,7 @@ CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_OABI_COMPAT=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
@ -339,6 +351,9 @@ CONFIG_OLD_SIGACTION=y
|
||||
CONFIG_OLD_SIGSUSPEND3=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_OFFSET=0xC0000000
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
@ -363,13 +378,18 @@ CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_GPIOMEM=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
@ -408,6 +428,7 @@ CONFIG_SMP=y
|
||||
CONFIG_SMP_ON_UP=y
|
||||
CONFIG_SMSC_PHY=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
@ -423,6 +444,7 @@ CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
@ -456,6 +478,8 @@ CONFIG_USE_OF=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VFP=y
|
||||
CONFIG_VFPv3=y
|
||||
CONFIG_VIDEO_DEV=y
|
||||
CONFIG_VIDEO_V4L2_I2C=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_VT_CONSOLE_SLEEP=y
|
@ -1,6 +1,10 @@
|
||||
CONFIG_64BIT=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_APERTURE_HELPERS=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
|
||||
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
@ -9,15 +13,16 @@ CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
@ -27,7 +32,6 @@ CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
@ -56,7 +60,6 @@ CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
# CONFIG_BCM2711_THERMAL is not set
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
# CONFIG_BCM2835_SMI is not set
|
||||
@ -80,7 +83,10 @@ CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_CAVIUM_ERRATUM_22375=y
|
||||
CONFIG_CAVIUM_ERRATUM_23154=y
|
||||
CONFIG_CAVIUM_ERRATUM_27456=y
|
||||
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
@ -99,9 +105,12 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
@ -120,13 +129,13 @@ CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
@ -139,7 +148,9 @@ CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
@ -148,10 +159,10 @@ CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
CONFIG_DMABUF_HEAPS_SYSTEM=y
|
||||
@ -162,13 +173,13 @@ CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
@ -180,7 +191,6 @@ CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
@ -201,6 +211,9 @@ CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
@ -211,9 +224,9 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IOREMAP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
@ -236,7 +249,6 @@ CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
@ -279,16 +291,20 @@ CONFIG_MAILBOX=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MICROCHIP_PHY=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
@ -315,6 +331,7 @@ CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
@ -328,6 +345,9 @@ CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_OVERLAY=y
|
||||
CONFIG_OF_RESOLVE=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
# CONFIG_PCIE_BRCMSTB is not set
|
||||
@ -348,8 +368,10 @@ CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
@ -357,7 +379,9 @@ CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_GPIOMEM=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
@ -396,6 +420,7 @@ CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SMSC_PHY=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
@ -420,6 +445,7 @@ CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
@ -438,6 +464,8 @@ CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_USB_USBNET=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VIDEO_DEV=y
|
||||
CONFIG_VIDEO_V4L2_I2C=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
@ -1,6 +1,10 @@
|
||||
CONFIG_64BIT=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_APERTURE_HELPERS=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
|
||||
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
@ -9,25 +13,20 @@ CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_ERRATUM_1319367=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
@ -38,7 +37,7 @@ CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
|
||||
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
@ -56,7 +55,6 @@ CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
CONFIG_BCM2711_THERMAL=y
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
# CONFIG_BCM2835_SMI is not set
|
||||
@ -84,7 +82,10 @@ CONFIG_BROADCOM_PHY=y
|
||||
CONFIG_CAVIUM_ERRATUM_22375=y
|
||||
CONFIG_CAVIUM_ERRATUM_23154=y
|
||||
CONFIG_CAVIUM_ERRATUM_27456=y
|
||||
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
@ -103,9 +104,12 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
@ -124,13 +128,13 @@ CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
@ -143,7 +147,9 @@ CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
@ -152,10 +158,10 @@ CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DIMLIB=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
@ -167,13 +173,13 @@ CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
@ -185,7 +191,6 @@ CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
@ -206,6 +211,9 @@ CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
@ -216,9 +224,9 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IOREMAP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
@ -242,7 +250,6 @@ CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
@ -250,7 +257,6 @@ CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HW_RANDOM_BCM2835 is not set
|
||||
CONFIG_HW_RANDOM_IPROC_RNG200=y
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
@ -287,15 +293,19 @@ CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
@ -313,6 +323,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
@ -322,6 +333,7 @@ CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
@ -335,6 +347,9 @@ CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_OVERLAY=y
|
||||
CONFIG_OF_RESOLVE=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
@ -358,17 +373,23 @@ CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_GPIOMEM=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
@ -406,6 +427,7 @@ CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
@ -430,6 +452,7 @@ CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
@ -450,6 +473,8 @@ CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_PCI=y
|
||||
CONFIG_USB_XHCI_PLATFORM=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VIDEO_DEV=y
|
||||
CONFIG_VIDEO_V4L2_I2C=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
612
target/linux/bcm27xx/bcm2712/config-6.1
Normal file
612
target/linux/bcm27xx/bcm2712/config-6.1
Normal file
@ -0,0 +1,612 @@
|
||||
CONFIG_64BIT=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_APERTURE_HELPERS=y
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
|
||||
CONFIG_ARCH_BRCMSTB=y
|
||||
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_1463225=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
|
||||
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
|
||||
CONFIG_ARM_BRCMSTB_AVS_CPUFREQ=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_GIC_V3_ITS_PCI=y
|
||||
# CONFIG_ARM_MHU_V2 is not set
|
||||
# CONFIG_ARM_PL172_MPMC is not set
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
|
||||
# CONFIG_ARM_SMMU is not set
|
||||
# CONFIG_ARM_SMMU_V3 is not set
|
||||
CONFIG_ARM_TIMER_SP804=y
|
||||
CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
CONFIG_BCM2711_THERMAL=y
|
||||
CONFIG_BCM2712_IOMMU=y
|
||||
CONFIG_BCM2712_MIP=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
CONFIG_BCM2835_SMI=y
|
||||
CONFIG_BCM2835_SMI_DEV=m
|
||||
CONFIG_BCM2835_THERMAL=y
|
||||
CONFIG_BCM2835_VCHIQ=y
|
||||
# CONFIG_BCM2835_VCHIQ_MMAL is not set
|
||||
CONFIG_BCM2835_WDT=y
|
||||
CONFIG_BCM7038_L1_IRQ=y
|
||||
CONFIG_BCM7120_L2_IRQ=y
|
||||
CONFIG_BCM7XXX_PHY=y
|
||||
CONFIG_BCMA=y
|
||||
CONFIG_BCMA_BLOCKIO=y
|
||||
# CONFIG_BCMA_DEBUG is not set
|
||||
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
|
||||
CONFIG_BCMA_DRIVER_PCI=y
|
||||
CONFIG_BCMA_FALLBACK_SPROM=y
|
||||
CONFIG_BCMA_HOST_PCI=y
|
||||
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
|
||||
# CONFIG_BCMA_HOST_SOC is not set
|
||||
CONFIG_BCMGENET=y
|
||||
CONFIG_BCM_NET_PHYLIB=y
|
||||
CONFIG_BCM_VCIO=y
|
||||
# CONFIG_BCM_VC_SM_CMA is not set
|
||||
CONFIG_BCM_VIDEOCORE=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_NVME=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BRCMSTB_DPFE=y
|
||||
CONFIG_BRCMSTB_L2_IRQ=y
|
||||
CONFIG_BRCMSTB_MEMC=y
|
||||
CONFIG_BRCMSTB_PM=y
|
||||
# CONFIG_BRCMSTB_THERMAL is not set
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_BRCM_USB_PINMAP=y
|
||||
CONFIG_BROADCOM_PHY=y
|
||||
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
CONFIG_CLK_RASPBERRYPI=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMA=y
|
||||
CONFIG_CMA_ALIGNMENT=8
|
||||
CONFIG_CMA_AREAS=7
|
||||
# CONFIG_CMA_DEBUG is not set
|
||||
# CONFIG_CMA_DEBUGFS is not set
|
||||
CONFIG_CMA_SIZE_MBYTES=5
|
||||
# CONFIG_CMA_SIZE_SEL_MAX is not set
|
||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_RP1=y
|
||||
# CONFIG_COMMON_CLK_RP1_SDIO is not set
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_CTS=y
|
||||
CONFIG_CRYPTO_DRBG=y
|
||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
||||
CONFIG_CRYPTO_DRBG_MENU=y
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_GHASH_ARM64_CE=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
CONFIG_CRYPTO_SEQIV=y
|
||||
CONFIG_CRYPTO_SHA1=y
|
||||
CONFIG_CRYPTO_SHA1_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA2_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SHA3=y
|
||||
CONFIG_CRYPTO_SHA3_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SM3=y
|
||||
CONFIG_CRYPTO_SM3_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SM4=y
|
||||
CONFIG_CRYPTO_SM4_ARM64_CE=y
|
||||
CONFIG_CRYPTO_SM4_ARM64_CE_BLK=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DIMLIB=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
CONFIG_DMABUF_HEAPS_SYSTEM=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BCM2708=y
|
||||
CONFIG_DMA_BCM2835=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_OPS=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
CONFIG_EXTCON=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_BCM2708=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FREEZER=y
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
CONFIG_FS_ENCRYPTION=y
|
||||
CONFIG_FS_ENCRYPTION_ALGS=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IOREMAP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_INJECTION=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_BRCMSTB=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
# CONFIG_HOTPLUG_PCI_CPCI is not set
|
||||
# CONFIG_HOTPLUG_PCI_PCIE is not set
|
||||
CONFIG_HOTPLUG_PCI_SHPC=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_IPROC_RNG200=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_ALGOBIT=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BCM2835=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_BRCMSTB=y
|
||||
CONFIG_I2C_DESIGNWARE_CORE=y
|
||||
CONFIG_I2C_DESIGNWARE_PLATFORM=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
CONFIG_INPUT_RASPBERRYPI_BUTTON=y
|
||||
CONFIG_IOMMU_API=y
|
||||
# CONFIG_IOMMU_DEBUGFS is not set
|
||||
# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
|
||||
CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
|
||||
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
|
||||
CONFIG_IOMMU_DMA=y
|
||||
CONFIG_IOMMU_IOVA=y
|
||||
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
|
||||
# CONFIG_IOMMU_IO_PGTABLE_DART is not set
|
||||
# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
|
||||
CONFIG_IOMMU_SUPPORT=y
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_MSI_IOMMU=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_KEYS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_PWM=y
|
||||
CONFIG_LEDS_TRIGGER_ACTPWR=y
|
||||
CONFIG_LEDS_TRIGGER_INPUT=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_MACB=y
|
||||
CONFIG_MACB_PCI=y
|
||||
CONFIG_MACB_USE_HWSTAMP=y
|
||||
CONFIG_MAC_PARTITION=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MAILBOX=y
|
||||
# CONFIG_MAILBOX_TEST is not set
|
||||
CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_PLATFORM_DRIVERS=y
|
||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
CONFIG_MFD_RP1=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MICROCHIP_PHY=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
CONFIG_MMC_BCM2835_SDHOST=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_BLOCK_MINORS=32
|
||||
CONFIG_MMC_CQHCI=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_BRCMSTB=y
|
||||
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
|
||||
CONFIG_MMC_SDHCI_IPROC=y
|
||||
CONFIG_MMC_SDHCI_OF_DWCMSHC=y
|
||||
# CONFIG_MMC_SDHCI_PCI is not set
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NOP_USB_XCEIV=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_NVME_CORE=y
|
||||
# CONFIG_NVME_HWMON is not set
|
||||
# CONFIG_NVME_MULTIPATH is not set
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
CONFIG_OF_DYNAMIC=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IOMMU=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_OVERLAY=y
|
||||
CONFIG_OF_RESOLVE=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEAER_INJECT=y
|
||||
CONFIG_PCIEASPM=y
|
||||
# CONFIG_PCIEASPM_DEFAULT is not set
|
||||
# CONFIG_PCIEASPM_PERFORMANCE is not set
|
||||
CONFIG_PCIEASPM_POWERSAVE=y
|
||||
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCIE_BRCMSTB=y
|
||||
CONFIG_PCIE_DPC=y
|
||||
CONFIG_PCIE_DW=y
|
||||
CONFIG_PCIE_DW_HOST=y
|
||||
CONFIG_PCIE_DW_PLAT=y
|
||||
CONFIG_PCIE_DW_PLAT_HOST=y
|
||||
CONFIG_PCIE_MICROCHIP_HOST=y
|
||||
CONFIG_PCIE_PME=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_ECAM=y
|
||||
CONFIG_PCI_HOST_COMMON=y
|
||||
CONFIG_PCI_HOST_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PCI_STUB=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
# CONFIG_PHY_BRCM_SATA is not set
|
||||
CONFIG_PHY_BRCM_USB=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM2712=y
|
||||
CONFIG_PINCTRL_BCM2835=y
|
||||
CONFIG_PINCTRL_RP1=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_GPIO=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_BRCMSTB=y
|
||||
CONFIG_PWM_RP1=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_GPIOMEM=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_REGULATOR_GPIO=y
|
||||
CONFIG_RESET_BRCMSTB=y
|
||||
CONFIG_RESET_BRCMSTB_RESCAL=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RESET_RASPBERRYPI=y
|
||||
CONFIG_RESET_SIMPLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
# CONFIG_RPIVID_MEM is not set
|
||||
# CONFIG_RPI_POE_POWER is not set
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_BRCMSTB=y
|
||||
CONFIG_RTC_DRV_RPI=y
|
||||
CONFIG_RTC_I2C_AND_SPI=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_SENSORS_RASPBERRYPI_HWMON=y
|
||||
CONFIG_SENSORS_RP1_ADC=y
|
||||
CONFIG_SERIAL_8250_BCM2835AUX=y
|
||||
CONFIG_SERIAL_8250_BCM7271=y
|
||||
# CONFIG_SERIAL_8250_DMA is not set
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=1
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=0
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SERIAL_DEV_BUS=y
|
||||
# CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SMSC_PHY=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOC_BRCMSTB=y
|
||||
CONFIG_SOC_BUS=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
CONFIG_SUSPEND=y
|
||||
CONFIG_SUSPEND_FREEZER=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TEXTSEARCH is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UACCE is not set
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
CONFIG_UEVENT_HELPER_PATH=""
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
||||
# CONFIG_USB_BRCMSTB is not set
|
||||
CONFIG_USB_COMMON=y
|
||||
CONFIG_USB_DWC3=y
|
||||
# CONFIG_USB_DWC3_DUAL_ROLE is not set
|
||||
# CONFIG_USB_DWC3_GADGET is not set
|
||||
CONFIG_USB_DWC3_HOST=y
|
||||
CONFIG_USB_DWCOTG=y
|
||||
CONFIG_USB_GADGET=y
|
||||
# CONFIG_USB_HCD_BCMA is not set
|
||||
CONFIG_USB_PCI=y
|
||||
CONFIG_USB_PHY=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
# CONFIG_USB_UHCI_HCD is not set
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_PCI=y
|
||||
CONFIG_USB_XHCI_PLATFORM=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VIDEO_DEV=y
|
||||
CONFIG_VIDEO_V4L2_I2C=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_VT_CONSOLE_SLEEP=y
|
||||
CONFIG_VT_HW_CONSOLE_BINDING=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XZ_DEC_ARM=y
|
||||
CONFIG_XZ_DEC_BCJ=y
|
||||
CONFIG_ZONE_DMA32=y
|
12
target/linux/bcm27xx/bcm2712/target.mk
Normal file
12
target/linux/bcm27xx/bcm2712/target.mk
Normal file
@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
ARCH:=aarch64
|
||||
SUBTARGET:=bcm2712
|
||||
BOARDNAME:=BCM2712 boards (64 bit)
|
||||
CPU_TYPE:=cortex-a76
|
||||
FEATURES+=pci pcie
|
||||
|
||||
define Target/Description
|
||||
Build firmware image for BCM2712 devices.
|
||||
This firmware features a 64 bit kernel.
|
||||
endef
|
@ -76,8 +76,8 @@ define Device/rpi
|
||||
raspberrypi,model-zero raspberrypi,model-zero-w
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43430-sdio \
|
||||
cypress-nvram-43430-sdio-rpi-zero-w \
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
brcmfmac-nvram-43430-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls
|
||||
endef
|
||||
ifeq ($(SUBTARGET),bcm2708)
|
||||
TARGET_DEVICES += rpi
|
||||
@ -87,10 +87,10 @@ define Device/rpi-2
|
||||
DEVICE_MODEL := 2B/2B 1.2
|
||||
DEVICE_VARIANT := (32bit)
|
||||
DEVICE_ALT0_VENDOR := Raspberry Pi
|
||||
DEVICE_ALT0_MODEL := 3B/3B+/3CM
|
||||
DEVICE_ALT0_MODEL := 3B/3B+/CM3
|
||||
DEVICE_ALT0_VARIANT := (32bit)
|
||||
DEVICE_ALT1_VENDOR := Raspberry Pi
|
||||
DEVICE_ALT1_MODEL := 4B/400/4CM
|
||||
DEVICE_ALT1_MODEL := 4B/400/CM4
|
||||
DEVICE_ALT1_VARIANT := (32bit)
|
||||
DEVICE_DTS := \
|
||||
bcm2709-rpi-2-b bcm2710-rpi-2-b \
|
||||
@ -107,10 +107,10 @@ define Device/rpi-2
|
||||
raspberrypi,model-zero-2
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43430-sdio \
|
||||
cypress-nvram-43430-sdio-rpi-3b \
|
||||
brcmfmac-nvram-43430-sdio \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-3b-plus cypress-nvram-43455-sdio-rpi-4b \
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
@ -119,7 +119,7 @@ ifeq ($(SUBTARGET),bcm2709)
|
||||
endif
|
||||
|
||||
define Device/rpi-3
|
||||
DEVICE_MODEL := 3B/3B+/3CM
|
||||
DEVICE_MODEL := 3B/3B+/CM3
|
||||
DEVICE_VARIANT := (64bit)
|
||||
DEVICE_ALT0_VENDOR := Raspberry Pi
|
||||
DEVICE_ALT0_MODEL := 2B-1.2
|
||||
@ -138,17 +138,17 @@ define Device/rpi-3
|
||||
raspberrypi,model-zero-2
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43430-sdio \
|
||||
cypress-nvram-43430-sdio-rpi-3b \
|
||||
brcmfmac-nvram-43430-sdio \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-3b-plus \
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls
|
||||
endef
|
||||
ifeq ($(SUBTARGET),bcm2710)
|
||||
TARGET_DEVICES += rpi-3
|
||||
endif
|
||||
|
||||
define Device/rpi-4
|
||||
DEVICE_MODEL := 4B/400/4CM
|
||||
DEVICE_MODEL := 4B/400/CM4
|
||||
DEVICE_VARIANT := (64bit)
|
||||
KERNEL_IMG := kernel8.img
|
||||
DEVICE_DTS := \
|
||||
@ -161,9 +161,10 @@ define Device/rpi-4
|
||||
raspberrypi,4-model-b
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-4b \
|
||||
kmod-brcmfmac wpad-basic-wolfssl \
|
||||
kmod-usb-net-lan78xx
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls \
|
||||
kmod-usb-net-lan78xx \
|
||||
kmod-r8169
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
@ -171,4 +172,21 @@ ifeq ($(SUBTARGET),bcm2711)
|
||||
TARGET_DEVICES += rpi-4
|
||||
endif
|
||||
|
||||
define Device/rpi-5
|
||||
DEVICE_MODEL := 5
|
||||
KERNEL_IMG := kernel_2712.img
|
||||
DEVICE_DTS := broadcom/bcm2712-rpi-5-b
|
||||
SUPPORTED_DEVICES := raspberrypi,5-model-b
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43455-sdio \
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls \
|
||||
kmod-hwmon-pwmfan kmod-thermal
|
||||
IMAGE/sysupgrade.img.gz := boot-common | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | sdcard-img | gzip
|
||||
endef
|
||||
ifeq ($(SUBTARGET),bcm2712)
|
||||
TARGET_DEVICES += rpi-5
|
||||
endif
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
################################################################################
|
||||
# For overclocking and various other settings, see:
|
||||
# https://www.raspberrypi.org/documentation/configuration/config-txt/README.md
|
||||
# https://www.raspberrypi.com/documentation/computers/config_txt.html
|
||||
################################################################################
|
||||
|
||||
# OpenWrt config
|
||||
|
@ -5,7 +5,7 @@
|
||||
# Restore PL011 (ttyAMA0) to GPIOs 14 & 15, instead of Mini UART (ttyS0).
|
||||
# Mini UART is disabled by default unless "enable_uart=1" is specified,
|
||||
# which changes the core frequency to a fixed value and impacts performance.
|
||||
# See https://www.raspberrypi.org/documentation/configuration/uart.md
|
||||
# See https://www.raspberrypi.com/documentation/computers/configuration.html#mini-uart-and-cpu-core-frequency
|
||||
[pi0w]
|
||||
dtoverlay=disable-bt
|
||||
[pi3]
|
||||
|
@ -1,10 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
[ $# -eq 5 ] || {
|
||||
set -e -x
|
||||
|
||||
if [ $# -ne 5 ]; then
|
||||
echo "SYNTAX: $0 <file> <bootfs image> <rootfs image> <bootfs size> <rootfs size>"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
OUTPUT="$1"
|
||||
BOOTFS="$2"
|
||||
@ -12,18 +13,16 @@ ROOTFS="$3"
|
||||
BOOTFSSIZE="$4"
|
||||
ROOTFSSIZE="$5"
|
||||
|
||||
align=4096
|
||||
head=4
|
||||
kernel_type=c
|
||||
rootfs_type=83
|
||||
sect=63
|
||||
|
||||
set $(ptgen -o $OUTPUT -h $head -s $sect -l 4096 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M)
|
||||
set $(ptgen -o $OUTPUT -h $head -s $sect -l $align -t $kernel_type -p ${BOOTFSSIZE}M -t $rootfs_type -p ${ROOTFSSIZE}M)
|
||||
|
||||
BOOTOFFSET="$(($1 / 512))"
|
||||
BOOTSIZE="$(($2 / 512))"
|
||||
ROOTFSOFFSET="$(($3 / 512))"
|
||||
ROOTFSSIZE="$(($4 / 512))"
|
||||
|
||||
dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc
|
||||
dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ define KernelPackage/pwm-raspberrypi-poe
|
||||
CONFIG_PWM_RASPBERRYPI_POE
|
||||
FILES:=$(LINUX_DIR)/drivers/pwm/pwm-raspberrypi-poe.ko
|
||||
AUTOLOAD:=$(call AutoLoad,20,pwm-raspberrypi-poe)
|
||||
DEPENDS:=@TARGET_bcm27xx @LINUX_5_15 +kmod-hwmon-pwmfan
|
||||
DEPENDS:=@TARGET_bcm27xx +kmod-hwmon-pwmfan
|
||||
endef
|
||||
|
||||
define KernelPackage/pwm-raspberrypi-poe/description
|
||||
|
@ -371,8 +371,7 @@ define KernelPackage/sound-soc-chipdip-dac
|
||||
$(LINUX_DIR)/sound/soc/bcm/snd-soc-chipdip-dac.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-chipdip-dac)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
@LINUX_5_10
|
||||
kmod-sound-soc-bcm2835-i2s
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
@ -383,6 +382,29 @@ endef
|
||||
$(eval $(call KernelPackage,sound-soc-chipdip-dac))
|
||||
|
||||
|
||||
define KernelPackage/sound-soc-dacberry-soundcard
|
||||
TITLE:=Support for DACBERRY400 Soundcard
|
||||
KCONFIG:= \
|
||||
CONFIG_SND_DACBERRY400 \
|
||||
CONFIG_SND_SOC_TLV320AIC3X_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/soc/bcm/snd-soc-dacberry400.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-tlv320aic3x.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-tlv320aic3x-i2c snd-soc-dacberry400)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-i2c-bcm2835 \
|
||||
+kmod-regmap-i2c
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
define KernelPackage/sound-soc-dacberry-soundcard/description
|
||||
This package contains support for DACBERRY400 Soundcard
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,sound-soc-dacberry-soundcard))
|
||||
|
||||
|
||||
define KernelPackage/sound-soc-digidac1-soundcard
|
||||
TITLE:=Support for RRA DigiDAC1
|
||||
KCONFIG:= \
|
||||
@ -660,14 +682,17 @@ define KernelPackage/sound-soc-hifiberry-digi
|
||||
TITLE:=Support for HifiBerry Digi / Digi+ / Digi+ Pro
|
||||
KCONFIG:= \
|
||||
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI \
|
||||
CONFIG_SND_SOC_WM8804
|
||||
CONFIG_SND_SOC_WM8804 \
|
||||
CONFIG_SND_SOC_WM8804_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-wm8804)
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804-i2c.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-wm8804 snd-soc-wm8804-i2c)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-sound-soc-rpi-wm8804-soundcard \
|
||||
+kmod-i2c-bcm2835
|
||||
+kmod-i2c-bcm2835 \
|
||||
+kmod-regmap-i2c
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
@ -803,17 +828,23 @@ define KernelPackage/sound-soc-justboom-both
|
||||
KCONFIG:= \
|
||||
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH \
|
||||
CONFIG_SND_SOC_PCM512x \
|
||||
CONFIG_SND_SOC_WM8804
|
||||
CONFIG_SND_SOC_PCM512x_I2C \
|
||||
CONFIG_SND_SOC_WM8804 \
|
||||
CONFIG_SND_SOC_WM8804_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/soc/bcm/snd-soc-justboom-both.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-pcm512x.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-pcm512x snd-soc-wm8804 \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-pcm512x-i2c.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804-i2c.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-pcm512x-i2c snd-soc-pcm512x \
|
||||
snd-soc-wm8804-i2c snd-soc-wm8804 \
|
||||
snd-soc-justboom-both)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-sound-soc-rpi-wm8804-soundcard \
|
||||
+kmod-i2c-bcm2835
|
||||
+kmod-i2c-bcm2835 \
|
||||
+kmod-regmap-i2c
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
@ -828,14 +859,18 @@ define KernelPackage/sound-soc-justboom-dac
|
||||
TITLE:=Support for JustBoom DAC
|
||||
KCONFIG:= \
|
||||
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC \
|
||||
CONFIG_SND_SOC_PCM512x
|
||||
CONFIG_SND_SOC_PCM512x \
|
||||
CONFIG_SND_SOC_PCM512x_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/soc/bcm/snd-soc-justboom-dac.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-pcm512x.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-pcm512x snd-soc-justboom-dac)
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-pcm512x.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-pcm512x-i2c.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-pcm512x-i2c snd-soc-pcm512x \
|
||||
snd-soc-justboom-dac)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-i2c-bcm2835
|
||||
+kmod-i2c-bcm2835 \
|
||||
+kmod-regmap-i2c
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
@ -850,14 +885,17 @@ define KernelPackage/sound-soc-justboom-digi
|
||||
TITLE:=Support for JustBoom Digi
|
||||
KCONFIG:= \
|
||||
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI \
|
||||
CONFIG_SND_SOC_WM8804
|
||||
CONFIG_SND_SOC_WM8804 \
|
||||
CONFIG_SND_SOC_WM8804_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-wm8804)
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804-i2c.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-wm8804-i2c snd-soc-wm8804)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-sound-soc-rpi-wm8804-soundcard \
|
||||
+kmod-i2c-bcm2835
|
||||
+kmod-i2c-bcm2835 \
|
||||
+kmod-regmap-i2c
|
||||
$(call AddDepends/sound)
|
||||
endef
|
||||
|
||||
@ -932,6 +970,7 @@ define KernelPackage/sound-soc-rpi-cirrus
|
||||
CONFIG_SND_SOC_WM8804 \
|
||||
CONFIG_SND_SOC_WM_ADSP
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/firmware/cirrus/cs_dsp.ko \
|
||||
$(LINUX_DIR)/drivers/mfd/arizona.ko \
|
||||
$(LINUX_DIR)/drivers/mfd/arizona-i2c.ko \
|
||||
$(LINUX_DIR)/sound/soc/bcm/snd-soc-rpi-cirrus.ko \
|
||||
@ -939,7 +978,7 @@ define KernelPackage/sound-soc-rpi-cirrus
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm-adsp.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm5102.ko \
|
||||
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8804.ko
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-pcm1794a snd-soc-rpi-cirrus)
|
||||
AUTOLOAD:=$(call AutoLoad,68,snd-soc-rpi-cirrus)
|
||||
DEPENDS:= \
|
||||
kmod-sound-soc-bcm2835-i2s \
|
||||
+kmod-i2c-bcm2835 \
|
||||
|
@ -5,13 +5,10 @@
|
||||
define KernelPackage/camera-bcm2835
|
||||
TITLE:=BCM2835 Camera
|
||||
KCONFIG:= \
|
||||
CONFIG_VIDEO_BCM2835 \
|
||||
CONFIG_VIDEO_BCM2835_MMAL \
|
||||
CONFIG_VIDEO_BCM2835_UNICAM=n \
|
||||
CONFIG_VIDEO_ISP_BCM2835=n
|
||||
CONFIG_VIDEO_BCM2835
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/staging/vc04_services/bcm2835-camera/bcm2835-v4l2.ko
|
||||
AUTOLOAD:=$(call AutoLoad,65,bcm2835-v4l2)
|
||||
AUTOLOAD:=$(call AutoLoad,66,bcm2835-v4l2)
|
||||
$(call AddDepends/video,@TARGET_bcm27xx +kmod-vchiq-mmal-bcm2835 +kmod-video-videobuf2)
|
||||
endef
|
||||
|
||||
@ -23,6 +20,24 @@ endef
|
||||
$(eval $(call KernelPackage,camera-bcm2835))
|
||||
|
||||
|
||||
define KernelPackage/codec-bcm2835
|
||||
TITLE:=BCM2835 Video Codec
|
||||
KCONFIG:= \
|
||||
CONFIG_VIDEO_CODEC_BCM2835
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/staging/vc04_services/bcm2835-codec/bcm2835-codec.ko
|
||||
AUTOLOAD:=$(call AutoLoad,67,bcm2835-codec)
|
||||
$(call AddDepends/video,@TARGET_bcm27xx +kmod-vchiq-mmal-bcm2835 +kmod-video-dma +kmod-video-mem2mem)
|
||||
endef
|
||||
|
||||
define KernelPackage/codec-bcm2835/description
|
||||
V4L2 video codecs for Broadcom BCM2835 SoC.
|
||||
This operates over the VCHIQ interface to a service running on VideoCore.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,codec-bcm2835))
|
||||
|
||||
|
||||
define KernelPackage/drm-vc4
|
||||
SUBMENU:=$(VIDEO_MENU)
|
||||
TITLE:=Broadcom VC4 Graphics
|
||||
@ -32,14 +47,12 @@ define KernelPackage/drm-vc4
|
||||
+kmod-sound-soc-core
|
||||
KCONFIG:= \
|
||||
CONFIG_DRM_VC4 \
|
||||
CONFIG_DRM_VC4_HDMI_CEC=y \
|
||||
CONFIG_DRM_GUD=n \
|
||||
CONFIG_DRM_V3D=n \
|
||||
CONFIG_DRM_TVE200=n
|
||||
CONFIG_DRM_VC4_HDMI_CEC=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/display/drm_display_helper.ko \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/drm_dma_helper.ko \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/vc4/vc4.ko \
|
||||
$(LINUX_DIR)/drivers/gpu/drm/drm_kms_helper.ko \
|
||||
$(LINUX_DIR)/drivers/media/cec/cec.ko@lt5.10 \
|
||||
$(LINUX_DIR)/drivers/media/cec/core/cec.ko
|
||||
AUTOLOAD:=$(call AutoProbe,vc4)
|
||||
endef
|
||||
@ -52,6 +65,24 @@ endef
|
||||
$(eval $(call KernelPackage,drm-vc4))
|
||||
|
||||
|
||||
define KernelPackage/isp-bcm2835
|
||||
TITLE:=BCM2835 ISP
|
||||
KCONFIG:= \
|
||||
CONFIG_VIDEO_ISP_BCM2835
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,67,bcm2835-isp)
|
||||
$(call AddDepends/video,@TARGET_bcm27xx +kmod-vchiq-mmal-bcm2835 +kmod-video-dma)
|
||||
endef
|
||||
|
||||
define KernelPackage/isp-bcm2835/description
|
||||
V4L2 driver for the Broadcom BCM2835 ISP hardware.
|
||||
This operates over the VCHIQ interface to a service running on VideoCore.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,isp-bcm2835))
|
||||
|
||||
|
||||
define KernelPackage/vc-sm-cma
|
||||
TITLE:=VideoCore Shared Memory (CMA) driver
|
||||
KCONFIG:= \
|
||||
@ -72,8 +103,7 @@ $(eval $(call KernelPackage,vc-sm-cma))
|
||||
define KernelPackage/vchiq-mmal-bcm2835
|
||||
TITLE:=BCM2835 MMAL VCHIQ service
|
||||
KCONFIG:= \
|
||||
CONFIG_BCM2835_VCHIQ_MMAL \
|
||||
CONFIG_VIDEO_CODEC_BCM2835=n
|
||||
CONFIG_BCM2835_VCHIQ_MMAL
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/staging/vc04_services/vchiq-mmal/bcm2835-mmal-vchiq.ko
|
||||
$(call AddDepends/video,@TARGET_bcm27xx +kmod-vc-sm-cma)
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 882882912cd25a637ba0cf09932ad248f584e680 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Wed, 28 Dec 2022 13:19:49 +0100
|
||||
Subject: [PATCH 1/2] Revert "net: broadcom: Add PTP_1588_CLOCK_OPTIONAL
|
||||
dependency for BCMGENET under ARCH_BCM2835"
|
||||
|
||||
[ Upstream commit 421f8663b3a775c32f724f793264097c60028f2e ]
|
||||
|
||||
This reverts commit eb96fd3983b2cca1c90db45eaff1de67b94f9950.
|
||||
---
|
||||
drivers/net/ethernet/broadcom/Kconfig | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/Kconfig
|
||||
+++ b/drivers/net/ethernet/broadcom/Kconfig
|
||||
@@ -71,14 +71,13 @@ config BCM63XX_ENET
|
||||
config BCMGENET
|
||||
tristate "Broadcom GENET internal MAC support"
|
||||
depends on HAS_IOMEM
|
||||
- depends on PTP_1588_CLOCK_OPTIONAL || !ARCH_BCM2835
|
||||
select MII
|
||||
select PHYLIB
|
||||
select FIXED_PHY
|
||||
select BCM7XXX_PHY
|
||||
select MDIO_BCM_UNIMAC
|
||||
select DIMLIB
|
||||
- select BROADCOM_PHY if ARCH_BCM2835
|
||||
+ select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
|
||||
help
|
||||
This driver supports the built-in Ethernet MACs found in the
|
||||
Broadcom BCM7xxx Set Top Box family chipset.
|
@ -1,23 +0,0 @@
|
||||
From f032f801658ce6b47498f3e140f7e4aef0645042 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Wed, 28 Dec 2022 13:20:24 +0100
|
||||
Subject: [PATCH 2/2] Revert "net: broadcom: Fix BCMGENET Kconfig"
|
||||
|
||||
[ Upstream commit 8d820bc9d12b8beebca836cceaf2bbe68216c2f8 ]
|
||||
|
||||
This reverts commit 6a264203dbdb0d076891d83bf3bb274d6b3863f2.
|
||||
---
|
||||
drivers/net/ethernet/broadcom/Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/Kconfig
|
||||
+++ b/drivers/net/ethernet/broadcom/Kconfig
|
||||
@@ -77,7 +77,7 @@ config BCMGENET
|
||||
select BCM7XXX_PHY
|
||||
select MDIO_BCM_UNIMAC
|
||||
select DIMLIB
|
||||
- select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
|
||||
+ select BROADCOM_PHY if ARCH_BCM2835
|
||||
help
|
||||
This driver supports the built-in Ethernet MACs found in the
|
||||
Broadcom BCM7xxx Set Top Box family chipset.
|
@ -1,111 +0,0 @@
|
||||
From d145ff5ff4c35bf00a84c7f916165150d0a75e53 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 15:59:29 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Split the CEC disable / enable
|
||||
functions in two
|
||||
|
||||
In order to ease further additions to the CEC enable and disable, let's
|
||||
split the function into two functions, one to enable and the other to
|
||||
disable.
|
||||
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-5-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 75 ++++++++++++++++++++--------------
|
||||
1 file changed, 45 insertions(+), 30 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -1749,7 +1749,7 @@ static irqreturn_t vc4_cec_irq_handler(i
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable)
|
||||
+static int vc4_hdmi_cec_enable(struct cec_adapter *adap)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
/* clock period in microseconds */
|
||||
@@ -1762,38 +1762,53 @@ static int vc4_hdmi_cec_adap_enable(stru
|
||||
val |= ((4700 / usecs) << VC4_HDMI_CEC_CNT_TO_4700_US_SHIFT) |
|
||||
((4500 / usecs) << VC4_HDMI_CEC_CNT_TO_4500_US_SHIFT);
|
||||
|
||||
- if (enable) {
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_5, val |
|
||||
- VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_5, val);
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_2,
|
||||
- ((1500 / usecs) << VC4_HDMI_CEC_CNT_TO_1500_US_SHIFT) |
|
||||
- ((1300 / usecs) << VC4_HDMI_CEC_CNT_TO_1300_US_SHIFT) |
|
||||
- ((800 / usecs) << VC4_HDMI_CEC_CNT_TO_800_US_SHIFT) |
|
||||
- ((600 / usecs) << VC4_HDMI_CEC_CNT_TO_600_US_SHIFT) |
|
||||
- ((400 / usecs) << VC4_HDMI_CEC_CNT_TO_400_US_SHIFT));
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_3,
|
||||
- ((2750 / usecs) << VC4_HDMI_CEC_CNT_TO_2750_US_SHIFT) |
|
||||
- ((2400 / usecs) << VC4_HDMI_CEC_CNT_TO_2400_US_SHIFT) |
|
||||
- ((2050 / usecs) << VC4_HDMI_CEC_CNT_TO_2050_US_SHIFT) |
|
||||
- ((1700 / usecs) << VC4_HDMI_CEC_CNT_TO_1700_US_SHIFT));
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_4,
|
||||
- ((4300 / usecs) << VC4_HDMI_CEC_CNT_TO_4300_US_SHIFT) |
|
||||
- ((3900 / usecs) << VC4_HDMI_CEC_CNT_TO_3900_US_SHIFT) |
|
||||
- ((3600 / usecs) << VC4_HDMI_CEC_CNT_TO_3600_US_SHIFT) |
|
||||
- ((3500 / usecs) << VC4_HDMI_CEC_CNT_TO_3500_US_SHIFT));
|
||||
-
|
||||
- if (!vc4_hdmi->variant->external_irq_controller)
|
||||
- HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC);
|
||||
- } else {
|
||||
- if (!vc4_hdmi->variant->external_irq_controller)
|
||||
- HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC);
|
||||
- HDMI_WRITE(HDMI_CEC_CNTRL_5, val |
|
||||
- VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
- }
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_5, val |
|
||||
+ VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_5, val);
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_2,
|
||||
+ ((1500 / usecs) << VC4_HDMI_CEC_CNT_TO_1500_US_SHIFT) |
|
||||
+ ((1300 / usecs) << VC4_HDMI_CEC_CNT_TO_1300_US_SHIFT) |
|
||||
+ ((800 / usecs) << VC4_HDMI_CEC_CNT_TO_800_US_SHIFT) |
|
||||
+ ((600 / usecs) << VC4_HDMI_CEC_CNT_TO_600_US_SHIFT) |
|
||||
+ ((400 / usecs) << VC4_HDMI_CEC_CNT_TO_400_US_SHIFT));
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_3,
|
||||
+ ((2750 / usecs) << VC4_HDMI_CEC_CNT_TO_2750_US_SHIFT) |
|
||||
+ ((2400 / usecs) << VC4_HDMI_CEC_CNT_TO_2400_US_SHIFT) |
|
||||
+ ((2050 / usecs) << VC4_HDMI_CEC_CNT_TO_2050_US_SHIFT) |
|
||||
+ ((1700 / usecs) << VC4_HDMI_CEC_CNT_TO_1700_US_SHIFT));
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_4,
|
||||
+ ((4300 / usecs) << VC4_HDMI_CEC_CNT_TO_4300_US_SHIFT) |
|
||||
+ ((3900 / usecs) << VC4_HDMI_CEC_CNT_TO_3900_US_SHIFT) |
|
||||
+ ((3600 / usecs) << VC4_HDMI_CEC_CNT_TO_3600_US_SHIFT) |
|
||||
+ ((3500 / usecs) << VC4_HDMI_CEC_CNT_TO_3500_US_SHIFT));
|
||||
+
|
||||
+ if (!vc4_hdmi->variant->external_irq_controller)
|
||||
+ HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int vc4_hdmi_cec_disable(struct cec_adapter *adap)
|
||||
+{
|
||||
+ struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
+
|
||||
+ if (!vc4_hdmi->variant->external_irq_controller)
|
||||
+ HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC);
|
||||
+
|
||||
+ HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) |
|
||||
+ VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable)
|
||||
+{
|
||||
+ if (enable)
|
||||
+ return vc4_hdmi_cec_enable(adap);
|
||||
+ else
|
||||
+ return vc4_hdmi_cec_disable(adap);
|
||||
+}
|
||||
+
|
||||
static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
@ -1,51 +0,0 @@
|
||||
From 0ba6ff7f5632f01143911e307be538ecc62e5094 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 15:59:30 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Make sure the device is powered with
|
||||
CEC
|
||||
|
||||
Similarly to what we encountered with the detect hook with DRM, nothing
|
||||
actually prevents any of the CEC callback from being run while the HDMI
|
||||
output is disabled.
|
||||
|
||||
However, this is an issue since any register access to the controller
|
||||
when it's powered down will result in a silent hang.
|
||||
|
||||
Let's make sure we run the runtime_pm hooks when the CEC adapter is
|
||||
opened and closed by the userspace to avoid that issue.
|
||||
|
||||
Fixes: 15b4511a4af6 ("drm/vc4: add HDMI CEC support")
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-6-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -1754,8 +1754,14 @@ static int vc4_hdmi_cec_enable(struct ce
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
/* clock period in microseconds */
|
||||
const u32 usecs = 1000000 / CEC_CLOCK_FREQ;
|
||||
- u32 val = HDMI_READ(HDMI_CEC_CNTRL_5);
|
||||
+ u32 val;
|
||||
+ int ret;
|
||||
|
||||
+ ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ val = HDMI_READ(HDMI_CEC_CNTRL_5);
|
||||
val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET |
|
||||
VC4_HDMI_CEC_CNT_TO_4700_US_MASK |
|
||||
VC4_HDMI_CEC_CNT_TO_4500_US_MASK);
|
||||
@@ -1798,6 +1804,8 @@ static int vc4_hdmi_cec_disable(struct c
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) |
|
||||
VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
|
||||
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,49 +0,0 @@
|
||||
From d0a44f399526a061e74b9a34b554f3d0e9cdddb3 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 15:59:31 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Warn if we access the controller while
|
||||
disabled
|
||||
|
||||
We've had many silent hangs where the kernel would look like it just
|
||||
stalled due to the access to one of the HDMI registers while the
|
||||
controller was disabled.
|
||||
|
||||
Add a warning if we're about to do that so that it's at least not silent
|
||||
anymore.
|
||||
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-7-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _VC4_HDMI_REGS_H_
|
||||
#define _VC4_HDMI_REGS_H_
|
||||
|
||||
+#include <linux/pm_runtime.h>
|
||||
+
|
||||
#include "vc4_hdmi.h"
|
||||
|
||||
#define VC4_HDMI_PACKET_STRIDE 0x24
|
||||
@@ -415,6 +417,8 @@ static inline u32 vc4_hdmi_read(struct v
|
||||
const struct vc4_hdmi_variant *variant = hdmi->variant;
|
||||
void __iomem *base;
|
||||
|
||||
+ WARN_ON(!pm_runtime_active(&hdmi->pdev->dev));
|
||||
+
|
||||
if (reg >= variant->num_registers) {
|
||||
dev_warn(&hdmi->pdev->dev,
|
||||
"Invalid register ID %u\n", reg);
|
||||
@@ -441,6 +445,8 @@ static inline void vc4_hdmi_write(struct
|
||||
const struct vc4_hdmi_variant *variant = hdmi->variant;
|
||||
void __iomem *base;
|
||||
|
||||
+ WARN_ON(!pm_runtime_active(&hdmi->pdev->dev));
|
||||
+
|
||||
if (reg >= variant->num_registers) {
|
||||
dev_warn(&hdmi->pdev->dev,
|
||||
"Invalid register ID %u\n", reg);
|
@ -1,47 +0,0 @@
|
||||
From faa24f47c0066893e0b7772befe378bde4dc2ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 25 Oct 2021 17:28:54 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Remove the DDC probing for status
|
||||
detection
|
||||
|
||||
Commit 9d44abbbb8d5 ("drm/vc4: Fall back to using an EDID probe in the
|
||||
absence of a GPIO.") added some code to read the EDID through DDC in the
|
||||
HDMI driver detect hook since the Pi3 had no HPD GPIO back then.
|
||||
However, commit b1b8f45b3130 ("ARM: dts: bcm2837: Add missing GPIOs of
|
||||
Expander") changed that a couple of years later.
|
||||
|
||||
This causes an issue though since some TV (like the LG 55C8) when it
|
||||
comes out of standy will deassert the HPD line, but the EDID will
|
||||
remain readable.
|
||||
|
||||
It causes an issues nn platforms without an HPD GPIO, like the Pi4,
|
||||
where the DDC probing will be our primary mean to detect a display, and
|
||||
thus we will never detect the HPD pulse. This was fine before since the
|
||||
pulse was small enough that we would never detect it, and we also didn't
|
||||
have anything (like the scrambler) that needed to be set up in the
|
||||
display.
|
||||
|
||||
However, now that we have both, the display during the HPD pulse will
|
||||
clear its scrambler status, and since we won't detect the
|
||||
disconnect/reconnect cycle we will never enable the scrambler back.
|
||||
|
||||
As our main reason for that DDC probing is gone, let's just remove it.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Link: https://lore.kernel.org/r/20211025152903.1088803-2-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -179,8 +179,6 @@ vc4_hdmi_connector_detect(struct drm_con
|
||||
if (vc4_hdmi->hpd_gpio) {
|
||||
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
|
||||
connected = true;
|
||||
- } else if (drm_probe_ddc(vc4_hdmi->ddc)) {
|
||||
- connected = true;
|
||||
} else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) {
|
||||
connected = true;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
From f818ed9b9033ef7fbe45a7f5e2fc8c0d0cfe8c1d Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 25 Oct 2021 17:29:01 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Raise the maximum clock rate
|
||||
|
||||
Now that we have the infrastructure in place, we can raise the maximum
|
||||
pixel rate we can reach for HDMI0 on the BCM2711.
|
||||
|
||||
HDMI1 is left untouched since its pixelvalve has a smaller FIFO and
|
||||
would need a clock faster than what we can provide to support the same
|
||||
modes.
|
||||
|
||||
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -2387,7 +2387,7 @@ static const struct vc4_hdmi_variant bcm
|
||||
.encoder_type = VC4_ENCODER_TYPE_HDMI0,
|
||||
.debugfs_name = "hdmi0_regs",
|
||||
.card_name = "vc4-hdmi-0",
|
||||
- .max_pixel_clock = HDMI_14_MAX_TMDS_CLK,
|
||||
+ .max_pixel_clock = 600000000,
|
||||
.registers = vc5_hdmi_hdmi0_fields,
|
||||
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
|
||||
.phy_lane_mapping = {
|
@ -1,907 +0,0 @@
|
||||
From d91a953904e1aeddf24a95af40fc1ae7ba2319fd Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 25 Oct 2021 16:11:08 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Add a spinlock to protect register
|
||||
access
|
||||
|
||||
The vc4 HDMI driver has multiple path shared between the CEC, ALSA and
|
||||
KMS frameworks, plus two interrupt handlers (CEC and hotplug) that will
|
||||
read and modify a number of registers.
|
||||
|
||||
Even though not bug has been reported so far, it's definitely unsafe, so
|
||||
let's just add a spinlock to protect the register access of the HDMI
|
||||
controller.
|
||||
|
||||
Link: https://lore.kernel.org/r/20211025141113.702757-5-maxime@cerno.tech
|
||||
Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.")
|
||||
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 202 ++++++++++++++++++++++++++--
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 5 +
|
||||
drivers/gpu/drm/vc4/vc4_hdmi_phy.c | 37 +++++
|
||||
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 2 +
|
||||
4 files changed, 236 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -122,6 +122,10 @@ static int vc4_hdmi_debugfs_regs(struct
|
||||
|
||||
static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_SW_RST);
|
||||
udelay(1);
|
||||
HDMI_WRITE(HDMI_M_CTL, 0);
|
||||
@@ -133,24 +137,36 @@ static void vc4_hdmi_reset(struct vc4_hd
|
||||
VC4_HDMI_SW_RESET_FORMAT_DETECT);
|
||||
|
||||
HDMI_WRITE(HDMI_SW_RESET_CONTROL, 0);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc5_hdmi_reset(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
reset_control_reset(vc4_hdmi->reset);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_DVP_CTL, 0);
|
||||
|
||||
HDMI_WRITE(HDMI_CLOCK_STOP,
|
||||
HDMI_READ(HDMI_CLOCK_STOP) | VC4_DVP_HT_CLOCK_STOP_PIXEL);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRM_VC4_HDMI_CEC
|
||||
static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long cec_rate = clk_get_rate(vc4_hdmi->cec_clock);
|
||||
+ unsigned long flags;
|
||||
u16 clk_cnt;
|
||||
u32 value;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
value = HDMI_READ(HDMI_CEC_CNTRL_1);
|
||||
value &= ~VC4_HDMI_CEC_DIV_CLK_CNT_MASK;
|
||||
|
||||
@@ -158,9 +174,11 @@ static void vc4_hdmi_cec_update_clk_div(
|
||||
* Set the clock divider: the hsm_clock rate and this divider
|
||||
* setting will give a 40 kHz CEC clock.
|
||||
*/
|
||||
- clk_cnt = clk_get_rate(vc4_hdmi->cec_clock) / CEC_CLOCK_FREQ;
|
||||
+ clk_cnt = cec_rate / CEC_CLOCK_FREQ;
|
||||
value |= clk_cnt << VC4_HDMI_CEC_DIV_CLK_CNT_SHIFT;
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_1, value);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
#else
|
||||
static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {}
|
||||
@@ -179,8 +197,16 @@ vc4_hdmi_connector_detect(struct drm_con
|
||||
if (vc4_hdmi->hpd_gpio) {
|
||||
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
|
||||
connected = true;
|
||||
- } else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) {
|
||||
- connected = true;
|
||||
+ } else {
|
||||
+ unsigned long flags;
|
||||
+ u32 hotplug;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+ hotplug = HDMI_READ(HDMI_HOTPLUG);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
+ if (hotplug & VC4_HDMI_HOTPLUG_CONNECTED)
|
||||
+ connected = true;
|
||||
}
|
||||
|
||||
if (connected) {
|
||||
@@ -374,9 +400,12 @@ static int vc4_hdmi_stop_packet(struct d
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
u32 packet_id = type - 0x80;
|
||||
+ unsigned long flags;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
|
||||
HDMI_READ(HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id));
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
if (!poll)
|
||||
return 0;
|
||||
@@ -396,6 +425,7 @@ static void vc4_hdmi_write_infoframe(str
|
||||
void __iomem *base = __vc4_hdmi_get_field_base(vc4_hdmi,
|
||||
ram_packet_start->reg);
|
||||
uint8_t buffer[VC4_HDMI_PACKET_STRIDE];
|
||||
+ unsigned long flags;
|
||||
ssize_t len, i;
|
||||
int ret;
|
||||
|
||||
@@ -413,6 +443,8 @@ static void vc4_hdmi_write_infoframe(str
|
||||
return;
|
||||
}
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
for (i = 0; i < len; i += 7) {
|
||||
writel(buffer[i + 0] << 0 |
|
||||
buffer[i + 1] << 8 |
|
||||
@@ -430,6 +462,9 @@ static void vc4_hdmi_write_infoframe(str
|
||||
|
||||
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
|
||||
HDMI_READ(HDMI_RAM_PACKET_CONFIG) | BIT(packet_id));
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
ret = wait_for((HDMI_READ(HDMI_RAM_PACKET_STATUS) &
|
||||
BIT(packet_id)), 100);
|
||||
if (ret)
|
||||
@@ -549,6 +584,7 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
{
|
||||
struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ unsigned long flags;
|
||||
|
||||
if (!vc4_hdmi_supports_scrambling(encoder, mode))
|
||||
return;
|
||||
@@ -559,8 +595,10 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, true);
|
||||
drm_scdc_set_scrambling(vc4_hdmi->ddc, true);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) |
|
||||
VC5_HDMI_SCRAMBLER_CTL_ENABLE);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work,
|
||||
msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS));
|
||||
@@ -570,6 +608,7 @@ static void vc4_hdmi_disable_scrambling(
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
+ unsigned long flags;
|
||||
|
||||
/*
|
||||
* At boot, encoder->crtc will be NULL. Since we don't know the
|
||||
@@ -585,8 +624,10 @@ static void vc4_hdmi_disable_scrambling(
|
||||
if (delayed_work_pending(&vc4_hdmi->scrambling_work))
|
||||
cancel_delayed_work_sync(&vc4_hdmi->scrambling_work);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) &
|
||||
~VC5_HDMI_SCRAMBLER_CTL_ENABLE);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
drm_scdc_set_scrambling(vc4_hdmi->ddc, false);
|
||||
drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, false);
|
||||
@@ -612,15 +653,23 @@ static void vc4_hdmi_encoder_post_crtc_d
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
|
||||
|
||||
HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_CLRRGB);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
mdelay(1);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_VID_CTL,
|
||||
HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
vc4_hdmi_disable_scrambling(encoder);
|
||||
}
|
||||
|
||||
@@ -628,10 +677,13 @@ static void vc4_hdmi_encoder_post_crtc_p
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_VID_CTL,
|
||||
HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
if (vc4_hdmi->variant->phy_disable)
|
||||
vc4_hdmi->variant->phy_disable(vc4_hdmi);
|
||||
@@ -650,8 +702,11 @@ static void vc4_hdmi_encoder_disable(str
|
||||
|
||||
static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
u32 csc_ctl;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
|
||||
VC4_HD_CSC_CTL_ORDER);
|
||||
|
||||
@@ -681,14 +736,19 @@ static void vc4_hdmi_csc_setup(struct vc
|
||||
|
||||
/* The RGB order applies even when CSC is disabled. */
|
||||
HDMI_WRITE(HDMI_CSC_CTL, csc_ctl);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
u32 csc_ctl;
|
||||
|
||||
csc_ctl = 0x07; /* RGB_CONVERT_MODE = custom matrix, || USE_RGB_TO_YCBCR */
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
if (enable) {
|
||||
/* CEA VICs other than #1 requre limited range RGB
|
||||
* output unless overridden by an AVI infoframe.
|
||||
@@ -720,6 +780,8 @@ static void vc5_hdmi_csc_setup(struct vc
|
||||
}
|
||||
|
||||
HDMI_WRITE(HDMI_CSC_CTL, csc_ctl);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
|
||||
@@ -743,6 +805,9 @@ static void vc4_hdmi_set_timings(struct
|
||||
VC4_SET_FIELD(mode->crtc_vtotal -
|
||||
mode->crtc_vsync_end,
|
||||
VC4_HDMI_VERTB_VBP));
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_HORZA,
|
||||
(vsync_pos ? VC4_HDMI_HORZA_VPOS : 0) |
|
||||
@@ -766,6 +831,8 @@ static void vc4_hdmi_set_timings(struct
|
||||
|
||||
HDMI_WRITE(HDMI_VERTB0, vertb_even);
|
||||
HDMI_WRITE(HDMI_VERTB1, vertb);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
|
||||
@@ -790,10 +857,13 @@ static void vc5_hdmi_set_timings(struct
|
||||
VC4_SET_FIELD(mode->crtc_vtotal -
|
||||
mode->crtc_vsync_end,
|
||||
VC4_HDMI_VERTB_VBP));
|
||||
+ unsigned long flags;
|
||||
unsigned char gcp;
|
||||
bool gcp_en;
|
||||
u32 reg;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021);
|
||||
HDMI_WRITE(HDMI_HORZA,
|
||||
(vsync_pos ? VC5_HDMI_HORZA_VPOS : 0) |
|
||||
@@ -857,13 +927,18 @@ static void vc5_hdmi_set_timings(struct
|
||||
HDMI_WRITE(HDMI_MISC_CONTROL, reg);
|
||||
|
||||
HDMI_WRITE(HDMI_CLOCK_STOP, 0);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
u32 drift;
|
||||
int ret;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
drift = HDMI_READ(HDMI_FIFO_CTL);
|
||||
drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK;
|
||||
|
||||
@@ -871,12 +946,20 @@ static void vc4_hdmi_recenter_fifo(struc
|
||||
drift & ~VC4_HDMI_FIFO_CTL_RECENTER);
|
||||
HDMI_WRITE(HDMI_FIFO_CTL,
|
||||
drift | VC4_HDMI_FIFO_CTL_RECENTER);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
usleep_range(1000, 1100);
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_FIFO_CTL,
|
||||
drift & ~VC4_HDMI_FIFO_CTL_RECENTER);
|
||||
HDMI_WRITE(HDMI_FIFO_CTL,
|
||||
drift | VC4_HDMI_FIFO_CTL_RECENTER);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
ret = wait_for(HDMI_READ(HDMI_FIFO_CTL) &
|
||||
VC4_HDMI_FIFO_CTL_RECENTER_DONE, 1);
|
||||
WARN_ONCE(ret, "Timeout waiting for "
|
||||
@@ -910,6 +993,7 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
unsigned long pixel_rate = vc4_conn_state->pixel_rate;
|
||||
unsigned long bvb_rate, hsm_rate;
|
||||
+ unsigned long flags;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
@@ -978,11 +1062,15 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
if (vc4_hdmi->variant->phy_init)
|
||||
vc4_hdmi->variant->phy_init(vc4_hdmi, vc4_conn_state);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_SCHEDULER_CONTROL,
|
||||
HDMI_READ(HDMI_SCHEDULER_CONTROL) |
|
||||
VC4_HDMI_SCHEDULER_CONTROL_MANUAL_FORMAT |
|
||||
VC4_HDMI_SCHEDULER_CONTROL_IGNORE_VSYNC_PREDICTS);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
if (vc4_hdmi->variant->set_timings)
|
||||
vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode);
|
||||
|
||||
@@ -1002,6 +1090,7 @@ static void vc4_hdmi_encoder_pre_crtc_en
|
||||
struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ unsigned long flags;
|
||||
|
||||
if (vc4_encoder->hdmi_monitor &&
|
||||
drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) {
|
||||
@@ -1016,7 +1105,9 @@ static void vc4_hdmi_encoder_pre_crtc_en
|
||||
vc4_encoder->limited_rgb_range = false;
|
||||
}
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
|
||||
@@ -1027,8 +1118,11 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC;
|
||||
bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC;
|
||||
+ unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_VID_CTL,
|
||||
VC4_HD_VID_CTL_ENABLE |
|
||||
VC4_HD_VID_CTL_CLRRGB |
|
||||
@@ -1045,6 +1139,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
HDMI_READ(HDMI_SCHEDULER_CONTROL) |
|
||||
VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
ret = wait_for(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
|
||||
VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000);
|
||||
WARN_ONCE(ret, "Timeout waiting for "
|
||||
@@ -1057,6 +1153,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
HDMI_READ(HDMI_SCHEDULER_CONTROL) &
|
||||
~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
ret = wait_for(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
|
||||
VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000);
|
||||
WARN_ONCE(ret, "Timeout waiting for "
|
||||
@@ -1064,6 +1162,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
}
|
||||
|
||||
if (vc4_encoder->hdmi_monitor) {
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
|
||||
VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE));
|
||||
HDMI_WRITE(HDMI_SCHEDULER_CONTROL,
|
||||
@@ -1073,6 +1173,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
|
||||
VC4_HDMI_RAM_PACKET_ENABLE);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
vc4_hdmi_set_infoframes(encoder);
|
||||
}
|
||||
|
||||
@@ -1196,6 +1298,7 @@ static void vc4_hdmi_audio_set_mai_clock
|
||||
unsigned int samplerate)
|
||||
{
|
||||
u32 hsm_clock = clk_get_rate(vc4_hdmi->audio_clock);
|
||||
+ unsigned long flags;
|
||||
unsigned long n, m;
|
||||
|
||||
rational_best_approximation(hsm_clock, samplerate,
|
||||
@@ -1205,9 +1308,11 @@ static void vc4_hdmi_audio_set_mai_clock
|
||||
VC4_HD_MAI_SMP_M_SHIFT) + 1,
|
||||
&n, &m);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_MAI_SMP,
|
||||
VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) |
|
||||
VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M));
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate)
|
||||
@@ -1218,6 +1323,8 @@ static void vc4_hdmi_set_n_cts(struct vc
|
||||
u32 n, cts;
|
||||
u64 tmp;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
n = 128 * samplerate / 1000;
|
||||
tmp = (u64)(mode->clock * 1000) * n;
|
||||
do_div(tmp, 128 * samplerate);
|
||||
@@ -1247,6 +1354,7 @@ static int vc4_hdmi_audio_startup(struct
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
|
||||
struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
+ unsigned long flags;
|
||||
|
||||
/*
|
||||
* If the HDMI encoder hasn't probed, or the encoder is
|
||||
@@ -1258,12 +1366,14 @@ static int vc4_hdmi_audio_startup(struct
|
||||
|
||||
vc4_hdmi->audio.streaming = true;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_MAI_CTL,
|
||||
VC4_HD_MAI_CTL_RESET |
|
||||
VC4_HD_MAI_CTL_FLUSH |
|
||||
VC4_HD_MAI_CTL_DLATE |
|
||||
VC4_HD_MAI_CTL_ERRORE |
|
||||
VC4_HD_MAI_CTL_ERRORF);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
if (vc4_hdmi->variant->phy_rng_enable)
|
||||
vc4_hdmi->variant->phy_rng_enable(vc4_hdmi);
|
||||
@@ -1275,6 +1385,7 @@ static void vc4_hdmi_audio_reset(struct
|
||||
{
|
||||
struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
struct device *dev = &vc4_hdmi->pdev->dev;
|
||||
+ unsigned long flags;
|
||||
int ret;
|
||||
|
||||
vc4_hdmi->audio.streaming = false;
|
||||
@@ -1282,20 +1393,29 @@ static void vc4_hdmi_audio_reset(struct
|
||||
if (ret)
|
||||
dev_err(dev, "Failed to stop audio infoframe: %d\n", ret);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_MAI_CTL, VC4_HD_MAI_CTL_RESET);
|
||||
HDMI_WRITE(HDMI_MAI_CTL, VC4_HD_MAI_CTL_ERRORF);
|
||||
HDMI_WRITE(HDMI_MAI_CTL, VC4_HD_MAI_CTL_FLUSH);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_audio_shutdown(struct device *dev, void *data)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_MAI_CTL,
|
||||
VC4_HD_MAI_CTL_DLATE |
|
||||
VC4_HD_MAI_CTL_ERRORE |
|
||||
VC4_HD_MAI_CTL_ERRORF);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
if (vc4_hdmi->variant->phy_rng_disable)
|
||||
vc4_hdmi->variant->phy_rng_disable(vc4_hdmi);
|
||||
|
||||
@@ -1350,6 +1470,7 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
unsigned int sample_rate = params->sample_rate;
|
||||
unsigned int channels = params->channels;
|
||||
+ unsigned long flags;
|
||||
u32 audio_packet_config, channel_mask;
|
||||
u32 channel_map;
|
||||
u32 mai_audio_format;
|
||||
@@ -1358,14 +1479,15 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__,
|
||||
sample_rate, params->sample_width, channels);
|
||||
|
||||
+ vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate);
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_MAI_CTL,
|
||||
VC4_SET_FIELD(channels, VC4_HD_MAI_CTL_CHNUM) |
|
||||
VC4_HD_MAI_CTL_WHOLSMP |
|
||||
VC4_HD_MAI_CTL_CHALIGN |
|
||||
VC4_HD_MAI_CTL_ENABLE);
|
||||
|
||||
- vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate);
|
||||
-
|
||||
mai_sample_rate = sample_rate_to_mai_fmt(sample_rate);
|
||||
if (params->iec.status[0] & IEC958_AES0_NONAUDIO &&
|
||||
params->channels == 8)
|
||||
@@ -1403,8 +1525,11 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
channel_map = vc4_hdmi->variant->channel_map(vc4_hdmi, channel_mask);
|
||||
HDMI_WRITE(HDMI_MAI_CHANNEL_MAP, channel_map);
|
||||
HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config);
|
||||
+
|
||||
vc4_hdmi_set_n_cts(vc4_hdmi, sample_rate);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea));
|
||||
vc4_hdmi_set_audio_infoframe(encoder);
|
||||
|
||||
@@ -1678,6 +1803,8 @@ static void vc4_cec_read_msg(struct vc4_
|
||||
struct cec_msg *msg = &vc4_hdmi->cec_rx_msg;
|
||||
unsigned int i;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
msg->len = 1 + ((cntrl1 & VC4_HDMI_CEC_REC_WRD_CNT_MASK) >>
|
||||
VC4_HDMI_CEC_REC_WRD_CNT_SHIFT);
|
||||
|
||||
@@ -1696,11 +1823,12 @@ static void vc4_cec_read_msg(struct vc4_
|
||||
}
|
||||
}
|
||||
|
||||
-static irqreturn_t vc4_cec_irq_handler_tx_bare(int irq, void *priv)
|
||||
+static irqreturn_t vc4_cec_irq_handler_tx_bare_locked(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
- struct vc4_hdmi *vc4_hdmi = priv;
|
||||
u32 cntrl1;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1);
|
||||
vc4_hdmi->cec_tx_ok = cntrl1 & VC4_HDMI_CEC_TX_STATUS_GOOD;
|
||||
cntrl1 &= ~VC4_HDMI_CEC_START_XMIT_BEGIN;
|
||||
@@ -1709,11 +1837,24 @@ static irqreturn_t vc4_cec_irq_handler_t
|
||||
return IRQ_WAKE_THREAD;
|
||||
}
|
||||
|
||||
-static irqreturn_t vc4_cec_irq_handler_rx_bare(int irq, void *priv)
|
||||
+static irqreturn_t vc4_cec_irq_handler_tx_bare(int irq, void *priv)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = priv;
|
||||
+ irqreturn_t ret;
|
||||
+
|
||||
+ spin_lock(&vc4_hdmi->hw_lock);
|
||||
+ ret = vc4_cec_irq_handler_tx_bare_locked(vc4_hdmi);
|
||||
+ spin_unlock(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t vc4_cec_irq_handler_rx_bare_locked(struct vc4_hdmi *vc4_hdmi)
|
||||
+{
|
||||
u32 cntrl1;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
vc4_hdmi->cec_rx_msg.len = 0;
|
||||
cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1);
|
||||
vc4_cec_read_msg(vc4_hdmi, cntrl1);
|
||||
@@ -1726,6 +1867,18 @@ static irqreturn_t vc4_cec_irq_handler_r
|
||||
return IRQ_WAKE_THREAD;
|
||||
}
|
||||
|
||||
+static irqreturn_t vc4_cec_irq_handler_rx_bare(int irq, void *priv)
|
||||
+{
|
||||
+ struct vc4_hdmi *vc4_hdmi = priv;
|
||||
+ irqreturn_t ret;
|
||||
+
|
||||
+ spin_lock(&vc4_hdmi->hw_lock);
|
||||
+ ret = vc4_cec_irq_handler_rx_bare_locked(vc4_hdmi);
|
||||
+ spin_unlock(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static irqreturn_t vc4_cec_irq_handler(int irq, void *priv)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = priv;
|
||||
@@ -1736,14 +1889,17 @@ static irqreturn_t vc4_cec_irq_handler(i
|
||||
if (!(stat & VC4_HDMI_CPU_CEC))
|
||||
return IRQ_NONE;
|
||||
|
||||
+ spin_lock(&vc4_hdmi->hw_lock);
|
||||
cntrl5 = HDMI_READ(HDMI_CEC_CNTRL_5);
|
||||
vc4_hdmi->cec_irq_was_rx = cntrl5 & VC4_HDMI_CEC_RX_CEC_INT;
|
||||
if (vc4_hdmi->cec_irq_was_rx)
|
||||
- ret = vc4_cec_irq_handler_rx_bare(irq, priv);
|
||||
+ ret = vc4_cec_irq_handler_rx_bare_locked(vc4_hdmi);
|
||||
else
|
||||
- ret = vc4_cec_irq_handler_tx_bare(irq, priv);
|
||||
+ ret = vc4_cec_irq_handler_tx_bare_locked(vc4_hdmi);
|
||||
|
||||
HDMI_WRITE(HDMI_CEC_CPU_CLEAR, VC4_HDMI_CPU_CEC);
|
||||
+ spin_unlock(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1752,6 +1908,7 @@ static int vc4_hdmi_cec_enable(struct ce
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
/* clock period in microseconds */
|
||||
const u32 usecs = 1000000 / CEC_CLOCK_FREQ;
|
||||
+ unsigned long flags;
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
@@ -1759,6 +1916,8 @@ static int vc4_hdmi_cec_enable(struct ce
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
val = HDMI_READ(HDMI_CEC_CNTRL_5);
|
||||
val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET |
|
||||
VC4_HDMI_CEC_CNT_TO_4700_US_MASK |
|
||||
@@ -1789,12 +1948,17 @@ static int vc4_hdmi_cec_enable(struct ce
|
||||
if (!vc4_hdmi->variant->external_irq_controller)
|
||||
HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vc4_hdmi_cec_disable(struct cec_adapter *adap)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
if (!vc4_hdmi->variant->external_irq_controller)
|
||||
HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC);
|
||||
@@ -1802,6 +1966,8 @@ static int vc4_hdmi_cec_disable(struct c
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) |
|
||||
VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET);
|
||||
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
|
||||
return 0;
|
||||
@@ -1818,10 +1984,14 @@ static int vc4_hdmi_cec_adap_enable(stru
|
||||
static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
+ unsigned long flags;
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_1,
|
||||
(HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) |
|
||||
(log_addr & 0xf) << VC4_HDMI_CEC_ADDR_SHIFT);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1830,6 +2000,7 @@ static int vc4_hdmi_cec_adap_transmit(st
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
struct drm_device *dev = vc4_hdmi->connector.dev;
|
||||
+ unsigned long flags;
|
||||
u32 val;
|
||||
unsigned int i;
|
||||
|
||||
@@ -1838,6 +2009,8 @@ static int vc4_hdmi_cec_adap_transmit(st
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
for (i = 0; i < msg->len; i += 4)
|
||||
HDMI_WRITE(HDMI_CEC_TX_DATA_1 + (i >> 2),
|
||||
(msg->msg[i]) |
|
||||
@@ -1853,6 +2026,9 @@ static int vc4_hdmi_cec_adap_transmit(st
|
||||
val |= VC4_HDMI_CEC_START_XMIT_BEGIN;
|
||||
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_1, val);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1867,6 +2043,7 @@ static int vc4_hdmi_cec_init(struct vc4_
|
||||
struct cec_connector_info conn_info;
|
||||
struct platform_device *pdev = vc4_hdmi->pdev;
|
||||
struct device *dev = &pdev->dev;
|
||||
+ unsigned long flags;
|
||||
u32 value;
|
||||
int ret;
|
||||
|
||||
@@ -1887,10 +2064,12 @@ static int vc4_hdmi_cec_init(struct vc4_
|
||||
cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector);
|
||||
cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
value = HDMI_READ(HDMI_CEC_CNTRL_1);
|
||||
/* Set the logical address to Unregistered */
|
||||
value |= VC4_HDMI_CEC_ADDR_MASK;
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_1, value);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
vc4_hdmi_cec_update_clk_div(vc4_hdmi);
|
||||
|
||||
@@ -1909,7 +2088,9 @@ static int vc4_hdmi_cec_init(struct vc4_
|
||||
if (ret)
|
||||
goto err_remove_cec_rx_handler;
|
||||
} else {
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, 0xffffffff);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
ret = request_threaded_irq(platform_get_irq(pdev, 0),
|
||||
vc4_cec_irq_handler,
|
||||
@@ -2179,6 +2360,7 @@ static int vc4_hdmi_bind(struct device *
|
||||
vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL);
|
||||
if (!vc4_hdmi)
|
||||
return -ENOMEM;
|
||||
+ spin_lock_init(&vc4_hdmi->hw_lock);
|
||||
INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq);
|
||||
|
||||
dev_set_drvdata(dev, vc4_hdmi);
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -179,6 +179,11 @@ struct vc4_hdmi {
|
||||
|
||||
struct debugfs_regset32 hdmi_regset;
|
||||
struct debugfs_regset32 hd_regset;
|
||||
+
|
||||
+ /**
|
||||
+ * @hw_lock: Spinlock protecting device register access.
|
||||
+ */
|
||||
+ spinlock_t hw_lock;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi_phy.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi_phy.c
|
||||
@@ -130,31 +130,49 @@
|
||||
void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi,
|
||||
struct vc4_hdmi_connector_state *conn_state)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
/* PHY should be in reset, like
|
||||
* vc4_hdmi_encoder_disable() does.
|
||||
*/
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
HDMI_WRITE(HDMI_TX_PHY_RESET_CTL, 0xf << 16);
|
||||
HDMI_WRITE(HDMI_TX_PHY_RESET_CTL, 0);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_TX_PHY_RESET_CTL, 0xf << 16);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc4_hdmi_phy_rng_enable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_TX_PHY_CTL_0,
|
||||
HDMI_READ(HDMI_TX_PHY_CTL_0) &
|
||||
~VC4_HDMI_TX_PHY_RNG_PWRDN);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc4_hdmi_phy_rng_disable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_TX_PHY_CTL_0,
|
||||
HDMI_READ(HDMI_TX_PHY_CTL_0) |
|
||||
VC4_HDMI_TX_PHY_RNG_PWRDN);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
static unsigned long long
|
||||
@@ -336,6 +354,8 @@ phy_get_channel_settings(enum vc4_hdmi_p
|
||||
|
||||
static void vc5_hdmi_reset_phy(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
HDMI_WRITE(HDMI_TX_PHY_RESET_CTL, 0x0f);
|
||||
HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL, BIT(10));
|
||||
}
|
||||
@@ -348,10 +368,13 @@ void vc5_hdmi_phy_init(struct vc4_hdmi *
|
||||
unsigned long long pixel_freq = conn_state->pixel_rate;
|
||||
unsigned long long vco_freq;
|
||||
unsigned char word_sel;
|
||||
+ unsigned long flags;
|
||||
u8 vco_sel, vco_div;
|
||||
|
||||
vco_freq = phy_get_vco_freq(pixel_freq, &vco_sel, &vco_div);
|
||||
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
vc5_hdmi_reset_phy(vc4_hdmi);
|
||||
|
||||
HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL,
|
||||
@@ -501,23 +524,37 @@ void vc5_hdmi_phy_init(struct vc4_hdmi *
|
||||
HDMI_READ(HDMI_TX_PHY_RESET_CTL) |
|
||||
VC4_HDMI_TX_PHY_RESET_CTL_PLL_RESETB |
|
||||
VC4_HDMI_TX_PHY_RESET_CTL_PLLDIV_RESETB);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc5_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
vc5_hdmi_reset_phy(vc4_hdmi);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc5_hdmi_phy_rng_enable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL,
|
||||
HDMI_READ(HDMI_TX_PHY_POWERDOWN_CTL) &
|
||||
~VC4_HDMI_TX_PHY_POWERDOWN_CTL_RNDGEN_PWRDN);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
|
||||
void vc5_hdmi_phy_rng_disable(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL,
|
||||
HDMI_READ(HDMI_TX_PHY_POWERDOWN_CTL) |
|
||||
VC4_HDMI_TX_PHY_POWERDOWN_CTL_RNDGEN_PWRDN);
|
||||
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
}
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
|
||||
@@ -445,6 +445,8 @@ static inline void vc4_hdmi_write(struct
|
||||
const struct vc4_hdmi_variant *variant = hdmi->variant;
|
||||
void __iomem *base;
|
||||
|
||||
+ lockdep_assert_held(&hdmi->hw_lock);
|
||||
+
|
||||
WARN_ON(!pm_runtime_active(&hdmi->pdev->dev));
|
||||
|
||||
if (reg >= variant->num_registers) {
|
@ -1,444 +0,0 @@
|
||||
From 5976ef1d81c8d474eddb55103f29a686f84f22f1 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 25 Oct 2021 16:11:09 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Use a mutex to prevent concurrent
|
||||
framework access
|
||||
|
||||
The vc4 HDMI controller registers into the KMS, CEC and ALSA
|
||||
frameworks.
|
||||
|
||||
However, no particular care is done to prevent the concurrent execution
|
||||
of different framework hooks from happening at the same time.
|
||||
|
||||
In order to protect against that scenario, let's introduce a mutex that
|
||||
relevant ALSA and KMS hooks will need to take to prevent concurrent
|
||||
execution.
|
||||
|
||||
CEC is left out at the moment though, since the .get_modes and .detect
|
||||
KMS hooks, when running cec_s_phys_addr_from_edid, can end up calling
|
||||
CEC's .adap_enable hook. This introduces some reentrancy that isn't easy
|
||||
to deal with properly.
|
||||
|
||||
The CEC hooks also don't share much state with the rest of the driver:
|
||||
the registers are entirely separate, we don't share any variable, the
|
||||
only thing that can conflict is the CEC clock divider setup that can be
|
||||
affected by a mode set.
|
||||
|
||||
However, after discussing it, it looks like CEC should be able to
|
||||
recover from this if it was to happen.
|
||||
|
||||
Link: https://lore.kernel.org/r/20211025141113.702757-6-maxime@cerno.tech
|
||||
Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support")
|
||||
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 118 +++++++++++++++++++++++++++++++--
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 14 ++++
|
||||
2 files changed, 126 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -192,6 +192,8 @@ vc4_hdmi_connector_detect(struct drm_con
|
||||
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
|
||||
bool connected = false;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
|
||||
|
||||
if (vc4_hdmi->hpd_gpio) {
|
||||
@@ -222,11 +224,13 @@ vc4_hdmi_connector_detect(struct drm_con
|
||||
|
||||
vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base.base);
|
||||
pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
return connector_status_connected;
|
||||
}
|
||||
|
||||
cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
|
||||
pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
return connector_status_disconnected;
|
||||
}
|
||||
|
||||
@@ -243,10 +247,14 @@ static int vc4_hdmi_connector_get_modes(
|
||||
int ret = 0;
|
||||
struct edid *edid;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
edid = drm_get_edid(connector, vc4_hdmi->ddc);
|
||||
cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid);
|
||||
- if (!edid)
|
||||
- return -ENODEV;
|
||||
+ if (!edid) {
|
||||
+ ret = -ENODEV;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid);
|
||||
|
||||
@@ -266,6 +274,9 @@ static int vc4_hdmi_connector_get_modes(
|
||||
}
|
||||
}
|
||||
|
||||
+out:
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -482,6 +493,8 @@ static void vc4_hdmi_set_avi_infoframe(s
|
||||
union hdmi_infoframe frame;
|
||||
int ret;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
|
||||
connector, mode);
|
||||
if (ret < 0) {
|
||||
@@ -533,6 +546,8 @@ static void vc4_hdmi_set_hdr_infoframe(s
|
||||
struct drm_connector_state *conn_state = connector->state;
|
||||
union hdmi_infoframe frame;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
if (!vc4_hdmi->variant->supports_hdr)
|
||||
return;
|
||||
|
||||
@@ -549,6 +564,8 @@ static void vc4_hdmi_set_infoframes(stru
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
vc4_hdmi_set_avi_infoframe(encoder);
|
||||
vc4_hdmi_set_spd_infoframe(encoder);
|
||||
/*
|
||||
@@ -568,6 +585,8 @@ static bool vc4_hdmi_supports_scrambling
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
if (!vc4_encoder->hdmi_monitor)
|
||||
return false;
|
||||
|
||||
@@ -586,6 +605,8 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
unsigned long flags;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
if (!vc4_hdmi_supports_scrambling(encoder, mode))
|
||||
return;
|
||||
|
||||
@@ -655,6 +676,8 @@ static void vc4_hdmi_encoder_post_crtc_d
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
unsigned long flags;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
|
||||
@@ -671,6 +694,8 @@ static void vc4_hdmi_encoder_post_crtc_d
|
||||
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
vc4_hdmi_disable_scrambling(encoder);
|
||||
+
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
|
||||
@@ -680,6 +705,8 @@ static void vc4_hdmi_encoder_post_crtc_p
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_VID_CTL,
|
||||
HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX);
|
||||
@@ -694,6 +721,8 @@ static void vc4_hdmi_encoder_post_crtc_p
|
||||
ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
if (ret < 0)
|
||||
DRM_ERROR("Failed to release power domain: %d\n", ret);
|
||||
+
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder)
|
||||
@@ -996,6 +1025,8 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
/*
|
||||
* As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must
|
||||
* be faster than pixel clock, infinitesimally faster, tested in
|
||||
@@ -1016,13 +1047,13 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to set HSM clock rate: %d\n", ret);
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to retain power domain: %d\n", ret);
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate);
|
||||
@@ -1074,13 +1105,16 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
if (vc4_hdmi->variant->set_timings)
|
||||
vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode);
|
||||
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+
|
||||
return;
|
||||
|
||||
err_disable_pixel_clock:
|
||||
clk_disable_unprepare(vc4_hdmi->pixel_clock);
|
||||
err_put_runtime_pm:
|
||||
pm_runtime_put(&vc4_hdmi->pdev->dev);
|
||||
-
|
||||
+out:
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1092,6 +1126,8 @@ static void vc4_hdmi_encoder_pre_crtc_en
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
unsigned long flags;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
if (vc4_encoder->hdmi_monitor &&
|
||||
drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) {
|
||||
if (vc4_hdmi->variant->csc_setup)
|
||||
@@ -1108,6 +1144,8 @@ static void vc4_hdmi_encoder_pre_crtc_en
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
|
||||
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
+
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
|
||||
@@ -1121,6 +1159,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_VID_CTL,
|
||||
@@ -1180,6 +1220,8 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
|
||||
vc4_hdmi_recenter_fifo(vc4_hdmi);
|
||||
vc4_hdmi_enable_scrambling(encoder);
|
||||
+
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
|
||||
@@ -1323,6 +1365,7 @@ static void vc4_hdmi_set_n_cts(struct vc
|
||||
u32 n, cts;
|
||||
u64 tmp;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
|
||||
n = 128 * samplerate / 1000;
|
||||
@@ -1356,13 +1399,17 @@ static int vc4_hdmi_audio_startup(struct
|
||||
struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
unsigned long flags;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
/*
|
||||
* If the HDMI encoder hasn't probed, or the encoder is
|
||||
* currently in DVI mode, treat the codec dai as missing.
|
||||
*/
|
||||
if (!encoder->crtc || !(HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
|
||||
- VC4_HDMI_RAM_PACKET_ENABLE))
|
||||
+ VC4_HDMI_RAM_PACKET_ENABLE)) {
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
return -ENODEV;
|
||||
+ }
|
||||
|
||||
vc4_hdmi->audio.streaming = true;
|
||||
|
||||
@@ -1378,6 +1425,8 @@ static int vc4_hdmi_audio_startup(struct
|
||||
if (vc4_hdmi->variant->phy_rng_enable)
|
||||
vc4_hdmi->variant->phy_rng_enable(vc4_hdmi);
|
||||
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1388,6 +1437,8 @@ static void vc4_hdmi_audio_reset(struct
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
vc4_hdmi->audio.streaming = false;
|
||||
ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO, false);
|
||||
if (ret)
|
||||
@@ -1407,6 +1458,8 @@ static void vc4_hdmi_audio_shutdown(stru
|
||||
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
|
||||
unsigned long flags;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
HDMI_WRITE(HDMI_MAI_CTL,
|
||||
@@ -1421,6 +1474,8 @@ static void vc4_hdmi_audio_shutdown(stru
|
||||
|
||||
vc4_hdmi->audio.streaming = false;
|
||||
vc4_hdmi_audio_reset(vc4_hdmi);
|
||||
+
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static int sample_rate_to_mai_fmt(int samplerate)
|
||||
@@ -1479,6 +1534,8 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__,
|
||||
sample_rate, params->sample_width, channels);
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+
|
||||
vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate);
|
||||
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
@@ -1533,6 +1590,8 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea));
|
||||
vc4_hdmi_set_audio_infoframe(encoder);
|
||||
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1575,7 +1634,9 @@ static int vc4_hdmi_audio_get_eld(struct
|
||||
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
|
||||
struct drm_connector *connector = &vc4_hdmi->connector;
|
||||
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
memcpy(buf, connector->eld, min(sizeof(connector->eld), len));
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1912,6 +1973,17 @@ static int vc4_hdmi_cec_enable(struct ce
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
+ /*
|
||||
+ * NOTE: This function should really take vc4_hdmi->mutex, but doing so
|
||||
+ * results in a reentrancy since cec_s_phys_addr_from_edid() called in
|
||||
+ * .detect or .get_modes might call .adap_enable, which leads to this
|
||||
+ * function being called with that mutex held.
|
||||
+ *
|
||||
+ * Concurrency is not an issue for the moment since we don't share any
|
||||
+ * state with KMS, so we can ignore the lock for now, but we need to
|
||||
+ * keep it in mind if we were to change that assumption.
|
||||
+ */
|
||||
+
|
||||
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1958,6 +2030,17 @@ static int vc4_hdmi_cec_disable(struct c
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
unsigned long flags;
|
||||
|
||||
+ /*
|
||||
+ * NOTE: This function should really take vc4_hdmi->mutex, but doing so
|
||||
+ * results in a reentrancy since cec_s_phys_addr_from_edid() called in
|
||||
+ * .detect or .get_modes might call .adap_enable, which leads to this
|
||||
+ * function being called with that mutex held.
|
||||
+ *
|
||||
+ * Concurrency is not an issue for the moment since we don't share any
|
||||
+ * state with KMS, so we can ignore the lock for now, but we need to
|
||||
+ * keep it in mind if we were to change that assumption.
|
||||
+ */
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
if (!vc4_hdmi->variant->external_irq_controller)
|
||||
@@ -1986,6 +2069,17 @@ static int vc4_hdmi_cec_adap_log_addr(st
|
||||
struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap);
|
||||
unsigned long flags;
|
||||
|
||||
+ /*
|
||||
+ * NOTE: This function should really take vc4_hdmi->mutex, but doing so
|
||||
+ * results in a reentrancy since cec_s_phys_addr_from_edid() called in
|
||||
+ * .detect or .get_modes might call .adap_enable, which leads to this
|
||||
+ * function being called with that mutex held.
|
||||
+ *
|
||||
+ * Concurrency is not an issue for the moment since we don't share any
|
||||
+ * state with KMS, so we can ignore the lock for now, but we need to
|
||||
+ * keep it in mind if we were to change that assumption.
|
||||
+ */
|
||||
+
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
||||
HDMI_WRITE(HDMI_CEC_CNTRL_1,
|
||||
(HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) |
|
||||
@@ -2004,6 +2098,17 @@ static int vc4_hdmi_cec_adap_transmit(st
|
||||
u32 val;
|
||||
unsigned int i;
|
||||
|
||||
+ /*
|
||||
+ * NOTE: This function should really take vc4_hdmi->mutex, but doing so
|
||||
+ * results in a reentrancy since cec_s_phys_addr_from_edid() called in
|
||||
+ * .detect or .get_modes might call .adap_enable, which leads to this
|
||||
+ * function being called with that mutex held.
|
||||
+ *
|
||||
+ * Concurrency is not an issue for the moment since we don't share any
|
||||
+ * state with KMS, so we can ignore the lock for now, but we need to
|
||||
+ * keep it in mind if we were to change that assumption.
|
||||
+ */
|
||||
+
|
||||
if (msg->len > 16) {
|
||||
drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len);
|
||||
return -ENOMEM;
|
||||
@@ -2360,6 +2465,7 @@ static int vc4_hdmi_bind(struct device *
|
||||
vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL);
|
||||
if (!vc4_hdmi)
|
||||
return -ENOMEM;
|
||||
+ mutex_init(&vc4_hdmi->mutex);
|
||||
spin_lock_init(&vc4_hdmi->hw_lock);
|
||||
INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq);
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -184,6 +184,20 @@ struct vc4_hdmi {
|
||||
* @hw_lock: Spinlock protecting device register access.
|
||||
*/
|
||||
spinlock_t hw_lock;
|
||||
+
|
||||
+ /**
|
||||
+ * @mutex: Mutex protecting the driver access across multiple
|
||||
+ * frameworks (KMS, ALSA).
|
||||
+ *
|
||||
+ * NOTE: While supported, CEC has been left out since
|
||||
+ * cec_s_phys_addr_from_edid() might call .adap_enable and lead to a
|
||||
+ * reentrancy issue between .get_modes (or .detect) and .adap_enable.
|
||||
+ * Since we don't share any state between the CEC hooks and KMS', it's
|
||||
+ * not a big deal. The only trouble might come from updating the CEC
|
||||
+ * clock divider which might be affected by a modeset, but CEC should
|
||||
+ * be resilient to that.
|
||||
+ */
|
||||
+ struct mutex mutex;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
@ -1,161 +0,0 @@
|
||||
From d6ecbdcba5174488d403ccddc016721243eb1797 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Tue, 19 Oct 2021 14:19:29 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Prevent access to crtc->state outside
|
||||
of KMS
|
||||
|
||||
Accessing the crtc->state pointer from outside the modesetting context
|
||||
is not allowed. We thus need to copy whatever we need from the KMS state
|
||||
to our structure in order to access it.
|
||||
|
||||
However, in the vc4 HDMI driver we do use that pointer in the ALSA code
|
||||
path, and potentially in the hotplug interrupt handler path.
|
||||
|
||||
These paths both need access to the CRTC adjusted mode in order for the
|
||||
proper dividers to be set for ALSA, and the scrambler state to be
|
||||
reinstated properly for hotplug.
|
||||
|
||||
Let's copy this mode into our private encoder structure and reference it
|
||||
from there when needed. Since that part is shared between KMS and other
|
||||
paths, we need to protect it using our mutex.
|
||||
|
||||
Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/
|
||||
Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support")
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 38 +++++++++++++++++++++++-----------
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 6 ++++++
|
||||
2 files changed, 32 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -488,8 +488,7 @@ static void vc4_hdmi_set_avi_infoframe(s
|
||||
struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
struct drm_connector *connector = &vc4_hdmi->connector;
|
||||
struct drm_connector_state *cstate = connector->state;
|
||||
- struct drm_crtc *crtc = encoder->crtc;
|
||||
- const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
|
||||
+ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
union hdmi_infoframe frame;
|
||||
int ret;
|
||||
|
||||
@@ -601,8 +600,8 @@ static bool vc4_hdmi_supports_scrambling
|
||||
|
||||
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
|
||||
{
|
||||
- struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
unsigned long flags;
|
||||
|
||||
lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
@@ -628,18 +627,21 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
unsigned long flags;
|
||||
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
/*
|
||||
* At boot, encoder->crtc will be NULL. Since we don't know the
|
||||
* state of the scrambler and in order to avoid any
|
||||
* inconsistency, let's disable it all the time.
|
||||
*/
|
||||
- if (crtc && !vc4_hdmi_supports_scrambling(encoder, &crtc->mode))
|
||||
+ if (crtc && !vc4_hdmi_supports_scrambling(encoder, mode))
|
||||
return;
|
||||
|
||||
- if (crtc && !vc4_hdmi_mode_needs_scrambling(&crtc->mode))
|
||||
+ if (crtc && !vc4_hdmi_mode_needs_scrambling(mode))
|
||||
return;
|
||||
|
||||
if (delayed_work_pending(&vc4_hdmi->scrambling_work))
|
||||
@@ -1018,8 +1020,8 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
||||
vc4_hdmi_encoder_get_connector_state(encoder, state);
|
||||
struct vc4_hdmi_connector_state *vc4_conn_state =
|
||||
conn_state_to_vc4_hdmi_conn_state(conn_state);
|
||||
- struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
unsigned long pixel_rate = vc4_conn_state->pixel_rate;
|
||||
unsigned long bvb_rate, hsm_rate;
|
||||
unsigned long flags;
|
||||
@@ -1121,9 +1123,9 @@ out:
|
||||
static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
- struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
- struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
+ struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
unsigned long flags;
|
||||
|
||||
mutex_lock(&vc4_hdmi->mutex);
|
||||
@@ -1151,8 +1153,8 @@ static void vc4_hdmi_encoder_pre_crtc_en
|
||||
static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
- struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+ struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
|
||||
bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC;
|
||||
bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC;
|
||||
@@ -1228,6 +1230,19 @@ static void vc4_hdmi_encoder_enable(stru
|
||||
{
|
||||
}
|
||||
|
||||
+static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
|
||||
+ struct drm_crtc_state *crtc_state,
|
||||
+ struct drm_connector_state *conn_state)
|
||||
+{
|
||||
+ struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+ memcpy(&vc4_hdmi->saved_adjusted_mode,
|
||||
+ &crtc_state->adjusted_mode,
|
||||
+ sizeof(vc4_hdmi->saved_adjusted_mode));
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+}
|
||||
+
|
||||
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL
|
||||
#define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL
|
||||
|
||||
@@ -1306,6 +1321,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e
|
||||
|
||||
static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = {
|
||||
.atomic_check = vc4_hdmi_encoder_atomic_check,
|
||||
+ .atomic_mode_set = vc4_hdmi_encoder_atomic_mode_set,
|
||||
.mode_valid = vc4_hdmi_encoder_mode_valid,
|
||||
.disable = vc4_hdmi_encoder_disable,
|
||||
.enable = vc4_hdmi_encoder_enable,
|
||||
@@ -1359,9 +1375,7 @@ static void vc4_hdmi_audio_set_mai_clock
|
||||
|
||||
static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate)
|
||||
{
|
||||
- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
- struct drm_crtc *crtc = encoder->crtc;
|
||||
- const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
|
||||
+ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
u32 n, cts;
|
||||
u64 tmp;
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -198,6 +198,12 @@ struct vc4_hdmi {
|
||||
* be resilient to that.
|
||||
*/
|
||||
struct mutex mutex;
|
||||
+
|
||||
+ /**
|
||||
+ * @saved_adjusted_mode: Copy of @drm_crtc_state.adjusted_mode
|
||||
+ * for use by ALSA hooks and interrupt handlers. Protected by @mutex.
|
||||
+ */
|
||||
+ struct drm_display_mode saved_adjusted_mode;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
@ -1,77 +0,0 @@
|
||||
From ba0375640d2d82158600a398181bb9f9c3835d0a Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Fri, 24 Sep 2021 14:27:38 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Check the device state in prepare()
|
||||
|
||||
Even though we already check that the encoder->crtc pointer is there
|
||||
during in startup(), which is part of the open() path in ASoC, nothing
|
||||
guarantees that our encoder state won't change between the time when we
|
||||
open the device and the time we prepare it.
|
||||
|
||||
Move the sanity checks we do in startup() to a helper and call it from
|
||||
prepare().
|
||||
|
||||
Fixes: 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec")
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 35 +++++++++++++++++++++++++++-------
|
||||
1 file changed, 28 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -1407,20 +1407,36 @@ static inline struct vc4_hdmi *dai_to_hd
|
||||
return snd_soc_card_get_drvdata(card);
|
||||
}
|
||||
|
||||
+static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi)
|
||||
+{
|
||||
+ struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
+
|
||||
+ lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
+
|
||||
+ /*
|
||||
+ * The encoder doesn't have a CRTC until the first modeset.
|
||||
+ */
|
||||
+ if (!encoder->crtc)
|
||||
+ return false;
|
||||
+
|
||||
+ /*
|
||||
+ * If the encoder is currently in DVI mode, treat the codec DAI
|
||||
+ * as missing.
|
||||
+ */
|
||||
+ if (!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) & VC4_HDMI_RAM_PACKET_ENABLE))
|
||||
+ return false;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
static int vc4_hdmi_audio_startup(struct device *dev, void *data)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
|
||||
- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
unsigned long flags;
|
||||
|
||||
mutex_lock(&vc4_hdmi->mutex);
|
||||
|
||||
- /*
|
||||
- * If the HDMI encoder hasn't probed, or the encoder is
|
||||
- * currently in DVI mode, treat the codec dai as missing.
|
||||
- */
|
||||
- if (!encoder->crtc || !(HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
|
||||
- VC4_HDMI_RAM_PACKET_ENABLE)) {
|
||||
+ if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) {
|
||||
mutex_unlock(&vc4_hdmi->mutex);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -1550,6 +1566,11 @@ static int vc4_hdmi_audio_prepare(struct
|
||||
|
||||
mutex_lock(&vc4_hdmi->mutex);
|
||||
|
||||
+ if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) {
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate);
|
||||
|
||||
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
@ -1,78 +0,0 @@
|
||||
From 02631cb4e30d7bc46f2b30657a84ddeb65831798 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Tue, 19 Oct 2021 17:31:58 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Introduce an output_enabled flag
|
||||
|
||||
We currently poke at encoder->crtc in the ALSA code path to determine
|
||||
whether the HDMI output is enabled or not, and thus whether we should
|
||||
allow the audio output.
|
||||
|
||||
However, that pointer is deprecated and shouldn't really be used by
|
||||
atomic drivers anymore. Since we have the infrastructure in place now,
|
||||
let's just create a flag that we toggle to report whether the controller
|
||||
is currently enabled and use that instead of encoder->crtc in ALSA.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 16 ++++++++++++----
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 6 ++++++
|
||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -729,6 +729,11 @@ static void vc4_hdmi_encoder_post_crtc_p
|
||||
|
||||
static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder)
|
||||
{
|
||||
+ struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+ vc4_hdmi->output_enabled = false;
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable)
|
||||
@@ -1228,6 +1233,11 @@ static void vc4_hdmi_encoder_post_crtc_e
|
||||
|
||||
static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
|
||||
{
|
||||
+ struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
+
|
||||
+ mutex_lock(&vc4_hdmi->mutex);
|
||||
+ vc4_hdmi->output_enabled = true;
|
||||
+ mutex_unlock(&vc4_hdmi->mutex);
|
||||
}
|
||||
|
||||
static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
|
||||
@@ -1409,14 +1419,12 @@ static inline struct vc4_hdmi *dai_to_hd
|
||||
|
||||
static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base;
|
||||
-
|
||||
lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
|
||||
/*
|
||||
- * The encoder doesn't have a CRTC until the first modeset.
|
||||
+ * If the controller is disabled, prevent any ALSA output.
|
||||
*/
|
||||
- if (!encoder->crtc)
|
||||
+ if (!vc4_hdmi->output_enabled)
|
||||
return false;
|
||||
|
||||
/*
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -204,6 +204,12 @@ struct vc4_hdmi {
|
||||
* for use by ALSA hooks and interrupt handlers. Protected by @mutex.
|
||||
*/
|
||||
struct drm_display_mode saved_adjusted_mode;
|
||||
+
|
||||
+ /**
|
||||
+ * @output_enabled: Is the HDMI controller currently active?
|
||||
+ * Protected by @mutex.
|
||||
+ */
|
||||
+ bool output_enabled;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
@ -1,101 +0,0 @@
|
||||
From 4b98173449085326199e97a10d06cee4cce021a1 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Tue, 19 Oct 2021 19:13:46 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Introduce a scdc_enabled flag
|
||||
|
||||
We currently rely on two functions, vc4_hdmi_supports_scrambling() and
|
||||
vc4_hdmi_mode_needs_scrambling() to determine if we should enable and
|
||||
disable the scrambler for any given mode.
|
||||
|
||||
Since we might need to disable the controller at boot, we also always
|
||||
run vc4_hdmi_disable_scrambling() and thus call those functions without
|
||||
a mode yet, which in turns need to make some special casing in order for
|
||||
it to work.
|
||||
|
||||
Instead of duplicating the check for whether or not we need to take care
|
||||
of the scrambler in both vc4_hdmi_enable_scrambling() and
|
||||
vc4_hdmi_disable_scrambling(), we can do that check only when we enable
|
||||
it and store whether or not it's been enabled in our private structure.
|
||||
|
||||
We also need to initialize that flag at true to make sure we disable the
|
||||
scrambler at boot since we can't really know its state yet.
|
||||
|
||||
This allows to simplify a bit that part of the driver, and removes one
|
||||
user of our copy of the CRTC adjusted mode outside of KMS (since
|
||||
vc4_hdmi_disable_scrambling() might be called from the hotplug interrupt
|
||||
handler).
|
||||
|
||||
It also removes our last user of the legacy encoder->crtc pointer.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 22 ++++++++++++----------
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 6 ++++++
|
||||
2 files changed, 18 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -620,6 +620,8 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
VC5_HDMI_SCRAMBLER_CTL_ENABLE);
|
||||
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
||||
|
||||
+ vc4_hdmi->scdc_enabled = true;
|
||||
+
|
||||
queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work,
|
||||
msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS));
|
||||
}
|
||||
@@ -627,22 +629,14 @@ static void vc4_hdmi_enable_scrambling(s
|
||||
static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
- struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
|
||||
- struct drm_crtc *crtc = encoder->crtc;
|
||||
unsigned long flags;
|
||||
|
||||
lockdep_assert_held(&vc4_hdmi->mutex);
|
||||
|
||||
- /*
|
||||
- * At boot, encoder->crtc will be NULL. Since we don't know the
|
||||
- * state of the scrambler and in order to avoid any
|
||||
- * inconsistency, let's disable it all the time.
|
||||
- */
|
||||
- if (crtc && !vc4_hdmi_supports_scrambling(encoder, mode))
|
||||
+ if (!vc4_hdmi->scdc_enabled)
|
||||
return;
|
||||
|
||||
- if (crtc && !vc4_hdmi_mode_needs_scrambling(mode))
|
||||
- return;
|
||||
+ vc4_hdmi->scdc_enabled = false;
|
||||
|
||||
if (delayed_work_pending(&vc4_hdmi->scrambling_work))
|
||||
cancel_delayed_work_sync(&vc4_hdmi->scrambling_work);
|
||||
@@ -2523,6 +2517,14 @@ static int vc4_hdmi_bind(struct device *
|
||||
vc4_hdmi->pdev = pdev;
|
||||
vc4_hdmi->variant = variant;
|
||||
|
||||
+ /*
|
||||
+ * Since we don't know the state of the controller and its
|
||||
+ * display (if any), let's assume it's always enabled.
|
||||
+ * vc4_hdmi_disable_scrambling() will thus run at boot, make
|
||||
+ * sure it's disabled, and avoid any inconsistency.
|
||||
+ */
|
||||
+ vc4_hdmi->scdc_enabled = true;
|
||||
+
|
||||
ret = variant->init_resources(vc4_hdmi);
|
||||
if (ret)
|
||||
return ret;
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -210,6 +210,12 @@ struct vc4_hdmi {
|
||||
* Protected by @mutex.
|
||||
*/
|
||||
bool output_enabled;
|
||||
+
|
||||
+ /**
|
||||
+ * @scdc_enabled: Is the HDMI controller currently running with
|
||||
+ * the scrambler on? Protected by @mutex.
|
||||
+ */
|
||||
+ bool scdc_enabled;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
@ -1,45 +0,0 @@
|
||||
From e83ac8f131b0f691e2a35866fa67b484c7256a49 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Wed, 26 May 2021 16:07:01 +0200
|
||||
Subject: [PATCH] drm/vc4: Make vc4_crtc_get_encoder public
|
||||
|
||||
We'll need that function in vc4_kms to compute the core clock rate
|
||||
requirements.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++----
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 5 +++++
|
||||
2 files changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -281,10 +281,10 @@ static u32 vc4_crtc_get_fifo_full_level_
|
||||
* allows drivers to push pixels to more than one encoder from the
|
||||
* same CRTC.
|
||||
*/
|
||||
-static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
- struct drm_atomic_state *state,
|
||||
- struct drm_connector_state *(*get_state)(struct drm_atomic_state *state,
|
||||
- struct drm_connector *connector))
|
||||
+struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
+ struct drm_atomic_state *state,
|
||||
+ struct drm_connector_state *(*get_state)(struct drm_atomic_state *state,
|
||||
+ struct drm_connector *connector))
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -544,6 +544,11 @@ vc4_crtc_to_vc4_pv_data(const struct vc4
|
||||
return container_of(data, struct vc4_pv_data, base);
|
||||
}
|
||||
|
||||
+struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
+ struct drm_atomic_state *state,
|
||||
+ struct drm_connector_state *(*get_state)(struct drm_atomic_state *state,
|
||||
+ struct drm_connector *connector));
|
||||
+
|
||||
struct vc4_crtc_state {
|
||||
struct drm_crtc_state base;
|
||||
/* Dlist area for this CRTC configuration. */
|
@ -1,43 +0,0 @@
|
||||
From 28f071bd81de9d9026587c9fe7a6f9c3781a30cf Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 14 Jun 2021 15:27:24 +0200
|
||||
Subject: [PATCH] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv
|
||||
prototype
|
||||
|
||||
vc4_crtc_config_pv() retrieves the encoder again, even though its only
|
||||
caller, vc4_crtc_atomic_enable(), already did.
|
||||
|
||||
Pass the encoder pointer as an argument instead of going through all the
|
||||
connectors to retrieve it again.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -315,12 +315,11 @@ static void vc4_crtc_pixelvalve_reset(st
|
||||
CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_FIFO_CLR);
|
||||
}
|
||||
|
||||
-static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_atomic_state *state)
|
||||
+static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encoder,
|
||||
+ struct drm_atomic_state *state)
|
||||
{
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
- struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, state,
|
||||
- drm_atomic_get_new_connector_state);
|
||||
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
||||
const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc);
|
||||
@@ -601,7 +600,7 @@ static void vc4_crtc_atomic_enable(struc
|
||||
if (vc4_encoder->pre_crtc_configure)
|
||||
vc4_encoder->pre_crtc_configure(encoder, state);
|
||||
|
||||
- vc4_crtc_config_pv(crtc, state);
|
||||
+ vc4_crtc_config_pv(crtc, encoder, state);
|
||||
|
||||
CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_EN);
|
||||
|
@ -1,96 +0,0 @@
|
||||
From 0496e855a6e1acd60d4ae2e52ee906a4cffae014 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 21 Jun 2021 16:07:22 +0200
|
||||
Subject: [PATCH] drm/vc4: crtc: Rework the encoder retrieval code
|
||||
(again)
|
||||
|
||||
It turns out the encoder retrieval code, in addition to being
|
||||
unnecessarily complicated, has a bug when only the planes and crtcs are
|
||||
affected by a given atomic commit.
|
||||
|
||||
Indeed, in such a case, either drm_atomic_get_old_connector_state or
|
||||
drm_atomic_get_new_connector_state will return NULL and thus our encoder
|
||||
retrieval code will not match on anything.
|
||||
|
||||
We can however simplify the code by using drm_for_each_encoder_mask, the
|
||||
drm_crtc_state storing the encoders a given CRTC is connected to
|
||||
directly and without relying on any other state.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 30 +++++++++---------------------
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 4 +---
|
||||
2 files changed, 10 insertions(+), 24 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -282,26 +282,14 @@ static u32 vc4_crtc_get_fifo_full_level_
|
||||
* same CRTC.
|
||||
*/
|
||||
struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
- struct drm_atomic_state *state,
|
||||
- struct drm_connector_state *(*get_state)(struct drm_atomic_state *state,
|
||||
- struct drm_connector *connector))
|
||||
+ struct drm_crtc_state *state)
|
||||
{
|
||||
- struct drm_connector *connector;
|
||||
- struct drm_connector_list_iter conn_iter;
|
||||
+ struct drm_encoder *encoder;
|
||||
|
||||
- drm_connector_list_iter_begin(crtc->dev, &conn_iter);
|
||||
- drm_for_each_connector_iter(connector, &conn_iter) {
|
||||
- struct drm_connector_state *conn_state = get_state(state, connector);
|
||||
-
|
||||
- if (!conn_state)
|
||||
- continue;
|
||||
-
|
||||
- if (conn_state->crtc == crtc) {
|
||||
- drm_connector_list_iter_end(&conn_iter);
|
||||
- return connector->encoder;
|
||||
- }
|
||||
- }
|
||||
- drm_connector_list_iter_end(&conn_iter);
|
||||
+ WARN_ON(hweight32(state->encoder_mask) > 1);
|
||||
+
|
||||
+ drm_for_each_encoder_mask(encoder, crtc->dev, state->encoder_mask)
|
||||
+ return encoder;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -554,8 +542,7 @@ static void vc4_crtc_atomic_disable(stru
|
||||
struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
|
||||
crtc);
|
||||
struct vc4_crtc_state *old_vc4_state = to_vc4_crtc_state(old_state);
|
||||
- struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, state,
|
||||
- drm_atomic_get_old_connector_state);
|
||||
+ struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, old_state);
|
||||
struct drm_device *dev = crtc->dev;
|
||||
|
||||
require_hvs_enabled(dev);
|
||||
@@ -582,10 +569,11 @@ static void vc4_crtc_atomic_disable(stru
|
||||
static void vc4_crtc_atomic_enable(struct drm_crtc *crtc,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
+ struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state,
|
||||
+ crtc);
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
||||
- struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, state,
|
||||
- drm_atomic_get_new_connector_state);
|
||||
+ struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, new_state);
|
||||
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
|
||||
require_hvs_enabled(dev);
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -545,9 +545,7 @@ vc4_crtc_to_vc4_pv_data(const struct vc4
|
||||
}
|
||||
|
||||
struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
- struct drm_atomic_state *state,
|
||||
- struct drm_connector_state *(*get_state)(struct drm_atomic_state *state,
|
||||
- struct drm_connector *connector));
|
||||
+ struct drm_crtc_state *state);
|
||||
|
||||
struct vc4_crtc_state {
|
||||
struct drm_crtc_state base;
|
@ -1,38 +0,0 @@
|
||||
From 28de437934da2fb9f04b0c4f5aa73553e63894e3 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 21 Jun 2021 16:13:02 +0200
|
||||
Subject: [PATCH] drm/vc4: crtc: Add some logging
|
||||
|
||||
The encoder retrieval code has been a source of bugs and glitches in the
|
||||
past and the crtc <-> encoder association been wrong in a number of
|
||||
different ways.
|
||||
|
||||
Add some logging to quickly spot issues if they occur.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -545,6 +545,9 @@ static void vc4_crtc_atomic_disable(stru
|
||||
struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, old_state);
|
||||
struct drm_device *dev = crtc->dev;
|
||||
|
||||
+ drm_dbg(dev, "Disabling CRTC %s (%u) connected to Encoder %s (%u)",
|
||||
+ crtc->name, crtc->base.id, encoder->name, encoder->base.id);
|
||||
+
|
||||
require_hvs_enabled(dev);
|
||||
|
||||
/* Disable vblank irq handling before crtc is disabled. */
|
||||
@@ -576,6 +579,9 @@ static void vc4_crtc_atomic_enable(struc
|
||||
struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, new_state);
|
||||
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
|
||||
+ drm_dbg(dev, "Enabling CRTC %s (%u) connected to Encoder %s (%u)",
|
||||
+ crtc->name, crtc->base.id, encoder->name, encoder->base.id);
|
||||
+
|
||||
require_hvs_enabled(dev);
|
||||
|
||||
/* Enable vblank irq handling before crtc is started otherwise
|
@ -1,123 +0,0 @@
|
||||
From 1cc57695d3103fa93eda71bb6ba212c3e5806b4a Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 21 Jun 2021 17:19:22 +0200
|
||||
Subject: [PATCH] drm/vc4: Leverage the load tracker on the BCM2711
|
||||
|
||||
The load tracker was initially designed to report and warn about a load
|
||||
too high for the HVS. To do so, it computes for each plane the impact
|
||||
it's going to have on the HVS, and will warn (if it's enabled) if we go
|
||||
over what the hardware can process.
|
||||
|
||||
While the limits being used are a bit irrelevant to the BCM2711, the
|
||||
algorithm to compute the HVS load will be one component used in order to
|
||||
compute the core clock rate on the BCM2711.
|
||||
|
||||
Let's remove the hooks to prevent the load tracker to do its
|
||||
computation, but since we don't have the same limits, don't check them
|
||||
against them, and prevent the debugfs file to enable it from being
|
||||
created.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_debugfs.c | 7 +++++--
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 3 ---
|
||||
drivers/gpu/drm/vc4/vc4_kms.c | 16 +++++-----------
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 5 -----
|
||||
4 files changed, 10 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_debugfs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/circ_buf.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/debugfs.h>
|
||||
+#include <linux/platform_device.h>
|
||||
|
||||
#include "vc4_drv.h"
|
||||
#include "vc4_regs.h"
|
||||
@@ -26,8 +27,10 @@ vc4_debugfs_init(struct drm_minor *minor
|
||||
struct vc4_dev *vc4 = to_vc4_dev(minor->dev);
|
||||
struct vc4_debugfs_info_entry *entry;
|
||||
|
||||
- debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR,
|
||||
- minor->debugfs_root, &vc4->load_tracker_enabled);
|
||||
+ if (!of_device_is_compatible(vc4->hvs->pdev->dev.of_node,
|
||||
+ "brcm,bcm2711-vc5"))
|
||||
+ debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR,
|
||||
+ minor->debugfs_root, &vc4->load_tracker_enabled);
|
||||
|
||||
list_for_each_entry(entry, &vc4->debugfs_list, link) {
|
||||
drm_debugfs_create_files(&entry->info, 1,
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -202,9 +202,6 @@ struct vc4_dev {
|
||||
|
||||
int power_refcount;
|
||||
|
||||
- /* Set to true when the load tracker is supported. */
|
||||
- bool load_tracker_available;
|
||||
-
|
||||
/* Set to true when the load tracker is active. */
|
||||
bool load_tracker_enabled;
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
@@ -554,9 +554,6 @@ static int vc4_load_tracker_atomic_check
|
||||
struct drm_plane *plane;
|
||||
int i;
|
||||
|
||||
- if (!vc4->load_tracker_available)
|
||||
- return 0;
|
||||
-
|
||||
priv_state = drm_atomic_get_private_obj_state(state,
|
||||
&vc4->load_tracker);
|
||||
if (IS_ERR(priv_state))
|
||||
@@ -631,9 +628,6 @@ static void vc4_load_tracker_obj_fini(st
|
||||
{
|
||||
struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
|
||||
- if (!vc4->load_tracker_available)
|
||||
- return;
|
||||
-
|
||||
drm_atomic_private_obj_fini(&vc4->load_tracker);
|
||||
}
|
||||
|
||||
@@ -641,9 +635,6 @@ static int vc4_load_tracker_obj_init(str
|
||||
{
|
||||
struct vc4_load_tracker_state *load_state;
|
||||
|
||||
- if (!vc4->load_tracker_available)
|
||||
- return 0;
|
||||
-
|
||||
load_state = kzalloc(sizeof(*load_state), GFP_KERNEL);
|
||||
if (!load_state)
|
||||
return -ENOMEM;
|
||||
@@ -865,9 +856,12 @@ int vc4_kms_load(struct drm_device *dev)
|
||||
"brcm,bcm2711-vc5");
|
||||
int ret;
|
||||
|
||||
+ /*
|
||||
+ * The limits enforced by the load tracker aren't relevant for
|
||||
+ * the BCM2711, but the load tracker computations are used for
|
||||
+ * the core clock rate calculation.
|
||||
+ */
|
||||
if (!is_vc5) {
|
||||
- vc4->load_tracker_available = true;
|
||||
-
|
||||
/* Start with the load tracker enabled. Can be
|
||||
* disabled through the debugfs load_tracker file.
|
||||
*/
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -527,11 +527,6 @@ static void vc4_plane_calc_load(struct d
|
||||
struct vc4_plane_state *vc4_state;
|
||||
struct drm_crtc_state *crtc_state;
|
||||
unsigned int vscale_factor;
|
||||
- struct vc4_dev *vc4;
|
||||
-
|
||||
- vc4 = to_vc4_dev(state->plane->dev);
|
||||
- if (!vc4->load_tracker_available)
|
||||
- return;
|
||||
|
||||
vc4_state = to_vc4_plane_state(state);
|
||||
crtc_state = drm_atomic_get_existing_crtc_state(state->state,
|
@ -1,242 +0,0 @@
|
||||
From 99c821dc4cd65ff067e2dfff4a47ceb5aa61ad0c Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Wed, 26 May 2021 16:13:02 +0200
|
||||
Subject: [PATCH] drm/vc4: Increase the core clock based on HVS load
|
||||
|
||||
Depending on a given HVS output (HVS to PixelValves) and input (planes
|
||||
attached to a channel) load, the HVS needs for the core clock to be
|
||||
raised above its boot time default.
|
||||
|
||||
Failing to do so will result in a vblank timeout and a stalled display
|
||||
pipeline.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 15 +++++
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 2 +
|
||||
drivers/gpu/drm/vc4/vc4_kms.c | 112 ++++++++++++++++++++++++++++++---
|
||||
3 files changed, 119 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -663,12 +663,27 @@ static int vc4_crtc_atomic_check(struct
|
||||
struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state);
|
||||
struct drm_connector *conn;
|
||||
struct drm_connector_state *conn_state;
|
||||
+ struct drm_encoder *encoder;
|
||||
int ret, i;
|
||||
|
||||
ret = vc4_hvs_atomic_check(crtc, state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ encoder = vc4_get_crtc_encoder(crtc, crtc_state);
|
||||
+ if (encoder) {
|
||||
+ const struct drm_display_mode *mode = &crtc_state->adjusted_mode;
|
||||
+ struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
+
|
||||
+ mode = &crtc_state->adjusted_mode;
|
||||
+ if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) {
|
||||
+ vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000,
|
||||
+ mode->clock * 9 / 10) * 1000;
|
||||
+ } else {
|
||||
+ vc4_state->hvs_load = mode->clock * 1000;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
for_each_new_connector_in_state(state, conn, conn_state,
|
||||
i) {
|
||||
if (conn_state->crtc != crtc)
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -558,6 +558,8 @@ struct vc4_crtc_state {
|
||||
unsigned int bottom;
|
||||
} margins;
|
||||
|
||||
+ unsigned long hvs_load;
|
||||
+
|
||||
/* Transitional state below, only valid during atomic commits */
|
||||
bool update_muxing;
|
||||
};
|
||||
--- a/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
@@ -39,9 +39,11 @@ static struct vc4_ctm_state *to_vc4_ctm_
|
||||
|
||||
struct vc4_hvs_state {
|
||||
struct drm_private_state base;
|
||||
+ unsigned long core_clock_rate;
|
||||
|
||||
struct {
|
||||
unsigned in_use: 1;
|
||||
+ unsigned long fifo_load;
|
||||
struct drm_crtc_commit *pending_commit;
|
||||
} fifo_state[HVS_NUM_CHANNELS];
|
||||
};
|
||||
@@ -339,11 +341,20 @@ static void vc4_atomic_commit_tail(struc
|
||||
struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
struct vc4_hvs *hvs = vc4->hvs;
|
||||
struct drm_crtc_state *new_crtc_state;
|
||||
+ struct vc4_hvs_state *new_hvs_state;
|
||||
struct drm_crtc *crtc;
|
||||
struct vc4_hvs_state *old_hvs_state;
|
||||
unsigned int channel;
|
||||
int i;
|
||||
|
||||
+ old_hvs_state = vc4_hvs_get_old_global_state(state);
|
||||
+ if (WARN_ON(!old_hvs_state))
|
||||
+ return;
|
||||
+
|
||||
+ new_hvs_state = vc4_hvs_get_new_global_state(state);
|
||||
+ if (WARN_ON(!new_hvs_state))
|
||||
+ return;
|
||||
+
|
||||
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
|
||||
struct vc4_crtc_state *vc4_crtc_state;
|
||||
|
||||
@@ -354,10 +365,6 @@ static void vc4_atomic_commit_tail(struc
|
||||
vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel);
|
||||
}
|
||||
|
||||
- old_hvs_state = vc4_hvs_get_old_global_state(state);
|
||||
- if (IS_ERR(old_hvs_state))
|
||||
- return;
|
||||
-
|
||||
for (channel = 0; channel < HVS_NUM_CHANNELS; channel++) {
|
||||
struct drm_crtc_commit *commit;
|
||||
int ret;
|
||||
@@ -377,8 +384,13 @@ static void vc4_atomic_commit_tail(struc
|
||||
old_hvs_state->fifo_state[channel].pending_commit = NULL;
|
||||
}
|
||||
|
||||
- if (vc4->hvs->hvs5)
|
||||
- clk_set_min_rate(hvs->core_clk, 500000000);
|
||||
+ if (vc4->hvs->hvs5) {
|
||||
+ unsigned long core_rate = max_t(unsigned long,
|
||||
+ 500000000,
|
||||
+ new_hvs_state->core_clock_rate);
|
||||
+
|
||||
+ clk_set_min_rate(hvs->core_clk, core_rate);
|
||||
+ }
|
||||
|
||||
drm_atomic_helper_commit_modeset_disables(dev, state);
|
||||
|
||||
@@ -401,8 +413,12 @@ static void vc4_atomic_commit_tail(struc
|
||||
|
||||
drm_atomic_helper_cleanup_planes(dev, state);
|
||||
|
||||
- if (vc4->hvs->hvs5)
|
||||
- clk_set_min_rate(hvs->core_clk, 0);
|
||||
+ if (vc4->hvs->hvs5) {
|
||||
+ drm_dbg(dev, "Running the core clock at %lu Hz\n",
|
||||
+ new_hvs_state->core_clock_rate);
|
||||
+
|
||||
+ clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate);
|
||||
+ }
|
||||
}
|
||||
|
||||
static int vc4_atomic_commit_setup(struct drm_atomic_state *state)
|
||||
@@ -659,11 +675,13 @@ vc4_hvs_channels_duplicate_state(struct
|
||||
|
||||
__drm_atomic_helper_private_obj_duplicate_state(obj, &state->base);
|
||||
|
||||
-
|
||||
for (i = 0; i < HVS_NUM_CHANNELS; i++) {
|
||||
state->fifo_state[i].in_use = old_state->fifo_state[i].in_use;
|
||||
+ state->fifo_state[i].fifo_load = old_state->fifo_state[i].fifo_load;
|
||||
}
|
||||
|
||||
+ state->core_clock_rate = old_state->core_clock_rate;
|
||||
+
|
||||
return &state->base;
|
||||
}
|
||||
|
||||
@@ -819,6 +837,76 @@ static int vc4_pv_muxing_atomic_check(st
|
||||
}
|
||||
|
||||
static int
|
||||
+vc4_core_clock_atomic_check(struct drm_atomic_state *state)
|
||||
+{
|
||||
+ struct vc4_dev *vc4 = to_vc4_dev(state->dev);
|
||||
+ struct drm_private_state *priv_state;
|
||||
+ struct vc4_hvs_state *hvs_new_state;
|
||||
+ struct vc4_load_tracker_state *load_state;
|
||||
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
|
||||
+ struct drm_crtc *crtc;
|
||||
+ unsigned int num_outputs;
|
||||
+ unsigned long pixel_rate;
|
||||
+ unsigned long cob_rate;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ priv_state = drm_atomic_get_private_obj_state(state,
|
||||
+ &vc4->load_tracker);
|
||||
+ if (IS_ERR(priv_state))
|
||||
+ return PTR_ERR(priv_state);
|
||||
+
|
||||
+ load_state = to_vc4_load_tracker_state(priv_state);
|
||||
+
|
||||
+ hvs_new_state = vc4_hvs_get_global_state(state);
|
||||
+ if (!hvs_new_state)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ for_each_oldnew_crtc_in_state(state, crtc,
|
||||
+ old_crtc_state,
|
||||
+ new_crtc_state,
|
||||
+ i) {
|
||||
+ if (old_crtc_state->active) {
|
||||
+ struct vc4_crtc_state *old_vc4_state =
|
||||
+ to_vc4_crtc_state(old_crtc_state);
|
||||
+ unsigned int channel = old_vc4_state->assigned_channel;
|
||||
+
|
||||
+ hvs_new_state->fifo_state[channel].fifo_load = 0;
|
||||
+ }
|
||||
+
|
||||
+ if (new_crtc_state->active) {
|
||||
+ struct vc4_crtc_state *new_vc4_state =
|
||||
+ to_vc4_crtc_state(new_crtc_state);
|
||||
+ unsigned int channel = new_vc4_state->assigned_channel;
|
||||
+
|
||||
+ hvs_new_state->fifo_state[channel].fifo_load =
|
||||
+ new_vc4_state->hvs_load;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ cob_rate = 0;
|
||||
+ num_outputs = 0;
|
||||
+ for (i = 0; i < HVS_NUM_CHANNELS; i++) {
|
||||
+ if (!hvs_new_state->fifo_state[i].in_use)
|
||||
+ continue;
|
||||
+
|
||||
+ num_outputs++;
|
||||
+ cob_rate += hvs_new_state->fifo_state[i].fifo_load;
|
||||
+ }
|
||||
+
|
||||
+ pixel_rate = load_state->hvs_load;
|
||||
+ if (num_outputs > 1) {
|
||||
+ pixel_rate = (pixel_rate * 40) / 100;
|
||||
+ } else {
|
||||
+ pixel_rate = (pixel_rate * 60) / 100;
|
||||
+ }
|
||||
+
|
||||
+ hvs_new_state->core_clock_rate = max(cob_rate, pixel_rate);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int
|
||||
vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)
|
||||
{
|
||||
int ret;
|
||||
@@ -835,7 +923,11 @@ vc4_atomic_check(struct drm_device *dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- return vc4_load_tracker_atomic_check(state);
|
||||
+ ret = vc4_load_tracker_atomic_check(state);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return vc4_core_clock_atomic_check(state);
|
||||
}
|
||||
|
||||
static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = {
|
@ -1,29 +0,0 @@
|
||||
From 0ba0b0f41c143fe0f30ea248e55872e681870be2 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 15:53:03 +0200
|
||||
Subject: [PATCH] drm/vc4: select PM
|
||||
|
||||
We already depend on runtime PM to get the power domains and clocks for
|
||||
most of the devices supported by the vc4 driver, so let's just select it
|
||||
to make sure it's there, and remove the ifdef.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/Kconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/Kconfig
|
||||
+++ b/drivers/gpu/drm/vc4/Kconfig
|
||||
@@ -5,11 +5,11 @@ config DRM_VC4
|
||||
depends on DRM
|
||||
depends on SND && SND_SOC
|
||||
depends on COMMON_CLK
|
||||
- depends on PM
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_KMS_CMA_HELPER
|
||||
select DRM_GEM_CMA_HELPER
|
||||
select DRM_PANEL_BRIDGE
|
||||
+ select PM
|
||||
select SND_PCM
|
||||
select SND_PCM_ELD
|
||||
select SND_SOC_GENERIC_DMAENGINE_PCM
|
@ -1,201 +0,0 @@
|
||||
From 22ce134cee72bd9ef4b02c8769f868309f2ab8fd Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 14:37:04 +0200
|
||||
Subject: [PATCH] drm/probe-helper: Create a HPD IRQ event helper for a
|
||||
single connector
|
||||
|
||||
The drm_helper_hpd_irq_event() function is iterating over all the
|
||||
connectors when an hotplug event is detected.
|
||||
|
||||
During that iteration, it will call each connector detect function and
|
||||
figure out if its status changed.
|
||||
|
||||
Finally, if any connector changed, it will notify the user-space and the
|
||||
clients that something changed on the DRM device.
|
||||
|
||||
This is supposed to be used for drivers that don't have a hotplug
|
||||
interrupt for individual connectors. However, drivers that can use an
|
||||
interrupt for a single connector are left in the dust and can either
|
||||
reimplement the logic used during the iteration for each connector or
|
||||
use that helper and iterate over all connectors all the time.
|
||||
|
||||
Since both are suboptimal, let's create a helper that will only perform
|
||||
the status detection on a single connector.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
|
||||
---
|
||||
|
||||
Changes from v1:
|
||||
- Rename the shared function
|
||||
- Move the hotplug event notification out of the shared function
|
||||
- Added missing locks
|
||||
- Improve the documentation
|
||||
- Switched to drm_dbg_kms
|
||||
---
|
||||
drivers/gpu/drm/drm_probe_helper.c | 120 ++++++++++++++++++++---------
|
||||
include/drm/drm_probe_helper.h | 1 +
|
||||
2 files changed, 86 insertions(+), 35 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/drm_probe_helper.c
|
||||
+++ b/drivers/gpu/drm/drm_probe_helper.c
|
||||
@@ -796,6 +796,86 @@ void drm_kms_helper_poll_fini(struct drm
|
||||
}
|
||||
EXPORT_SYMBOL(drm_kms_helper_poll_fini);
|
||||
|
||||
+static bool check_connector_changed(struct drm_connector *connector)
|
||||
+{
|
||||
+ struct drm_device *dev = connector->dev;
|
||||
+ enum drm_connector_status old_status;
|
||||
+ u64 old_epoch_counter;
|
||||
+ bool changed = false;
|
||||
+
|
||||
+ /* Only handle HPD capable connectors. */
|
||||
+ drm_WARN_ON(dev, !(connector->polled & DRM_CONNECTOR_POLL_HPD));
|
||||
+
|
||||
+ drm_WARN_ON(dev, !mutex_is_locked(&dev->mode_config.mutex));
|
||||
+
|
||||
+ old_status = connector->status;
|
||||
+ old_epoch_counter = connector->epoch_counter;
|
||||
+
|
||||
+ drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Old epoch counter %llu\n",
|
||||
+ connector->base.id,
|
||||
+ connector->name,
|
||||
+ old_epoch_counter);
|
||||
+
|
||||
+ connector->status = drm_helper_probe_detect(connector, NULL, false);
|
||||
+ drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
|
||||
+ connector->base.id,
|
||||
+ connector->name,
|
||||
+ drm_get_connector_status_name(old_status),
|
||||
+ drm_get_connector_status_name(connector->status));
|
||||
+
|
||||
+ drm_dbg_kms(dev, "[CONNECTOR:%d:%s] New epoch counter %llu\n",
|
||||
+ connector->base.id,
|
||||
+ connector->name,
|
||||
+ connector->epoch_counter);
|
||||
+
|
||||
+ /*
|
||||
+ * Check if epoch counter had changed, meaning that we need
|
||||
+ * to send a uevent.
|
||||
+ */
|
||||
+ if (old_epoch_counter != connector->epoch_counter)
|
||||
+ changed = true;
|
||||
+
|
||||
+ return changed;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * drm_connector_helper_hpd_irq_event - hotplug processing
|
||||
+ * @connector: drm_connector
|
||||
+ *
|
||||
+ * Drivers can use this helper function to run a detect cycle on a connector
|
||||
+ * which has the DRM_CONNECTOR_POLL_HPD flag set in its &polled member.
|
||||
+ *
|
||||
+ * This helper function is useful for drivers which can track hotplug
|
||||
+ * interrupts for a single connector. Drivers that want to send a
|
||||
+ * hotplug event for all connectors or can't track hotplug interrupts
|
||||
+ * per connector need to use drm_helper_hpd_irq_event().
|
||||
+ *
|
||||
+ * This function must be called from process context with no mode
|
||||
+ * setting locks held.
|
||||
+ *
|
||||
+ * Note that a connector can be both polled and probed from the hotplug
|
||||
+ * handler, in case the hotplug interrupt is known to be unreliable.
|
||||
+ */
|
||||
+bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector)
|
||||
+{
|
||||
+ struct drm_device *dev = connector->dev;
|
||||
+ bool changed;
|
||||
+
|
||||
+ mutex_lock(&dev->mode_config.mutex);
|
||||
+ changed = check_connector_changed(connector);
|
||||
+ mutex_unlock(&dev->mode_config.mutex);
|
||||
+
|
||||
+ if (changed) {
|
||||
+ drm_kms_helper_hotplug_event(dev);
|
||||
+ drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Sent hotplug event\n",
|
||||
+ connector->base.id,
|
||||
+ connector->name);
|
||||
+ }
|
||||
+
|
||||
+ return changed;
|
||||
+}
|
||||
+EXPORT_SYMBOL(drm_connector_helper_hpd_irq_event);
|
||||
+
|
||||
/**
|
||||
* drm_helper_hpd_irq_event - hotplug processing
|
||||
* @dev: drm_device
|
||||
@@ -809,9 +889,10 @@ EXPORT_SYMBOL(drm_kms_helper_poll_fini);
|
||||
* interrupts for each connector.
|
||||
*
|
||||
* Drivers which support hotplug interrupts for each connector individually and
|
||||
- * which have a more fine-grained detect logic should bypass this code and
|
||||
- * directly call drm_kms_helper_hotplug_event() in case the connector state
|
||||
- * changed.
|
||||
+ * which have a more fine-grained detect logic can use
|
||||
+ * drm_connector_helper_hpd_irq_event(). Alternatively, they should bypass this
|
||||
+ * code and directly call drm_kms_helper_hotplug_event() in case the connector
|
||||
+ * state changed.
|
||||
*
|
||||
* This function must be called from process context with no mode
|
||||
* setting locks held.
|
||||
@@ -823,9 +904,7 @@ bool drm_helper_hpd_irq_event(struct drm
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
- enum drm_connector_status old_status;
|
||||
bool changed = false;
|
||||
- u64 old_epoch_counter;
|
||||
|
||||
if (!dev->mode_config.poll_enabled)
|
||||
return false;
|
||||
@@ -833,37 +912,8 @@ bool drm_helper_hpd_irq_event(struct drm
|
||||
mutex_lock(&dev->mode_config.mutex);
|
||||
drm_connector_list_iter_begin(dev, &conn_iter);
|
||||
drm_for_each_connector_iter(connector, &conn_iter) {
|
||||
- /* Only handle HPD capable connectors. */
|
||||
- if (!(connector->polled & DRM_CONNECTOR_POLL_HPD))
|
||||
- continue;
|
||||
-
|
||||
- old_status = connector->status;
|
||||
-
|
||||
- old_epoch_counter = connector->epoch_counter;
|
||||
-
|
||||
- DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Old epoch counter %llu\n", connector->base.id,
|
||||
- connector->name,
|
||||
- old_epoch_counter);
|
||||
-
|
||||
- connector->status = drm_helper_probe_detect(connector, NULL, false);
|
||||
- DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
|
||||
- connector->base.id,
|
||||
- connector->name,
|
||||
- drm_get_connector_status_name(old_status),
|
||||
- drm_get_connector_status_name(connector->status));
|
||||
-
|
||||
- DRM_DEBUG_KMS("[CONNECTOR:%d:%s] New epoch counter %llu\n",
|
||||
- connector->base.id,
|
||||
- connector->name,
|
||||
- connector->epoch_counter);
|
||||
-
|
||||
- /*
|
||||
- * Check if epoch counter had changed, meaning that we need
|
||||
- * to send a uevent.
|
||||
- */
|
||||
- if (old_epoch_counter != connector->epoch_counter)
|
||||
+ if (check_connector_changed(connector))
|
||||
changed = true;
|
||||
-
|
||||
}
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
mutex_unlock(&dev->mode_config.mutex);
|
||||
--- a/include/drm/drm_probe_helper.h
|
||||
+++ b/include/drm/drm_probe_helper.h
|
||||
@@ -18,6 +18,7 @@ int drm_helper_probe_detect(struct drm_c
|
||||
void drm_kms_helper_poll_init(struct drm_device *dev);
|
||||
void drm_kms_helper_poll_fini(struct drm_device *dev);
|
||||
bool drm_helper_hpd_irq_event(struct drm_device *dev);
|
||||
+bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector);
|
||||
void drm_kms_helper_hotplug_event(struct drm_device *dev);
|
||||
|
||||
void drm_kms_helper_poll_disable(struct drm_device *dev);
|
@ -1,60 +0,0 @@
|
||||
From b30b747d76946fb176bb4b044c830415d551b7bb Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 19 Aug 2021 13:50:12 +0200
|
||||
Subject: [PATCH] drm/vc4: hdmi: Actually check for the connector
|
||||
status in hotplug
|
||||
|
||||
The drm_helper_hpd_irq_event() documentation states that this function
|
||||
is "useful for drivers which can't or don't track hotplug interrupts for
|
||||
each connector." and that "Drivers which support hotplug interrupts for
|
||||
each connector individually and which have a more fine-grained detect
|
||||
logic should bypass this code and directly call
|
||||
drm_kms_helper_hotplug_event()". This is thus what we ended-up doing.
|
||||
|
||||
However, what this actually means, and is further explained in the
|
||||
drm_kms_helper_hotplug_event() documentation, is that
|
||||
drm_kms_helper_hotplug_event() should be called by drivers that can
|
||||
track the connection status change, and if it has changed we should call
|
||||
that function.
|
||||
|
||||
This underlying expectation we failed to provide is that the caller of
|
||||
drm_kms_helper_hotplug_event() should call drm_helper_probe_detect() to
|
||||
probe the new status of the connector.
|
||||
|
||||
Since we didn't do it, it meant that even though we were sending the
|
||||
notification to user-space and the DRM clients that something changed we
|
||||
never probed or updated our internal connector status ourselves.
|
||||
|
||||
This went mostly unnoticed since the detect callback usually doesn't
|
||||
have any side-effect. Also, if we were using the DRM fbdev emulation
|
||||
(which is a DRM client), or any user-space application that can deal
|
||||
with hotplug events, chances are they would react to the hotplug event
|
||||
by probing the connector status eventually.
|
||||
|
||||
However, now that we have to enable the scrambler in detect() if it was
|
||||
enabled it has a side effect, and an application such as Kodi or
|
||||
modetest doesn't deal with hotplug events. This resulted with a black
|
||||
screen when Kodi or modetest was running when a screen was disconnected
|
||||
and then reconnected, or switched off and on.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -1802,10 +1802,11 @@ static void vc4_hdmi_audio_exit(struct v
|
||||
static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv)
|
||||
{
|
||||
struct vc4_hdmi *vc4_hdmi = priv;
|
||||
- struct drm_device *dev = vc4_hdmi->connector.dev;
|
||||
+ struct drm_connector *connector = &vc4_hdmi->connector;
|
||||
+ struct drm_device *dev = connector->dev;
|
||||
|
||||
if (dev && dev->registered)
|
||||
- drm_kms_helper_hotplug_event(dev);
|
||||
+ drm_connector_helper_hpd_irq_event(connector);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
From 269985a75363eecabfc6e039c4731100c4d47b05 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Wed, 15 Dec 2021 10:51:14 +0100
|
||||
Subject: [PATCH] firmware: raspberrypi: Add
|
||||
RPI_FIRMWARE_NOTIFY_DISPLAY_DONE
|
||||
|
||||
The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the
|
||||
firmware the kernel is in charge of the display now and the firmware can
|
||||
free whatever resources it was using.
|
||||
|
||||
Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-2-maxime@cerno.tech
|
||||
---
|
||||
include/soc/bcm2835/raspberrypi-firmware.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/include/soc/bcm2835/raspberrypi-firmware.h
|
||||
+++ b/include/soc/bcm2835/raspberrypi-firmware.h
|
||||
@@ -91,6 +91,7 @@ enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_GET_POE_HAT_VAL = 0x00030049,
|
||||
RPI_FIRMWARE_SET_POE_HAT_VAL = 0x00030050,
|
||||
RPI_FIRMWARE_NOTIFY_XHCI_RESET = 0x00030058,
|
||||
+ RPI_FIRMWARE_NOTIFY_DISPLAY_DONE = 0x00030066,
|
||||
|
||||
/* Dispmanx TAGS */
|
||||
RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001,
|
@ -1,39 +0,0 @@
|
||||
From c8f54918eece907f904d160815603bfcee0cfa1e Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Wed, 15 Dec 2021 10:51:16 +0100
|
||||
Subject: [PATCH] drm/vc4: Remove conflicting framebuffers before
|
||||
callind bind_all
|
||||
|
||||
The bind hooks will modify their controller registers, so simplefb is
|
||||
going to be unusable anyway. Let's avoid any transient state where it
|
||||
could still be in the system but no longer functionnal.
|
||||
|
||||
Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-4-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
@@ -272,15 +272,15 @@ static int vc4_drm_bind(struct device *d
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = component_bind_all(dev, drm);
|
||||
+ ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = vc4_plane_create_additional_planes(drm);
|
||||
+ ret = component_bind_all(dev, drm);
|
||||
if (ret)
|
||||
- goto unbind_all;
|
||||
+ return ret;
|
||||
|
||||
- ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
|
||||
+ ret = vc4_plane_create_additional_planes(drm);
|
||||
if (ret)
|
||||
goto unbind_all;
|
||||
|
@ -1,69 +0,0 @@
|
||||
From 9e9177db83609c19bbe523cc4d20119cf09ea787 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Wed, 15 Dec 2021 10:51:17 +0100
|
||||
Subject: [PATCH] drm/vc4: Notify the firmware when DRM is in charge
|
||||
|
||||
Once the call to drm_fb_helper_remove_conflicting_framebuffers() has
|
||||
been made, simplefb has been unregistered and the KMS driver is entirely
|
||||
in charge of the display.
|
||||
|
||||
Thus, we can notify the firmware it can free whatever resource it was
|
||||
using to maintain simplefb functional.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-5-maxime@cerno.tech
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
|
||||
+#include <soc/bcm2835/raspberrypi-firmware.h>
|
||||
+
|
||||
#include "uapi/drm/vc4_drm.h"
|
||||
|
||||
#include "vc4_drv.h"
|
||||
@@ -226,6 +228,7 @@ static const struct of_device_id vc4_dma
|
||||
static int vc4_drm_bind(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
+ struct rpi_firmware *firmware = NULL;
|
||||
struct drm_device *drm;
|
||||
struct vc4_dev *vc4;
|
||||
struct device_node *node;
|
||||
@@ -272,10 +275,29 @@ static int vc4_drm_bind(struct device *d
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware");
|
||||
+ if (node) {
|
||||
+ firmware = rpi_firmware_get(node);
|
||||
+ of_node_put(node);
|
||||
+
|
||||
+ if (!firmware)
|
||||
+ return -EPROBE_DEFER;
|
||||
+ }
|
||||
+
|
||||
ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ if (firmware) {
|
||||
+ ret = rpi_firmware_property(firmware,
|
||||
+ RPI_FIRMWARE_NOTIFY_DISPLAY_DONE,
|
||||
+ NULL, 0);
|
||||
+ if (ret)
|
||||
+ drm_warn(drm, "Couldn't stop firmware display driver: %d\n", ret);
|
||||
+
|
||||
+ rpi_firmware_put(firmware);
|
||||
+ }
|
||||
+
|
||||
ret = component_bind_all(dev, drm);
|
||||
if (ret)
|
||||
return ret;
|
@ -1,96 +0,0 @@
|
||||
From 85c2420c3b800f5ec030b28f19b2a77022173a9b Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Fri, 15 Mar 2019 21:11:10 +0000
|
||||
Subject: [PATCH] Revert "staging: bcm2835-audio: Drop DT dependency"
|
||||
|
||||
This reverts commit b7491a9fca2dc2535b9dc922550a37c5baae9d3d.
|
||||
---
|
||||
.../vc04_services/bcm2835-audio/bcm2835.c | 31 +++++++++++++------
|
||||
1 file changed, 22 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
@@ -6,13 +6,13 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
|
||||
#include "bcm2835.h"
|
||||
|
||||
static bool enable_hdmi;
|
||||
static bool enable_headphones;
|
||||
static bool enable_compat_alsa = true;
|
||||
-static int num_channels = MAX_SUBSTREAMS;
|
||||
|
||||
module_param(enable_hdmi, bool, 0444);
|
||||
MODULE_PARM_DESC(enable_hdmi, "Enables HDMI virtual audio device");
|
||||
@@ -21,8 +21,6 @@ MODULE_PARM_DESC(enable_headphones, "Ena
|
||||
module_param(enable_compat_alsa, bool, 0444);
|
||||
MODULE_PARM_DESC(enable_compat_alsa,
|
||||
"Enables ALSA compatibility virtual audio device");
|
||||
-module_param(num_channels, int, 0644);
|
||||
-MODULE_PARM_DESC(num_channels, "Number of audio channels (default: 8)");
|
||||
|
||||
static void bcm2835_devm_free_vchi_ctx(struct device *dev, void *res)
|
||||
{
|
||||
@@ -296,19 +294,28 @@ static int snd_add_child_devices(struct
|
||||
static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
+ u32 numchans;
|
||||
int err;
|
||||
|
||||
- if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) {
|
||||
- num_channels = MAX_SUBSTREAMS;
|
||||
- dev_warn(dev, "Illegal num_channels value, will use %u\n",
|
||||
- num_channels);
|
||||
+ err = of_property_read_u32(dev->of_node, "brcm,pwm-channels",
|
||||
+ &numchans);
|
||||
+ if (err) {
|
||||
+ dev_err(dev, "Failed to get DT property 'brcm,pwm-channels'");
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ if (numchans == 0 || numchans > MAX_SUBSTREAMS) {
|
||||
+ numchans = MAX_SUBSTREAMS;
|
||||
+ dev_warn(dev,
|
||||
+ "Illegal 'brcm,pwm-channels' value, will use %u\n",
|
||||
+ numchans);
|
||||
}
|
||||
|
||||
err = bcm2835_devm_add_vchi_ctx(dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- err = snd_add_child_devices(dev, num_channels);
|
||||
+ err = snd_add_child_devices(dev, numchans);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -330,6 +337,12 @@ static int snd_bcm2835_alsa_resume(struc
|
||||
|
||||
#endif
|
||||
|
||||
+static const struct of_device_id snd_bcm2835_of_match_table[] = {
|
||||
+ { .compatible = "brcm,bcm2835-audio",},
|
||||
+ {},
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
|
||||
+
|
||||
static struct platform_driver bcm2835_alsa_driver = {
|
||||
.probe = snd_bcm2835_alsa_probe,
|
||||
#ifdef CONFIG_PM
|
||||
@@ -338,6 +351,7 @@ static struct platform_driver bcm2835_al
|
||||
#endif
|
||||
.driver = {
|
||||
.name = "bcm2835_audio",
|
||||
+ .of_match_table = snd_bcm2835_of_match_table,
|
||||
},
|
||||
};
|
||||
module_platform_driver(bcm2835_alsa_driver);
|
||||
@@ -345,4 +359,3 @@ module_platform_driver(bcm2835_alsa_driv
|
||||
MODULE_AUTHOR("Dom Cobley");
|
||||
MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
|
||||
MODULE_LICENSE("GPL");
|
||||
-MODULE_ALIAS("platform:bcm2835_audio");
|
@ -1,24 +0,0 @@
|
||||
From e61ce76e706cdafe29c9c0e7bbe39bc8af9377ba Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 14 Jul 2015 10:26:09 +0100
|
||||
Subject: [PATCH] spi: spidev: Completely disable the spidev warning
|
||||
|
||||
An alternative strategy would be to use "rpi,spidev" instead, but that
|
||||
would require many Raspberry Pi Device Tree changes.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -759,7 +759,7 @@ static int spidev_probe(struct spi_devic
|
||||
* compatible string, it is a Linux implementation thing
|
||||
* rather than a description of the hardware.
|
||||
*/
|
||||
- WARN(spi->dev.of_node &&
|
||||
+ WARN(0 && spi->dev.of_node &&
|
||||
of_device_is_compatible(spi->dev.of_node, "spidev"),
|
||||
"%pOF: buggy DT: spidev listed directly in DT\n", spi->dev.of_node);
|
||||
|
@ -1,29 +0,0 @@
|
||||
From da6e94edb85fc948357b4163b6ddaa9e75f5e0df Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 23 Feb 2016 17:26:48 +0000
|
||||
Subject: [PATCH] amba_pl011: Don't use DT aliases for numbering
|
||||
|
||||
The pl011 driver looks for DT aliases of the form "serial<n>",
|
||||
and if found uses <n> as the device ID. This can cause
|
||||
/dev/ttyAMA0 to become /dev/ttyAMA1, which is confusing if the
|
||||
other serial port is provided by the 8250 driver which doesn't
|
||||
use the same logic.
|
||||
---
|
||||
drivers/tty/serial/amba-pl011.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/drivers/tty/serial/amba-pl011.c
|
||||
+++ b/drivers/tty/serial/amba-pl011.c
|
||||
@@ -2752,7 +2752,12 @@ static int pl011_setup_port(struct devic
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
+ /* Don't use DT serial<n> aliases - it causes the device to
|
||||
+ be renumbered to ttyAMA1 if it is the second serial port in the
|
||||
+ system, even though the other one is ttyS0. The 8250 driver
|
||||
+ doesn't use this logic, so always remains ttyS0.
|
||||
index = pl011_probe_dt_alias(index, dev);
|
||||
+ */
|
||||
|
||||
uap->old_cr = 0;
|
||||
uap->port.dev = dev;
|
@ -1,86 +0,0 @@
|
||||
From 307744a359bddf354711e54836e4757788c9dfc4 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Wed, 1 Mar 2017 16:07:39 +0000
|
||||
Subject: [PATCH] amba_pl011: Round input clock up
|
||||
|
||||
The UART clock is initialised to be as close to the requested
|
||||
frequency as possible without exceeding it. Now that there is a
|
||||
clock manager that returns the actual frequencies, an expected
|
||||
48MHz clock is reported as 47999625. If the requested baudrate
|
||||
== requested clock/16, there is no headroom and the slight
|
||||
reduction in actual clock rate results in failure.
|
||||
|
||||
Detect cases where it looks like a "round" clock was chosen and
|
||||
adjust the reported clock to match that "round" value. As the
|
||||
code comment says:
|
||||
|
||||
/*
|
||||
* If increasing a clock by less than 0.1% changes it
|
||||
* from ..999.. to ..000.., round up.
|
||||
*/
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/tty/serial/amba-pl011.c | 23 +++++++++++++++++++++--
|
||||
1 file changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/tty/serial/amba-pl011.c
|
||||
+++ b/drivers/tty/serial/amba-pl011.c
|
||||
@@ -1726,6 +1726,23 @@ static void pl011_put_poll_char(struct u
|
||||
|
||||
#endif /* CONFIG_CONSOLE_POLL */
|
||||
|
||||
+unsigned long pl011_clk_round(unsigned long clk)
|
||||
+{
|
||||
+ unsigned long scaler;
|
||||
+
|
||||
+ /*
|
||||
+ * If increasing a clock by less than 0.1% changes it
|
||||
+ * from ..999.. to ..000.., round up.
|
||||
+ */
|
||||
+ scaler = 1;
|
||||
+ while (scaler * 100000 < clk)
|
||||
+ scaler *= 10;
|
||||
+ if ((clk + scaler - 1)/scaler % 1000 == 0)
|
||||
+ clk = (clk/scaler + 1) * scaler;
|
||||
+
|
||||
+ return clk;
|
||||
+}
|
||||
+
|
||||
static int pl011_hwinit(struct uart_port *port)
|
||||
{
|
||||
struct uart_amba_port *uap =
|
||||
@@ -1742,7 +1759,7 @@ static int pl011_hwinit(struct uart_port
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
- uap->port.uartclk = clk_get_rate(uap->clk);
|
||||
+ uap->port.uartclk = pl011_clk_round(clk_get_rate(uap->clk));
|
||||
|
||||
/* Clear pending error and receive interrupts */
|
||||
pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS |
|
||||
@@ -2448,7 +2465,7 @@ static int pl011_console_setup(struct co
|
||||
plat->init();
|
||||
}
|
||||
|
||||
- uap->port.uartclk = clk_get_rate(uap->clk);
|
||||
+ uap->port.uartclk = pl011_clk_round(clk_get_rate(uap->clk));
|
||||
|
||||
if (uap->vendor->fixed_options) {
|
||||
baud = uap->fixed_baud;
|
||||
@@ -2665,6 +2682,7 @@ static struct uart_driver amba_reg = {
|
||||
.cons = AMBA_CONSOLE,
|
||||
};
|
||||
|
||||
+#if 0
|
||||
static int pl011_probe_dt_alias(int index, struct device *dev)
|
||||
{
|
||||
struct device_node *np;
|
||||
@@ -2696,6 +2714,7 @@ static int pl011_probe_dt_alias(int inde
|
||||
|
||||
return ret;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* unregisters the driver also if no more ports are left */
|
||||
static void pl011_unregister_port(struct uart_amba_port *uap)
|
@ -1,209 +0,0 @@
|
||||
From 784d9bd9e4fecb27ceb3a0d0375dc13d1f35e44c Mon Sep 17 00:00:00 2001
|
||||
From: Harm Hanemaaijer <fgenfb@yahoo.com>
|
||||
Date: Thu, 20 Jun 2013 20:21:39 +0200
|
||||
Subject: [PATCH] Speed up console framebuffer imageblit function
|
||||
|
||||
Especially on platforms with a slower CPU but a relatively high
|
||||
framebuffer fill bandwidth, like current ARM devices, the existing
|
||||
console monochrome imageblit function used to draw console text is
|
||||
suboptimal for common pixel depths such as 16bpp and 32bpp. The existing
|
||||
code is quite general and can deal with several pixel depths. By creating
|
||||
special case functions for 16bpp and 32bpp, by far the most common pixel
|
||||
formats used on modern systems, a significant speed-up is attained
|
||||
which can be readily felt on ARM-based devices like the Raspberry Pi
|
||||
and the Allwinner platform, but should help any platform using the
|
||||
fb layer.
|
||||
|
||||
The special case functions allow constant folding, eliminating a number
|
||||
of instructions including divide operations, and allow the use of an
|
||||
unrolled loop, eliminating instructions with a variable shift size,
|
||||
reducing source memory access instructions, and eliminating excessive
|
||||
branching. These unrolled loops also allow much better code optimization
|
||||
by the C compiler. The code that selects which optimized variant is used
|
||||
is also simplified, eliminating integer divide instructions.
|
||||
|
||||
The speed-up, measured by timing 'cat file.txt' in the console, varies
|
||||
between 40% and 70%, when testing on the Raspberry Pi and Allwinner
|
||||
ARM-based platforms, depending on font size and the pixel depth, with
|
||||
the greater benefit for 32bpp.
|
||||
|
||||
Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
|
||||
---
|
||||
drivers/video/fbdev/core/cfbimgblt.c | 152 ++++++++++++++++++++++++++-
|
||||
1 file changed, 147 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/video/fbdev/core/cfbimgblt.c
|
||||
+++ b/drivers/video/fbdev/core/cfbimgblt.c
|
||||
@@ -28,6 +28,11 @@
|
||||
*
|
||||
* Also need to add code to deal with cards endians that are different than
|
||||
* the native cpu endians. I also need to deal with MSB position in the word.
|
||||
+ * Modified by Harm Hanemaaijer (fgenfb@yahoo.com) 2013:
|
||||
+ * - Provide optimized versions of fast_imageblit for 16 and 32bpp that are
|
||||
+ * significantly faster than the previous implementation.
|
||||
+ * - Simplify the fast/slow_imageblit selection code, avoiding integer
|
||||
+ * divides.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/string.h>
|
||||
@@ -262,6 +267,133 @@ static inline void fast_imageblit(const
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Optimized fast_imageblit for bpp == 16. ppw = 2, bit_mask = 3 folded
|
||||
+ * into the code, main loop unrolled.
|
||||
+ */
|
||||
+
|
||||
+static inline void fast_imageblit16(const struct fb_image *image,
|
||||
+ struct fb_info *p, u8 __iomem * dst1,
|
||||
+ u32 fgcolor, u32 bgcolor)
|
||||
+{
|
||||
+ u32 fgx = fgcolor, bgx = bgcolor;
|
||||
+ u32 spitch = (image->width + 7) / 8;
|
||||
+ u32 end_mask, eorx;
|
||||
+ const char *s = image->data, *src;
|
||||
+ u32 __iomem *dst;
|
||||
+ const u32 *tab = NULL;
|
||||
+ int i, j, k;
|
||||
+
|
||||
+ tab = fb_be_math(p) ? cfb_tab16_be : cfb_tab16_le;
|
||||
+
|
||||
+ fgx <<= 16;
|
||||
+ bgx <<= 16;
|
||||
+ fgx |= fgcolor;
|
||||
+ bgx |= bgcolor;
|
||||
+
|
||||
+ eorx = fgx ^ bgx;
|
||||
+ k = image->width / 2;
|
||||
+
|
||||
+ for (i = image->height; i--;) {
|
||||
+ dst = (u32 __iomem *) dst1;
|
||||
+ src = s;
|
||||
+
|
||||
+ j = k;
|
||||
+ while (j >= 4) {
|
||||
+ u8 bits = *src;
|
||||
+ end_mask = tab[(bits >> 6) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 4) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 2) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[bits & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ src++;
|
||||
+ j -= 4;
|
||||
+ }
|
||||
+ if (j != 0) {
|
||||
+ u8 bits = *src;
|
||||
+ end_mask = tab[(bits >> 6) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ if (j >= 2) {
|
||||
+ end_mask = tab[(bits >> 4) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ if (j == 3) {
|
||||
+ end_mask = tab[(bits >> 2) & 3];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ dst1 += p->fix.line_length;
|
||||
+ s += spitch;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Optimized fast_imageblit for bpp == 32. ppw = 1, bit_mask = 1 folded
|
||||
+ * into the code, main loop unrolled.
|
||||
+ */
|
||||
+
|
||||
+static inline void fast_imageblit32(const struct fb_image *image,
|
||||
+ struct fb_info *p, u8 __iomem * dst1,
|
||||
+ u32 fgcolor, u32 bgcolor)
|
||||
+{
|
||||
+ u32 fgx = fgcolor, bgx = bgcolor;
|
||||
+ u32 spitch = (image->width + 7) / 8;
|
||||
+ u32 end_mask, eorx;
|
||||
+ const char *s = image->data, *src;
|
||||
+ u32 __iomem *dst;
|
||||
+ const u32 *tab = NULL;
|
||||
+ int i, j, k;
|
||||
+
|
||||
+ tab = cfb_tab32;
|
||||
+
|
||||
+ eorx = fgx ^ bgx;
|
||||
+ k = image->width;
|
||||
+
|
||||
+ for (i = image->height; i--;) {
|
||||
+ dst = (u32 __iomem *) dst1;
|
||||
+ src = s;
|
||||
+
|
||||
+ j = k;
|
||||
+ while (j >= 8) {
|
||||
+ u8 bits = *src;
|
||||
+ end_mask = tab[(bits >> 7) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 6) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 5) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 4) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 3) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 2) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[(bits >> 1) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ end_mask = tab[bits & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ src++;
|
||||
+ j -= 8;
|
||||
+ }
|
||||
+ if (j != 0) {
|
||||
+ u32 bits = (u32) * src;
|
||||
+ while (j > 1) {
|
||||
+ end_mask = tab[(bits >> 7) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst++);
|
||||
+ bits <<= 1;
|
||||
+ j--;
|
||||
+ }
|
||||
+ end_mask = tab[(bits >> 7) & 1];
|
||||
+ FB_WRITEL((end_mask & eorx) ^ bgx, dst);
|
||||
+ }
|
||||
+ dst1 += p->fix.line_length;
|
||||
+ s += spitch;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void cfb_imageblit(struct fb_info *p, const struct fb_image *image)
|
||||
{
|
||||
u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0;
|
||||
@@ -294,11 +426,21 @@ void cfb_imageblit(struct fb_info *p, co
|
||||
bgcolor = image->bg_color;
|
||||
}
|
||||
|
||||
- if (32 % bpp == 0 && !start_index && !pitch_index &&
|
||||
- ((width & (32/bpp-1)) == 0) &&
|
||||
- bpp >= 8 && bpp <= 32)
|
||||
- fast_imageblit(image, p, dst1, fgcolor, bgcolor);
|
||||
- else
|
||||
+ if (!start_index && !pitch_index) {
|
||||
+ if (bpp == 32)
|
||||
+ fast_imageblit32(image, p, dst1, fgcolor,
|
||||
+ bgcolor);
|
||||
+ else if (bpp == 16 && (width & 1) == 0)
|
||||
+ fast_imageblit16(image, p, dst1, fgcolor,
|
||||
+ bgcolor);
|
||||
+ else if (bpp == 8 && (width & 3) == 0)
|
||||
+ fast_imageblit(image, p, dst1, fgcolor,
|
||||
+ bgcolor);
|
||||
+ else
|
||||
+ slow_imageblit(image, p, dst1, fgcolor,
|
||||
+ bgcolor,
|
||||
+ start_index, pitch_index);
|
||||
+ } else
|
||||
slow_imageblit(image, p, dst1, fgcolor, bgcolor,
|
||||
start_index, pitch_index);
|
||||
} else
|
@ -1,57 +0,0 @@
|
||||
From 03a2b2dc2c01a00838b83b6843c086230847239f Mon Sep 17 00:00:00 2001
|
||||
From: Nick Bulleid <nedbulleid@fastmail.com>
|
||||
Date: Thu, 10 May 2018 21:57:02 +0100
|
||||
Subject: [PATCH] Add ability to export gpio used by gpio-poweroff
|
||||
|
||||
Signed-off-by: Nick Bulleid <nedbulleid@fastmail.com>
|
||||
|
||||
Added export feature to gpio-poweroff documentation
|
||||
|
||||
Signed-off-by: Nick Bulleid <nedbulleid@fastmail.com>
|
||||
---
|
||||
.../devicetree/bindings/power/reset/gpio-poweroff.txt | 1 +
|
||||
drivers/power/reset/gpio-poweroff.c | 9 +++++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
--- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
|
||||
+++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
|
||||
@@ -31,6 +31,7 @@ Optional properties:
|
||||
- inactive-delay-ms: Delay (default 100) to wait after driving gpio inactive
|
||||
- timeout-ms: Time to wait before asserting a WARN_ON(1). If nothing is
|
||||
specified, 3000 ms is used.
|
||||
+- export : Export the GPIO line to the sysfs system
|
||||
|
||||
Examples:
|
||||
|
||||
--- a/drivers/power/reset/gpio-poweroff.c
|
||||
+++ b/drivers/power/reset/gpio-poweroff.c
|
||||
@@ -51,6 +51,7 @@ static int gpio_poweroff_probe(struct pl
|
||||
bool input = false;
|
||||
enum gpiod_flags flags;
|
||||
bool force = false;
|
||||
+ bool export = false;
|
||||
|
||||
/* If a pm_power_off function has already been added, leave it alone */
|
||||
force = of_property_read_bool(pdev->dev.of_node, "force");
|
||||
@@ -76,6 +77,12 @@ static int gpio_poweroff_probe(struct pl
|
||||
if (IS_ERR(reset_gpio))
|
||||
return PTR_ERR(reset_gpio);
|
||||
|
||||
+ export = of_property_read_bool(pdev->dev.of_node, "export");
|
||||
+ if (export) {
|
||||
+ gpiod_export(reset_gpio, false);
|
||||
+ gpiod_export_link(&pdev->dev, "poweroff-gpio", reset_gpio);
|
||||
+ }
|
||||
+
|
||||
pm_power_off = &gpio_poweroff_do_poweroff;
|
||||
return 0;
|
||||
}
|
||||
@@ -85,6 +92,8 @@ static int gpio_poweroff_remove(struct p
|
||||
if (pm_power_off == &gpio_poweroff_do_poweroff)
|
||||
pm_power_off = NULL;
|
||||
|
||||
+ gpiod_unexport(reset_gpio);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,114 +0,0 @@
|
||||
From bf71202ee22c77b2dd594d56a411dec94a0f7436 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Thu, 14 Jun 2018 15:07:26 +0100
|
||||
Subject: [PATCH] of: configfs: Use of_overlay_fdt_apply API call
|
||||
|
||||
The published API to the dynamic overlay application mechanism now
|
||||
takes a Flattened Device Tree blob as input so that it can manage the
|
||||
lifetime of the unflattened tree. Conveniently, the new API call -
|
||||
of_overlay_fdt_apply - is virtually a drop-in replacement for
|
||||
create_overlay, which can now be deleted.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/of/configfs.c | 47 +++++++------------------------------------
|
||||
1 file changed, 7 insertions(+), 40 deletions(-)
|
||||
|
||||
--- a/drivers/of/configfs.c
|
||||
+++ b/drivers/of/configfs.c
|
||||
@@ -40,41 +40,6 @@ struct cfs_overlay_item {
|
||||
int dtbo_size;
|
||||
};
|
||||
|
||||
-static int create_overlay(struct cfs_overlay_item *overlay, void *blob)
|
||||
-{
|
||||
- int err;
|
||||
-
|
||||
- /* unflatten the tree */
|
||||
- of_fdt_unflatten_tree(blob, NULL, &overlay->overlay);
|
||||
- if (overlay->overlay == NULL) {
|
||||
- pr_err("%s: failed to unflatten tree\n", __func__);
|
||||
- err = -EINVAL;
|
||||
- goto out_err;
|
||||
- }
|
||||
- pr_debug("%s: unflattened OK\n", __func__);
|
||||
-
|
||||
- /* mark it as detached */
|
||||
- of_node_set_flag(overlay->overlay, OF_DETACHED);
|
||||
-
|
||||
- /* perform resolution */
|
||||
- err = of_resolve_phandles(overlay->overlay);
|
||||
- if (err != 0) {
|
||||
- pr_err("%s: Failed to resolve tree\n", __func__);
|
||||
- goto out_err;
|
||||
- }
|
||||
- pr_debug("%s: resolved OK\n", __func__);
|
||||
-
|
||||
- err = of_overlay_apply(overlay->overlay, &overlay->ov_id);
|
||||
- if (err < 0) {
|
||||
- pr_err("%s: Failed to create overlay (err=%d)\n",
|
||||
- __func__, err);
|
||||
- goto out_err;
|
||||
- }
|
||||
-
|
||||
-out_err:
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
static inline struct cfs_overlay_item *to_cfs_overlay_item(
|
||||
struct config_item *item)
|
||||
{
|
||||
@@ -115,7 +80,8 @@ static ssize_t cfs_overlay_item_path_sto
|
||||
if (err != 0)
|
||||
goto out_err;
|
||||
|
||||
- err = create_overlay(overlay, (void *)overlay->fw->data);
|
||||
+ err = of_overlay_fdt_apply((void *)overlay->fw->data,
|
||||
+ (u32)overlay->fw->size, &overlay->ov_id);
|
||||
if (err != 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -136,7 +102,7 @@ static ssize_t cfs_overlay_item_status_s
|
||||
struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
|
||||
return sprintf(page, "%s\n",
|
||||
- overlay->ov_id >= 0 ? "applied" : "unapplied");
|
||||
+ overlay->ov_id > 0 ? "applied" : "unapplied");
|
||||
}
|
||||
|
||||
CONFIGFS_ATTR(cfs_overlay_item_, path);
|
||||
@@ -188,7 +154,8 @@ ssize_t cfs_overlay_item_dtbo_write(stru
|
||||
|
||||
overlay->dtbo_size = count;
|
||||
|
||||
- err = create_overlay(overlay, overlay->dtbo);
|
||||
+ err = of_overlay_fdt_apply(overlay->dtbo, overlay->dtbo_size,
|
||||
+ &overlay->ov_id);
|
||||
if (err != 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -198,6 +165,7 @@ out_err:
|
||||
kfree(overlay->dtbo);
|
||||
overlay->dtbo = NULL;
|
||||
overlay->dtbo_size = 0;
|
||||
+ overlay->ov_id = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -213,7 +181,7 @@ static void cfs_overlay_release(struct c
|
||||
{
|
||||
struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
|
||||
- if (overlay->ov_id >= 0)
|
||||
+ if (overlay->ov_id > 0)
|
||||
of_overlay_remove(&overlay->ov_id);
|
||||
if (overlay->fw)
|
||||
release_firmware(overlay->fw);
|
||||
@@ -241,7 +209,6 @@ static struct config_item *cfs_overlay_g
|
||||
overlay = kzalloc(sizeof(*overlay), GFP_KERNEL);
|
||||
if (!overlay)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
- overlay->ov_id = -1;
|
||||
|
||||
config_item_init_type_name(&overlay->item, name, &cfs_overlay_type);
|
||||
return &overlay->item;
|
@ -1,23 +0,0 @@
|
||||
From c625bcbb6a4c45e29c7c2c0dec24831025051032 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 6 Nov 2018 12:57:48 +0000
|
||||
Subject: [PATCH] sc16is7xx: Don't spin if no data received
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/2676
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/tty/serial/sc16is7xx.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/tty/serial/sc16is7xx.c
|
||||
+++ b/drivers/tty/serial/sc16is7xx.c
|
||||
@@ -709,6 +709,8 @@ static bool sc16is7xx_port_irq(struct sc
|
||||
|
||||
if (rxlen)
|
||||
sc16is7xx_handle_rx(port, rxlen, iir);
|
||||
+ else
|
||||
+ return false;
|
||||
break;
|
||||
case SC16IS7XX_IIR_THRI_SRC:
|
||||
sc16is7xx_handle_tx(port);
|
@ -1,47 +0,0 @@
|
||||
From d6fafd1bfe1388aee8e7294fb663d0054d77ea34 Mon Sep 17 00:00:00 2001
|
||||
From: James Hughes <JamesH65@users.noreply.github.com>
|
||||
Date: Fri, 2 Nov 2018 11:55:49 +0000
|
||||
Subject: [PATCH] Update issue templates (#2736)
|
||||
|
||||
---
|
||||
.github/ISSUE_TEMPLATE/bug_report.md | 34 ++++++++++++++++++++++++++++
|
||||
1 file changed, 34 insertions(+)
|
||||
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
|
||||
|
||||
--- /dev/null
|
||||
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
|
||||
@@ -0,0 +1,34 @@
|
||||
+---
|
||||
+name: Bug report
|
||||
+about: Create a report to help us fix your issue
|
||||
+
|
||||
+---
|
||||
+
|
||||
+**Is this the right place for my bug report?**
|
||||
+This repository contains the Linux kernel used on the Raspberry Pi. If you believe that the issue you are seeing is kernel-related, this is the right place. If not, we have other repositories for the GPU firmware at [github.com/raspberrypi/firmware](https://github.com/raspberrypi/firmware) and Raspberry Pi userland applications at [github.com/raspberrypi/userland](https://github.com/raspberrypi/userland). If you have problems with the Raspbian distribution packages, report them in the [github.com/RPi-Distro/repo](https://github.com/RPi-Distro/repo). If you simply have a question, then [the Raspberry Pi forums](https://www.raspberrypi.org/forums) are the best place to ask it.
|
||||
+
|
||||
+**Describe the bug**
|
||||
+Add a clear and concise description of what you think the bug is.
|
||||
+
|
||||
+**To reproduce**
|
||||
+List the steps required to reproduce the issue.
|
||||
+
|
||||
+**Expected behaviour**
|
||||
+Add a clear and concise description of what you expected to happen.
|
||||
+
|
||||
+**Actual behaviour**
|
||||
+Add a clear and concise description of what actually happened.
|
||||
+
|
||||
+**System**
|
||||
+ Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
|
||||
+
|
||||
+* Which model of Raspberry Pi? e.g. Pi3B+, PiZeroW
|
||||
+* Which OS and version (`cat /etc/rpi-issue`)?
|
||||
+* Which firmware version (`vcgencmd version`)?
|
||||
+* Which kernel version (`uname -a`)?
|
||||
+
|
||||
+**Logs**
|
||||
+If applicable, add the relevant output from `dmesg` or similar.
|
||||
+
|
||||
+**Additional context**
|
||||
+Add any other relevant context for the problem.
|
@ -1,50 +0,0 @@
|
||||
From aaf2a1e8450ce447683d3a7daec5644e72252db8 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Howard <phil@gadgetoid.com>
|
||||
Date: Fri, 29 Mar 2019 10:53:14 +0000
|
||||
Subject: [PATCH] rtc: rv3028: Add backup switchover mode support
|
||||
|
||||
Signed-off-by: Phil Howard <phil@pimoroni.com>
|
||||
---
|
||||
drivers/rtc/rtc-rv3028.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
--- a/drivers/rtc/rtc-rv3028.c
|
||||
+++ b/drivers/rtc/rtc-rv3028.c
|
||||
@@ -80,6 +80,7 @@
|
||||
|
||||
#define RV3028_BACKUP_TCE BIT(5)
|
||||
#define RV3028_BACKUP_TCR_MASK GENMASK(1,0)
|
||||
+#define RV3028_BACKUP_BSM_MASK 0x0C
|
||||
|
||||
#define OFFSET_STEP_PPT 953674
|
||||
|
||||
@@ -789,6 +790,7 @@ static int rv3028_probe(struct i2c_clien
|
||||
struct rv3028_data *rv3028;
|
||||
int ret, status;
|
||||
u32 ohms;
|
||||
+ u8 bsm;
|
||||
struct nvmem_config nvmem_cfg = {
|
||||
.name = "rv3028_nvram",
|
||||
.word_size = 1,
|
||||
@@ -855,6 +857,21 @@ static int rv3028_probe(struct i2c_clien
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ /* setup backup switchover mode */
|
||||
+ if (!device_property_read_u8(&client->dev, "backup-switchover-mode",
|
||||
+ &bsm)) {
|
||||
+ if (bsm <= 3) {
|
||||
+ ret = regmap_update_bits(rv3028->regmap, RV3028_BACKUP,
|
||||
+ RV3028_BACKUP_BSM_MASK,
|
||||
+ (bsm & 0x03) << 2);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ } else {
|
||||
+ dev_warn(&client->dev, "invalid backup switchover mode value\n");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* setup trickle charger */
|
||||
if (!device_property_read_u32(&client->dev, "trickle-resistor-ohms",
|
||||
&ohms)) {
|
@ -1,23 +0,0 @@
|
||||
From 0b3302cebb33cb64e4cff1c01996b61cec44fc0e Mon Sep 17 00:00:00 2001
|
||||
From: P33M <p33m@github.com>
|
||||
Date: Thu, 2 May 2019 11:53:45 +0100
|
||||
Subject: [PATCH] lan78xx: use default alignment for rx buffers
|
||||
|
||||
The lan78xx uses a 12-byte hardware rx header, so there is no need
|
||||
to allocate SKBs with NET_IP_ALIGN set. Removes alignment faults
|
||||
in both dwc_otg and in ipv6 processing.
|
||||
---
|
||||
drivers/net/usb/lan78xx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/usb/lan78xx.c
|
||||
+++ b/drivers/net/usb/lan78xx.c
|
||||
@@ -3502,7 +3502,7 @@ static int rx_submit(struct lan78xx_net
|
||||
size_t size = dev->rx_urb_size;
|
||||
int ret = 0;
|
||||
|
||||
- skb = netdev_alloc_skb_ip_align(dev->net, size);
|
||||
+ skb = netdev_alloc_skb(dev->net, size);
|
||||
if (!skb) {
|
||||
usb_free_urb(urb);
|
||||
return -ENOMEM;
|
@ -1,74 +0,0 @@
|
||||
From 31fe8b118083aa6caff216fa476ae2393c49df27 Mon Sep 17 00:00:00 2001
|
||||
From: Philipp Zabel <p.zabel@pengutronix.de>
|
||||
Date: Thu, 21 Sep 2017 17:30:24 +0200
|
||||
Subject: [PATCH] media: tc358743: fix connected/active CSI-2 lane
|
||||
reporting
|
||||
|
||||
g_mbus_config was supposed to indicate all supported lane numbers, not
|
||||
only the number of those currently in active use. Since the TC358743
|
||||
can dynamically reduce the number of active lanes if the required
|
||||
bandwidth allows for it, report all lane numbers up to the connected
|
||||
number of lanes as supported in pdata mode.
|
||||
In device tree mode, do not report lane count and clock mode at all, as
|
||||
the receiver driver can determine these from the device tree.
|
||||
|
||||
To allow communicating the number of currently active lanes, add a new
|
||||
bitfield to the v4l2_mbus_config flags. This is a temporary fix, to be
|
||||
used only until a better solution is found.
|
||||
|
||||
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
|
||||
---
|
||||
drivers/media/i2c/tc358743.c | 14 ++++++++++++--
|
||||
include/media/v4l2-mediabus.h | 8 ++++++++
|
||||
2 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/media/i2c/tc358743.c
|
||||
+++ b/drivers/media/i2c/tc358743.c
|
||||
@@ -1609,11 +1609,20 @@ static int tc358743_get_mbus_config(stru
|
||||
struct v4l2_mbus_config *cfg)
|
||||
{
|
||||
struct tc358743_state *state = to_state(sd);
|
||||
+ const u32 mask = V4L2_MBUS_CSI2_LANE_MASK;
|
||||
+
|
||||
+ if (state->csi_lanes_in_use > state->bus.num_data_lanes)
|
||||
+ return -EINVAL;
|
||||
|
||||
cfg->type = V4L2_MBUS_CSI2_DPHY;
|
||||
+ cfg->flags = (state->csi_lanes_in_use << __ffs(mask)) & mask;
|
||||
+
|
||||
+ /* In DT mode, only report the number of active lanes */
|
||||
+ if (sd->dev->of_node)
|
||||
+ return 0;
|
||||
|
||||
- /* Support for non-continuous CSI-2 clock is missing in the driver */
|
||||
- cfg->flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
|
||||
+ /* Support for non-continuous CSI-2 clock is missing in pdate mode */
|
||||
+ cfg->flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
|
||||
|
||||
switch (state->csi_lanes_in_use) {
|
||||
case 1:
|
||||
@@ -2056,6 +2065,7 @@ static int tc358743_probe(struct i2c_cli
|
||||
if (pdata) {
|
||||
state->pdata = *pdata;
|
||||
state->bus.flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
|
||||
+ state->bus.num_data_lanes = 4;
|
||||
} else {
|
||||
err = tc358743_probe_of(state);
|
||||
if (err == -ENODEV)
|
||||
--- a/include/media/v4l2-mediabus.h
|
||||
+++ b/include/media/v4l2-mediabus.h
|
||||
@@ -92,6 +92,14 @@
|
||||
V4L2_MBUS_CSI2_CHANNEL_1 | \
|
||||
V4L2_MBUS_CSI2_CHANNEL_2 | \
|
||||
V4L2_MBUS_CSI2_CHANNEL_3)
|
||||
+/*
|
||||
+ * Number of lanes in use, 0 == use all available lanes (default)
|
||||
+ *
|
||||
+ * This is a temporary fix for devices that need to reduce the number of active
|
||||
+ * lanes for certain modes, until g_mbus_config() can be replaced with a better
|
||||
+ * solution.
|
||||
+ */
|
||||
+#define V4L2_MBUS_CSI2_LANE_MASK (0xf << 10)
|
||||
|
||||
/**
|
||||
* enum v4l2_mbus_type - media bus type
|
@ -1,35 +0,0 @@
|
||||
From 81a2bf6bf59e24bac2c9bc6b4a76ecea74d80a11 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sperl <kernel@martin.sperl.org>
|
||||
Date: Mon, 13 May 2019 11:05:27 +0000
|
||||
Subject: [PATCH] spi: bcm2835: enable shared interrupt support
|
||||
|
||||
Add shared interrupt support for this driver.
|
||||
|
||||
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
|
||||
---
|
||||
drivers/spi/spi-bcm2835.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-bcm2835.c
|
||||
+++ b/drivers/spi/spi-bcm2835.c
|
||||
@@ -384,6 +384,10 @@ static irqreturn_t bcm2835_spi_interrupt
|
||||
if (bs->tx_len && cs & BCM2835_SPI_CS_DONE)
|
||||
bcm2835_wr_fifo_blind(bs, BCM2835_SPI_FIFO_SIZE);
|
||||
|
||||
+ /* check if we got interrupt enabled */
|
||||
+ if (!(bcm2835_rd(bs, BCM2835_SPI_CS) & BCM2835_SPI_CS_INTR))
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
/* Read as many bytes as possible from FIFO */
|
||||
bcm2835_rd_fifo(bs);
|
||||
/* Write as many bytes as possible to FIFO */
|
||||
@@ -1369,7 +1373,8 @@ static int bcm2835_spi_probe(struct plat
|
||||
bcm2835_wr(bs, BCM2835_SPI_CS,
|
||||
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
|
||||
|
||||
- err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
|
||||
+ err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt,
|
||||
+ IRQF_SHARED,
|
||||
dev_name(&pdev->dev), bs);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
|
@ -1,102 +0,0 @@
|
||||
From 9c20d47206de1b7ac78c8186dbb717751100eac6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Fri, 11 Jan 2019 17:31:07 -0800
|
||||
Subject: [PATCH] soc: bcm: bcm2835-pm: Add support for 2711.
|
||||
|
||||
Without the actual power management part any more, there's a lot less
|
||||
to set up for V3D. We just need to clear the RSTN field for the power
|
||||
domain, and expose the reset controller for toggling it again.
|
||||
|
||||
This is definitely incomplete -- the old ISP and H264 is in the old
|
||||
bridge, but since we have no consumers of it I've just done the
|
||||
minimum to get V3D working.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/mfd/bcm2835-pm.c | 11 +++++++++++
|
||||
drivers/soc/bcm/bcm2835-power.c | 22 ++++++++++++++++++++++
|
||||
include/linux/mfd/bcm2835-pm.h | 1 +
|
||||
3 files changed, 34 insertions(+)
|
||||
|
||||
--- a/drivers/mfd/bcm2835-pm.c
|
||||
+++ b/drivers/mfd/bcm2835-pm.c
|
||||
@@ -50,6 +50,17 @@ static int bcm2835_pm_probe(struct platf
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ /* Map the ARGON ASB regs if present. */
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
|
||||
+ if (res) {
|
||||
+ pm->arg_asb = devm_ioremap_resource(dev, res);
|
||||
+ if (IS_ERR(pm->arg_asb)) {
|
||||
+ dev_err(dev, "Failed to map ARGON ASB: %ld\n",
|
||||
+ PTR_ERR(pm->arg_asb));
|
||||
+ return PTR_ERR(pm->arg_asb);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* We'll use the presence of the AXI ASB regs in the
|
||||
* bcm2835-pm binding as the key for whether we can reference
|
||||
* the full PM register range and support power domains.
|
||||
--- a/drivers/soc/bcm/bcm2835-power.c
|
||||
+++ b/drivers/soc/bcm/bcm2835-power.c
|
||||
@@ -143,6 +143,8 @@ struct bcm2835_power {
|
||||
/* AXI Async bridge registers. */
|
||||
void __iomem *asb;
|
||||
|
||||
+ bool is_2711;
|
||||
+
|
||||
struct genpd_onecell_data pd_xlate;
|
||||
struct bcm2835_power_domain domains[BCM2835_POWER_DOMAIN_COUNT];
|
||||
struct reset_controller_dev reset;
|
||||
@@ -192,6 +194,10 @@ static int bcm2835_power_power_off(struc
|
||||
{
|
||||
struct bcm2835_power *power = pd->power;
|
||||
|
||||
+ /* 2711 has no power domains above the reset controller. */
|
||||
+ if (power->is_2711)
|
||||
+ return 0;
|
||||
+
|
||||
/* Enable functional isolation */
|
||||
PM_WRITE(pm_reg, PM_READ(pm_reg) & ~PM_ISFUNC);
|
||||
|
||||
@@ -213,6 +219,10 @@ static int bcm2835_power_power_on(struct
|
||||
int inrush;
|
||||
bool powok;
|
||||
|
||||
+ /* 2711 has no power domains above the reset controller. */
|
||||
+ if (power->is_2711)
|
||||
+ return 0;
|
||||
+
|
||||
/* If it was already powered on by the fw, leave it that way. */
|
||||
if (PM_READ(pm_reg) & PM_POWUP)
|
||||
return 0;
|
||||
@@ -627,6 +637,18 @@ static int bcm2835_power_probe(struct pl
|
||||
power->base = pm->base;
|
||||
power->asb = pm->asb;
|
||||
|
||||
+ /* 2711 hack: the new ARGON ASB took over V3D, which is our
|
||||
+ * only consumer of this driver so far. The old ASB seems to
|
||||
+ * still be present with ISP and H264 bits but no V3D, but I
|
||||
+ * don't know if that's real or not. The V3D is in the same
|
||||
+ * place in the new ASB as the old one, so just poke the new
|
||||
+ * one for now.
|
||||
+ */
|
||||
+ if (pm->arg_asb) {
|
||||
+ power->asb = pm->arg_asb;
|
||||
+ power->is_2711 = true;
|
||||
+ }
|
||||
+
|
||||
id = ASB_READ(ASB_AXI_BRDG_ID);
|
||||
if (id != 0x62726467 /* "BRDG" */) {
|
||||
dev_err(dev, "ASB register ID returned 0x%08x\n", id);
|
||||
--- a/include/linux/mfd/bcm2835-pm.h
|
||||
+++ b/include/linux/mfd/bcm2835-pm.h
|
||||
@@ -9,6 +9,7 @@ struct bcm2835_pm {
|
||||
struct device *dev;
|
||||
void __iomem *base;
|
||||
void __iomem *asb;
|
||||
+ void __iomem *arg_asb;
|
||||
};
|
||||
|
||||
#endif /* BCM2835_MFD_PM_H */
|
@ -1,20 +0,0 @@
|
||||
From c9c8772ef6ae86678a793d168129866bdc0a92cc Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Thu, 4 Oct 2018 17:22:43 -0700
|
||||
Subject: [PATCH] drm/v3d: Add support for 2711.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/gpu/drm/v3d/v3d_drv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
@@ -199,6 +199,7 @@ static const struct drm_driver v3d_drm_d
|
||||
static const struct of_device_id v3d_of_match[] = {
|
||||
{ .compatible = "brcm,7268-v3d" },
|
||||
{ .compatible = "brcm,7278-v3d" },
|
||||
+ { .compatible = "brcm,2711-v3d" },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, v3d_of_match);
|
@ -1,52 +0,0 @@
|
||||
From 15d0d4bb7c817c3cbcdb276d911b9e93a0c825e9 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Mon, 14 Jan 2019 12:35:43 -0800
|
||||
Subject: [PATCH] drm/v3d: Skip MMU flush if the device is currently
|
||||
off.
|
||||
|
||||
If it's off, we know it will be reset on poweron, so the MMU won't
|
||||
have any TLB cached from before this point. Avoids failed waits for
|
||||
MMU flush to reply.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
(cherry picked from commit 3ee4e2e0a9e9587eacbb69b067bbc72ab2cdc47b)
|
||||
---
|
||||
drivers/gpu/drm/v3d/v3d_mmu.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_mmu.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_mmu.c
|
||||
@@ -18,6 +18,8 @@
|
||||
* each client. This is not yet implemented.
|
||||
*/
|
||||
|
||||
+#include <linux/pm_runtime.h>
|
||||
+
|
||||
#include "v3d_drv.h"
|
||||
#include "v3d_regs.h"
|
||||
|
||||
@@ -34,6 +36,14 @@ static int v3d_mmu_flush_all(struct v3d_
|
||||
{
|
||||
int ret;
|
||||
|
||||
+ /* Keep power on the device on until we're done with this
|
||||
+ * call, but skip the flush if the device is off and will be
|
||||
+ * reset when powered back on.
|
||||
+ */
|
||||
+ ret = pm_runtime_get_if_in_use(v3d->dev);
|
||||
+ if (ret == 0)
|
||||
+ return 0;
|
||||
+
|
||||
/* Make sure that another flush isn't already running when we
|
||||
* start this one.
|
||||
*/
|
||||
@@ -61,6 +71,9 @@ static int v3d_mmu_flush_all(struct v3d_
|
||||
if (ret)
|
||||
dev_err(v3d->drm.dev, "MMUC flush wait idle failed\n");
|
||||
|
||||
+ pm_runtime_mark_last_busy(v3d->dev);
|
||||
+ pm_runtime_put_autosuspend(v3d->dev);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,68 +0,0 @@
|
||||
From 9d058ec3839e19637efc1957cdbbdafd69878acb Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Mon, 14 Jan 2019 14:47:57 -0800
|
||||
Subject: [PATCH] drm/v3d: Hook up the runtime PM ops.
|
||||
|
||||
In translating the runtime PM code from vc4, I missed the ".pm"
|
||||
assignment to actually connect them up. Fixes missing MMU setup if
|
||||
runtime PM resets V3D.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
(cherry picked from commit ca197699af29baa8236c74c53d4904ca8957ee06)
|
||||
---
|
||||
drivers/gpu/drm/v3d/v3d_drv.c | 37 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
@@ -38,6 +38,42 @@
|
||||
#define DRIVER_MINOR 0
|
||||
#define DRIVER_PATCHLEVEL 0
|
||||
|
||||
+#ifdef CONFIG_PM
|
||||
+static int v3d_runtime_suspend(struct device *dev)
|
||||
+{
|
||||
+ struct drm_device *drm = dev_get_drvdata(dev);
|
||||
+ struct v3d_dev *v3d = to_v3d_dev(drm);
|
||||
+
|
||||
+ v3d_irq_disable(v3d);
|
||||
+
|
||||
+ clk_disable_unprepare(v3d->clk);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int v3d_runtime_resume(struct device *dev)
|
||||
+{
|
||||
+ struct drm_device *drm = dev_get_drvdata(dev);
|
||||
+ struct v3d_dev *v3d = to_v3d_dev(drm);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = clk_prepare_enable(v3d->clk);
|
||||
+ if (ret != 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* XXX: VPM base */
|
||||
+
|
||||
+ v3d_mmu_set_page_table(v3d);
|
||||
+ v3d_irq_enable(v3d);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static const struct dev_pm_ops v3d_pm_ops = {
|
||||
+ SET_RUNTIME_PM_OPS(v3d_runtime_suspend, v3d_runtime_resume, NULL)
|
||||
+};
|
||||
+
|
||||
static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
@@ -332,6 +368,7 @@ static struct platform_driver v3d_platfo
|
||||
.driver = {
|
||||
.name = "v3d",
|
||||
.of_match_table = v3d_of_match,
|
||||
+ .pm = &v3d_pm_ops,
|
||||
},
|
||||
};
|
||||
|
@ -1,109 +0,0 @@
|
||||
From b0f7366704c0da4e0be8f8df887378717acf135b Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Mon, 14 Jan 2019 15:13:17 -0800
|
||||
Subject: [PATCH] drm/v3d: HACK: gut runtime pm for now.
|
||||
|
||||
Something is still unstable -- on starting a new glxgears from an idle
|
||||
X11, I get an MMU violation in high addresses. The CTS also failed
|
||||
quite quickly. With this, CTS progresses for an hour before OOMing
|
||||
(allocating some big buffers when my board only has 600MB available to
|
||||
Linux)
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/gpu/drm/v3d/v3d_debugfs.c | 16 +---------------
|
||||
drivers/gpu/drm/v3d/v3d_drv.c | 9 ---------
|
||||
2 files changed, 1 insertion(+), 24 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_debugfs.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <linux/circ_buf.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/debugfs.h>
|
||||
-#include <linux/pm_runtime.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
#include <drm/drm_debugfs.h>
|
||||
@@ -130,11 +129,8 @@ static int v3d_v3d_debugfs_ident(struct
|
||||
struct drm_device *dev = node->minor->dev;
|
||||
struct v3d_dev *v3d = to_v3d_dev(dev);
|
||||
u32 ident0, ident1, ident2, ident3, cores;
|
||||
- int ret, core;
|
||||
+ int core;
|
||||
|
||||
- ret = pm_runtime_get_sync(v3d->drm.dev);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
|
||||
ident0 = V3D_READ(V3D_HUB_IDENT0);
|
||||
ident1 = V3D_READ(V3D_HUB_IDENT1);
|
||||
@@ -187,9 +183,6 @@ static int v3d_v3d_debugfs_ident(struct
|
||||
(misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
|
||||
}
|
||||
|
||||
- pm_runtime_mark_last_busy(v3d->drm.dev);
|
||||
- pm_runtime_put_autosuspend(v3d->drm.dev);
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -217,11 +210,6 @@ static int v3d_measure_clock(struct seq_
|
||||
uint32_t cycles;
|
||||
int core = 0;
|
||||
int measure_ms = 1000;
|
||||
- int ret;
|
||||
-
|
||||
- ret = pm_runtime_get_sync(v3d->drm.dev);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
|
||||
if (v3d->ver >= 40) {
|
||||
V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
|
||||
@@ -245,8 +233,6 @@ static int v3d_measure_clock(struct seq_
|
||||
cycles / (measure_ms * 1000),
|
||||
(cycles / (measure_ms * 100)) % 10);
|
||||
|
||||
- pm_runtime_mark_last_busy(v3d->drm.dev);
|
||||
- pm_runtime_put_autosuspend(v3d->drm.dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--- a/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
|
||||
@@ -79,7 +79,6 @@ static int v3d_get_param_ioctl(struct dr
|
||||
{
|
||||
struct v3d_dev *v3d = to_v3d_dev(dev);
|
||||
struct drm_v3d_get_param *args = data;
|
||||
- int ret;
|
||||
static const u32 reg_map[] = {
|
||||
[DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
|
||||
[DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
|
||||
@@ -105,17 +104,12 @@ static int v3d_get_param_ioctl(struct dr
|
||||
if (args->value != 0)
|
||||
return -EINVAL;
|
||||
|
||||
- ret = pm_runtime_get_sync(v3d->drm.dev);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
|
||||
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
|
||||
args->value = V3D_CORE_READ(0, offset);
|
||||
} else {
|
||||
args->value = V3D_READ(offset);
|
||||
}
|
||||
- pm_runtime_mark_last_busy(v3d->drm.dev);
|
||||
- pm_runtime_put_autosuspend(v3d->drm.dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -320,9 +314,6 @@ static int v3d_platform_drm_probe(struct
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
- pm_runtime_use_autosuspend(dev);
|
||||
- pm_runtime_set_autosuspend_delay(dev, 50);
|
||||
- pm_runtime_enable(dev);
|
||||
|
||||
ret = v3d_gem_init(drm);
|
||||
if (ret)
|
@ -1,85 +0,0 @@
|
||||
From c22955161cfe7f3c10ff0ee4b1ff296c5bee9496 Mon Sep 17 00:00:00 2001
|
||||
From: James Hughes <james.hughes@raspberrypi.org>
|
||||
Date: Tue, 16 Jul 2019 12:18:21 +0100
|
||||
Subject: [PATCH] Add HDMI1 facility to the driver.
|
||||
|
||||
For generic ALSA, all you need is the bcm2835.h change, but
|
||||
have also added structures for IEC958 HDMI. Not sure how to
|
||||
test those.
|
||||
---
|
||||
.../vc04_services/bcm2835-audio/bcm2835.c | 29 ++++++++++++++++---
|
||||
.../vc04_services/bcm2835-audio/bcm2835.h | 4 ++-
|
||||
2 files changed, 28 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
@@ -79,7 +79,11 @@ static int bcm2835_audio_alsa_newpcm(str
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, 0, 1, true);
|
||||
+ err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, AUDIO_DEST_HDMI0, 1, true);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI1", 2, AUDIO_DEST_HDMI1, 1, true);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -106,7 +110,7 @@ static struct bcm2835_audio_driver bcm28
|
||||
.newctl = snd_bcm2835_new_ctl,
|
||||
};
|
||||
|
||||
-static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
|
||||
+static struct bcm2835_audio_driver bcm2835_audio_hdmi0 = {
|
||||
.driver = {
|
||||
.name = "bcm2835_hdmi",
|
||||
.owner = THIS_MODULE,
|
||||
@@ -116,7 +120,20 @@ static struct bcm2835_audio_driver bcm28
|
||||
.minchannels = 1,
|
||||
.newpcm = bcm2835_audio_simple_newpcm,
|
||||
.newctl = snd_bcm2835_new_hdmi_ctl,
|
||||
- .route = AUDIO_DEST_HDMI
|
||||
+ .route = AUDIO_DEST_HDMI0
|
||||
+};
|
||||
+
|
||||
+static struct bcm2835_audio_driver bcm2835_audio_hdmi1 = {
|
||||
+ .driver = {
|
||||
+ .name = "bcm2835_hdmi",
|
||||
+ .owner = THIS_MODULE,
|
||||
+ },
|
||||
+ .shortname = "bcm2835 HDMI 1",
|
||||
+ .longname = "bcm2835 HDMI 1",
|
||||
+ .minchannels = 1,
|
||||
+ .newpcm = bcm2835_audio_simple_newpcm,
|
||||
+ .newctl = snd_bcm2835_new_hdmi_ctl,
|
||||
+ .route = AUDIO_DEST_HDMI1
|
||||
};
|
||||
|
||||
static struct bcm2835_audio_driver bcm2835_audio_headphones = {
|
||||
@@ -143,7 +160,11 @@ static struct bcm2835_audio_drivers chil
|
||||
.is_enabled = &enable_compat_alsa,
|
||||
},
|
||||
{
|
||||
- .audio_driver = &bcm2835_audio_hdmi,
|
||||
+ .audio_driver = &bcm2835_audio_hdmi0,
|
||||
+ .is_enabled = &enable_hdmi,
|
||||
+ },
|
||||
+ {
|
||||
+ .audio_driver = &bcm2835_audio_hdmi1,
|
||||
.is_enabled = &enable_hdmi,
|
||||
},
|
||||
{
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
|
||||
@@ -33,7 +33,9 @@ enum {
|
||||
enum snd_bcm2835_route {
|
||||
AUDIO_DEST_AUTO = 0,
|
||||
AUDIO_DEST_HEADPHONES = 1,
|
||||
- AUDIO_DEST_HDMI = 2,
|
||||
+ AUDIO_DEST_HDMI = 2, // for backwards compatibility.
|
||||
+ AUDIO_DEST_HDMI0 = 2,
|
||||
+ AUDIO_DEST_HDMI1 = 3,
|
||||
AUDIO_DEST_MAX,
|
||||
};
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 98631cef94563d6857f4133e7917f234be8667bd Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Thu, 15 Aug 2019 12:02:34 +0100
|
||||
Subject: [PATCH] configs: arm64/bcm2711: Enable V3D
|
||||
|
||||
Enable the V3D driver, which depends on BCM2835_POWER.
|
||||
|
||||
Originally submitted by GitHub user 'phire' in a slightly different
|
||||
form.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/pull/3063
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/gpu/drm/v3d/Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/Kconfig
|
||||
+++ b/drivers/gpu/drm/v3d/Kconfig
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
config DRM_V3D
|
||||
tristate "Broadcom V3D 3.x and newer"
|
||||
- depends on ARCH_BCM || ARCH_BCMSTB || COMPILE_TEST
|
||||
+ depends on ARCH_BCM || ARCH_BCMSTB || ARCH_BCM2835 || COMPILE_TEST
|
||||
depends on DRM
|
||||
depends on COMMON_CLK
|
||||
depends on MMU
|
@ -1,77 +0,0 @@
|
||||
From 3c54a4cdc8c65248c347a02b36ac378fe81379ba Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Wed, 28 Aug 2019 13:34:30 +0100
|
||||
Subject: [PATCH] media: dt-bindings: Add binding for the Sony IMX219
|
||||
sensor
|
||||
|
||||
The IMX219 is an 8MPix CSI2 sensor, supporting 2 or 4 data lanes.
|
||||
Document the binding for this device.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
.../devicetree/bindings/media/i2c/imx219.txt | 59 +++++++++++++++++++
|
||||
1 file changed, 59 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/media/i2c/imx219.txt
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/media/i2c/imx219.txt
|
||||
@@ -0,0 +1,59 @@
|
||||
+* Sony 1/4.0-Inch 8Mpixel CMOS Digital Image Sensor
|
||||
+
|
||||
+The Sony imx219 is a 1/4.0-inch CMOS active pixel digital image sensor with
|
||||
+an active array size of 3280H x 2464V. It is programmable through I2C
|
||||
+interface. The I2C address is fixed to 0x10 as per sensor data sheet.
|
||||
+Image data is sent through MIPI CSI-2, which is configured as either 2 or 4
|
||||
+data lanes.
|
||||
+
|
||||
+Required Properties:
|
||||
+- compatible: value should be "sony,imx219" for imx219 sensor
|
||||
+- reg: I2C bus address of the device
|
||||
+- clocks: reference to the xclk input clock.
|
||||
+- clock-names: should be "xclk".
|
||||
+- DOVDD-supply: Digital I/O voltage supply, 1.8 volts
|
||||
+- AVDD-supply: Analog voltage supply, 2.8 volts
|
||||
+- DVDD-supply: Digital core voltage supply, 1.2 volts
|
||||
+
|
||||
+Optional Properties:
|
||||
+- xclr-gpios: reference to the GPIO connected to the xclr pin, if any. Must be
|
||||
+ released after all supplies are applied.
|
||||
+ This is an active high signal to the imx219.
|
||||
+
|
||||
+The imx219 device node should contain one 'port' child node with
|
||||
+an 'endpoint' subnode. For further reading on port node refer to
|
||||
+Documentation/devicetree/bindings/media/video-interfaces.txt.
|
||||
+
|
||||
+Endpoint node required properties for CSI-2 connection are:
|
||||
+- remote-endpoint: a phandle to the bus receiver's endpoint node.
|
||||
+- clock-lanes: should be set to <0> (clock lane on hardware lane 0)
|
||||
+- data-lanes: should be set to <1 2>, or <1 2 3 4> (two or four lane CSI-2
|
||||
+ supported)
|
||||
+
|
||||
+Example:
|
||||
+ sensor@10 {
|
||||
+ compatible = "sony,imx219";
|
||||
+ reg = <0x10>;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ clocks = <&imx219_clk>;
|
||||
+ clock-names = "xclk";
|
||||
+ xclr-gpios = <&gpio_sensor 0 0>;
|
||||
+ DOVDD-supply = <&vgen4_reg>; /* 1.8v */
|
||||
+ AVDD-supply = <&vgen3_reg>; /* 2.8v */
|
||||
+ DVDD-supply = <&vgen2_reg>; /* 1.2v */
|
||||
+
|
||||
+ imx219_clk: camera-clk {
|
||||
+ compatible = "fixed-clock";
|
||||
+ #clock-cells = <0>;
|
||||
+ clock-frequency = <24000000>;
|
||||
+ };
|
||||
+
|
||||
+ port {
|
||||
+ sensor_out: endpoint {
|
||||
+ remote-endpoint = <&csiss_in>;
|
||||
+ clock-lanes = <0>;
|
||||
+ data-lanes = <1 2>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
File diff suppressed because it is too large
Load Diff
@ -1,62 +0,0 @@
|
||||
From 5154d39501380fa5680aea0fab0c3f3f2337fe1f Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Wed, 18 Sep 2019 17:22:36 +0100
|
||||
Subject: [PATCH] drm/v3d: Delete pm_runtime support
|
||||
|
||||
The pm_runtime was blocking changelist submission, so delete it as a
|
||||
temporary workaround.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/gpu/drm/v3d/v3d_gem.c | 5 -----
|
||||
drivers/gpu/drm/v3d/v3d_mmu.c | 11 -----------
|
||||
2 files changed, 16 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_gem.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
|
||||
@@ -485,10 +485,6 @@ v3d_job_init(struct v3d_dev *v3d, struct
|
||||
job->v3d = v3d;
|
||||
job->free = free;
|
||||
|
||||
- ret = pm_runtime_get_sync(v3d->drm.dev);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
xa_init_flags(&job->deps, XA_FLAGS_ALLOC);
|
||||
|
||||
ret = drm_syncobj_find_fence(file_priv, in_sync, 0, 0, &in_fence);
|
||||
@@ -505,7 +501,6 @@ v3d_job_init(struct v3d_dev *v3d, struct
|
||||
return 0;
|
||||
fail:
|
||||
xa_destroy(&job->deps);
|
||||
- pm_runtime_put_autosuspend(v3d->drm.dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
--- a/drivers/gpu/drm/v3d/v3d_mmu.c
|
||||
+++ b/drivers/gpu/drm/v3d/v3d_mmu.c
|
||||
@@ -36,14 +36,6 @@ static int v3d_mmu_flush_all(struct v3d_
|
||||
{
|
||||
int ret;
|
||||
|
||||
- /* Keep power on the device on until we're done with this
|
||||
- * call, but skip the flush if the device is off and will be
|
||||
- * reset when powered back on.
|
||||
- */
|
||||
- ret = pm_runtime_get_if_in_use(v3d->dev);
|
||||
- if (ret == 0)
|
||||
- return 0;
|
||||
-
|
||||
/* Make sure that another flush isn't already running when we
|
||||
* start this one.
|
||||
*/
|
||||
@@ -71,9 +63,6 @@ static int v3d_mmu_flush_all(struct v3d_
|
||||
if (ret)
|
||||
dev_err(v3d->drm.dev, "MMUC flush wait idle failed\n");
|
||||
|
||||
- pm_runtime_mark_last_busy(v3d->dev);
|
||||
- pm_runtime_put_autosuspend(v3d->dev);
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,139 +0,0 @@
|
||||
From 078a4914aaa74a3af8262b29ff82011b9e752a8e Mon Sep 17 00:00:00 2001
|
||||
From: James Hughes <james.hughes@raspberrypi.org>
|
||||
Date: Tue, 24 Sep 2019 18:26:55 +0100
|
||||
Subject: [PATCH] Rename HDMI ALSA device names, check for enable state
|
||||
|
||||
HDMI Alsa devices renamed to match names used by DRM, to
|
||||
HDMI 1 and HDMI 2
|
||||
|
||||
Check for which HDMI devices are connected and only create
|
||||
devices for those that are present.
|
||||
|
||||
The rename of the devices might cause some backwards compatibility
|
||||
issues, but since this particular part of the driver needs to be
|
||||
specifically enabled, I suspect the number of people who will see
|
||||
the problem will be very small.
|
||||
|
||||
Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
|
||||
---
|
||||
.../vc04_services/bcm2835-audio/bcm2835.c | 70 +++++++++++++++++--
|
||||
1 file changed, 63 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
@@ -9,8 +9,9 @@
|
||||
#include <linux/of.h>
|
||||
|
||||
#include "bcm2835.h"
|
||||
+#include <soc/bcm2835/raspberrypi-firmware.h>
|
||||
|
||||
-static bool enable_hdmi;
|
||||
+static bool enable_hdmi, enable_hdmi0, enable_hdmi1;
|
||||
static bool enable_headphones;
|
||||
static bool enable_compat_alsa = true;
|
||||
|
||||
@@ -115,8 +116,8 @@ static struct bcm2835_audio_driver bcm28
|
||||
.name = "bcm2835_hdmi",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
- .shortname = "bcm2835 HDMI",
|
||||
- .longname = "bcm2835 HDMI",
|
||||
+ .shortname = "bcm2835 HDMI 1",
|
||||
+ .longname = "bcm2835 HDMI 1",
|
||||
.minchannels = 1,
|
||||
.newpcm = bcm2835_audio_simple_newpcm,
|
||||
.newctl = snd_bcm2835_new_hdmi_ctl,
|
||||
@@ -128,8 +129,8 @@ static struct bcm2835_audio_driver bcm28
|
||||
.name = "bcm2835_hdmi",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
- .shortname = "bcm2835 HDMI 1",
|
||||
- .longname = "bcm2835 HDMI 1",
|
||||
+ .shortname = "bcm2835 HDMI 2",
|
||||
+ .longname = "bcm2835 HDMI 2",
|
||||
.minchannels = 1,
|
||||
.newpcm = bcm2835_audio_simple_newpcm,
|
||||
.newctl = snd_bcm2835_new_hdmi_ctl,
|
||||
@@ -161,11 +162,11 @@ static struct bcm2835_audio_drivers chil
|
||||
},
|
||||
{
|
||||
.audio_driver = &bcm2835_audio_hdmi0,
|
||||
- .is_enabled = &enable_hdmi,
|
||||
+ .is_enabled = &enable_hdmi0,
|
||||
},
|
||||
{
|
||||
.audio_driver = &bcm2835_audio_hdmi1,
|
||||
- .is_enabled = &enable_hdmi,
|
||||
+ .is_enabled = &enable_hdmi1,
|
||||
},
|
||||
{
|
||||
.audio_driver = &bcm2835_audio_headphones,
|
||||
@@ -312,6 +313,53 @@ static int snd_add_child_devices(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void set_hdmi_enables(struct device *dev)
|
||||
+{
|
||||
+ struct device_node *firmware_node;
|
||||
+ struct rpi_firmware *firmware;
|
||||
+ u32 num_displays, i, display_id;
|
||||
+ int ret;
|
||||
+
|
||||
+ firmware_node = of_parse_phandle(dev->of_node, "brcm,firmware", 0);
|
||||
+ firmware = rpi_firmware_get(firmware_node);
|
||||
+
|
||||
+ if (!firmware)
|
||||
+ return;
|
||||
+
|
||||
+ of_node_put(firmware_node);
|
||||
+
|
||||
+ ret = rpi_firmware_property(firmware,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS,
|
||||
+ &num_displays, sizeof(u32));
|
||||
+
|
||||
+ if (ret)
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < num_displays; i++) {
|
||||
+ display_id = i;
|
||||
+ ret = rpi_firmware_property(firmware,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID,
|
||||
+ &display_id, sizeof(display_id));
|
||||
+ if (!ret) {
|
||||
+ if (display_id == 2)
|
||||
+ enable_hdmi0 = true;
|
||||
+ if (display_id == 7)
|
||||
+ enable_hdmi1 = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!enable_hdmi0 && enable_hdmi1) {
|
||||
+ /* Swap them over and reassign route. This means
|
||||
+ * that if we only have one connected, it is always named
|
||||
+ * HDMI1, irrespective of if its on port HDMI0 or HDMI1.
|
||||
+ * This should match with the naming of HDMI ports in DRM
|
||||
+ */
|
||||
+ enable_hdmi0 = true;
|
||||
+ enable_hdmi1 = false;
|
||||
+ bcm2835_audio_hdmi0.route = AUDIO_DEST_HDMI1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -332,6 +380,14 @@ static int snd_bcm2835_alsa_probe(struct
|
||||
numchans);
|
||||
}
|
||||
|
||||
+ if (!enable_compat_alsa) {
|
||||
+ set_hdmi_enables(dev);
|
||||
+ // In this mode, always enable analog output
|
||||
+ enable_headphones = true;
|
||||
+ } else {
|
||||
+ enable_hdmi0 = enable_hdmi;
|
||||
+ }
|
||||
+
|
||||
err = bcm2835_devm_add_vchi_ctx(dev);
|
||||
if (err)
|
||||
return err;
|
@ -1,23 +0,0 @@
|
||||
From 9d335660546d3ed85193ca0276f5bf8ca4ee61eb Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 2 Mar 2020 14:40:19 +0000
|
||||
Subject: [PATCH] drivers: char: vcio: Use common compat header
|
||||
|
||||
The definition of compat_ptr is now common for most platforms, but
|
||||
requires the inclusion of <linux/compat.h>.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/char/broadcom/vcio.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/char/broadcom/vcio.c
|
||||
+++ b/drivers/char/broadcom/vcio.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uaccess.h>
|
||||
+#include <linux/compat.h>
|
||||
#include <soc/bcm2835/raspberrypi-firmware.h>
|
||||
|
||||
#define MBOX_CHAN_PROPERTY 8
|
@ -1,154 +0,0 @@
|
||||
From 49bdb5120b45a6c92e6f10d1d2db85f9d88ba1e3 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Fri, 13 Dec 2019 17:04:25 +0100
|
||||
Subject: [PATCH] media: uapi: hevc: Add scaling matrix control
|
||||
|
||||
Taken from https://patchwork.linuxtv.org/patch/60728/
|
||||
Changes (mainly documentation) have been requested.
|
||||
|
||||
HEVC has a scaling matrix concept. Add support for it.
|
||||
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
.../media/v4l/ext-ctrls-codec.rst | 41 +++++++++++++++++++
|
||||
.../media/v4l/pixfmt-compressed.rst | 5 ++-
|
||||
drivers/media/v4l2-core/v4l2-ctrls.c | 10 +++++
|
||||
include/media/hevc-ctrls.h | 11 +++++
|
||||
4 files changed, 65 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
|
||||
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
|
||||
@@ -3181,6 +3181,47 @@ enum v4l2_mpeg_video_hevc_size_of_length
|
||||
|
||||
\normalsize
|
||||
|
||||
+``V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX (struct)``
|
||||
+ Specifies the scaling matrix (as extracted from the bitstream) for
|
||||
+ the associated HEVC slice data. The bitstream parameters are
|
||||
+ defined according to :ref:`hevc`, section 7.4.5 "Scaling list
|
||||
+ data semantics". For further documentation, refer to the above
|
||||
+ specification, unless there is an explicit comment stating
|
||||
+ otherwise.
|
||||
+
|
||||
+ .. note::
|
||||
+
|
||||
+ This compound control is not yet part of the public kernel API and
|
||||
+ it is expected to change.
|
||||
+
|
||||
+.. c:type:: v4l2_ctrl_hevc_scaling_matrix
|
||||
+
|
||||
+.. cssclass:: longtable
|
||||
+
|
||||
+.. flat-table:: struct v4l2_ctrl_hevc_scaling_matrix
|
||||
+ :header-rows: 0
|
||||
+ :stub-columns: 0
|
||||
+ :widths: 1 1 2
|
||||
+
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_4x4[6][16]``
|
||||
+ -
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_8x8[6][64]``
|
||||
+ -
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_16x16[6][64]``
|
||||
+ -
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_32x32[2][64]``
|
||||
+ -
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_dc_coef_16x16[6]``
|
||||
+ -
|
||||
+ * - __u8
|
||||
+ - ``scaling_list_dc_coef_32x32[2]``
|
||||
+ -
|
||||
+
|
||||
``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (enum)``
|
||||
Specifies the decoding mode to use. Currently exposes slice-based and
|
||||
frame-based decoding but new modes might be added later on.
|
||||
--- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
|
||||
+++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
|
||||
@@ -195,8 +195,9 @@ Compressed Formats
|
||||
Metadata associated with the frame to decode is required to be passed
|
||||
through the following controls:
|
||||
``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
|
||||
- ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
|
||||
- ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
|
||||
+ ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``,
|
||||
+ ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``, and
|
||||
+ ``V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX``.
|
||||
See the :ref:`associated Codec Control IDs <v4l2-mpeg-hevc>`.
|
||||
Buffers associated with this pixel format must contain the appropriate
|
||||
number of macroblocks to decode a full corresponding frame.
|
||||
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
|
||||
@@ -1042,6 +1042,7 @@ const char *v4l2_ctrl_get_name(u32 id)
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_SPS: return "HEVC Sequence Parameter Set";
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_PPS: return "HEVC Picture Parameter Set";
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS: return "HEVC Slice Parameters";
|
||||
+ case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX: return "HEVC Scaling Matrix";
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE: return "HEVC Decode Mode";
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE: return "HEVC Start Code";
|
||||
|
||||
@@ -1527,6 +1528,9 @@ void v4l2_ctrl_fill(u32 id, const char *
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS:
|
||||
*type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS;
|
||||
break;
|
||||
+ case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX:
|
||||
+ *type = V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX;
|
||||
+ break;
|
||||
case V4L2_CID_UNIT_CELL_SIZE:
|
||||
*type = V4L2_CTRL_TYPE_AREA;
|
||||
*flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
@@ -2238,6 +2242,9 @@ static int std_validate_compound(const s
|
||||
|
||||
break;
|
||||
|
||||
+ case V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX:
|
||||
+ break;
|
||||
+
|
||||
case V4L2_CTRL_TYPE_AREA:
|
||||
area = p;
|
||||
if (!area->width || !area->height)
|
||||
@@ -2954,6 +2961,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
|
||||
case V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY:
|
||||
elem_size = sizeof(struct v4l2_ctrl_hdr10_mastering_display);
|
||||
break;
|
||||
+ case V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX:
|
||||
+ elem_size = sizeof(struct v4l2_ctrl_hevc_scaling_matrix);
|
||||
+ break;
|
||||
case V4L2_CTRL_TYPE_AREA:
|
||||
elem_size = sizeof(struct v4l2_area);
|
||||
break;
|
||||
--- a/include/media/hevc-ctrls.h
|
||||
+++ b/include/media/hevc-ctrls.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_SPS (V4L2_CID_CODEC_BASE + 1008)
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_PPS (V4L2_CID_CODEC_BASE + 1009)
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS (V4L2_CID_CODEC_BASE + 1010)
|
||||
+#define V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX (V4L2_CID_CODEC_BASE + 1011)
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS (V4L2_CID_CODEC_BASE + 1012)
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (V4L2_CID_CODEC_BASE + 1015)
|
||||
#define V4L2_CID_MPEG_VIDEO_HEVC_START_CODE (V4L2_CID_CODEC_BASE + 1016)
|
||||
@@ -27,6 +28,7 @@
|
||||
#define V4L2_CTRL_TYPE_HEVC_SPS 0x0120
|
||||
#define V4L2_CTRL_TYPE_HEVC_PPS 0x0121
|
||||
#define V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS 0x0122
|
||||
+#define V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX 0x0123
|
||||
#define V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS 0x0124
|
||||
|
||||
enum v4l2_mpeg_video_hevc_decode_mode {
|
||||
@@ -238,4 +240,13 @@ struct v4l2_ctrl_hevc_decode_params {
|
||||
*/
|
||||
#define V4L2_CID_HANTRO_HEVC_SLICE_HEADER_SKIP (V4L2_CID_CODEC_HANTRO_BASE + 0)
|
||||
|
||||
+struct v4l2_ctrl_hevc_scaling_matrix {
|
||||
+ __u8 scaling_list_4x4[6][16];
|
||||
+ __u8 scaling_list_8x8[6][64];
|
||||
+ __u8 scaling_list_16x16[6][64];
|
||||
+ __u8 scaling_list_32x32[2][64];
|
||||
+ __u8 scaling_list_dc_coef_16x16[6];
|
||||
+ __u8 scaling_list_dc_coef_32x32[2];
|
||||
+};
|
||||
+
|
||||
#endif
|
@ -1,59 +0,0 @@
|
||||
From 8ed873d6e26bc706b0af3bef29f87e2975046222 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Fri, 13 Dec 2019 17:04:27 +0100
|
||||
Subject: [PATCH] media: uapi: hevc: Add segment address field
|
||||
|
||||
From https://patchwork.linuxtv.org/patch/60725/
|
||||
Changes requested, but mainly docs.
|
||||
|
||||
If HEVC frame consists of multiple slices, segment address has to be
|
||||
known in order to properly decode it.
|
||||
|
||||
Add segment address field to slice parameters.
|
||||
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
.../userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
|
||||
include/media/hevc-ctrls.h | 9 +++++++--
|
||||
2 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
|
||||
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
|
||||
@@ -2961,6 +2961,9 @@ enum v4l2_mpeg_video_hevc_size_of_length
|
||||
* - __u32
|
||||
- ``data_bit_offset``
|
||||
- Offset (in bits) to the video data in the current slice data.
|
||||
+ * - __u32
|
||||
+ - ``slice_segment_addr``
|
||||
+ -
|
||||
* - __u8
|
||||
- ``nal_unit_type``
|
||||
-
|
||||
--- a/include/media/hevc-ctrls.h
|
||||
+++ b/include/media/hevc-ctrls.h
|
||||
@@ -173,6 +173,10 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||
__u32 bit_size;
|
||||
__u32 data_bit_offset;
|
||||
|
||||
+ /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||
+ __u32 slice_segment_addr;
|
||||
+ __u32 num_entry_point_offsets;
|
||||
+
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */
|
||||
__u8 nal_unit_type;
|
||||
__u8 nuh_temporal_id_plus1;
|
||||
@@ -198,11 +202,12 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||
__u8 pic_struct;
|
||||
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||
- __u32 slice_segment_addr;
|
||||
__u8 ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
|
||||
__u8 ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
|
||||
|
||||
- __u8 padding;
|
||||
+ __u8 padding[5];
|
||||
+
|
||||
+ __u32 entry_point_offset_minus1[256];
|
||||
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */
|
||||
struct v4l2_hevc_pred_weight_table pred_weight_table;
|
@ -1,63 +0,0 @@
|
||||
From b0682b4ef5d4eb82ee702d8c3f3560349f1a231c Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 13 Feb 2020 17:51:09 +0100
|
||||
Subject: [PATCH] dt-bindings: clock: Add a binding for the RPi
|
||||
Firmware clocks
|
||||
|
||||
The firmare running on the RPi VideoCore can be used to discover and
|
||||
change the various clocks running in the BCM2711. Since devices will
|
||||
need to use them through the DT, let's add a pretty simple binding.
|
||||
|
||||
Cc: Michael Turquette <mturquette@baylibre.com>
|
||||
Cc: Stephen Boyd <sboyd@kernel.org>
|
||||
Cc: Rob Herring <robh+dt@kernel.org>
|
||||
Cc: linux-clk@vger.kernel.org
|
||||
Cc: devicetree@vger.kernel.org
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
.../clock/raspberrypi,firmware-clocks.yaml | 39 +++++++++++++++++++
|
||||
1 file changed, 39 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/clock/raspberrypi,firmware-clocks.yaml
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/clock/raspberrypi,firmware-clocks.yaml
|
||||
@@ -0,0 +1,39 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/clock/raspberrypi,firmware-clocks.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: RaspberryPi Firmware Clocks Device Tree Bindings
|
||||
+
|
||||
+maintainers:
|
||||
+ - Maxime Ripard <mripard@kernel.org>
|
||||
+
|
||||
+properties:
|
||||
+ "#clock-cells":
|
||||
+ const: 1
|
||||
+
|
||||
+ compatible:
|
||||
+ const: raspberrypi,firmware-clocks
|
||||
+
|
||||
+ raspberrypi,firmware:
|
||||
+ $ref: /schemas/types.yaml#/definitions/phandle
|
||||
+ description: >
|
||||
+ Phandle to the mailbox node to communicate with the firmware.
|
||||
+
|
||||
+required:
|
||||
+ - "#clock-cells"
|
||||
+ - compatible
|
||||
+ - raspberrypi,firmware
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ firmware_clocks: firmware-clocks {
|
||||
+ compatible = "raspberrypi,firmware-clocks";
|
||||
+ raspberrypi,firmware = <&firmware>;
|
||||
+ #clock-cells = <1>;
|
||||
+ };
|
||||
+
|
||||
+...
|
@ -1,174 +0,0 @@
|
||||
From b60e8bcad707be3999f253d0d8a829130c1862c2 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Thu, 13 Feb 2020 16:45:24 +0100
|
||||
Subject: [PATCH] dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI
|
||||
controllers bindings
|
||||
|
||||
The HDMI controllers found in the BCM2711 SoC need some adjustments to the
|
||||
bindings, especially since the registers have been shuffled around in more
|
||||
register ranges.
|
||||
|
||||
Cc: Rob Herring <robh+dt@kernel.org>
|
||||
Cc: devicetree@vger.kernel.org
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
.../bindings/display/brcm,bcm2835-hdmi.yaml | 118 ++++++++++++++++--
|
||||
1 file changed, 109 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml
|
||||
+++ b/Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml
|
||||
@@ -11,24 +11,58 @@ maintainers:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
- const: brcm,bcm2835-hdmi
|
||||
+ enum:
|
||||
+ - brcm,bcm2835-hdmi
|
||||
+ - brcm,bcm2711-hdmi0
|
||||
+ - brcm,bcm2711-hdmi1
|
||||
|
||||
reg:
|
||||
+ oneOf:
|
||||
+ - items:
|
||||
+ - description: HDMI register range
|
||||
+ - description: HD register range
|
||||
+
|
||||
+ - items:
|
||||
+ - description: HDMI controller register range
|
||||
+ - description: DVP register range
|
||||
+ - description: HDMI PHY register range
|
||||
+ - description: Rate Manager register range
|
||||
+ - description: Packet RAM register range
|
||||
+ - description: Metadata RAM register range
|
||||
+ - description: CSC register range
|
||||
+ - description: CEC register range
|
||||
+ - description: HD register range
|
||||
+
|
||||
+ reg-names:
|
||||
items:
|
||||
- - description: HDMI register range
|
||||
- - description: HD register range
|
||||
+ - const: hdmi
|
||||
+ - const: dvp
|
||||
+ - const: phy
|
||||
+ - const: rm
|
||||
+ - const: packet
|
||||
+ - const: metadata
|
||||
+ - const: csc
|
||||
+ - const: cec
|
||||
+ - const: hd
|
||||
|
||||
interrupts:
|
||||
minItems: 2
|
||||
|
||||
clocks:
|
||||
- items:
|
||||
- - description: The pixel clock
|
||||
- - description: The HDMI state machine clock
|
||||
+ oneOf:
|
||||
+ - items:
|
||||
+ - description: The pixel clock
|
||||
+ - description: The HDMI state machine clock
|
||||
+
|
||||
+ - items:
|
||||
+ - description: The HDMI state machine clock
|
||||
|
||||
clock-names:
|
||||
- items:
|
||||
- - const: pixel
|
||||
+ oneOf:
|
||||
+ - items:
|
||||
+ - const: pixel
|
||||
+ - const: hdmi
|
||||
+
|
||||
- const: hdmi
|
||||
|
||||
ddc:
|
||||
@@ -51,15 +85,54 @@ properties:
|
||||
dma-names:
|
||||
const: audio-rx
|
||||
|
||||
+ resets:
|
||||
+ maxItems: 1
|
||||
+
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- - interrupts
|
||||
- clocks
|
||||
- ddc
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
+if:
|
||||
+ properties:
|
||||
+ compatible:
|
||||
+ contains:
|
||||
+ enum:
|
||||
+ - brcm,bcm2711-hdmi0
|
||||
+ - brcm,bcm2711-hdmi1
|
||||
+
|
||||
+then:
|
||||
+ properties:
|
||||
+ reg:
|
||||
+ minItems: 9
|
||||
+
|
||||
+ clocks:
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ clock-names:
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ required:
|
||||
+ - reg-names
|
||||
+ - resets
|
||||
+
|
||||
+else:
|
||||
+ properties:
|
||||
+ reg:
|
||||
+ maxItems: 2
|
||||
+
|
||||
+ clocks:
|
||||
+ minItems: 2
|
||||
+
|
||||
+ clock-names:
|
||||
+ minItems: 2
|
||||
+
|
||||
+ required:
|
||||
+ - interrupts
|
||||
+
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/bcm2835.h>
|
||||
@@ -77,4 +150,31 @@ examples:
|
||||
clock-names = "pixel", "hdmi";
|
||||
};
|
||||
|
||||
+ - |
|
||||
+ hdmi0: hdmi@7ef00700 {
|
||||
+ compatible = "brcm,bcm2711-hdmi0";
|
||||
+ reg = <0x7ef00700 0x300>,
|
||||
+ <0x7ef00300 0x200>,
|
||||
+ <0x7ef00f00 0x80>,
|
||||
+ <0x7ef00f80 0x80>,
|
||||
+ <0x7ef01b00 0x200>,
|
||||
+ <0x7ef01f00 0x400>,
|
||||
+ <0x7ef00200 0x80>,
|
||||
+ <0x7ef04300 0x100>,
|
||||
+ <0x7ef20000 0x100>;
|
||||
+ reg-names = "hdmi",
|
||||
+ "dvp",
|
||||
+ "phy",
|
||||
+ "rm",
|
||||
+ "packet",
|
||||
+ "metadata",
|
||||
+ "csc",
|
||||
+ "cec",
|
||||
+ "hd";
|
||||
+ clocks = <&firmware_clocks 13>;
|
||||
+ clock-names = "hdmi";
|
||||
+ resets = <&dvp 0>;
|
||||
+ ddc = <&ddc0>;
|
||||
+ };
|
||||
+
|
||||
...
|
@ -1,39 +0,0 @@
|
||||
From e8a4f85fb2d132ccd7e5773176df779588ba1281 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 27 Jan 2020 10:22:44 +0000
|
||||
Subject: [PATCH] drm: Checking of the pitch is only valid for linear
|
||||
formats
|
||||
|
||||
framebuffer_check was computing a minimum pitch value and ensuring
|
||||
that the provided value was greater than this.
|
||||
That check is only valid if the format is linear.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_framebuffer.c | 16 ++++++++++------
|
||||
1 file changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/drm_framebuffer.c
|
||||
+++ b/drivers/gpu/drm/drm_framebuffer.c
|
||||
@@ -214,12 +214,16 @@ static int framebuffer_check(struct drm_
|
||||
if (min_pitch > UINT_MAX)
|
||||
return -ERANGE;
|
||||
|
||||
- if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX)
|
||||
- return -ERANGE;
|
||||
+ if (r->modifier[i] == DRM_FORMAT_MOD_LINEAR) {
|
||||
+ if ((uint64_t)height * r->pitches[i] + r->offsets[i] >
|
||||
+ UINT_MAX)
|
||||
+ return -ERANGE;
|
||||
|
||||
- if (block_size && r->pitches[i] < min_pitch) {
|
||||
- DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i);
|
||||
- return -EINVAL;
|
||||
+ if (block_size && r->pitches[i] < min_pitch) {
|
||||
+ DRM_DEBUG_KMS("bad pitch %u for plane %d\n",
|
||||
+ r->pitches[i], i);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (r->modifier[i] && !(r->flags & DRM_MODE_FB_MODIFIERS)) {
|
@ -1,53 +0,0 @@
|
||||
From 7f47cc7fd70961891c50ce303147274b6f318464 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 20 Apr 2020 22:18:52 +0100
|
||||
Subject: [PATCH] driver: char: rpivid: Remove legacy name support
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/char/broadcom/rpivid-mem.c | 22 ----------------------
|
||||
1 file changed, 22 deletions(-)
|
||||
|
||||
--- a/drivers/char/broadcom/rpivid-mem.c
|
||||
+++ b/drivers/char/broadcom/rpivid-mem.c
|
||||
@@ -193,32 +193,11 @@ static int rpivid_mem_probe(struct platf
|
||||
goto failed_device_create;
|
||||
}
|
||||
|
||||
- /* Legacy alias */
|
||||
- {
|
||||
- char *oldname = kstrdup(priv->name, GFP_KERNEL);
|
||||
-
|
||||
- oldname[1] = 'a';
|
||||
- oldname[2] = 'r';
|
||||
- oldname[3] = 'g';
|
||||
- oldname[4] = 'o';
|
||||
- oldname[5] = 'n';
|
||||
- dev = device_create(priv->class, NULL, priv->devid + 1, NULL,
|
||||
- oldname + 1);
|
||||
- kfree(oldname);
|
||||
-
|
||||
- if (IS_ERR(dev)) {
|
||||
- err = PTR_ERR(dev);
|
||||
- goto failed_legacy_device_create;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
dev_info(priv->dev, "%s initialised: Registers at 0x%08lx length 0x%08lx",
|
||||
priv->name, priv->regs_phys, priv->mem_window_len);
|
||||
|
||||
return 0;
|
||||
|
||||
-failed_legacy_device_create:
|
||||
- device_destroy(priv->class, priv->devid);
|
||||
failed_device_create:
|
||||
class_destroy(priv->class);
|
||||
failed_class_create:
|
||||
@@ -238,7 +217,6 @@ static int rpivid_mem_remove(struct plat
|
||||
struct device *dev = &pdev->dev;
|
||||
struct rpivid_mem_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
- device_destroy(priv->class, priv->devid + 1);
|
||||
device_destroy(priv->class, priv->devid);
|
||||
class_destroy(priv->class);
|
||||
cdev_del(&priv->rpivid_mem_cdev);
|
@ -1,51 +0,0 @@
|
||||
From f24635237a6c0f3338955169098fd6709b4420d5 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Tue, 21 Apr 2020 11:30:23 +0100
|
||||
Subject: [PATCH] driver: char: rpivid: Don't map more than wanted
|
||||
|
||||
Limit mappings to the permitted range, but don't map more than asked
|
||||
for otherwise we walk off the end of the allocated VMA.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/char/broadcom/rpivid-mem.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/char/broadcom/rpivid-mem.c
|
||||
+++ b/drivers/char/broadcom/rpivid-mem.c
|
||||
@@ -100,6 +100,7 @@ static int rpivid_mem_mmap(struct file *
|
||||
{
|
||||
struct rpivid_mem_priv *priv;
|
||||
unsigned long pages;
|
||||
+ unsigned long len;
|
||||
|
||||
priv = file->private_data;
|
||||
pages = priv->regs_phys >> PAGE_SHIFT;
|
||||
@@ -107,14 +108,13 @@ static int rpivid_mem_mmap(struct file *
|
||||
* The address decode is far larger than the actual number of registers.
|
||||
* Just map the whole lot in.
|
||||
*/
|
||||
- vma->vm_page_prot = phys_mem_access_prot(file, pages,
|
||||
- priv->mem_window_len,
|
||||
+ len = min(vma->vm_end - vma->vm_start, priv->mem_window_len);
|
||||
+ vma->vm_page_prot = phys_mem_access_prot(file, pages, len,
|
||||
vma->vm_page_prot);
|
||||
vma->vm_ops = &rpivid_mem_vm_ops;
|
||||
if (remap_pfn_range(vma, vma->vm_start,
|
||||
- pages,
|
||||
- priv->mem_window_len,
|
||||
- vma->vm_page_prot)) {
|
||||
+ pages, len,
|
||||
+ vma->vm_page_prot)) {
|
||||
return -EAGAIN;
|
||||
}
|
||||
return 0;
|
||||
@@ -156,7 +156,7 @@ static int rpivid_mem_probe(struct platf
|
||||
ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (ioresource) {
|
||||
priv->regs_phys = ioresource->start;
|
||||
- priv->mem_window_len = ioresource->end - ioresource->start;
|
||||
+ priv->mem_window_len = (ioresource->end + 1) - ioresource->start;
|
||||
} else {
|
||||
dev_err(priv->dev, "failed to get IO resource");
|
||||
err = -ENOENT;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,308 +0,0 @@
|
||||
From f84e5dc673c401f4ac3d9b7423bf611a88a7b0c0 Mon Sep 17 00:00:00 2001
|
||||
From: Naushir Patuck <naush@raspberrypi.com>
|
||||
Date: Thu, 2 Apr 2020 16:08:51 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Use dummy buffer if none have
|
||||
been queued
|
||||
|
||||
If no buffer has been queued by a userland application, we use an
|
||||
internal dummy buffer for the hardware to spin in. This will allow
|
||||
the driver to release the existing userland buffer back to the
|
||||
application for processing.
|
||||
|
||||
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
---
|
||||
.../media/platform/bcm2835/bcm2835-unicam.c | 160 ++++++++++++------
|
||||
1 file changed, 110 insertions(+), 50 deletions(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
+#include <linux/dma-mapping.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -112,6 +113,12 @@ MODULE_PARM_DESC(debug, "Debug level 0-3
|
||||
/* Default size of the embedded buffer */
|
||||
#define UNICAM_EMBEDDED_SIZE 8192
|
||||
|
||||
+/*
|
||||
+ * Size of the dummy buffer. Can be any size really, but the DMA
|
||||
+ * allocation works in units of page sizes.
|
||||
+ */
|
||||
+#define DUMMY_BUF_SIZE (PAGE_SIZE)
|
||||
+
|
||||
enum pad_types {
|
||||
IMAGE_PAD,
|
||||
METADATA_PAD,
|
||||
@@ -390,6 +397,12 @@ struct unicam_node {
|
||||
struct media_pad pad;
|
||||
struct v4l2_ctrl_handler ctrl_handler;
|
||||
unsigned int embedded_lines;
|
||||
+ /*
|
||||
+ * Dummy buffer intended to be used by unicam
|
||||
+ * if we have no other queued buffers to swap to.
|
||||
+ */
|
||||
+ void *dummy_buf_cpu_addr;
|
||||
+ dma_addr_t dummy_buf_dma_addr;
|
||||
};
|
||||
|
||||
struct unicam_device {
|
||||
@@ -661,27 +674,24 @@ static int unicam_reset_format(struct un
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void unicam_wr_dma_addr(struct unicam_device *dev, dma_addr_t dmaaddr,
|
||||
- int pad_id)
|
||||
+static void unicam_wr_dma_addr(struct unicam_cfg *cfg, dma_addr_t dmaaddr,
|
||||
+ unsigned int buffer_size, int pad_id)
|
||||
{
|
||||
- dma_addr_t endaddr;
|
||||
+ dma_addr_t endaddr = dmaaddr + buffer_size;
|
||||
|
||||
/*
|
||||
- * dmaaddr should be a 32-bit address with the top two bits set to 0x3
|
||||
- * to signify uncached access through the Videocore memory controller.
|
||||
+ * dmaaddr and endaddr should be a 32-bit address with the top two bits
|
||||
+ * set to 0x3 to signify uncached access through the Videocore memory
|
||||
+ * controller.
|
||||
*/
|
||||
- BUG_ON((dmaaddr >> 30) != 0x3);
|
||||
+ BUG_ON((dmaaddr >> 30) != 0x3 && (endaddr >> 30) != 0x3);
|
||||
|
||||
if (pad_id == IMAGE_PAD) {
|
||||
- endaddr = dmaaddr +
|
||||
- dev->node[IMAGE_PAD].v_fmt.fmt.pix.sizeimage;
|
||||
- reg_write(&dev->cfg, UNICAM_IBSA0, dmaaddr);
|
||||
- reg_write(&dev->cfg, UNICAM_IBEA0, endaddr);
|
||||
+ reg_write(cfg, UNICAM_IBSA0, dmaaddr);
|
||||
+ reg_write(cfg, UNICAM_IBEA0, endaddr);
|
||||
} else {
|
||||
- endaddr = dmaaddr +
|
||||
- dev->node[METADATA_PAD].v_fmt.fmt.meta.buffersize;
|
||||
- reg_write(&dev->cfg, UNICAM_DBSA0, dmaaddr);
|
||||
- reg_write(&dev->cfg, UNICAM_DBEA0, endaddr);
|
||||
+ reg_write(cfg, UNICAM_DBSA0, dmaaddr);
|
||||
+ reg_write(cfg, UNICAM_DBEA0, endaddr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,6 +714,7 @@ static inline void unicam_schedule_next_
|
||||
struct unicam_device *dev = node->dev;
|
||||
struct unicam_dmaqueue *dma_q = &node->dma_queue;
|
||||
struct unicam_buffer *buf;
|
||||
+ unsigned int size;
|
||||
dma_addr_t addr;
|
||||
|
||||
buf = list_entry(dma_q->active.next, struct unicam_buffer, list);
|
||||
@@ -711,7 +722,23 @@ static inline void unicam_schedule_next_
|
||||
list_del(&buf->list);
|
||||
|
||||
addr = vb2_dma_contig_plane_dma_addr(&buf->vb.vb2_buf, 0);
|
||||
- unicam_wr_dma_addr(dev, addr, node->pad_id);
|
||||
+ size = (node->pad_id == IMAGE_PAD) ?
|
||||
+ dev->node[IMAGE_PAD].v_fmt.fmt.pix.sizeimage :
|
||||
+ dev->node[METADATA_PAD].v_fmt.fmt.meta.buffersize;
|
||||
+
|
||||
+ unicam_wr_dma_addr(&dev->cfg, addr, size, node->pad_id);
|
||||
+}
|
||||
+
|
||||
+static inline void unicam_schedule_dummy_buffer(struct unicam_node *node)
|
||||
+{
|
||||
+ struct unicam_device *dev = node->dev;
|
||||
+ dma_addr_t addr = node->dummy_buf_dma_addr;
|
||||
+
|
||||
+ unicam_dbg(3, dev, "Scheduling dummy buffer for node %d\n",
|
||||
+ node->pad_id);
|
||||
+
|
||||
+ unicam_wr_dma_addr(&dev->cfg, addr, DUMMY_BUF_SIZE, node->pad_id);
|
||||
+ node->next_frm = NULL;
|
||||
}
|
||||
|
||||
static inline void unicam_process_buffer_complete(struct unicam_node *node,
|
||||
@@ -721,7 +748,6 @@ static inline void unicam_process_buffer
|
||||
node->cur_frm->vb.sequence = sequence;
|
||||
|
||||
vb2_buffer_done(&node->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
|
||||
- node->cur_frm = node->next_frm;
|
||||
}
|
||||
|
||||
static int unicam_num_nodes_streaming(struct unicam_device *dev)
|
||||
@@ -788,6 +814,28 @@ static irqreturn_t unicam_isr(int irq, v
|
||||
if (!(sta && (UNICAM_IS | UNICAM_PI0)))
|
||||
return IRQ_HANDLED;
|
||||
|
||||
+ /*
|
||||
+ * We must run the frame end handler first. If we have a valid next_frm
|
||||
+ * and we get a simultaneout FE + FS interrupt, running the FS handler
|
||||
+ * first would null out the next_frm ptr and we would have lost the
|
||||
+ * buffer forever.
|
||||
+ */
|
||||
+ if (ista & UNICAM_FEI || sta & UNICAM_PI0) {
|
||||
+ /*
|
||||
+ * Ensure we have swapped buffers already as we can't
|
||||
+ * stop the peripheral. If no buffer is available, use a
|
||||
+ * dummy buffer to dump out frames until we get a new buffer
|
||||
+ * to use.
|
||||
+ */
|
||||
+ for (i = 0; i < num_nodes_streaming; i++) {
|
||||
+ if (unicam->node[i].cur_frm)
|
||||
+ unicam_process_buffer_complete(&unicam->node[i],
|
||||
+ sequence);
|
||||
+ unicam->node[i].cur_frm = unicam->node[i].next_frm;
|
||||
+ }
|
||||
+ unicam->sequence++;
|
||||
+ }
|
||||
+
|
||||
if (ista & UNICAM_FSI) {
|
||||
/*
|
||||
* Timestamp is to be when the first data byte was captured,
|
||||
@@ -798,24 +846,16 @@ static irqreturn_t unicam_isr(int irq, v
|
||||
if (unicam->node[i].cur_frm)
|
||||
unicam->node[i].cur_frm->vb.vb2_buf.timestamp =
|
||||
ts;
|
||||
+ /*
|
||||
+ * Set the next frame output to go to a dummy frame
|
||||
+ * if we have not managed to obtain another frame
|
||||
+ * from the queue.
|
||||
+ */
|
||||
+ unicam_schedule_dummy_buffer(&unicam->node[i]);
|
||||
}
|
||||
}
|
||||
- if (ista & UNICAM_FEI || sta & UNICAM_PI0) {
|
||||
- /*
|
||||
- * Ensure we have swapped buffers already as we can't
|
||||
- * stop the peripheral. Overwrite the frame we've just
|
||||
- * captured instead.
|
||||
- */
|
||||
- for (i = 0; i < num_nodes_streaming; i++) {
|
||||
- if (unicam->node[i].cur_frm &&
|
||||
- unicam->node[i].cur_frm != unicam->node[i].next_frm)
|
||||
- unicam_process_buffer_complete(&unicam->node[i],
|
||||
- sequence);
|
||||
- }
|
||||
- unicam->sequence++;
|
||||
- }
|
||||
-
|
||||
- /* Cannot swap buffer at frame end, there may be a race condition
|
||||
+ /*
|
||||
+ * Cannot swap buffer at frame end, there may be a race condition
|
||||
* where the HW does not actually swap it if the new frame has
|
||||
* already started.
|
||||
*/
|
||||
@@ -823,7 +863,7 @@ static irqreturn_t unicam_isr(int irq, v
|
||||
for (i = 0; i < num_nodes_streaming; i++) {
|
||||
spin_lock(&unicam->node[i].dma_queue_lock);
|
||||
if (!list_empty(&unicam->node[i].dma_queue.active) &&
|
||||
- unicam->node[i].cur_frm == unicam->node[i].next_frm)
|
||||
+ !unicam->node[i].next_frm)
|
||||
unicam_schedule_next_buffer(&unicam->node[i]);
|
||||
spin_unlock(&unicam->node[i].dma_queue_lock);
|
||||
}
|
||||
@@ -1352,7 +1392,7 @@ static void unicam_start_rx(struct unica
|
||||
{
|
||||
struct unicam_cfg *cfg = &dev->cfg;
|
||||
int line_int_freq = dev->node[IMAGE_PAD].v_fmt.fmt.pix.height >> 2;
|
||||
- unsigned int i;
|
||||
+ unsigned int size, i;
|
||||
u32 val;
|
||||
|
||||
if (line_int_freq < 128)
|
||||
@@ -1413,7 +1453,7 @@ static void unicam_start_rx(struct unica
|
||||
reg_write_field(cfg, UNICAM_ANA, 0, UNICAM_DDL);
|
||||
|
||||
/* Always start in trigger frame capture mode (UNICAM_FCM set) */
|
||||
- val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM;
|
||||
+ val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB;
|
||||
set_field(&val, line_int_freq, UNICAM_LCIE_MASK);
|
||||
reg_write(cfg, UNICAM_ICTL, val);
|
||||
reg_write(cfg, UNICAM_STA, UNICAM_STA_MASK_ALL);
|
||||
@@ -1501,7 +1541,8 @@ static void unicam_start_rx(struct unica
|
||||
|
||||
reg_write(&dev->cfg, UNICAM_IBLS,
|
||||
dev->node[IMAGE_PAD].v_fmt.fmt.pix.bytesperline);
|
||||
- unicam_wr_dma_addr(dev, addr[IMAGE_PAD], IMAGE_PAD);
|
||||
+ size = dev->node[IMAGE_PAD].v_fmt.fmt.pix.sizeimage;
|
||||
+ unicam_wr_dma_addr(&dev->cfg, addr[IMAGE_PAD], size, IMAGE_PAD);
|
||||
unicam_set_packing_config(dev);
|
||||
unicam_cfg_image_id(dev);
|
||||
|
||||
@@ -1511,8 +1552,10 @@ static void unicam_start_rx(struct unica
|
||||
reg_write(cfg, UNICAM_MISC, val);
|
||||
|
||||
if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data) {
|
||||
+ size = dev->node[METADATA_PAD].v_fmt.fmt.meta.buffersize;
|
||||
unicam_enable_ed(dev);
|
||||
- unicam_wr_dma_addr(dev, addr[METADATA_PAD], METADATA_PAD);
|
||||
+ unicam_wr_dma_addr(&dev->cfg, addr[METADATA_PAD], size,
|
||||
+ METADATA_PAD);
|
||||
}
|
||||
|
||||
/* Enable peripheral */
|
||||
@@ -1686,13 +1729,14 @@ static void unicam_stop_streaming(struct
|
||||
unicam_runtime_put(dev);
|
||||
|
||||
} else if (node->pad_id == METADATA_PAD) {
|
||||
- /* Null out the embedded data buffer address so the HW does
|
||||
- * not use it. This is only really needed if the embedded data
|
||||
- * pad is disabled before the image pad. The 0x3 in the top two
|
||||
- * bits signifies uncached accesses through the Videocore
|
||||
- * memory controller.
|
||||
+ /* Allow the hardware to spin in the dummy buffer.
|
||||
+ * This is only really needed if the embedded data pad is
|
||||
+ * disabled before the image pad. The 0x3 in the top two bits
|
||||
+ * signifies uncached accesses through the Videocore memory
|
||||
+ * controller.
|
||||
*/
|
||||
- unicam_wr_dma_addr(dev, 0xc0000000, METADATA_PAD);
|
||||
+ unicam_wr_dma_addr(&dev->cfg, node->dummy_buf_dma_addr,
|
||||
+ DUMMY_BUF_SIZE, METADATA_PAD);
|
||||
}
|
||||
|
||||
/* Clear all queued buffers for the node */
|
||||
@@ -2321,6 +2365,15 @@ static int register_node(struct unicam_d
|
||||
video_set_drvdata(vdev, node);
|
||||
vdev->entity.flags |= MEDIA_ENT_FL_DEFAULT;
|
||||
|
||||
+ node->dummy_buf_cpu_addr = dma_alloc_coherent(&unicam->pdev->dev,
|
||||
+ DUMMY_BUF_SIZE,
|
||||
+ &node->dummy_buf_dma_addr,
|
||||
+ GFP_ATOMIC);
|
||||
+ if (!node->dummy_buf_cpu_addr) {
|
||||
+ unicam_err(unicam, "Unable to allocate dummy buffer.\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
if (node->pad_id == METADATA_PAD ||
|
||||
!v4l2_subdev_has_op(unicam->sensor, video, s_std)) {
|
||||
v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_STD);
|
||||
@@ -2376,13 +2429,20 @@ static int register_node(struct unicam_d
|
||||
|
||||
static void unregister_nodes(struct unicam_device *unicam)
|
||||
{
|
||||
- if (unicam->node[IMAGE_PAD].registered) {
|
||||
- video_unregister_device(&unicam->node[IMAGE_PAD].video_dev);
|
||||
- unicam->node[IMAGE_PAD].registered = 0;
|
||||
- }
|
||||
- if (unicam->node[METADATA_PAD].registered) {
|
||||
- video_unregister_device(&unicam->node[METADATA_PAD].video_dev);
|
||||
- unicam->node[METADATA_PAD].registered = 0;
|
||||
+ struct unicam_node *node;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < MAX_NODES; i++) {
|
||||
+ node = &unicam->node[i];
|
||||
+ if (node->dummy_buf_cpu_addr) {
|
||||
+ dma_free_coherent(&unicam->pdev->dev, DUMMY_BUF_SIZE,
|
||||
+ node->dummy_buf_cpu_addr,
|
||||
+ node->dummy_buf_dma_addr);
|
||||
+ }
|
||||
+ if (node->registered) {
|
||||
+ video_unregister_device(&node->video_dev);
|
||||
+ node->registered = 0;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
@ -1,31 +0,0 @@
|
||||
From e60e756a1354d248a01b4e1cd231c0ceb9d97a20 Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Date: Tue, 24 Mar 2020 23:13:02 +0200
|
||||
Subject: [PATCH] media: bcm2835-unicam: Disable event-related ioctls
|
||||
on metadata node
|
||||
|
||||
The unicam driver supports both the SOURCE_CHANGE and CTRL events. Both
|
||||
events are only generated on the image video node, so the event-related
|
||||
ioctls are useless on the medatada node. Disable them.
|
||||
|
||||
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
||||
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -2374,6 +2374,11 @@ static int register_node(struct unicam_d
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
+ if (node->pad_id == METADATA_PAD) {
|
||||
+ v4l2_disable_ioctl(vdev, VIDIOC_DQEVENT);
|
||||
+ v4l2_disable_ioctl(vdev, VIDIOC_SUBSCRIBE_EVENT);
|
||||
+ v4l2_disable_ioctl(vdev, VIDIOC_UNSUBSCRIBE_EVENT);
|
||||
+ }
|
||||
if (node->pad_id == METADATA_PAD ||
|
||||
!v4l2_subdev_has_op(unicam->sensor, video, s_std)) {
|
||||
v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_STD);
|
@ -1,55 +0,0 @@
|
||||
From 507598bd205c63215a636e80acb95772f65a712e Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Date: Tue, 24 Mar 2020 23:13:02 +0200
|
||||
Subject: [PATCH] media: bcm2835-unicam: Add support for the FRAME_SYNC
|
||||
event
|
||||
|
||||
The FRAME_SYNC event is useful for userspace image processing algorithms
|
||||
to program the camera sensor as early as possible after frame start.
|
||||
Support it.
|
||||
|
||||
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
||||
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
||||
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -772,6 +772,16 @@ static int unicam_all_nodes_disabled(str
|
||||
!dev->node[METADATA_PAD].streaming;
|
||||
}
|
||||
|
||||
+static void unicam_queue_event_sof(struct unicam_device *unicam)
|
||||
+{
|
||||
+ struct v4l2_event event = {
|
||||
+ .type = V4L2_EVENT_FRAME_SYNC,
|
||||
+ .u.frame_sync.frame_sequence = unicam->sequence,
|
||||
+ };
|
||||
+
|
||||
+ v4l2_event_queue(&unicam->node[IMAGE_PAD].video_dev, &event);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* unicam_isr : ISR handler for unicam capture
|
||||
* @irq: irq number
|
||||
@@ -853,6 +863,8 @@ static irqreturn_t unicam_isr(int irq, v
|
||||
*/
|
||||
unicam_schedule_dummy_buffer(&unicam->node[i]);
|
||||
}
|
||||
+
|
||||
+ unicam_queue_event_sof(unicam);
|
||||
}
|
||||
/*
|
||||
* Cannot swap buffer at frame end, there may be a race condition
|
||||
@@ -2022,6 +2034,8 @@ static int unicam_subscribe_event(struct
|
||||
const struct v4l2_event_subscription *sub)
|
||||
{
|
||||
switch (sub->type) {
|
||||
+ case V4L2_EVENT_FRAME_SYNC:
|
||||
+ return v4l2_event_subscribe(fh, sub, 2, NULL);
|
||||
case V4L2_EVENT_SOURCE_CHANGE:
|
||||
return v4l2_event_subscribe(fh, sub, 4, NULL);
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
From 15af88c051fb4807a5e8bb265288de52a650aea7 Mon Sep 17 00:00:00 2001
|
||||
From: Naushir Patuck <naush@raspberrypi.com>
|
||||
Date: Tue, 21 Apr 2020 16:26:03 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Re-fetch mbus code from subdev
|
||||
on a g_fmt call
|
||||
|
||||
The sensor subdevice may change the Bayer order if a H/V flip is
|
||||
requested after a s_fmt call. Unicam g_fmt must call the subdev get_fmt
|
||||
in case this has happened and return out the correct format 4cc.
|
||||
|
||||
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
---
|
||||
.../media/platform/bcm2835/bcm2835-unicam.c | 21 ++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -967,11 +967,30 @@ static int unicam_enum_fmt_vid_cap(struc
|
||||
static int unicam_g_fmt_vid_cap(struct file *file, void *priv,
|
||||
struct v4l2_format *f)
|
||||
{
|
||||
+ struct v4l2_mbus_framefmt mbus_fmt = {0};
|
||||
struct unicam_node *node = video_drvdata(file);
|
||||
+ struct unicam_device *dev = node->dev;
|
||||
+ const struct unicam_fmt *fmt = NULL;
|
||||
+ int ret;
|
||||
|
||||
- if (node->pad_id == METADATA_PAD)
|
||||
+ if (node->pad_id != IMAGE_PAD)
|
||||
return -EINVAL;
|
||||
|
||||
+ /*
|
||||
+ * If a flip has occurred in the sensor, the fmt code might have
|
||||
+ * changed. So we will need to re-fetch the format from the subdevice.
|
||||
+ */
|
||||
+ ret = __subdev_get_format(dev, &mbus_fmt, node->pad_id);
|
||||
+ if (ret)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Find the V4L2 format from mbus code. We must match a known format. */
|
||||
+ fmt = find_format_by_code(mbus_fmt.code);
|
||||
+ if (!fmt)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ node->fmt = fmt;
|
||||
+ node->v_fmt.fmt.pix.pixelformat = fmt->fourcc;
|
||||
*f = node->v_fmt;
|
||||
|
||||
return 0;
|
@ -1,82 +0,0 @@
|
||||
From 2a6df1416027768c6e6f01ef39659b8b2e95f034 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 29 Apr 2020 16:45:02 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Add support for
|
||||
VIDIOC_[S|G]_SELECTION
|
||||
|
||||
Sensors are now reflecting cropping and scaling parameters through
|
||||
the selection API, therefore Unicam needs to forward the requests
|
||||
through to the subdev.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
.../media/platform/bcm2835/bcm2835-unicam.c | 44 +++++++++++++++++++
|
||||
1 file changed, 44 insertions(+)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -1898,6 +1898,39 @@ static int unicam_g_edid(struct file *fi
|
||||
return v4l2_subdev_call(dev->sensor, pad, get_edid, edid);
|
||||
}
|
||||
|
||||
+static int unicam_s_selection(struct file *file, void *priv,
|
||||
+ struct v4l2_selection *sel)
|
||||
+{
|
||||
+ struct unicam_node *node = video_drvdata(file);
|
||||
+ struct unicam_device *dev = node->dev;
|
||||
+ struct v4l2_subdev_selection sdsel = {
|
||||
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
|
||||
+ .target = sel->target,
|
||||
+ .flags = sel->flags,
|
||||
+ .r = sel->r,
|
||||
+ };
|
||||
+
|
||||
+ return v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel);
|
||||
+}
|
||||
+
|
||||
+static int unicam_g_selection(struct file *file, void *priv,
|
||||
+ struct v4l2_selection *sel)
|
||||
+{
|
||||
+ struct unicam_node *node = video_drvdata(file);
|
||||
+ struct unicam_device *dev = node->dev;
|
||||
+ struct v4l2_subdev_selection sdsel = {
|
||||
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
|
||||
+ .target = sel->target,
|
||||
+ };
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = v4l2_subdev_call(dev->sensor, pad, get_selection, NULL, &sdsel);
|
||||
+ if (!ret)
|
||||
+ sel->r = sdsel.r;
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int unicam_enum_framesizes(struct file *file, void *priv,
|
||||
struct v4l2_frmsizeenum *fsize)
|
||||
{
|
||||
@@ -2218,6 +2251,9 @@ static const struct v4l2_ioctl_ops unica
|
||||
.vidioc_enum_framesizes = unicam_enum_framesizes,
|
||||
.vidioc_enum_frameintervals = unicam_enum_frameintervals,
|
||||
|
||||
+ .vidioc_g_selection = unicam_g_selection,
|
||||
+ .vidioc_s_selection = unicam_s_selection,
|
||||
+
|
||||
.vidioc_g_parm = unicam_g_parm,
|
||||
.vidioc_s_parm = unicam_s_parm,
|
||||
|
||||
@@ -2446,6 +2482,14 @@ static int register_node(struct unicam_d
|
||||
!v4l2_subdev_has_op(unicam->sensor, pad, enum_frame_size))
|
||||
v4l2_disable_ioctl(&node->video_dev, VIDIOC_ENUM_FRAMESIZES);
|
||||
|
||||
+ if (node->pad_id == METADATA_PAD ||
|
||||
+ !v4l2_subdev_has_op(unicam->sensor, pad, set_selection))
|
||||
+ v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_SELECTION);
|
||||
+
|
||||
+ if (node->pad_id == METADATA_PAD ||
|
||||
+ !v4l2_subdev_has_op(unicam->sensor, pad, get_selection))
|
||||
+ v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_SELECTION);
|
||||
+
|
||||
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
|
||||
if (ret) {
|
||||
unicam_err(unicam, "Unable to register video device.\n");
|
@ -1,28 +0,0 @@
|
||||
From 8e878b9ef7d6078e5facad9ebc0eacca9cbe3688 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 29 Apr 2020 22:05:09 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Do not stop streaming in
|
||||
unicam_release
|
||||
|
||||
unicam_release calls _vb2_fop_release, which will call stop_streaming
|
||||
if that particular node was streaming. Calling it unconditionally (as
|
||||
the code was) means that if a second handle was opened eg to alter
|
||||
a setting, on closing that connection it also stopped Unicam.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -2204,9 +2204,6 @@ static int unicam_release(struct file *f
|
||||
if (fh_singular)
|
||||
v4l2_subdev_call(sd, core, s_power, 0);
|
||||
|
||||
- if (node->streaming)
|
||||
- unicam_stop_streaming(&node->buffer_queue);
|
||||
-
|
||||
node->open--;
|
||||
mutex_unlock(&node->lock);
|
||||
|
@ -1,38 +0,0 @@
|
||||
From 25ab75ec729423e9e230ef3fe027c275ab17addb Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 30 Apr 2020 09:52:50 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Fix reference counting in
|
||||
unicam_open
|
||||
|
||||
The reference counting of node->open was only incremented after
|
||||
a check that the node was v4l2_fh_is_singular_file, which resulted
|
||||
in the counting going wrong and s_power not being called at an
|
||||
appropriate time.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -2170,16 +2170,18 @@ static int unicam_open(struct file *file
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
+ node->open++;
|
||||
+
|
||||
if (!v4l2_fh_is_singular_file(file))
|
||||
goto unlock;
|
||||
|
||||
ret = v4l2_subdev_call(dev->sensor, core, s_power, 1);
|
||||
if (ret < 0 && ret != -ENOIOCTLCMD) {
|
||||
v4l2_fh_release(file);
|
||||
+ node->open--;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
- node->open++;
|
||||
ret = 0;
|
||||
|
||||
unlock:
|
@ -1,21 +0,0 @@
|
||||
From 9daa9e4fe269c5b1fbdeee4e8219ac204b84c72c Mon Sep 17 00:00:00 2001
|
||||
From: Jacko Dirks <jdirks.linuxdev@gmail.com>
|
||||
Date: Tue, 5 May 2020 14:33:31 +0200
|
||||
Subject: [PATCH] media: bcm2835: unicam: Fix uninitialized warning
|
||||
|
||||
Signed-off-by: Jacko Dirks <jdirks.linuxdev@gmail.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -1001,7 +1001,7 @@ const struct unicam_fmt *get_first_suppo
|
||||
{
|
||||
struct v4l2_subdev_mbus_code_enum mbus_code;
|
||||
const struct unicam_fmt *fmt = NULL;
|
||||
- int ret;
|
||||
+ int ret = 0;
|
||||
int j;
|
||||
|
||||
for (j = 0; ret != -EINVAL && ret != -ENOIOCTLCMD; ++j) {
|
@ -1,130 +0,0 @@
|
||||
From d46001f333424af540e02d2a19c11205d40a11f3 Mon Sep 17 00:00:00 2001
|
||||
From: Naushir Patuck <naush@raspberrypi.com>
|
||||
Date: Thu, 7 May 2020 15:50:54 +0100
|
||||
Subject: [PATCH] dt-bindings: media: i2c: Add IMX477 CMOS sensor
|
||||
binding
|
||||
|
||||
Add YAML device tree binding for IMX477 CMOS image sensor.
|
||||
|
||||
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
---
|
||||
.../devicetree/bindings/media/i2c/imx477.yaml | 113 ++++++++++++++++++
|
||||
1 file changed, 113 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/media/i2c/imx477.yaml
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/media/i2c/imx477.yaml
|
||||
@@ -0,0 +1,113 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/media/i2c/imx477.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Sony 1/2.3-Inch 12Mpixel CMOS Digital Image Sensor
|
||||
+
|
||||
+maintainers:
|
||||
+ - Naushir Patuck <naush@raspberypi.com>
|
||||
+
|
||||
+description: |-
|
||||
+ The Sony IMX477 is a 1/2.3-inch CMOS active pixel digital image sensor
|
||||
+ with an active array size of 4056H x 3040V. It is programmable through
|
||||
+ I2C interface. The I2C address is fixed to 0x1A as per sensor data sheet.
|
||||
+ Image data is sent through MIPI CSI-2, which is configured as either 2 or
|
||||
+ 4 data lanes.
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ const: sony,imx477
|
||||
+
|
||||
+ reg:
|
||||
+ description: I2C device address
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ clocks:
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ VDIG-supply:
|
||||
+ description:
|
||||
+ Digital I/O voltage supply, 1.05 volts
|
||||
+
|
||||
+ VANA-supply:
|
||||
+ description:
|
||||
+ Analog voltage supply, 2.8 volts
|
||||
+
|
||||
+ VDDL-supply:
|
||||
+ description:
|
||||
+ Digital core voltage supply, 1.8 volts
|
||||
+
|
||||
+ reset-gpios:
|
||||
+ description: |-
|
||||
+ Reference to the GPIO connected to the xclr pin, if any.
|
||||
+ Must be released (set high) after all all supplies and INCK are applied.
|
||||
+
|
||||
+ # See ../video-interfaces.txt for more details
|
||||
+ port:
|
||||
+ type: object
|
||||
+ properties:
|
||||
+ endpoint:
|
||||
+ type: object
|
||||
+ properties:
|
||||
+ data-lanes:
|
||||
+ description: |-
|
||||
+ The sensor supports either two-lane, or four-lane operation.
|
||||
+ For two-lane operation the property must be set to <1 2>.
|
||||
+ items:
|
||||
+ - const: 1
|
||||
+ - const: 2
|
||||
+
|
||||
+ clock-noncontinuous:
|
||||
+ type: boolean
|
||||
+ description: |-
|
||||
+ MIPI CSI-2 clock is non-continuous if this property is present,
|
||||
+ otherwise it's continuous.
|
||||
+
|
||||
+ link-frequencies:
|
||||
+ allOf:
|
||||
+ - $ref: /schemas/types.yaml#/definitions/uint64-array
|
||||
+ description:
|
||||
+ Allowed data bus frequencies.
|
||||
+
|
||||
+ required:
|
||||
+ - link-frequencies
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+ - reg
|
||||
+ - clocks
|
||||
+ - VANA-supply
|
||||
+ - VDIG-supply
|
||||
+ - VDDL-supply
|
||||
+ - port
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ i2c0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ imx477: sensor@10 {
|
||||
+ compatible = "sony,imx477";
|
||||
+ reg = <0x1a>;
|
||||
+ clocks = <&imx477_clk>;
|
||||
+ VANA-supply = <&imx477_vana>; /* 2.8v */
|
||||
+ VDIG-supply = <&imx477_vdig>; /* 1.05v */
|
||||
+ VDDL-supply = <&imx477_vddl>; /* 1.8v */
|
||||
+
|
||||
+ port {
|
||||
+ imx477_0: endpoint {
|
||||
+ remote-endpoint = <&csi1_ep>;
|
||||
+ data-lanes = <1 2>;
|
||||
+ clock-noncontinuous;
|
||||
+ link-frequencies = /bits/ 64 <450000000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+...
|
@ -1,51 +0,0 @@
|
||||
From 04d21a5b2bbfee3b0a09c72ea5c11cfef10b08c1 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 13 May 2020 18:28:27 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: Always service interrupts
|
||||
|
||||
From when bringing up the driver, there was a check in the isr
|
||||
to ignore interrupts (claiming them handled) should the driver
|
||||
not be streaming.
|
||||
|
||||
The VPU now will not register a camera driver if it finds a
|
||||
CSI2 node enabled in device tree, therefore this flawed check is
|
||||
redundant.
|
||||
|
||||
https://github.com/raspberrypi/linux/issues/3602
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 15 ---------------
|
||||
1 file changed, 15 deletions(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -766,12 +766,6 @@ static int unicam_all_nodes_streaming(st
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int unicam_all_nodes_disabled(struct unicam_device *dev)
|
||||
-{
|
||||
- return !dev->node[IMAGE_PAD].streaming &&
|
||||
- !dev->node[METADATA_PAD].streaming;
|
||||
-}
|
||||
-
|
||||
static void unicam_queue_event_sof(struct unicam_device *unicam)
|
||||
{
|
||||
struct v4l2_event event = {
|
||||
@@ -801,15 +795,6 @@ static irqreturn_t unicam_isr(int irq, v
|
||||
u64 ts;
|
||||
int i;
|
||||
|
||||
- /*
|
||||
- * Don't service interrupts if not streaming.
|
||||
- * Avoids issues if the VPU should enable the
|
||||
- * peripheral without the kernel knowing (that
|
||||
- * shouldn't happen, but causes issues if it does).
|
||||
- */
|
||||
- if (unicam_all_nodes_disabled(unicam))
|
||||
- return IRQ_HANDLED;
|
||||
-
|
||||
sta = reg_read(cfg, UNICAM_STA);
|
||||
/* Write value back to clear the interrupts */
|
||||
reg_write(cfg, UNICAM_STA, sta);
|
@ -1,70 +0,0 @@
|
||||
From e37d08d5cc0eece55a886f52ef35ac148acabe08 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Wed, 13 May 2020 20:10:15 +0100
|
||||
Subject: [PATCH] sc16is7xx: Fix for hardware flow control
|
||||
|
||||
The SC16IS7XX hardware flow control is mishandled by the driver in
|
||||
a number of ways:
|
||||
|
||||
1. The set_baud method accidentally clears it when setting EFR bit.
|
||||
2. Even though hardware flow control is enabled, it isn't indicated
|
||||
back to the serial framework.
|
||||
3. Applying the flow control clears the EFR bit.
|
||||
4. The CTS support is not indicated in the return from
|
||||
sc16is7xx_get_mctrl.
|
||||
|
||||
Address all of those issues using a mixture of patches found on the
|
||||
linked pages.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/2542
|
||||
See: https://www.spinics.net/lists/linux-serial/msg21794.html
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/tty/serial/sc16is7xx.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/tty/serial/sc16is7xx.c
|
||||
+++ b/drivers/tty/serial/sc16is7xx.c
|
||||
@@ -524,8 +524,9 @@ static int sc16is7xx_set_baud(struct uar
|
||||
|
||||
/* Enable enhanced features */
|
||||
regcache_cache_bypass(s->regmap, true);
|
||||
- sc16is7xx_port_write(port, SC16IS7XX_EFR_REG,
|
||||
- SC16IS7XX_EFR_ENABLE_BIT);
|
||||
+ sc16is7xx_port_update(port, SC16IS7XX_EFR_REG,
|
||||
+ SC16IS7XX_EFR_ENABLE_BIT,
|
||||
+ SC16IS7XX_EFR_ENABLE_BIT);
|
||||
regcache_cache_bypass(s->regmap, false);
|
||||
|
||||
/* Put LCR back to the normal mode */
|
||||
@@ -855,7 +856,7 @@ static unsigned int sc16is7xx_get_mctrl(
|
||||
/* DCD and DSR are not wired and CTS/RTS is handled automatically
|
||||
* so just indicate DSR and CAR asserted
|
||||
*/
|
||||
- return TIOCM_DSR | TIOCM_CAR;
|
||||
+ return TIOCM_DSR | TIOCM_CAR | TIOCM_RI | TIOCM_CTS;
|
||||
}
|
||||
|
||||
static void sc16is7xx_set_mctrl(struct uart_port *port, unsigned int mctrl)
|
||||
@@ -942,14 +943,19 @@ static void sc16is7xx_set_termios(struct
|
||||
regcache_cache_bypass(s->regmap, true);
|
||||
sc16is7xx_port_write(port, SC16IS7XX_XON1_REG, termios->c_cc[VSTART]);
|
||||
sc16is7xx_port_write(port, SC16IS7XX_XOFF1_REG, termios->c_cc[VSTOP]);
|
||||
- if (termios->c_cflag & CRTSCTS)
|
||||
+ if (termios->c_cflag & CRTSCTS) {
|
||||
flow |= SC16IS7XX_EFR_AUTOCTS_BIT |
|
||||
SC16IS7XX_EFR_AUTORTS_BIT;
|
||||
+ port->status |= UPSTAT_AUTOCTS;
|
||||
+ };
|
||||
if (termios->c_iflag & IXON)
|
||||
flow |= SC16IS7XX_EFR_SWFLOW3_BIT;
|
||||
if (termios->c_iflag & IXOFF)
|
||||
flow |= SC16IS7XX_EFR_SWFLOW1_BIT;
|
||||
|
||||
+ /* Always set enable enhanced */
|
||||
+ flow |= SC16IS7XX_EFR_ENABLE_BIT;
|
||||
+
|
||||
sc16is7xx_port_write(port, SC16IS7XX_EFR_REG, flow);
|
||||
regcache_cache_bypass(s->regmap, false);
|
||||
|
@ -1,28 +0,0 @@
|
||||
From a516ca77e73d369486803865e06a6854b6f0dd97 Mon Sep 17 00:00:00 2001
|
||||
From: David Plowman <david.plowman@raspberrypi.com>
|
||||
Date: Thu, 28 May 2020 11:09:48 +0100
|
||||
Subject: [PATCH] media: bcm2835-unicam: change minimum number of
|
||||
vb2_queue buffers to 1
|
||||
|
||||
Since the unicam driver was modified to write to a dummy buffer when no
|
||||
user-supplied buffer is available, it can now write to and return a
|
||||
buffer even when there's only a single one. Enable this by changing the
|
||||
min_buffers_needed in the vb2_queue; it will be useful for enabling
|
||||
still captures without allocating more memory than absolutely necessary.
|
||||
|
||||
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
|
||||
---
|
||||
drivers/media/platform/bcm2835/bcm2835-unicam.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
|
||||
@@ -2404,7 +2404,7 @@ static int register_node(struct unicam_d
|
||||
q->buf_struct_size = sizeof(struct unicam_buffer);
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &node->lock;
|
||||
- q->min_buffers_needed = 2;
|
||||
+ q->min_buffers_needed = 1;
|
||||
q->dev = &unicam->pdev->dev;
|
||||
|
||||
ret = vb2_queue_init(q);
|
@ -1,33 +0,0 @@
|
||||
From 3b5412d506f5b7f2d947346ccdda8b67c9902576 Mon Sep 17 00:00:00 2001
|
||||
From: Hristo Venev <hristo@venev.name>
|
||||
Date: Fri, 5 Jun 2020 09:22:49 +0000
|
||||
Subject: [PATCH] snd_bcm2835: disable HDMI audio when vc4 is used
|
||||
(#3640)
|
||||
|
||||
Things don't work too well when both the vc4 driver and the firmware
|
||||
driver are trying to control the same audio output:
|
||||
|
||||
[ 763.569406] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5
|
||||
|
||||
Hence, when the vc4 HDMI driver is used, let it control audio. This is done
|
||||
by introducing a new device tree property to the audio node, and
|
||||
extending the vc4-kms-v3d overlays to set it appropriately.
|
||||
|
||||
Signed-off-by: Hristo Venev <hristo@venev.name>
|
||||
---
|
||||
drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
@@ -381,7 +381,9 @@ static int snd_bcm2835_alsa_probe(struct
|
||||
}
|
||||
|
||||
if (!enable_compat_alsa) {
|
||||
- set_hdmi_enables(dev);
|
||||
+ if (!of_property_read_bool(dev->of_node, "brcm,disable-hdmi"))
|
||||
+ set_hdmi_enables(dev);
|
||||
+
|
||||
// In this mode, always enable analog output
|
||||
enable_headphones = true;
|
||||
} else {
|
@ -1,30 +0,0 @@
|
||||
From 013c1eecd74e1c40eda16fc6230e6d4ec6106d53 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Mikityanskiy <maxtram95@gmail.com>
|
||||
Date: Sat, 20 Jun 2020 15:40:00 +0300
|
||||
Subject: [PATCH] staging: bcm2835-audio: Add missing MODULE_ALIAS
|
||||
|
||||
Commit 8353fe6f1e0f ("Revert "staging: bcm2835-audio: Drop DT
|
||||
dependency"") reverts the upstream change and makes bcm2835-audio use
|
||||
device tree again, however, it also removes the MODULE_ALIAS for the
|
||||
platform device. This MODULE_ALIAS is needed, because VCHIQ registers
|
||||
bcm2835-audio as a child platform device since commit 25c7597af20d
|
||||
("staging: vchiq_arm: Register a platform device for audio"), and this
|
||||
mechanism is adopted also in the downstream kernel.
|
||||
|
||||
This commit puts back that MODULE_ALIAS to make bcm2835-audio
|
||||
autoprobing work again. The rest of VCHIQ children have their
|
||||
MODULE_ALIASes in place.
|
||||
|
||||
Fixes: 8353fe6f1e0f ("Revert "staging: bcm2835-audio: Drop DT dependency"")
|
||||
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
|
||||
---
|
||||
drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
|
||||
@@ -438,3 +438,4 @@ module_platform_driver(bcm2835_alsa_driv
|
||||
MODULE_AUTHOR("Dom Cobley");
|
||||
MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
|
||||
MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS("platform:bcm2835_audio");
|
File diff suppressed because it is too large
Load Diff
@ -1,40 +0,0 @@
|
||||
From e2d1526bc0029a25dc1aac46f63630cd876a978b Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Konovalov <andrey.konovalov@linaro.org>
|
||||
Date: Fri, 12 Jun 2020 15:53:46 +0200
|
||||
Subject: [PATCH] media: i2c: imx290: set the format before
|
||||
VIDIOC_SUBDEV_G_FMT is called
|
||||
|
||||
Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream.
|
||||
|
||||
With the current driver 'media-ctl -p' issued right after the imx290 driver
|
||||
is loaded prints:
|
||||
pad0: Source
|
||||
[fmt:unknown/0x0]
|
||||
|
||||
The format value of zero is due to the current_format field of the imx290
|
||||
struct not being initialized yet.
|
||||
|
||||
As imx290_entity_init_cfg() calls imx290_set_fmt(), the current_mode field
|
||||
is also initialized, so the line which set current_mode to a default value
|
||||
in driver's probe() function is no longer needed.
|
||||
|
||||
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
|
||||
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
||||
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -1087,6 +1087,9 @@ static int imx290_probe(struct i2c_clien
|
||||
goto free_ctrl;
|
||||
}
|
||||
|
||||
+ /* Initialize the frame format (this also sets imx290->current_mode) */
|
||||
+ imx290_entity_init_cfg(&imx290->sd, NULL);
|
||||
+
|
||||
ret = v4l2_async_register_subdev(&imx290->sd);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Could not register v4l2 device\n");
|
@ -1,264 +0,0 @@
|
||||
From 9fe4d33587bd7931e2a0decc7c4881945a1c0ab3 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 25 Jun 2020 08:28:51 +0100
|
||||
Subject: [PATCH] media: i2c: imx290: Add support for 74.25MHz clock
|
||||
|
||||
The existing driver only supported a clock of 37.125MHz, but the
|
||||
sensor also supports 74.25MHz.
|
||||
|
||||
Add the relevant register modifications to support this alternate
|
||||
clock frequency.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 119 ++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 97 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -1,6 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
- * Sony IMX290 CMOS Image Sensor Driver
|
||||
+ * Sony IMX290/327 CMOS Image Sensor Driver
|
||||
+ *
|
||||
+ * The IMX290 and IMX327 are very similar 1920x1080 1/2.8 CMOS image sensors.
|
||||
+ * IMX327 can support up to 60fps, whilst IMX290 support up to 120fps (only
|
||||
+ * 10bit and when connected over 4 CSI-2 lanes).
|
||||
*
|
||||
* Copyright (C) 2019 FRAMOS GmbH.
|
||||
*
|
||||
@@ -22,6 +26,11 @@
|
||||
#include <media/v4l2-fwnode.h>
|
||||
#include <media/v4l2-subdev.h>
|
||||
|
||||
+enum imx290_clk_index {
|
||||
+ CLK_37_125,
|
||||
+ CLK_74_25,
|
||||
+};
|
||||
+
|
||||
#define IMX290_STANDBY 0x3000
|
||||
#define IMX290_REGHOLD 0x3001
|
||||
#define IMX290_XMSTA 0x3002
|
||||
@@ -60,11 +69,16 @@ struct imx290_mode {
|
||||
|
||||
const struct imx290_regval *data;
|
||||
u32 data_size;
|
||||
+
|
||||
+ /* Clock setup can vary. Index as enum imx290_clk_index */
|
||||
+ const struct imx290_regval *clk_data[2];
|
||||
+ u32 clk_size;
|
||||
};
|
||||
|
||||
struct imx290 {
|
||||
struct device *dev;
|
||||
struct clk *xclk;
|
||||
+ u32 xclk_freq;
|
||||
struct regmap *regmap;
|
||||
u8 nlanes;
|
||||
u8 bpp;
|
||||
@@ -116,8 +130,6 @@ static const struct imx290_regval imx290
|
||||
{ 0x3018, 0x65 },
|
||||
{ 0x3019, 0x04 },
|
||||
{ 0x301a, 0x00 },
|
||||
- { 0x3444, 0x20 },
|
||||
- { 0x3445, 0x25 },
|
||||
{ 0x303a, 0x0c },
|
||||
{ 0x3040, 0x00 },
|
||||
{ 0x3041, 0x00 },
|
||||
@@ -171,6 +183,30 @@ static const struct imx290_regval imx290
|
||||
{ 0x33b3, 0x04 },
|
||||
};
|
||||
|
||||
+static const struct imx290_regval imx290_37_125mhz_clock_1080p[] = {
|
||||
+ { 0x305c, 0x18 },
|
||||
+ { 0x305d, 0x03 },
|
||||
+ { 0x305e, 0x20 },
|
||||
+ { 0x305f, 0x01 },
|
||||
+ { 0x315e, 0x1a },
|
||||
+ { 0x3164, 0x1a },
|
||||
+ { 0x3444, 0x20 },
|
||||
+ { 0x3445, 0x25 },
|
||||
+ { 0x3480, 0x49 },
|
||||
+};
|
||||
+
|
||||
+static const struct imx290_regval imx290_74_250mhz_clock_1080p[] = {
|
||||
+ { 0x305c, 0x0c },
|
||||
+ { 0x305d, 0x03 },
|
||||
+ { 0x305e, 0x10 },
|
||||
+ { 0x305f, 0x01 },
|
||||
+ { 0x315e, 0x1b },
|
||||
+ { 0x3164, 0x1b },
|
||||
+ { 0x3444, 0x40 },
|
||||
+ { 0x3445, 0x4a },
|
||||
+ { 0x3480, 0x92 },
|
||||
+};
|
||||
+
|
||||
static const struct imx290_regval imx290_1080p_settings[] = {
|
||||
/* mode settings */
|
||||
{ 0x3007, 0x00 },
|
||||
@@ -182,13 +218,6 @@ static const struct imx290_regval imx290
|
||||
{ 0x3419, 0x04 },
|
||||
{ 0x3012, 0x64 },
|
||||
{ 0x3013, 0x00 },
|
||||
- { 0x305c, 0x18 },
|
||||
- { 0x305d, 0x03 },
|
||||
- { 0x305e, 0x20 },
|
||||
- { 0x305f, 0x01 },
|
||||
- { 0x315e, 0x1a },
|
||||
- { 0x3164, 0x1a },
|
||||
- { 0x3480, 0x49 },
|
||||
/* data rate settings */
|
||||
{ 0x3405, 0x10 },
|
||||
{ 0x3446, 0x57 },
|
||||
@@ -209,6 +238,30 @@ static const struct imx290_regval imx290
|
||||
{ 0x3455, 0x00 },
|
||||
};
|
||||
|
||||
+static const struct imx290_regval imx290_37_125mhz_clock_720p[] = {
|
||||
+ { 0x305c, 0x20 },
|
||||
+ { 0x305d, 0x00 },
|
||||
+ { 0x305e, 0x20 },
|
||||
+ { 0x305f, 0x01 },
|
||||
+ { 0x315e, 0x1a },
|
||||
+ { 0x3164, 0x1a },
|
||||
+ { 0x3444, 0x20 },
|
||||
+ { 0x3445, 0x25 },
|
||||
+ { 0x3480, 0x49 },
|
||||
+};
|
||||
+
|
||||
+static const struct imx290_regval imx290_74_250mhz_clock_720p[] = {
|
||||
+ { 0x305c, 0x10 },
|
||||
+ { 0x305d, 0x00 },
|
||||
+ { 0x305e, 0x10 },
|
||||
+ { 0x305f, 0x01 },
|
||||
+ { 0x315e, 0x1b },
|
||||
+ { 0x3164, 0x1b },
|
||||
+ { 0x3444, 0x40 },
|
||||
+ { 0x3445, 0x4a },
|
||||
+ { 0x3480, 0x92 },
|
||||
+};
|
||||
+
|
||||
static const struct imx290_regval imx290_720p_settings[] = {
|
||||
/* mode settings */
|
||||
{ 0x3007, 0x10 },
|
||||
@@ -220,13 +273,6 @@ static const struct imx290_regval imx290
|
||||
{ 0x3419, 0x02 },
|
||||
{ 0x3012, 0x64 },
|
||||
{ 0x3013, 0x00 },
|
||||
- { 0x305c, 0x20 },
|
||||
- { 0x305d, 0x00 },
|
||||
- { 0x305e, 0x20 },
|
||||
- { 0x305f, 0x01 },
|
||||
- { 0x315e, 0x1a },
|
||||
- { 0x3164, 0x1a },
|
||||
- { 0x3480, 0x49 },
|
||||
/* data rate settings */
|
||||
{ 0x3405, 0x10 },
|
||||
{ 0x3446, 0x4f },
|
||||
@@ -312,6 +358,11 @@ static const struct imx290_mode imx290_m
|
||||
.link_freq_index = FREQ_INDEX_1080P,
|
||||
.data = imx290_1080p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_1080p_settings),
|
||||
+ .clk_data = {
|
||||
+ [CLK_37_125] = imx290_37_125mhz_clock_1080p,
|
||||
+ [CLK_74_25] = imx290_74_250mhz_clock_1080p,
|
||||
+ },
|
||||
+ .clk_size = ARRAY_SIZE(imx290_37_125mhz_clock_1080p),
|
||||
},
|
||||
{
|
||||
.width = 1280,
|
||||
@@ -320,6 +371,11 @@ static const struct imx290_mode imx290_m
|
||||
.link_freq_index = FREQ_INDEX_720P,
|
||||
.data = imx290_720p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_720p_settings),
|
||||
+ .clk_data = {
|
||||
+ [CLK_37_125] = imx290_37_125mhz_clock_1080p,
|
||||
+ [CLK_74_25] = imx290_74_250mhz_clock_1080p,
|
||||
+ },
|
||||
+ .clk_size = ARRAY_SIZE(imx290_37_125mhz_clock_1080p),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -331,6 +387,11 @@ static const struct imx290_mode imx290_m
|
||||
.link_freq_index = FREQ_INDEX_1080P,
|
||||
.data = imx290_1080p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_1080p_settings),
|
||||
+ .clk_data = {
|
||||
+ [CLK_37_125] = imx290_37_125mhz_clock_720p,
|
||||
+ [CLK_74_25] = imx290_74_250mhz_clock_720p,
|
||||
+ },
|
||||
+ .clk_size = ARRAY_SIZE(imx290_37_125mhz_clock_720p),
|
||||
},
|
||||
{
|
||||
.width = 1280,
|
||||
@@ -339,6 +400,11 @@ static const struct imx290_mode imx290_m
|
||||
.link_freq_index = FREQ_INDEX_720P,
|
||||
.data = imx290_720p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_720p_settings),
|
||||
+ .clk_data = {
|
||||
+ [CLK_37_125] = imx290_37_125mhz_clock_720p,
|
||||
+ [CLK_74_25] = imx290_74_250mhz_clock_720p,
|
||||
+ },
|
||||
+ .clk_size = ARRAY_SIZE(imx290_37_125mhz_clock_720p),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -712,6 +778,8 @@ static int imx290_set_hmax(struct imx290
|
||||
/* Start streaming */
|
||||
static int imx290_start_streaming(struct imx290 *imx290)
|
||||
{
|
||||
+ enum imx290_clk_index clk_idx = imx290->xclk_freq == 37125000 ?
|
||||
+ CLK_37_125 : CLK_74_25;
|
||||
int ret;
|
||||
|
||||
/* Set init register settings */
|
||||
@@ -723,6 +791,14 @@ static int imx290_start_streaming(struct
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ ret = imx290_set_register_array(imx290,
|
||||
+ imx290->current_mode->clk_data[clk_idx],
|
||||
+ imx290->current_mode->clk_size);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(imx290->dev, "Could not set clock registers\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
/* Apply the register values related to current frame format */
|
||||
ret = imx290_write_current_format(imx290);
|
||||
if (ret < 0) {
|
||||
@@ -935,7 +1011,6 @@ static int imx290_probe(struct i2c_clien
|
||||
.bus_type = V4L2_MBUS_CSI2_DPHY
|
||||
};
|
||||
struct imx290 *imx290;
|
||||
- u32 xclk_freq;
|
||||
s64 fq;
|
||||
int ret;
|
||||
|
||||
@@ -999,21 +1074,21 @@ static int imx290_probe(struct i2c_clien
|
||||
}
|
||||
|
||||
ret = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
|
||||
- &xclk_freq);
|
||||
+ &imx290->xclk_freq);
|
||||
if (ret) {
|
||||
dev_err(dev, "Could not get xclk frequency\n");
|
||||
goto free_err;
|
||||
}
|
||||
|
||||
/* external clock must be 37.125 MHz */
|
||||
- if (xclk_freq != 37125000) {
|
||||
+ if (imx290->xclk_freq != 37125000 && imx290->xclk_freq != 74250000) {
|
||||
dev_err(dev, "External clock frequency %u is not supported\n",
|
||||
- xclk_freq);
|
||||
+ imx290->xclk_freq);
|
||||
ret = -EINVAL;
|
||||
goto free_err;
|
||||
}
|
||||
|
||||
- ret = clk_set_rate(imx290->xclk, xclk_freq);
|
||||
+ ret = clk_set_rate(imx290->xclk, imx290->xclk_freq);
|
||||
if (ret) {
|
||||
dev_err(dev, "Could not set xclk frequency\n");
|
||||
goto free_err;
|
@ -1,26 +0,0 @@
|
||||
From fd92c9d240a36459944a971ef3bd7fec0ebf1400 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Jun 2020 13:41:43 +0100
|
||||
Subject: [PATCH] media: i2c: imx290: Correct range for V4L2_CID_GAIN
|
||||
to 0-238
|
||||
|
||||
The datasheet lists the gain as being 0.0 to 72.0dB in 0.3dB steps, which
|
||||
makes 238 steps total.
|
||||
Correct the 0-72 range defined in the driver.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -1120,7 +1120,7 @@ static int imx290_probe(struct i2c_clien
|
||||
v4l2_ctrl_handler_init(&imx290->ctrls, 4);
|
||||
|
||||
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
- V4L2_CID_GAIN, 0, 72, 1, 0);
|
||||
+ V4L2_CID_GAIN, 0, 238, 1, 0);
|
||||
|
||||
imx290->link_freq =
|
||||
v4l2_ctrl_new_int_menu(&imx290->ctrls, &imx290_ctrl_ops,
|
@ -1,159 +0,0 @@
|
||||
From 1ef87a70e7e946447835c8cefa0bc690c29d7ac8 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Jun 2020 14:36:40 +0100
|
||||
Subject: [PATCH] media: i2c: imx290: Convert HMAX setting into
|
||||
V4L2_CID_HBLANK
|
||||
|
||||
Userspace needs to know HBLANK if it is to work out exposure times
|
||||
and frame rates, therefore convert it to map onto V4L2_CID_HBLANK
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 66 +++++++++++++++++++++++++-------------
|
||||
1 file changed, 44 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -40,6 +40,9 @@ enum imx290_clk_index {
|
||||
#define IMX290_GAIN 0x3014
|
||||
#define IMX290_HMAX_LOW 0x301c
|
||||
#define IMX290_HMAX_HIGH 0x301d
|
||||
+#define IMX290_HMAX_MIN_2LANE 4400 /* Min of 4400 pixels = 30fps */
|
||||
+#define IMX290_HMAX_MIN_4LANE 2200 /* Min of 2200 pixels = 60fps */
|
||||
+#define IMX290_HMAX_MAX 0xffff
|
||||
#define IMX290_PGCTRL 0x308c
|
||||
#define IMX290_PHY_LANE_NUM 0x3407
|
||||
#define IMX290_CSI_LANE_MODE 0x3443
|
||||
@@ -82,6 +85,7 @@ struct imx290 {
|
||||
struct regmap *regmap;
|
||||
u8 nlanes;
|
||||
u8 bpp;
|
||||
+ u16 hmax_min;
|
||||
|
||||
struct v4l2_subdev sd;
|
||||
struct media_pad pad;
|
||||
@@ -94,6 +98,7 @@ struct imx290 {
|
||||
struct v4l2_ctrl_handler ctrls;
|
||||
struct v4l2_ctrl *link_freq;
|
||||
struct v4l2_ctrl *pixel_rate;
|
||||
+ struct v4l2_ctrl *hblank;
|
||||
|
||||
struct mutex lock;
|
||||
};
|
||||
@@ -518,6 +523,26 @@ static int imx290_set_gain(struct imx290
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int imx290_set_hmax(struct imx290 *imx290, u32 val)
|
||||
+{
|
||||
+ u32 hmax = val + imx290->current_mode->width;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = imx290_write_reg(imx290, IMX290_HMAX_LOW, (hmax & 0xff));
|
||||
+ if (ret) {
|
||||
+ dev_err(imx290->dev, "Error setting HMAX register\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = imx290_write_reg(imx290, IMX290_HMAX_HIGH, ((hmax >> 8) & 0xff));
|
||||
+ if (ret) {
|
||||
+ dev_err(imx290->dev, "Error setting HMAX register\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* Stop streaming */
|
||||
static int imx290_stop_streaming(struct imx290 *imx290)
|
||||
{
|
||||
@@ -546,6 +571,9 @@ static int imx290_set_ctrl(struct v4l2_c
|
||||
case V4L2_CID_GAIN:
|
||||
ret = imx290_set_gain(imx290, ctrl->val);
|
||||
break;
|
||||
+ case V4L2_CID_HBLANK:
|
||||
+ ret = imx290_set_hmax(imx290, ctrl->val);
|
||||
+ break;
|
||||
case V4L2_CID_TEST_PATTERN:
|
||||
if (ctrl->val) {
|
||||
imx290_write_reg(imx290, IMX290_BLKLEVEL_LOW, 0x00);
|
||||
@@ -702,6 +730,12 @@ static int imx290_set_fmt(struct v4l2_su
|
||||
if (imx290->pixel_rate)
|
||||
__v4l2_ctrl_s_ctrl_int64(imx290->pixel_rate,
|
||||
imx290_calc_pixel_rate(imx290));
|
||||
+
|
||||
+ if (imx290->hblank)
|
||||
+ __v4l2_ctrl_modify_range(imx290->hblank,
|
||||
+ imx290->hmax_min - mode->width,
|
||||
+ IMX290_HMAX_MAX - mode->width,
|
||||
+ 1, mode->hmax - mode->width);
|
||||
}
|
||||
|
||||
*format = fmt->format;
|
||||
@@ -756,25 +790,6 @@ static int imx290_write_current_format(s
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int imx290_set_hmax(struct imx290 *imx290, u32 val)
|
||||
-{
|
||||
- int ret;
|
||||
-
|
||||
- ret = imx290_write_reg(imx290, IMX290_HMAX_LOW, (val & 0xff));
|
||||
- if (ret) {
|
||||
- dev_err(imx290->dev, "Error setting HMAX register\n");
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- ret = imx290_write_reg(imx290, IMX290_HMAX_HIGH, ((val >> 8) & 0xff));
|
||||
- if (ret) {
|
||||
- dev_err(imx290->dev, "Error setting HMAX register\n");
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/* Start streaming */
|
||||
static int imx290_start_streaming(struct imx290 *imx290)
|
||||
{
|
||||
@@ -813,9 +828,6 @@ static int imx290_start_streaming(struct
|
||||
dev_err(imx290->dev, "Could not set current mode\n");
|
||||
return ret;
|
||||
}
|
||||
- ret = imx290_set_hmax(imx290, imx290->current_mode->hmax);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
|
||||
/* Apply customized values from user */
|
||||
ret = v4l2_ctrl_handler_setup(imx290->sd.ctrl_handler);
|
||||
@@ -1010,6 +1022,7 @@ static int imx290_probe(struct i2c_clien
|
||||
struct v4l2_fwnode_endpoint ep = {
|
||||
.bus_type = V4L2_MBUS_CSI2_DPHY
|
||||
};
|
||||
+ const struct imx290_mode *mode;
|
||||
struct imx290 *imx290;
|
||||
s64 fq;
|
||||
int ret;
|
||||
@@ -1048,6 +1061,8 @@ static int imx290_probe(struct i2c_clien
|
||||
ret = -EINVAL;
|
||||
goto free_err;
|
||||
}
|
||||
+ imx290->hmax_min = (imx290->nlanes == 2) ? IMX290_HMAX_MIN_2LANE :
|
||||
+ IMX290_HMAX_MIN_4LANE;
|
||||
|
||||
dev_dbg(dev, "Using %u data lanes\n", imx290->nlanes);
|
||||
|
||||
@@ -1122,6 +1137,13 @@ static int imx290_probe(struct i2c_clien
|
||||
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
V4L2_CID_GAIN, 0, 238, 1, 0);
|
||||
|
||||
+ mode = imx290->current_mode;
|
||||
+ imx290->hblank = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
+ V4L2_CID_HBLANK,
|
||||
+ imx290->hmax_min - mode->width,
|
||||
+ IMX290_HMAX_MAX - mode->width, 1,
|
||||
+ mode->hmax - mode->width);
|
||||
+
|
||||
imx290->link_freq =
|
||||
v4l2_ctrl_new_int_menu(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
V4L2_CID_LINK_FREQ,
|
@ -1,141 +0,0 @@
|
||||
From 2ec876df0a1c42bb42fff3d34fdb618d42c39e43 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Jun 2020 18:09:12 +0100
|
||||
Subject: [PATCH] media: i2c: imx290: Add support for V4L2_CID_VBLANK
|
||||
|
||||
In order to calculate framerate and durations userspace needs
|
||||
the vertical blanking information. This can be configurable,
|
||||
and indeed the datasheet lists different values for VBLANK for
|
||||
the 1080p and 720p modes.
|
||||
|
||||
Add the new control, and adopt the datasheet values for each mode.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 38 ++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -38,6 +38,8 @@ enum imx290_clk_index {
|
||||
#define IMX290_BLKLEVEL_LOW 0x300a
|
||||
#define IMX290_BLKLEVEL_HIGH 0x300b
|
||||
#define IMX290_GAIN 0x3014
|
||||
+#define IMX290_VMAX_LOW 0x3018
|
||||
+#define IMX290_VMAX_MAX 0x3fff
|
||||
#define IMX290_HMAX_LOW 0x301c
|
||||
#define IMX290_HMAX_HIGH 0x301d
|
||||
#define IMX290_HMAX_MIN_2LANE 4400 /* Min of 4400 pixels = 30fps */
|
||||
@@ -68,6 +70,7 @@ struct imx290_mode {
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 hmax;
|
||||
+ u32 vmax;
|
||||
u8 link_freq_index;
|
||||
|
||||
const struct imx290_regval *data;
|
||||
@@ -99,6 +102,7 @@ struct imx290 {
|
||||
struct v4l2_ctrl *link_freq;
|
||||
struct v4l2_ctrl *pixel_rate;
|
||||
struct v4l2_ctrl *hblank;
|
||||
+ struct v4l2_ctrl *vblank;
|
||||
|
||||
struct mutex lock;
|
||||
};
|
||||
@@ -132,8 +136,6 @@ static const char * const imx290_test_pa
|
||||
|
||||
static const struct imx290_regval imx290_global_init_settings[] = {
|
||||
{ 0x3007, 0x00 },
|
||||
- { 0x3018, 0x65 },
|
||||
- { 0x3019, 0x04 },
|
||||
{ 0x301a, 0x00 },
|
||||
{ 0x303a, 0x0c },
|
||||
{ 0x3040, 0x00 },
|
||||
@@ -360,6 +362,7 @@ static const struct imx290_mode imx290_m
|
||||
.width = 1920,
|
||||
.height = 1080,
|
||||
.hmax = 0x1130,
|
||||
+ .vmax = 0x0465,
|
||||
.link_freq_index = FREQ_INDEX_1080P,
|
||||
.data = imx290_1080p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_1080p_settings),
|
||||
@@ -373,6 +376,7 @@ static const struct imx290_mode imx290_m
|
||||
.width = 1280,
|
||||
.height = 720,
|
||||
.hmax = 0x19c8,
|
||||
+ .vmax = 0x02ee,
|
||||
.link_freq_index = FREQ_INDEX_720P,
|
||||
.data = imx290_720p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_720p_settings),
|
||||
@@ -389,6 +393,7 @@ static const struct imx290_mode imx290_m
|
||||
.width = 1920,
|
||||
.height = 1080,
|
||||
.hmax = 0x0898,
|
||||
+ .vmax = 0x0465,
|
||||
.link_freq_index = FREQ_INDEX_1080P,
|
||||
.data = imx290_1080p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_1080p_settings),
|
||||
@@ -402,6 +407,7 @@ static const struct imx290_mode imx290_m
|
||||
.width = 1280,
|
||||
.height = 720,
|
||||
.hmax = 0x0ce4,
|
||||
+ .vmax = 0x02ee,
|
||||
.link_freq_index = FREQ_INDEX_720P,
|
||||
.data = imx290_720p_settings,
|
||||
.data_size = ARRAY_SIZE(imx290_720p_settings),
|
||||
@@ -543,6 +549,19 @@ static int imx290_set_hmax(struct imx290
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int imx290_set_vmax(struct imx290 *imx290, u32 val)
|
||||
+{
|
||||
+ u32 vmax = val + imx290->current_mode->height;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = imx290_write_buffered_reg(imx290, IMX290_VMAX_LOW, 3,
|
||||
+ vmax);
|
||||
+ if (ret)
|
||||
+ dev_err(imx290->dev, "Unable to write vmax\n");
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/* Stop streaming */
|
||||
static int imx290_stop_streaming(struct imx290 *imx290)
|
||||
{
|
||||
@@ -574,6 +593,9 @@ static int imx290_set_ctrl(struct v4l2_c
|
||||
case V4L2_CID_HBLANK:
|
||||
ret = imx290_set_hmax(imx290, ctrl->val);
|
||||
break;
|
||||
+ case V4L2_CID_VBLANK:
|
||||
+ ret = imx290_set_vmax(imx290, ctrl->val);
|
||||
+ break;
|
||||
case V4L2_CID_TEST_PATTERN:
|
||||
if (ctrl->val) {
|
||||
imx290_write_reg(imx290, IMX290_BLKLEVEL_LOW, 0x00);
|
||||
@@ -736,6 +758,12 @@ static int imx290_set_fmt(struct v4l2_su
|
||||
imx290->hmax_min - mode->width,
|
||||
IMX290_HMAX_MAX - mode->width,
|
||||
1, mode->hmax - mode->width);
|
||||
+ if (imx290->vblank)
|
||||
+ __v4l2_ctrl_modify_range(imx290->vblank,
|
||||
+ mode->vmax - mode->height,
|
||||
+ IMX290_VMAX_MAX - mode->height,
|
||||
+ 1,
|
||||
+ mode->vmax - mode->height);
|
||||
}
|
||||
|
||||
*format = fmt->format;
|
||||
@@ -1144,6 +1172,12 @@ static int imx290_probe(struct i2c_clien
|
||||
IMX290_HMAX_MAX - mode->width, 1,
|
||||
mode->hmax - mode->width);
|
||||
|
||||
+ imx290->vblank = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
+ V4L2_CID_VBLANK,
|
||||
+ mode->vmax - mode->height,
|
||||
+ IMX290_VMAX_MAX - mode->height, 1,
|
||||
+ mode->vmax - mode->height);
|
||||
+
|
||||
imx290->link_freq =
|
||||
v4l2_ctrl_new_int_menu(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
V4L2_CID_LINK_FREQ,
|
@ -1,93 +0,0 @@
|
||||
From e14032e74f63afc123d631d4475b057221b2de60 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Jun 2020 18:19:13 +0100
|
||||
Subject: [PATCH] media: i2c: imx290: Add exposure control to the
|
||||
driver.
|
||||
|
||||
Adds support for V4L2_CID_EXPOSURE so that userspace can control
|
||||
the sensor exposure time.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/imx290.c | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
--- a/drivers/media/i2c/imx290.c
|
||||
+++ b/drivers/media/i2c/imx290.c
|
||||
@@ -45,6 +45,10 @@ enum imx290_clk_index {
|
||||
#define IMX290_HMAX_MIN_2LANE 4400 /* Min of 4400 pixels = 30fps */
|
||||
#define IMX290_HMAX_MIN_4LANE 2200 /* Min of 2200 pixels = 60fps */
|
||||
#define IMX290_HMAX_MAX 0xffff
|
||||
+
|
||||
+#define IMX290_EXPOSURE_MIN 2
|
||||
+#define IMX290_EXPOSURE_STEP 1
|
||||
+#define IMX290_EXPOSURE_LOW 0x3020
|
||||
#define IMX290_PGCTRL 0x308c
|
||||
#define IMX290_PHY_LANE_NUM 0x3407
|
||||
#define IMX290_CSI_LANE_MODE 0x3443
|
||||
@@ -103,6 +107,7 @@ struct imx290 {
|
||||
struct v4l2_ctrl *pixel_rate;
|
||||
struct v4l2_ctrl *hblank;
|
||||
struct v4l2_ctrl *vblank;
|
||||
+ struct v4l2_ctrl *exposure;
|
||||
|
||||
struct mutex lock;
|
||||
};
|
||||
@@ -529,6 +534,20 @@ static int imx290_set_gain(struct imx290
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int imx290_set_exposure(struct imx290 *imx290, u32 value)
|
||||
+{
|
||||
+ u32 exposure = (imx290->current_mode->height + imx290->vblank->val) -
|
||||
+ value;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = imx290_write_buffered_reg(imx290, IMX290_EXPOSURE_LOW, 3,
|
||||
+ exposure);
|
||||
+ if (ret)
|
||||
+ dev_err(imx290->dev, "Unable to write exposure\n");
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int imx290_set_hmax(struct imx290 *imx290, u32 val)
|
||||
{
|
||||
u32 hmax = val + imx290->current_mode->width;
|
||||
@@ -590,6 +609,9 @@ static int imx290_set_ctrl(struct v4l2_c
|
||||
case V4L2_CID_GAIN:
|
||||
ret = imx290_set_gain(imx290, ctrl->val);
|
||||
break;
|
||||
+ case V4L2_CID_EXPOSURE:
|
||||
+ ret = imx290_set_exposure(imx290, ctrl->val);
|
||||
+ break;
|
||||
case V4L2_CID_HBLANK:
|
||||
ret = imx290_set_hmax(imx290, ctrl->val);
|
||||
break;
|
||||
@@ -764,6 +786,12 @@ static int imx290_set_fmt(struct v4l2_su
|
||||
IMX290_VMAX_MAX - mode->height,
|
||||
1,
|
||||
mode->vmax - mode->height);
|
||||
+ if (imx290->exposure)
|
||||
+ __v4l2_ctrl_modify_range(imx290->exposure,
|
||||
+ mode->vmax - mode->height,
|
||||
+ mode->vmax - 4,
|
||||
+ IMX290_EXPOSURE_STEP,
|
||||
+ mode->vmax - 4);
|
||||
}
|
||||
|
||||
*format = fmt->format;
|
||||
@@ -1178,6 +1206,13 @@ static int imx290_probe(struct i2c_clien
|
||||
IMX290_VMAX_MAX - mode->height, 1,
|
||||
mode->vmax - mode->height);
|
||||
|
||||
+ imx290->exposure = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
+ V4L2_CID_EXPOSURE,
|
||||
+ IMX290_EXPOSURE_MIN,
|
||||
+ mode->vmax - 4,
|
||||
+ IMX290_EXPOSURE_STEP,
|
||||
+ mode->vmax - 4);
|
||||
+
|
||||
imx290->link_freq =
|
||||
v4l2_ctrl_new_int_menu(&imx290->ctrls, &imx290_ctrl_ops,
|
||||
V4L2_CID_LINK_FREQ,
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user