summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2020-06-10 17:15:58 -0500
committerJustin M. Forbes <jforbes@fedoraproject.org>2020-06-10 17:15:58 -0500
commit614b7d7d7b10d8e3f146bed311215f818be5accd (patch)
treeff92323ae8547b034624753824df4568b1079918
parentf74d84eda2966af5c10fcae2ef90a940f96943a0 (diff)
downloadkernel-614b7d7d7b10d8e3f146bed311215f818be5accd.tar.gz
kernel-614b7d7d7b10d8e3f146bed311215f818be5accd.tar.xz
kernel-614b7d7d7b10d8e3f146bed311215f818be5accd.zip
Initial 5.7.2 rebase
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
-rw-r--r--0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch71
-rw-r--r--0001-ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m.patch (renamed from ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m400.patch)33
-rw-r--r--0001-ARM-fix-__get_user_check-in-case-uaccess_-calls-are-.patch (renamed from ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch)71
-rw-r--r--0001-ARM-tegra-usb-no-reset.patch (renamed from ARM-tegra-usb-no-reset.patch)10
-rw-r--r--0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch (renamed from 0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch)78
-rw-r--r--0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch (renamed from arm64-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch)15
-rw-r--r--0001-Add-support-for-deprecating-processors.patch303
-rw-r--r--0001-Drop-that-for-now.patch8
-rw-r--r--0001-IB-rxe-Mark-Soft-RoCE-Transport-driver-as-tech-previ.patch58
-rw-r--r--0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch (renamed from input-rmi4-remove-the-need-for-artifical-IRQ.patch)96
-rw-r--r--0001-KEYS-Make-use-of-platform-keyring-for-module-signatu.patch (renamed from KEYS-Make-use-of-platform-keyring-for-module-signature.patch)11
-rw-r--r--0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch104
-rw-r--r--0001-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch40
-rw-r--r--0001-PCI-brcmstb-Wait-for-Raspberry-Pi-s-firmware-when-pr.patch57
-rw-r--r--0001-USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch72
-rw-r--r--0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch75
-rw-r--r--0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch (renamed from ACPI-scan-Fix-regression-related-to-X-Gene-UARTs.patch)33
-rw-r--r--0001-acpi-prefer-booting-with-ACPI-over-DTS.patch56
-rw-r--r--0001-acr-Use-kmemdup-instead-of-kmalloc-and-memcpy.patch55
-rw-r--r--0001-add-pci_hw_vendor_status.patch96
-rw-r--r--0001-ahci-thunderx2-Fix-for-errata-that-affects-stop-engi.patch89
-rw-r--r--0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch38
-rw-r--r--0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch (renamed from arm-make-highpte-not-expert.patch)10
-rw-r--r--0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch81
-rw-r--r--0001-backlight-lp855x-Ensure-regulators-are-disabled-on-p.patch118
-rw-r--r--0001-core-memory-remove-redundant-assignments-to-variable.patch32
-rw-r--r--0001-device-detect-if-changing-endianness-failed.patch62
-rw-r--r--0001-device-detect-vGPUs.patch59
-rw-r--r--0001-device-rework-mmio-mapping-code-to-get-rid-of-second.patch84
-rw-r--r--0001-device-use-regular-PRI-accessors-in-chipset-detectio.patch113
-rw-r--r--0001-disp-gv100-expose-capabilities-class.patch149
-rw-r--r--0001-disp-hda-gf119-add-HAL-for-programming-device-entry-.patch146
-rw-r--r--0001-disp-hda-gf119-select-HDA-device-entry-based-on-boun.patch49
-rw-r--r--0001-disp-hda-gt215-pass-head-to-nvkm_ior.hda.eld.patch83
-rw-r--r--0001-disp-hda-gv100-NV_PDISP_SF_AUDIO_CNTRL0-register-mov.patch105
-rw-r--r--0001-disp-nv50-increase-timeout-on-pio-channel-free-polli.patch26
-rw-r--r--0001-drm-Use-generic-helper-to-check-_PR3-presence.patch96
-rw-r--r--0001-drm-panel-add-Xingbangda-XBD599-panel.patch423
-rw-r--r--0001-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calcu.patch59
-rw-r--r--0001-dt-bindings-Add-doc-for-Pine64-Pinebook-Pro.patch32
-rw-r--r--0001-dt-bindings-panel-add-binding-for-Xingbangda-XBD599-.patch74
-rw-r--r--0001-e1000e-bump-up-timeout-to-wait-when-ME-un-configure-.patch35
-rw-r--r--0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch161
-rw-r--r--0001-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch72
-rw-r--r--0001-firmware-raspberrypi-Introduce-vl805-init-routine.patch110
-rw-r--r--0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch98
-rw-r--r--0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch123
-rw-r--r--0001-kABI-Add-generic-kABI-macros-to-use-for-kABI-workaro.patch214
-rw-r--r--0001-kdump-add-support-for-crashkernel-auto.patch189
-rw-r--r--0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch43
-rw-r--r--0001-kdump-round-up-the-total-memory-size-to-128M-for-cra.patch93
-rw-r--r--0001-kms-Fix-regression-by-audio-component-transition.patch82
-rw-r--r--0001-kms-gv100-Add-support-for-interlaced-modes.patch64
-rw-r--r--0001-kms-nv50-Initialize-core-channel-in-nouveau_display_.patch47
-rw-r--r--0001-kms-nv50-Move-8BPC-limit-for-MST-into-nv50_mstc_get_.patch65
-rw-r--r--0001-kms-nv50-Probe-SOR-and-PIOR-caps-for-DP-interlacing-.patch439
-rw-r--r--0001-kms-nv50-Share-DP-SST-mode_valid-handling-with-MST.patch209
-rw-r--r--0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch10
-rw-r--r--0001-mmu-Remove-unneeded-semicolon.patch47
-rw-r--r--0001-modules-add-rhelversion-MODULE_INFO-tag.patch151
-rw-r--r--0001-perf-cs-etm-Move-defined-of-traceid_list.patch58
-rw-r--r--0001-platform-x86-sony-laptop-SNC-calls-should-handle-BUF.patch116
-rw-r--r--0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch100
-rw-r--r--0001-s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch (renamed from s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch)27
-rw-r--r--0001-scsi-smartpqi-add-inspur-advantech-ids.patch70
-rw-r--r--0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch103
-rw-r--r--0001-soc-bcm2835-Sync-xHCI-reset-firmware-property-with-d.patch32
-rw-r--r--0001-virt-vbox-Add-a-few-new-vmmdev-request-types-to-the-.patch58
-rw-r--r--0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch320
-rw-r--r--0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch130
-rw-r--r--0001-virt-vbox-Fix-VBGL_IOCTL_VMMDEV_REQUEST_BIG-and-_LOG.patch123
-rw-r--r--0001-virt-vbox-Fix-guest-capabilities-mask-check.patch47
-rw-r--r--0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch30
-rw-r--r--0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch103
-rw-r--r--0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch38
-rw-r--r--20200505_leo_yan_linaro_org.patch70
-rw-r--r--ARM-Enable-thermal-support-for-Raspberry-Pi-4.patch905
-rw-r--r--Raspberry-Pi-4-PCIe-support.patch1995
-rw-r--r--alsa-5.6.patch390
-rw-r--r--arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch868
-rw-r--r--arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch29
-rw-r--r--arm64-tegra-jetson-tx1-fixes.patch39
-rw-r--r--bcm2835-irqchip-Quiesce-IRQs-left-enabled-by-bootloader.patch232
-rw-r--r--bcm283x-gpu-drm-v3d-Add-ARCH_BCM2835-to-DRM_V3D-Kconfig.patch30
-rw-r--r--configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE2
-rw-r--r--configs/fedora/debug/CONFIG_TEST_LOCKUP1
-rw-r--r--configs/fedora/debug/x86/x86_64/README3
-rw-r--r--configs/fedora/generic/CONFIG_AD5770R1
-rw-r--r--configs/fedora/generic/CONFIG_AD7091R51
-rw-r--r--configs/fedora/generic/CONFIG_AL30101
-rw-r--r--configs/fedora/generic/CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ1
-rw-r--r--configs/fedora/generic/CONFIG_APPLE_MFI_FASTCHARGE1
-rw-r--r--configs/fedora/generic/CONFIG_ARCH_RANDOM (renamed from configs/fedora/generic/s390x/CONFIG_ARCH_RANDOM)0
-rw-r--r--configs/fedora/generic/CONFIG_ATH11K1
-rw-r--r--configs/fedora/generic/CONFIG_BACKLIGHT_LED1
-rw-r--r--configs/fedora/generic/CONFIG_BAREUDP1
-rw-r--r--configs/fedora/generic/CONFIG_BCM84881_PHY1
-rw-r--r--configs/fedora/generic/CONFIG_BMA4001
-rw-r--r--configs/fedora/generic/CONFIG_BOOTTIME_TRACING1
-rw-r--r--configs/fedora/generic/CONFIG_BOOT_CONFIG1
-rw-r--r--configs/fedora/generic/CONFIG_BPF_LSM1
-rw-r--r--configs/fedora/generic/CONFIG_CAN_UCAN2
-rw-r--r--configs/fedora/generic/CONFIG_CAPI_AVM1
-rw-r--r--configs/fedora/generic/CONFIG_CHELSIO_TLS_DEVICE1
-rw-r--r--configs/fedora/generic/CONFIG_CLK_RASPBERRYPI1
-rw-r--r--configs/fedora/generic/CONFIG_COMMON_CLK_FSL_SAI1
-rw-r--r--configs/fedora/generic/CONFIG_CPU_FREQ_THERMAL1
-rw-r--r--configs/fedora/generic/CONFIG_CROS_EC_TYPEC1
-rw-r--r--configs/fedora/generic/CONFIG_CROS_USBPD_NOTIFY1
-rw-r--r--configs/fedora/generic/CONFIG_DLHL60D1
-rw-r--r--configs/fedora/generic/CONFIG_DMABUF_HEAPS1
-rw-r--r--configs/fedora/generic/CONFIG_DMABUF_MOVE_NOTIFY1
-rw-r--r--configs/fedora/generic/CONFIG_DM_CLONE2
-rw-r--r--configs/fedora/generic/CONFIG_DRM_ANALOGIX_ANX63451
-rw-r--r--configs/fedora/generic/CONFIG_DRM_DISPLAY_CONNECTOR1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_DP_CEC2
-rw-r--r--configs/fedora/generic/CONFIG_DRM_LVDS_CODEC1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_LVDS_ENCODER1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_BOE_HIMAX8279D1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_BOE_TV101WUM_NL61
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_ELIDA_KD35T1331
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA021
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_LEADTEK_LTK500HD18291
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_NOVATEK_NT355101
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF011
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_SONY_ACX424AKP1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_XINGBANGDA_XBD5991
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PANEL_XINPENG_XPP055C2721
-rw-r--r--configs/fedora/generic/CONFIG_DRM_PARADE_PS86401
-rw-r--r--configs/fedora/generic/CONFIG_DRM_SIMPLE_BRIDGE1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_TIDSS1
-rw-r--r--configs/fedora/generic/CONFIG_DRM_TI_TPD12S0151
-rw-r--r--configs/fedora/generic/CONFIG_DRM_TOSHIBA_TC3587681
-rw-r--r--configs/fedora/generic/CONFIG_EFI_DISABLE_PCI_DMA1
-rw-r--r--configs/fedora/generic/CONFIG_ETHTOOL_NETLINK1
-rw-r--r--configs/fedora/generic/CONFIG_EXFAT_DEFAULT_IOCHARSET1
-rw-r--r--configs/fedora/generic/CONFIG_EXFAT_FS2
-rw-r--r--configs/fedora/generic/CONFIG_F2FS_FS_COMPRESSION1
-rw-r--r--configs/fedora/generic/CONFIG_F2FS_FS_LZ41
-rw-r--r--configs/fedora/generic/CONFIG_F2FS_FS_LZO1
-rw-r--r--configs/fedora/generic/CONFIG_F2FS_FS_ZSTD1
-rw-r--r--configs/fedora/generic/CONFIG_FSL_ENETC1
-rw-r--r--configs/fedora/generic/CONFIG_FSL_ENETC_MDIO1
-rw-r--r--configs/fedora/generic/CONFIG_FSL_ENETC_VF1
-rw-r--r--configs/fedora/generic/CONFIG_GIGASET_BASE1
-rw-r--r--configs/fedora/generic/CONFIG_GIGASET_CAPI1
-rw-r--r--configs/fedora/generic/CONFIG_GIGASET_DEBUG1
-rw-r--r--configs/fedora/generic/CONFIG_GIGASET_M1011
-rw-r--r--configs/fedora/generic/CONFIG_GIGASET_M1051
-rw-r--r--configs/fedora/generic/CONFIG_GP2AP0021
-rw-r--r--configs/fedora/generic/CONFIG_GPIO_LOGICVC1
-rw-r--r--configs/fedora/generic/CONFIG_GPIO_SIFIVE1
-rw-r--r--configs/fedora/generic/CONFIG_HID_CREATIVE_SB05402
-rw-r--r--configs/fedora/generic/CONFIG_HID_GLORIOUS1
-rw-r--r--configs/fedora/generic/CONFIG_HID_MCP22211
-rw-r--r--configs/fedora/generic/CONFIG_HMC4251
-rw-r--r--configs/fedora/generic/CONFIG_HW_RANDOM_HISI_V21
-rw-r--r--configs/fedora/generic/CONFIG_HYSDN1
-rw-r--r--configs/fedora/generic/CONFIG_HYSDN_CAPI1
-rw-r--r--configs/fedora/generic/CONFIG_I2C_PARPORT_LIGHT1
-rw-r--r--configs/fedora/generic/CONFIG_ICP101001
-rw-r--r--configs/fedora/generic/CONFIG_IFCVF1
-rw-r--r--configs/fedora/generic/CONFIG_INET_ESPINTCP1
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_BZIP21
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_GZIP1
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_LZ41
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_LZMA1
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_LZO1
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_NONE1
-rw-r--r--configs/fedora/generic/CONFIG_INITRAMFS_COMPRESSION_XZ1
-rw-r--r--configs/fedora/generic/CONFIG_IPV6_RPL_LWTUNNEL1
-rw-r--r--configs/fedora/generic/CONFIG_KPROBE_EVENT_GEN_TEST1
-rw-r--r--configs/fedora/generic/CONFIG_LTC24961
-rw-r--r--configs/fedora/generic/CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE1
-rw-r--r--configs/fedora/generic/CONFIG_MDIO_MVUSB1
-rw-r--r--configs/fedora/generic/CONFIG_MDIO_XPCS1
-rw-r--r--configs/fedora/generic/CONFIG_MFD_IQS62X1
-rw-r--r--configs/fedora/generic/CONFIG_MFD_ROHM_BD718281
-rw-r--r--configs/fedora/generic/CONFIG_MFD_WCD934X1
-rw-r--r--configs/fedora/generic/CONFIG_MHI_BUS1
-rw-r--r--configs/fedora/generic/CONFIG_MICROCHIP_PIT64B1
-rw-r--r--configs/fedora/generic/CONFIG_MLX5_TC_CT1
-rw-r--r--configs/fedora/generic/CONFIG_MMC_HSQ1
-rw-r--r--configs/fedora/generic/CONFIG_MPTCP1
-rw-r--r--configs/fedora/generic/CONFIG_MPTCP_HMAC_TEST1
-rw-r--r--configs/fedora/generic/CONFIG_MPTCP_IPV61
-rw-r--r--configs/fedora/generic/CONFIG_MSM_MMCC_89981
-rw-r--r--configs/fedora/generic/CONFIG_MTD_NAND_FSL_IFC1
-rw-r--r--configs/fedora/generic/CONFIG_NET_DSA_AR93311
-rw-r--r--configs/fedora/generic/CONFIG_NET_DSA_TAG_AR93311
-rw-r--r--configs/fedora/generic/CONFIG_NET_SCH_ETS1
-rw-r--r--configs/fedora/generic/CONFIG_NET_SCH_FQ_PIE1
-rw-r--r--configs/fedora/generic/CONFIG_NFSD_V4_2_INTER_SSC1
-rw-r--r--configs/fedora/generic/CONFIG_NFS_DISABLE_UDP_SUPPORT1
-rw-r--r--configs/fedora/generic/CONFIG_PCIE_EDR1
-rw-r--r--configs/fedora/generic/CONFIG_PHY_CADENCE_TORRENT1
-rw-r--r--configs/fedora/generic/CONFIG_PHY_INTEL_EMMC1
-rw-r--r--configs/fedora/generic/CONFIG_PINCTRL_IPQ60181
-rw-r--r--configs/fedora/generic/CONFIG_PING1
-rw-r--r--configs/fedora/generic/CONFIG_PLX_DMA1
-rw-r--r--configs/fedora/generic/CONFIG_PROVE_RAW_LOCK_NESTING1
-rw-r--r--configs/fedora/generic/CONFIG_PTDUMP_DEBUGFS1
-rw-r--r--configs/fedora/generic/CONFIG_PTP_1588_CLOCK_IDT82P331
-rw-r--r--configs/fedora/generic/CONFIG_PTP_1588_CLOCK_INES1
-rw-r--r--configs/fedora/generic/CONFIG_PWM_DEBUG1
-rw-r--r--configs/fedora/generic/CONFIG_QCOM_CPR1
-rw-r--r--configs/fedora/generic/CONFIG_REGULATOR_MP54161
-rw-r--r--configs/fedora/generic/CONFIG_REGULATOR_MP88591
-rw-r--r--configs/fedora/generic/CONFIG_REGULATOR_MP886X1
-rw-r--r--configs/fedora/generic/CONFIG_REGULATOR_MPQ79201
-rw-r--r--configs/fedora/generic/CONFIG_REGULATOR_VQMMC_IPQ40191
-rw-r--r--configs/fedora/generic/CONFIG_RESET_BRCMSTB_RESCAL1
-rw-r--r--configs/fedora/generic/CONFIG_RESET_INTEL_GW1
-rw-r--r--configs/fedora/generic/CONFIG_RHEL_DIFFERENCES1
-rw-r--r--configs/fedora/generic/CONFIG_RH_DISABLE_DEPRECATED1
-rw-r--r--configs/fedora/generic/CONFIG_SCHED_THERMAL_PRESSURE1
-rw-r--r--configs/fedora/generic/CONFIG_SC_DISPCC_71801
-rw-r--r--configs/fedora/generic/CONFIG_SC_GPUCC_71801
-rw-r--r--configs/fedora/generic/CONFIG_SC_VIDEOCC_71801
-rw-r--r--configs/fedora/generic/CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE2
-rw-r--r--configs/fedora/generic/CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE1
-rw-r--r--configs/fedora/generic/CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS1
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_ADM11771
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_AXI_FAN_CONTROL1
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_DRIVETEMP1
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_MAX207301
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_MAX317301
-rw-r--r--configs/fedora/generic/CONFIG_SENSORS_XDPE1221
-rw-r--r--configs/fedora/generic/CONFIG_SERIAL_8250_16550A_VARIANTS1
-rw-r--r--configs/fedora/generic/CONFIG_SERIAL_SPRD1
-rw-r--r--configs/fedora/generic/CONFIG_SND_BCM63XX_I2S_WHISTLER1
-rw-r--r--configs/fedora/generic/CONFIG_SND_CTL_VALIDATION1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_MT66601
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_PCM512x_I2C2
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_RT1308_SDW1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_RT5682_SDW1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_RT700_SDW1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_RT711_SDW1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_RT715_SDW1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_SOF_DEBUG_PROBES1
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_TLV320ADCX1401
-rw-r--r--configs/fedora/generic/CONFIG_SND_SOC_WSA881X1
-rw-r--r--configs/fedora/generic/CONFIG_SPI_FSI1
-rw-r--r--configs/fedora/generic/CONFIG_SPI_HISI_SFC_V3XX1
-rw-r--r--configs/fedora/generic/CONFIG_SPI_MUX1
-rw-r--r--configs/fedora/generic/CONFIG_STAGING_EXFAT_FS1
-rw-r--r--configs/fedora/generic/CONFIG_STRICT_KERNEL_RWX1
-rw-r--r--configs/fedora/generic/CONFIG_SYNTH_EVENT_GEN_TEST1
-rw-r--r--configs/fedora/generic/CONFIG_TEST_LOCKUP1
-rw-r--r--configs/fedora/generic/CONFIG_TEST_MIN_HEAP1
-rw-r--r--configs/fedora/generic/CONFIG_THUNDERBOLT1
-rw-r--r--configs/fedora/generic/CONFIG_TINYDRM_ILI94861
-rw-r--r--configs/fedora/generic/CONFIG_UACCE1
-rw-r--r--configs/fedora/generic/CONFIG_USB_MAX3420_UDC1
-rw-r--r--configs/fedora/generic/CONFIG_USB_RAW_GADGET1
-rw-r--r--configs/fedora/generic/CONFIG_VDPA16
-rw-r--r--configs/fedora/generic/CONFIG_VDPA_MENU1
-rw-r--r--configs/fedora/generic/CONFIG_VDPA_SIM1
-rw-r--r--configs/fedora/generic/CONFIG_VHOST_MENU1
-rw-r--r--configs/fedora/generic/CONFIG_VHOST_VDPA1
-rw-r--r--configs/fedora/generic/CONFIG_VIDEO_USBVISION2
-rw-r--r--configs/fedora/generic/CONFIG_VIRTIO_BLK_SCSI1
-rw-r--r--configs/fedora/generic/CONFIG_VIRTIO_VDPA1
-rw-r--r--configs/fedora/generic/CONFIG_VSOCKETS_LOOPBACK1
-rw-r--r--configs/fedora/generic/CONFIG_WIREGUARD1
-rw-r--r--configs/fedora/generic/CONFIG_WIREGUARD_DEBUG1
-rw-r--r--configs/fedora/generic/CONFIG_X86_PTDUMP1
-rw-r--r--configs/fedora/generic/CONFIG_XILINX_LL_TEMAC1
-rw-r--r--configs/fedora/generic/CONFIG_ZONEFS_FS1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_8421
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ41
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_DEFAULT_ON1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD1
-rw-r--r--configs/fedora/generic/CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC1
-rw-r--r--configs/fedora/generic/arm/CONFIG_ARM_IMX8M_DDRC_DEVFREQ1
-rw-r--r--configs/fedora/generic/arm/CONFIG_ARM_SMMU_LEGACY_DT_BINDINGS1
-rw-r--r--configs/fedora/generic/arm/CONFIG_CRYPTO_DEV_QCE_ENABLE_ALL1
-rw-r--r--configs/fedora/generic/arm/CONFIG_CRYPTO_DEV_QCE_ENABLE_SHA1
-rw-r--r--configs/fedora/generic/arm/CONFIG_CRYPTO_DEV_QCE_ENABLE_SKCIPHER1
-rw-r--r--configs/fedora/generic/arm/CONFIG_CRYPTO_DEV_QCE_SW_MAX_LEN1
-rw-r--r--configs/fedora/generic/arm/CONFIG_DRM_LVDS_ENCODER1
-rw-r--r--configs/fedora/generic/arm/CONFIG_FRAME_WARN1
-rw-r--r--configs/fedora/generic/arm/CONFIG_GPIO_MPC8XXX (renamed from configs/fedora/generic/CONFIG_GPIO_MPC8XXX)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_HISILICON_IRQ_MBIGEN2
-rw-r--r--configs/fedora/generic/arm/CONFIG_HW_RANDOM_IPROC_RNG2001
-rw-r--r--configs/fedora/generic/arm/CONFIG_IMX8MM_THERMAL1
-rw-r--r--configs/fedora/generic/arm/CONFIG_IMX_DSP2
-rw-r--r--configs/fedora/generic/arm/CONFIG_IMX_REMOTEPROC1
-rw-r--r--configs/fedora/generic/arm/CONFIG_INA2XX_ADC (renamed from configs/fedora/generic/arm/aarch64/CONFIG_INA2XX_ADC)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_INPUT_PWM_BEEPER1
-rw-r--r--configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_MSM89161
-rw-r--r--configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_OSM_L31
-rw-r--r--configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_SC71801
-rw-r--r--configs/fedora/generic/arm/CONFIG_IPQ_GCC_60181
-rw-r--r--configs/fedora/generic/arm/CONFIG_MDIO_IPQ80641
-rw-r--r--configs/fedora/generic/arm/CONFIG_MESON_SECURE_PM_DOMAINS1
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_DATAFLASH (renamed from configs/fedora/generic/arm/armv7/CONFIG_MTD_DATAFLASH)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_DATAFLASH_OTP (renamed from configs/fedora/generic/arm/armv7/CONFIG_MTD_DATAFLASH_OTP)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_DATAFLASH_WRITE_VERIFY (renamed from configs/fedora/generic/arm/armv7/CONFIG_MTD_DATAFLASH_WRITE_VERIFY)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_PHYSMAP_GEMINI1
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_PHYSMAP_IXP4XX1
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_PHYSMAP_OF2
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_PHYSMAP_VERSATILE1
-rw-r--r--configs/fedora/generic/arm/CONFIG_MTD_SST25L (renamed from configs/fedora/generic/arm/armv7/CONFIG_MTD_SST25L)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_NET_VENDOR_MELLANOX1
-rw-r--r--configs/fedora/generic/arm/CONFIG_NVMEM_SPMI_SDAM1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PHY_MESON_AXG_MIPI_PCIE_ANALOG1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PHY_MESON_AXG_PCIE1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PHY_QCOM_USB_HS_28NM1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PHY_QCOM_USB_SS1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PHY_ROCKCHIP_DPHY_RX01
-rw-r--r--configs/fedora/generic/arm/CONFIG_PINCTRL_IMX8MM1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PINCTRL_IMX8MN1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PINCTRL_IMX8MP1
-rw-r--r--configs/fedora/generic/arm/CONFIG_PINCTRL_IMX8MQ1
-rw-r--r--configs/fedora/generic/arm/CONFIG_QCOM_SCM1
-rw-r--r--configs/fedora/generic/arm/CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT1
-rw-r--r--configs/fedora/generic/arm/CONFIG_QUICC_ENGINE1
-rw-r--r--configs/fedora/generic/arm/CONFIG_RTC_DRV_PCF853631
-rw-r--r--configs/fedora/generic/arm/CONFIG_SC_MSS_71801
-rw-r--r--configs/fedora/generic/arm/CONFIG_SERIAL_8250_TEGRA1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SM_GCC_82501
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_IMX_SOC (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_IMX_SOC)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_MESON_AIU1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_MESON_G12A_TOACODEC1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_MESON_GX_SOUND_CARD1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_SOC_IMX_AUDMUX (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_IMX_AUDMUX)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_SOC_IMX_SGTL5000 (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_IMX_SGTL5000)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_SOC_IMX_SPDIF (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_IMX_SPDIF)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_SOC_MESON_T90151
-rw-r--r--configs/fedora/generic/arm/CONFIG_SND_SOC_WM8962 (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_WM8962)0
-rw-r--r--configs/fedora/generic/arm/CONFIG_SOC_IMX8M1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SUN6I_MSGBOX1
-rw-r--r--configs/fedora/generic/arm/CONFIG_SUN8I_THERMAL1
-rw-r--r--configs/fedora/generic/arm/CONFIG_VIDEO_HANTRO_IMX8M1
-rw-r--r--configs/fedora/generic/arm/CONFIG_VIDEO_ROCKCHIP_ISP11
-rw-r--r--configs/fedora/generic/arm/CONFIG_VIDEO_SUN8I_ROTATE1
-rw-r--r--configs/fedora/generic/arm/CONFIG_XILINX_XADC1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_64BIT1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_ARM64_AMU_EXTN1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_ARM64_E0PD1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_ARM64_ERRATUM_15309231
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_ARM64_USE_LSE_ATOMICS1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_CLK_IMX8MP1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_CLK_LS1028A_PLLDIG1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_CLK_QORIQ2
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_OCTEONTX_CPT1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_ZYNQMP_AES1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_DEVICE_PRIVATE1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_DRM_PANEL_XINGBANGDA_XBD5991
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_EDAC_DMC5201
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_FORCE_MAX_ZONEORDER3
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_GPIO_MLXBF21
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_HISI_DMA1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_IMX_SC_THERMAL1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_MEMORY_HOTREMOVE1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_MTD_NAND_FSL_IFC1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_NET_DSA_MSCC_FELIX1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_NVDIMM_DAX1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_NVDIMM_PFN1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_OCTEONTX2_PF1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_OCTEONTX2_VF1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_PCIE_LAYERSCAPE_GEN41
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_PCIE_MOBIVEIL1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_PCIE_MOBIVEIL_PLAT1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_PCIE_TEGRA194_HOST1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_PINCTRL_IMX8MP1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_QCOM_CPR1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_QCOM_IPA1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_QCOM_SOCINFO1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_QORIQ_CPUFREQ1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_REGULATOR_MP88591
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_IMX_SOC1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_MAX98357A1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SGTL50001
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SOF_IMX8_SUPPORT1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SOF_IMX_TOPLEVEL1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SOF_OF1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SOUNDWIRE_QCOM1
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_SPI_QCOM_GENI2
-rw-r--r--configs/fedora/generic/arm/aarch64/CONFIG_ZONE_DEVICE1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_ARCH_ASPEED1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_ARCH_IPQ40XX1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_ARM_TEGRA_CPUIDLE1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_CRYPTO_DEV_OMAP_AES2
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_DRM_MCDE1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_HIGHPTE3
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_HISILICON_IRQ_MBIGEN1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_OMAP_REMOTEPROC_WATCHDOG1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_SENSORS_GPIO_FAN1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_SI70201
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_SND_SOC_SGTL50001
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_SOC_LS1021A (renamed from configs/fedora/generic/arm/armv7/armv7/CONFIG_SOC_LS1021A)0
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_SPI_FSL_SPI1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_TI_SYSCON_CLK1
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_TOUCHSCREEN_ADS78461
-rw-r--r--configs/fedora/generic/arm/armv7/CONFIG_USB_MUSB_AM335X_CHILD1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_AM335X_PHY_USB1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_ARM_TI_CPUFREQ1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_PWM_TIEHRPWM1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_CS42XX8_I2C1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC231
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_I2C1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_SPI1
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_WM87311
-rw-r--r--configs/fedora/generic/arm/armv7/armv7/CONFIG_WKUP_M3_RPROC1
-rw-r--r--configs/fedora/generic/arm/armv7/lpae/CONFIG_AM335X_PHY_USB1
-rw-r--r--configs/fedora/generic/arm/armv7/lpae/CONFIG_SOC_AM43XX1
-rw-r--r--configs/fedora/generic/powerpc/CONFIG_COMPAT1
-rw-r--r--configs/fedora/generic/powerpc/CONFIG_HOTPLUG_PCI_POWERNV2
-rw-r--r--configs/fedora/generic/powerpc/CONFIG_PMU_SYSFS1
-rw-r--r--configs/fedora/generic/powerpc/CONFIG_QUICC_ENGINE1
-rw-r--r--configs/fedora/generic/s390x/CONFIG_64BIT1
-rw-r--r--configs/fedora/generic/s390x/CONFIG_NODES_SHIFT2
-rw-r--r--configs/fedora/generic/s390x/CONFIG_QETH_OSN1
-rw-r--r--configs/fedora/generic/s390x/CONFIG_QETH_OSX1
-rw-r--r--configs/fedora/generic/s390x/CONFIG_ZLIB_DFLTCC1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_ALIGNMENT1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_SIZE_MBYTES1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_SIZE_SEL_MAX1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_SIZE_SEL_MBYTES1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_SIZE_SEL_MIN1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CMA_SIZE_SEL_PERCENTAGE1
-rw-r--r--configs/fedora/generic/x86/CONFIG_CRC_PMIC_OPREGION1
-rw-r--r--configs/fedora/generic/x86/CONFIG_DMA_CMA1
-rw-r--r--configs/fedora/generic/x86/CONFIG_DRM_NOUVEAU_SVM1
-rw-r--r--configs/fedora/generic/x86/CONFIG_DWMAC_INTEL1
-rw-r--r--configs/fedora/generic/x86/CONFIG_I2C_PARPORT_LIGHT1
-rw-r--r--configs/fedora/generic/x86/CONFIG_IMA_ARCH_POLICY1
-rw-r--r--configs/fedora/generic/x86/CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON1
-rw-r--r--configs/fedora/generic/x86/CONFIG_KEYBOARD_APPLESPI1
-rw-r--r--configs/fedora/generic/x86/CONFIG_PCIE_INTEL_GW1
-rw-r--r--configs/fedora/generic/x86/CONFIG_PHY_INTEL_EMMC1
-rw-r--r--configs/fedora/generic/x86/CONFIG_PINCTRL_LYNXPOINT1
-rw-r--r--configs/fedora/generic/x86/CONFIG_PTP_1588_CLOCK_VMW1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_HDA_PREALLOC_SIZE1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_BDW_RT5650_MACH1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_PCM512x_MACH1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~1
-rw-r--r--configs/fedora/generic/x86/CONFIG_STACKPROTECTOR_STRONG1
-rw-r--r--configs/fedora/generic/x86/CONFIG_SURFACE_3_POWER_OPREGION1
-rw-r--r--configs/fedora/generic/x86/CONFIG_THUNDERBOLT_NET1
-rw-r--r--configs/fedora/generic/x86/CONFIG_TIME_NS1
-rw-r--r--configs/fedora/generic/x86/CONFIG_TYPEC_MUX_INTEL_PMC1
-rw-r--r--configs/fedora/generic/x86/CONFIG_USB41
-rw-r--r--configs/fedora/generic/x86/CONFIG_USB4_NET1
-rw-r--r--configs/fedora/generic/x86/CONFIG_VBOXSF_FS1
-rw-r--r--configs/fedora/generic/x86/i686/CONFIG_64BIT1
-rw-r--r--configs/fedora/generic/x86/i686/CONFIG_HOTPLUG_PCI_SHPC1
-rw-r--r--configs/fedora/generic/x86/i686/CONFIG_INPUT_PWM_BEEPER1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_64BIT1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_CONTEXT_TRACKING_FORCE1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_BLAKE2S_X861
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_EFI_RCI2_TABLE (renamed from configs/fedora/generic/x86/CONFIG_EFI_RCI2_TABLE)0
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_INTEL_IDXD1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_INTEL_UNCORE_FREQ_CONTROL1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_THUNDERBOLT1
-rw-r--r--configs/fedora/generic/x86/x86_64/CONFIG_VIRT_CPU_ACCOUNTING_GEN1
-rw-r--r--efi-secureboot.patch337
-rw-r--r--filter-aarch64.sh2
-rw-r--r--filter-aarch64.sh.fedora2
-rw-r--r--filter-aarch64.sh.rhel18
-rw-r--r--filter-armv7hl.sh2
-rw-r--r--filter-armv7hl.sh.fedora2
-rwxr-xr-xfilter-modules.sh17
-rwxr-xr-xfilter-modules.sh.fedora17
-rw-r--r--filter-modules.sh.rhel168
-rw-r--r--filter-ppc64le.sh.rhel14
-rw-r--r--filter-s390x.sh.rhel12
-rw-r--r--filter-x86_64.sh.rhel12
-rw-r--r--kernel-aarch64-debug-fedora.config295
-rw-r--r--kernel-aarch64-fedora.config294
-rw-r--r--kernel-armv7hl-debug-fedora.config258
-rw-r--r--kernel-armv7hl-fedora.config257
-rw-r--r--kernel-armv7hl-lpae-debug-fedora.config273
-rw-r--r--kernel-armv7hl-lpae-fedora.config272
-rw-r--r--kernel-i686-debug-fedora.config234
-rw-r--r--kernel-i686-fedora.config233
-rw-r--r--kernel-ppc64le-debug-fedora.config207
-rw-r--r--kernel-ppc64le-fedora.config206
-rw-r--r--kernel-s390x-debug-fedora.config207
-rw-r--r--kernel-s390x-fedora.config206
-rw-r--r--kernel-x86_64-debug-fedora.config232
-rw-r--r--kernel-x86_64-fedora.config231
-rw-r--r--kernel.spec1648
-rw-r--r--linux-kernel-test.patch0
-rw-r--r--sources4
-rw-r--r--usb-phy-tegra-Add-38.4MHz-clock-table-entry.patch53
-rw-r--r--usb-xhci-Raspberry-Pi-FW-loader-for-VIA-VL805.patch91
501 files changed, 10746 insertions, 6903 deletions
diff --git a/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch b/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch
new file mode 100644
index 000000000..ec362d9b2
--- /dev/null
+++ b/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch
@@ -0,0 +1,71 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Al Stone <ahs3@redhat.com>
+Date: Tue, 27 Feb 2018 00:21:23 -0500
+Subject: [PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
+
+Message-id: <20180227002123.21608-1-ahs3@redhat.com>
+Patchwork-id: 206052
+O-Subject: [RHEL8 BZ1518076 PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
+Bugzilla: 1518076
+RH-Acked-by: Mark Salter <msalter@redhat.com>
+RH-Acked-by: Jeremy McNicoll <jmcnicol@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1518076
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15417197
+Tested: compile-only; several other patches are required for full booting
+ QE has tested limited boot (see comment#12 of BZ)
+
+This is a re-post of a RHEL-ALT-7.5 patch specific to aarch64 moonshots
+that we use in beaker. It is required for these machines to boot.
+
+ commit 8a663a264863efedf8bb4a9d76ac603920fdd739
+ Author: Robert Richter <rrichter@redhat.com>
+ Date: Wed Aug 16 19:49:30 2017 -0400
+
+ [acpi] APEI: arm64: Ignore broken HPE moonshot APEI support
+
+ From: Mark Salter <msalter@redhat.com>
+ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1344237
+ Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13768971
+ Tested: Booted on moonshot with patched 4.11.0-20 kernel
+ Upstream: RHEL-only
+
+ The aarch64 HP moonshot platforms we have in beaker and elsewhere have
+ a firmware bug which causes a spurious fatal memory error via APEI at
+ boot time. This platform is no longer supported and no further firmware
+ updates are expected. This is a downstream-only hack to avoid the problem
+ by bailing out of HEST table probing if we detect a moonshot HEST table.
+
+ Signed-off-by: Mark Salter <msalter@redhat.com>
+ Signed-off-by: Robert Richter <rrichter@redhat.com>
+ Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Al Stone <ahs3@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/acpi/apei/hest.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
+index 822402480f7d..3f87d8602560 100644
+--- a/drivers/acpi/apei/hest.c
++++ b/drivers/acpi/apei/hest.c
+@@ -88,6 +88,14 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
+ if (hest_disable || !hest_tab)
+ return -EINVAL;
+
++#ifdef CONFIG_ARM64
++ /* Ignore broken firmware */
++ if (!strncmp(hest_tab->header.oem_id, "HPE ", 6) &&
++ !strncmp(hest_tab->header.oem_table_id, "ProLiant", 8) &&
++ MIDR_IMPLEMENTOR(read_cpuid_id()) == ARM_CPU_IMP_APM)
++ return -EINVAL;
++#endif
++
+ hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+ for (i = 0; i < hest_tab->error_source_count; i++) {
+ len = hest_esrc_len(hest_hdr);
+--
+2.26.2
+
diff --git a/ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m400.patch b/0001-ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m.patch
index 3dcfd4969..1cc560ee8 100644
--- a/ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m400.patch
+++ b/0001-ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m.patch
@@ -1,8 +1,17 @@
-From dbdda4277cf0422a9ccb7ea98d0263c3cdbecdf6 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
-Date: Tue, 8 May 2018 21:54:39 -0400
-Subject: [PATCH] ACPI / irq: Workaround firmware issue on X-Gene based
- m400
+Date: Thu, 10 May 2018 17:38:43 -0400
+Subject: [PATCH] ACPI / irq: Workaround firmware issue on X-Gene based m400
+
+Message-id: <20180510173844.29580-3-msalter@redhat.com>
+Patchwork-id: 214383
+O-Subject: [RHEL-8 BZ1519554 2/3] ACPI / irq: Workaround firmware issue on X-Gene based m400
+Bugzilla: 1519554
+RH-Acked-by: Al Stone <astone@redhat.com>
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519554
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16144520
The ACPI firmware on the xgene-based m400 platorms erroneously
describes its UART interrupt as ACPI_PRODUCER rather than
@@ -11,24 +20,26 @@ find its interrupt and the kernel unable find a console.
Work around this by avoiding the producer/consumer check
for X-Gene UARTs.
+Upstream Status: RHEL only
Signed-off-by: Mark Salter <msalter@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
---
drivers/acpi/irq.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
-index 7c352cba0528..028c1a564cff 100644
+index e209081d644b..7484bcf59a1b 100644
--- a/drivers/acpi/irq.c
+++ b/drivers/acpi/irq.c
-@@ -129,6 +129,7 @@ struct acpi_irq_parse_one_ctx {
+@@ -126,6 +126,7 @@ struct acpi_irq_parse_one_ctx {
unsigned int index;
unsigned long *res_flags;
struct irq_fwspec *fwspec;
+ bool skip_producer_check;
};
-
+
/**
-@@ -200,7 +201,8 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
+@@ -197,7 +198,8 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
return AE_CTRL_TERMINATE;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
eirq = &ares->data.extended_irq;
@@ -38,13 +49,13 @@ index 7c352cba0528..028c1a564cff 100644
return AE_OK;
if (ctx->index >= eirq->interrupt_count) {
ctx->index -= eirq->interrupt_count;
-@@ -235,8 +237,19 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
+@@ -232,8 +234,19 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
static int acpi_irq_parse_one(acpi_handle handle, unsigned int index,
struct irq_fwspec *fwspec, unsigned long *flags)
{
- struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags, fwspec };
+ struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags, fwspec, false };
-
+
+ /*
+ * Firmware on arm64-based HPE m400 platform incorrectly marks
+ * its UART interrupt as ACPI_PRODUCER rather than ACPI_CONSUMER.
@@ -60,5 +71,5 @@ index 7c352cba0528..028c1a564cff 100644
return ctx.rc;
}
--
-2.17.0
+2.26.2
diff --git a/ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch b/0001-ARM-fix-__get_user_check-in-case-uaccess_-calls-are-.patch
index db893d26e..c5a43608f 100644
--- a/ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch
+++ b/0001-ARM-fix-__get_user_check-in-case-uaccess_-calls-are-.patch
@@ -1,67 +1,8 @@
-From patchwork Mon Sep 30 05:59:25 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Masahiro Yamada <yamada.masahiro@socionext.com>
-X-Patchwork-Id: 1132459
-Return-Path: <SRS0=rUXN=XZ=vger.kernel.org=linux-kernel-owner@kernel.org>
-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
- by smtp.lore.kernel.org (Postfix) with ESMTP id DF215C4360C
- for <linux-kernel@archiver.kernel.org>; Mon, 30 Sep 2019 06:02:56 +0000 (UTC)
-Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
- by mail.kernel.org (Postfix) with ESMTP id B032A20815
- for <linux-kernel@archiver.kernel.org>; Mon, 30 Sep 2019 06:02:56 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com
- header.b="sVJyT1RO"
-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
- id S1729635AbfI3GCz (ORCPT
- <rfc822;linux-kernel@archiver.kernel.org>);
- Mon, 30 Sep 2019 02:02:55 -0400
-Received: from conuserg-10.nifty.com ([210.131.2.77]:65305 "EHLO
- conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
- with ESMTP id S1726121AbfI3GCz (ORCPT
- <rfc822;linux-kernel@vger.kernel.org>);
- Mon, 30 Sep 2019 02:02:55 -0400
-Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp
- [153.142.97.92]) (authenticated)
- by conuserg-10.nifty.com with ESMTP id x8U60ANM011158;
- Mon, 30 Sep 2019 15:00:10 +0900
-DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x8U60ANM011158
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com;
- s=dec2015msa; t=1569823213;
- bh=31RHoPop8t0h2pCPRnwABR+VMelvfuLJ6qwFWQxvRAk=;
- h=From:To:Cc:Subject:Date:From;
- b=sVJyT1ROU+6mzkZMRTb0M214/0QcKkmxRbNgDwh2q1TPJpEjPLOoE+y1jkVndgyce
- qBfr7v3nYiN5WSsx5xTwPYvHohsWcSS3AWwyVRw8Kxjd0CGrX8l5WcF76SmCvJPLCB
- wLRZ7C1/Z/zv9v8AVlB2BGhDmSvNQJ9bvuGi42d+JbBXGDfg0HZGGHEj7yDDLBV9nW
- EZkTGzP6wtIdqgD6DM5Lj4LA7FnlzH8Ocy6yp5agIZ7tdaiVh4E+Xb97KFsLgRin/o
- kTPCap5ub1TziurVW+1pbzwH+G3TNVeY+yJdYcAQRFzXXOrTa7s5zIJUtObrYVGCA2
- ctH5uaN1kjx1g==
-X-Nifty-SrcIP: [153.142.97.92]
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <yamada.masahiro@socionext.com>
-To: linux-arm-kernel@lists.infradead.org,
- Russell King <rmk+kernel@armlinux.org.uk>
-Cc: Linus Torvalds <torvalds@linux-foundation.org>,
- Olof Johansson <olof@lixom.net>, Arnd Bergmann <arnd@arndb.de>,
- Nick Desaulniers <ndesaulniers@google.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Masahiro Yamada <yamada.masahiro@socionext.com>,
- Julien Thierry <julien.thierry.kdev@gmail.com>,
- Russell King <linux@armlinux.org.uk>,
- Stefan Agner <stefan@agner.ch>,
- Thomas Gleixner <tglx@linutronix.de>,
- Vincent Whitchurch <vincent.whitchurch@axis.com>,
- linux-kernel@vger.kernel.org
+Date: Mon, 30 Sep 2019 14:59:25 +0900
Subject: [PATCH] ARM: fix __get_user_check() in case uaccess_* calls are not
inlined
-Date: Mon, 30 Sep 2019 14:59:25 +0900
-Message-Id: <20190930055925.25842-1-yamada.masahiro@socionext.com>
-X-Mailer: git-send-email 2.17.1
-Sender: linux-kernel-owner@vger.kernel.org
-Precedence: bulk
-List-ID: <linux-kernel.vger.kernel.org>
-X-Mailing-List: linux-kernel@vger.kernel.org
KernelCI reports that bcm2835_defconfig is no longer booting since
commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
@@ -106,12 +47,11 @@ Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
-
arch/arm/include/asm/uaccess.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
-index 303248e5b990..559f252d7e3c 100644
+index 98c6b91be4a8..60055827dddc 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -191,11 +191,12 @@ extern int __get_user_64t_4(void *);
@@ -139,5 +79,8 @@ index 303248e5b990..559f252d7e3c 100644
+ uaccess_restore(__ua_flags); \
+ __err; \
})
-
+
#define get_user(x, p) \
+--
+2.26.2
+
diff --git a/ARM-tegra-usb-no-reset.patch b/0001-ARM-tegra-usb-no-reset.patch
index 8ea4f5174..f91c6b83e 100644
--- a/ARM-tegra-usb-no-reset.patch
+++ b/0001-ARM-tegra-usb-no-reset.patch
@@ -1,3 +1,4 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 3 May 2012 20:27:11 +0100
Subject: [PATCH] ARM: tegra: usb no reset
@@ -9,13 +10,13 @@ Patch for disconnect issues with storage attached to a
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
-index 43cb2f2e3b43..7f838ec11c81 100644
+index fc748c731832..7d35e12de70f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
-@@ -4996,6 +4996,13 @@ static void hub_event(struct work_struct *work)
+@@ -5517,6 +5517,13 @@ static void hub_event(struct work_struct *work)
(u16) hub->change_bits[0],
(u16) hub->event_bits[0]);
-
+
+ /* Don't disconnect USB-SATA on TrimSlice */
+ if (strcmp(dev_name(hdev->bus->controller), "tegra-ehci.0") == 0) {
+ if ((hdev->state == 7) && (hub->change_bits[0] == 0) &&
@@ -26,3 +27,6 @@ index 43cb2f2e3b43..7f838ec11c81 100644
/* Lock the device, then check to see if we were
* disconnected while waiting for the lock to succeed. */
usb_lock_device(hdev);
+--
+2.26.2
+
diff --git a/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch b/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch
index 871105093..ee11a2428 100644
--- a/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch
+++ b/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch
@@ -1,41 +1,21 @@
-From c8218e9b3c38fcd36a2d06eec09952a0c6cee9e0 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 2 Oct 2017 18:22:13 -0400
-Subject: [PATCH 2/3] Add efi_status_to_str() and rework efi_status_to_err().
+Subject: [PATCH] Add efi_status_to_str() and rework efi_status_to_err().
This adds efi_status_to_str() for use when printing efi_status_t
messages, and reworks efi_status_to_err() so that the two use a common
list of errors.
+Upstream Status: RHEL only
Signed-off-by: Peter Jones <pjones@redhat.com>
---
- include/linux/efi.h | 3 ++
- drivers/firmware/efi/efi.c | 122 ++++++++++++++++++++++++++++++++++-----------
- 2 files changed, 95 insertions(+), 30 deletions(-)
+ drivers/firmware/efi/efi.c | 124 +++++++++++++++++++++++++++----------
+ include/linux/efi.h | 3 +
+ 2 files changed, 96 insertions(+), 31 deletions(-)
-diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 18b16bf5ce1..436b3c93c3d 100644
---- a/include/linux/efi.h
-+++ b/include/linux/efi.h
-@@ -42,6 +42,8 @@
- #define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1)))
- #define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
-
-+#define EFI_IS_ERROR(x) ((x) & (1UL << (BITS_PER_LONG-1)))
-+
- typedef unsigned long efi_status_t;
- typedef u8 efi_bool_t;
- typedef u16 efi_char16_t; /* UNICODE character */
-@@ -1183,6 +1185,7 @@ static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
- #endif
-
- extern int efi_status_to_err(efi_status_t status);
-+extern const char *efi_status_to_str(efi_status_t status);
-
- /*
- * Variable Attributes
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
-index 557a47829d0..e8f9c7d84e9 100644
+index 4e3055238f31..36ca9e2943ce 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -31,6 +31,7 @@
@@ -43,13 +23,13 @@ index 557a47829d0..e8f9c7d84e9 100644
#include <linux/memblock.h>
#include <linux/security.h>
+#include <linux/bsearch.h>
-
+
#include <asm/early_ioremap.h>
-
-@@ -865,40 +866,101 @@ int efi_mem_type(unsigned long phys_addr)
+
+@@ -828,40 +829,101 @@ int efi_mem_type(unsigned long phys_addr)
}
#endif
-
+
+struct efi_error_code {
+ efi_status_t status;
+ int errno;
@@ -123,9 +103,7 @@ index 557a47829d0..e8f9c7d84e9 100644
int efi_status_to_err(efi_status_t status)
{
- int err;
-+ struct efi_error_code *found;
-+ size_t num = sizeof(efi_error_codes) / sizeof(struct efi_error_code);
-
+-
- switch (status) {
- case EFI_SUCCESS:
- err = 0;
@@ -154,6 +132,10 @@ index 557a47829d0..e8f9c7d84e9 100644
- default:
- err = -EINVAL;
- }
++ struct efi_error_code *found;
++ size_t num = sizeof(efi_error_codes) / sizeof(struct efi_error_code);
+
+- return err;
+ found = bsearch((void *)(uintptr_t)status, efi_error_codes,
+ sizeof(struct efi_error_code), num,
+ efi_status_cmp_bsearch);
@@ -161,8 +143,7 @@ index 557a47829d0..e8f9c7d84e9 100644
+ return -EINVAL;
+ return found->errno;
+}
-
-- return err;
++
+const char *
+efi_status_to_str(efi_status_t status)
+{
@@ -176,8 +157,29 @@ index 557a47829d0..e8f9c7d84e9 100644
+ return "Unknown error code";
+ return found->description;
}
-
+
static DEFINE_SPINLOCK(efi_mem_reserve_persistent_lock);
+diff --git a/include/linux/efi.h b/include/linux/efi.h
+index 9430d01c0c3d..51503bf118ab 100644
+--- a/include/linux/efi.h
++++ b/include/linux/efi.h
+@@ -42,6 +42,8 @@
+ #define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1)))
+ #define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
+
++#define EFI_IS_ERROR(x) ((x) & (1UL << (BITS_PER_LONG-1)))
++
+ typedef unsigned long efi_status_t;
+ typedef u8 efi_bool_t;
+ typedef u16 efi_char16_t; /* UNICODE character */
+@@ -825,6 +827,7 @@ static inline bool efi_rt_services_supported(unsigned int mask)
+ #endif
+
+ extern int efi_status_to_err(efi_status_t status);
++extern const char *efi_status_to_str(efi_status_t status);
+
+ /*
+ * Variable Attributes
--
-2.15.0
+2.26.2
diff --git a/arm64-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch b/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
index 6417bc29a..970824d59 100644
--- a/arm64-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
+++ b/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch
@@ -1,29 +1,32 @@
-From 487ff7b0e537506057960a0c2d9482d19f2acf4a Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
-Date: Wed, 26 Apr 2017 11:12:54 +0100
+Date: Wed, 26 Feb 2020 13:38:40 -0500
Subject: [PATCH] Add option of 13 for FORCE_MAX_ZONEORDER
This is a hack, but it's what the other distros currently use
for aarch64 with 4K pages so we'll do the same while upstream
decides what the best outcome is (which isn't this).
+Upstream Status: RHEL only
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+[Add a dependency on RHEL_DIFFERENCES]
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
-index 3741859765cf..deec9511f1d3 100644
+index 7f37a6d0658a..c88ee0e8ce6e 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
-@@ -751,6 +751,7 @@ config XEN
+@@ -1126,6 +1126,7 @@ config XEN
config FORCE_MAX_ZONEORDER
int
default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
-+ default "13" if (ARCH_THUNDER && !ARM64_64K_PAGES)
++ default "13" if (ARCH_THUNDER && !ARM64_64K_PAGES && !RHEL_DIFFERENCES)
default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
default "11"
help
--
-2.12.2
+2.26.2
diff --git a/0001-Add-support-for-deprecating-processors.patch b/0001-Add-support-for-deprecating-processors.patch
new file mode 100644
index 000000000..8eaf00d7c
--- /dev/null
+++ b/0001-Add-support-for-deprecating-processors.patch
@@ -0,0 +1,303 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Wed, 13 Nov 2019 14:44:30 -0500
+Subject: [PATCH] Add support for deprecating processors
+
+Message-id: <20191113144431.9403-4-labbott@redhat.com>
+Patchwork-id: 286081
+O-Subject: [ARK INTERNAL PATCHv2 3/4] [redhat] Add support for deprecating processors
+Bugzilla:
+RH-Acked-by: Don Zickus <dzickus@redhat.com>
+RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+RH-Acked-by: Jiri Benc <jbenc@redhat.com>
+
+This is the squashed version of the following patches
+modifed to use the new CONFIG_RH_DISABLE_DEPRECATED option
+
+add rh_check_supported
+
+Message-id: <1525313397-75200-1-git-send-email-darcari@redhat.com>
+Patchwork-id: 212189
+O-Subject: [RHEL8.0 BZ 1565717 v2] x86: add rh_check_supported
+Bugzilla: 1565717
+RH-Acked-by: Steve Best <sbest@redhat.com>
+RH-Acked-by: Mikulas Patocka <mpatocka@redhat.com>
+
+Description:
+
+Add code to verify that the booted x86 processor is supported by
+Red Hat. In cases where the processor is not supported a critical
+message is logged.
+
+Initially the supported set of processors for RHEL8 remains the same
+as RHEL7.
+
+Bugzilla: http://bugzilla.redhat.com/1565717
+Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=15966242
+
+Test: Booted brew build on supported (Haswell) and unsupported processor (CNL)
+ and achieved desired results.
+
+Upstream: RHEL Only
+
+Cc: David Arcari <darcari@redhat.com>
+Cc: Mikulas Patocka <mpatocka@redhat.com>
+Cc: Dave Young <dyoung@redhat.com>
+Cc: Josh Poimboeuf <jpoimboe@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+update rh_check_supported processor list
+
+Message-id: <1530618602-17477-1-git-send-email-darcari@redhat.com>
+Patchwork-id: 223452
+O-Subject: [RHEL8.0 BZ 1595918] x86: update rh_check_supported processor list
+Bugzilla: 1595918
+RH-Acked-by: Jarod Wilson <jarod@redhat.com>
+RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+RH-Acked-by: Steve Best <sbest@redhat.com>
+
+Bugzilla: http://bugzilla.redhat.com/1595918
+Upstream Status: RHEL_only
+Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16916208
+Tested: Verified on a varity of supported and unsupported Intel and AMD systems.
+ Results as expected.
+
+In RHEL8, we are marking some of the older processors as unsupported. No code
+is being removed; however, the older processors are not supported and as such
+are not candidates for certification.
+
+Cc: David Arcari <darcari@redhat.com>
+Cc: Prarit Bhargava <prarit@redhat.com>
+Cc: Steve Best <sbest@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+Signed-off-by: Jakub Racek <jracek@redhat.com>
+refresh: rename FAM6_ATOM again, see f2c4db1bd
+
+mark whiskey-lake processor supported
+
+Message-id: <1533125629-12870-1-git-send-email-darcari@redhat.com>
+Patchwork-id: 225809
+O-Subject: [ BZ 1609604] mark whiskey-lake processor supported
+Bugzilla: 1609604
+RH-Acked-by: Steve Best <sbest@redhat.com>
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+
+Bugzilla: http://bugzilla.redhat.com/1609604
+Build Info: https://brewweb.devel.redhat.com/taskinfo?taskID=17474338
+Upstream Status: RHEL Only
+Tested: Successful excecution of platform-test suite.
+
+Whiskey Lake is cpu model 142 with stepping 11. Stepping > 11 for cpu model
+142 is not supported.
+
+For model 158, the highest supported stepping is 10.
+
+Cc: Prarit Bhargava <prarit@redhat.com>
+Cc: David Arcari <darcari@redhat.com>
+Cc: Dave Young <dyoung@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+mark intel knights landing and knights mill unsupported
+
+Message-id: <1533580277-126323-1-git-send-email-darcari@redhat.com>
+Patchwork-id: 226187
+O-Subject: [RHEL8.0 BZ 1610493] mark intel knights landing and knights mill unsupported
+Bugzilla: 1610493
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+RH-Acked-by: Steve Best <sbest@redhat.com>
+
+Bugzilla: http://bugzilla.redhat.com/1610493
+Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17625348
+
+Tested: verified on KNL/KNM system
+Upstream Status: RHEL Only
+Depends: http://bugzilla.redhat.com/1609604
+
+We are marking KNL/KNM processors as unsupported. No code is being removed;
+however, the older processors are not supported and as such are not
+candidates for certification.
+
+Upstream Status: RHEL only
+Cc: Prarit Bhargava <prarit@redhat.com>
+Cc: David Arcari <darcari@redhat.com>
+Cc: Dave Young <dyoung@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ arch/x86/kernel/cpu/common.c | 1 +
+ arch/x86/kernel/setup.c | 132 ++++++++++++++++++++++++++++++++++-
+ 2 files changed, 132 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
+index bed0cb83fe24..a15622e0d79f 100644
+--- a/arch/x86/kernel/cpu/common.c
++++ b/arch/x86/kernel/cpu/common.c
+@@ -1205,6 +1205,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
+ cpu_detect(c);
+ get_cpu_vendor(c);
+ get_cpu_cap(c);
++ get_model_name(c); /* RHEL: get model name for unsupported check */
+ get_cpu_address_sizes(c);
+ setup_force_cpu_cap(X86_FEATURE_CPUID);
+
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
+index 4b3fa6cd3106..e39ec0f88d28 100644
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -44,6 +44,7 @@
+ #include <asm/unwind.h>
+ #include <asm/vsyscall.h>
+ #include <linux/vmalloc.h>
++#include <asm/intel-family.h>
+
+ /*
+ * max_low_pfn_mapped: highest directly mapped pfn < 4 GB
+@@ -747,7 +748,132 @@ static void __init trim_low_memory_range(void)
+ {
+ memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
+ }
+-
++
++static bool valid_amd_processor(__u8 family, const char *model_id)
++{
++ bool valid;
++
++ switch(family) {
++ case 0x15:
++ valid = true;
++ break;
++
++ case 0x17:
++ valid = strstr(model_id, "AMD EPYC 7");
++ break;
++
++ default:
++ valid = false;
++ break;
++ }
++
++ return valid;
++}
++
++static bool valid_intel_processor(__u8 family, __u8 model, __u8 stepping)
++{
++ bool valid;
++
++ if (family != 6)
++ return false;
++
++ switch(model) {
++ case INTEL_FAM6_ATOM_GOLDMONT_D:
++ case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
++
++ case INTEL_FAM6_BROADWELL:
++ case INTEL_FAM6_BROADWELL_G:
++ case INTEL_FAM6_BROADWELL_X:
++ case INTEL_FAM6_BROADWELL_D:
++
++ case INTEL_FAM6_HASWELL:
++ case INTEL_FAM6_HASWELL_G:
++ case INTEL_FAM6_HASWELL_L:
++ case INTEL_FAM6_HASWELL_X:
++ valid = true;
++ break;
++
++ case INTEL_FAM6_KABYLAKE:
++ valid = (stepping <= 10);
++ break;
++
++ case INTEL_FAM6_KABYLAKE_L:
++ valid = (stepping <= 11);
++ break;
++
++ case INTEL_FAM6_SKYLAKE_L:
++ case INTEL_FAM6_SKYLAKE:
++ case INTEL_FAM6_SKYLAKE_X:
++ /* stepping > 4 is Cascade Lake and is not supported */
++ valid = (stepping <= 4);
++ break;
++
++ default:
++ valid = false;
++ break;
++ }
++
++ return valid;
++}
++
++static void rh_check_supported(void)
++{
++ bool guest;
++
++ guest = (x86_hyper_type != X86_HYPER_NATIVE || boot_cpu_has(X86_FEATURE_HYPERVISOR));
++
++ /* RHEL supports single cpu on guests only */
++ if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) &&
++ !guest && is_kdump_kernel()) {
++ pr_crit("Detected single cpu native boot.\n");
++ pr_crit("Important: In this kernel, single threaded, single CPU 64-bit physical systems are unsupported.");
++ }
++
++ /*
++ * If the RHEL kernel does not support this hardware, the kernel will
++ * attempt to boot, but no support is provided for this hardware
++ */
++ switch (boot_cpu_data.x86_vendor) {
++ case X86_VENDOR_AMD:
++ if (!valid_amd_processor(boot_cpu_data.x86,
++ boot_cpu_data.x86_model_id)) {
++ pr_crit("Detected CPU family %xh model %d\n",
++ boot_cpu_data.x86,
++ boot_cpu_data.x86_model);
++ mark_hardware_unsupported("AMD Processor");
++ }
++ break;
++
++ case X86_VENDOR_INTEL:
++ if (!valid_intel_processor(boot_cpu_data.x86,
++ boot_cpu_data.x86_model,
++ boot_cpu_data.x86_stepping)) {
++ pr_crit("Detected CPU family %d model %d stepping %d\n",
++ boot_cpu_data.x86,
++ boot_cpu_data.x86_model,
++ boot_cpu_data.x86_stepping);
++ mark_hardware_unsupported("Intel Processor");
++ }
++ break;
++
++ default:
++ pr_crit("Detected processor %s %s\n",
++ boot_cpu_data.x86_vendor_id,
++ boot_cpu_data.x86_model_id);
++ mark_hardware_unsupported("Processor");
++ break;
++ }
++
++ /*
++ * Due to the complexity of x86 lapic & ioapic enumeration, and PCI IRQ
++ * routing, ACPI is required for x86. acpi=off is a valid debug kernel
++ * parameter, so just print out a loud warning in case something
++ * goes wrong (which is most of the time).
++ */
++ if (acpi_disabled && !guest)
++ pr_crit("ACPI has been disabled or is not available on this hardware. This may result in a single cpu boot, incorrect PCI IRQ routing, or boot failure.\n");
++}
++
+ /*
+ * Dump out kernel offset information on panic.
+ */
+@@ -1244,6 +1370,10 @@ void __init setup_arch(char **cmdline_p)
+ efi_apply_memmap_quirks();
+ #endif
+
++#ifdef CONFIG_RH_DISABLE_DEPRECATED
++ rh_check_supported();
++#endif
++
+ unwind_init();
+ }
+
+--
+2.26.2
+
diff --git a/0001-Drop-that-for-now.patch b/0001-Drop-that-for-now.patch
index 1d1850944..bc898b654 100644
--- a/0001-Drop-that-for-now.patch
+++ b/0001-Drop-that-for-now.patch
@@ -1,4 +1,4 @@
-From 12cec6680e67d6b4fed9e30cd8c1f13871996cc1 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Laura Abbott <labbott@redhat.com>
Date: Wed, 23 Jan 2019 14:36:37 +0100
Subject: [PATCH] Drop that for now
@@ -8,10 +8,10 @@ Subject: [PATCH] Drop that for now
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index f5b1d0d168e0..5f31107b22d1 100644
+index 3d65d1153aac..0e2fb7fe2675 100644
--- a/Makefile
+++ b/Makefile
-@@ -430,7 +430,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
+@@ -479,7 +479,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
-Werror=implicit-function-declaration -Werror=implicit-int \
@@ -21,5 +21,5 @@ index f5b1d0d168e0..5f31107b22d1 100644
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
--
-2.20.1
+2.26.2
diff --git a/0001-IB-rxe-Mark-Soft-RoCE-Transport-driver-as-tech-previ.patch b/0001-IB-rxe-Mark-Soft-RoCE-Transport-driver-as-tech-previ.patch
new file mode 100644
index 000000000..cb5344d98
--- /dev/null
+++ b/0001-IB-rxe-Mark-Soft-RoCE-Transport-driver-as-tech-previ.patch
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Don Dutile <ddutile@redhat.com>
+Date: Tue, 24 Jul 2018 22:29:16 -0400
+Subject: [PATCH] IB/rxe: Mark Soft-RoCE Transport driver as tech-preview
+
+Message-id: <20180724222916.19362-1-ddutile@redhat.com>
+Patchwork-id: 225418
+O-Subject: [PATCH RHEL-8.0] IB/rxe: Mark Soft-RoCE Transport driver as tech-preview.
+Bugzilla: 1605216
+RH-Acked-by: Jarod Wilson <jarod@redhat.com>
+RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+RH-Acked-by: Honggang Li <honli@redhat.com>
+
+The Soft-RoCE driver implements the InfiniBand RDMA transport
+over the Linux network stack. It enables a system with a
+standard Ethernet adapter to interoperate with a RoCE
+adapter or with another system running the RXE driver.
+
+Unfortunately, a wide range of tests and/or use-cases have shown
+that the driver is not ready for enterprise use, and upstream bug
+fixing may not be complete for RHEL-8.0.
+Thus, recommendation from driver maintainer is to mark it as
+tech-preview. It is expected that future bug fixes will enable it
+to be upgraded to fully supported. In the mean time, it works
+in a number of use cases, and can be used to demonstrate upstream
+fixes on failing cases.
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1605216
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17344161
+
+Testing:
+Simple boot test, and loading of rxe driver to show tech-preview
+msg is generated in dmesg log.
+
+Upstream Status: RHEL only
+Signed-off-by: Donald Dutile <ddutile@redhat.com
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/infiniband/sw/rxe/rxe.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
+index 4afdd2e20883..05e637aa0e3d 100644
+--- a/drivers/infiniband/sw/rxe/rxe.c
++++ b/drivers/infiniband/sw/rxe/rxe.c
+@@ -335,6 +335,8 @@ static int __init rxe_module_init(void)
+ {
+ int err;
+
++ mark_tech_preview("Soft-RoCE Transport Driver", THIS_MODULE);
++
+ /* initialize slab caches for managed objects */
+ err = rxe_cache_init();
+ if (err) {
+--
+2.26.2
+
diff --git a/input-rmi4-remove-the-need-for-artifical-IRQ.patch b/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
index 9a1794558..4d7bef554 100644
--- a/input-rmi4-remove-the-need-for-artifical-IRQ.patch
+++ b/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
@@ -1,4 +1,4 @@
-From 0a74d0f27e8d60e427b447a041bc061917d85fac Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date: Mon, 3 Apr 2017 18:18:21 +0200
Subject: [PATCH] Input: rmi4 - remove the need for artificial IRQ in case of
@@ -22,33 +22,33 @@ Signed-off-by: Lyude <lyude@redhat.com>
3 files changed, 75 insertions(+), 114 deletions(-)
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
-index 9e33165250a3..e7e33a160b47 100644
+index 8cffa84c9650..6c4e3675601a 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
-@@ -316,19 +316,12 @@ static int rmi_input_event(struct hid_device *hdev, u8 *data, int size)
+@@ -322,19 +322,12 @@ static int rmi_input_event(struct hid_device *hdev, u8 *data, int size)
{
struct rmi_data *hdata = hid_get_drvdata(hdev);
struct rmi_device *rmi_dev = hdata->xport.rmi_dev;
- unsigned long flags;
-
+
if (!(test_bit(RMI_STARTED, &hdata->flags)))
return 0;
-
+
- local_irq_save(flags);
-
rmi_set_attn_data(rmi_dev, data[1], &data[2], size - 2);
-
+
- generic_handle_irq(hdata->rmi_irq);
-
- local_irq_restore(flags);
-
return 1;
}
-
-@@ -586,56 +579,6 @@ static const struct rmi_transport_ops hid_rmi_ops = {
+
+@@ -592,56 +585,6 @@ static const struct rmi_transport_ops hid_rmi_ops = {
.reset = rmi_hid_reset,
};
-
+
-static void rmi_irq_teardown(void *data)
-{
- struct rmi_data *hdata = data;
@@ -102,10 +102,10 @@ index 9e33165250a3..e7e33a160b47 100644
static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
struct rmi_data *data = NULL;
-@@ -708,18 +651,11 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
-
+@@ -714,18 +657,11 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
+
mutex_init(&data->page_mutex);
-
+
- ret = rmi_setup_irq_domain(hdev);
- if (ret) {
- hid_err(hdev, "failed to allocate IRQ domain\n");
@@ -114,26 +114,26 @@ index 9e33165250a3..e7e33a160b47 100644
-
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
rmi_hid_pdata.f30_data.disable = true;
-
+
data->xport.dev = hdev->dev.parent;
data->xport.pdata = rmi_hid_pdata;
- data->xport.pdata.irq = data->rmi_irq;
data->xport.proto_name = "hid";
data->xport.ops = &hid_rmi_ops;
-
+
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
-index fc3ab93b7aea..35bc90141db8 100644
+index 258d5fe3d395..f7298e3dc8f3 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
-@@ -185,34 +185,47 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsigned long irq_status,
+@@ -182,34 +182,47 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsigned long irq_status,
attn_data.data = fifo_data;
-
+
kfifo_put(&drvdata->attn_fifo, attn_data);
+
+ schedule_work(&drvdata->attn_work);
}
EXPORT_SYMBOL_GPL(rmi_set_attn_data);
-
+
-static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
+static void attn_callback(struct work_struct *work)
{
@@ -144,7 +144,7 @@ index fc3ab93b7aea..35bc90141db8 100644
+ attn_work);
struct rmi4_attn_data attn_data = {0};
int ret, count;
-
+
count = kfifo_get(&drvdata->attn_fifo, &attn_data);
- if (count) {
- *(drvdata->irq_status) = attn_data.irq_status;
@@ -152,7 +152,7 @@ index fc3ab93b7aea..35bc90141db8 100644
- }
+ if (!count)
+ return;
-
+
- ret = rmi_process_interrupt_requests(rmi_dev);
+ *(drvdata->irq_status) = attn_data.irq_status;
+ drvdata->attn_data = attn_data;
@@ -162,14 +162,14 @@ index fc3ab93b7aea..35bc90141db8 100644
- rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
+ rmi_dbg(RMI_DEBUG_CORE, &drvdata->rmi_dev->dev,
"Failed to process interrupt request: %d\n", ret);
-
+
- if (count) {
- kfree(attn_data.data);
-- attn_data.data = NULL;
+- drvdata->attn_data.data = NULL;
- }
+ kfree(attn_data.data);
-+ attn_data.data = NULL;
-
++ drvdata->attn_data.data = NULL;
+
if (!kfifo_is_empty(&drvdata->attn_fifo))
- return rmi_irq_fn(irq, dev_id);
+ schedule_work(&drvdata->attn_work);
@@ -184,30 +184,30 @@ index fc3ab93b7aea..35bc90141db8 100644
+ if (ret)
+ rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
+ "Failed to process interrupt request: %d\n", ret);
-
+
return IRQ_HANDLED;
}
-@@ -220,7 +233,6 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
+@@ -217,7 +230,6 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
static int rmi_irq_init(struct rmi_device *rmi_dev)
{
struct rmi_device_platform_data *pdata = rmi_get_platform_data(rmi_dev);
- struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
int irq_flags = irq_get_trigger_type(pdata->irq);
int ret;
-
-@@ -238,8 +250,6 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
+
+@@ -235,8 +247,6 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
return ret;
}
-
+
- data->enabled = true;
-
return 0;
}
-
-@@ -889,23 +899,27 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
+
+@@ -886,23 +896,27 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
if (data->enabled)
goto out;
-
+
- enable_irq(irq);
- data->enabled = true;
- if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
@@ -227,7 +227,7 @@ index fc3ab93b7aea..35bc90141db8 100644
+ "Failed to disable irq for wake: %d\n",
+ retval);
+ }
-
+
- /*
- * Call rmi_process_interrupt_requests() after enabling irq,
- * otherwise we may lose interrupt on edge-triggered systems.
@@ -245,12 +245,12 @@ index fc3ab93b7aea..35bc90141db8 100644
+ } else {
+ data->enabled = true;
+ }
-
+
out:
mutex_unlock(&data->enabled_mutex);
-@@ -925,20 +939,22 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
+@@ -922,20 +936,22 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
goto out;
-
+
data->enabled = false;
- disable_irq(irq);
- if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
@@ -283,21 +283,21 @@ index fc3ab93b7aea..35bc90141db8 100644
+ kfree(attn_data.data);
+ }
}
-
+
out:
-@@ -984,6 +1000,8 @@ static int rmi_driver_remove(struct device *dev)
+@@ -981,6 +997,8 @@ static int rmi_driver_remove(struct device *dev)
irq_domain_remove(data->irqdomain);
data->irqdomain = NULL;
-
+
+ cancel_work_sync(&data->attn_work);
+
rmi_f34_remove_sysfs(rmi_dev);
rmi_free_function_list(rmi_dev);
-
-@@ -1221,9 +1239,15 @@ static int rmi_driver_probe(struct device *dev)
+
+@@ -1219,9 +1237,15 @@ static int rmi_driver_probe(struct device *dev)
}
}
-
+
- retval = rmi_irq_init(rmi_dev);
- if (retval < 0)
- goto err_destroy_functions;
@@ -310,21 +310,21 @@ index fc3ab93b7aea..35bc90141db8 100644
+ data->enabled = true;
+
+ INIT_WORK(&data->attn_work, attn_callback);
-
+
if (data->f01_container->dev.driver) {
/* Driver already bound, so enable ATTN now. */
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
-index 5ef5c7c412a7..21f48f2807de 100644
+index 7b22366d0065..307a651b2755 100644
--- a/include/linux/rmi.h
+++ b/include/linux/rmi.h
-@@ -366,6 +366,7 @@ struct rmi_driver_data {
-
+@@ -363,6 +363,7 @@ struct rmi_driver_data {
+
struct rmi4_attn_data attn_data;
DECLARE_KFIFO(attn_fifo, struct rmi4_attn_data, 16);
+ struct work_struct attn_work;
};
-
+
int rmi_register_transport_device(struct rmi_transport_dev *xport);
--
-2.17.1
+2.26.2
diff --git a/KEYS-Make-use-of-platform-keyring-for-module-signature.patch b/0001-KEYS-Make-use-of-platform-keyring-for-module-signatu.patch
index 7c2a0b68d..b53addbe3 100644
--- a/KEYS-Make-use-of-platform-keyring-for-module-signature.patch
+++ b/0001-KEYS-Make-use-of-platform-keyring-for-module-signatu.patch
@@ -1,4 +1,4 @@
-From 70cecc97a4fc1667472224558a50dd7b6c42c789 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Holmes <robeholmes@gmail.com>
Date: Tue, 23 Apr 2019 07:39:29 +0000
Subject: [PATCH] KEYS: Make use of platform keyring for module signature
@@ -15,8 +15,8 @@ were not successfully verified.
Signed-off-by: Robert Holmes <robeholmes@gmail.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
- kernel/module_signing.c | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
+ kernel/module_signing.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
index 9d9fc678c91d..84ad75a53c83 100644
@@ -25,7 +25,7 @@ index 9d9fc678c91d..84ad75a53c83 100644
@@ -38,8 +38,15 @@ int mod_verify_sig(const void *mod, struct load_info *info)
modlen -= sig_len + sizeof(ms);
info->len = modlen;
-
+
- return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
+ ret = verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
VERIFY_USE_SECONDARY_KEYRING,
@@ -40,4 +40,5 @@ index 9d9fc678c91d..84ad75a53c83 100644
+ return ret;
}
--
-2.21.0
+2.26.2
+
diff --git a/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch b/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch
deleted file mode 100644
index 34934a970..000000000
--- a/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 3ce5852ec6add45a28fe1706e9163351940e905c Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones@redhat.com>
-Date: Mon, 2 Oct 2017 18:25:29 -0400
-Subject: [PATCH 1/3] Make get_cert_list() not complain about cert lists that
- aren't present.
-
-Signed-off-by: Peter Jones <pjones@redhat.com>
----
- security/integrity/platform_certs/load_uefi.c | 37 ++++++++++++++++++++++---------------
- 1 file changed, 22 insertions(+), 15 deletions(-)
-
-diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
-index 81b19c52832b..e188f3ecbce3 100644
---- a/security/integrity/platform_certs/load_uefi.c
-+++ b/security/integrity/platform_certs/load_uefi.c
-@@ -38,8 +38,8 @@ static __init bool uefi_check_ignore_db(void)
- /*
- * Get a certificate list blob from the named EFI variable.
- */
--static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
-- unsigned long *size)
-+static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
-+ unsigned long *size , void **cert_list)
- {
- efi_status_t status;
- unsigned long lsize = 4;
-@@ -47,24 +47,31 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
- void *db;
-
- status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
-+ if (status == EFI_NOT_FOUND) {
-+ *size = 0;
-+ *cert_list = NULL;
-+ return 0;
-+ }
-+
- if (status != EFI_BUFFER_TOO_SMALL) {
- pr_err("Couldn't get size: 0x%lx\n", status);
-- return NULL;
-+ return efi_status_to_err(status);
- }
-
- db = kmalloc(lsize, GFP_KERNEL);
- if (!db)
-- return NULL;
-+ return -ENOMEM;
-
- status = efi.get_variable(name, guid, NULL, &lsize, db);
- if (status != EFI_SUCCESS) {
- kfree(db);
- pr_err("Error reading db var: 0x%lx\n", status);
-- return NULL;
-+ return efi_status_to_err(status);
- }
-
- *size = lsize;
-- return db;
-+ *cert_list = db;
-+ return 0;
- }
-
- /*
-@@ -153,10 +160,10 @@ static int __init load_uefi_certs(void)
- * an error if we can't get them.
- */
- if (!uefi_check_ignore_db()) {
-- db = get_cert_list(L"db", &secure_var, &dbsize);
-- if (!db) {
-+ rc = get_cert_list(L"db", &secure_var, &dbsize, &db);
-+ if (rc < 0) {
- pr_err("MODSIGN: Couldn't get UEFI db list\n");
-- } else {
-+ } else if (dbsize != 0) {
- rc = parse_efi_signature_list("UEFI:db",
- db, dbsize, get_handler_for_db);
- if (rc)
-@@ -166,10 +173,10 @@ static int __init load_uefi_certs(void)
- }
- }
-
-- mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
-- if (!mok) {
-+ rc = get_cert_list(L"MokListRT", &mok_var, &moksize, &mok);
-+ if (rc < 0) {
- pr_info("Couldn't get UEFI MokListRT\n");
-- } else {
-+ } else if (moksize != 0) {
- rc = parse_efi_signature_list("UEFI:MokListRT",
- mok, moksize, get_handler_for_db);
- if (rc)
-@@ -177,10 +184,10 @@ static int __init load_uefi_certs(void)
- kfree(mok);
- }
-
-- dbx = get_cert_list(L"dbx", &secure_var, &dbxsize);
-- if (!dbx) {
-+ rc = get_cert_list(L"dbx", &secure_var, &dbxsize, &dbx);
-+ if (rc < 0) {
- pr_info("Couldn't get UEFI dbx list\n");
-- } else {
-+ } else if (dbxsize != 0) {
- rc = parse_efi_signature_list("UEFI:dbx",
- dbx, dbxsize,
- get_handler_for_dbx);
diff --git a/0001-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch b/0001-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch
new file mode 100644
index 000000000..671b7402f
--- /dev/null
+++ b/0001-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Mon, 2 Oct 2017 18:18:30 -0400
+Subject: [PATCH] Make get_cert_list() use efi_status_to_str() to print error
+ messages.
+
+Upstream Status: RHEL only
+Signed-off-by: Peter Jones <pjones@redhat.com>
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ security/integrity/platform_certs/load_uefi.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
+index 253fb9a7fc98..8c95b68d86d4 100644
+--- a/security/integrity/platform_certs/load_uefi.c
++++ b/security/integrity/platform_certs/load_uefi.c
+@@ -46,7 +46,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
+ return NULL;
+
+ if (*status != EFI_BUFFER_TOO_SMALL) {
+- pr_err("Couldn't get size: 0x%lx\n", *status);
++ pr_err("Couldn't get size: %s (0x%lx)\n",
++ efi_status_to_str(*status), *status);
+ return NULL;
+ }
+
+@@ -57,7 +58,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
+ *status = efi.get_variable(name, guid, NULL, &lsize, db);
+ if (*status != EFI_SUCCESS) {
+ kfree(db);
+- pr_err("Error reading db var: 0x%lx\n", *status);
++ pr_err("Error reading db var: %s (0x%lx)\n",
++ efi_status_to_str(*status), *status);
+ return NULL;
+ }
+
+--
+2.26.2
+
diff --git a/0001-PCI-brcmstb-Wait-for-Raspberry-Pi-s-firmware-when-pr.patch b/0001-PCI-brcmstb-Wait-for-Raspberry-Pi-s-firmware-when-pr.patch
new file mode 100644
index 000000000..07f8b4e26
--- /dev/null
+++ b/0001-PCI-brcmstb-Wait-for-Raspberry-Pi-s-firmware-when-pr.patch
@@ -0,0 +1,57 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Date: Tue, 10 Mar 2020 13:52:41 +0100
+Subject: [PATCH] PCI: brcmstb: Wait for Raspberry Pi's firmware when present
+
+xHCI's PCI fixup, run at the end of pcie-brcmstb's probe, depends on
+RPi4's VideoCore firmware interface to be up and running. It's possible
+for both initializations to race, so make sure it's available prior to
+starting.
+
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ drivers/pci/controller/pcie-brcmstb.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
+index 6d79d14527a6..aee84679a997 100644
+--- a/drivers/pci/controller/pcie-brcmstb.c
++++ b/drivers/pci/controller/pcie-brcmstb.c
+@@ -28,6 +28,8 @@
+ #include <linux/string.h>
+ #include <linux/types.h>
+
++#include <soc/bcm2835/raspberrypi-firmware.h>
++
+ #include "../pci.h"
+
+ /* BRCM_PCIE_CAP_REGS - Offset for the mandatory capability config regs */
+@@ -917,11 +919,24 @@ static int brcm_pcie_probe(struct platform_device *pdev)
+ {
+ struct device_node *np = pdev->dev.of_node, *msi_np;
+ struct pci_host_bridge *bridge;
++ struct device_node *fw_np;
+ struct brcm_pcie *pcie;
+ struct pci_bus *child;
+ struct resource *res;
+ int ret;
+
++ /*
++ * We have to wait for the Raspberry Pi's firmware interface to be up
++ * as some PCI fixups depend on it.
++ */
++ fw_np = of_find_compatible_node(NULL, NULL,
++ "raspberrypi,bcm2835-firmware");
++ if (fw_np && !rpi_firmware_get(fw_np)) {
++ of_node_put(fw_np);
++ return -EPROBE_DEFER;
++ }
++ of_node_put(fw_np);
++
+ bridge = devm_pci_alloc_host_bridge(&pdev->dev, sizeof(*pcie));
+ if (!bridge)
+ return -ENOMEM;
+--
+2.26.2
+
diff --git a/0001-USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch b/0001-USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch
new file mode 100644
index 000000000..7f13ec1f5
--- /dev/null
+++ b/0001-USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch
@@ -0,0 +1,72 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Date: Tue, 10 Mar 2020 13:52:42 +0100
+Subject: [PATCH] USB: pci-quirks: Add Raspberry Pi 4 quirk
+
+On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be
+loaded directly from an EEPROM or, if not present, by the SoC's
+VideCore. Inform VideCore that VL805 was just reset.
+
+Also, as this creates a dependency between XHCI_PCI and VideoCore's
+firmware interface, reflect that on the firmware interface Kconfg.
+
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+---
+ drivers/firmware/Kconfig | 1 +
+ drivers/usb/host/pci-quirks.c | 16 ++++++++++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
+index 8007d4aa76dc..7ca346d3d337 100644
+--- a/drivers/firmware/Kconfig
++++ b/drivers/firmware/Kconfig
+@@ -180,6 +180,7 @@ config ISCSI_IBFT
+ config RASPBERRYPI_FIRMWARE
+ tristate "Raspberry Pi Firmware Driver"
+ depends on BCM2835_MBOX
++ default XHCI_PCI
+ help
+ This option enables support for communicating with the firmware on the
+ Raspberry Pi.
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
+index beb2efa71341..0dc34668bb2a 100644
+--- a/drivers/usb/host/pci-quirks.c
++++ b/drivers/usb/host/pci-quirks.c
+@@ -16,6 +16,9 @@
+ #include <linux/export.h>
+ #include <linux/acpi.h>
+ #include <linux/dmi.h>
++
++#include <soc/bcm2835/raspberrypi-firmware.h>
++
+ #include "pci-quirks.h"
+ #include "xhci-ext-caps.h"
+
+@@ -1243,11 +1246,24 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
+
+ static void quirk_usb_early_handoff(struct pci_dev *pdev)
+ {
++ int ret;
++
+ /* Skip Netlogic mips SoC's internal PCI USB controller.
+ * This device does not need/support EHCI/OHCI handoff
+ */
+ if (pdev->vendor == 0x184e) /* vendor Netlogic */
+ return;
++
++ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
++ ret = rpi_firmware_init_vl805(pdev);
++ if (ret) {
++ /* Firmware might be outdated, or something failed */
++ dev_warn(&pdev->dev,
++ "Failed to load VL805's firmware: %d. Will continue to attempt to work, but bad things might happen. You should fix this...\n",
++ ret);
++ }
++ }
++
+ if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
+ pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
+ pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
+--
+2.26.2
+
diff --git a/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch b/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch
new file mode 100644
index 000000000..828ed5d9a
--- /dev/null
+++ b/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch
@@ -0,0 +1,75 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Robert Richter <rrichter@redhat.com>
+Date: Thu, 7 Jun 2018 22:59:32 -0400
+Subject: [PATCH] Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
+
+Message-id: <1528412373-19128-2-git-send-email-rrichter@redhat.com>
+Patchwork-id: 220950
+O-Subject: [RHEL-8.0 BZ 1563590 v2 1/2] PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
+Bugzilla: 1563590
+RH-Acked-by: Dean Nelson <dnelson@redhat.com>
+RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
+RH-Acked-by: Mark Salter <msalter@redhat.com>
+
+From: Ashok Kumar Sekar <asekar@redhat.com>
+
+PCI BAR 5 is not setup correctly for the on-board AHCI
+controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
+by using BAR 4's resources which are populated correctly but NOT used
+by the AHCI controller actually.
+
+RHEL-only:
+
+Both patches are in RHEL-7.6 also. Inclusion of the patches into RHEL-8
+was discussed. Since there are partners with Ax system configurations it
+was decided to carry them in RHEL8 too. See:
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=1563590#c1
+
+Upstream Status: RHEL only
+Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
+Signed-off-by: Jayachandran C <jchandra@broadcom.com>
+Signed-off-by: Robert Richter <rrichter@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/pci/quirks.c | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index ca9ed5774eb1..bd0cee4236b0 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -4183,6 +4183,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
+ quirk_bridge_cavm_thrx2_pcie_root);
+
++/*
++ * PCI BAR 5 is not setup correctly for the on-board AHCI controller
++ * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
++ * using BAR 4's resources which are populated correctly and NOT
++ * actually used by the AHCI controller.
++ */
++static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
++{
++ struct resource *r = &dev->resource[4];
++
++ if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
++ return;
++
++ /* Set BAR5 resource to BAR4 */
++ dev->resource[5] = *r;
++
++ /* Update BAR5 in pci config space */
++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);
++
++ /* Clear BAR4's resource */
++ memset(r, 0, sizeof(*r));
++}
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);
++
+ /*
+ * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
+ * class code. Fix it.
+--
+2.26.2
+
diff --git a/ACPI-scan-Fix-regression-related-to-X-Gene-UARTs.patch b/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch
index 697d76e13..86cbf5dad 100644
--- a/ACPI-scan-Fix-regression-related-to-X-Gene-UARTs.patch
+++ b/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch
@@ -1,7 +1,17 @@
-From 1e494dc5f3140005ff1f17bc06c0c16d6d50d580 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
-Date: Thu, 19 Apr 2018 23:29:47 -0400
-Subject: [PATCH] ACPI / scan: Fix regression related to X-Gene UARTs
+Date: Thu, 10 May 2018 17:38:44 -0400
+Subject: [PATCH] aarch64: acpi scan: Fix regression related to X-Gene UARTs
+
+Message-id: <20180510173844.29580-4-msalter@redhat.com>
+Patchwork-id: 214381
+O-Subject: [RHEL-8 BZ1519554 3/3] aarch64: acpi scan: Fix regression related to X-Gene UARTs
+Bugzilla: 1519554
+RH-Acked-by: Al Stone <astone@redhat.com>
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519554
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16144520
Commit e361d1f85855 ("ACPI / scan: Fix enumeration for special UART
devices") caused a regression with some X-Gene based platforms (Mustang
@@ -10,30 +20,33 @@ device is also a slave device attached to itself. With the above commit
the UART won't be enumerated by ACPI scan (slave serial devices shouldn't
be). So check for X-Gene UART device and skip slace device check on it.
+Upstream Status: RHEL only
Signed-off-by: Mark Salter <msalter@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
---
- drivers/acpi/scan.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ drivers/acpi/scan.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
-index e1b6231cfa1c..542dafac4306 100644
+index 6d3448895382..221255007dc8 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
-@@ -1567,6 +1567,14 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
+@@ -1563,6 +1563,15 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
if (!acpi_match_device_ids(device, i2c_multi_instantiate_ids))
return false;
-
+
+ /*
+ * Firmware on some arm64 X-Gene platforms will make the UART
+ * device appear as both a UART and a slave of that UART. Just
+ * bail out here for X-Gene UARTs.
+ */
-+ if (!strcmp(acpi_device_hid(device), "APMC0D08"))
++ if (IS_ENABLED(CONFIG_ARM64) &&
++ !strcmp(acpi_device_hid(device), "APMC0D08"))
+ return false;
+
INIT_LIST_HEAD(&resource_list);
acpi_dev_get_resources(device, &resource_list,
acpi_check_serial_bus_slave,
--
-2.17.1
+2.26.2
diff --git a/0001-acpi-prefer-booting-with-ACPI-over-DTS.patch b/0001-acpi-prefer-booting-with-ACPI-over-DTS.patch
new file mode 100644
index 000000000..e188b5a2d
--- /dev/null
+++ b/0001-acpi-prefer-booting-with-ACPI-over-DTS.patch
@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mark Salter <msalter@redhat.com>
+Date: Fri, 11 May 2018 21:01:17 -0400
+Subject: [PATCH] acpi: prefer booting with ACPI over DTS
+
+Message-id: <20180511210117.10457-1-msalter@redhat.com>
+Patchwork-id: 214708
+O-Subject: [RHEL-8 BZ1576869] [RHEL only] acpi: prefer booting with ACPI over DTS
+Bugzilla: 1576869
+RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
+RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+RH-Acked-by: Bhupesh Sharma <bhsharma@redhat.com>
+RH-Acked-by: Dean Nelson <dnelson@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1576869
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16208479
+Testing: Verified kernel defaults to ACPI on Mustang
+
+From: Jonathan Toppins <jtoppins@redhat.com>
+
+ This patch forces ACPI boot tables to be preferred over DTS.
+
+ Currently for ACPI to be used a user either has to set acpi=on on the
+ kernel command line or make sure any device tree passed to the kernel
+ is empty. If the dtb passed to the kernel is non-empty then device-tree
+ will be chosen as the boot method of choice.
+
+ RHEL does not wish to support this boot method so change table boot
+ preferences to use ACPI. In the event ACPI table checks fail the kernel
+ will fallback to using DTS to boot.
+
+ Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Mark Salter <msalter@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ arch/arm64/kernel/acpi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
+index a100483b47c4..29f693734edb 100644
+--- a/arch/arm64/kernel/acpi.c
++++ b/arch/arm64/kernel/acpi.c
+@@ -39,7 +39,7 @@ int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */
+ EXPORT_SYMBOL(acpi_pci_disabled);
+
+ static bool param_acpi_off __initdata;
+-static bool param_acpi_on __initdata;
++static bool param_acpi_on __initdata = true;
+ static bool param_acpi_force __initdata;
+
+ static int __init parse_acpi(char *arg)
+--
+2.26.2
+
diff --git a/0001-acr-Use-kmemdup-instead-of-kmalloc-and-memcpy.patch b/0001-acr-Use-kmemdup-instead-of-kmalloc-and-memcpy.patch
new file mode 100644
index 000000000..9470c4608
--- /dev/null
+++ b/0001-acr-Use-kmemdup-instead-of-kmalloc-and-memcpy.patch
@@ -0,0 +1,55 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zou Wei <zou_wei@huawei.com>
+Date: Tue, 21 Apr 2020 20:37:31 +0800
+Subject: [PATCH] acr: Use kmemdup instead of kmalloc and memcpy
+
+Fixes coccicheck warning:
+
+drivers/gpu/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c:103:23-30: WARNING opportunity for kmemdup
+drivers/gpu/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c:113:22-29: WARNING opportunity for kmemdup
+
+Fixes: 22dcda45a3d1 ("drivers/gpu/drm/nouveau/acr: implement new subdev to replace "secure boot"")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Zou Wei <zou_wei@huawei.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c
+index aecce2dac558..667fa016496e 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/hsfw.c
+@@ -100,25 +100,21 @@ nvkm_acr_hsfw_load_image(struct nvkm_acr *acr, const char *name, int ver,
+ hsfw->data_size = lhdr->data_size;
+
+ hsfw->sig.prod.size = fwhdr->sig_prod_size;
+- hsfw->sig.prod.data = kmalloc(hsfw->sig.prod.size, GFP_KERNEL);
++ hsfw->sig.prod.data = kmemdup(fw->data + fwhdr->sig_prod_offset + sig,
++ hsfw->sig.prod.size, GFP_KERNEL);
+ if (!hsfw->sig.prod.data) {
+ ret = -ENOMEM;
+ goto done;
+ }
+
+- memcpy(hsfw->sig.prod.data, fw->data + fwhdr->sig_prod_offset + sig,
+- hsfw->sig.prod.size);
+-
+ hsfw->sig.dbg.size = fwhdr->sig_dbg_size;
+- hsfw->sig.dbg.data = kmalloc(hsfw->sig.dbg.size, GFP_KERNEL);
++ hsfw->sig.dbg.data = kmemdup(fw->data + fwhdr->sig_dbg_offset + sig,
++ hsfw->sig.dbg.size, GFP_KERNEL);
+ if (!hsfw->sig.dbg.data) {
+ ret = -ENOMEM;
+ goto done;
+ }
+
+- memcpy(hsfw->sig.dbg.data, fw->data + fwhdr->sig_dbg_offset + sig,
+- hsfw->sig.dbg.size);
+-
+ hsfw->sig.patch_loc = loc;
+ done:
+ nvkm_firmware_put(fw);
+--
+2.26.2
+
diff --git a/0001-add-pci_hw_vendor_status.patch b/0001-add-pci_hw_vendor_status.patch
new file mode 100644
index 000000000..ebd330296
--- /dev/null
+++ b/0001-add-pci_hw_vendor_status.patch
@@ -0,0 +1,96 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Maurizio Lombardi <mlombard@redhat.com>
+Date: Mon, 18 Jun 2018 12:51:25 -0400
+Subject: [PATCH] add pci_hw_vendor_status()
+
+Message-id: <1529326285-28560-1-git-send-email-mlombard@redhat.com>
+Patchwork-id: 222337
+O-Subject: [RHEL8 PATCH] pci: add pci_hw_vendor_status()
+Bugzilla: 1590829
+RH-Acked-by: Tomas Henzl <thenzl@redhat.com>
+RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+
+This patch adds pci_hw_vendor_status() like in RHEL7 which should be called
+during the driver's probe to identify deprecated devices.
+
+BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1590829
+Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=16761315
+
+See RHEL7 commits e0dddd9a63403ec82077ed410074fc6485873d4b and
+3fcddde5ddf4b190c84ce9d83d56a75137513bd7
+
+RHEL_only.
+
+Upstream Status: RHEL only
+Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/pci/pci-driver.c | 29 +++++++++++++++++++++++++++++
+ include/linux/pci.h | 4 ++++
+ 2 files changed, 33 insertions(+)
+
+diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
+index 0454ca0e4e3f..5cc490b821be 100644
+--- a/drivers/pci/pci-driver.c
++++ b/drivers/pci/pci-driver.c
+@@ -18,6 +18,7 @@
+ #include <linux/kexec.h>
+ #include <linux/of_device.h>
+ #include <linux/acpi.h>
++#include <linux/kernel.h>
+ #include "pci.h"
+ #include "pcie/portdrv.h"
+
+@@ -278,6 +279,34 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
+ return found_id;
+ }
+
++/**
++ * pci_hw_vendor_status - Tell if a PCI device is supported by the HW vendor
++ * @ids: array of PCI device id structures to search in
++ * @dev: the PCI device structure to match against
++ *
++ * Used by a driver to check whether this device is in its list of unsupported
++ * devices. Returns the matching pci_device_id structure or %NULL if there is
++ * no match.
++ *
++ * Reserved for Internal Red Hat use only.
++ */
++const struct pci_device_id *pci_hw_vendor_status(
++ const struct pci_device_id *ids,
++ struct pci_dev *dev)
++{
++ char devinfo[64];
++ const struct pci_device_id *ret = pci_match_id(ids, dev);
++
++ if (ret) {
++ snprintf(devinfo, sizeof(devinfo), "%s %s",
++ dev_driver_string(&dev->dev), dev_name(&dev->dev));
++ mark_hardware_deprecated(devinfo);
++ }
++
++ return ret;
++}
++EXPORT_SYMBOL(pci_hw_vendor_status);
++
+ struct drv_dev_and_id {
+ struct pci_driver *drv;
+ struct pci_dev *dev;
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index 83ce1cdf5676..88397dd562d9 100644
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1397,6 +1397,10 @@ int pci_add_dynid(struct pci_driver *drv,
+ unsigned long driver_data);
+ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
+ struct pci_dev *dev);
++/* Reserved for Internal Red Hat use only */
++const struct pci_device_id *pci_hw_vendor_status(
++ const struct pci_device_id *ids,
++ struct pci_dev *dev);
+ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
+ int pass);
+
+--
+2.26.2
+
diff --git a/0001-ahci-thunderx2-Fix-for-errata-that-affects-stop-engi.patch b/0001-ahci-thunderx2-Fix-for-errata-that-affects-stop-engi.patch
new file mode 100644
index 000000000..0299e965c
--- /dev/null
+++ b/0001-ahci-thunderx2-Fix-for-errata-that-affects-stop-engi.patch
@@ -0,0 +1,89 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Robert Richter <rrichter@redhat.com>
+Date: Thu, 7 Jun 2018 22:59:33 -0400
+Subject: [PATCH] ahci: thunderx2: Fix for errata that affects stop engine
+
+Message-id: <1528412373-19128-3-git-send-email-rrichter@redhat.com>
+Patchwork-id: 220952
+O-Subject: [RHEL-8.0 BZ 1563590 v2 2/2] ahci: thunderx2: Fix for errata that affects stop engine
+Bugzilla: 1563590
+RH-Acked-by: Dean Nelson <dnelson@redhat.com>
+RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
+RH-Acked-by: Mark Salter <msalter@redhat.com>
+
+From: Jayachandran C <jnair@caviumnetworks.com>
+
+Apply workaround for this errata:
+ Synopsis: Resetting PxCMD.ST may hang the SATA device
+
+ Description: An internal ping-pong buffer state is not reset
+ correctly for an PxCMD.ST=0 command for a SATA channel. This
+ may cause the SATA interface to hang when a PxCMD.ST=0 command
+ is received.
+
+ Workaround: A SATA_BIU_CORE_ENABLE.sw_init_bsi must be asserted
+ by the driver whenever the PxCMD.ST needs to be de-asserted. This
+ will reset both the ports. So, it may not always work in a 2
+ channel SATA system.
+
+ Resolution: Fix in B0.
+
+Add the code to ahci_stop_engine() to do this. It is not easy to
+stop the other "port" since it is associated with a different AHCI
+interface. Please note that with this fix, SATA reset does not
+hang any more, but it can cause failures on the other interface
+if that is in active use.
+
+Unfortunately, we have nothing other the the CPU ID to check if the
+SATA block has this issue.
+
+RHEL-only:
+
+Both patches are in RHEL-7.6 also. Inclusion of the patches into RHEL-8
+was discussed. Since there are partners with Ax system configurations it
+was decided to carry them in RHEL8 too. See:
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=1563590#c1
+
+[v3 with new delays]
+Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Robert Richter <rrichter@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/ata/libahci.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
+index ea5bf5f4cbed..71c55cae27ac 100644
+--- a/drivers/ata/libahci.c
++++ b/drivers/ata/libahci.c
+@@ -666,6 +666,24 @@ int ahci_stop_engine(struct ata_port *ap)
+ tmp &= ~PORT_CMD_START;
+ writel(tmp, port_mmio + PORT_CMD);
+
++#ifdef CONFIG_ARM64
++ /* Rev Ax of Cavium CN99XX needs a hack for port stop */
++ if (dev_is_pci(ap->host->dev) &&
++ to_pci_dev(ap->host->dev)->vendor == 0x14e4 &&
++ to_pci_dev(ap->host->dev)->device == 0x9027 &&
++ midr_is_cpu_model_range(read_cpuid_id(),
++ MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN),
++ MIDR_CPU_VAR_REV(0, 0),
++ MIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) {
++ tmp = readl(hpriv->mmio + 0x8000);
++ udelay(100);
++ writel(tmp | (1 << 26), hpriv->mmio + 0x8000);
++ udelay(100);
++ writel(tmp & ~(1 << 26), hpriv->mmio + 0x8000);
++ dev_warn(ap->host->dev, "CN99XX SATA reset workaround applied\n");
++ }
++#endif
++
+ /* wait for engine to stop. This could be as long as 500 msec */
+ tmp = ata_wait_register(ap, port_mmio + PORT_CMD,
+ PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
+--
+2.26.2
+
diff --git a/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch b/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch
new file mode 100644
index 000000000..286c898cb
--- /dev/null
+++ b/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch
@@ -0,0 +1,38 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Cline <jcline@redhat.com>
+Date: Tue, 1 Oct 2019 15:51:23 +0000
+Subject: [PATCH] arm: aarch64: Drop the EXPERT setting from ARM64_FORCE_52BIT
+
+Message-id: <20191001181256.22935-1-jcline@redhat.com>
+Patchwork-id: 275498
+O-Subject: [ARK INTERNAL PATCH] [ARK INTERNAL PATCH] [redhat] Add patch
+ to drop the EXPERT setting from ARM64_FORCE_52BIT
+Bugzilla:
+RH-Acked-by: Laura Abbott <labbott@redhat.com>
+
+We don't turn on EXPERT as there are few settings we actually want to
+mess with. Remove the dependency for ARM64_FORCE_52BIT as we do want
+that on in debug builds to help find 52-bit bugs.
+
+Upstream Status: RHEL only
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ arch/arm64/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
+index 5d513f461957..7f37a6d0658a 100644
+--- a/arch/arm64/Kconfig
++++ b/arch/arm64/Kconfig
+@@ -858,7 +858,7 @@ endchoice
+
+ config ARM64_FORCE_52BIT
+ bool "Force 52-bit virtual addresses for userspace"
+- depends on ARM64_VA_BITS_52 && EXPERT
++ depends on ARM64_VA_BITS_52
+ help
+ For systems with 52-bit userspace VAs enabled, the kernel will attempt
+ to maintain compatibility with older software by providing 48-bit VAs
+--
+2.26.2
+
diff --git a/arm-make-highpte-not-expert.patch b/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch
index 09630fda1..040f33cb1 100644
--- a/arm-make-highpte-not-expert.patch
+++ b/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch
@@ -1,4 +1,4 @@
-From 19908e5fe3e63ed2d39f0a8a9135f35fd428d766 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jon Masters <jcm@redhat.com>
Date: Thu, 18 Jul 2019 15:47:26 -0400
Subject: [PATCH] arm: make CONFIG_HIGHPTE optional without CONFIG_EXPERT
@@ -11,12 +11,12 @@ Signed-off-by: Jon Masters <jcm@redhat.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 2bf1ce39a96d..e792b3e60095 100644
+index c77c93c485a0..f808c4e0727f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1644,9 +1644,9 @@ config HIGHMEM
+@@ -1543,9 +1543,9 @@ config HIGHMEM
If unsure, say n.
-
+
config HIGHPTE
- bool "Allocate 2nd-level pagetables from highmem" if EXPERT
+ bool "Allocate 2nd-level pagetables from highmem"
@@ -27,5 +27,5 @@ index 2bf1ce39a96d..e792b3e60095 100644
The VM uses one page of physical memory for each page table.
For systems with a lot of processes, this can use a lot of
--
-2.17.2
+2.26.2
diff --git a/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch b/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch
new file mode 100644
index 000000000..e3b07c2bb
--- /dev/null
+++ b/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch
@@ -0,0 +1,81 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Mon, 16 Mar 2020 21:35:03 +0800
+Subject: [PATCH] arm64: allwinner: dts: a64: add LCD-related device nodes for
+ PinePhone
+
+PinePhone uses PWM backlight and a XBD599 LCD panel over DSI for
+display.
+
+Add its device nodes.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+---
+ .../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 +++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+index cefda145c3c9..96d9150423e0 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+@@ -16,6 +16,15 @@ aliases {
+ serial0 = &uart0;
+ };
+
++ backlight: backlight {
++ compatible = "pwm-backlight";
++ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
++ brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
++ default-brightness-level = <15>;
++ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
++ power-supply = <&reg_ldo_io0>;
++ };
++
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+@@ -84,6 +93,30 @@ &dai {
+ status = "okay";
+ };
+
++&de {
++ status = "okay";
++};
++
++&dphy {
++ status = "okay";
++};
++
++&dsi {
++ vcc-dsi-supply = <&reg_dldo1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "okay";
++
++ panel@0 {
++ compatible = "xingbangda,xbd599";
++ reg = <0>;
++ reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
++ iovcc-supply = <&reg_dldo2>;
++ vcc-supply = <&reg_ldo_io0>;
++ backlight = <&backlight>;
++ };
++};
++
+ &ehci0 {
+ status = "okay";
+ };
+@@ -188,6 +221,10 @@ &r_pio {
+ */
+ };
+
++&r_pwm {
++ status = "okay";
++};
++
+ &r_rsb {
+ status = "okay";
+
+--
+2.26.2
+
diff --git a/0001-backlight-lp855x-Ensure-regulators-are-disabled-on-p.patch b/0001-backlight-lp855x-Ensure-regulators-are-disabled-on-p.patch
new file mode 100644
index 000000000..192dbaeec
--- /dev/null
+++ b/0001-backlight-lp855x-Ensure-regulators-are-disabled-on-p.patch
@@ -0,0 +1,118 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jon Hunter <jonathanh@nvidia.com>
+Date: Mon, 24 Feb 2020 14:07:48 +0000
+Subject: [PATCH] backlight: lp855x: Ensure regulators are disabled on probe
+ failure
+
+If probing the LP885x backlight fails after the regulators have been
+enabled, then the following warning is seen when releasing the
+regulators ...
+
+ WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 _regulator_put.part.28+0x158/0x160
+ Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables x_tables ipv6 nf_defrag_ipv6
+ CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1
+ Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
+
+ ...
+
+ Call trace:
+ _regulator_put.part.28+0x158/0x160
+ regulator_put+0x34/0x50
+ devm_regulator_release+0x10/0x18
+ release_nodes+0x12c/0x230
+ devres_release_all+0x34/0x50
+ really_probe+0x1c0/0x370
+ driver_probe_device+0x58/0x100
+ device_driver_attach+0x6c/0x78
+ __driver_attach+0xb0/0xf0
+ bus_for_each_dev+0x68/0xc8
+ driver_attach+0x20/0x28
+ bus_add_driver+0x160/0x1f0
+ driver_register+0x60/0x110
+ i2c_register_driver+0x40/0x80
+ lp855x_driver_init+0x20/0x1000 [lp855x_bl]
+ do_one_initcall+0x58/0x1a0
+ do_init_module+0x54/0x1d0
+ load_module+0x1d80/0x21c8
+ __do_sys_finit_module+0xe8/0x100
+ __arm64_sys_finit_module+0x18/0x20
+ el0_svc_common.constprop.3+0xb0/0x168
+ do_el0_svc+0x20/0x98
+ el0_sync_handler+0xf4/0x1b0
+ el0_sync+0x140/0x180
+
+Fix this by ensuring that the regulators are disabled, if enabled, on
+probe failure.
+
+Finally, ensure that the vddio regulator is disabled in the driver
+remove handler.
+
+Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
+Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
+---
+ drivers/video/backlight/lp855x_bl.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
+index f68920131a4a..e94932c69f54 100644
+--- a/drivers/video/backlight/lp855x_bl.c
++++ b/drivers/video/backlight/lp855x_bl.c
+@@ -456,7 +456,7 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
+ ret = regulator_enable(lp->enable);
+ if (ret < 0) {
+ dev_err(lp->dev, "failed to enable vddio: %d\n", ret);
+- return ret;
++ goto disable_supply;
+ }
+
+ /*
+@@ -471,24 +471,34 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
+ ret = lp855x_configure(lp);
+ if (ret) {
+ dev_err(lp->dev, "device config err: %d", ret);
+- return ret;
++ goto disable_vddio;
+ }
+
+ ret = lp855x_backlight_register(lp);
+ if (ret) {
+ dev_err(lp->dev,
+ "failed to register backlight. err: %d\n", ret);
+- return ret;
++ goto disable_vddio;
+ }
+
+ ret = sysfs_create_group(&lp->dev->kobj, &lp855x_attr_group);
+ if (ret) {
+ dev_err(lp->dev, "failed to register sysfs. err: %d\n", ret);
+- return ret;
++ goto disable_vddio;
+ }
+
+ backlight_update_status(lp->bl);
++
+ return 0;
++
++disable_vddio:
++ if (lp->enable)
++ regulator_disable(lp->enable);
++disable_supply:
++ if (lp->supply)
++ regulator_disable(lp->supply);
++
++ return ret;
+ }
+
+ static int lp855x_remove(struct i2c_client *cl)
+@@ -497,6 +507,8 @@ static int lp855x_remove(struct i2c_client *cl)
+
+ lp->bl->props.brightness = 0;
+ backlight_update_status(lp->bl);
++ if (lp->enable)
++ regulator_disable(lp->enable);
+ if (lp->supply)
+ regulator_disable(lp->supply);
+ sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group);
+--
+2.26.2
+
diff --git a/0001-core-memory-remove-redundant-assignments-to-variable.patch b/0001-core-memory-remove-redundant-assignments-to-variable.patch
new file mode 100644
index 000000000..d490d68d2
--- /dev/null
+++ b/0001-core-memory-remove-redundant-assignments-to-variable.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Sat, 29 Feb 2020 00:53:07 +0000
+Subject: [PATCH] core/memory: remove redundant assignments to variable ret
+
+The variable ret is being initialized with a value that is never
+read and it is being updated later with a new value. The initialization
+is redundant and can be removed.
+
+Addresses-Coverity: ("Unused value")
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/core/memory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/core/memory.c b/drivers/gpu/drm/nouveau/nvkm/core/memory.c
+index 4cc186262d34..38130ef272d6 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/core/memory.c
++++ b/drivers/gpu/drm/nouveau/nvkm/core/memory.c
+@@ -140,7 +140,7 @@ nvkm_memory_new(struct nvkm_device *device, enum nvkm_memory_target target,
+ {
+ struct nvkm_instmem *imem = device->imem;
+ struct nvkm_memory *memory;
+- int ret = -ENOSYS;
++ int ret;
+
+ if (unlikely(target != NVKM_MEM_TARGET_INST || !imem))
+ return -ENOSYS;
+--
+2.26.2
+
diff --git a/0001-device-detect-if-changing-endianness-failed.patch b/0001-device-detect-if-changing-endianness-failed.patch
new file mode 100644
index 000000000..1089b7e87
--- /dev/null
+++ b/0001-device-detect-if-changing-endianness-failed.patch
@@ -0,0 +1,62 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Tue, 28 Apr 2020 18:54:03 +0200
+Subject: [PATCH] device: detect if changing endianness failed
+
+v2: relax the checks a little
+
+Signed-off-by: Karol Herbst <kherbst@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ .../gpu/drm/nouveau/nvkm/engine/device/base.c | 26 +++++++++++++++----
+ 1 file changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+index 37589f36546d..c732074bf790 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+@@ -2924,6 +2924,20 @@ nvkm_device_del(struct nvkm_device **pdevice)
+ }
+ }
+
++static inline bool
++nvkm_device_endianness(void __iomem *pri)
++{
++ u32 boot1 = ioread32_native(pri + 0x000004) & 0x01000001;
++#ifdef __BIG_ENDIAN
++ if (!boot1)
++ return false;
++#else
++ if (boot1)
++ return false;
++#endif
++ return true;
++}
++
+ int
+ nvkm_device_ctor(const struct nvkm_device_func *func,
+ const struct nvkm_device_quirk *quirk,
+@@ -2973,13 +2987,15 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ /* identify the chipset, and determine classes of subdev/engines */
+ if (detect) {
+ /* switch mmio to cpu's native endianness */
+-#ifndef __BIG_ENDIAN
+- if (ioread32_native(map + 0x000004) != 0x00000000) {
+-#else
+- if (ioread32_native(map + 0x000004) == 0x00000000) {
+-#endif
++ if (!nvkm_device_endianness(map)) {
+ iowrite32_native(0x01000001, map + 0x000004);
+ ioread32_native(map);
++ if (!nvkm_device_endianness(map)) {
++ nvdev_error(device,
++ "GPU not supported on big-endian\n");
++ ret = -ENOSYS;
++ goto done;
++ }
+ }
+
+ /* read boot0 and strapping information */
+--
+2.26.2
+
diff --git a/0001-device-detect-vGPUs.patch b/0001-device-detect-vGPUs.patch
new file mode 100644
index 000000000..08f591ff7
--- /dev/null
+++ b/0001-device-detect-vGPUs.patch
@@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Tue, 28 Apr 2020 18:54:04 +0200
+Subject: [PATCH] device: detect vGPUs
+
+Using ENODEV as this prevents probe failed errors in dmesg.
+
+v2: move check further down
+
+Signed-off-by: Karol Herbst <kherbst@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+index c732074bf790..f977dddcd809 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+@@ -2948,7 +2948,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ {
+ struct nvkm_subdev *subdev;
+ u64 mmio_base, mmio_size;
+- u32 boot0, strap;
++ u32 boot0, boot1, strap;
+ void __iomem *map = NULL;
+ int ret = -EEXIST, i;
+ unsigned chipset;
+@@ -2998,9 +2998,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ }
+ }
+
+- /* read boot0 and strapping information */
+ boot0 = ioread32_native(map + 0x000000);
+- strap = ioread32_native(map + 0x101000);
+
+ /* chipset can be overridden for devel/testing purposes */
+ chipset = nvkm_longopt(device->cfgopt, "NvChipset", 0);
+@@ -3158,6 +3156,17 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ nvdev_info(device, "NVIDIA %s (%08x)\n",
+ device->chip->name, boot0);
+
++ /* vGPU detection */
++ boot1 = ioread32_native(map + 0x000004);
++ if (device->card_type >= TU100 && (boot1 & 0x00030000)) {
++ nvdev_info(device, "vGPUs are not supported\n");
++ ret = -ENODEV;
++ goto done;
++ }
++
++ /* read strapping information */
++ strap = ioread32_native(map + 0x101000);
++
+ /* determine frequency of timing crystal */
+ if ( device->card_type <= NV_10 || device->chipset < 0x17 ||
+ (device->chipset >= 0x20 && device->chipset < 0x25))
+--
+2.26.2
+
diff --git a/0001-device-rework-mmio-mapping-code-to-get-rid-of-second.patch b/0001-device-rework-mmio-mapping-code-to-get-rid-of-second.patch
new file mode 100644
index 000000000..bde820ba5
--- /dev/null
+++ b/0001-device-rework-mmio-mapping-code-to-get-rid-of-second.patch
@@ -0,0 +1,84 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Tue, 28 Apr 2020 18:54:02 +0200
+Subject: [PATCH] device: rework mmio mapping code to get rid of second map
+
+Fixes warnings on GPUs with smaller a smaller mmio region like vGPUs.
+
+Signed-off-by: Karol Herbst <kherbst@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ .../gpu/drm/nouveau/nvkm/engine/device/base.c | 27 ++++++++++---------
+ 1 file changed, 15 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+index 8ebbe1656008..37589f36546d 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+@@ -2935,7 +2935,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ struct nvkm_subdev *subdev;
+ u64 mmio_base, mmio_size;
+ u32 boot0, strap;
+- void __iomem *map;
++ void __iomem *map = NULL;
+ int ret = -EEXIST, i;
+ unsigned chipset;
+
+@@ -2961,12 +2961,17 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ mmio_base = device->func->resource_addr(device, 0);
+ mmio_size = device->func->resource_size(device, 0);
+
+- /* identify the chipset, and determine classes of subdev/engines */
+- if (detect) {
+- map = ioremap(mmio_base, 0x102000);
+- if (ret = -ENOMEM, map == NULL)
++ if (detect || mmio) {
++ map = ioremap(mmio_base, mmio_size);
++ if (map == NULL) {
++ nvdev_error(device, "unable to map PRI\n");
++ ret = -ENOMEM;
+ goto done;
++ }
++ }
+
++ /* identify the chipset, and determine classes of subdev/engines */
++ if (detect) {
+ /* switch mmio to cpu's native endianness */
+ #ifndef __BIG_ENDIAN
+ if (ioread32_native(map + 0x000004) != 0x00000000) {
+@@ -2980,7 +2985,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ /* read boot0 and strapping information */
+ boot0 = ioread32_native(map + 0x000000);
+ strap = ioread32_native(map + 0x101000);
+- iounmap(map);
+
+ /* chipset can be overridden for devel/testing purposes */
+ chipset = nvkm_longopt(device->cfgopt, "NvChipset", 0);
+@@ -3159,12 +3163,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ device->name = device->chip->name;
+
+ if (mmio) {
+- device->pri = ioremap(mmio_base, mmio_size);
+- if (!device->pri) {
+- nvdev_error(device, "unable to map PRI\n");
+- ret = -ENOMEM;
+- goto done;
+- }
++ device->pri = map;
+ }
+
+ mutex_init(&device->mutex);
+@@ -3254,6 +3253,10 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+
+ ret = 0;
+ done:
++ if (map && (!mmio || ret)) {
++ device->pri = NULL;
++ iounmap(map);
++ }
+ mutex_unlock(&nv_devices_mutex);
+ return ret;
+ }
+--
+2.26.2
+
diff --git a/0001-device-use-regular-PRI-accessors-in-chipset-detectio.patch b/0001-device-use-regular-PRI-accessors-in-chipset-detectio.patch
new file mode 100644
index 000000000..ec4345169
--- /dev/null
+++ b/0001-device-use-regular-PRI-accessors-in-chipset-detectio.patch
@@ -0,0 +1,113 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Thu, 30 Apr 2020 14:08:53 +1000
+Subject: [PATCH] device: use regular PRI accessors in chipset detection
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ .../gpu/drm/nouveau/nvkm/engine/device/base.c | 31 ++++++++-----------
+ 1 file changed, 13 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+index f977dddcd809..5b90c2a1bf3d 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+@@ -2925,9 +2925,9 @@ nvkm_device_del(struct nvkm_device **pdevice)
+ }
+
+ static inline bool
+-nvkm_device_endianness(void __iomem *pri)
++nvkm_device_endianness(struct nvkm_device *device)
+ {
+- u32 boot1 = ioread32_native(pri + 0x000004) & 0x01000001;
++ u32 boot1 = nvkm_rd32(device, 0x000004) & 0x01000001;
+ #ifdef __BIG_ENDIAN
+ if (!boot1)
+ return false;
+@@ -2949,7 +2949,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ struct nvkm_subdev *subdev;
+ u64 mmio_base, mmio_size;
+ u32 boot0, boot1, strap;
+- void __iomem *map = NULL;
+ int ret = -EEXIST, i;
+ unsigned chipset;
+
+@@ -2976,8 +2975,8 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ mmio_size = device->func->resource_size(device, 0);
+
+ if (detect || mmio) {
+- map = ioremap(mmio_base, mmio_size);
+- if (map == NULL) {
++ device->pri = ioremap(mmio_base, mmio_size);
++ if (device->pri == NULL) {
+ nvdev_error(device, "unable to map PRI\n");
+ ret = -ENOMEM;
+ goto done;
+@@ -2987,10 +2986,10 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ /* identify the chipset, and determine classes of subdev/engines */
+ if (detect) {
+ /* switch mmio to cpu's native endianness */
+- if (!nvkm_device_endianness(map)) {
+- iowrite32_native(0x01000001, map + 0x000004);
+- ioread32_native(map);
+- if (!nvkm_device_endianness(map)) {
++ if (!nvkm_device_endianness(device)) {
++ nvkm_wr32(device, 0x000004, 0x01000001);
++ nvkm_rd32(device, 0x000000);
++ if (!nvkm_device_endianness(device)) {
+ nvdev_error(device,
+ "GPU not supported on big-endian\n");
+ ret = -ENOSYS;
+@@ -2998,7 +2997,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ }
+ }
+
+- boot0 = ioread32_native(map + 0x000000);
++ boot0 = nvkm_rd32(device, 0x000000);
+
+ /* chipset can be overridden for devel/testing purposes */
+ chipset = nvkm_longopt(device->cfgopt, "NvChipset", 0);
+@@ -3157,7 +3156,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ device->chip->name, boot0);
+
+ /* vGPU detection */
+- boot1 = ioread32_native(map + 0x000004);
++ boot1 = nvkm_rd32(device, 0x0000004);
+ if (device->card_type >= TU100 && (boot1 & 0x00030000)) {
+ nvdev_info(device, "vGPUs are not supported\n");
+ ret = -ENODEV;
+@@ -3165,7 +3164,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ }
+
+ /* read strapping information */
+- strap = ioread32_native(map + 0x101000);
++ strap = nvkm_rd32(device, 0x101000);
+
+ /* determine frequency of timing crystal */
+ if ( device->card_type <= NV_10 || device->chipset < 0x17 ||
+@@ -3187,10 +3186,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+ if (!device->name)
+ device->name = device->chip->name;
+
+- if (mmio) {
+- device->pri = map;
+- }
+-
+ mutex_init(&device->mutex);
+
+ for (i = 0; i < NVKM_SUBDEV_NR; i++) {
+@@ -3278,9 +3273,9 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
+
+ ret = 0;
+ done:
+- if (map && (!mmio || ret)) {
++ if (device->pri && (!mmio || ret)) {
++ iounmap(device->pri);
+ device->pri = NULL;
+- iounmap(map);
+ }
+ mutex_unlock(&nv_devices_mutex);
+ return ret;
+--
+2.26.2
+
diff --git a/0001-disp-gv100-expose-capabilities-class.patch b/0001-disp-gv100-expose-capabilities-class.patch
new file mode 100644
index 000000000..60293792f
--- /dev/null
+++ b/0001-disp-gv100-expose-capabilities-class.patch
@@ -0,0 +1,149 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Thu, 13 Feb 2020 09:39:34 +1000
+Subject: [PATCH] disp/gv100-: expose capabilities class
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/include/nvif/class.h | 2 +
+ .../gpu/drm/nouveau/nvkm/engine/disp/Kbuild | 2 +
+ .../drm/nouveau/nvkm/engine/disp/capsgv100.c | 60 +++++++++++++++++++
+ .../drm/nouveau/nvkm/engine/disp/rootgv100.c | 1 +
+ .../drm/nouveau/nvkm/engine/disp/rootnv50.h | 3 +
+ .../drm/nouveau/nvkm/engine/disp/roottu102.c | 1 +
+ 6 files changed, 69 insertions(+)
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/engine/disp/capsgv100.c
+
+diff --git a/drivers/gpu/drm/nouveau/include/nvif/class.h b/drivers/gpu/drm/nouveau/include/nvif/class.h
+index 30659747ffe8..2c79beb41126 100644
+--- a/drivers/gpu/drm/nouveau/include/nvif/class.h
++++ b/drivers/gpu/drm/nouveau/include/nvif/class.h
+@@ -89,6 +89,8 @@
+ #define GV100_DISP /* cl5070.h */ 0x0000c370
+ #define TU102_DISP /* cl5070.h */ 0x0000c570
+
++#define GV100_DISP_CAPS 0x0000c373
++
+ #define NV31_MPEG 0x00003174
+ #define G82_MPEG 0x00008274
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
+index 0d584d0da59c..f7af648e0c17 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
+@@ -74,6 +74,8 @@ nvkm-y += nvkm/engine/disp/rootgp102.o
+ nvkm-y += nvkm/engine/disp/rootgv100.o
+ nvkm-y += nvkm/engine/disp/roottu102.o
+
++nvkm-y += nvkm/engine/disp/capsgv100.o
++
+ nvkm-y += nvkm/engine/disp/channv50.o
+ nvkm-y += nvkm/engine/disp/changf119.o
+ nvkm-y += nvkm/engine/disp/changv100.o
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/capsgv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/capsgv100.c
+new file mode 100644
+index 000000000000..5026e530f4bb
+--- /dev/null
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/capsgv100.c
+@@ -0,0 +1,60 @@
++/*
++ * Copyright 2020 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ */
++#define gv100_disp_caps(p) container_of((p), struct gv100_disp_caps, object)
++#include "rootnv50.h"
++
++struct gv100_disp_caps {
++ struct nvkm_object object;
++ struct nv50_disp *disp;
++};
++
++static int
++gv100_disp_caps_map(struct nvkm_object *object, void *argv, u32 argc,
++ enum nvkm_object_map *type, u64 *addr, u64 *size)
++{
++ struct gv100_disp_caps *caps = gv100_disp_caps(object);
++ struct nvkm_device *device = caps->disp->base.engine.subdev.device;
++ *type = NVKM_OBJECT_MAP_IO;
++ *addr = 0x640000 + device->func->resource_addr(device, 0);
++ *size = 0x1000;
++ return 0;
++}
++
++static const struct nvkm_object_func
++gv100_disp_caps = {
++ .map = gv100_disp_caps_map,
++};
++
++int
++gv100_disp_caps_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
++ struct nv50_disp *disp, struct nvkm_object **pobject)
++{
++ struct gv100_disp_caps *caps;
++
++ if (!(caps = kzalloc(sizeof(*caps), GFP_KERNEL)))
++ return -ENOMEM;
++ *pobject = &caps->object;
++
++ nvkm_object_ctor(&gv100_disp_caps, oclass, &caps->object);
++ caps->disp = disp;
++ return 0;
++}
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c
+index 9c658d632d37..47efb48d769a 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c
+@@ -27,6 +27,7 @@
+ static const struct nv50_disp_root_func
+ gv100_disp_root = {
+ .user = {
++ {{-1,-1,GV100_DISP_CAPS }, gv100_disp_caps_new },
+ {{0,0,GV100_DISP_CURSOR }, gv100_disp_curs_new },
+ {{0,0,GV100_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
+ {{0,0,GV100_DISP_CORE_CHANNEL_DMA }, gv100_disp_core_new },
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
+index a1f942793f98..7070f5408d92 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
+@@ -24,6 +24,9 @@ int nv50_disp_root_new_(const struct nv50_disp_root_func *, struct nvkm_disp *,
+ const struct nvkm_oclass *, void *data, u32 size,
+ struct nvkm_object **);
+
++int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32,
++ struct nv50_disp *, struct nvkm_object **);
++
+ extern const struct nvkm_disp_oclass nv50_disp_root_oclass;
+ extern const struct nvkm_disp_oclass g84_disp_root_oclass;
+ extern const struct nvkm_disp_oclass g94_disp_root_oclass;
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c
+index 579a5d02308a..d8719d38b98a 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c
+@@ -27,6 +27,7 @@
+ static const struct nv50_disp_root_func
+ tu102_disp_root = {
+ .user = {
++ {{-1,-1,GV100_DISP_CAPS }, gv100_disp_caps_new },
+ {{0,0,TU102_DISP_CURSOR }, gv100_disp_curs_new },
+ {{0,0,TU102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
+ {{0,0,TU102_DISP_CORE_CHANNEL_DMA }, gv100_disp_core_new },
+--
+2.26.2
+
diff --git a/0001-disp-hda-gf119-add-HAL-for-programming-device-entry-.patch b/0001-disp-hda-gf119-add-HAL-for-programming-device-entry-.patch
new file mode 100644
index 000000000..cba6699dc
--- /dev/null
+++ b/0001-disp-hda-gf119-add-HAL-for-programming-device-entry-.patch
@@ -0,0 +1,146 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 6 May 2020 14:40:56 +1000
+Subject: [PATCH] disp/hda/gf119-: add HAL for programming device entry in SF
+
+Register has moved on GV100.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c | 11 +++++++++--
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h | 2 ++
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c | 1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c | 1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c | 1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c | 1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c | 1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c | 1 +
+ 8 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+index 1080ba6ecd64..8a0ec7db5145 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+@@ -23,6 +23,14 @@
+ */
+ #include "ior.h"
+
++void
++gf119_hda_device_entry(struct nvkm_ior *ior, int head)
++{
++ struct nvkm_device *device = ior->disp->engine.subdev.device;
++ const u32 hoff = 0x800 * head;
++ nvkm_mask(device, 0x616548 + hoff, 0x00000070, 0x00000000);
++}
++
+ void
+ gf119_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
+ {
+@@ -41,11 +49,10 @@ void
+ gf119_hda_hpd(struct nvkm_ior *ior, int head, bool present)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
+- const u32 hoff = 0x800 * head;
+ u32 data = 0x80000000;
+ u32 mask = 0x80000001;
+ if (present) {
+- nvkm_mask(device, 0x616548 + hoff, 0x00000070, 0x00000000);
++ ior->func->hda.device_entry(ior, head);
+ data |= 0x00000001;
+ } else {
+ mask |= 0x00000002;
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+index c60acf71831e..eb1155e47ecd 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+@@ -88,6 +88,7 @@ struct nvkm_ior_func {
+ struct {
+ void (*hpd)(struct nvkm_ior *, int head, bool present);
+ void (*eld)(struct nvkm_ior *, int head, u8 *data, u8 size);
++ void (*device_entry)(struct nvkm_ior *, int head);
+ } hda;
+ };
+
+@@ -162,6 +163,7 @@ void gt215_hda_eld(struct nvkm_ior *, int, u8 *, u8);
+
+ void gf119_hda_hpd(struct nvkm_ior *, int, bool);
+ void gf119_hda_eld(struct nvkm_ior *, int, u8 *, u8);
++void gf119_hda_device_entry(struct nvkm_ior *, int);
+
+ #define IOR_MSG(i,l,f,a...) do { \
+ struct nvkm_ior *_ior = (i); \
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
+index 456a5a143522..3b3643fb1019 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
+@@ -177,6 +177,7 @@ gf119_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c
+index b94090edaebf..0c0925680790 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c
+@@ -43,6 +43,7 @@ gk104_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c
+index e6965dec09c9..38045c92197f 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c
+@@ -57,6 +57,7 @@ gm107_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c
+index 384f82652bec..cf2075db742a 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c
+@@ -115,6 +115,7 @@ gm200_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
+index b0597ff9a714..565cfbc65550 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
+@@ -103,6 +103,7 @@ gv100_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
+index 4d5f3791ea7b..b16ecea098c7 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
+@@ -88,6 +88,7 @@ tu102_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
++ .device_entry = gf119_hda_device_entry,
+ },
+ };
+
+--
+2.26.2
+
diff --git a/0001-disp-hda-gf119-select-HDA-device-entry-based-on-boun.patch b/0001-disp-hda-gf119-select-HDA-device-entry-based-on-boun.patch
new file mode 100644
index 000000000..714d1a0f3
--- /dev/null
+++ b/0001-disp-hda-gf119-select-HDA-device-entry-based-on-boun.patch
@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 6 May 2020 14:40:58 +1000
+Subject: [PATCH] disp/hda/gf119-: select HDA device entry based on bound head
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+index 8a0ec7db5145..19d2d58344e4 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+@@ -28,14 +28,14 @@ gf119_hda_device_entry(struct nvkm_ior *ior, int head)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
+ const u32 hoff = 0x800 * head;
+- nvkm_mask(device, 0x616548 + hoff, 0x00000070, 0x00000000);
++ nvkm_mask(device, 0x616548 + hoff, 0x00000070, head << 4);
+ }
+
+ void
+ gf119_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
+- const u32 soff = 0x030 * ior->id;
++ const u32 soff = 0x030 * ior->id + (head * 0x04);
+ int i;
+
+ for (i = 0; i < size; i++)
+@@ -49,6 +49,7 @@ void
+ gf119_hda_hpd(struct nvkm_ior *ior, int head, bool present)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
++ const u32 soff = 0x030 * ior->id + (head * 0x04);
+ u32 data = 0x80000000;
+ u32 mask = 0x80000001;
+ if (present) {
+@@ -57,5 +58,5 @@ gf119_hda_hpd(struct nvkm_ior *ior, int head, bool present)
+ } else {
+ mask |= 0x00000002;
+ }
+- nvkm_mask(device, 0x10ec10 + ior->id * 0x030, mask, data);
++ nvkm_mask(device, 0x10ec10 + soff, mask, data);
+ }
+--
+2.26.2
+
diff --git a/0001-disp-hda-gt215-pass-head-to-nvkm_ior.hda.eld.patch b/0001-disp-hda-gt215-pass-head-to-nvkm_ior.hda.eld.patch
new file mode 100644
index 000000000..0011e60ae
--- /dev/null
+++ b/0001-disp-hda-gt215-pass-head-to-nvkm_ior.hda.eld.patch
@@ -0,0 +1,83 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 6 May 2020 14:40:52 +1000
+Subject: [PATCH] disp/hda/gt215-: pass head to nvkm_ior.hda.eld()
+
+We're going to use the bound head to select HDA device entry.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c | 2 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c | 2 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h | 6 +++---
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 2 +-
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+index 0fa0ec0a1de0..1080ba6ecd64 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
+@@ -24,7 +24,7 @@
+ #include "ior.h"
+
+ void
+-gf119_hda_eld(struct nvkm_ior *ior, u8 *data, u8 size)
++gf119_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
+ const u32 soff = 0x030 * ior->id;
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
+index 4509d2ba880e..0d1b81fe1093 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
+@@ -24,7 +24,7 @@
+ #include "ior.h"
+
+ void
+-gt215_hda_eld(struct nvkm_ior *ior, u8 *data, u8 size)
++gt215_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
+ {
+ struct nvkm_device *device = ior->disp->engine.subdev.device;
+ const u32 soff = ior->id * 0x800;
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+index 009d3a8b7a50..c60acf71831e 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+@@ -87,7 +87,7 @@ struct nvkm_ior_func {
+
+ struct {
+ void (*hpd)(struct nvkm_ior *, int head, bool present);
+- void (*eld)(struct nvkm_ior *, u8 *data, u8 size);
++ void (*eld)(struct nvkm_ior *, int head, u8 *data, u8 size);
+ } hda;
+ };
+
+@@ -158,10 +158,10 @@ void gv100_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
+ void gm200_hdmi_scdc(struct nvkm_ior *, int, u8);
+
+ void gt215_hda_hpd(struct nvkm_ior *, int, bool);
+-void gt215_hda_eld(struct nvkm_ior *, u8 *, u8);
++void gt215_hda_eld(struct nvkm_ior *, int, u8 *, u8);
+
+ void gf119_hda_hpd(struct nvkm_ior *, int, bool);
+-void gf119_hda_eld(struct nvkm_ior *, u8 *, u8);
++void gf119_hda_eld(struct nvkm_ior *, int, u8 *, u8);
+
+ #define IOR_MSG(i,l,f,a...) do { \
+ struct nvkm_ior *_ior = (i); \
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
+index 5f758948d6e1..a7672ef17d3b 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
+@@ -155,7 +155,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
+ if (outp->info.type == DCB_OUTPUT_DP)
+ ior->func->dp.audio(ior, hidx, true);
+ ior->func->hda.hpd(ior, hidx, true);
+- ior->func->hda.eld(ior, data, size);
++ ior->func->hda.eld(ior, hidx, data, size);
+ } else {
+ if (outp->info.type == DCB_OUTPUT_DP)
+ ior->func->dp.audio(ior, hidx, false);
+--
+2.26.2
+
diff --git a/0001-disp-hda-gv100-NV_PDISP_SF_AUDIO_CNTRL0-register-mov.patch b/0001-disp-hda-gv100-NV_PDISP_SF_AUDIO_CNTRL0-register-mov.patch
new file mode 100644
index 000000000..b93c9f13b
--- /dev/null
+++ b/0001-disp-hda-gv100-NV_PDISP_SF_AUDIO_CNTRL0-register-mov.patch
@@ -0,0 +1,105 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 6 May 2020 14:41:01 +1000
+Subject: [PATCH] disp/hda/gv100-: NV_PDISP_SF_AUDIO_CNTRL0 register moved
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ .../gpu/drm/nouveau/nvkm/engine/disp/Kbuild | 1 +
+ .../drm/nouveau/nvkm/engine/disp/hdagv100.c | 30 +++++++++++++++++++
+ .../gpu/drm/nouveau/nvkm/engine/disp/ior.h | 2 ++
+ .../drm/nouveau/nvkm/engine/disp/sorgv100.c | 2 +-
+ .../drm/nouveau/nvkm/engine/disp/sortu102.c | 2 +-
+ 5 files changed, 35 insertions(+), 2 deletions(-)
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagv100.c
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
+index f7af648e0c17..571687ba85b8 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
+@@ -47,6 +47,7 @@ nvkm-y += nvkm/engine/disp/dp.o
+
+ nvkm-y += nvkm/engine/disp/hdagt215.o
+ nvkm-y += nvkm/engine/disp/hdagf119.o
++nvkm-y += nvkm/engine/disp/hdagv100.o
+
+ nvkm-y += nvkm/engine/disp/hdmi.o
+ nvkm-y += nvkm/engine/disp/hdmig84.o
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagv100.c
+new file mode 100644
+index 000000000000..57d374ecfeef
+--- /dev/null
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagv100.c
+@@ -0,0 +1,30 @@
++/*
++ * Copyright 2020 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ */
++#include "ior.h"
++
++void
++gv100_hda_device_entry(struct nvkm_ior *ior, int head)
++{
++ struct nvkm_device *device = ior->disp->engine.subdev.device;
++ const u32 hoff = 0x800 * head;
++ nvkm_mask(device, 0x616528 + hoff, 0x00000070, head << 4);
++}
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+index eb1155e47ecd..c1d7a36e4d3c 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+@@ -165,6 +165,8 @@ void gf119_hda_hpd(struct nvkm_ior *, int, bool);
+ void gf119_hda_eld(struct nvkm_ior *, int, u8 *, u8);
+ void gf119_hda_device_entry(struct nvkm_ior *, int);
+
++void gv100_hda_device_entry(struct nvkm_ior *, int);
++
+ #define IOR_MSG(i,l,f,a...) do { \
+ struct nvkm_ior *_ior = (i); \
+ nvkm_##l(&_ior->disp->engine.subdev, "%s: "f"\n", _ior->name, ##a); \
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
+index 565cfbc65550..d11a0dff10c6 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
+@@ -103,7 +103,7 @@ gv100_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
+- .device_entry = gf119_hda_device_entry,
++ .device_entry = gv100_hda_device_entry,
+ },
+ };
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
+index b16ecea098c7..fa6d74251237 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
+@@ -88,7 +88,7 @@ tu102_sor = {
+ .hda = {
+ .hpd = gf119_hda_hpd,
+ .eld = gf119_hda_eld,
+- .device_entry = gf119_hda_device_entry,
++ .device_entry = gv100_hda_device_entry,
+ },
+ };
+
+--
+2.26.2
+
diff --git a/0001-disp-nv50-increase-timeout-on-pio-channel-free-polli.patch b/0001-disp-nv50-increase-timeout-on-pio-channel-free-polli.patch
new file mode 100644
index 000000000..d8c1a93d5
--- /dev/null
+++ b/0001-disp-nv50-increase-timeout-on-pio-channel-free-polli.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 6 May 2020 14:40:45 +1000
+Subject: [PATCH] disp/nv50-: increase timeout on pio channel free() polling
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
+index 8c5cf096f69b..658a200ab616 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
+@@ -32,7 +32,7 @@
+ bool
+ curs507a_space(struct nv50_wndw *wndw)
+ {
+- nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 2,
++ nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 100,
+ if (nvif_rd32(&wndw->wimm.base.user, 0x0008) >= 4)
+ return true;
+ );
+--
+2.26.2
+
diff --git a/0001-drm-Use-generic-helper-to-check-_PR3-presence.patch b/0001-drm-Use-generic-helper-to-check-_PR3-presence.patch
new file mode 100644
index 000000000..f0f9e0dfd
--- /dev/null
+++ b/0001-drm-Use-generic-helper-to-check-_PR3-presence.patch
@@ -0,0 +1,96 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Date: Thu, 23 Apr 2020 14:23:58 +0800
+Subject: [PATCH] drm: Use generic helper to check _PR3 presence
+
+Replace nouveau_pr3_present() in favor of a more generic one,
+pci_pr3_present().
+
+Also the presence of upstream bridge _PR3 doesn't need to go hand in
+hand with device's _DSM, so check _PR3 before _DSM.
+
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nouveau_acpi.c | 44 ++++++--------------------
+ 1 file changed, 10 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
+index fe3a10255c36..b84dff1b0f28 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
++++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
+@@ -212,37 +212,6 @@ static const struct vga_switcheroo_handler nouveau_dsm_handler = {
+ .get_client_id = nouveau_dsm_get_client_id,
+ };
+
+-/*
+- * Firmware supporting Windows 8 or later do not use _DSM to put the device into
+- * D3cold, they instead rely on disabling power resources on the parent.
+- */
+-static bool nouveau_pr3_present(struct pci_dev *pdev)
+-{
+- struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
+- struct acpi_device *parent_adev;
+-
+- if (!parent_pdev)
+- return false;
+-
+- if (!parent_pdev->bridge_d3) {
+- /*
+- * Parent PCI bridge is currently not power managed.
+- * Since userspace can change these afterwards to be on
+- * the safe side we stick with _DSM and prevent usage of
+- * _PR3 from the bridge.
+- */
+- pci_d3cold_disable(pdev);
+- return false;
+- }
+-
+- parent_adev = ACPI_COMPANION(&parent_pdev->dev);
+- if (!parent_adev)
+- return false;
+-
+- return parent_adev->power.flags.power_resources &&
+- acpi_has_method(parent_adev->handle, "_PR3");
+-}
+-
+ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out,
+ bool *has_mux, bool *has_opt,
+ bool *has_opt_flags, bool *has_pr3)
+@@ -250,6 +219,16 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
+ acpi_handle dhandle;
+ bool supports_mux;
+ int optimus_funcs;
++ struct pci_dev *parent_pdev;
++
++ *has_pr3 = false;
++ parent_pdev = pci_upstream_bridge(pdev);
++ if (parent_pdev) {
++ if (parent_pdev->bridge_d3)
++ *has_pr3 = pci_pr3_present(parent_pdev);
++ else
++ pci_d3cold_disable(pdev);
++ }
+
+ dhandle = ACPI_HANDLE(&pdev->dev);
+ if (!dhandle)
+@@ -270,7 +249,6 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
+ *has_mux = supports_mux;
+ *has_opt = !!optimus_funcs;
+ *has_opt_flags = optimus_funcs & (1 << NOUVEAU_DSM_OPTIMUS_FLAGS);
+- *has_pr3 = false;
+
+ if (optimus_funcs) {
+ uint32_t result;
+@@ -280,8 +258,6 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
+ (result & OPTIMUS_ENABLED) ? "enabled" : "disabled",
+ (result & OPTIMUS_DYNAMIC_PWR_CAP) ? "dynamic power, " : "",
+ (result & OPTIMUS_HDA_CODEC_MASK) ? "hda bios codec supported" : "");
+-
+- *has_pr3 = nouveau_pr3_present(pdev);
+ }
+ }
+
+--
+2.26.2
+
diff --git a/0001-drm-panel-add-Xingbangda-XBD599-panel.patch b/0001-drm-panel-add-Xingbangda-XBD599-panel.patch
new file mode 100644
index 000000000..ae0850b8a
--- /dev/null
+++ b/0001-drm-panel-add-Xingbangda-XBD599-panel.patch
@@ -0,0 +1,423 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Mon, 16 Mar 2020 21:35:01 +0800
+Subject: [PATCH] drm: panel: add Xingbangda XBD599 panel
+
+Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI IPS LCD panel made by
+Xingbangda, which is used on PinePhone final assembled phones.
+
+Add support for it.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+---
+ drivers/gpu/drm/panel/Kconfig | 9 +
+ drivers/gpu/drm/panel/Makefile | 1 +
+ .../gpu/drm/panel/panel-xingbangda-xbd599.c | 366 ++++++++++++++++++
+ 3 files changed, 376 insertions(+)
+ create mode 100644 drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
+
+diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
+index a1723c1b5fbf..cf0c59015a44 100644
+--- a/drivers/gpu/drm/panel/Kconfig
++++ b/drivers/gpu/drm/panel/Kconfig
+@@ -433,6 +433,15 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
+ Say Y here if you want to enable support for Truly NT35597 WQXGA Dual DSI
+ Video Mode panel
+
++config DRM_PANEL_XINGBANGDA_XBD599
++ tristate "Xingbangda XBD599 panel"
++ depends on OF
++ depends on DRM_MIPI_DSI
++ depends on BACKLIGHT_CLASS_DEVICE
++ help
++ Say Y here if you want to enable support for the Xingbangda XBD599
++ MIPI DSI Video Mode panel.
++
+ config DRM_PANEL_XINPENG_XPP055C272
+ tristate "Xinpeng XPP055C272 panel driver"
+ depends on OF
+diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
+index 96a883cd6630..c84ed5215984 100644
+--- a/drivers/gpu/drm/panel/Makefile
++++ b/drivers/gpu/drm/panel/Makefile
+@@ -46,4 +46,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
+ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
+ obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
+ obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
++obj-$(CONFIG_DRM_PANEL_XINGBANGDA_XBD599) += panel-xingbangda-xbd599.o
+ obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
+diff --git a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
+new file mode 100644
+index 000000000000..b483f96ee1db
+--- /dev/null
++++ b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
+@@ -0,0 +1,366 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * Xingbangda XBD599 MIPI-DSI panel driver
++ *
++ * Copyright (C) 2019-2020 Icenowy Zheng <icenowy@aosc.io>
++ *
++ * Based on panel-rocktech-jh057n00900.c, which is:
++ * Copyright (C) Purism SPC 2019
++ */
++
++#include <linux/delay.h>
++#include <linux/gpio/consumer.h>
++#include <linux/mod_devicetable.h>
++#include <linux/module.h>
++#include <linux/of_device.h>
++#include <linux/regulator/consumer.h>
++
++#include <drm/drm_mipi_dsi.h>
++#include <drm/drm_modes.h>
++#include <drm/drm_panel.h>
++#include <drm/drm_print.h>
++
++/* Manufacturer specific Commands send via DSI */
++#define ST7703_CMD_ALL_PIXEL_OFF 0x22
++#define ST7703_CMD_ALL_PIXEL_ON 0x23
++#define ST7703_CMD_SETDISP 0xB2
++#define ST7703_CMD_SETRGBIF 0xB3
++#define ST7703_CMD_SETCYC 0xB4
++#define ST7703_CMD_SETBGP 0xB5
++#define ST7703_CMD_SETVCOM 0xB6
++#define ST7703_CMD_SETOTP 0xB7
++#define ST7703_CMD_SETPOWER_EXT 0xB8
++#define ST7703_CMD_SETEXTC 0xB9
++#define ST7703_CMD_SETMIPI 0xBA
++#define ST7703_CMD_SETVDC 0xBC
++#define ST7703_CMD_SETSCR 0xC0
++#define ST7703_CMD_SETPOWER 0xC1
++#define ST7703_CMD_UNK_C6 0xC6
++#define ST7703_CMD_SETPANEL 0xCC
++#define ST7703_CMD_SETGAMMA 0xE0
++#define ST7703_CMD_SETEQ 0xE3
++#define ST7703_CMD_SETGIP1 0xE9
++#define ST7703_CMD_SETGIP2 0xEA
++
++static const char * const regulator_names[] = {
++ "iovcc",
++ "vcc",
++};
++
++struct xbd599 {
++ struct device *dev;
++ struct drm_panel panel;
++ struct gpio_desc *reset_gpio;
++ struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)];
++ bool prepared;
++};
++
++static inline struct xbd599 *panel_to_xbd599(struct drm_panel *panel)
++{
++ return container_of(panel, struct xbd599, panel);
++}
++
++#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
++ static const u8 d[] = { seq }; \
++ int ret; \
++ ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
++ if (ret < 0) \
++ return ret; \
++ } while (0)
++
++static int xbd599_init_sequence(struct xbd599 *ctx)
++{
++ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
++ struct device *dev = ctx->dev;
++ int ret;
++
++ /*
++ * Init sequence was supplied by the panel vendor.
++ */
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC,
++ 0xF1, 0x12, 0x83);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI,
++ 0x33, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25,
++ 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02, 0x4F, 0x11,
++ 0x00, 0x00, 0x37);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT,
++ 0x25, 0x22, 0x20, 0x03);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF,
++ 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00,
++ 0x00, 0x00);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR,
++ 0x73, 0x73, 0x50, 0x50, 0x00, 0xC0, 0x08, 0x70,
++ 0x00);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0xF0);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ,
++ 0x00, 0x00, 0x0B, 0x0B, 0x10, 0x10, 0x00, 0x00,
++ 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10);
++ dsi_dcs_write_seq(dsi, 0xC6, 0x01, 0x00, 0xFF, 0xFF, 0x00);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
++ 0x74, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xFF, 0xFF,
++ 0xCC, 0xCC, 0x77, 0x77);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x07, 0x07);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x2C, 0x2C);
++ dsi_dcs_write_seq(dsi, 0xBF, 0x02, 0x11, 0x00);
++
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1,
++ 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12,
++ 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
++ 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
++ 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
++ 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
++ 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
++ 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2,
++ 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
++ 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
++ 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
++ 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A,
++ 0xA5, 0x00, 0x00, 0x00, 0x00);
++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA,
++ 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35,
++ 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12,
++ 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41,
++ 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12,
++ 0x12, 0x18);
++ msleep(20);
++
++ ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
++ if (ret < 0) {
++ DRM_DEV_ERROR(dev, "Failed to exit sleep mode\n");
++ return ret;
++ }
++ msleep(250);
++
++ ret = mipi_dsi_dcs_set_display_on(dsi);
++ if (ret)
++ return ret;
++ msleep(50);
++
++ DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
++ return 0;
++}
++
++static int xbd599_prepare(struct drm_panel *panel)
++{
++ struct xbd599 *ctx = panel_to_xbd599(panel);
++ int ret;
++
++ if (ctx->prepared)
++ return 0;
++
++ ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
++ if (ret)
++ return ret;
++
++ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
++ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
++ usleep_range(20, 40);
++ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
++ msleep(20);
++
++ ctx->prepared = true;
++
++ return 0;
++}
++
++static int xbd599_enable(struct drm_panel *panel)
++{
++ struct xbd599 *ctx = panel_to_xbd599(panel);
++ int ret;
++
++ ret = xbd599_init_sequence(ctx);
++ if (ret < 0) {
++ DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
++ ret);
++ return ret;
++ }
++
++ return 0;
++}
++
++static int xbd599_disable(struct drm_panel *panel)
++{
++ struct xbd599 *ctx = panel_to_xbd599(panel);
++ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
++
++ return mipi_dsi_dcs_set_display_off(dsi);
++}
++
++static int xbd599_unprepare(struct drm_panel *panel)
++{
++ struct xbd599 *ctx = panel_to_xbd599(panel);
++
++ if (!ctx->prepared)
++ return 0;
++
++ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
++ regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
++ ctx->prepared = false;
++
++ return 0;
++}
++
++static const struct drm_display_mode xbd599_default_mode = {
++ .hdisplay = 720,
++ .hsync_start = 720 + 40,
++ .hsync_end = 720 + 40 + 40,
++ .htotal = 720 + 40 + 40 + 40,
++ .vdisplay = 1440,
++ .vsync_start = 1440 + 18,
++ .vsync_end = 1440 + 18 + 10,
++ .vtotal = 1440 + 18 + 10 + 17,
++ .vrefresh = 60,
++ .clock = 69000,
++ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
++
++ .width_mm = 68,
++ .height_mm = 136,
++ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
++};
++
++static int xbd599_get_modes(struct drm_panel *panel,
++ struct drm_connector *connector)
++{
++ struct xbd599 *ctx = panel_to_xbd599(panel);
++ struct drm_display_mode *mode;
++
++ mode = drm_mode_duplicate(connector->dev, &xbd599_default_mode);
++ if (!mode) {
++ DRM_DEV_ERROR(ctx->dev, "Failed to add mode\n");
++ return -ENOMEM;
++ }
++
++ drm_mode_set_name(mode);
++
++ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
++ connector->display_info.width_mm = mode->width_mm;
++ connector->display_info.height_mm = mode->height_mm;
++ drm_mode_probed_add(connector, mode);
++
++ return 1;
++}
++
++static const struct drm_panel_funcs xbd599_drm_funcs = {
++ .prepare = xbd599_prepare,
++ .enable = xbd599_enable,
++ .disable = xbd599_disable,
++ .unprepare = xbd599_unprepare,
++ .get_modes = xbd599_get_modes,
++};
++
++static int xbd599_probe(struct mipi_dsi_device *dsi)
++{
++ struct device *dev = &dsi->dev;
++ struct xbd599 *ctx;
++ int i, ret;
++
++ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
++ if (!ctx)
++ return -ENOMEM;
++
++ for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++)
++ ctx->supplies[i].supply = regulator_names[i];
++
++ ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
++ ctx->supplies);
++ if (ret < 0) {
++ DRM_DEV_ERROR(&dsi->dev, "cannot get regulators\n");
++ return ret;
++ }
++
++ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
++ if (IS_ERR(ctx->reset_gpio)) {
++ DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
++ return PTR_ERR(ctx->reset_gpio);
++ }
++
++ mipi_dsi_set_drvdata(dsi, ctx);
++
++ ctx->dev = dev;
++
++ dsi->lanes = 4;
++ dsi->format = MIPI_DSI_FMT_RGB888;
++ dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
++
++ drm_panel_init(&ctx->panel, &dsi->dev, &xbd599_drm_funcs,
++ DRM_MODE_CONNECTOR_DSI);
++
++ ret = drm_panel_of_backlight(&ctx->panel);
++ if (ret)
++ return ret;
++
++ drm_panel_add(&ctx->panel);
++
++ ret = mipi_dsi_attach(dsi);
++ if (ret < 0) {
++ DRM_DEV_ERROR(dev, "mipi_dsi_attach failed. Is host ready?\n");
++ drm_panel_remove(&ctx->panel);
++ return ret;
++ }
++
++ DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
++ xbd599_default_mode.hdisplay,
++ xbd599_default_mode.vdisplay,
++ xbd599_default_mode.vrefresh,
++ mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
++
++ return 0;
++}
++
++static void xbd599_shutdown(struct mipi_dsi_device *dsi)
++{
++ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
++ int ret;
++
++ ret = drm_panel_unprepare(&ctx->panel);
++ if (ret < 0)
++ DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n",
++ ret);
++}
++
++static int xbd599_remove(struct mipi_dsi_device *dsi)
++{
++ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
++ int ret;
++
++ xbd599_shutdown(dsi);
++
++ ret = mipi_dsi_detach(dsi);
++ if (ret < 0)
++ DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n",
++ ret);
++
++ drm_panel_remove(&ctx->panel);
++
++ return 0;
++}
++
++static const struct of_device_id xbd599_of_match[] = {
++ { .compatible = "xingbangda,xbd599", },
++ { /* sentinel */ }
++};
++MODULE_DEVICE_TABLE(of, xbd599_of_match);
++
++static struct mipi_dsi_driver xbd599_driver = {
++ .probe = xbd599_probe,
++ .remove = xbd599_remove,
++ .shutdown = xbd599_shutdown,
++ .driver = {
++ .name = "panel-xingbangda-xbd599",
++ .of_match_table = xbd599_of_match,
++ },
++};
++module_mipi_dsi_driver(xbd599_driver);
++
++MODULE_AUTHOR("Icenowy Zheng <icenowy@aosc.io>");
++MODULE_DESCRIPTION("DRM driver for Xingbangda XBD599 MIPI DSI panel");
++MODULE_LICENSE("GPL v2");
+--
+2.26.2
+
diff --git a/0001-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calcu.patch b/0001-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calcu.patch
new file mode 100644
index 000000000..f61b5490f
--- /dev/null
+++ b/0001-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calcu.patch
@@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Mon, 16 Mar 2020 21:35:02 +0800
+Subject: [PATCH] drm/sun4i: sun6i_mipi_dsi: fix horizontal timing calculation
+
+The max() function call in horizontal timing calculation shouldn't pad a
+length already subtracted with overhead to overhead, instead it should
+only prevent the set timing to underflow.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+---
+ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+index 3eb89f1eb0e1..4e415793d155 100644
+--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
++++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+@@ -555,7 +555,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
+ */
+ #define HSA_PACKET_OVERHEAD 10
+ hsa = max((unsigned int)HSA_PACKET_OVERHEAD,
+- (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD);
++ (mode->hsync_end - mode->hsync_start) * Bpp) - HSA_PACKET_OVERHEAD;
+
+ /*
+ * The backporch is set using a blanking packet (4
+@@ -564,7 +564,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
+ */
+ #define HBP_PACKET_OVERHEAD 6
+ hbp = max((unsigned int)HBP_PACKET_OVERHEAD,
+- (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD);
++ (mode->htotal - mode->hsync_end) * Bpp) - HBP_PACKET_OVERHEAD;
+
+ /*
+ * The frontporch is set using a sync event (4 bytes)
+@@ -574,7 +574,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
+ */
+ #define HFP_PACKET_OVERHEAD 16
+ hfp = max((unsigned int)HFP_PACKET_OVERHEAD,
+- (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD);
++ (mode->hsync_start - mode->hdisplay) * Bpp) - HFP_PACKET_OVERHEAD;
+
+ /*
+ * The blanking is set using a sync event (4 bytes)
+@@ -583,8 +583,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
+ */
+ #define HBLK_PACKET_OVERHEAD 10
+ hblk = max((unsigned int)HBLK_PACKET_OVERHEAD,
+- (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp -
+- HBLK_PACKET_OVERHEAD);
++ (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp) -
++ HBLK_PACKET_OVERHEAD;
+
+ /*
+ * And I'm not entirely sure what vblk is about. The driver in
+--
+2.26.2
+
diff --git a/0001-dt-bindings-Add-doc-for-Pine64-Pinebook-Pro.patch b/0001-dt-bindings-Add-doc-for-Pine64-Pinebook-Pro.patch
new file mode 100644
index 000000000..f212fb501
--- /dev/null
+++ b/0001-dt-bindings-Add-doc-for-Pine64-Pinebook-Pro.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Emmanuel Vadot <manu@freebsd.org>
+Date: Wed, 4 Mar 2020 22:30:22 +0100
+Subject: [PATCH] dt-bindings: Add doc for Pine64 Pinebook Pro
+
+Add a compatible for Pine64 Pinebook Pro
+
+Signed-off-by: Emmanuel Vadot <manu@freebsd.org>
+Reviewed-by: Rob Herring <robh@kernel.org>
+---
+ Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
+index 715586dea9bb..fff0439c6b78 100644
+--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
++++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
+@@ -420,6 +420,11 @@ properties:
+ - const: pine64,rockpro64
+ - const: rockchip,rk3399
+
++ - description: Pine64 PinebookPro
++ items:
++ - const: pine64,pinebook-pro
++ - const: rockchip,rk3399
++
+ - description: Radxa Rock
+ items:
+ - const: radxa,rock
+--
+2.26.2
+
diff --git a/0001-dt-bindings-panel-add-binding-for-Xingbangda-XBD599-.patch b/0001-dt-bindings-panel-add-binding-for-Xingbangda-XBD599-.patch
new file mode 100644
index 000000000..8e6808fdc
--- /dev/null
+++ b/0001-dt-bindings-panel-add-binding-for-Xingbangda-XBD599-.patch
@@ -0,0 +1,74 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Icenowy Zheng <icenowy@aosc.io>
+Date: Mon, 16 Mar 2020 21:35:00 +0800
+Subject: [PATCH] dt-bindings: panel: add binding for Xingbangda XBD599 panel
+
+Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI LCD panel.
+
+Add its device tree binding.
+
+Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
+---
+ .../display/panel/xingbangda,xbd599.yaml | 50 +++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
+
+diff --git a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
+new file mode 100644
+index 000000000000..b27bcf11198f
+--- /dev/null
++++ b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
+@@ -0,0 +1,50 @@
++# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
++%YAML 1.2
++---
++$id: http://devicetree.org/schemas/display/panel/xingbangda,xbd599.yaml#
++$schema: http://devicetree.org/meta-schemas/core.yaml#
++
++title: Xingbangda XBD599 5.99in MIPI-DSI LCD panel
++
++maintainers:
++ - Icenowy Zheng <icenowy@aosc.io>
++
++allOf:
++ - $ref: panel-common.yaml#
++
++properties:
++ compatible:
++ const: xingbangda,xbd599
++ reg: true
++ backlight: true
++ reset-gpios: true
++ vcc-supply:
++ description: regulator that supplies the VCC voltage
++ iovcc-supply:
++ description: regulator that supplies the IOVCC voltage
++
++required:
++ - compatible
++ - reg
++ - backlight
++ - vcc-supply
++ - iovcc-supply
++
++additionalProperties: false
++
++examples:
++ - |
++ dsi {
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ panel@0 {
++ compatible = "xingbangda,xbd599";
++ reg = <0>;
++ backlight = <&backlight>;
++ iovcc-supply = <&reg_dldo2>;
++ vcc-supply = <&reg_ldo_io0>;
++ };
++ };
++
++...
+--
+2.26.2
+
diff --git a/0001-e1000e-bump-up-timeout-to-wait-when-ME-un-configure-.patch b/0001-e1000e-bump-up-timeout-to-wait-when-ME-un-configure-.patch
new file mode 100644
index 000000000..8e740ce24
--- /dev/null
+++ b/0001-e1000e-bump-up-timeout-to-wait-when-ME-un-configure-.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aaron Ma <aaron.ma@canonical.com>
+Date: Tue, 24 Mar 2020 03:16:39 +0800
+Subject: [PATCH] e1000e: bump up timeout to wait when ME un-configure ULP mode
+
+ME takes 2+ seconds to un-configure ULP mode done after resume
+from s2idle on some ThinkPad laptops.
+Without enough wait, reset and re-init will fail with error.
+
+Fixes: f15bb6dde738cc8fa0 ("e1000e: Add support for S0ix")
+BugLink: https://bugs.launchpad.net/bugs/1865570
+Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
+---
+ drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
+index 735bf25952fc..15f6c0a4dc63 100644
+--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
+@@ -1243,9 +1243,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
+ ew32(H2ME, mac_reg);
+ }
+
+- /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */
++ /* Poll up to 2.5sec for ME to clear ULP_CFG_DONE. */
+ while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) {
+- if (i++ == 30) {
++ if (i++ == 250) {
+ ret_val = -E1000_ERR_PHY;
+ goto out;
+ }
+--
+2.26.2
+
diff --git a/0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch b/0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch
new file mode 100644
index 000000000..acd11a206
--- /dev/null
+++ b/0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch
@@ -0,0 +1,161 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Tue, 27 Feb 2018 10:04:55 +0000
+Subject: [PATCH] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode
+
+UEFI machines can be booted in Secure Boot mode. Add an EFI_SECURE_BOOT
+flag that can be passed to efi_enabled() to find out whether secure boot is
+enabled.
+
+Move the switch-statement in x86's setup_arch() that inteprets the
+secure_boot boot parameter to generic code and set the bit there.
+
+Upstream Status: RHEL only
+Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Signed-off-by: David Howells <dhowells@redhat.com>
+Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+cc: linux-efi@vger.kernel.org
+[Rebased for context; efi_is_table_address was moved to arch/x86]
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ arch/x86/kernel/setup.c | 14 +-----------
+ drivers/firmware/efi/Makefile | 1 +
+ drivers/firmware/efi/secureboot.c | 38 +++++++++++++++++++++++++++++++
+ include/linux/efi.h | 18 ++++++++++-----
+ 4 files changed, 52 insertions(+), 19 deletions(-)
+ create mode 100644 drivers/firmware/efi/secureboot.c
+
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
+index e39ec0f88d28..08e9f5fc26a8 100644
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -1250,19 +1250,7 @@ void __init setup_arch(char **cmdline_p)
+ /* Allocate bigger log buffer */
+ setup_log_buf(1);
+
+- if (efi_enabled(EFI_BOOT)) {
+- switch (boot_params.secure_boot) {
+- case efi_secureboot_mode_disabled:
+- pr_info("Secure boot disabled\n");
+- break;
+- case efi_secureboot_mode_enabled:
+- pr_info("Secure boot enabled\n");
+- break;
+- default:
+- pr_info("Secure boot could not be determined\n");
+- break;
+- }
+- }
++ efi_set_secure_boot(boot_params.secure_boot);
+
+ reserve_initrd();
+
+diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
+index 7a216984552b..f0ef02d733af 100644
+--- a/drivers/firmware/efi/Makefile
++++ b/drivers/firmware/efi/Makefile
+@@ -25,6 +25,7 @@ obj-$(CONFIG_EFI_FAKE_MEMMAP) += fake_map.o
+ obj-$(CONFIG_EFI_BOOTLOADER_CONTROL) += efibc.o
+ obj-$(CONFIG_EFI_TEST) += test/
+ obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o
++obj-$(CONFIG_EFI) += secureboot.o
+ obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o
+ obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o
+ obj-$(CONFIG_EFI_EMBEDDED_FIRMWARE) += embedded-firmware.o
+diff --git a/drivers/firmware/efi/secureboot.c b/drivers/firmware/efi/secureboot.c
+new file mode 100644
+index 000000000000..de0a3714a5d4
+--- /dev/null
++++ b/drivers/firmware/efi/secureboot.c
+@@ -0,0 +1,38 @@
++/* Core kernel secure boot support.
++ *
++ * Copyright (C) 2017 Red Hat, Inc. All Rights Reserved.
++ * Written by David Howells (dhowells@redhat.com)
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public Licence
++ * as published by the Free Software Foundation; either version
++ * 2 of the Licence, or (at your option) any later version.
++ */
++
++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
++
++#include <linux/efi.h>
++#include <linux/kernel.h>
++#include <linux/printk.h>
++
++/*
++ * Decide what to do when UEFI secure boot mode is enabled.
++ */
++void __init efi_set_secure_boot(enum efi_secureboot_mode mode)
++{
++ if (efi_enabled(EFI_BOOT)) {
++ switch (mode) {
++ case efi_secureboot_mode_disabled:
++ pr_info("Secure boot disabled\n");
++ break;
++ case efi_secureboot_mode_enabled:
++ set_bit(EFI_SECURE_BOOT, &efi.flags);
++ pr_info("Secure boot enabled\n");
++ break;
++ default:
++ pr_warn("Secure boot could not be determined (mode %u)\n",
++ mode);
++ break;
++ }
++ }
++}
+diff --git a/include/linux/efi.h b/include/linux/efi.h
+index 51503bf118ab..b35e693f20f3 100644
+--- a/include/linux/efi.h
++++ b/include/linux/efi.h
+@@ -778,6 +778,14 @@ extern int __init efi_setup_pcdp_console(char *);
+ #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
+ #define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
+ #define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */
++#define EFI_SECURE_BOOT 13 /* Are we in Secure Boot mode? */
++
++enum efi_secureboot_mode {
++ efi_secureboot_mode_unset,
++ efi_secureboot_mode_unknown,
++ efi_secureboot_mode_disabled,
++ efi_secureboot_mode_enabled,
++};
+
+ #ifdef CONFIG_EFI
+ /*
+@@ -789,6 +797,8 @@ static inline bool efi_enabled(int feature)
+ }
+ extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
+
++extern void __init efi_set_secure_boot(enum efi_secureboot_mode mode);
++
+ bool __pure __efi_soft_reserve_enabled(void);
+
+ static inline bool __pure efi_soft_reserve_enabled(void)
+@@ -815,6 +825,8 @@ efi_capsule_pending(int *reset_type)
+ return false;
+ }
+
++static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
++
+ static inline bool efi_soft_reserve_enabled(void)
+ {
+ return false;
+@@ -1086,12 +1098,6 @@ static inline bool efi_runtime_disabled(void) { return true; }
+ extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
+ extern unsigned long efi_call_virt_save_flags(void);
+
+-enum efi_secureboot_mode {
+- efi_secureboot_mode_unset,
+- efi_secureboot_mode_unknown,
+- efi_secureboot_mode_disabled,
+- efi_secureboot_mode_enabled,
+-};
+ enum efi_secureboot_mode efi_get_secureboot(void);
+
+ #ifdef CONFIG_RESET_ATTACK_MITIGATION
+--
+2.26.2
+
diff --git a/0001-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch b/0001-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch
new file mode 100644
index 000000000..97096ad32
--- /dev/null
+++ b/0001-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch
@@ -0,0 +1,72 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Mon, 30 Sep 2019 21:28:16 +0000
+Subject: [PATCH] efi: Lock down the kernel if booted in secure boot mode
+
+UEFI Secure Boot provides a mechanism for ensuring that the firmware
+will only load signed bootloaders and kernels. Certain use cases may
+also require that all kernel modules also be signed. Add a
+configuration option that to lock down the kernel - which includes
+requiring validly signed modules - if the kernel is secure-booted.
+
+Upstream Status: RHEL only
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ arch/x86/kernel/setup.c | 8 ++++++++
+ security/lockdown/Kconfig | 13 +++++++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
+index 08e9f5fc26a8..b6f5510f3d91 100644
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -18,6 +18,7 @@
+ #include <linux/sfi.h>
+ #include <linux/hugetlb.h>
+ #include <linux/tboot.h>
++#include <linux/security.h>
+ #include <linux/usb/xhci-dbgp.h>
+
+ #include <uapi/linux/mount.h>
+@@ -1099,6 +1100,13 @@ void __init setup_arch(char **cmdline_p)
+ if (efi_enabled(EFI_BOOT))
+ efi_init();
+
++ efi_set_secure_boot(boot_params.secure_boot);
++
++#ifdef CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT
++ if (efi_enabled(EFI_SECURE_BOOT))
++ security_lock_kernel_down("EFI Secure Boot mode", LOCKDOWN_INTEGRITY_MAX);
++#endif
++
+ dmi_setup();
+
+ /*
+diff --git a/security/lockdown/Kconfig b/security/lockdown/Kconfig
+index e84ddf484010..d0501353a4b9 100644
+--- a/security/lockdown/Kconfig
++++ b/security/lockdown/Kconfig
+@@ -16,6 +16,19 @@ config SECURITY_LOCKDOWN_LSM_EARLY
+ subsystem is fully initialised. If enabled, lockdown will
+ unconditionally be called before any other LSMs.
+
++config LOCK_DOWN_IN_EFI_SECURE_BOOT
++ bool "Lock down the kernel in EFI Secure Boot mode"
++ default n
++ depends on EFI && SECURITY_LOCKDOWN_LSM_EARLY
++ help
++ UEFI Secure Boot provides a mechanism for ensuring that the firmware
++ will only load signed bootloaders and kernels. Secure boot mode may
++ be determined from EFI variables provided by the system firmware if
++ not indicated by the boot parameters.
++
++ Enabling this option results in kernel lockdown being triggered if
++ EFI Secure Boot is set.
++
+ choice
+ prompt "Kernel default lockdown mode"
+ default LOCK_DOWN_KERNEL_FORCE_NONE
+--
+2.26.2
+
diff --git a/0001-firmware-raspberrypi-Introduce-vl805-init-routine.patch b/0001-firmware-raspberrypi-Introduce-vl805-init-routine.patch
new file mode 100644
index 000000000..db8a4a16c
--- /dev/null
+++ b/0001-firmware-raspberrypi-Introduce-vl805-init-routine.patch
@@ -0,0 +1,110 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Date: Tue, 10 Mar 2020 13:52:40 +0100
+Subject: [PATCH] firmware: raspberrypi: Introduce vl805 init routine
+
+On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be
+loaded directly from an EEPROM or, if not present, by the SoC's
+VideCore. The function informs VideCore that VL805 was just reset, or
+requests for a probe defer.
+
+Based on Tim Gover's downstream implementation.
+
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ drivers/firmware/raspberrypi.c | 38 ++++++++++++++++++++++
+ include/soc/bcm2835/raspberrypi-firmware.h | 7 ++++
+ 2 files changed, 45 insertions(+)
+
+diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
+index da26a584dca0..cbb495aff6a0 100644
+--- a/drivers/firmware/raspberrypi.c
++++ b/drivers/firmware/raspberrypi.c
+@@ -12,6 +12,7 @@
+ #include <linux/of_platform.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
++#include <linux/pci.h>
+ #include <soc/bcm2835/raspberrypi-firmware.h>
+
+ #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf))
+@@ -286,6 +287,43 @@ struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
+ }
+ EXPORT_SYMBOL_GPL(rpi_firmware_get);
+
++/*
++ * On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be
++ * loaded directly from an EEPROM or, if not present, by the SoC's VideCore.
++ * Inform VideCore that VL805 was just reset, or defer xhci's probe if not yet
++ * joinable trough the mailbox interface.
++ */
++int rpi_firmware_init_vl805(struct pci_dev *pdev)
++{
++ struct device_node *fw_np;
++ struct rpi_firmware *fw;
++ u32 dev_addr;
++ int ret;
++
++ fw_np = of_find_compatible_node(NULL, NULL,
++ "raspberrypi,bcm2835-firmware");
++ if (!fw_np)
++ return 0;
++
++ fw = rpi_firmware_get(fw_np);
++ of_node_put(fw_np);
++ if (!fw)
++ return -EPROBE_DEFER;
++
++ dev_addr = pdev->bus->number << 20 | PCI_SLOT(pdev->devfn) << 15 |
++ PCI_FUNC(pdev->devfn) << 12;
++
++ ret = rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_XHCI_RESET,
++ &dev_addr, sizeof(dev_addr));
++ if (ret)
++ return ret;
++
++ dev_dbg(&pdev->dev, "loaded Raspberry Pi's VL805 firmware\n");
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(rpi_firmware_init_vl805);
++
+ static const struct of_device_id rpi_firmware_of_match[] = {
+ { .compatible = "raspberrypi,bcm2835-firmware", },
+ {},
+diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
+index cc9cdbc66403..3025aca3c358 100644
+--- a/include/soc/bcm2835/raspberrypi-firmware.h
++++ b/include/soc/bcm2835/raspberrypi-firmware.h
+@@ -10,6 +10,7 @@
+ #include <linux/of_device.h>
+
+ struct rpi_firmware;
++struct pci_dev;
+
+ enum rpi_firmware_property_status {
+ RPI_FIRMWARE_STATUS_REQUEST = 0,
+@@ -141,6 +142,7 @@ int rpi_firmware_property(struct rpi_firmware *fw,
+ int rpi_firmware_property_list(struct rpi_firmware *fw,
+ void *data, size_t tag_size);
+ struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node);
++int rpi_firmware_init_vl805(struct pci_dev *pdev);
+ #else
+ static inline int rpi_firmware_property(struct rpi_firmware *fw, u32 tag,
+ void *data, size_t len)
+@@ -158,6 +160,11 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware
+ {
+ return NULL;
+ }
++
++static inline int rpi_firmware_init_vl805(struct pci_dev *pdev)
++{
++ return 0;
++}
+ #endif
+
+ #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */
+--
+2.26.2
+
diff --git a/0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch b/0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch
new file mode 100644
index 000000000..e6eef22d6
--- /dev/null
+++ b/0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch
@@ -0,0 +1,98 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Mon, 20 May 2019 22:21:02 -0400
+Subject: [PATCH] iommu/arm-smmu: workaround DMA mode issues
+
+Message-id: <20190520222102.19488-1-labbott@redhat.com>
+Patchwork-id: 259215
+O-Subject: [ARK INTERNAL PATCH] iommu/arm-smmu: workaround DMA mode issues
+Bugzilla:
+RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
+RH-Acked-by: Mark Salter <msalter@redhat.com>
+
+From: Mark Salter <msalter@redhat.com>
+
+Rebased for v5.2-rc1
+
+ Bugzilla: 1652259
+ Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19244562
+ Upstream status: RHEL only.
+
+ rhel8 commit 65feb1ed0ec9a088a63a90d46c0f7563ac96ad0f
+ Author: Mark Salter <msalter@redhat.com>
+ Date: Wed Nov 21 17:15:59 2018 +0100
+
+ [iommu] iommu/arm-smmu: workaround DMA mode issues
+
+ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1624077
+ Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=18112820
+ Testing: Verified iommu.passthrough=1 no longer needed on gigabyte platforms.
+ Upstream Status: RHEL-only
+
+ In RHEL_ALT 7.5 we carried a RHEL-only patch which forced the arm smmuv2
+ into bypass mode due to performance issues on CN88xx. This was intended
+ to be a temporary hack until the issues were resolved. Another vendor
+ had issues with the iommu in bypass mode so we reverted the RHEL-only
+ patch so that iommu is in DMA mode by default (upstream default).
+
+ It turns on that there are remaining SMMU DMA mode issues on Gigabyte
+ platformws with CN88xx cpus. The problem manifests itself by pcie
+ card drivers failing to initialize the cards when SMMU is in DMA mode.
+ The root cause has not been determined yet, but looks likely to be
+ a hw or firmware issue. This patch forces bypass mode for Gigabyte
+ platforms. CN88xx isn't officially supported in RHEL but we have a
+ lot of them being used internally for testing, so I think we want
+ this to support that use case in RHEL8.
+
+ Signed-off-by: Mark Salter <msalter@redhat.com>
+ Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+ Acked-by: Mark Salter <msalter@redhat.com>
+ Acked-by: Donald Dutile <ddutile@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Laura Abbott <labbott@redhat.com>
+---
+ drivers/iommu/iommu.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
+index 03d6a26687bc..86981f228c90 100644
+--- a/drivers/iommu/iommu.c
++++ b/drivers/iommu/iommu.c
+@@ -7,6 +7,7 @@
+ #define pr_fmt(fmt) "iommu: " fmt
+
+ #include <linux/device.h>
++#include <linux/dmi.h>
+ #include <linux/kernel.h>
+ #include <linux/bug.h>
+ #include <linux/types.h>
+@@ -2664,3 +2665,24 @@ int iommu_sva_get_pasid(struct iommu_sva *handle)
+ return ops->sva_get_pasid(handle);
+ }
+ EXPORT_SYMBOL_GPL(iommu_sva_get_pasid);
++
++#ifdef CONFIG_ARM64
++static int __init iommu_quirks(void)
++{
++ const char *vendor, *name;
++
++ vendor = dmi_get_system_info(DMI_SYS_VENDOR);
++ name = dmi_get_system_info(DMI_PRODUCT_NAME);
++
++ if (vendor &&
++ (strncmp(vendor, "GIGABYTE", 8) == 0 && name &&
++ (strncmp(name, "R120", 4) == 0 ||
++ strncmp(name, "R270", 4) == 0))) {
++ pr_warn("Gigabyte %s detected, force iommu passthrough mode", name);
++ iommu_def_domain_type = IOMMU_DOMAIN_IDENTITY;
++ }
++
++ return 0;
++}
++arch_initcall(iommu_quirks);
++#endif
+--
+2.26.2
+
diff --git a/0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch b/0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch
new file mode 100644
index 000000000..56a9fa2d0
--- /dev/null
+++ b/0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch
@@ -0,0 +1,123 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Sun, 10 Feb 2019 01:27:54 +0000
+Subject: [PATCH] ipmi: do not configure ipmi for HPE m400
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1670017
+Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20147017
+
+Commit 913a89f009d9 ("ipmi: Don't initialize anything in the core until
+something uses it") added new locking which broke context.
+
+ Message-id: <20180713142210.15700-1-tcamuso@redhat.com>
+ Patchwork-id: 224899
+ O-Subject: [RHEL8 BZ 1583537 1/1] ipmi: do not configure ipmi for HPE m400
+ Bugzilla: 1583537
+ RH-Acked-by: Dean Nelson <dnelson@redhat.com>
+ RH-Acked-by: Al Stone <ahs3@redhat.com>
+ RH-Acked-by: Mark Salter <msalter@redhat.com>
+
+ bugzilla:https://bugzilla.redhat.com/show_bug.cgi?id=1583537
+ brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17150528
+
+ RHEL-only
+
+ The ARM-based HPE m400 reports host-side ipmi as residing in intel
+ port-io space, which does not exist in ARM processors. Therefore, when
+ running on an m400, host-side ipmi configuration code must simply return
+ zero without trying to configure the host-side ipmi.
+
+ This patch prevents panic on boot by averting attempts to configure
+ host-side ipmi on this platform.
+
+ Though HPE m400 is not certified with RHEL, and HPE has relegated it to
+ EOL status, the platform is still used extensively in ARM development
+ and test for RHEL.
+
+ Testing:
+ Boot without blacklisting ipmi and check to see that no ipmi modules
+ are loaded.
+
+ Signed-off-by: Tony Camuso <tcamuso@redhat.com>
+
+ cc: Prarit Bhargava <prarit@redhat.com>
+ cc: Brendan Conoboy <blc@redhat.com>
+ cc: Jeff Bastian <jbastian@redhat.com>
+ cc: Scott Herold <sherold@redhat.com>
+ Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Laura Abbott <labbott@redhat.com>
+Acked-by: Tony Camuso <tcamuso@redhat.com>
+Acked-by: Dean Nelson <dnelson@redhat.com>
+Acked-by: Jarod Wilson <jarod@redhat.com>
+Acked-by: Mark Salter <msalter@redhat.com>
+---
+ drivers/char/ipmi/ipmi_dmi.c | 15 +++++++++++++++
+ drivers/char/ipmi/ipmi_msghandler.c | 16 +++++++++++++++-
+ 2 files changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c
+index bbf7029e224b..cf7faa970dd6 100644
+--- a/drivers/char/ipmi/ipmi_dmi.c
++++ b/drivers/char/ipmi/ipmi_dmi.c
+@@ -215,6 +215,21 @@ static int __init scan_for_dmi_ipmi(void)
+ {
+ const struct dmi_device *dev = NULL;
+
++#ifdef CONFIG_ARM64
++ /* RHEL-only
++ * If this is ARM-based HPE m400, return now, because that platform
++ * reports the host-side ipmi address as intel port-io space, which
++ * does not exist in the ARM architecture.
++ */
++ const char *dmistr = dmi_get_system_info(DMI_PRODUCT_NAME);
++
++ if (dmistr && (strcmp("ProLiant m400 Server", dmistr) == 0)) {
++ pr_debug("%s does not support host ipmi\n", dmistr);
++ return 0;
++ }
++ /* END RHEL-only */
++#endif
++
+ while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev)))
+ dmi_decode_ipmi((const struct dmi_header *) dev->device_data);
+
+diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
+index c48d8f086382..0fc980a87ed0 100644
+--- a/drivers/char/ipmi/ipmi_msghandler.c
++++ b/drivers/char/ipmi/ipmi_msghandler.c
+@@ -33,6 +33,7 @@
+ #include <linux/workqueue.h>
+ #include <linux/uuid.h>
+ #include <linux/nospec.h>
++#include <linux/dmi.h>
+
+ #define IPMI_DRIVER_VERSION "39.2"
+
+@@ -5154,8 +5155,21 @@ static int __init ipmi_init_msghandler_mod(void)
+ {
+ int rv;
+
+- pr_info("version " IPMI_DRIVER_VERSION "\n");
++#ifdef CONFIG_ARM64
++ /* RHEL-only
++ * If this is ARM-based HPE m400, return now, because that platform
++ * reports the host-side ipmi address as intel port-io space, which
++ * does not exist in the ARM architecture.
++ */
++ const char *dmistr = dmi_get_system_info(DMI_PRODUCT_NAME);
+
++ if (dmistr && (strcmp("ProLiant m400 Server", dmistr) == 0)) {
++ pr_debug("%s does not support host ipmi\n", dmistr);
++ return -ENOSYS;
++ }
++ /* END RHEL-only */
++#endif
++ pr_info("version " IPMI_DRIVER_VERSION "\n");
+ mutex_lock(&ipmi_interfaces_mutex);
+ rv = ipmi_register_driver();
+ mutex_unlock(&ipmi_interfaces_mutex);
+--
+2.26.2
+
diff --git a/0001-kABI-Add-generic-kABI-macros-to-use-for-kABI-workaro.patch b/0001-kABI-Add-generic-kABI-macros-to-use-for-kABI-workaro.patch
new file mode 100644
index 000000000..4b895c6c4
--- /dev/null
+++ b/0001-kABI-Add-generic-kABI-macros-to-use-for-kABI-workaro.patch
@@ -0,0 +1,214 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Myron Stowe <myron.stowe@redhat.com>
+Date: Fri, 29 Jun 2018 20:05:41 -0400
+Subject: [PATCH] kABI: Add generic kABI macros to use for kABI workarounds
+
+Message-id: <20180629200436.151355.18581.stgit@tak.stowe>
+Patchwork-id: 223206
+O-Subject: [RHEL8.0 PATCH v3] kABI: Add generic kABI macros to use for kABI workarounds
+Bugzilla: 1546831
+RH-Acked-by: Larry Woodman <lwoodman@redhat.com>
+RH-Acked-by: Jarod Wilson <jarod@redhat.com>
+
+Some kernel subsystem maintainers have asked about kABI for RHEL8.0
+- getting kABI related "extension" structures and such into place. The
+consensus was to wait until the 4.17 re-base. Now that that's occurred,
+lets get this first step, kABI macros, into RHEL8.0 so developers will
+notice, and use, them in subsequent kABI related efforts.
+
+Content taken from RHEL 7. No functional change intended.
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1546831
+Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=16694565
+Upstream Status: N/A (RHEL only)
+Testing: Passed through brew build.
+
+Upstream Status: RHEL only
+Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ include/linux/rh_kabi.h | 172 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 172 insertions(+)
+ create mode 100644 include/linux/rh_kabi.h
+
+diff --git a/include/linux/rh_kabi.h b/include/linux/rh_kabi.h
+new file mode 100644
+index 000000000000..e0d3353802bb
+--- /dev/null
++++ b/include/linux/rh_kabi.h
+@@ -0,0 +1,172 @@
++/*
++ * rh_kabi.h - Red Hat kABI abstraction header
++ *
++ * Copyright (c) 2014 Don Zickus
++ * Copyright (c) 2015-2017 Jiri Benc
++ * Copyright (c) 2015 Sabrina Dubroca, Hannes Frederic Sowa
++ * Copyright (c) 2016-2018 Prarit Bhargava
++ * Copyright (c) 2017 Paolo Abeni, Larry Woodman
++ *
++ * This file is released under the GPLv2.
++ * See the file COPYING for more details.
++ *
++ * These kabi macros hide the changes from the kabi checker and from the
++ * process that computes the exported symbols' checksums.
++ * They have 2 variants: one (defined under __GENKSYMS__) used when
++ * generating the checksums, and the other used when building the kernel's
++ * binaries.
++ *
++ * The use of these macros does not guarantee that the usage and modification
++ * of code is correct. As with all Red Hat only changes, an engineer must
++ * explain why the use of the macro is valid in the patch containing the
++ * changes.
++ *
++ */
++
++#ifndef _LINUX_RH_KABI_H
++#define _LINUX_RH_KABI_H
++
++#include <linux/compiler.h>
++#include <linux/stringify.h>
++
++/*
++ * RH_KABI_CONST
++ * Adds a new const modifier to a function parameter preserving the old
++ * checksum.
++ *
++ * RH_KABI_DEPRECATE
++ * Mark the element as deprecated and make it unusable by modules while
++ * preserving kABI checksums.
++ *
++ * RH_KABI_DEPRECATE_FN
++ * Mark the function pointer as deprecated and make it unusable by modules
++ * while preserving kABI checksums.
++ *
++ * RH_KABI_EXTEND
++ * Simple macro for adding a new element to a struct.
++ *
++ * Warning: only use if a hole exists for _all_ arches. Use pahole to verify.
++ *
++ * RH_KABI_FILL_HOLE
++ * Simple macro for filling a hole in a struct.
++ *
++ * RH_KABI_RENAME
++ * Simple macro for renaming an element without changing its type. This
++ * macro can be used in bitfields, for example.
++ *
++ * NOTE: does not include the final ';'
++ *
++ * RH_KABI_REPLACE
++ * Simple replacement of _orig with a union of _orig and _new.
++ *
++ * The RH_KABI_REPLACE* macros attempt to add the ability to use the '_new'
++ * element while preserving size alignment with the '_orig' element.
++ *
++ * The #ifdef __GENKSYMS__ preserves the kABI agreement, while the anonymous
++ * union structure preserves the size alignment (assuming the '_new' element
++ * is not bigger than the '_orig' element).
++ *
++ * RH_KABI_REPLACE_UNSAFE
++ * Unsafe version of RH_KABI_REPLACE. Only use for typedefs.
++ *
++ * RH_KABI_FORCE_CHANGE
++ * Force change of the symbol checksum. The argument of the macro is a
++ * version for cases we need to do this more than once.
++ *
++ * This macro does the opposite: it changes the symbol checksum without
++ * actually changing anything about the exported symbol. It is useful for
++ * symbols that are not whitelisted, we're changing them in an
++ * incompatible way and want to prevent 3rd party modules to silently
++ * corrupt memory. Instead, by changing the symbol checksum, such modules
++ * won't be loaded by the kernel. This macro should only be used as a
++ * last resort when all other KABI workarounds have failed.
++ *
++ * NOTE
++ * Don't use ';' after these macros as it messes up the kABI checker by
++ * changing what the resulting token string looks like. Instead let this
++ * macro add the ';' so it can be properly hidden from the kABI checker
++ * (mainly for RH_KABI_EXTEND, but applied to all macros for uniformity).
++ *
++ */
++#ifdef __GENKSYMS__
++
++# define RH_KABI_CONST
++# define RH_KABI_EXTEND(_new)
++# define RH_KABI_FILL_HOLE(_new)
++# define RH_KABI_FORCE_CHANGE(ver) __attribute__((rh_kabi_change ## ver))
++# define RH_KABI_RENAME(_orig, _new) _orig
++
++# define _RH_KABI_DEPRECATE(_type, _orig) _type _orig
++# define _RH_KABI_DEPRECATE_FN(_type, _orig, _args...) _type (*_orig)(_args)
++# define _RH_KABI_REPLACE(_orig, _new) _orig
++# define _RH_KABI_REPLACE_UNSAFE(_orig, _new) _orig
++
++#else
++
++# define RH_KABI_ALIGN_WARNING ". Disable CONFIG_RH_KABI_SIZE_ALIGN_CHECKS if debugging."
++
++# define RH_KABI_CONST const
++# define RH_KABI_EXTEND(_new) _new;
++# define RH_KABI_FILL_HOLE(_new) _new;
++# define RH_KABI_FORCE_CHANGE(ver)
++# define RH_KABI_RENAME(_orig, _new) _new
++
++
++#if IS_BUILTIN(CONFIG_RH_KABI_SIZE_ALIGN_CHECKS)
++# define __RH_KABI_CHECK_SIZE_ALIGN(_orig, _new) \
++ union { \
++ _Static_assert(sizeof(struct{_new;}) <= sizeof(struct{_orig;}), \
++ __FILE__ ":" __stringify(__LINE__) ": " __stringify(_new) " is larger than " __stringify(_orig) RH_KABI_ALIGN_WARNING); \
++ _Static_assert(__alignof__(struct{_new;}) <= __alignof__(struct{_orig;}), \
++ __FILE__ ":" __stringify(__LINE__) ": " __stringify(_orig) " is not aligned the same as " __stringify(_new) RH_KABI_ALIGN_WARNING); \
++ }
++#else
++# define __RH_KABI_CHECK_SIZE_ALIGN(_orig, _new)
++#endif
++
++# define _RH_KABI_DEPRECATE(_type, _orig) _type rh_reserved_##_orig
++# define _RH_KABI_DEPRECATE_FN(_type, _orig, _args...) \
++ _type (* rh_reserved_##_orig)(_args)
++# define _RH_KABI_REPLACE(_orig, _new) \
++ union { \
++ _new; \
++ struct { \
++ _orig; \
++ } __UNIQUE_ID(rh_kabi_hide); \
++ __RH_KABI_CHECK_SIZE_ALIGN(_orig, _new); \
++ }
++# define _RH_KABI_REPLACE_UNSAFE(_orig, _new) _new
++
++#endif /* __GENKSYMS__ */
++
++/* semicolon added wrappers for the RH_KABI_REPLACE macros */
++# define RH_KABI_DEPRECATE(_type, _orig) _RH_KABI_DEPRECATE(_type, _orig);
++# define RH_KABI_DEPRECATE_FN(_type, _orig, _args...) \
++ _RH_KABI_DEPRECATE_FN(_type, _orig, _args);
++# define RH_KABI_REPLACE(_orig, _new) _RH_KABI_REPLACE(_orig, _new);
++# define RH_KABI_REPLACE_UNSAFE(_orig, _new) _RH_KABI_REPLACE_UNSAFE(_orig, _new);
++/*
++ * Macro for breaking up a random element into two smaller chunks using an
++ * anonymous struct inside an anonymous union.
++ */
++# define RH_KABI_REPLACE2(orig, _new1, _new2) RH_KABI_REPLACE(orig, struct{ _new1; _new2;})
++
++# define RH_KABI_RESERVE(n) _RH_KABI_RESERVE(n);
++/*
++ * Simple wrappers to replace standard Red Hat reserved elements.
++ */
++# define RH_KABI_USE(n, _new) RH_KABI_REPLACE(_RH_KABI_RESERVE(n), _new)
++/*
++ * Macros for breaking up a reserved element into two smaller chunks using
++ * an anonymous struct inside an anonymous union.
++ */
++# define RH_KABI_USE2(n, _new1, _new2) RH_KABI_REPLACE(_RH_KABI_RESERVE(n), struct{ _new1; _new2; })
++
++/*
++ * We tried to standardize on Red Hat reserved names. These wrappers
++ * leverage those common names making it easier to read and find in the
++ * code.
++ */
++# define _RH_KABI_RESERVE(n) unsigned long rh_reserved##n
++
++#endif /* _LINUX_RH_KABI_H */
+--
+2.26.2
+
diff --git a/0001-kdump-add-support-for-crashkernel-auto.patch b/0001-kdump-add-support-for-crashkernel-auto.patch
new file mode 100644
index 000000000..83eb38e6d
--- /dev/null
+++ b/0001-kdump-add-support-for-crashkernel-auto.patch
@@ -0,0 +1,189 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Cline <jcline@redhat.com>
+Date: Tue, 23 Jul 2019 15:24:30 +0000
+Subject: [PATCH] kdump: add support for crashkernel=auto
+
+Rebased for v5.3-rc1 because the documentation has moved.
+
+ Message-id: <20180604013831.574215750@redhat.com>
+ Patchwork-id: 8166
+ O-Subject: [kernel team] [PATCH RHEL8.0 V2 2/2] kdump: add support for crashkernel=auto
+ Bugzilla: 1507353
+ RH-Acked-by: Don Zickus <dzickus@redhat.com>
+ RH-Acked-by: Baoquan He <bhe@redhat.com>
+ RH-Acked-by: Pingfan Liu <piliu@redhat.com>
+
+ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
+ Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16534135
+ Tested: ppc64le, x86_64 with several memory sizes.
+ kdump qe tested 160M on various x86 machines in lab.
+
+ We continue to provide crashkernel=auto like we did in RHEL6
+ and RHEL7, this will simplify the kdump deployment for common
+ use cases that kdump just works with the auto reserved values.
+ But this is still a best effort estimation, we can not know the
+ exact memory requirement because it depends on a lot of different
+ factors.
+
+ The implementation of crashkernel=auto is simplified as a wrapper
+ to use below kernel cmdline:
+ x86_64: crashkernel=1G-64G:160M,64G-1T:256M,1T-:512M
+ s390x: crashkernel=4G-64G:160M,64G-1T:256M,1T-:512M
+ arm64: crashkernel=2G-:512M
+ ppc64: crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G
+
+ The difference between this way and the old implementation in
+ RHEL6/7 is we do not scale the crash reserved memory size according
+ to system memory size anymore.
+
+ Latest effort to move upstream is below thread:
+ https://lkml.org/lkml/2018/5/20/262
+ But unfortunately it is still unlikely to be accepted, thus we
+ will still use a RHEL only patch in RHEL8.
+
+ Copied old patch description about the history reason see below:
+ '''
+ Non-upstream explanations:
+ Besides "crashkenrel=X@Y" format, upstream also has advanced
+ "crashkernel=range1:size1[,range2:size2,...][@offset]", and
+ "crashkernel=X,high{low}" formats, but they need more careful
+ manual configuration, and have different values for different
+ architectures.
+
+ Most of the distributions use the standard "crashkernel=X@Y"
+ upstream format, and use crashkernel range format for advanced
+ scenarios, heavily relying on the user's involvement.
+
+ While "crashkernel=auto" is redhat's special feature, it exists
+ and has been used as the default boot cmdline since 2008 rhel6.
+ It does not require users to figure out how many crash memory
+ size for their systems, also has been proved to be able to work
+ pretty well for common scenarios.
+
+ "crashkernel=auto" was tested/based on rhel-related products, as
+ we have stable kernel configurations which means more or less
+ stable memory consumption. In 2014 we tried to post them again to
+ upstream but NACKed by people because they think it's not general
+ and unnecessary, users can specify their own values or do that by
+ scripts. However our customers insist on having it added to rhel.
+
+ Also see one previous discussion related to this backport to Pegas:
+ On 10/17/2016 at 10:15 PM, Don Zickus wrote:
+ > On Fri, Oct 14, 2016 at 10:57:41AM +0800, Dave Young wrote:
+ >> Don, agree with you we should evaluate them instead of just inherit
+ >> them blindly. Below is what I think about kdump auto memory:
+ >> There are two issues for crashkernel=auto in upstream:
+ >> 1) It will be seen as a policy which should not go to kernel
+ >> 2) It is hard to get a good number for the crash reserved size,
+ >> considering various different kernel config options one can setups.
+ >> In RHEL we are easier because our supported Kconfig is limited.
+ >> I digged the upstream mail archive, but I'm not sure I got all the
+ >> information, at least Michael Ellerman was objecting the series for
+ >> 1).
+ > Yes, I know. Vivek and I have argued about this for years. :-)
+ >
+ > I had hoped all the changes internally to the makedumpfile would allow
+ > the memory configuration to stabilize at a number like 192M or 128M and
+ > only in the rare cases extend beyond that.
+ >
+ > So I always treated that as a temporary hack until things were better.
+ > With the hope of every new RHEL release we get smarter and better. :-)
+ > Ideally it would be great if we could get the number down to 64M for most
+ > cases and just turn it on in Fedora. Maybe someday.... ;-)
+ >
+ > We can have this conversation when the patch gets reposted/refreshed
+ > for upstream on rhkl?
+ >
+ > Cheers,
+ > Don
+
+ We had proposed to drop the historic crashkernel=auto code and move
+ to use crashkernel=range:size format and pass them in anaconda.
+
+ The initial reason is crashkernel=range:size works just fine because
+ we do not need complex algorithm to scale crashkernel reserved size
+ any more. The old linear scaling is mainly for old makedumpfile
+ requirements, now it is not necessary.
+
+ But With the new approach, backward compatibility is potentially at risk.
+ For e.g. let's consider the following cases:
+ 1) When we upgrade from an older distribution like rhel-alt-7.4(which
+ uses crashkernel=auto) to rhel-alt-7.5 (which uses the crashkernel=xY
+ format)
+ In this case we can use anaconda scripts for checking
+ 'crashkernel=auto' in kernel spec and update to the new
+ 'crashkernel=range:size' format.
+ 2) When we upgrade from rhel-alt-7.5(which uses crashkernel=xY format)
+ to rhel-alt-7.6(which uses crashkernel=xY format), but the x and/or Y
+ values are changed in rhel-alt-7.6.
+ For example from crashkernel=2G-:160M to crashkernel=2G-:192M, then we have
+ no way to determine if the X and/or Y values were distribution
+ provided or user specified ones.
+ Since it is recommended to give precedence to user-specified values,
+ so we cannot do an upgrade in such a case."
+
+ Thus turn back to resolve it in kernel, and add a simpler version
+ which just hacks to use the range:size style in code, and make
+ rhel-only code easily to maintain.
+ '''
+
+ Signed-off-by: Dave Young <dyoung@redhat.com>
+ Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ Documentation/admin-guide/kdump/kdump.rst | 11 +++++++++++
+ kernel/crash_core.c | 14 ++++++++++++++
+ 2 files changed, 25 insertions(+)
+
+diff --git a/Documentation/admin-guide/kdump/kdump.rst b/Documentation/admin-guide/kdump/kdump.rst
+index ac7e131d2935..3b3bf30e537d 100644
+--- a/Documentation/admin-guide/kdump/kdump.rst
++++ b/Documentation/admin-guide/kdump/kdump.rst
+@@ -285,6 +285,17 @@ This would mean:
+ 2) if the RAM size is between 512M and 2G (exclusive), then reserve 64M
+ 3) if the RAM size is larger than 2G, then reserve 128M
+
++Or you can use crashkernel=auto if you have enough memory. The threshold
++is 2G on x86_64, arm64, ppc64 and ppc64le. The threshold is 4G for s390x.
++If your system memory is less than the threshold crashkernel=auto will not
++reserve memory.
++
++The automatically reserved memory size varies based on architecture.
++The size changes according to system memory size like below:
++ x86_64: 1G-64G:160M,64G-1T:256M,1T-:512M
++ s390x: 4G-64G:160M,64G-1T:256M,1T-:512M
++ arm64: 2G-:512M
++ ppc64: 2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G
+
+
+ Boot into System Kernel
+diff --git a/kernel/crash_core.c b/kernel/crash_core.c
+index d631d22089ba..c252221b2f4b 100644
+--- a/kernel/crash_core.c
++++ b/kernel/crash_core.c
+@@ -258,6 +258,20 @@ static int __init __parse_crashkernel(char *cmdline,
+ if (suffix)
+ return parse_crashkernel_suffix(ck_cmdline, crash_size,
+ suffix);
++
++ if (strncmp(ck_cmdline, "auto", 4) == 0) {
++#ifdef CONFIG_X86_64
++ ck_cmdline = "1G-64G:160M,64G-1T:256M,1T-:512M";
++#elif defined(CONFIG_S390)
++ ck_cmdline = "4G-64G:160M,64G-1T:256M,1T-:512M";
++#elif defined(CONFIG_ARM64)
++ ck_cmdline = "2G-:512M";
++#elif defined(CONFIG_PPC64)
++ ck_cmdline = "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G";
++#endif
++ pr_info("Using crashkernel=auto, the size choosed is a best effort estimation.\n");
++ }
++
+ /*
+ * if the commandline contains a ':', then that's the extended
+ * syntax -- if not, it must be the classic syntax
+--
+2.26.2
+
diff --git a/0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch b/0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch
new file mode 100644
index 000000000..5444af2e6
--- /dev/null
+++ b/0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dave Young <dyoung@redhat.com>
+Date: Tue, 12 Jun 2018 00:54:22 -0400
+Subject: [PATCH] kdump: fix a grammar issue in a kernel message
+
+Message-id: <20180612005422.GA2568@dhcp-128-65.nay.redhat.com>
+Patchwork-id: 8201
+O-Subject: [kernel team] [RHEL8.0 PATCH V2] kdump: fix a grammar issue in a kernel message
+Bugzilla: 1507353
+RH-Acked-by: Myron Stowe <mstowe@redhat.com>
+RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
+RH-Acked-by: Jiri Benc <jbenc@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
+Upstream Status: RHEL-only as crashkernel=auto is not accepted in upstream
+Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16661950
+Test: verified on a kvm guest
+
+s/choosed/chosen
+
+Upstream Status: RHEL only
+Signed-off-by: Dave Young <dyoung@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ kernel/crash_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/crash_core.c b/kernel/crash_core.c
+index c252221b2f4b..df551fc9034c 100644
+--- a/kernel/crash_core.c
++++ b/kernel/crash_core.c
+@@ -269,7 +269,7 @@ static int __init __parse_crashkernel(char *cmdline,
+ #elif defined(CONFIG_PPC64)
+ ck_cmdline = "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G";
+ #endif
+- pr_info("Using crashkernel=auto, the size choosed is a best effort estimation.\n");
++ pr_info("Using crashkernel=auto, the size chosen is a best effort estimation.\n");
+ }
+
+ /*
+--
+2.26.2
+
diff --git a/0001-kdump-round-up-the-total-memory-size-to-128M-for-cra.patch b/0001-kdump-round-up-the-total-memory-size-to-128M-for-cra.patch
new file mode 100644
index 000000000..26576a04e
--- /dev/null
+++ b/0001-kdump-round-up-the-total-memory-size-to-128M-for-cra.patch
@@ -0,0 +1,93 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dave Young <dyoung@redhat.com>
+Date: Mon, 4 Jun 2018 01:38:25 -0400
+Subject: [PATCH] kdump: round up the total memory size to 128M for crashkernel
+ reservation
+
+Message-id: <20180604013831.523644967@redhat.com>
+Patchwork-id: 8165
+O-Subject: [kernel team] [PATCH RHEL8.0 V2 1/2] kdump: round up the total memory size to 128M for crashkernel reservation
+Bugzilla: 1507353
+RH-Acked-by: Don Zickus <dzickus@redhat.com>
+RH-Acked-by: Baoquan He <bhe@redhat.com>
+RH-Acked-by: Pingfan Liu <piliu@redhat.com>
+
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
+Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16534135
+Tested: ppc64le, x86_64 with several memory sizes.
+
+The total memory size we get in kernel is usually slightly less than 2G with
+2G memory module machine. The main reason is bios/firmware reserve some area
+it will not export all memory as usable to Linux.
+
+2G memory X86 kvm guest test result of the total_mem value:
+UEFI boot with ovmf: 0x7ef10000
+Legacy boot kvm guest: 0x7ff7cc00
+This is also a problem on arm64 UEFI booted system according to my test.
+
+Thus for example crashkernel=1G-2G:128M, if we have a 1G memory
+machine, we get total size 1023M from firmware then it will not fall
+into 1G-2G thus no memory reserved. User will never know that, it is
+hard to let user to know the exact total value we get in kernel
+
+An option is to use dmi/smbios to get physical memory size, but it's not
+reliable as well. According to Prarit hardware vendors sometimes screw this up.
+Thus round up total size to 128M to workaround this problem.
+
+Posted below patch in upstream, but no response yet:
+http://lists.infradead.org/pipermail/kexec/2018-April/020568.html
+
+Upstream Status: RHEL only
+Signed-off-by: Dave Young <dyoung@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ kernel/crash_core.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/crash_core.c b/kernel/crash_core.c
+index 9f1557b98468..d631d22089ba 100644
+--- a/kernel/crash_core.c
++++ b/kernel/crash_core.c
+@@ -7,6 +7,7 @@
+ #include <linux/crash_core.h>
+ #include <linux/utsname.h>
+ #include <linux/vmalloc.h>
++#include <linux/sizes.h>
+
+ #include <asm/page.h>
+ #include <asm/sections.h>
+@@ -39,6 +40,15 @@ static int __init parse_crashkernel_mem(char *cmdline,
+ unsigned long long *crash_base)
+ {
+ char *cur = cmdline, *tmp;
++ unsigned long long total_mem = system_ram;
++
++ /*
++ * Firmware sometimes reserves some memory regions for it's own use.
++ * so we get less than actual system memory size.
++ * Workaround this by round up the total size to 128M which is
++ * enough for most test cases.
++ */
++ total_mem = roundup(total_mem, SZ_128M);
+
+ /* for each entry of the comma-separated list */
+ do {
+@@ -83,13 +93,13 @@ static int __init parse_crashkernel_mem(char *cmdline,
+ return -EINVAL;
+ }
+ cur = tmp;
+- if (size >= system_ram) {
++ if (size >= total_mem) {
+ pr_warn("crashkernel: invalid size\n");
+ return -EINVAL;
+ }
+
+ /* match ? */
+- if (system_ram >= start && system_ram < end) {
++ if (total_mem >= start && total_mem < end) {
+ *crash_size = size;
+ break;
+ }
+--
+2.26.2
+
diff --git a/0001-kms-Fix-regression-by-audio-component-transition.patch b/0001-kms-Fix-regression-by-audio-component-transition.patch
new file mode 100644
index 000000000..198e0be9e
--- /dev/null
+++ b/0001-kms-Fix-regression-by-audio-component-transition.patch
@@ -0,0 +1,82 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 16 Apr 2020 09:54:28 +0200
+Subject: [PATCH] kms: Fix regression by audio component transition
+
+Since the commit 742db30c4ee6 ("drm/nouveau: Add HD-audio component
+notifier support"), the nouveau driver notifies and pokes the HD-audio
+HPD and ELD via audio component, but this seems broken. The culprit
+is the naive assumption that crtc->index corresponds to the HDA pin.
+Actually this rather corresponds to the MST dev_id (alias "pipe" in
+the audio component framework) while the actual port number is given
+from the output ior id number.
+
+This patch corrects the assignment of port and dev_id arguments in the
+audio component ops to recover from the HDMI/DP audio regression.
+
+Fixes: 742db30c4ee6 ("drm/nouveau: Add HD-audio component notifier support")
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207223
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/disp.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index 6be9df1820c5..2625ed84fc44 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -482,15 +482,16 @@ nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
+ * audio component binding for ELD notification
+ */
+ static void
+-nv50_audio_component_eld_notify(struct drm_audio_component *acomp, int port)
++nv50_audio_component_eld_notify(struct drm_audio_component *acomp, int port,
++ int dev_id)
+ {
+ if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
+ acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
+- port, -1);
++ port, dev_id);
+ }
+
+ static int
+-nv50_audio_component_get_eld(struct device *kdev, int port, int pipe,
++nv50_audio_component_get_eld(struct device *kdev, int port, int dev_id,
+ bool *enabled, unsigned char *buf, int max_bytes)
+ {
+ struct drm_device *drm_dev = dev_get_drvdata(kdev);
+@@ -506,7 +507,8 @@ nv50_audio_component_get_eld(struct device *kdev, int port, int pipe,
+ nv_encoder = nouveau_encoder(encoder);
+ nv_connector = nouveau_encoder_connector_get(nv_encoder);
+ nv_crtc = nouveau_crtc(encoder->crtc);
+- if (!nv_connector || !nv_crtc || nv_crtc->index != port)
++ if (!nv_connector || !nv_crtc || nv_encoder->or != port ||
++ nv_crtc->index != dev_id)
+ continue;
+ *enabled = drm_detect_monitor_audio(nv_connector->edid);
+ if (*enabled) {
+@@ -600,7 +602,8 @@ nv50_audio_disable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc)
+
+ nvif_mthd(&disp->disp->object, 0, &args, sizeof(args));
+
+- nv50_audio_component_eld_notify(drm->audio.component, nv_crtc->index);
++ nv50_audio_component_eld_notify(drm->audio.component, nv_encoder->or,
++ nv_crtc->index);
+ }
+
+ static void
+@@ -634,7 +637,8 @@ nv50_audio_enable(struct drm_encoder *encoder, struct drm_display_mode *mode)
+ nvif_mthd(&disp->disp->object, 0, &args,
+ sizeof(args.base) + drm_eld_size(args.data));
+
+- nv50_audio_component_eld_notify(drm->audio.component, nv_crtc->index);
++ nv50_audio_component_eld_notify(drm->audio.component, nv_encoder->or,
++ nv_crtc->index);
+ }
+
+ /******************************************************************************
+--
+2.26.2
+
diff --git a/0001-kms-gv100-Add-support-for-interlaced-modes.patch b/0001-kms-gv100-Add-support-for-interlaced-modes.patch
new file mode 100644
index 000000000..c50c826b8
--- /dev/null
+++ b/0001-kms-gv100-Add-support-for-interlaced-modes.patch
@@ -0,0 +1,64 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Mon, 11 May 2020 18:41:25 -0400
+Subject: [PATCH] kms/gv100-: Add support for interlaced modes
+
+We advertise being able to set interlaced modes, so let's actually make
+sure to do that. Otherwise, we'll end up hanging the display engine due
+to trying to set a mode with timings adjusted for interlacing without
+telling the hardware it's actually an interlaced mode.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/headc37d.c | 5 +++--
+ drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
+index 00011ce109a6..4a9a32b89f74 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/headc37d.c
+@@ -168,14 +168,15 @@ headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
+ struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+ struct nv50_head_mode *m = &asyh->mode;
+ u32 *push;
+- if ((push = evo_wait(core, 12))) {
++ if ((push = evo_wait(core, 13))) {
+ evo_mthd(push, 0x2064 + (head->base.index * 0x400), 5);
+ evo_data(push, (m->v.active << 16) | m->h.active );
+ evo_data(push, (m->v.synce << 16) | m->h.synce );
+ evo_data(push, (m->v.blanke << 16) | m->h.blanke );
+ evo_data(push, (m->v.blanks << 16) | m->h.blanks );
+ evo_data(push, (m->v.blank2e << 16) | m->v.blank2s);
+- evo_mthd(push, 0x200c + (head->base.index * 0x400), 1);
++ evo_mthd(push, 0x2008 + (head->base.index * 0x400), 2);
++ evo_data(push, m->interlace);
+ evo_data(push, m->clock * 1000);
+ evo_mthd(push, 0x2028 + (head->base.index * 0x400), 1);
+ evo_data(push, m->clock * 1000);
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
+index 938d910a1b1e..859131a8bc3c 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
+@@ -173,14 +173,15 @@ headc57d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
+ struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
+ struct nv50_head_mode *m = &asyh->mode;
+ u32 *push;
+- if ((push = evo_wait(core, 12))) {
++ if ((push = evo_wait(core, 13))) {
+ evo_mthd(push, 0x2064 + (head->base.index * 0x400), 5);
+ evo_data(push, (m->v.active << 16) | m->h.active );
+ evo_data(push, (m->v.synce << 16) | m->h.synce );
+ evo_data(push, (m->v.blanke << 16) | m->h.blanke );
+ evo_data(push, (m->v.blanks << 16) | m->h.blanks );
+ evo_data(push, (m->v.blank2e << 16) | m->v.blank2s);
+- evo_mthd(push, 0x200c + (head->base.index * 0x400), 1);
++ evo_mthd(push, 0x2008 + (head->base.index * 0x400), 2);
++ evo_data(push, m->interlace);
+ evo_data(push, m->clock * 1000);
+ evo_mthd(push, 0x2028 + (head->base.index * 0x400), 1);
+ evo_data(push, m->clock * 1000);
+--
+2.26.2
+
diff --git a/0001-kms-nv50-Initialize-core-channel-in-nouveau_display_.patch b/0001-kms-nv50-Initialize-core-channel-in-nouveau_display_.patch
new file mode 100644
index 000000000..b590bb06c
--- /dev/null
+++ b/0001-kms-nv50-Initialize-core-channel-in-nouveau_display_.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Mon, 11 May 2020 18:41:23 -0400
+Subject: [PATCH] kms/nv50-: Initialize core channel in
+ nouveau_display_create()
+
+We'll need the core channel initialized and ready by the time that we
+start creating modesetting objects, so that we can call the
+NV507D_GET_CAPABILITIES method to make the hardware expose it's
+modesetting capabilities for later probing.
+
+So, when loading the driver prepare the core channel from within
+nouveau_display_create(). Everywhere else, we initialize the core
+channel during resume.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/disp.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index 2625ed84fc44..2afd56b9887d 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -2373,7 +2373,8 @@ nv50_display_init(struct drm_device *dev, bool resume, bool runtime)
+ struct drm_encoder *encoder;
+ struct drm_plane *plane;
+
+- core->func->init(core);
++ if (resume || runtime)
++ core->func->init(core);
+
+ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
+ if (encoder->encoder_type != DRM_MODE_ENCODER_DPMST) {
+@@ -2460,6 +2461,8 @@ nv50_display_create(struct drm_device *dev)
+ if (ret)
+ goto out;
+
++ disp->core->func->init(disp->core);
++
+ /* create crtc objects to represent the hw heads */
+ if (disp->disp->object.oclass >= GV100_DISP)
+ crtcs = nvif_rd32(&device->object, 0x610060) & 0xff;
+--
+2.26.2
+
diff --git a/0001-kms-nv50-Move-8BPC-limit-for-MST-into-nv50_mstc_get_.patch b/0001-kms-nv50-Move-8BPC-limit-for-MST-into-nv50_mstc_get_.patch
new file mode 100644
index 000000000..0a6a4cfa8
--- /dev/null
+++ b/0001-kms-nv50-Move-8BPC-limit-for-MST-into-nv50_mstc_get_.patch
@@ -0,0 +1,65 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Mon, 11 May 2020 18:41:26 -0400
+Subject: [PATCH] kms/nv50-: Move 8BPC limit for MST into nv50_mstc_get_modes()
+
+This just limits the BPC for MST connectors to a maximum of 8 from
+nv50_mstc_get_modes(), instead of doing so during
+nv50_msto_atomic_check(). This doesn't introduce any functional changes
+yet (other then userspace now lying about the max bpc, but we can't
+support that yet anyway so meh). But, we'll need this in a moment so
+that we can share mode validation between SST and MST which will fix
+some real world issues.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/disp.c | 25 ++++++++++++++-----------
+ 1 file changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index 1db4f20b8697..e92e7bf49780 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -908,15 +908,9 @@ nv50_msto_atomic_check(struct drm_encoder *encoder,
+ if (!state->duplicated) {
+ const int clock = crtc_state->adjusted_mode.clock;
+
+- /*
+- * XXX: Since we don't use HDR in userspace quite yet, limit
+- * the bpc to 8 to save bandwidth on the topology. In the
+- * future, we'll want to properly fix this by dynamically
+- * selecting the highest possible bpc that would fit in the
+- * topology
+- */
+- asyh->or.bpc = min(connector->display_info.bpc, 8U);
+- asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3, false);
++ asyh->or.bpc = connector->display_info.bpc;
++ asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3,
++ false);
+ }
+
+ slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr, mstc->port,
+@@ -1076,8 +1070,17 @@ nv50_mstc_get_modes(struct drm_connector *connector)
+ if (mstc->edid)
+ ret = drm_add_edid_modes(&mstc->connector, mstc->edid);
+
+- if (!mstc->connector.display_info.bpc)
+- mstc->connector.display_info.bpc = 8;
++ /*
++ * XXX: Since we don't use HDR in userspace quite yet, limit the bpc
++ * to 8 to save bandwidth on the topology. In the future, we'll want
++ * to properly fix this by dynamically selecting the highest possible
++ * bpc that would fit in the topology
++ */
++ if (connector->display_info.bpc)
++ connector->display_info.bpc =
++ clamp(connector->display_info.bpc, 6U, 8U);
++ else
++ connector->display_info.bpc = 8;
+
+ if (mstc->native)
+ drm_mode_destroy(mstc->connector.dev, mstc->native);
+--
+2.26.2
+
diff --git a/0001-kms-nv50-Probe-SOR-and-PIOR-caps-for-DP-interlacing-.patch b/0001-kms-nv50-Probe-SOR-and-PIOR-caps-for-DP-interlacing-.patch
new file mode 100644
index 000000000..e74501bef
--- /dev/null
+++ b/0001-kms-nv50-Probe-SOR-and-PIOR-caps-for-DP-interlacing-.patch
@@ -0,0 +1,439 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Mon, 11 May 2020 18:41:24 -0400
+Subject: [PATCH] kms/nv50-: Probe SOR and PIOR caps for DP interlacing support
+
+Right now, we make the mistake of allowing interlacing on all
+connectors. Nvidia hardware does not always support interlacing with DP
+though, so we need to make sure that we don't allow interlaced modes to
+be set in such situations as otherwise we'll end up accidentally hanging
+the display HW.
+
+This fixes some hangs with Turing, which would be caused by attempting
+to set an interlaced mode on hardware that doesn't support it. This
+patch likely fixes other hardware hanging in the same way as well.
+
+Note that we say we probe PIOR caps, but they don't actually have any
+interlacing caps. So, the get_caps() function for PIORs just sets
+interlacing support to true.
+
+Changes since v1:
+* Actually probe caps correctly this time, both on EVO and NVDisplay.
+Changes since v2:
+* Fix probing for < GF119
+* Use vfunc table, in prep for adding more caps in the future.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/core.h | 7 ++++++
+ drivers/gpu/drm/nouveau/dispnv50/core507d.c | 15 ++++++++++++
+ drivers/gpu/drm/nouveau/dispnv50/core827d.c | 1 +
+ drivers/gpu/drm/nouveau/dispnv50/core907d.c | 1 +
+ drivers/gpu/drm/nouveau/dispnv50/core917d.c | 1 +
+ drivers/gpu/drm/nouveau/dispnv50/corec37d.c | 26 +++++++++++++++++++++
+ drivers/gpu/drm/nouveau/dispnv50/corec57d.c | 1 +
+ drivers/gpu/drm/nouveau/dispnv50/disp.c | 19 +++++++++++++--
+ drivers/gpu/drm/nouveau/dispnv50/disp.h | 1 +
+ drivers/gpu/drm/nouveau/dispnv50/pior507d.c | 8 +++++++
+ drivers/gpu/drm/nouveau/dispnv50/sor507d.c | 7 ++++++
+ drivers/gpu/drm/nouveau/dispnv50/sor907d.c | 11 +++++++++
+ drivers/gpu/drm/nouveau/dispnv50/sorc37d.c | 9 +++++++
+ drivers/gpu/drm/nouveau/nouveau_connector.c | 10 +++++++-
+ drivers/gpu/drm/nouveau/nouveau_encoder.h | 4 ++++
+ 15 files changed, 118 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/core.h b/drivers/gpu/drm/nouveau/dispnv50/core.h
+index ff94f3f6f264..99157dc94d23 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/core.h
++++ b/drivers/gpu/drm/nouveau/dispnv50/core.h
+@@ -2,6 +2,7 @@
+ #define __NV50_KMS_CORE_H__
+ #include "disp.h"
+ #include "atom.h"
++#include <nouveau_encoder.h>
+
+ struct nv50_core {
+ const struct nv50_core_func *func;
+@@ -15,6 +16,7 @@ void nv50_core_del(struct nv50_core **);
+ struct nv50_core_func {
+ void (*init)(struct nv50_core *);
+ void (*ntfy_init)(struct nouveau_bo *, u32 offset);
++ int (*caps_init)(struct nouveau_drm *, struct nv50_disp *);
+ int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
+ struct nvif_device *);
+ void (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
+@@ -27,6 +29,9 @@ struct nv50_core_func {
+ const struct nv50_outp_func {
+ void (*ctrl)(struct nv50_core *, int or, u32 ctrl,
+ struct nv50_head_atom *);
++ /* XXX: Only used by SORs and PIORs for now */
++ void (*get_caps)(struct nv50_disp *,
++ struct nouveau_encoder *, int or);
+ } *dac, *pior, *sor;
+ };
+
+@@ -35,6 +40,7 @@ int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32,
+ struct nv50_core **);
+ void core507d_init(struct nv50_core *);
+ void core507d_ntfy_init(struct nouveau_bo *, u32);
++int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *);
+ int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
+ void core507d_update(struct nv50_core *, u32 *, bool);
+
+@@ -51,6 +57,7 @@ extern const struct nv50_outp_func sor907d;
+ int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
+
+ int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
++int corec37d_caps_init(struct nouveau_drm *, struct nv50_disp *);
+ int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
+ void corec37d_update(struct nv50_core *, u32 *, bool);
+ void corec37d_wndw_owner(struct nv50_core *);
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/core507d.c b/drivers/gpu/drm/nouveau/dispnv50/core507d.c
+index c5152c39c684..e341f572c269 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/core507d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/core507d.c
+@@ -62,6 +62,20 @@ core507d_ntfy_init(struct nouveau_bo *bo, u32 offset)
+ nouveau_bo_wr32(bo, offset / 4, 0x00000000);
+ }
+
++int
++core507d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
++{
++ u32 *push = evo_wait(&disp->core->chan, 2);
++
++ if (push) {
++ evo_mthd(push, 0x008c, 1);
++ evo_data(push, 0x0);
++ evo_kick(push, &disp->core->chan);
++ }
++
++ return 0;
++}
++
+ void
+ core507d_init(struct nv50_core *core)
+ {
+@@ -77,6 +91,7 @@ static const struct nv50_core_func
+ core507d = {
+ .init = core507d_init,
+ .ntfy_init = core507d_ntfy_init,
++ .caps_init = core507d_caps_init,
+ .ntfy_wait_done = core507d_ntfy_wait_done,
+ .update = core507d_update,
+ .head = &head507d,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/core827d.c b/drivers/gpu/drm/nouveau/dispnv50/core827d.c
+index 6123a068f836..2e0c1c536afe 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/core827d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/core827d.c
+@@ -26,6 +26,7 @@ static const struct nv50_core_func
+ core827d = {
+ .init = core507d_init,
+ .ntfy_init = core507d_ntfy_init,
++ .caps_init = core507d_caps_init,
+ .ntfy_wait_done = core507d_ntfy_wait_done,
+ .update = core507d_update,
+ .head = &head827d,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/core907d.c b/drivers/gpu/drm/nouveau/dispnv50/core907d.c
+index ef822f813435..271629832629 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/core907d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/core907d.c
+@@ -26,6 +26,7 @@ static const struct nv50_core_func
+ core907d = {
+ .init = core507d_init,
+ .ntfy_init = core507d_ntfy_init,
++ .caps_init = core507d_caps_init,
+ .ntfy_wait_done = core507d_ntfy_wait_done,
+ .update = core507d_update,
+ .head = &head907d,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/core917d.c b/drivers/gpu/drm/nouveau/dispnv50/core917d.c
+index 392338df5bfd..5cc072d4c30f 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/core917d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/core917d.c
+@@ -26,6 +26,7 @@ static const struct nv50_core_func
+ core917d = {
+ .init = core507d_init,
+ .ntfy_init = core507d_ntfy_init,
++ .caps_init = core507d_caps_init,
+ .ntfy_wait_done = core507d_ntfy_wait_done,
+ .update = core507d_update,
+ .head = &head917d,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
+index c03cb987856b..e0c8811fb8e4 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/corec37d.c
+@@ -22,6 +22,7 @@
+ #include "core.h"
+ #include "head.h"
+
++#include <nvif/class.h>
+ #include <nouveau_bo.h>
+
+ #include <nvif/timer.h>
+@@ -87,6 +88,30 @@ corec37d_ntfy_init(struct nouveau_bo *bo, u32 offset)
+ nouveau_bo_wr32(bo, offset / 4 + 3, 0x00000000);
+ }
+
++int corec37d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
++{
++ int ret;
++
++ ret = nvif_object_init(&disp->disp->object, 0, GV100_DISP_CAPS,
++ NULL, 0, &disp->caps);
++ if (ret) {
++ NV_ERROR(drm,
++ "Failed to init notifier caps region: %d\n",
++ ret);
++ return ret;
++ }
++
++ ret = nvif_object_map(&disp->caps, NULL, 0);
++ if (ret) {
++ NV_ERROR(drm,
++ "Failed to map notifier caps region: %d\n",
++ ret);
++ return ret;
++ }
++
++ return 0;
++}
++
+ static void
+ corec37d_init(struct nv50_core *core)
+ {
+@@ -111,6 +136,7 @@ static const struct nv50_core_func
+ corec37d = {
+ .init = corec37d_init,
+ .ntfy_init = corec37d_ntfy_init,
++ .caps_init = corec37d_caps_init,
+ .ntfy_wait_done = corec37d_ntfy_wait_done,
+ .update = corec37d_update,
+ .wndw.owner = corec37d_wndw_owner,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
+index 147adcd60937..10ba9e9e4ae6 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
+@@ -46,6 +46,7 @@ static const struct nv50_core_func
+ corec57d = {
+ .init = corec57d_init,
+ .ntfy_init = corec37d_ntfy_init,
++ .caps_init = corec37d_caps_init,
+ .ntfy_wait_done = corec37d_ntfy_wait_done,
+ .update = corec37d_update,
+ .wndw.owner = corec37d_wndw_owner,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index 2afd56b9887d..1db4f20b8697 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -1663,6 +1663,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
+ struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
+ struct nouveau_encoder *nv_encoder;
+ struct drm_encoder *encoder;
++ struct nv50_disp *disp = nv50_disp(connector->dev);
+ int type, ret;
+
+ switch (dcbe->type) {
+@@ -1689,10 +1690,12 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
+
+ drm_connector_attach_encoder(connector, encoder);
+
++ disp->core->func->sor->get_caps(disp, nv_encoder, ffs(dcbe->or) - 1);
++
+ if (dcbe->type == DCB_OUTPUT_DP) {
+- struct nv50_disp *disp = nv50_disp(encoder->dev);
+ struct nvkm_i2c_aux *aux =
+ nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
++
+ if (aux) {
+ if (disp->disp->object.oclass < GF110_DISP) {
+ /* HW has no support for address-only
+@@ -1805,7 +1808,9 @@ nv50_pior_func = {
+ static int
+ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
+ {
+- struct nouveau_drm *drm = nouveau_drm(connector->dev);
++ struct drm_device *dev = connector->dev;
++ struct nouveau_drm *drm = nouveau_drm(dev);
++ struct nv50_disp *disp = nv50_disp(dev);
+ struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
+ struct nvkm_i2c_bus *bus = NULL;
+ struct nvkm_i2c_aux *aux = NULL;
+@@ -1844,6 +1849,9 @@ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
+ drm_encoder_helper_add(encoder, &nv50_pior_help);
+
+ drm_connector_attach_encoder(connector, encoder);
++
++ disp->core->func->pior->get_caps(disp, nv_encoder, ffs(dcbe->or) - 1);
++
+ return 0;
+ }
+
+@@ -2401,6 +2409,8 @@ nv50_display_destroy(struct drm_device *dev)
+
+ nv50_audio_component_fini(nouveau_drm(dev));
+
++ nvif_object_unmap(&disp->caps);
++ nvif_object_fini(&disp->caps);
+ nv50_core_del(&disp->core);
+
+ nouveau_bo_unmap(disp->sync);
+@@ -2462,6 +2472,11 @@ nv50_display_create(struct drm_device *dev)
+ goto out;
+
+ disp->core->func->init(disp->core);
++ if (disp->core->func->caps_init) {
++ ret = disp->core->func->caps_init(drm, disp);
++ if (ret)
++ goto out;
++ }
+
+ /* create crtc objects to represent the hw heads */
+ if (disp->disp->object.oclass >= GV100_DISP)
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
+index d54fe00ac3a3..89c3b38c32a5 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
+@@ -9,6 +9,7 @@ struct nv50_msto;
+ struct nv50_disp {
+ struct nvif_disp *disp;
+ struct nv50_core *core;
++ struct nvif_object caps;
+
+ #define NV50_DISP_SYNC(c, o) ((c) * 0x040 + (o))
+ #define NV50_DISP_CORE_NTFY NV50_DISP_SYNC(0 , 0x00)
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/pior507d.c b/drivers/gpu/drm/nouveau/dispnv50/pior507d.c
+index d2bac6a341dc..45d8ce7d2c28 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/pior507d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/pior507d.c
+@@ -38,7 +38,15 @@ pior507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
+ }
+ }
+
++static void
++pior507d_get_caps(struct nv50_disp *disp, struct nouveau_encoder *outp,
++ int or)
++{
++ outp->caps.dp_interlace = true;
++}
++
+ const struct nv50_outp_func
+ pior507d = {
+ .ctrl = pior507d_ctrl,
++ .get_caps = pior507d_get_caps,
+ };
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/sor507d.c b/drivers/gpu/drm/nouveau/dispnv50/sor507d.c
+index 5222fe6a9b21..9a59fa7da00d 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/sor507d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/sor507d.c
+@@ -38,7 +38,14 @@ sor507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
+ }
+ }
+
++static void
++sor507d_get_caps(struct nv50_disp *core, struct nouveau_encoder *outp, int or)
++{
++ outp->caps.dp_interlace = true;
++}
++
+ const struct nv50_outp_func
+ sor507d = {
+ .ctrl = sor507d_ctrl,
++ .get_caps = sor507d_get_caps,
+ };
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/sor907d.c b/drivers/gpu/drm/nouveau/dispnv50/sor907d.c
+index b0314ec11fb3..9577ccf1c809 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/sor907d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/sor907d.c
+@@ -21,6 +21,7 @@
+ */
+ #include "core.h"
+
++#include <nouveau_bo.h>
+ #include <nvif/class.h>
+
+ static void
+@@ -35,7 +36,17 @@ sor907d_ctrl(struct nv50_core *core, int or, u32 ctrl,
+ }
+ }
+
++static void
++sor907d_get_caps(struct nv50_disp *disp, struct nouveau_encoder *outp, int or)
++{
++ const int off = or * 2;
++ u32 tmp = nouveau_bo_rd32(disp->sync, 0x000014 + off);
++
++ outp->caps.dp_interlace = !!(tmp & 0x04000000);
++}
++
+ const struct nv50_outp_func
+ sor907d = {
+ .ctrl = sor907d_ctrl,
++ .get_caps = sor907d_get_caps,
+ };
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/sorc37d.c b/drivers/gpu/drm/nouveau/dispnv50/sorc37d.c
+index dff059241c5d..c86ca955fdcd 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/sorc37d.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/sorc37d.c
+@@ -33,7 +33,16 @@ sorc37d_ctrl(struct nv50_core *core, int or, u32 ctrl,
+ }
+ }
+
++static void
++sorc37d_get_caps(struct nv50_disp *disp, struct nouveau_encoder *outp, int or)
++{
++ u32 tmp = nvif_rd32(&disp->caps, 0x000144 + (or * 8));
++
++ outp->caps.dp_interlace = !!(tmp & 0x04000000);
++}
++
+ const struct nv50_outp_func
+ sorc37d = {
+ .ctrl = sorc37d_ctrl,
++ .get_caps = sorc37d_get_caps,
+ };
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
+index 9a9a7f5003d3..6dae00da5d7e 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
+@@ -509,7 +509,11 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
+ nv_connector->detected_encoder = nv_encoder;
+
+ if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
+- connector->interlace_allowed = true;
++ if (nv_encoder->dcb->type == DCB_OUTPUT_DP)
++ connector->interlace_allowed =
++ nv_encoder->caps.dp_interlace;
++ else
++ connector->interlace_allowed = true;
+ connector->doublescan_allowed = true;
+ } else
+ if (nv_encoder->dcb->type == DCB_OUTPUT_LVDS ||
+@@ -1060,6 +1064,10 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
+ case DCB_OUTPUT_TV:
+ return get_slave_funcs(encoder)->mode_valid(encoder, mode);
+ case DCB_OUTPUT_DP:
++ if (mode->flags & DRM_MODE_FLAG_INTERLACE &&
++ !nv_encoder->caps.dp_interlace)
++ return MODE_NO_INTERLACE;
++
+ max_clock = nv_encoder->dp.link_nr;
+ max_clock *= nv_encoder->dp.link_bw;
+ clock = clock * (connector->display_info.bpc * 3) / 10;
+diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h
+index 3517f920bf89..3217f587eceb 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_encoder.h
++++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h
+@@ -66,6 +66,10 @@ struct nouveau_encoder {
+ } dp;
+ };
+
++ struct {
++ bool dp_interlace : 1;
++ } caps;
++
+ void (*enc_save)(struct drm_encoder *encoder);
+ void (*enc_restore)(struct drm_encoder *encoder);
+ void (*update)(struct nouveau_encoder *, u8 head,
+--
+2.26.2
+
diff --git a/0001-kms-nv50-Share-DP-SST-mode_valid-handling-with-MST.patch b/0001-kms-nv50-Share-DP-SST-mode_valid-handling-with-MST.patch
new file mode 100644
index 000000000..c14aed7ea
--- /dev/null
+++ b/0001-kms-nv50-Share-DP-SST-mode_valid-handling-with-MST.patch
@@ -0,0 +1,209 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Mon, 11 May 2020 18:41:27 -0400
+Subject: [PATCH] kms/nv50-: Share DP SST mode_valid() handling with MST
+
+Currently, the nv50_mstc_mode_valid() function is happy to take any and
+all modes, even the ones we can't actually support sometimes like
+interlaced modes.
+
+Luckily, the only difference between the mode validation that needs to
+be performed for MST vs. SST is that eventually we'll need to check the
+minimum PBN against the MSTB's full PBN capabilities (remember-we don't
+care about the current bw state here). Otherwise, all of the other code
+can be shared.
+
+So, we move all of the common mode validation in
+nouveau_connector_mode_valid() into a separate helper,
+nv50_dp_mode_valid(), and use that from both nv50_mstc_mode_valid() and
+nouveau_connector_mode_valid(). Note that we allow for returning the
+calculated clock that nv50_dp_mode_valid() came up with, since we'll
+eventually want to use that for PBN calculation in
+nv50_mstc_mode_valid().
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/dispnv50/disp.c | 9 +++-
+ drivers/gpu/drm/nouveau/nouveau_connector.c | 46 ++++++++++++---------
+ drivers/gpu/drm/nouveau/nouveau_connector.h | 5 +++
+ drivers/gpu/drm/nouveau/nouveau_dp.c | 31 ++++++++++++++
+ drivers/gpu/drm/nouveau/nouveau_encoder.h | 4 ++
+ 5 files changed, 75 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index e92e7bf49780..d5d69532f3c5 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -1056,7 +1056,14 @@ static enum drm_mode_status
+ nv50_mstc_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+ {
+- return MODE_OK;
++ struct nv50_mstc *mstc = nv50_mstc(connector);
++ struct nouveau_encoder *outp = mstc->mstm->outp;
++
++ /* TODO: calculate the PBN from the dotclock and validate against the
++ * MSTB's max possible PBN
++ */
++
++ return nv50_dp_mode_valid(connector, outp, mode, NULL);
+ }
+
+ static int
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
+index 6dae00da5d7e..1b383ae0248f 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
+@@ -38,6 +38,7 @@
+ #include "nouveau_reg.h"
+ #include "nouveau_drv.h"
+ #include "dispnv04/hw.h"
++#include "dispnv50/disp.h"
+ #include "nouveau_acpi.h"
+
+ #include "nouveau_display.h"
+@@ -1033,6 +1034,29 @@ get_tmds_link_bandwidth(struct drm_connector *connector)
+ return 112000 * duallink_scale;
+ }
+
++enum drm_mode_status
++nouveau_conn_mode_clock_valid(const struct drm_display_mode *mode,
++ const unsigned min_clock,
++ const unsigned max_clock,
++ unsigned int *clock_out)
++{
++ unsigned int clock = mode->clock;
++
++ if ((mode->flags & DRM_MODE_FLAG_3D_MASK) ==
++ DRM_MODE_FLAG_3D_FRAME_PACKING)
++ clock *= 2;
++
++ if (clock < min_clock)
++ return MODE_CLOCK_LOW;
++ if (clock > max_clock)
++ return MODE_CLOCK_HIGH;
++
++ if (clock_out)
++ *clock_out = clock;
++
++ return MODE_OK;
++}
++
+ static enum drm_mode_status
+ nouveau_connector_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
+@@ -1041,7 +1065,6 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
+ struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder;
+ struct drm_encoder *encoder = to_drm_encoder(nv_encoder);
+ unsigned min_clock = 25000, max_clock = min_clock;
+- unsigned clock = mode->clock;
+
+ switch (nv_encoder->dcb->type) {
+ case DCB_OUTPUT_LVDS:
+@@ -1064,29 +1087,14 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
+ case DCB_OUTPUT_TV:
+ return get_slave_funcs(encoder)->mode_valid(encoder, mode);
+ case DCB_OUTPUT_DP:
+- if (mode->flags & DRM_MODE_FLAG_INTERLACE &&
+- !nv_encoder->caps.dp_interlace)
+- return MODE_NO_INTERLACE;
+-
+- max_clock = nv_encoder->dp.link_nr;
+- max_clock *= nv_encoder->dp.link_bw;
+- clock = clock * (connector->display_info.bpc * 3) / 10;
+- break;
++ return nv50_dp_mode_valid(connector, nv_encoder, mode, NULL);
+ default:
+ BUG();
+ return MODE_BAD;
+ }
+
+- if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING)
+- clock *= 2;
+-
+- if (clock < min_clock)
+- return MODE_CLOCK_LOW;
+-
+- if (clock > max_clock)
+- return MODE_CLOCK_HIGH;
+-
+- return MODE_OK;
++ return nouveau_conn_mode_clock_valid(mode, min_clock, max_clock,
++ NULL);
+ }
+
+ static struct drm_encoder *
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h
+index de84fb4708c7..9e062c7adec8 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.h
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.h
+@@ -195,6 +195,11 @@ int nouveau_conn_atomic_get_property(struct drm_connector *,
+ const struct drm_connector_state *,
+ struct drm_property *, u64 *);
+ struct drm_display_mode *nouveau_conn_native_mode(struct drm_connector *);
++enum drm_mode_status
++nouveau_conn_mode_clock_valid(const struct drm_display_mode *,
++ const unsigned min_clock,
++ const unsigned max_clock,
++ unsigned *clock);
+
+ #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
+ extern int nouveau_backlight_init(struct drm_connector *);
+diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c
+index 2674f1587457..8a0f7994e1ae 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_dp.c
++++ b/drivers/gpu/drm/nouveau/nouveau_dp.c
+@@ -98,3 +98,34 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
+ return NOUVEAU_DP_SST;
+ return ret;
+ }
++
++/* TODO:
++ * - Use the minimum possible BPC here, once we add support for the max bpc
++ * property.
++ * - Validate the mode against downstream port caps (see
++ * drm_dp_downstream_max_clock())
++ * - Validate against the DP caps advertised by the GPU (we don't check these
++ * yet)
++ */
++enum drm_mode_status
++nv50_dp_mode_valid(struct drm_connector *connector,
++ struct nouveau_encoder *outp,
++ const struct drm_display_mode *mode,
++ unsigned *out_clock)
++{
++ const unsigned min_clock = 25000;
++ unsigned max_clock, clock;
++ enum drm_mode_status ret;
++
++ if (mode->flags & DRM_MODE_FLAG_INTERLACE && !outp->caps.dp_interlace)
++ return MODE_NO_INTERLACE;
++
++ max_clock = outp->dp.link_nr * outp->dp.link_bw;
++ clock = mode->clock * (connector->display_info.bpc * 3) / 10;
++
++ ret = nouveau_conn_mode_clock_valid(mode, min_clock, max_clock,
++ &clock);
++ if (out_clock)
++ *out_clock = clock;
++ return ret;
++}
+diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h
+index 3217f587eceb..de51733b0476 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_encoder.h
++++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h
+@@ -104,6 +104,10 @@ enum nouveau_dp_status {
+ };
+
+ int nouveau_dp_detect(struct nouveau_encoder *);
++enum drm_mode_status nv50_dp_mode_valid(struct drm_connector *,
++ struct nouveau_encoder *,
++ const struct drm_display_mode *,
++ unsigned *clock);
+
+ struct nouveau_connector *
+ nouveau_encoder_connector_get(struct nouveau_encoder *encoder);
+--
+2.26.2
+
diff --git a/0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch b/0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch
index e87612358..2e055125c 100644
--- a/0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch
+++ b/0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch
@@ -1,4 +1,4 @@
-From 14d329da03ea1145efce866b127b10ea6390b5e1 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Murphy Zhou <jencce.kernel@gmail.com>
Date: Sun, 29 Sep 2019 17:56:59 +0800
Subject: [PATCH] mm/kmemleak: skip late_init if not skip disable
@@ -51,10 +51,10 @@ Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
1 file changed, 5 insertions(+)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
-index 03a8d84badad..b9baf617fe35 100644
+index e362dc3d2028..0c3dfb8eef67 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
-@@ -1946,6 +1946,11 @@ void __init kmemleak_init(void)
+@@ -1958,6 +1958,11 @@ void __init kmemleak_init(void)
*/
static int __init kmemleak_late_init(void)
{
@@ -64,8 +64,8 @@ index 03a8d84badad..b9baf617fe35 100644
+ }
+
kmemleak_initialized = 1;
-
+
debugfs_create_file("kmemleak", 0644, NULL, NULL, &kmemleak_fops);
--
-2.21.0
+2.26.2
diff --git a/0001-mmu-Remove-unneeded-semicolon.patch b/0001-mmu-Remove-unneeded-semicolon.patch
new file mode 100644
index 000000000..3931ff586
--- /dev/null
+++ b/0001-mmu-Remove-unneeded-semicolon.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zheng Bin <zhengbin13@huawei.com>
+Date: Fri, 24 Apr 2020 15:36:01 +0800
+Subject: [PATCH] mmu: Remove unneeded semicolon
+
+Fixes coccicheck warning:
+
+drivers/gpu/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h:307:2-3: Unneeded semicolon
+drivers/gpu/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:583:2-3: Unneeded semicolon
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
+index 41640e0584ac..199f94e15c5f 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
+@@ -580,7 +580,7 @@ nvkm_vmm_iter(struct nvkm_vmm *vmm, const struct nvkm_vmm_page *page,
+ it.pte[it.lvl]++;
+ }
+ }
+- };
++ }
+
+ nvkm_vmm_flush(&it);
+ return ~0ULL;
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
+index 5e55ecbd8005..d3f8f916d0db 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
+@@ -304,7 +304,7 @@ int tu102_vmm_new(struct nvkm_mmu *, bool, u64, u64, void *, u32,
+ FILL(VMM, PT, PTEI, _ptes, MAP, _addr); \
+ PTEI += _ptes; \
+ PTEN -= _ptes; \
+- }; \
++ } \
+ nvkm_done((PT)->memory); \
+ } while(0)
+
+--
+2.26.2
+
diff --git a/0001-modules-add-rhelversion-MODULE_INFO-tag.patch b/0001-modules-add-rhelversion-MODULE_INFO-tag.patch
new file mode 100644
index 000000000..5fbcc61e2
--- /dev/null
+++ b/0001-modules-add-rhelversion-MODULE_INFO-tag.patch
@@ -0,0 +1,151 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Mon, 7 Jan 2019 21:03:10 +0000
+Subject: [PATCH] modules: add rhelversion MODULE_INFO tag
+
+There were several changes in the 5.0-rc1 kernel that required
+this patch to be rebased with some context diff.
+
+ Patchwork-id: 7379
+ O-Subject: [kernel team] [RHEL8.0 BZ 1544999 1/2] modules: add rhelversion MODULE_INFO tag
+ Bugzilla: 1544999
+ RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+ RH-Acked-by: Oleg Nesterov <oleg@redhat.com>
+ RH-Acked-by: Jarod Wilson <jarod@redhat.com>
+
+ Bugzilla: http://bugzilla.redhat.com/1544999
+
+ kernel-alt commit 9816b4b6ca5d4c0504d8806ce99442c90afbc8e6
+ Author: Prarit Bhargava <prarit@redhat.com>
+ Date: Fri Feb 9 18:09:26 2018 -0500
+
+ [kernel] modules: add rhelversion MODULE_INFO tag
+
+ Message-id: <20180209180926.5955-3-prarit@redhat.com>
+ Patchwork-id: 205587
+ O-Subject: [RHEL-ALT-7.5 BZ 1542796 2/2] modules: add rhelversion MODULE_INFO tag
+ Bugzilla: 1542796
+ RH-Acked-by: David Arcari <darcari@redhat.com>
+ RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
+ RH-Acked-by: Steve Best <sbest@redhat.com>
+
+ Bugzilla: http://bugzilla.redhat.com/1542796
+
+ rhel7 commit 9af8c3992ce5fff253c49abc0dedb3ec77badba4
+ Author: Kyle McMartin <kmcmarti@redhat.com>
+ Date: Fri Sep 12 17:46:12 2014 -0400
+
+ [kernel] modules: add rhelversion MODULE_INFO tag
+
+ Message-id: <20140912174612.GS29420@redacted.bos.redhat.com>
+ Patchwork-id: 94052
+ O-Subject: [RHEL7.1 PATCH 2/6 v4] modules: add rhelversion MODULE_INFO tag
+ Bugzilla: 1110315
+ RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
+ RH-Acked-by: Johannes Weiner <jweiner@redhat.com>
+ RH-Acked-by: Don Zickus <dzickus@redhat.com>
+
+ From: Kyle McMartin <kmcmarti@redhat.com>
+
+ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1110315
+
+ >From kylem's RHEL8 post:
+
+ Let's not lose this ability in RHEL8. Sadly can't be applied to RHEL7
+ because it breaks KABI due to the struct module change.
+
+ Inspired by bits of a147e4729d9920ccae2c717ca65c811cc0f93a1d in RHEL6,
+ which got lost for RHEL7.0. :/
+
+ Kyle is correct and doing this would break RHEL7's KABI. I'm taking this
+ patch in as a base and the next patch will resolve the KABI issues.
+
+ [v2]: dzickus, cleanup add_rhelversion()
+ [v4]: resubmitted along with 16k stacks change
+
+ Signed-off-by: Jarod Wilson <jarod@redhat.com>
+
+ Cc: Richard Guy Briggs <rgb@redhat.com>
+ Cc: Peter Rajnoha <prajnoha@redhat.com>
+ Cc: Laura Abbott <labbott@redhat.com>
+ Cc: Josh Poimboeuf <jpoimboe@redhat.com>
+ Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+
+Upstream Status: RHEL only
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+Acked-by: Don Zickus <dzickus@redhat.com>
+Acked-by: Prarit Bhargava <prarit@redhat.com>
+---
+ include/linux/module.h | 1 +
+ kernel/module.c | 2 ++
+ scripts/mod/modpost.c | 8 ++++++++
+ 3 files changed, 11 insertions(+)
+
+diff --git a/include/linux/module.h b/include/linux/module.h
+index 1ad393e62bef..3fb19abee033 100644
+--- a/include/linux/module.h
++++ b/include/linux/module.h
+@@ -371,6 +371,7 @@ struct module {
+ struct module_attribute *modinfo_attrs;
+ const char *version;
+ const char *srcversion;
++ const char *rhelversion;
+ struct kobject *holders_dir;
+
+ /* Exported symbols */
+diff --git a/kernel/module.c b/kernel/module.c
+index 646f1e2330d2..aed5b1fcadf8 100644
+--- a/kernel/module.c
++++ b/kernel/module.c
+@@ -799,6 +799,7 @@ static struct module_attribute modinfo_##field = { \
+
+ MODINFO_ATTR(version);
+ MODINFO_ATTR(srcversion);
++MODINFO_ATTR(rhelversion);
+
+ static char last_unloaded_module[MODULE_NAME_LEN+1];
+
+@@ -1263,6 +1264,7 @@ static struct module_attribute *modinfo_attrs[] = {
+ &module_uevent,
+ &modinfo_version,
+ &modinfo_srcversion,
++ &modinfo_rhelversion,
+ &modinfo_initstate,
+ &modinfo_coresize,
+ &modinfo_initsize,
+diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
+index 5c3c50c5ec52..188eb460cede 100644
+--- a/scripts/mod/modpost.c
++++ b/scripts/mod/modpost.c
+@@ -21,6 +21,7 @@
+ #include <errno.h>
+ #include "modpost.h"
+ #include "../../include/linux/license.h"
++#include "../../include/generated/uapi/linux/version.h"
+
+ /* Are we using CONFIG_MODVERSIONS? */
+ static int modversions = 0;
+@@ -2381,6 +2382,12 @@ static void add_srcversion(struct buffer *b, struct module *mod)
+ }
+ }
+
++static void add_rhelversion(struct buffer *b, struct module *mod)
++{
++ buf_printf(b, "MODULE_INFO(rhelversion, \"%d.%d\");\n", RHEL_MAJOR,
++ RHEL_MINOR);
++}
++
+ static void write_if_changed(struct buffer *b, const char *fname)
+ {
+ char *tmp;
+@@ -2644,6 +2651,7 @@ int main(int argc, char **argv)
+ add_depends(&buf, mod);
+ add_moddevtable(&buf, mod);
+ add_srcversion(&buf, mod);
++ add_rhelversion(&buf, mod);
+
+ sprintf(fname, "%s.mod.c", mod->name);
+ write_if_changed(&buf, fname);
+--
+2.26.2
+
diff --git a/0001-perf-cs-etm-Move-defined-of-traceid_list.patch b/0001-perf-cs-etm-Move-defined-of-traceid_list.patch
new file mode 100644
index 000000000..63cbefa93
--- /dev/null
+++ b/0001-perf-cs-etm-Move-defined-of-traceid_list.patch
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Leo Yan <leo.yan@linaro.org>
+Date: Tue, 5 May 2020 21:36:42 +0800
+Subject: [PATCH] perf cs-etm: Move defined of traceid_list
+
+The variable 'traceid_list' is defined in the header file cs-etm.h,
+if multiple C files include cs-etm.h the compiler might complaint for
+multiple definition of 'traceid_list'.
+
+To fix multiple definition error, move the definition of 'traceid_list'
+into cs-etm.c.
+
+Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
+Reported-by: Thomas Backlund <tmb@mageia.org>
+Signed-off-by: Leo Yan <leo.yan@linaro.org>
+Tested-by: Thomas Backlund <tmb@mageia.org>
+Tested-by: Mike Leach <mike.leach@linaro.org>
+Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
+Reviewed-by: Mike Leach <mike.leach@linaro.org>
+Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+
+Upstream Status: https://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org/
+---
+ tools/perf/util/cs-etm.c | 3 +++
+ tools/perf/util/cs-etm.h | 3 ---
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
+index 62d2f9b9ce1b..381d9708e9bd 100644
+--- a/tools/perf/util/cs-etm.c
++++ b/tools/perf/util/cs-etm.c
+@@ -94,6 +94,9 @@ struct cs_etm_queue {
+ struct cs_etm_traceid_queue **traceid_queues;
+ };
+
++/* RB tree for quick conversion between traceID and metadata pointers */
++static struct intlist *traceid_list;
++
+ static int cs_etm__update_queues(struct cs_etm_auxtrace *etm);
+ static int cs_etm__process_queues(struct cs_etm_auxtrace *etm);
+ static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
+diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
+index 650ecc2a6349..4ad925d6d799 100644
+--- a/tools/perf/util/cs-etm.h
++++ b/tools/perf/util/cs-etm.h
+@@ -114,9 +114,6 @@ enum cs_etm_isa {
+ CS_ETM_ISA_T32,
+ };
+
+-/* RB tree for quick conversion between traceID and metadata pointers */
+-struct intlist *traceid_list;
+-
+ struct cs_etm_queue;
+
+ struct cs_etm_packet {
+--
+2.26.2
+
diff --git a/0001-platform-x86-sony-laptop-SNC-calls-should-handle-BUF.patch b/0001-platform-x86-sony-laptop-SNC-calls-should-handle-BUF.patch
new file mode 100644
index 000000000..743e38804
--- /dev/null
+++ b/0001-platform-x86-sony-laptop-SNC-calls-should-handle-BUF.patch
@@ -0,0 +1,116 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mattia Dongili <malattia@linux.it>
+Date: Fri, 8 May 2020 09:14:04 +0900
+Subject: [PATCH] platform/x86: sony-laptop: SNC calls should handle BUFFER
+ types
+
+After commit 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer
+objects for ASL create_field() operator") ACPICA creates buffers even
+when new fields are small enough to fit into an integer.
+Many SNC calls counted on the old behaviour.
+Since sony-laptop already handles the INTEGER/BUFFER case in
+sony_nc_buffer_call, switch sony_nc_int_call to use its more generic
+function instead.
+
+Fixes: 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator")
+Reported-by: Dominik Mierzejewski <dominik@greysector.net>
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491
+Reported-by: William Bader <williambader@hotmail.com>
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1830150
+Signed-off-by: Mattia Dongili <malattia@linux.it>
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Upstream Status: linux-platform-drivers-x86/for-next
+(cherry picked from commit 47828d22539f76c8c9dcf2a55f18ea3a8039d8ef)
+---
+ drivers/platform/x86/sony-laptop.c | 53 +++++++++++++-----------------
+ 1 file changed, 23 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
+index 51309f7ceede..6932cd11e660 100644
+--- a/drivers/platform/x86/sony-laptop.c
++++ b/drivers/platform/x86/sony-laptop.c
+@@ -757,33 +757,6 @@ static union acpi_object *__call_snc_method(acpi_handle handle, char *method,
+ return result;
+ }
+
+-static int sony_nc_int_call(acpi_handle handle, char *name, int *value,
+- int *result)
+-{
+- union acpi_object *object = NULL;
+- if (value) {
+- u64 v = *value;
+- object = __call_snc_method(handle, name, &v);
+- } else
+- object = __call_snc_method(handle, name, NULL);
+-
+- if (!object)
+- return -EINVAL;
+-
+- if (object->type != ACPI_TYPE_INTEGER) {
+- pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n",
+- ACPI_TYPE_INTEGER, object->type);
+- kfree(object);
+- return -EINVAL;
+- }
+-
+- if (result)
+- *result = object->integer.value;
+-
+- kfree(object);
+- return 0;
+-}
+-
+ #define MIN(a, b) (a > b ? b : a)
+ static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
+ void *buffer, size_t buflen)
+@@ -795,17 +768,20 @@ static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
+ if (!object)
+ return -EINVAL;
+
+- if (object->type == ACPI_TYPE_BUFFER) {
++ if (!buffer) {
++ /* do nothing */
++ } else if (object->type == ACPI_TYPE_BUFFER) {
+ len = MIN(buflen, object->buffer.length);
++ memset(buffer, 0, buflen);
+ memcpy(buffer, object->buffer.pointer, len);
+
+ } else if (object->type == ACPI_TYPE_INTEGER) {
+ len = MIN(buflen, sizeof(object->integer.value));
++ memset(buffer, 0, buflen);
+ memcpy(buffer, &object->integer.value, len);
+
+ } else {
+- pr_warn("Invalid acpi_object: expected 0x%x got 0x%x\n",
+- ACPI_TYPE_BUFFER, object->type);
++ pr_warn("Unexpected acpi_object: 0x%x\n", object->type);
+ ret = -EINVAL;
+ }
+
+@@ -813,6 +789,23 @@ static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
+ return ret;
+ }
+
++static int sony_nc_int_call(acpi_handle handle, char *name, int *value, int
++ *result)
++{
++ int ret;
++
++ if (value) {
++ u64 v = *value;
++
++ ret = sony_nc_buffer_call(handle, name, &v, result,
++ sizeof(*result));
++ } else {
++ ret = sony_nc_buffer_call(handle, name, NULL, result,
++ sizeof(*result));
++ }
++ return ret;
++}
++
+ struct sony_nc_handles {
+ u16 cap[0x10];
+ struct device_attribute devattr;
+--
+2.26.2
+
diff --git a/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch b/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch
new file mode 100644
index 000000000..1e07d8e45
--- /dev/null
+++ b/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch
@@ -0,0 +1,100 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 12 May 2020 00:39:24 +0200
+Subject: [PATCH] pwm: lpss: Fix get_state runtime-pm reference handling
+
+Before commit cfc4c189bc70 ("pwm: Read initial hardware state at request
+time"), a driver's get_state callback would get called once per PWM from
+pwmchip_add().
+
+pwm-lpss' runtime-pm code was relying on this, getting a runtime-pm ref for
+PWMs which are enabled at probe time from within its get_state callback,
+before enabling runtime-pm.
+
+The change to calling get_state at request time causes a number of
+problems:
+
+1. PWMs enabled at probe time may get runtime suspended before they are
+requested, causing e.g. a LCD backlight controlled by the PWM to turn off.
+
+2. When the request happens when the PWM has been runtime suspended, the
+ctrl register will read all 1 / 0xffffffff, causing get_state to store
+bogus values in the pwm_state.
+
+3. get_state was using an async pm_runtime_get() call, because it assumed
+that runtime-pm has not been enabled yet. If shortly after the request an
+apply call is made, then the pwm_lpss_is_updating() check may trigger
+because the resume triggered by the pm_runtime_get() call is not complete
+yet, so the ctrl register still reads all 1 / 0xffffffff.
+
+This commit fixes these issues by moving the initial pm_runtime_get() call
+for PWMs which are enabled at probe time to the pwm_lpss_probe() function;
+and by making get_state take a runtime-pm ref before reading the ctrl reg.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1828927
+Fixes: cfc4c189bc70 ("pwm: Read initial hardware state at request time")
+Cc: stable@vger.kernel.org
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/linux-acpi/5f15f6bc-8650-d86e-893f-0d41557c57c7@redhat.com/
+---
+ drivers/pwm/pwm-lpss.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
+index 75bbfe5f3bc2..9d965ffe66d1 100644
+--- a/drivers/pwm/pwm-lpss.c
++++ b/drivers/pwm/pwm-lpss.c
+@@ -158,7 +158,6 @@ static int pwm_lpss_apply(struct pwm_chip *chip, struct pwm_device *pwm,
+ return 0;
+ }
+
+-/* This function gets called once from pwmchip_add to get the initial state */
+ static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
+ struct pwm_state *state)
+ {
+@@ -167,6 +166,8 @@ static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
+ unsigned long long base_unit, freq, on_time_div;
+ u32 ctrl;
+
++ pm_runtime_get_sync(chip->dev);
++
+ base_unit_range = BIT(lpwm->info->base_unit_bits);
+
+ ctrl = pwm_lpss_read(pwm);
+@@ -187,8 +188,7 @@ static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
+ state->polarity = PWM_POLARITY_NORMAL;
+ state->enabled = !!(ctrl & PWM_ENABLE);
+
+- if (state->enabled)
+- pm_runtime_get(chip->dev);
++ pm_runtime_put(chip->dev);
+ }
+
+ static const struct pwm_ops pwm_lpss_ops = {
+@@ -202,7 +202,8 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
+ {
+ struct pwm_lpss_chip *lpwm;
+ unsigned long c;
+- int ret;
++ int i, ret;
++ u32 ctrl;
+
+ if (WARN_ON(info->npwm > MAX_PWMS))
+ return ERR_PTR(-ENODEV);
+@@ -232,6 +233,12 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
+ return ERR_PTR(ret);
+ }
+
++ for (i = 0; i < lpwm->info->npwm; i++) {
++ ctrl = pwm_lpss_read(&lpwm->chip.pwms[i]);
++ if (ctrl & PWM_ENABLE)
++ pm_runtime_get(dev);
++ }
++
+ return lpwm;
+ }
+ EXPORT_SYMBOL_GPL(pwm_lpss_probe);
+--
+2.26.2
+
diff --git a/s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch b/0001-s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch
index 0779418b4..4332472bb 100644
--- a/s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch
+++ b/0001-s390-Lock-down-the-kernel-when-the-IPL-secure-flag-i.patch
@@ -1,4 +1,4 @@
-From eaa12998810bd9db85dec71f0da55fd5aae73d0f Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jcline@redhat.com>
Date: Wed, 30 Oct 2019 14:37:49 +0000
Subject: [PATCH] s390: Lock down the kernel when the IPL secure flag is set
@@ -6,6 +6,7 @@ Subject: [PATCH] s390: Lock down the kernel when the IPL secure flag is set
Automatically lock down the kernel to LOCKDOWN_CONFIDENTIALITY_MAX if
the IPL secure flag is set.
+Upstream Status: RHEL only
Suggested-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
@@ -15,7 +16,7 @@ Signed-off-by: Jeremy Cline <jcline@redhat.com>
3 files changed, 10 insertions(+)
diff --git a/arch/s390/include/asm/ipl.h b/arch/s390/include/asm/ipl.h
-index 084e71b7272a..1d1b5ec7357b 100644
+index b63bd66404b8..3482d9602e68 100644
--- a/arch/s390/include/asm/ipl.h
+++ b/arch/s390/include/asm/ipl.h
@@ -109,6 +109,7 @@ int ipl_report_add_component(struct ipl_report *report, struct kexec_buf *kbuf,
@@ -23,16 +24,16 @@ index 084e71b7272a..1d1b5ec7357b 100644
int ipl_report_add_certificate(struct ipl_report *report, void *key,
unsigned long addr, unsigned long len);
+bool ipl_get_secureboot(void);
-
+
/*
* DIAG 308 support
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
-index 6837affc19e8..2d3f3d00e05c 100644
+index 4a71061974fd..9baf0b570c3d 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
-@@ -1842,3 +1842,8 @@ int ipl_report_free(struct ipl_report *report)
+@@ -1901,3 +1901,8 @@ int ipl_report_free(struct ipl_report *report)
}
-
+
#endif
+
+bool ipl_get_secureboot(void)
@@ -40,7 +41,7 @@ index 6837affc19e8..2d3f3d00e05c 100644
+ return !!ipl_secure_flag;
+}
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
-index 9cbf490fd162..0510ecdfc3f6 100644
+index 36445dd40fdb..b338a050c5aa 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -49,6 +49,7 @@
@@ -48,19 +49,19 @@ index 9cbf490fd162..0510ecdfc3f6 100644
#include <linux/compat.h>
#include <linux/start_kernel.h>
+#include <linux/security.h>
-
+
#include <asm/boot_data.h>
#include <asm/ipl.h>
-@@ -1096,6 +1097,9 @@ void __init setup_arch(char **cmdline_p)
-
+@@ -1093,6 +1094,9 @@ void __init setup_arch(char **cmdline_p)
+
log_component_list();
-
+
+ if (ipl_get_secureboot())
-+ security_lock_kernel_down("Secure IPL mode", LOCKDOWN_CONFIDENTIALITY_MAX);
++ security_lock_kernel_down("Secure IPL mode", LOCKDOWN_INTEGRITY_MAX);
+
/* Have one command line that is parsed and saved in /proc/cmdline */
/* boot_command_line has been already set up in early.c */
*cmdline_p = boot_command_line;
--
-2.24.1
+2.26.2
diff --git a/0001-scsi-smartpqi-add-inspur-advantech-ids.patch b/0001-scsi-smartpqi-add-inspur-advantech-ids.patch
new file mode 100644
index 000000000..4e2bbb794
--- /dev/null
+++ b/0001-scsi-smartpqi-add-inspur-advantech-ids.patch
@@ -0,0 +1,70 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Don Brace <dbrace@redhat.com>
+Date: Mon, 16 Jul 2018 19:20:41 -0400
+Subject: [PATCH] scsi: smartpqi: add inspur advantech ids
+
+Message-id: <1531768843-2544-4-git-send-email-dbrace@redhat.com>
+Patchwork-id: 224988
+O-Subject: [RHEL 8.0 e-stor V2 PATCH 3/5] scsi: smartpqi: add inspur advantech ids
+Bugzilla: 1503736
+RH-Acked-by: Ewan Milne <emilne@redhat.com>
+RH-Acked-by: Tomas Henzl <thenzl@redhat.com>
+
+From: Kevin Barnett <kevin.barnett@microsemi.com>
+
+Add support for these new device IDs:
+
+ Advantech MIC-8312BridgeB
+ INSPUR PM8204-2GB
+ INSPUR PM8204-4GB
+ INSPUR PM8222-SHBA
+
+Upstream Status: RHEL only
+Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
+Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
+Signed-off-by: Don Brace <don.brace@microsemi.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+(cherry picked from commit 9f8d05fa98442de78d1ab30235b0cc656ed7aff0)
+Signed-off-by: Don Brace <dbrace@redhat.com>
+Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
+---
+ drivers/scsi/smartpqi/smartpqi_init.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
+index cd157f11eb22..c5dc6cf57a71 100644
+--- a/drivers/scsi/smartpqi/smartpqi_init.c
++++ b/drivers/scsi/smartpqi/smartpqi_init.c
+@@ -8247,6 +8247,18 @@ static const struct pci_device_id pqi_pci_id_table[] = {
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+ 0x19e5, 0xd22c)
+ },
++ {
++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
++ 0x1bd4, 0x004a)
++ },
++ {
++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
++ 0x1bd4, 0x004b)
++ },
++ {
++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
++ 0x1bd4, 0x004c)
++ },
+ {
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+ PCI_VENDOR_ID_ADAPTEC2, 0x0110)
+@@ -8383,6 +8395,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+ PCI_VENDOR_ID_ADVANTECH, 0x8312)
+ },
++ {
++ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
++ PCI_VENDOR_ID_ADVANTECH, 0x8312)
++ },
+ {
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+ PCI_VENDOR_ID_DELL, 0x1fe0)
+--
+2.26.2
+
diff --git a/0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch b/0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch
new file mode 100644
index 000000000..fc6b78ad0
--- /dev/null
+++ b/0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch
@@ -0,0 +1,103 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Cline <jcline@redhat.com>
+Date: Mon, 30 Sep 2019 21:22:47 +0000
+Subject: [PATCH] security: lockdown: expose a hook to lock the kernel down
+
+In order to automatically lock down kernels running on UEFI machines
+booted in Secure Boot mode, expose the lock_kernel_down() hook.
+
+Upstream Status: RHEL only
+Signed-off-by: Jeremy Cline <jcline@redhat.com>
+---
+ include/linux/lsm_hook_defs.h | 2 ++
+ include/linux/lsm_hooks.h | 6 ++++++
+ include/linux/security.h | 5 +++++
+ security/lockdown/lockdown.c | 1 +
+ security/security.c | 6 ++++++
+ 5 files changed, 20 insertions(+)
+
+diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
+index 5616b2567aa7..bc5caab1413b 100644
+--- a/include/linux/lsm_hook_defs.h
++++ b/include/linux/lsm_hook_defs.h
+@@ -371,6 +371,8 @@ LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux)
+ #endif /* CONFIG_BPF_SYSCALL */
+
+ LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
++LSM_HOOK(int, 0, lock_kernel_down, const char *where, enum lockdown_reason level)
++
+
+ #ifdef CONFIG_PERF_EVENTS
+ LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int type)
+diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
+index 988ca0df7824..4ed37b95417c 100644
+--- a/include/linux/lsm_hooks.h
++++ b/include/linux/lsm_hooks.h
+@@ -1476,6 +1476,12 @@
+ *
+ * @what: kernel feature being accessed
+ *
++ * @lock_kernel_down
++ * Put the kernel into lock-down mode.
++ *
++ * @where: Where the lock-down is originating from (e.g. command line option)
++ * @level: The lock-down level (can only increase)
++ *
+ * Security hooks for perf events
+ *
+ * @perf_event_open:
+diff --git a/include/linux/security.h b/include/linux/security.h
+index a8d9310472df..381305889d89 100644
+--- a/include/linux/security.h
++++ b/include/linux/security.h
+@@ -446,6 +446,7 @@ int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
+ int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
+ int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
+ int security_locked_down(enum lockdown_reason what);
++int security_lock_kernel_down(const char *where, enum lockdown_reason level);
+ #else /* CONFIG_SECURITY */
+
+ static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
+@@ -1273,6 +1274,10 @@ static inline int security_locked_down(enum lockdown_reason what)
+ {
+ return 0;
+ }
++static inline int security_lock_kernel_down(const char *where, enum lockdown_reason level)
++{
++ return 0;
++}
+ #endif /* CONFIG_SECURITY */
+
+ #ifdef CONFIG_SECURITY_NETWORK
+diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
+index 5a952617a0eb..61cc3cdc4d25 100644
+--- a/security/lockdown/lockdown.c
++++ b/security/lockdown/lockdown.c
+@@ -73,6 +73,7 @@ static int lockdown_is_locked_down(enum lockdown_reason what)
+
+ static struct security_hook_list lockdown_hooks[] __lsm_ro_after_init = {
+ LSM_HOOK_INIT(locked_down, lockdown_is_locked_down),
++ LSM_HOOK_INIT(lock_kernel_down, lock_kernel_down),
+ };
+
+ static int __init lockdown_lsm_init(void)
+diff --git a/security/security.c b/security/security.c
+index 51de970fbb1e..48d05f8067f2 100644
+--- a/security/security.c
++++ b/security/security.c
+@@ -2468,6 +2468,12 @@ int security_locked_down(enum lockdown_reason what)
+ }
+ EXPORT_SYMBOL(security_locked_down);
+
++int security_lock_kernel_down(const char *where, enum lockdown_reason level)
++{
++ return call_int_hook(lock_kernel_down, 0, where, level);
++}
++EXPORT_SYMBOL(security_lock_kernel_down);
++
+ #ifdef CONFIG_PERF_EVENTS
+ int security_perf_event_open(struct perf_event_attr *attr, int type)
+ {
+--
+2.26.2
+
diff --git a/0001-soc-bcm2835-Sync-xHCI-reset-firmware-property-with-d.patch b/0001-soc-bcm2835-Sync-xHCI-reset-firmware-property-with-d.patch
new file mode 100644
index 000000000..3dd66b141
--- /dev/null
+++ b/0001-soc-bcm2835-Sync-xHCI-reset-firmware-property-with-d.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Date: Tue, 10 Mar 2020 13:52:39 +0100
+Subject: [PATCH] soc: bcm2835: Sync xHCI reset firmware property with
+ downstream
+
+The property is needed in order to trigger VL805's firmware load. Note
+that there is a gap between the property introduced and the previous
+one. This is also the case downstream.
+
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ include/soc/bcm2835/raspberrypi-firmware.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
+index 7800e12ee042..cc9cdbc66403 100644
+--- a/include/soc/bcm2835/raspberrypi-firmware.h
++++ b/include/soc/bcm2835/raspberrypi-firmware.h
+@@ -90,7 +90,7 @@ enum rpi_firmware_property_tag {
+ RPI_FIRMWARE_SET_PERIPH_REG = 0x00038045,
+ RPI_FIRMWARE_GET_POE_HAT_VAL = 0x00030049,
+ RPI_FIRMWARE_SET_POE_HAT_VAL = 0x00030050,
+-
++ RPI_FIRMWARE_NOTIFY_XHCI_RESET = 0x00030058,
+
+ /* Dispmanx TAGS */
+ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001,
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Add-a-few-new-vmmdev-request-types-to-the-.patch b/0001-virt-vbox-Add-a-few-new-vmmdev-request-types-to-the-.patch
new file mode 100644
index 000000000..92c93e835
--- /dev/null
+++ b/0001-virt-vbox-Add-a-few-new-vmmdev-request-types-to-the-.patch
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 11:05:40 +0200
+Subject: [PATCH] virt: vbox: Add a few new vmmdev request types to the
+ userspace whitelist
+
+Upstream VirtualBox has defined and is using a few new request types for
+vmmdev requests passed through /dev/vboxguest to the hypervisor.
+
+Add the defines for these to vbox_vmmdev_types.h and add add them to the
+whitelists of vmmdev requests which userspace is allowed to make.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1789545
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 2 ++
+ include/uapi/linux/vbox_vmmdev_types.h | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index 4f1addaa3f6f..ffd76b949276 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -1299,7 +1299,9 @@ static int vbg_req_allowed(struct vbg_dev *gdev, struct vbg_session *session,
+ case VMMDEVREQ_VIDEO_ACCEL_ENABLE:
+ case VMMDEVREQ_VIDEO_ACCEL_FLUSH:
+ case VMMDEVREQ_VIDEO_SET_VISIBLE_REGION:
++ case VMMDEVREQ_VIDEO_UPDATE_MONITOR_POSITIONS:
+ case VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX:
++ case VMMDEVREQ_GET_DISPLAY_CHANGE_REQ_MULTI:
+ case VMMDEVREQ_GET_SEAMLESS_CHANGE_REQ:
+ case VMMDEVREQ_GET_VRDPCHANGE_REQ:
+ case VMMDEVREQ_LOG_STRING:
+diff --git a/include/uapi/linux/vbox_vmmdev_types.h b/include/uapi/linux/vbox_vmmdev_types.h
+index c27289fd619a..f8a8d6b3c521 100644
+--- a/include/uapi/linux/vbox_vmmdev_types.h
++++ b/include/uapi/linux/vbox_vmmdev_types.h
+@@ -63,6 +63,7 @@ enum vmmdev_request_type {
+ VMMDEVREQ_SET_GUEST_CAPABILITIES = 56,
+ VMMDEVREQ_VIDEMODE_SUPPORTED2 = 57, /* since version 3.2.0 */
+ VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX = 80, /* since version 4.2.4 */
++ VMMDEVREQ_GET_DISPLAY_CHANGE_REQ_MULTI = 81,
+ VMMDEVREQ_HGCM_CONNECT = 60,
+ VMMDEVREQ_HGCM_DISCONNECT = 61,
+ VMMDEVREQ_HGCM_CALL32 = 62,
+@@ -92,6 +93,8 @@ enum vmmdev_request_type {
+ VMMDEVREQ_WRITE_COREDUMP = 218,
+ VMMDEVREQ_GUEST_HEARTBEAT = 219,
+ VMMDEVREQ_HEARTBEAT_CONFIGURE = 220,
++ VMMDEVREQ_NT_BUG_CHECK = 221,
++ VMMDEVREQ_VIDEO_UPDATE_MONITOR_POSITIONS = 222,
+ /* Ensure the enum is a 32 bit data-type */
+ VMMDEVREQ_SIZEHACK = 0x7fffffff
+ };
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch b/0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch
new file mode 100644
index 000000000..c001fe5d4
--- /dev/null
+++ b/0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch
@@ -0,0 +1,320 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 18:04:30 +0200
+Subject: [PATCH] virt: vbox: Add support for the new
+ VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl
+
+Add support for the new VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl, this
+is necessary for automatic resizing of the guest resolution to match the
+VM-window size to work with the new VMSVGA virtual GPU which is now the
+new default in VirtualBox.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1789545
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 163 +++++++++++++++++++++++-
+ drivers/virt/vboxguest/vboxguest_core.h | 14 ++
+ include/uapi/linux/vboxguest.h | 24 ++++
+ 3 files changed, 200 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index 15b3cb618c6e..4f1addaa3f6f 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -679,7 +679,7 @@ static int vbg_set_host_capabilities(struct vbg_dev *gdev,
+
+ WARN_ON(!mutex_is_locked(&gdev->session_mutex));
+
+- caps = gdev->set_guest_caps_tracker.mask;
++ caps = gdev->acquired_guest_caps | gdev->set_guest_caps_tracker.mask;
+
+ if (gdev->guest_caps_host == caps)
+ return 0;
+@@ -703,6 +703,113 @@ static int vbg_set_host_capabilities(struct vbg_dev *gdev,
+ return vbg_status_code_to_errno(rc);
+ }
+
++/**
++ * Acquire (get exclusive access) guest capabilities for a session.
++ * Takes the session mutex.
++ * Return: 0 or negative errno value.
++ * @gdev: The Guest extension device.
++ * @session: The session.
++ * @flags: Flags (VBGL_IOC_AGC_FLAGS_XXX).
++ * @or_mask: The capabilities to add.
++ * @not_mask: The capabilities to remove.
++ * @session_termination: Set if we're called by the session cleanup code.
++ * This tweaks the error handling so we perform
++ * proper session cleanup even if the host
++ * misbehaves.
++ */
++static int vbg_acquire_session_capabilities(struct vbg_dev *gdev,
++ struct vbg_session *session,
++ u32 or_mask, u32 not_mask,
++ u32 flags, bool session_termination)
++{
++ unsigned long irqflags;
++ bool wakeup = false;
++ int ret = 0;
++
++ mutex_lock(&gdev->session_mutex);
++
++ if (gdev->set_guest_caps_tracker.mask & or_mask) {
++ vbg_err("%s error: cannot acquire caps which are currently set\n",
++ __func__);
++ ret = -EINVAL;
++ goto out;
++ }
++
++ /*
++ * Mark any caps in the or_mask as now being in acquire-mode. Note
++ * once caps are in acquire_mode they always stay in this mode.
++ * This impacts event handling, so we take the event-lock.
++ */
++ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
++ gdev->acquire_mode_guest_caps |= or_mask;
++ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
++
++ /* If we only have to switch the caps to acquire mode, we're done. */
++ if (flags & VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE)
++ goto out;
++
++ not_mask &= ~or_mask; /* or_mask takes priority over not_mask */
++ not_mask &= session->acquired_guest_caps;
++ or_mask &= ~session->acquired_guest_caps;
++
++ if (or_mask == 0 && not_mask == 0)
++ goto out;
++
++ if (gdev->acquired_guest_caps & or_mask) {
++ ret = -EBUSY;
++ goto out;
++ }
++
++ gdev->acquired_guest_caps |= or_mask;
++ gdev->acquired_guest_caps &= ~not_mask;
++ /* session->acquired_guest_caps impacts event handling, take the lock */
++ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
++ session->acquired_guest_caps |= or_mask;
++ session->acquired_guest_caps &= ~not_mask;
++ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
++
++ ret = vbg_set_host_capabilities(gdev, session, session_termination);
++ /* Roll back on failure, unless it's session termination time. */
++ if (ret < 0 && !session_termination) {
++ gdev->acquired_guest_caps &= ~or_mask;
++ gdev->acquired_guest_caps |= not_mask;
++ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
++ session->acquired_guest_caps &= ~or_mask;
++ session->acquired_guest_caps |= not_mask;
++ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
++ }
++
++ /*
++ * If we added a capability, check if that means some other thread in
++ * our session should be unblocked because there are events pending
++ * (the result of vbg_get_allowed_event_mask_for_session() may change).
++ *
++ * HACK ALERT! When the seamless support capability is added we generate
++ * a seamless change event so that the ring-3 client can sync with
++ * the seamless state.
++ */
++ if (ret == 0 && or_mask != 0) {
++ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
++
++ if (or_mask & VMMDEV_GUEST_SUPPORTS_SEAMLESS)
++ gdev->pending_events |=
++ VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
++
++ if (gdev->pending_events)
++ wakeup = true;
++
++ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
++
++ if (wakeup)
++ wake_up(&gdev->event_wq);
++ }
++
++out:
++ mutex_unlock(&gdev->session_mutex);
++
++ return ret;
++}
++
+ /**
+ * Sets the guest capabilities for a session. Takes the session spinlock.
+ * Return: 0 or negative errno value.
+@@ -725,6 +832,13 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+
+ mutex_lock(&gdev->session_mutex);
+
++ if (gdev->acquire_mode_guest_caps & or_mask) {
++ vbg_err("%s error: cannot set caps which are in acquire_mode\n",
++ __func__);
++ ret = -EBUSY;
++ goto out;
++ }
++
+ /* Apply the changes to the session mask. */
+ previous = session->set_guest_caps;
+ session->set_guest_caps |= or_mask;
+@@ -962,6 +1076,7 @@ void vbg_core_close_session(struct vbg_session *session)
+ struct vbg_dev *gdev = session->gdev;
+ int i, rc;
+
++ vbg_acquire_session_capabilities(gdev, session, 0, U32_MAX, 0, true);
+ vbg_set_session_capabilities(gdev, session, 0, U32_MAX, true);
+ vbg_set_session_event_filter(gdev, session, 0, U32_MAX, true);
+
+@@ -1019,6 +1134,25 @@ static int vbg_ioctl_driver_version_info(
+ return 0;
+ }
+
++/* Must be called with the event_lock held */
++static u32 vbg_get_allowed_event_mask_for_session(struct vbg_dev *gdev,
++ struct vbg_session *session)
++{
++ u32 acquire_mode_caps = gdev->acquire_mode_guest_caps;
++ u32 session_acquired_caps = session->acquired_guest_caps;
++ u32 allowed_events = VMMDEV_EVENT_VALID_EVENT_MASK;
++
++ if ((acquire_mode_caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS) &&
++ !(session_acquired_caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS))
++ allowed_events &= ~VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
++
++ if ((acquire_mode_caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS) &&
++ !(session_acquired_caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS))
++ allowed_events &= ~VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
++
++ return allowed_events;
++}
++
+ static bool vbg_wait_event_cond(struct vbg_dev *gdev,
+ struct vbg_session *session,
+ u32 event_mask)
+@@ -1030,6 +1164,7 @@ static bool vbg_wait_event_cond(struct vbg_dev *gdev,
+ spin_lock_irqsave(&gdev->event_spinlock, flags);
+
+ events = gdev->pending_events & event_mask;
++ events &= vbg_get_allowed_event_mask_for_session(gdev, session);
+ wakeup = events || session->cancel_waiters;
+
+ spin_unlock_irqrestore(&gdev->event_spinlock, flags);
+@@ -1044,6 +1179,7 @@ static u32 vbg_consume_events_locked(struct vbg_dev *gdev,
+ {
+ u32 events = gdev->pending_events & event_mask;
+
++ events &= vbg_get_allowed_event_mask_for_session(gdev, session);
+ gdev->pending_events &= ~events;
+ return events;
+ }
+@@ -1445,6 +1581,29 @@ static int vbg_ioctl_change_filter_mask(struct vbg_dev *gdev,
+ false);
+ }
+
++static int vbg_ioctl_acquire_guest_capabilities(struct vbg_dev *gdev,
++ struct vbg_session *session,
++ struct vbg_ioctl_acquire_guest_caps *caps)
++{
++ u32 flags, or_mask, not_mask;
++
++ if (vbg_ioctl_chk(&caps->hdr, sizeof(caps->u.in), 0))
++ return -EINVAL;
++
++ flags = caps->u.in.flags;
++ or_mask = caps->u.in.or_mask;
++ not_mask = caps->u.in.not_mask;
++
++ if (flags & ~VBGL_IOC_AGC_FLAGS_VALID_MASK)
++ return -EINVAL;
++
++ if ((or_mask | not_mask) & ~VMMDEV_GUEST_CAPABILITIES_MASK)
++ return -EINVAL;
++
++ return vbg_acquire_session_capabilities(gdev, session, or_mask,
++ not_mask, flags, false);
++}
++
+ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
+ struct vbg_session *session, struct vbg_ioctl_set_guest_caps *caps)
+ {
+@@ -1554,6 +1713,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
+ return vbg_ioctl_interrupt_all_wait_events(gdev, session, data);
+ case VBG_IOCTL_CHANGE_FILTER_MASK:
+ return vbg_ioctl_change_filter_mask(gdev, session, data);
++ case VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES:
++ return vbg_ioctl_acquire_guest_capabilities(gdev, session, data);
+ case VBG_IOCTL_CHANGE_GUEST_CAPABILITIES:
+ return vbg_ioctl_change_guest_capabilities(gdev, session, data);
+ case VBG_IOCTL_CHECK_BALLOON:
+diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
+index dc745a033164..ab4bf64e2cec 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.h
++++ b/drivers/virt/vboxguest/vboxguest_core.h
+@@ -117,6 +117,15 @@ struct vbg_dev {
+ */
+ u32 event_filter_host;
+
++ /**
++ * Guest capabilities which have been switched to acquire_mode.
++ */
++ u32 acquire_mode_guest_caps;
++ /**
++ * Guest capabilities acquired by vbg_acquire_session_capabilities().
++ * Only one session can acquire a capability at a time.
++ */
++ u32 acquired_guest_caps;
+ /**
+ * Usage counters for guest capabilities requested through
+ * vbg_set_session_capabilities(). Indexed by capability bit
+@@ -164,6 +173,11 @@ struct vbg_session {
+ * host filter. Protected by vbg_gdev.session_mutex.
+ */
+ u32 event_filter;
++ /**
++ * Guest capabilities acquired by vbg_acquire_session_capabilities().
++ * Only one session can acquire a capability at a time.
++ */
++ u32 acquired_guest_caps;
+ /**
+ * Guest capabilities set through vbg_set_session_capabilities().
+ * A capability claimed by any guest session will be reported to the
+diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h
+index f79d7abe27db..15125f6ec60d 100644
+--- a/include/uapi/linux/vboxguest.h
++++ b/include/uapi/linux/vboxguest.h
+@@ -257,6 +257,30 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8);
+ _IOWR('V', 12, struct vbg_ioctl_change_filter)
+
+
++/** VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES data structure. */
++struct vbg_ioctl_acquire_guest_caps {
++ /** The header. */
++ struct vbg_ioctl_hdr hdr;
++ union {
++ struct {
++ /** Flags (VBGL_IOC_AGC_FLAGS_XXX). */
++ __u32 flags;
++ /** Capabilities to set (VMMDEV_GUEST_SUPPORTS_XXX). */
++ __u32 or_mask;
++ /** Capabilities to drop (VMMDEV_GUEST_SUPPORTS_XXX). */
++ __u32 not_mask;
++ } in;
++ } u;
++};
++VMMDEV_ASSERT_SIZE(vbg_ioctl_acquire_guest_caps, 24 + 12);
++
++#define VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE 0x00000001
++#define VBGL_IOC_AGC_FLAGS_VALID_MASK 0x00000001
++
++#define VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES \
++ _IOWR('V', 13, struct vbg_ioctl_acquire_guest_caps)
++
++
+ /** VBG_IOCTL_CHANGE_GUEST_CAPABILITIES data structure. */
+ struct vbg_ioctl_set_guest_caps {
+ /** The header. */
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch b/0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch
new file mode 100644
index 000000000..3362eaddf
--- /dev/null
+++ b/0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch
@@ -0,0 +1,130 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 15:30:29 +0200
+Subject: [PATCH] virt: vbox: Add vbg_set_host_capabilities() helper function
+
+Add vbg_set_host_capabilities() helper function, this is a preparation
+patch for adding support for the VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 79 ++++++++++++++-----------
+ 1 file changed, 46 insertions(+), 33 deletions(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index aee5eff229f2..15b3cb618c6e 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -661,6 +661,48 @@ static int vbg_reset_host_capabilities(struct vbg_dev *gdev)
+ return vbg_status_code_to_errno(rc);
+ }
+
++/**
++ * Set guest capabilities on the host.
++ * Must be called with gdev->session_mutex hold.
++ * Return: 0 or negative errno value.
++ * @gdev: The Guest extension device.
++ * @session: The session.
++ * @session_termination: Set if we're called by the session cleanup code.
++ */
++static int vbg_set_host_capabilities(struct vbg_dev *gdev,
++ struct vbg_session *session,
++ bool session_termination)
++{
++ struct vmmdev_mask *req;
++ u32 caps;
++ int rc;
++
++ WARN_ON(!mutex_is_locked(&gdev->session_mutex));
++
++ caps = gdev->set_guest_caps_tracker.mask;
++
++ if (gdev->guest_caps_host == caps)
++ return 0;
++
++ /* On termination the requestor is the kernel, as we're cleaning up. */
++ req = vbg_req_alloc(sizeof(*req), VMMDEVREQ_SET_GUEST_CAPABILITIES,
++ session_termination ? VBG_KERNEL_REQUEST :
++ session->requestor);
++ if (!req) {
++ gdev->guest_caps_host = U32_MAX;
++ return -ENOMEM;
++ }
++
++ req->or_mask = caps;
++ req->not_mask = ~caps;
++ rc = vbg_req_perform(gdev, req);
++ vbg_req_free(req, sizeof(*req));
++
++ gdev->guest_caps_host = (rc >= 0) ? caps : U32_MAX;
++
++ return vbg_status_code_to_errno(rc);
++}
++
+ /**
+ * Sets the guest capabilities for a session. Takes the session spinlock.
+ * Return: 0 or negative errno value.
+@@ -678,23 +720,8 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+ u32 or_mask, u32 not_mask,
+ bool session_termination)
+ {
+- struct vmmdev_mask *req;
+ u32 changed, previous;
+- int rc, ret = 0;
+-
+- /*
+- * Allocate a request buffer before taking the spinlock, when
+- * the session is being terminated the requestor is the kernel,
+- * as we're cleaning up.
+- */
+- req = vbg_req_alloc(sizeof(*req), VMMDEVREQ_SET_GUEST_CAPABILITIES,
+- session_termination ? VBG_KERNEL_REQUEST :
+- session->requestor);
+- if (!req) {
+- if (!session_termination)
+- return -ENOMEM;
+- /* Ignore allocation failure, we must do session cleanup. */
+- }
++ int ret = 0;
+
+ mutex_lock(&gdev->session_mutex);
+
+@@ -709,23 +736,10 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+ goto out;
+
+ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
+- or_mask = gdev->set_guest_caps_tracker.mask;
+-
+- if (gdev->guest_caps_host == or_mask || !req)
+- goto out;
+-
+- gdev->guest_caps_host = or_mask;
+- req->or_mask = or_mask;
+- req->not_mask = ~or_mask;
+- rc = vbg_req_perform(gdev, req);
+- if (rc < 0) {
+- ret = vbg_status_code_to_errno(rc);
+-
+- /* Failed, roll back (unless it's session termination time). */
+- gdev->guest_caps_host = U32_MAX;
+- if (session_termination)
+- goto out;
+
++ ret = vbg_set_host_capabilities(gdev, session, session_termination);
++ /* Roll back on failure, unless it's session termination time. */
++ if (ret < 0 && !session_termination) {
+ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
+ session->set_guest_caps);
+ session->set_guest_caps = previous;
+@@ -733,7 +747,6 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+
+ out:
+ mutex_unlock(&gdev->session_mutex);
+- vbg_req_free(req, sizeof(*req));
+
+ return ret;
+ }
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Fix-VBGL_IOCTL_VMMDEV_REQUEST_BIG-and-_LOG.patch b/0001-virt-vbox-Fix-VBGL_IOCTL_VMMDEV_REQUEST_BIG-and-_LOG.patch
new file mode 100644
index 000000000..daf372ec2
--- /dev/null
+++ b/0001-virt-vbox-Fix-VBGL_IOCTL_VMMDEV_REQUEST_BIG-and-_LOG.patch
@@ -0,0 +1,123 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 12:21:30 +0200
+Subject: [PATCH] virt: vbox: Fix VBGL_IOCTL_VMMDEV_REQUEST_BIG and _LOG req
+ numbers to match upstream
+
+Until this commit the mainline kernel version (this version) of the
+vboxguest module contained a bug where it defined
+VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG using
+_IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead of
+_IO(V, ...) as the out of tree VirtualBox upstream version does.
+
+Since the VirtualBox userspace bits are always built against VirtualBox
+upstream's headers, this means that so far the mainline kernel version
+of the vboxguest module has been failing these 2 ioctls with -ENOTTY.
+I guess that VBGL_IOCTL_VMMDEV_REQUEST_BIG is never used causing us to
+not hit that one and sofar the vboxguest driver has failed to actually
+log any log messages passed it through VBGL_IOCTL_LOG.
+
+This commit changes the VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG
+defines to match the out of tree VirtualBox upstream vboxguest version,
+while keeping compatibility with the old wrong request defines so as
+to not break the kernel ABI in case someone has been using the old
+request defines.
+
+Fixes: f6ddd094f579 ("virt: Add vboxguest driver for Virtual Box Guest integration UAPI")
+Cc: stable@vger.kernel.org
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 4 +++-
+ drivers/virt/vboxguest/vboxguest_core.h | 15 +++++++++++++++
+ drivers/virt/vboxguest/vboxguest_linux.c | 3 ++-
+ include/uapi/linux/vboxguest.h | 4 ++--
+ 4 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index b690a8a4bf9e..8fab04e76c14 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -1520,7 +1520,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
+
+ /* For VMMDEV_REQUEST hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT */
+ if (req_no_size == VBG_IOCTL_VMMDEV_REQUEST(0) ||
+- req == VBG_IOCTL_VMMDEV_REQUEST_BIG)
++ req == VBG_IOCTL_VMMDEV_REQUEST_BIG ||
++ req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT)
+ return vbg_ioctl_vmmrequest(gdev, session, data);
+
+ if (hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT)
+@@ -1558,6 +1559,7 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
+ case VBG_IOCTL_HGCM_CALL(0):
+ return vbg_ioctl_hgcm_call(gdev, session, f32bit, data);
+ case VBG_IOCTL_LOG(0):
++ case VBG_IOCTL_LOG_ALT(0):
+ return vbg_ioctl_log(data);
+ }
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
+index 4188c12b839f..77c3a9c8255d 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.h
++++ b/drivers/virt/vboxguest/vboxguest_core.h
+@@ -15,6 +15,21 @@
+ #include <linux/vboxguest.h>
+ #include "vmmdev.h"
+
++/*
++ * The mainline kernel version (this version) of the vboxguest module
++ * contained a bug where it defined VBGL_IOCTL_VMMDEV_REQUEST_BIG and
++ * VBGL_IOCTL_LOG using _IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead
++ * of _IO(V, ...) as the out of tree VirtualBox upstream version does.
++ *
++ * These _ALT definitions keep compatibility with the wrong defines the
++ * mainline kernel version used for a while.
++ * Note the VirtualBox userspace bits have always been built against
++ * VirtualBox upstream's headers, so this is likely not necessary. But
++ * we must never break our ABI so we keep these around to be 100% sure.
++ */
++#define VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)
++#define VBG_IOCTL_LOG_ALT(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)
++
+ struct vbg_session;
+
+ /** VBox guest memory balloon. */
+diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c
+index 6e8c0f1c1056..32c2c52f7e84 100644
+--- a/drivers/virt/vboxguest/vboxguest_linux.c
++++ b/drivers/virt/vboxguest/vboxguest_linux.c
+@@ -131,7 +131,8 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,
+ * the need for a bounce-buffer and another copy later on.
+ */
+ is_vmmdev_req = (req & ~IOCSIZE_MASK) == VBG_IOCTL_VMMDEV_REQUEST(0) ||
+- req == VBG_IOCTL_VMMDEV_REQUEST_BIG;
++ req == VBG_IOCTL_VMMDEV_REQUEST_BIG ||
++ req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT;
+
+ if (is_vmmdev_req)
+ buf = vbg_req_alloc(size, VBG_IOCTL_HDR_TYPE_DEFAULT,
+diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h
+index 9cec58a6a5ea..f79d7abe27db 100644
+--- a/include/uapi/linux/vboxguest.h
++++ b/include/uapi/linux/vboxguest.h
+@@ -103,7 +103,7 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20);
+
+
+ /* IOCTL to perform a VMM Device request larger then 1KB. */
+-#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)
++#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IO('V', 3)
+
+
+ /** VBG_IOCTL_HGCM_CONNECT data structure. */
+@@ -198,7 +198,7 @@ struct vbg_ioctl_log {
+ } u;
+ };
+
+-#define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)
++#define VBG_IOCTL_LOG(s) _IO('V', 9)
+
+
+ /** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Fix-guest-capabilities-mask-check.patch b/0001-virt-vbox-Fix-guest-capabilities-mask-check.patch
new file mode 100644
index 000000000..77dbde8f5
--- /dev/null
+++ b/0001-virt-vbox-Fix-guest-capabilities-mask-check.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 13:23:06 +0200
+Subject: [PATCH] virt: vbox: Fix guest capabilities mask check
+
+Check the passed in capabilities against VMMDEV_GUEST_CAPABILITIES_MASK
+instead of against VMMDEV_EVENT_VALID_EVENT_MASK.
+This tightens the allowed mask from 0x7ff to 0x7.
+
+Fixes: 0ba002bc4393 ("virt: Add vboxguest driver for Virtual Box Guest integration")
+Cc: stable@vger.kernel.org
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 2 +-
+ drivers/virt/vboxguest/vmmdev.h | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index 8fab04e76c14..18ebd7a6af98 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -1444,7 +1444,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
+ or_mask = caps->u.in.or_mask;
+ not_mask = caps->u.in.not_mask;
+
+- if ((or_mask | not_mask) & ~VMMDEV_EVENT_VALID_EVENT_MASK)
++ if ((or_mask | not_mask) & ~VMMDEV_GUEST_CAPABILITIES_MASK)
+ return -EINVAL;
+
+ ret = vbg_set_session_capabilities(gdev, session, or_mask, not_mask,
+diff --git a/drivers/virt/vboxguest/vmmdev.h b/drivers/virt/vboxguest/vmmdev.h
+index 6337b8d75d96..21f408120e3f 100644
+--- a/drivers/virt/vboxguest/vmmdev.h
++++ b/drivers/virt/vboxguest/vmmdev.h
+@@ -206,6 +206,8 @@ VMMDEV_ASSERT_SIZE(vmmdev_mask, 24 + 8);
+ * not.
+ */
+ #define VMMDEV_GUEST_SUPPORTS_GRAPHICS BIT(2)
++/* The mask of valid capabilities, for sanity checking. */
++#define VMMDEV_GUEST_CAPABILITIES_MASK 0x00000007U
+
+ /** struct vmmdev_hypervisorinfo - Hypervisor info structure. */
+ struct vmmdev_hypervisorinfo {
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch b/0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch
new file mode 100644
index 000000000..b9a90c4cd
--- /dev/null
+++ b/0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 11:24:43 +0200
+Subject: [PATCH] virt: vbox: Log unknown ioctl requests as error
+
+Every now and then upstream adds new ioctls without notifying us,
+log unknown ioctl requests as an error to catch these.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index ffd76b949276..e0e343d0ba93 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -1739,7 +1739,7 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
+ return vbg_ioctl_log(data);
+ }
+
+- vbg_debug("VGDrvCommonIoCtl: Unknown req %#08x\n", req);
++ vbg_err("Userspace made an unknown ioctl req %#08x\n", req);
+ return -ENOTTY;
+ }
+
+--
+2.26.2
+
diff --git a/0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch b/0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch
new file mode 100644
index 000000000..e92eac034
--- /dev/null
+++ b/0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch
@@ -0,0 +1,103 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 19 May 2020 14:33:13 +0200
+Subject: [PATCH] virt: vbox: Rename guest_caps struct members to
+ set_guest_caps
+
+Rename guest_caps[_tracker] struct members to set_guest_caps[_tracker]
+this is a preparation patch for adding support for the
+VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
+---
+ drivers/virt/vboxguest/vboxguest_core.c | 20 ++++++++++----------
+ drivers/virt/vboxguest/vboxguest_core.h | 9 +++++----
+ 2 files changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
+index 18ebd7a6af98..aee5eff229f2 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.c
++++ b/drivers/virt/vboxguest/vboxguest_core.c
+@@ -699,17 +699,17 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+ mutex_lock(&gdev->session_mutex);
+
+ /* Apply the changes to the session mask. */
+- previous = session->guest_caps;
+- session->guest_caps |= or_mask;
+- session->guest_caps &= ~not_mask;
++ previous = session->set_guest_caps;
++ session->set_guest_caps |= or_mask;
++ session->set_guest_caps &= ~not_mask;
+
+ /* If anything actually changed, update the global usage counters. */
+- changed = previous ^ session->guest_caps;
++ changed = previous ^ session->set_guest_caps;
+ if (!changed)
+ goto out;
+
+- vbg_track_bit_usage(&gdev->guest_caps_tracker, changed, previous);
+- or_mask = gdev->guest_caps_tracker.mask;
++ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
++ or_mask = gdev->set_guest_caps_tracker.mask;
+
+ if (gdev->guest_caps_host == or_mask || !req)
+ goto out;
+@@ -726,9 +726,9 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
+ if (session_termination)
+ goto out;
+
+- vbg_track_bit_usage(&gdev->guest_caps_tracker, changed,
+- session->guest_caps);
+- session->guest_caps = previous;
++ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
++ session->set_guest_caps);
++ session->set_guest_caps = previous;
+ }
+
+ out:
+@@ -1452,7 +1452,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
+ if (ret)
+ return ret;
+
+- caps->u.out.session_caps = session->guest_caps;
++ caps->u.out.session_caps = session->set_guest_caps;
+ caps->u.out.global_caps = gdev->guest_caps_host;
+
+ return 0;
+diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
+index 77c3a9c8255d..dc745a033164 100644
+--- a/drivers/virt/vboxguest/vboxguest_core.h
++++ b/drivers/virt/vboxguest/vboxguest_core.h
+@@ -118,11 +118,12 @@ struct vbg_dev {
+ u32 event_filter_host;
+
+ /**
+- * Usage counters for guest capabilities. Indexed by capability bit
++ * Usage counters for guest capabilities requested through
++ * vbg_set_session_capabilities(). Indexed by capability bit
+ * number, one count per session using a capability.
+ * Protected by session_mutex.
+ */
+- struct vbg_bit_usage_tracker guest_caps_tracker;
++ struct vbg_bit_usage_tracker set_guest_caps_tracker;
+ /**
+ * The guest capabilities last reported to the host (or UINT32_MAX).
+ * Protected by session_mutex.
+@@ -164,11 +165,11 @@ struct vbg_session {
+ */
+ u32 event_filter;
+ /**
+- * Guest capabilities for this session.
++ * Guest capabilities set through vbg_set_session_capabilities().
+ * A capability claimed by any guest session will be reported to the
+ * host. Protected by vbg_gdev.session_mutex.
+ */
+- u32 guest_caps;
++ u32 set_guest_caps;
+ /** VMMDEV_REQUESTOR_* flags */
+ u32 requestor;
+ /** Set on CANCEL_ALL_WAITEVENTS, protected by vbg_devevent_spinlock. */
+--
+2.26.2
+
diff --git a/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch b/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch
deleted file mode 100644
index ec107ba09..000000000
--- a/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 520e902d864930e2d4f329983d9ae9781a24231f Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones@redhat.com>
-Date: Mon, 2 Oct 2017 18:18:30 -0400
-Subject: [PATCH 3/3] Make get_cert_list() use efi_status_to_str() to print
- error messages.
-
-Signed-off-by: Peter Jones <pjones@redhat.com>
----
- security/integrity/platform_certs/load_uefi.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
-index 9ef34c44fd1..13a2826715d 100644
---- a/security/integrity/platform_certs/load_uefi.c
-+++ b/security/integrity/platform_certs/load_uefi.c
-@@ -51,7 +51,8 @@ static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
- }
-
- if (status != EFI_BUFFER_TOO_SMALL) {
-- pr_err("Couldn't get size: 0x%lx\n", status);
-+ pr_err("Couldn't get size: %s (0x%lx)\n",
-+ efi_status_to_str(status), status);
- return efi_status_to_err(status);
- }
-
-@@ -64,7 +65,8 @@ static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
- status = efi.get_variable(name, guid, NULL, &lsize, db);
- if (status != EFI_SUCCESS) {
- kfree(db);
-- pr_err("Error reading db var: 0x%lx\n", status);
-+ pr_err("Error reading db var: %s (0x%lx)\n",
-+ efi_status_to_str(status), status);
- return efi_status_to_err(status);
- }
-
---
-2.15.0
-
diff --git a/20200505_leo_yan_linaro_org.patch b/20200505_leo_yan_linaro_org.patch
new file mode 100644
index 000000000..9674efab9
--- /dev/null
+++ b/20200505_leo_yan_linaro_org.patch
@@ -0,0 +1,70 @@
+From MAILER-DAEMON Wed May 6 20:19:37 2020
+From: Leo Yan <leo.yan@linaro.org>
+To: Arnaldo Carvalho de Melo <acme@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Tor Jeremiassen <tor@ti.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
+Subject: [PATCH] perf cs-etm: Move defined of traceid_list
+Date: Tue, 05 May 2020 21:36:42 +0800
+Message-Id: <20200505133642.4756-1-leo.yan@linaro.org>
+List-Id: <linux-arm-kernel.lists.infradead.org>
+Cc: Leo Yan <leo.yan@linaro.org>
+Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
+Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+
+The variable 'traceid_list' is defined in the header file cs-etm.h,
+if multiple C files include cs-etm.h the compiler might complaint for
+multiple definition of 'traceid_list'.
+
+To fix multiple definition error, move the definition of 'traceid_list'
+into cs-etm.c.
+
+Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
+Reported-by: Thomas Backlund <tmb@mageia.org>
+Signed-off-by: Leo Yan <leo.yan@linaro.org>
+Tested-by: Thomas Backlund <tmb@mageia.org>
+Tested-by: Mike Leach <mike.leach@linaro.org>
+Reviewed-by: Mike Leach <mike.leach@linaro.org>
+Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+---
+ tools/perf/util/cs-etm.c | 3 +++
+ tools/perf/util/cs-etm.h | 3 ---
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
+index 62d2f9b9ce1b..381d9708e9bd 100644
+--- a/tools/perf/util/cs-etm.c
++++ b/tools/perf/util/cs-etm.c
+@@ -94,6 +94,9 @@ struct cs_etm_queue {
+ struct cs_etm_traceid_queue **traceid_queues;
+ };
+
++/* RB tree for quick conversion between traceID and metadata pointers */
++static struct intlist *traceid_list;
++
+ static int cs_etm__update_queues(struct cs_etm_auxtrace *etm);
+ static int cs_etm__process_queues(struct cs_etm_auxtrace *etm);
+ static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
+diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
+index 650ecc2a6349..4ad925d6d799 100644
+--- a/tools/perf/util/cs-etm.h
++++ b/tools/perf/util/cs-etm.h
+@@ -114,9 +114,6 @@ enum cs_etm_isa {
+ CS_ETM_ISA_T32,
+ };
+
+-/* RB tree for quick conversion between traceID and metadata pointers */
+-struct intlist *traceid_list;
+-
+ struct cs_etm_queue;
+
+ struct cs_etm_packet {
+--
+2.17.1
+
+
+_______________________________________________
+linux-arm-kernel mailing list
+linux-arm-kernel@lists.infradead.org
+http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
+
diff --git a/ARM-Enable-thermal-support-for-Raspberry-Pi-4.patch b/ARM-Enable-thermal-support-for-Raspberry-Pi-4.patch
deleted file mode 100644
index 86824875b..000000000
--- a/ARM-Enable-thermal-support-for-Raspberry-Pi-4.patch
+++ /dev/null
@@ -1,905 +0,0 @@
-From patchwork Tue Jan 7 18:15:54 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <wahrenst@gmx.net>
-X-Patchwork-Id: 11321573
-Return-Path:
- <SRS0=75uJ=24=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D8381398
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:16:25 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 0478120848
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:16:24 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="SQ2gKFhN";
- dkim=fail reason="signature verification failed" (1024-bit key)
- header.d=gmx.net header.i=@gmx.net header.b="BJDhWiM+"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0478120848
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=gmx.net
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=YkqzhAYhCTWbi2xiP7xxu+Dn8Q8DmCRb4IJ4Bu0zhz8=; b=SQ2gKFhNqib/g5IS6Ax5bJ6+91
- NnToAV0XRtMvD+Mv//d/rvzEQuagdTXc7G1qFGgWXJVH3dbQAnlgt/iNOwtDxAT/4PcAn4h5HFAag
- 66kkhMcZAbA7JExXlnqfMil9fKX3gFJPxRophEP+3IPQkJpQyaYcSgCT7q1qWI0ea7WoySKITupFB
- /zqJdAB1FovALLqUMblrq+3yz5V5mtmXHbZ9XlaH2vZivUkozyl7y2lTwVupfEMEOX3tMsZKKw7kO
- 3zP1295r9jZD5AxI56MIxKUhe09ZgdaStZfRckzxKLVvphRbmbdj/a5lDLwebJ01BvFOZMnhxpSiD
- oPP03MfQ==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotOw-00044e-SA; Tue, 07 Jan 2020 18:16:22 +0000
-Received: from mout.gmx.net ([212.227.15.19])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotOo-0003u6-Ni
- for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2020 18:16:16 +0000
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
- s=badeba3b8450; t=1578420965;
- bh=u7twVNjh2D9zy5OC10Di3QMaWd8qSsrGW9KSWjAYn3g=;
- h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;
- b=BJDhWiM+5P9ZadhIRk4bTNFKVwW+JTvjQQxBte6Z9/lEi/hUMLjX6X6wI0UsdG/9q
- F4Cwa0tCAECdod5u4KiSRbsYOd1o4Z/dYru23Wk+v5LX/L1GSxqimU6Rt6Y750q8m7
- H8qhNz2GpltKbfQYfiCht8+4Noq2Ir1n+/dUhyGU=
-X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
-Received: from localhost.localdomain ([37.4.249.154]) by mail.gmx.com
- (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id
- 1M6llE-1im9Zy3f6U-008MHP; Tue, 07 Jan 2020 19:16:05 +0100
-From: Stefan Wahren <wahrenst@gmx.net>
-To: Zhang Rui <rui.zhang@intel.com>,
- Daniel Lezcano <daniel.lezcano@linaro.org>,
- Amit Kucheria <amit.kucheria@verdurent.com>,
- Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
-Subject: [PATCH V3 1/4] dt-bindings: Add Broadcom AVS RO thermal
-Date: Tue, 7 Jan 2020 19:15:54 +0100
-Message-Id: <1578420957-32229-2-git-send-email-wahrenst@gmx.net>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-References: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-X-Provags-ID: V03:K1:JNoVLD/m7l4v/En9GYWWvMF90Sn/VtIIReEvqeT1ahKtoJ1LkyQ
- iAtYBYTb+NwFUEidrSbyieU8GW35aLLzyYQnuJTNqPmnSbG2PnoXvhwHuDsxvWSwUy6mkwH
- 8ZEA1Til7h0N3jLmIx+k620EBhcirK4sOEO1dRoCyQ0YuU8w1s6WymV1wzmIWI654AscZ9o
- J8IrwX+k75qsiQ2SovoOg==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:1m7ABTNKeYs=:dwivK5EisaHNhkVyhbAPYp
- kvAhhRRErs0LcQc8ZbpEAx/yq5NZ5xne4VViuO86ljYW/FoCw48Pz8APxSxRAFasQ5XgUJLP5
- TwCvRfPRrdfLO3tE5KvLJTW7FJPetXyuRGB9vpPgp8f7UmdUL542Li3JvUZ33oouVIjMEPek6
- eJ7EymgiCWO2bamuE79cyu30HsDd1LGBBQrzvFwQleMU8BbbLmaiQtIfSxdPKqyjHm+bvLtDP
- uK/ei0MTgAsXPpgIdHoGsb71RQ0HY5PtjoLmMsNb3Nvcu9FNWgu+ybES1IfFGXvrkd1C8fgCB
- Q5VlqL1b7kUD0EHnh7rjg8rGKBiaqdQCE0rsj3GJDHLnhxpSblechYL1CIMYh0+YmL8VtDREe
- qzbJ3wdWDTKF1F8njEuuvjb05/C/4X6IzbpEWS5uxJ9wVdqWX2b6MpQQ7x7H4B88IHb0/IU+D
- vdYY8z+R3R5MkQzZJngkBLWIif2N/omDDhmHv+9TJcHmvbZJaDpHIfZ0rdtGe50zbA3DaQjjs
- bDwDylhHw0I+Hc8nBJUH7PN84Fiiime6VMByUd9PFiy9cpm2bP6AwEi1Mwefb1URWcmgwnYEe
- JmxWZoJ8JfGcW8ITKWyEuka8Ux5E2Ci1R82cWYUo5brxrZvFcYg2pUnUwpOysMZzLKCUWy2FL
- QwuEZfTk676yMpqbF1y0Xsuf+c9Q9pOvwzC3N+VKiDm3UOdnS5kmkaDAtRFJVCderrdeMv11a
- S2iZm2wNIvmHXsogK8savP05nVqWUbyf8h2vR0jlTRBz2kAyQmtZrJyPLBjww/6Vrx7SeElxk
- alcdmtEi3tdo6eMkRsFebFaCUPqItnfbJbHbXJ4udFSh4fsjduS3UppT4JbCCzqm+XNGVrUqR
- BT9vCmRbySk5wIT3D0Eg76wFeIZv4OSRzQguvVF9jkBp1Rpg++L8ryT16Wlox17PM5Er2T8Hn
- DvtQYG2N0H4cY1aJW/zPeQBWHH1uSqJfAew37CAL+skNaSTa0vFcZ767XBCfg6RLfXyKh85qm
- Gt8gRY7Js2eGw9uR74OlrgJ4TIun187UAelKzqsGADORGyoHo1fMJuk0Mdiowqu+iX5qn3+cE
- hCcZPwE2VuH0H9J8fUNRrotICpKdurbLvl40ubrd7Ke2b80dNLZfLbLnOKHSQyYy7TFJ8FgZ0
- eSlGh0KXP7kZU1n2gIGKqpYdthjTXDHyHw9QqRUStYpd/WtcY5d4gxnomwYCghPPhaIzjeHkD
- ifQLPwagP2YYxjG2ZH8f8ZQSh3kEP4r9bbTGpIw==
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200107_101615_067475_AF11981B
-X-CRM114-Status: GOOD ( 11.10 )
-X-Spam-Score: -0.2 (/)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-0.2 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.15.19 listed in list.dnswl.org]
- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
- provider (wahrenst[at]gmx.net)
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
- envelope-from domain
- 0.1 DKIM_SIGNED Message has a DKIM or DK signature,
- not necessarily
- valid
- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
- author's domain
- -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
- Stefan Wahren <wahrenst@gmx.net>, linux-arm-kernel@lists.infradead.org,
- linux-pm@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-Since the BCM2711 doesn't have a AVS TMON block, the thermal information
-must be retrieved from the AVS ring oscillator block. This block is part
-of the AVS monitor which contains a bunch of raw sensors.
-
-Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
-Reviewed-by: Rob Herring <robh@kernel.org>
-Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
- .../bindings/thermal/brcm,avs-ro-thermal.yaml | 45 ++++++++++++++++++++++
- 1 file changed, 45 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
-
---
-2.7.4
-
-diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
-new file mode 100644
-index 0000000..98e7b57
---- /dev/null
-+++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
-@@ -0,0 +1,45 @@
-+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-+%YAML 1.2
-+---
-+$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
-+$schema: http://devicetree.org/meta-schemas/core.yaml#
-+
-+title: Broadcom AVS ring oscillator thermal
-+
-+maintainers:
-+ - Stefan Wahren <wahrenst@gmx.net>
-+
-+description: |+
-+ The thermal node should be the child of a syscon node with the
-+ required property:
-+
-+ - compatible: Should be one of the following:
-+ "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
-+
-+ Refer to the the bindings described in
-+ Documentation/devicetree/bindings/mfd/syscon.txt
-+
-+properties:
-+ compatible:
-+ const: brcm,bcm2711-thermal
-+
-+ reg:
-+ maxItems: 1
-+
-+required:
-+ - compatible
-+ - reg
-+
-+examples:
-+ - |
-+ avs-monitor@7d5d2000 {
-+ compatible = "brcm,bcm2711-avs-monitor",
-+ "syscon", "simple-mfd";
-+ reg = <0x7d5d2000 0xf00>;
-+
-+ thermal: thermal {
-+ compatible = "brcm,bcm2711-thermal";
-+ #thermal-sensor-cells = <0>;
-+ };
-+ };
-+...
-
-From patchwork Tue Jan 7 18:15:55 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <wahrenst@gmx.net>
-X-Patchwork-Id: 11321579
-Return-Path:
- <SRS0=75uJ=24=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EEC4138D
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:17:14 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 1A18F20848
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:17:14 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="WN1BmRCI";
- dkim=fail reason="signature verification failed" (1024-bit key)
- header.d=gmx.net header.i=@gmx.net header.b="JbSBDGbs"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A18F20848
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=gmx.net
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=rd33uxZir356e7wb2uZqLp6zepYzCUaWcTH20TBa6Qk=; b=WN1BmRCI/FB6C4+ssKo3wCeIYT
- 5K0oT/RSBHeB2bGbPVTr2hxGUgjDDUXvnyAUw5RMItV3h54Q8JS41AP+v6VpB99bd0X+8HrC3rHa9
- ZD6AcP0l8Qovx8Tk427GW5beomc7Z0mUK9NY2xfcEc81gfGAOa0+cOMBAoj7OSqAe3qXB4e/X0uWO
- Z8MrJvtd7wZzzvsXaEKac7C+gzrIZbm108W/rSS2205m8+TdzBCWB1PK23JgnqLZDzWt2Z0bfBI+W
- Yy4G5buoin/9QXdofS3uI/23A833iKxHljZL12/xWtwCy70/sqWVvTv13U3aKNh5SzqQ2zBi4nT+1
- ed+Q4ktg==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotPk-0004my-Pu; Tue, 07 Jan 2020 18:17:12 +0000
-Received: from mout.gmx.net ([212.227.15.18])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotOp-0003ud-1M
- for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2020 18:16:18 +0000
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
- s=badeba3b8450; t=1578420965;
- bh=4mbXLn8R9HTqHSqjDYTVnf33y1TLbPgq1QZsQUXuORI=;
- h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;
- b=JbSBDGbsT0C/YiJLKHHclDX+IekngU601r/NZUXbm7pEwIYsEG9Fpom2kM2knFKu6
- P8bgl9yGKGMF3bKRLNYwPzCNgXdBIDyzI8MsZOrBpZG4jgG62ofrIuBWMuCDJ2if7S
- 9nt5L4RoIxNX7cPNA8tE7jX2d15dzT534YUlWCzQ=
-X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
-Received: from localhost.localdomain ([37.4.249.154]) by mail.gmx.com
- (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id
- 1M7sDg-1il3eJ1VuE-0053xL; Tue, 07 Jan 2020 19:16:05 +0100
-From: Stefan Wahren <wahrenst@gmx.net>
-To: Zhang Rui <rui.zhang@intel.com>,
- Daniel Lezcano <daniel.lezcano@linaro.org>,
- Amit Kucheria <amit.kucheria@verdurent.com>,
- Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
-Subject: [PATCH V3 2/4] thermal: Add BCM2711 thermal driver
-Date: Tue, 7 Jan 2020 19:15:55 +0100
-Message-Id: <1578420957-32229-3-git-send-email-wahrenst@gmx.net>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-References: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-X-Provags-ID: V03:K1:yFvB7JDgtfyjUut8k1Chkrb/ErSVsg3EvQyWqLPXb8cBJL7dcQK
- dsv56Ee8bmn70zRFQcp+ZxoKnJOLsQX8yr4SSStLpZInOQB1eFljwNlqO1yvOMTchBW9aNV
- 8K/3K5y1XYvkIucOrqA4mcg/Abn6C2HRj+YX30kIzWXSZJYVPfGO7BlReGxXXeOS3RN/0+v
- AxjdzIeF7ITk0B2E8IlXg==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:jTzlGkSo9bo=:dlU7pPc0rf9QUy9ZULoDP9
- 8GSLL1VdjzaySpcK+jGdXJmnrTtTdrwOVCM13Yj+OFiXY9BhB02v3Y1/GACb0zByQF6m5R+HY
- E9rP1h/ZotZ106drpf22Cq8qEcdAIN5naIaEYooguO0tmeziCzo2zdEeRvJQpiw0XPxJzNMRM
- 6r/2TRXgeXb53bBysAa4tCjXgXGwqtbF0WKTAsWBjogBF/6lwK2AgGFC8X4mY7XOv8GZOq+EO
- eCr92WcgDG5MIwJF7G+Q/SWbTCV+S7Fs8D52Iy3YYtdNKYJa8Mq2PmZs+zx2feLAmwfSxGctw
- EuEMw9cv1bA2tVzuUn7GiFQYGlJpxGvvCrxvU6F99yw9ECI3c3zIOHKmsXPlWMBQo9AuD/0rF
- P//MLHaS7rzJds2En+JKdP/bAR2XxC/qCtHnF7VIxMkbrXUU69CYWVTAz5gaxFv5CtBY5kqmi
- /AkDqAJimergmP6IIVtmEpgO5aE2KcbFFWtqt8e+OshhR/JDJ6JP8+kZUnbV9e0nY2cUJQqeT
- n30n/BPVfHDvMlXeHpI//Eo90SBCEVY9BRd90Q/9tmyRckXcLt+mK9USdZAkyrq7X+eXNlB2b
- QPHkn7XPbEso/0K2GzZCEO+kh5IKoYf4o53VM++6q7SDY48oU7MGG29P36RlK40W4wxgYcnbQ
- G6ofOpVasFvQlsfoWZAy3tMP3h7pzSXTMzfb+oBl+20O/5R32GpSWt/jO/Rfhyk+Ho+MGiQwA
- TqHZK+xG6BWesd9jIKv+A0n/NnxbHfylDpSRa0x4Al27WH1GQcN70HE+B91a58+3NmNd8cl1u
- nR++5B6h+UhxHjwY3mJFn6JaJE9tzHZYUcYYH6JeUq03cFXZC9Fxdns96ofekPi24KiO9T49q
- byceV+B8w4shzosvTwbuExqTP6JvIQU0VGVNzFhWlFvoMardYHn0PWKlIy16TPVaRXEL7yl2U
- +TRzGy2pXi4g1TkFMGGmRU17UYWsREIKw3+RqOSuq8riGSWZrUgVbk2wJLp/0kS4pLMUzaF/a
- QMemNPTBJfdX15J9IiNHnOMDGmEdpRucbFs9HYRn4HhWDMl1TskP5nyUiG8p+7ET3PLjS+r4K
- IFzT7g2tghwbdcDkMOjwK1CFXVblw2fUa5gjZoLCAb+psUornL0pyskLONpUQDgX+FONMdu5C
- gXIa+nu2CgDmi+mxoDIx4hSim5yfx1eGeryexRr5UiX4wdT0jXDx3nyfK+z9DTgBbIwY0D0qM
- gN5jbjyZRfDrlBl1cMJHAWyDEdL42xvNhWkeV0Q==
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200107_101615_404914_F8328398
-X-CRM114-Status: GOOD ( 17.41 )
-X-Spam-Score: -0.2 (/)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-0.2 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.15.18 listed in list.dnswl.org]
- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
- provider (wahrenst[at]gmx.net)
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
- envelope-from domain
- 0.1 DKIM_SIGNED Message has a DKIM or DK signature,
- not necessarily
- valid
- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
- author's domain
- -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
- Stefan Wahren <wahrenst@gmx.net>, linux-arm-kernel@lists.infradead.org,
- linux-pm@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This adds the thermal sensor driver for the Broadcom BCM2711 SoC,
-which is placed on the Raspberry Pi 4. The driver only provides
-SoC temperature reading so far.
-
-Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
- drivers/thermal/broadcom/Kconfig | 7 ++
- drivers/thermal/broadcom/Makefile | 1 +
- drivers/thermal/broadcom/bcm2711_thermal.c | 129 +++++++++++++++++++++++++++++
- 3 files changed, 137 insertions(+)
- create mode 100644 drivers/thermal/broadcom/bcm2711_thermal.c
-
---
-2.7.4
-
-diff --git a/drivers/thermal/broadcom/Kconfig b/drivers/thermal/broadcom/Kconfig
-index cf43e15..061f1db 100644
---- a/drivers/thermal/broadcom/Kconfig
-+++ b/drivers/thermal/broadcom/Kconfig
-@@ -1,4 +1,11 @@
- # SPDX-License-Identifier: GPL-2.0-only
-+config BCM2711_THERMAL
-+ tristate "Broadcom AVS RO thermal sensor driver"
-+ depends on ARCH_BCM2835 || COMPILE_TEST
-+ depends on THERMAL_OF && MFD_SYSCON
-+ help
-+ Support for thermal sensors on Broadcom BCM2711 SoCs.
-+
- config BCM2835_THERMAL
- tristate "Thermal sensors on bcm2835 SoC"
- depends on ARCH_BCM2835 || COMPILE_TEST
-diff --git a/drivers/thermal/broadcom/Makefile b/drivers/thermal/broadcom/Makefile
-index 490ab1f..c917b24 100644
---- a/drivers/thermal/broadcom/Makefile
-+++ b/drivers/thermal/broadcom/Makefile
-@@ -1,4 +1,5 @@
- # SPDX-License-Identifier: GPL-2.0-only
-+obj-$(CONFIG_BCM2711_THERMAL) += bcm2711_thermal.o
- obj-$(CONFIG_BCM2835_THERMAL) += bcm2835_thermal.o
- obj-$(CONFIG_BRCMSTB_THERMAL) += brcmstb_thermal.o
- obj-$(CONFIG_BCM_NS_THERMAL) += ns-thermal.o
-diff --git a/drivers/thermal/broadcom/bcm2711_thermal.c b/drivers/thermal/broadcom/bcm2711_thermal.c
-new file mode 100644
-index 0000000..b1d3c4d
---- /dev/null
-+++ b/drivers/thermal/broadcom/bcm2711_thermal.c
-@@ -0,0 +1,129 @@
-+// SPDX-License-Identifier: GPL-2.0+
-+/*
-+ * Broadcom AVS RO thermal sensor driver
-+ *
-+ * based on brcmstb_thermal
-+ *
-+ * Copyright (C) 2020 Stefan Wahren
-+ */
-+
-+#include <linux/bitops.h>
-+#include <linux/clk.h>
-+#include <linux/device.h>
-+#include <linux/err.h>
-+#include <linux/io.h>
-+#include <linux/kernel.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/of_device.h>
-+#include <linux/regmap.h>
-+#include <linux/thermal.h>
-+
-+#include "../thermal_hwmon.h"
-+
-+#define AVS_RO_TEMP_STATUS 0x200
-+ #define AVS_RO_TEMP_STATUS_valid_msk (BIT(16) | BIT(10))
-+ #define AVS_RO_TEMP_STATUS_data_msk GENMASK(9, 0)
-+
-+struct bcm2711_thermal_priv {
-+ struct regmap *regmap;
-+ struct device *dev;
-+ struct thermal_zone_device *thermal;
-+};
-+
-+static int bcm2711_get_temp(void *data, int *temp)
-+{
-+ struct bcm2711_thermal_priv *priv = data;
-+ int slope = thermal_zone_get_slope(priv->thermal);
-+ int offset = thermal_zone_get_offset(priv->thermal);
-+ u32 val;
-+ int ret;
-+ long t;
-+
-+ ret = regmap_read(priv->regmap, AVS_RO_TEMP_STATUS, &val);
-+ if (ret)
-+ return ret;
-+
-+ if (!(val & AVS_RO_TEMP_STATUS_valid_msk)) {
-+ dev_err(priv->dev, "reading not valid\n");
-+ return -EIO;
-+ }
-+
-+ val &= AVS_RO_TEMP_STATUS_data_msk;
-+
-+ /* Convert a HW code to a temperature reading (millidegree celsius) */
-+ t = slope * val + offset;
-+ if (t < 0)
-+ *temp = 0;
-+ else
-+ *temp = t;
-+
-+ return 0;
-+}
-+
-+static const struct thermal_zone_of_device_ops bcm2711_thermal_of_ops = {
-+ .get_temp = bcm2711_get_temp,
-+};
-+
-+static const struct of_device_id bcm2711_thermal_id_table[] = {
-+ { .compatible = "brcm,bcm2711-thermal" },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, bcm2711_thermal_id_table);
-+
-+static int bcm2711_thermal_probe(struct platform_device *pdev)
-+{
-+ struct thermal_zone_device *thermal;
-+ struct bcm2711_thermal_priv *priv;
-+ struct device *dev = &pdev->dev;
-+ struct device_node *parent;
-+ struct regmap *regmap;
-+ int ret;
-+
-+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-+ if (!priv)
-+ return -ENOMEM;
-+
-+ /* get regmap from syscon node */
-+ parent = of_get_parent(dev->of_node); /* parent should be syscon node */
-+ regmap = syscon_node_to_regmap(parent);
-+ of_node_put(parent);
-+ if (IS_ERR(regmap)) {
-+ ret = PTR_ERR(regmap);
-+ dev_err(dev, "failed to get regmap: %d\n", ret);
-+ return ret;
-+ }
-+ priv->regmap = regmap;
-+ priv->dev = dev;
-+
-+ thermal = devm_thermal_zone_of_sensor_register(dev, 0, priv,
-+ &bcm2711_thermal_of_ops);
-+ if (IS_ERR(thermal)) {
-+ ret = PTR_ERR(thermal);
-+ dev_err(dev, "could not register sensor: %d\n", ret);
-+ return ret;
-+ }
-+
-+ priv->thermal = thermal;
-+
-+ thermal->tzp->no_hwmon = false;
-+ ret = thermal_add_hwmon_sysfs(thermal);
-+ if (ret)
-+ return ret;
-+
-+ return 0;
-+}
-+
-+static struct platform_driver bcm2711_thermal_driver = {
-+ .probe = bcm2711_thermal_probe,
-+ .driver = {
-+ .name = "bcm2711_thermal",
-+ .of_match_table = bcm2711_thermal_id_table,
-+ },
-+};
-+module_platform_driver(bcm2711_thermal_driver);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Stefan Wahren");
-+MODULE_DESCRIPTION("Broadcom AVS RO thermal sensor driver");
-
-From patchwork Tue Jan 7 18:15:56 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <wahrenst@gmx.net>
-X-Patchwork-Id: 11321577
-Return-Path:
- <SRS0=75uJ=24=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E3DA138D
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:17:03 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id D9D1920848
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:17:02 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="ik3qMsDb";
- dkim=fail reason="signature verification failed" (1024-bit key)
- header.d=gmx.net header.i=@gmx.net header.b="dq7Bd9O5"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9D1920848
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=gmx.net
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=3Jmn1DTkt6iHJo4nKs/bZbMCywPz9fpkSPNvdSNQuD0=; b=ik3qMsDbyY7oIjPW5+6nccv1h7
- oTVZ+0E3fy/IjWBwKY5FfojiU4G096Dur2GDb1EeYQdJPYEusJkMhhogib+k9m2wcU+Ho8h2EZeKF
- Jll43seK5zjOJwQO8N/Jv0wOd2UqlWswRCLEoAUgGbDEU5gYR8Ue2MPlCFqJMBEeZ8KC3SeWIfYgi
- fLTUD74gERNQ7YL6u8uEq8Nx6BUgyW0/HUQ3Km8r9DMV7NbRoKm07M+5sKldGxSqxMRWUkW1aq9YV
- cQW+XybMtNHLfcTOJYOvyQApYP0CK8q+I+xtd4SM150gTyCKEhDUAk+UFEUnJ9pDgTeh6yGqQqv5I
- BmWUq8aQ==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotPZ-0004bP-3J; Tue, 07 Jan 2020 18:17:01 +0000
-Received: from mout.gmx.net ([212.227.15.18])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotOp-0003ue-1N
- for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2020 18:16:18 +0000
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
- s=badeba3b8450; t=1578420966;
- bh=aWglA2PfdwtIHtm2mDExM6LOMnFuWnZiRAiujdoAMW8=;
- h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;
- b=dq7Bd9O5pRIoP35pWiEbr3vIwPVUIZdztKslWibSe4sYkKnlLAbn2Tly+3mecxMX4
- plidbchinnJHsr1byo3468d32bXORW9ghvyBGxOn50Zs4URcLnZ6Mj9sUeBhkRs9yz
- afE9G4bQQvpFS9Aa/ELtd1yj+QyiHuLkxDC5oxSA=
-X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
-Received: from localhost.localdomain ([37.4.249.154]) by mail.gmx.com
- (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id
- 1MoO2E-1jUaw13WDg-00onqT; Tue, 07 Jan 2020 19:16:05 +0100
-From: Stefan Wahren <wahrenst@gmx.net>
-To: Zhang Rui <rui.zhang@intel.com>,
- Daniel Lezcano <daniel.lezcano@linaro.org>,
- Amit Kucheria <amit.kucheria@verdurent.com>,
- Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
-Subject: [PATCH V3 3/4] ARM: dts: bcm2711: Enable thermal
-Date: Tue, 7 Jan 2020 19:15:56 +0100
-Message-Id: <1578420957-32229-4-git-send-email-wahrenst@gmx.net>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-References: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-X-Provags-ID: V03:K1:nnCaGh26y5WZ7Y+Du8wo80ycqs5dd0zUOiU8IyxmRBut3vh+kbS
- hWpSdRT6jUdGy0zdQC4p0GWbndKZlE8PcisuGyj1O6JS+PZF0lvHyqMgg93jy1GqVcINVAT
- m9kwkGNF9DR+OKHvvajSgRYV5gRp3BIZpN7jBioSwAr2xEZCwI3aFYzZL0/nM1tdwZi08do
- f9kojNp6jUr4vT/oaeL8g==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:eypfnYKWbbQ=:3vD1OpSV55xSk4yzLYUc8F
- ss17pikWe3sKTkGoI3BFvSL2dMCJntwyDYvcMBefgSpGcgd2z3eK3CjpAhx5Z35UkdK7cr6ep
- lsMn51ut2iKyCZ1FGpPY5mDJroBPqJFUDxNCh0BAQJn/Vyd5aWvtIStBX8vhSZeSLwOpkgYtq
- INAm+O2AD+nw7gqpqya1+fc2pMPvW9S2I6sYSLCuOP1gqJraZSDDgUp8hn2DbLlhVPgD5MSet
- VUMc8Crizcnnhu+3dx1SJtxS/Vykaw4X0YVr5/sV3mNPI9sqSWpndRywGkJfhs6ruCBSTZPqD
- lR/PwjRR58iwZ2J2O3oBfahA9dQYEQNQqxsQxIcJ296R7AyEpq8PePDjT6Z0qKPaIP1KiR9/8
- bq+HA6Be/peO7fvhwDxJNy0yQSnXJDjLqu8Gop7ybALxiK+c+alVEtyBJwd7wL+FCdL3hNnHi
- gGsohKQNAHfMWgJXcnYBqr/mcSjQf07IYNuidrfs7biH4SIVMneDFBM+bDyXpPKaHrAf3f8AJ
- 6RwAQAuSBoGRrR6lOKFx63o3tmAI4R/vfyosXbLXm8nheUTCB3tmW+/J++QiCrafqCA8rzZCF
- eZgIaNncjMxPxyUmV608AjOWEnE6xf0cXC57Cw6mOq19oVtp3qesCkDvbyaAskyCX2IXZJ7hp
- R4RpokH33Uhu6IaIyGV2LuP3GZK9YmAOG1CZc6l5u7se8WRN7N1n2HkLLe2u6DM/WjZmdT7HR
- uOAbQn7NWoke1DXdnj57eY3h0Y+OJlYvhkdh7pWVUiWRLRqOOnD+ME2CRRRqD6RlKuSilEpeu
- qvPT2/eJFvIL4pejhNNrPB2C3RiHhHmyeUbQo+2Na5X/sLn3vwhfDac57ev5NKIeD7FPGPgzr
- 4YF/E/rSQhXylqhqwomJMyE77jIsa09OD73gY0UYIW38Z3bfj1MlNpM3Dzq68Uy7ILcunYJgS
- JYdohNePZWLE8JBRj3z04HdTs4ogtDQLrJZEoPqWJwyYXpIblHXV3hcEm99M6ZiBCVeJQz2st
- narTYNER7iY19YC1Bc/z0ahz5Y/DiKEZI1KwPjmqzwl9DtgiFpahgvJ/htv/UFTl6UZHKBM9g
- k/uJbVQbreofaRz730uheNJu0ruz6QvWSAMa21Ge+vl84CGbcDOtC2ydUXhbjpVYa12n5Eg5A
- pQS244oqQTS3hWqK8xrFNm4jmBcCDAPGv3xVBW1Jg6pRqybLzta5jN+FfPaMbWh0yVV5VO6qu
- tKLGAzCzdsJVRK3ly7+y1msAZ7D0THx91qoghfQ==
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200107_101615_402374_8C4F49A4
-X-CRM114-Status: GOOD ( 10.05 )
-X-Spam-Score: -0.2 (/)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-0.2 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
- provider (wahrenst[at]gmx.net)
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.15.18 listed in list.dnswl.org]
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
- envelope-from domain
- 0.1 DKIM_SIGNED Message has a DKIM or DK signature,
- not necessarily
- valid
- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
- author's domain
- -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
- Stefan Wahren <wahrenst@gmx.net>, linux-arm-kernel@lists.infradead.org,
- linux-pm@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding
-the AVS monitor and a subnode for the thermal part.
-
-Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
-Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
- arch/arm/boot/dts/bcm2711.dtsi | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
---
-2.7.4
-
-diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
-index 961bed8..96f341d 100644
---- a/arch/arm/boot/dts/bcm2711.dtsi
-+++ b/arch/arm/boot/dts/bcm2711.dtsi
-@@ -66,6 +66,17 @@
- IRQ_TYPE_LEVEL_HIGH)>;
- };
-
-+ avs_monitor: avs-monitor@7d5d2000 {
-+ compatible = "brcm,bcm2711-avs-monitor",
-+ "syscon", "simple-mfd";
-+ reg = <0x7d5d2000 0xf00>;
-+
-+ thermal: thermal {
-+ compatible = "brcm,bcm2711-thermal";
-+ #thermal-sensor-cells = <0>;
-+ };
-+ };
-+
- dma: dma@7e007000 {
- compatible = "brcm,bcm2835-dma";
- reg = <0x7e007000 0xb00>;
-@@ -363,6 +374,7 @@
-
- &cpu_thermal {
- coefficients = <(-487) 410040>;
-+ thermal-sensors = <&thermal>;
- };
-
- &dsi0 {
-
-From patchwork Tue Jan 7 18:15:57 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <wahrenst@gmx.net>
-X-Patchwork-Id: 11321575
-Return-Path:
- <SRS0=75uJ=24=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E84E3138D
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:16:44 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id C25C220848
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Tue, 7 Jan 2020 18:16:44 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="EHM8n8KN";
- dkim=fail reason="signature verification failed" (1024-bit key)
- header.d=gmx.net header.i=@gmx.net header.b="Idmw230V"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C25C220848
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=gmx.net
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=FI3zHZWFfRXQ5XfvKcNW0c7MrnTDIP/1CsQtLlw0qhk=; b=EHM8n8KNF/sE/U53eeci7J27D/
- L6VFKJctUZqFEOfeRIf3CEPuX3Pk7huocVD4K/yvqJnuSIC9Sje4gjYORUjtz0xEW8CKjxjf5sbo4
- iYEtnBsDYtEQWwTsMvpNbOtR9yZQiY7fMcQK8nhC4R5A9vtv43ytxgkV84YVL5SLBHhGZjzUmuRb9
- FKBtltjzocTcD8mbcVN6Lvjcu/a4J5A+/LHRH7nzuQ7ChaJ9Mw/y7zJHcaBuEOhba/3Dzd9+03jLD
- oOExZgjTpNtAXsLye/WHt/BTHen3PFAjAAMLvLPE6fEStapg1ZuOa2ueopvmsCSgQ7KMmBHUkX5NX
- 8kfsNepQ==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotPH-0004Mo-B2; Tue, 07 Jan 2020 18:16:43 +0000
-Received: from mout.gmx.net ([212.227.15.19])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iotOo-0003u5-Ni
- for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2020 18:16:16 +0000
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
- s=badeba3b8450; t=1578420966;
- bh=ywvSvkZtxIFgQK2uzodzJ55BZghcFbFAXSLbAwo36wY=;
- h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;
- b=Idmw230VWPBhZW2v+dAYw62P6JElxPEL/uqCuoHO0gDvDK3VOnfVdcv9d1ALNkZ2+
- Y+8kPpr9BiXxUfm8bw+Xmjv/SzBxlFpg2EK/a8Hg1b+OzEQC+AII1OlGsc5FjmhCdA
- PYd0h0yBiUAl3qCFDZaEL6GR5SqLeAQ2sKdGgVLY=
-X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
-Received: from localhost.localdomain ([37.4.249.154]) by mail.gmx.com
- (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id
- 1M1HZo-1irdDo1LiM-002s6V; Tue, 07 Jan 2020 19:16:06 +0100
-From: Stefan Wahren <wahrenst@gmx.net>
-To: Zhang Rui <rui.zhang@intel.com>,
- Daniel Lezcano <daniel.lezcano@linaro.org>,
- Amit Kucheria <amit.kucheria@verdurent.com>,
- Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
-Subject: [PATCH V3 4/4] ARM: configs: Build BCM2711 thermal as module
-Date: Tue, 7 Jan 2020 19:15:57 +0100
-Message-Id: <1578420957-32229-5-git-send-email-wahrenst@gmx.net>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-References: <1578420957-32229-1-git-send-email-wahrenst@gmx.net>
-X-Provags-ID: V03:K1:KgT8/xCsDfTXBG/ZvIRxjN+W6EAwuQgL8jv7F25Vy4z+LXj8G1P
- FvRXVhgSwOlulZ964d6rnvX7HL7dcwoY5KFt4EhM20cYoQ7YJ90EDHTamYirCxIqbox1UqU
- ONycfR3lNn3uKEv5yBZAPy3RJBy/loio9XdwmoBs6tYkYaaVTtIztndrmforVufG7I03eQv
- W3OI55XFGJevmqp5FLjsQ==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:XO0bOe0Ep8o=:kSgMi1gYunuPgzCu/XiJe8
- 55cXkb2VEpp+0ZB7lgktyFvshluW/8SnuuoMm0yhsBOUju5moUy3EZx62VduAycSWKQ78+NnI
- nuuYaeMimJEZFIkXd/bIo8qA7TQgY5Ai7wFwAtnufeOK6yhqeXld+O6drS9SE7OUPwiRaFLvX
- a4z3zZIJ/WSdgxfIjZJl+1A8tbqJu7QHtc7BvlrnNqu0L7T9RP/4wKZFs+iqJxgb56ONYX6aW
- eJEAdrGioHnjoWK1N2opYc6mYPThXU7WIGI67W1LEp4sdfzemZwQzCuEX4itQkAnL2DeCQ5Ga
- TB3twKe/JfrKyCgWbB1LzE4zIekmdDkNCLP1O1ry0t5+zdTGCZqjgF0aW1XQwp7nUNAKqvnkR
- oGFH00fcZrTjP7GTsAHM1SFbj/j8S4XbS2KGdNqEc+X3ozKoe941uA4inBhtY+DCHFbDc82RB
- saG1XiaXGsPKwjXuAqFoy+XoGrMHnHWh5g9mP7Zd8K8eY9UW2y2qLVLlIfRct6viL+vCIg5bq
- bBOs7WNQuQK66Q8JwSFVNkWe5cjQ4sjCurxBOCJu6414eyACNqp75abbUH3UXbZ1ZWeQB05gV
- pAQjr6XZtxFBUpzRIscP1mp92bxLC60clMvMwMY7L3J2tmJzvf+8KaEZ46/AXpMn/5UHILhV8
- RHgsmsQOZtPYbgegdxdoBc4kR22+31P9QayG4NNZpKN6TEFlqDfoNUbNez4dIJleG22IlSiAm
- HnfbzPvVXjeK2JiZBcfGTDhAuoGbB8Fj+2eQ26gxDe6zKM6e+8/ggitNae4Dbbw0frlGYT/H6
- Wawodx5tZYYdi+XZ6h7xR7gVz+qUtDxU3/g+269QUGswvjIS+a6z7lzkEuyK7V6ieV8u7Eh4X
- sN1khUObrdWcgax2sqRsD0RD05hMRw3yVlf9xuWpUo/SWo+mVR/rXK6YkXDiRCL5kmMzaJ/ZF
- b4PktMNM1fUynsV780QqPYKWWfAdvMlDCWnofVBqBUPHArgmZeAkiFzfCcecwEBz+jAxwUZmE
- ANzUWQENqeKB/qYYpxtBwoBTpfvKT9aAuk83/Xxf8kHjFo2JE0BLWXqe+/i6FQUtXR4VmNd2G
- UVWlOQJHCJCaXerv7dUwcdFH2tluzwimauf3xv9Suhg06gzqG2AzZefj6DSqfSFAESG+a1r9m
- u1k2ZLky+lFSekVHbbxsc5W/2rXnl7YvbHVJ1NqvR0HhNJjn7ISBZGvzeJz7kFQCKjXZiQA76
- XprBZmCVmQkyOoIyjE6h4g5xdzecqsXUyniZ7MA==
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200107_101615_064044_029A3653
-X-CRM114-Status: GOOD ( 10.12 )
-X-Spam-Score: -0.2 (/)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-0.2 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
- provider (wahrenst[at]gmx.net)
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.15.19 listed in list.dnswl.org]
- -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
- envelope-from domain
- 0.1 DKIM_SIGNED Message has a DKIM or DK signature,
- not necessarily
- valid
- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
- author's domain
- -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
- Stefan Wahren <wahrenst@gmx.net>, linux-arm-kernel@lists.infradead.org,
- linux-pm@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This builds the BCM2711 thermal driver as module for the Raspberry Pi 4.
-
-Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
- arch/arm/configs/multi_v7_defconfig | 1 +
- arch/arm64/configs/defconfig | 1 +
- 2 files changed, 2 insertions(+)
-
---
-2.7.4
-
-diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
-index 3f1b96d..f5d19cc 100644
---- a/arch/arm/configs/multi_v7_defconfig
-+++ b/arch/arm/configs/multi_v7_defconfig
-@@ -496,6 +496,7 @@ CONFIG_IMX_THERMAL=y
- CONFIG_ROCKCHIP_THERMAL=y
- CONFIG_RCAR_THERMAL=y
- CONFIG_ARMADA_THERMAL=y
-+CONFIG_BCM2711_THERMAL=m
- CONFIG_BCM2835_THERMAL=m
- CONFIG_BRCMSTB_THERMAL=m
- CONFIG_ST_THERMAL_MEMMAP=y
-diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
-index 6a83ba2..b2f6673 100644
---- a/arch/arm64/configs/defconfig
-+++ b/arch/arm64/configs/defconfig
-@@ -442,6 +442,7 @@ CONFIG_ROCKCHIP_THERMAL=m
- CONFIG_RCAR_THERMAL=y
- CONFIG_RCAR_GEN3_THERMAL=y
- CONFIG_ARMADA_THERMAL=y
-+CONFIG_BCM2711_THERMAL=m
- CONFIG_BCM2835_THERMAL=m
- CONFIG_BRCMSTB_THERMAL=m
- CONFIG_EXYNOS_THERMAL=y
diff --git a/Raspberry-Pi-4-PCIe-support.patch b/Raspberry-Pi-4-PCIe-support.patch
deleted file mode 100644
index d87f6f512..000000000
--- a/Raspberry-Pi-4-PCIe-support.patch
+++ /dev/null
@@ -1,1995 +0,0 @@
-From patchwork Mon Dec 16 11:01:07 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-X-Patchwork-Id: 11293801
-Return-Path:
- <SRS0=BOSQ=2G=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A73D930
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:01:44 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id B59B620700
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:01:43 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="cb79RIet"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B59B620700
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=suse.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
- List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
- Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
- Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
- List-Owner; bh=BIaxi8TW6/7kc2+ri3jCQvUDcvRqu4DcRQH+PcSrqFE=; b=cb79RIetq9xDMB
- WjzGeSpWqqJFBoypJgtl/f0hMNvDJo23OqyPAA3XiHnd/1OiFVtIaHj0rl0/7mBUqLfVJzym3AJq8
- MbvE4H5sbjLxLskuQnjMJoITqCzh1fly6HBgLOQJRHZU3rLBVnkbRPgRv+nRt5Nqi5M3aJp1a3qsL
- 8hPhH1PkGeofP4XjfWvnfl7nhg21+dC3Bxu86pb1aKPogRL6Rw4FGwOawF3ySHMGue4t9OfGcUh+B
- NI08Au81lvrfZys52Hfb5S7BXmj8vd/1fGqW97GjBdZcHjdUNMfFHHlC4SmLwJqvKdVWpgJH01sdP
- 29RmPOdzQSiBF+WIhx2w==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo8E-0003Jg-15; Mon, 16 Dec 2019 11:01:42 +0000
-Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de)
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo80-00036F-By; Mon, 16 Dec 2019 11:01:30 +0000
-X-Virus-Scanned: by amavisd-new at test-mx.suse.de
-Received: from relay2.suse.de (unknown [195.135.220.254])
- by mx1.suse.de (Postfix) with ESMTP id 0A418ABF4;
- Mon, 16 Dec 2019 11:01:27 +0000 (UTC)
-From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-To: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org,
- Florian Fainelli <f.fainelli@gmail.com>,
- bcm-kernel-feedback-list@broadcom.com,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Bjorn Helgaas <bhelgaas@google.com>
-Subject: [PATCH v5 1/6] dt-bindings: PCI: Add bindings for brcmstb's PCIe
- device
-Date: Mon, 16 Dec 2019 12:01:07 +0100
-Message-Id: <20191216110113.30436-2-nsaenzjulienne@suse.de>
-X-Mailer: git-send-email 2.24.0
-In-Reply-To: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-References: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-MIME-Version: 1.0
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20191216_030128_695398_7DDDD9AA
-X-CRM114-Status: GOOD ( 12.44 )
-X-Spam-Score: -2.3 (--)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-2.3 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [195.135.220.15 listed in wl.mailspike.net]
- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,
- medium trust [195.135.220.15 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Mark Rutland <mark.rutland@arm.com>, Rob Herring <robh@kernel.org>,
- mbrugger@suse.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
- phil@raspberrypi.org, jeremy.linton@arm.com,
- Rob Herring <robh+dt@kernel.org>,
- wahrenst@gmx.net, james.quinlan@broadcom.com,
- linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-From: Jim Quinlan <james.quinlan@broadcom.com>
-
-The DT bindings description of the brcmstb PCIe device is described.
-This node can only be used for now on the Raspberry Pi 4.
-
-Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
-Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Reviewed-by: Rob Herring <robh@kernel.org>
-Reviewed-by: Andrew Murray <andrew.murray@arm.com>
----
-
-Changes since v2:
- - Add pci reference schema
- - Drop all default properties
- - Assume msi-controller and msi-parent are properly defined
- - Add num entries on multiple properties
- - use unevaluatedProperties
- - Update required properties
- - Fix license
-
-Changes since v1:
- - Fix commit Subject
- - Remove linux,pci-domain
-
-This was based on Jim's original submission[1], converted to yaml and
-adapted to the RPi4 case.
-
-[1] https://patchwork.kernel.org/patch/10605937/
-
- .../bindings/pci/brcm,stb-pcie.yaml | 97 +++++++++++++++++++
- 1 file changed, 97 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
-
-diff --git a/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml b/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
-new file mode 100644
-index 000000000000..77d3e81a437b
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
-@@ -0,0 +1,97 @@
-+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-+%YAML 1.2
-+---
-+$id: http://devicetree.org/schemas/pci/brcm,stb-pcie.yaml#
-+$schema: http://devicetree.org/meta-schemas/core.yaml#
-+
-+title: Brcmstb PCIe Host Controller Device Tree Bindings
-+
-+maintainers:
-+ - Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-+
-+allOf:
-+ - $ref: /schemas/pci/pci-bus.yaml#
-+
-+properties:
-+ compatible:
-+ const: brcm,bcm2711-pcie # The Raspberry Pi 4
-+
-+ reg:
-+ maxItems: 1
-+
-+ interrupts:
-+ minItems: 1
-+ maxItems: 2
-+ items:
-+ - description: PCIe host controller
-+ - description: builtin MSI controller
-+
-+ interrupt-names:
-+ minItems: 1
-+ maxItems: 2
-+ items:
-+ - const: pcie
-+ - const: msi
-+
-+ ranges:
-+ maxItems: 1
-+
-+ dma-ranges:
-+ maxItems: 1
-+
-+ clocks:
-+ maxItems: 1
-+
-+ clock-names:
-+ items:
-+ - const: sw_pcie
-+
-+ msi-controller:
-+ description: Identifies the node as an MSI controller.
-+
-+ msi-parent:
-+ description: MSI controller the device is capable of using.
-+
-+ brcm,enable-ssc:
-+ description: Indicates usage of spread-spectrum clocking.
-+ type: boolean
-+
-+required:
-+ - reg
-+ - dma-ranges
-+ - "#interrupt-cells"
-+ - interrupts
-+ - interrupt-names
-+ - interrupt-map-mask
-+ - interrupt-map
-+ - msi-controller
-+
-+unevaluatedProperties: false
-+
-+examples:
-+ - |
-+ #include <dt-bindings/interrupt-controller/irq.h>
-+ #include <dt-bindings/interrupt-controller/arm-gic.h>
-+
-+ scb {
-+ #address-cells = <2>;
-+ #size-cells = <1>;
-+ pcie0: pcie@7d500000 {
-+ compatible = "brcm,bcm2711-pcie";
-+ reg = <0x0 0x7d500000 0x9310>;
-+ device_type = "pci";
-+ #address-cells = <3>;
-+ #size-cells = <2>;
-+ #interrupt-cells = <1>;
-+ interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
-+ <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
-+ interrupt-names = "pcie", "msi";
-+ interrupt-map-mask = <0x0 0x0 0x0 0x7>;
-+ interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
-+ msi-parent = <&pcie0>;
-+ msi-controller;
-+ ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 0x0 0x04000000>;
-+ dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
-+ brcm,enable-ssc;
-+ };
-+ };
-
-From patchwork Mon Dec 16 11:01:08 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-X-Patchwork-Id: 11293815
-Return-Path:
- <SRS0=BOSQ=2G=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72D3D930
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:03 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 3F7AB207FF
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:03 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="ISsHC9fH"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F7AB207FF
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=suse.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
- List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
- Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
- Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
- List-Owner; bh=UdJf8Rwrz/6hs1077s5n/9efhkcR9FHAvuF0K/vLN8Y=; b=ISsHC9fHRq+60M
- 7gtGwBg+WQQOYb9jdFmwMcxGe0qeWpPaGIHMIEsnIe4XD9FwQCB/DOlaEd0YroSKG9wx+ltXjqRP6
- corbkj+3N2CbLy6xpcmwrU7Mbjs2kt7wAx86+oeF2HHVgt0LIa3b38nMkD9IIKU9cNsE/eBW8QAOz
- wBlxik6IpMapnTNb5x/QmfGMTJUfmL0t8wz7HK1aJtKRj8U99KmswxLykSrniOXw8EBd+NnZxjV5W
- 6sD8LTIHp/B5zbN06MCX9sggOhONO7PjnEkmJM68Jzwu/O+6k8MHEfGBRdTLXvkoDmW1uFhIt/u79
- nZo/2ZcH3xzpGMNR//gA==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo8W-0003bB-8M; Mon, 16 Dec 2019 11:02:00 +0000
-Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de)
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo81-00036I-17; Mon, 16 Dec 2019 11:01:31 +0000
-X-Virus-Scanned: by amavisd-new at test-mx.suse.de
-Received: from relay2.suse.de (unknown [195.135.220.254])
- by mx1.suse.de (Postfix) with ESMTP id B9907ACA7;
- Mon, 16 Dec 2019 11:01:27 +0000 (UTC)
-From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-To: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org,
- Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Subject: [PATCH v5 2/6] ARM: dts: bcm2711: Enable PCIe controller
-Date: Mon, 16 Dec 2019 12:01:08 +0100
-Message-Id: <20191216110113.30436-3-nsaenzjulienne@suse.de>
-X-Mailer: git-send-email 2.24.0
-In-Reply-To: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-References: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-MIME-Version: 1.0
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20191216_030129_211513_E7F95430
-X-CRM114-Status: GOOD ( 12.22 )
-X-Spam-Score: -2.3 (--)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-2.3 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [195.135.220.15 listed in wl.mailspike.net]
- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,
- medium trust [195.135.220.15 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: devicetree@vger.kernel.org, f.fainelli@gmail.com,
- linux-pci@vger.kernel.org,
- phil@raspberrypi.org, jeremy.linton@arm.com, mbrugger@suse.com,
- bcm-kernel-feedback-list@broadcom.com, wahrenst@gmx.net,
- james.quinlan@broadcom.com, linux-arm-kernel@lists.infradead.org,
- linux-rpi-kernel@lists.infradead.org
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This enables bcm2711's PCIe bus, which is hardwired to a VIA
-Technologies XHCI USB 3.0 controller.
-
-Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
-
-Changes since v4:
- - Rebase commit taking into account genet support series
-
-Changes since v3:
- - Remove unwarranted comment
-
-Changes since v2:
- - Remove unused interrupt-map
- - correct dma-ranges to it's full size, non power of 2 bus DMA
- constraints now supported in linux-next[1]
- - add device_type
- - rename alias from pcie_0 to pcie0
-
-Changes since v1:
- - remove linux,pci-domain
-
-[1] https://lkml.org/lkml/2019/11/21/235
-
- arch/arm/boot/dts/bcm2711.dtsi | 31 ++++++++++++++++++++++++++++++-
- 1 file changed, 30 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
-index e2f6ffb00aa9..b56388ce1216 100644
---- a/arch/arm/boot/dts/bcm2711.dtsi
-+++ b/arch/arm/boot/dts/bcm2711.dtsi
-@@ -331,7 +331,36 @@ scb {
- #address-cells = <2>;
- #size-cells = <1>;
-
-- ranges = <0x0 0x7c000000 0x0 0xfc000000 0x03800000>;
-+ ranges = <0x0 0x7c000000 0x0 0xfc000000 0x03800000>,
-+ <0x6 0x00000000 0x6 0x00000000 0x40000000>;
-+
-+ pcie0: pcie@7d500000 {
-+ compatible = "brcm,bcm2711-pcie";
-+ reg = <0x0 0x7d500000 0x9310>;
-+ device_type = "pci";
-+ #address-cells = <3>;
-+ #interrupt-cells = <1>;
-+ #size-cells = <2>;
-+ interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
-+ <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
-+ interrupt-names = "pcie", "msi";
-+ interrupt-map-mask = <0x0 0x0 0x0 0x7>;
-+ interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143
-+ IRQ_TYPE_LEVEL_HIGH>;
-+ msi-controller;
-+ msi-parent = <&pcie0>;
-+
-+ ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000
-+ 0x0 0x04000000>;
-+ /*
-+ * The wrapper around the PCIe block has a bug
-+ * preventing it from accessing beyond the first 3GB of
-+ * memory.
-+ */
-+ dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000
-+ 0x0 0xc0000000>;
-+ brcm,enable-ssc;
-+ };
-
- genet: ethernet@7d580000 {
- compatible = "brcm,bcm2711-genet-v5";
-
-From patchwork Mon Dec 16 11:01:09 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-X-Patchwork-Id: 11293817
-Return-Path:
- <SRS0=BOSQ=2G=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5258B138C
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:16 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 2BC2C206EC
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:16 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="ESaFz97K"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BC2C206EC
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=suse.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
- List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
- Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
- Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
- List-Owner; bh=+5ayi0cziQL3ZyCMj3iZr+38A6c8osp+1etjz8lMcs0=; b=ESaFz97K8D7L5Q
- eP6cOr4xBwD8JGVEOalDJHmTA7YrfsYPlyqEmoV5jf6647ddqM+dXZE2HpqGgiKBSvQmg3bbSh92t
- DokvbV8Iglu0LlQvliFFakzKq3z/SEtdiQ67DhNsyC8/6150TSWOQ3bgblVRH3pBCettQmRRCdSPG
- S0nb5uLQ0mpfLJvfcpN6lDJepIxpaCo4My4i5OPN5rCVQgW0b181kKQ0CiOpn6+RHsZ8TZQT3oGLt
- lXuYTni2GgcysGX3UNYbzsex6v8wqmSxchH+qpnwdJw7G/oxFcNTvVQ5BIjU62CZmX6qC+RjOwwnB
- LwtY7yRrtR/lXNVBKOFQ==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo8l-0003rT-Fs; Mon, 16 Dec 2019 11:02:15 +0000
-Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de)
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo82-00036x-Ea; Mon, 16 Dec 2019 11:01:34 +0000
-X-Virus-Scanned: by amavisd-new at test-mx.suse.de
-Received: from relay2.suse.de (unknown [195.135.220.254])
- by mx1.suse.de (Postfix) with ESMTP id 25A22ACC6;
- Mon, 16 Dec 2019 11:01:29 +0000 (UTC)
-From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-To: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org,
- Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
- Florian Fainelli <f.fainelli@gmail.com>,
- bcm-kernel-feedback-list@broadcom.com,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Subject: [PATCH v5 3/6] PCI: brcmstb: Add Broadcom STB PCIe host controller
- driver
-Date: Mon, 16 Dec 2019 12:01:09 +0100
-Message-Id: <20191216110113.30436-4-nsaenzjulienne@suse.de>
-X-Mailer: git-send-email 2.24.0
-In-Reply-To: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-References: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-MIME-Version: 1.0
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20191216_030130_800432_3B8FE2E4
-X-CRM114-Status: GOOD ( 18.27 )
-X-Spam-Score: -2.3 (--)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-2.3 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [195.135.220.15 listed in wl.mailspike.net]
- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,
- medium trust [195.135.220.15 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: mbrugger@suse.com, linux-pci@vger.kernel.org, phil@raspberrypi.org,
- jeremy.linton@arm.com, wahrenst@gmx.net, james.quinlan@broadcom.com,
- Bjorn Helgaas <bhelgaas@google.com>, linux-arm-kernel@lists.infradead.org,
- linux-rpi-kernel@lists.infradead.org
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-From: Jim Quinlan <james.quinlan@broadcom.com>
-
-This adds a basic driver for Broadcom's STB PCIe controller, for now
-aimed at Raspberry Pi 4's SoC, bcm2711.
-
-Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
-Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Reviewed-by: Andrew Murray <andrew.murray@arm.com>
-Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
----
-
-Changes since v3:
- - Update commit message
- - rollback roundup_pow_two usage, it'll be updated later down the line
- - Remove comment in register definition
-
-Changes since v2:
- - Correct rc_bar2_offset sign
- - Invert IRQ clear and masking in setup code
- - Use bitfield.h, redo all register ops while keeping the register
- names intact
- - Remove all SHIFT register definitions
- - Get rid of all _RB writes
- - Get rid of of_data
- - Don't iterate over inexisting dma-ranges
- - Add comment regarding dma-ranges validation
- - Small cosmetic cleanups
- - Fix license mismatch
- - Set driver Kconfig tristate
- - Didn't add any comment about the controller not being I/O coherent
- for now as I wait for Jeremy's reply
-
-Changes since v1:
- - Fix Kconfig
- - Remove pci domain check
- - Remove all MSI related code
- - Remove supend/resume code
- - Simplify link state wait routine
- - Prefix all functions
- - Use of_device_get_match_data()
- - Use devm_clk_get_optional()
- - Get rid of irq variable
- - Use STB all over the driver
- - Simplify map_bus() function
- - Fix license mismatch
- - Remove unused register definitions
- - Small cleanups, spell errors
-
-This is based on Jim's original submission[1] but adapted and tailored
-specifically to bcm2711's needs (that's the Raspberry Pi 4). Support for
-the rest of the brcmstb family will soon follow once we get support for
-multiple dma-ranges in dma/direct.
-
-[1] https://patchwork.kernel.org/patch/10605959/
-
- drivers/pci/controller/Kconfig | 8 +
- drivers/pci/controller/Makefile | 1 +
- drivers/pci/controller/pcie-brcmstb.c | 748 ++++++++++++++++++++++++++
- 3 files changed, 757 insertions(+)
- create mode 100644 drivers/pci/controller/pcie-brcmstb.c
-
-diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
-index c77069c8ee5d..27504f108ee5 100644
---- a/drivers/pci/controller/Kconfig
-+++ b/drivers/pci/controller/Kconfig
-@@ -253,6 +253,14 @@ config VMD
- To compile this driver as a module, choose M here: the
- module will be called vmd.
-
-+config PCIE_BRCMSTB
-+ tristate "Broadcom Brcmstb PCIe host controller"
-+ depends on ARCH_BCM2835 || COMPILE_TEST
-+ depends on OF
-+ help
-+ Say Y here to enable PCIe host controller support for
-+ Broadcom STB based SoCs, like the Raspberry Pi 4.
-+
- config PCI_HYPERV_INTERFACE
- tristate "Hyper-V PCI Interface"
- depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
-diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile
-index 3d4f597f15ce..01b2502a5323 100644
---- a/drivers/pci/controller/Makefile
-+++ b/drivers/pci/controller/Makefile
-@@ -28,6 +28,7 @@ obj-$(CONFIG_PCIE_MEDIATEK) += pcie-mediatek.o
- obj-$(CONFIG_PCIE_MOBIVEIL) += pcie-mobiveil.o
- obj-$(CONFIG_PCIE_TANGO_SMP8759) += pcie-tango.o
- obj-$(CONFIG_VMD) += vmd.o
-+obj-$(CONFIG_PCIE_BRCMSTB) += pcie-brcmstb.o
- # pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW
- obj-y += dwc/
-
-diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
-new file mode 100644
-index 000000000000..dd681164faa0
---- /dev/null
-+++ b/drivers/pci/controller/pcie-brcmstb.c
-@@ -0,0 +1,748 @@
-+// SPDX-License-Identifier: GPL-2.0+
-+/* Copyright (C) 2009 - 2019 Broadcom */
-+
-+#include <linux/bitfield.h>
-+#include <linux/clk.h>
-+#include <linux/compiler.h>
-+#include <linux/delay.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/io.h>
-+#include <linux/ioport.h>
-+#include <linux/irqdomain.h>
-+#include <linux/kernel.h>
-+#include <linux/list.h>
-+#include <linux/log2.h>
-+#include <linux/module.h>
-+#include <linux/of_address.h>
-+#include <linux/of_irq.h>
-+#include <linux/of_pci.h>
-+#include <linux/of_platform.h>
-+#include <linux/pci.h>
-+#include <linux/printk.h>
-+#include <linux/sizes.h>
-+#include <linux/slab.h>
-+#include <linux/string.h>
-+#include <linux/types.h>
-+
-+#include "../pci.h"
-+
-+/* BRCM_PCIE_CAP_REGS - Offset for the mandatory capability config regs */
-+#define BRCM_PCIE_CAP_REGS 0x00ac
-+
-+/* Broadcom STB PCIe Register Offsets */
-+#define PCIE_RC_CFG_VENDOR_VENDOR_SPECIFIC_REG1 0x0188
-+#define PCIE_RC_CFG_VENDOR_VENDOR_SPECIFIC_REG1_ENDIAN_MODE_BAR2_MASK 0xc
-+#define PCIE_RC_CFG_VENDOR_SPCIFIC_REG1_LITTLE_ENDIAN 0x0
-+
-+#define PCIE_RC_CFG_PRIV1_ID_VAL3 0x043c
-+#define PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK 0xffffff
-+
-+#define PCIE_RC_DL_MDIO_ADDR 0x1100
-+#define PCIE_RC_DL_MDIO_WR_DATA 0x1104
-+#define PCIE_RC_DL_MDIO_RD_DATA 0x1108
-+
-+#define PCIE_MISC_MISC_CTRL 0x4008
-+#define PCIE_MISC_MISC_CTRL_SCB_ACCESS_EN_MASK 0x1000
-+#define PCIE_MISC_MISC_CTRL_CFG_READ_UR_MODE_MASK 0x2000
-+#define PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_MASK 0x300000
-+#define PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_128 0x0
-+#define PCIE_MISC_MISC_CTRL_SCB0_SIZE_MASK 0xf8000000
-+
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LO 0x400c
-+#define PCIE_MEM_WIN0_LO(win) \
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LO + ((win) * 4)
-+
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI 0x4010
-+#define PCIE_MEM_WIN0_HI(win) \
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI + ((win) * 4)
-+
-+#define PCIE_MISC_RC_BAR1_CONFIG_LO 0x402c
-+#define PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK 0x1f
-+
-+#define PCIE_MISC_RC_BAR2_CONFIG_LO 0x4034
-+#define PCIE_MISC_RC_BAR2_CONFIG_LO_SIZE_MASK 0x1f
-+#define PCIE_MISC_RC_BAR2_CONFIG_HI 0x4038
-+
-+#define PCIE_MISC_RC_BAR3_CONFIG_LO 0x403c
-+#define PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK 0x1f
-+
-+#define PCIE_MISC_PCIE_CTRL 0x4064
-+#define PCIE_MISC_PCIE_CTRL_PCIE_L23_REQUEST_MASK 0x1
-+
-+#define PCIE_MISC_PCIE_STATUS 0x4068
-+#define PCIE_MISC_PCIE_STATUS_PCIE_PORT_MASK 0x80
-+#define PCIE_MISC_PCIE_STATUS_PCIE_DL_ACTIVE_MASK 0x20
-+#define PCIE_MISC_PCIE_STATUS_PCIE_PHYLINKUP_MASK 0x10
-+#define PCIE_MISC_PCIE_STATUS_PCIE_LINK_IN_L23_MASK 0x40
-+
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT 0x4070
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT_LIMIT_MASK 0xfff00000
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT_BASE_MASK 0xfff0
-+#define PCIE_MEM_WIN0_BASE_LIMIT(win) \
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT + ((win) * 4)
-+
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_HI 0x4080
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_HI_BASE_MASK 0xff
-+#define PCIE_MEM_WIN0_BASE_HI(win) \
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_HI + ((win) * 8)
-+
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI 0x4084
-+#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI_LIMIT_MASK 0xff
-+#define PCIE_MEM_WIN0_LIMIT_HI(win) \
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI + ((win) * 8)
-+
-+#define PCIE_MISC_HARD_PCIE_HARD_DEBUG 0x4204
-+#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK 0x2
-+#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x08000000
-+
-+#define PCIE_MSI_INTR2_STATUS 0x4500
-+#define PCIE_MSI_INTR2_CLR 0x4508
-+#define PCIE_MSI_INTR2_MASK_SET 0x4510
-+#define PCIE_MSI_INTR2_MASK_CLR 0x4514
-+
-+#define PCIE_EXT_CFG_DATA 0x8000
-+
-+#define PCIE_EXT_CFG_INDEX 0x9000
-+#define PCIE_EXT_BUSNUM_SHIFT 20
-+#define PCIE_EXT_SLOT_SHIFT 15
-+#define PCIE_EXT_FUNC_SHIFT 12
-+
-+#define PCIE_RGR1_SW_INIT_1 0x9210
-+#define PCIE_RGR1_SW_INIT_1_PERST_MASK 0x1
-+#define PCIE_RGR1_SW_INIT_1_INIT_MASK 0x2
-+
-+/* PCIe parameters */
-+#define BRCM_NUM_PCIE_OUT_WINS 0x4
-+
-+/* MDIO registers */
-+#define MDIO_PORT0 0x0
-+#define MDIO_DATA_MASK 0x7fffffff
-+#define MDIO_PORT_MASK 0xf0000
-+#define MDIO_REGAD_MASK 0xffff
-+#define MDIO_CMD_MASK 0xfff00000
-+#define MDIO_CMD_READ 0x1
-+#define MDIO_CMD_WRITE 0x0
-+#define MDIO_DATA_DONE_MASK 0x80000000
-+#define MDIO_RD_DONE(x) (((x) & MDIO_DATA_DONE_MASK) ? 1 : 0)
-+#define MDIO_WT_DONE(x) (((x) & MDIO_DATA_DONE_MASK) ? 0 : 1)
-+#define SSC_REGS_ADDR 0x1100
-+#define SET_ADDR_OFFSET 0x1f
-+#define SSC_CNTL_OFFSET 0x2
-+#define SSC_CNTL_OVRD_EN_MASK 0x8000
-+#define SSC_CNTL_OVRD_VAL_MASK 0x4000
-+#define SSC_STATUS_OFFSET 0x1
-+#define SSC_STATUS_SSC_MASK 0x400
-+#define SSC_STATUS_PLL_LOCK_MASK 0x800
-+
-+/* Internal PCIe Host Controller Information.*/
-+struct brcm_pcie {
-+ struct device *dev;
-+ void __iomem *base;
-+ struct clk *clk;
-+ struct pci_bus *root_bus;
-+ struct device_node *np;
-+ bool ssc;
-+ int gen;
-+};
-+
-+/*
-+ * This is to convert the size of the inbound "BAR" region to the
-+ * non-linear values of PCIE_X_MISC_RC_BAR[123]_CONFIG_LO.SIZE
-+ */
-+static int brcm_pcie_encode_ibar_size(u64 size)
-+{
-+ int log2_in = ilog2(size);
-+
-+ if (log2_in >= 12 && log2_in <= 15)
-+ /* Covers 4KB to 32KB (inclusive) */
-+ return (log2_in - 12) + 0x1c;
-+ else if (log2_in >= 16 && log2_in <= 35)
-+ /* Covers 64KB to 32GB, (inclusive) */
-+ return log2_in - 15;
-+ /* Something is awry so disable */
-+ return 0;
-+}
-+
-+static u32 brcm_pcie_mdio_form_pkt(int port, int regad, int cmd)
-+{
-+ u32 pkt = 0;
-+
-+ pkt |= FIELD_PREP(MDIO_PORT_MASK, port);
-+ pkt |= FIELD_PREP(MDIO_REGAD_MASK, regad);
-+ pkt |= FIELD_PREP(MDIO_CMD_MASK, cmd);
-+
-+ return pkt;
-+}
-+
-+/* negative return value indicates error */
-+static int brcm_pcie_mdio_read(void __iomem *base, u8 port, u8 regad, u32 *val)
-+{
-+ int tries;
-+ u32 data;
-+
-+ writel(brcm_pcie_mdio_form_pkt(port, regad, MDIO_CMD_READ),
-+ base + PCIE_RC_DL_MDIO_ADDR);
-+ readl(base + PCIE_RC_DL_MDIO_ADDR);
-+
-+ data = readl(base + PCIE_RC_DL_MDIO_RD_DATA);
-+ for (tries = 0; !MDIO_RD_DONE(data) && tries < 10; tries++) {
-+ udelay(10);
-+ data = readl(base + PCIE_RC_DL_MDIO_RD_DATA);
-+ }
-+
-+ *val = FIELD_GET(MDIO_DATA_MASK, data);
-+ return MDIO_RD_DONE(data) ? 0 : -EIO;
-+}
-+
-+/* negative return value indicates error */
-+static int brcm_pcie_mdio_write(void __iomem *base, u8 port,
-+ u8 regad, u16 wrdata)
-+{
-+ int tries;
-+ u32 data;
-+
-+ writel(brcm_pcie_mdio_form_pkt(port, regad, MDIO_CMD_WRITE),
-+ base + PCIE_RC_DL_MDIO_ADDR);
-+ readl(base + PCIE_RC_DL_MDIO_ADDR);
-+ writel(MDIO_DATA_DONE_MASK | wrdata, base + PCIE_RC_DL_MDIO_WR_DATA);
-+
-+ data = readl(base + PCIE_RC_DL_MDIO_WR_DATA);
-+ for (tries = 0; !MDIO_WT_DONE(data) && tries < 10; tries++) {
-+ udelay(10);
-+ data = readl(base + PCIE_RC_DL_MDIO_WR_DATA);
-+ }
-+
-+ return MDIO_WT_DONE(data) ? 0 : -EIO;
-+}
-+
-+/*
-+ * Configures device for Spread Spectrum Clocking (SSC) mode; a negative
-+ * return value indicates error.
-+ */
-+static int brcm_pcie_set_ssc(struct brcm_pcie *pcie)
-+{
-+ int pll, ssc;
-+ int ret;
-+ u32 tmp;
-+
-+ ret = brcm_pcie_mdio_write(pcie->base, MDIO_PORT0, SET_ADDR_OFFSET,
-+ SSC_REGS_ADDR);
-+ if (ret < 0)
-+ return ret;
-+
-+ ret = brcm_pcie_mdio_read(pcie->base, MDIO_PORT0,
-+ SSC_CNTL_OFFSET, &tmp);
-+ if (ret < 0)
-+ return ret;
-+
-+ u32p_replace_bits(&tmp, 1, SSC_CNTL_OVRD_EN_MASK);
-+ u32p_replace_bits(&tmp, 1, SSC_CNTL_OVRD_VAL_MASK);
-+ ret = brcm_pcie_mdio_write(pcie->base, MDIO_PORT0,
-+ SSC_CNTL_OFFSET, tmp);
-+ if (ret < 0)
-+ return ret;
-+
-+ usleep_range(1000, 2000);
-+ ret = brcm_pcie_mdio_read(pcie->base, MDIO_PORT0,
-+ SSC_STATUS_OFFSET, &tmp);
-+ if (ret < 0)
-+ return ret;
-+
-+ ssc = FIELD_GET(SSC_STATUS_SSC_MASK, tmp);
-+ pll = FIELD_GET(SSC_STATUS_PLL_LOCK_MASK, tmp);
-+
-+ return ssc && pll ? 0 : -EIO;
-+}
-+
-+/* Limits operation to a specific generation (1, 2, or 3) */
-+static void brcm_pcie_set_gen(struct brcm_pcie *pcie, int gen)
-+{
-+ u16 lnkctl2 = readw(pcie->base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKCTL2);
-+ u32 lnkcap = readl(pcie->base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKCAP);
-+
-+ lnkcap = (lnkcap & ~PCI_EXP_LNKCAP_SLS) | gen;
-+ writel(lnkcap, pcie->base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKCAP);
-+
-+ lnkctl2 = (lnkctl2 & ~0xf) | gen;
-+ writew(lnkctl2, pcie->base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKCTL2);
-+}
-+
-+static void brcm_pcie_set_outbound_win(struct brcm_pcie *pcie,
-+ unsigned int win, u64 cpu_addr,
-+ u64 pcie_addr, u64 size)
-+{
-+ u32 cpu_addr_mb_high, limit_addr_mb_high;
-+ phys_addr_t cpu_addr_mb, limit_addr_mb;
-+ int high_addr_shift;
-+ u32 tmp;
-+
-+ /* Set the base of the pcie_addr window */
-+ writel(lower_32_bits(pcie_addr), pcie->base + PCIE_MEM_WIN0_LO(win));
-+ writel(upper_32_bits(pcie_addr), pcie->base + PCIE_MEM_WIN0_HI(win));
-+
-+ /* Write the addr base & limit lower bits (in MBs) */
-+ cpu_addr_mb = cpu_addr / SZ_1M;
-+ limit_addr_mb = (cpu_addr + size - 1) / SZ_1M;
-+
-+ tmp = readl(pcie->base + PCIE_MEM_WIN0_BASE_LIMIT(win));
-+ u32p_replace_bits(&tmp, cpu_addr_mb,
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT_BASE_MASK);
-+ u32p_replace_bits(&tmp, limit_addr_mb,
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT_LIMIT_MASK);
-+ writel(tmp, pcie->base + PCIE_MEM_WIN0_BASE_LIMIT(win));
-+
-+ /* Write the cpu & limit addr upper bits */
-+ high_addr_shift =
-+ HWEIGHT32(PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_LIMIT_BASE_MASK);
-+
-+ cpu_addr_mb_high = cpu_addr_mb >> high_addr_shift;
-+ tmp = readl(pcie->base + PCIE_MEM_WIN0_BASE_HI(win));
-+ u32p_replace_bits(&tmp, cpu_addr_mb_high,
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_BASE_HI_BASE_MASK);
-+ writel(tmp, pcie->base + PCIE_MEM_WIN0_BASE_HI(win));
-+
-+ limit_addr_mb_high = limit_addr_mb >> high_addr_shift;
-+ tmp = readl(pcie->base + PCIE_MEM_WIN0_LIMIT_HI(win));
-+ u32p_replace_bits(&tmp, limit_addr_mb_high,
-+ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI_LIMIT_MASK);
-+ writel(tmp, pcie->base + PCIE_MEM_WIN0_LIMIT_HI(win));
-+}
-+
-+/* The controller is capable of serving in both RC and EP roles */
-+static bool brcm_pcie_rc_mode(struct brcm_pcie *pcie)
-+{
-+ void __iomem *base = pcie->base;
-+ u32 val = readl(base + PCIE_MISC_PCIE_STATUS);
-+
-+ return !!FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_PORT_MASK, val);
-+}
-+
-+static bool brcm_pcie_link_up(struct brcm_pcie *pcie)
-+{
-+ u32 val = readl(pcie->base + PCIE_MISC_PCIE_STATUS);
-+ u32 dla = FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_DL_ACTIVE_MASK, val);
-+ u32 plu = FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_PHYLINKUP_MASK, val);
-+
-+ return dla && plu;
-+}
-+
-+/* Configuration space read/write support */
-+static inline int brcm_pcie_cfg_index(int busnr, int devfn, int reg)
-+{
-+ return ((PCI_SLOT(devfn) & 0x1f) << PCIE_EXT_SLOT_SHIFT)
-+ | ((PCI_FUNC(devfn) & 0x07) << PCIE_EXT_FUNC_SHIFT)
-+ | (busnr << PCIE_EXT_BUSNUM_SHIFT)
-+ | (reg & ~3);
-+}
-+
-+static void __iomem *brcm_pcie_map_conf(struct pci_bus *bus, unsigned int devfn,
-+ int where)
-+{
-+ struct brcm_pcie *pcie = bus->sysdata;
-+ void __iomem *base = pcie->base;
-+ int idx;
-+
-+ /* Accesses to the RC go right to the RC registers if slot==0 */
-+ if (pci_is_root_bus(bus))
-+ return PCI_SLOT(devfn) ? NULL : base + where;
-+
-+ /* For devices, write to the config space index register */
-+ idx = brcm_pcie_cfg_index(bus->number, devfn, 0);
-+ writel(idx, pcie->base + PCIE_EXT_CFG_INDEX);
-+ return base + PCIE_EXT_CFG_DATA + where;
-+}
-+
-+static struct pci_ops brcm_pcie_ops = {
-+ .map_bus = brcm_pcie_map_conf,
-+ .read = pci_generic_config_read,
-+ .write = pci_generic_config_write,
-+};
-+
-+static inline void brcm_pcie_bridge_sw_init_set(struct brcm_pcie *pcie, u32 val)
-+{
-+ u32 tmp;
-+
-+ tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1);
-+ u32p_replace_bits(&tmp, val, PCIE_RGR1_SW_INIT_1_INIT_MASK);
-+ writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1);
-+}
-+
-+static inline void brcm_pcie_perst_set(struct brcm_pcie *pcie, u32 val)
-+{
-+ u32 tmp;
-+
-+ tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1);
-+ u32p_replace_bits(&tmp, val, PCIE_RGR1_SW_INIT_1_PERST_MASK);
-+ writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1);
-+}
-+
-+static inline int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie,
-+ u64 *rc_bar2_size,
-+ u64 *rc_bar2_offset)
-+{
-+ struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
-+ struct device *dev = pcie->dev;
-+ struct resource_entry *entry;
-+
-+ entry = resource_list_first_type(&bridge->dma_ranges, IORESOURCE_MEM);
-+ if (!entry)
-+ return -ENODEV;
-+
-+ *rc_bar2_offset = -entry->offset;
-+ *rc_bar2_size = 1ULL << fls64(entry->res->end - entry->res->start);
-+
-+ /*
-+ * We validate the inbound memory view even though we should trust
-+ * whatever the device-tree provides. This is because of an HW issue on
-+ * early Raspberry Pi 4's revisions (bcm2711). It turns out its
-+ * firmware has to dynamically edit dma-ranges due to a bug on the
-+ * PCIe controller integration, which prohibits any access above the
-+ * lower 3GB of memory. Given this, we decided to keep the dma-ranges
-+ * in check, avoiding hard to debug device-tree related issues in the
-+ * future:
-+ *
-+ * The PCIe host controller by design must set the inbound viewport to
-+ * be a contiguous arrangement of all of the system's memory. In
-+ * addition, its size mut be a power of two. To further complicate
-+ * matters, the viewport must start on a pcie-address that is aligned
-+ * on a multiple of its size. If a portion of the viewport does not
-+ * represent system memory -- e.g. 3GB of memory requires a 4GB
-+ * viewport -- we can map the outbound memory in or after 3GB and even
-+ * though the viewport will overlap the outbound memory the controller
-+ * will know to send outbound memory downstream and everything else
-+ * upstream.
-+ *
-+ * For example:
-+ *
-+ * - The best-case scenario, memory up to 3GB, is to place the inbound
-+ * region in the first 4GB of pcie-space, as some legacy devices can
-+ * only address 32bits. We would also like to put the MSI under 4GB
-+ * as well, since some devices require a 32bit MSI target address.
-+ *
-+ * - If the system memory is 4GB or larger we cannot start the inbound
-+ * region at location 0 (since we have to allow some space for
-+ * outbound memory @ 3GB). So instead it will start at the 1x
-+ * multiple of its size
-+ */
-+ if (!*rc_bar2_size || *rc_bar2_offset % *rc_bar2_size ||
-+ (*rc_bar2_offset < SZ_4G && *rc_bar2_offset > SZ_2G)) {
-+ dev_err(dev, "Invalid rc_bar2_offset/size: size 0x%llx, off 0x%llx\n",
-+ *rc_bar2_size, *rc_bar2_offset);
-+ return -EINVAL;
-+ }
-+
-+ return 0;
-+}
-+
-+static int brcm_pcie_setup(struct brcm_pcie *pcie)
-+{
-+ struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
-+ u64 rc_bar2_offset, rc_bar2_size;
-+ void __iomem *base = pcie->base;
-+ struct device *dev = pcie->dev;
-+ struct resource_entry *entry;
-+ unsigned int scb_size_val;
-+ bool ssc_good = false;
-+ struct resource *res;
-+ int num_out_wins = 0;
-+ u16 nlw, cls, lnksta;
-+ int i, ret;
-+ u32 tmp;
-+
-+ /* Reset the bridge */
-+ brcm_pcie_bridge_sw_init_set(pcie, 1);
-+
-+ usleep_range(100, 200);
-+
-+ /* Take the bridge out of reset */
-+ brcm_pcie_bridge_sw_init_set(pcie, 0);
-+
-+ tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+ tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
-+ writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+ /* Wait for SerDes to be stable */
-+ usleep_range(100, 200);
-+
-+ /* Set SCB_MAX_BURST_SIZE, CFG_READ_UR_MODE, SCB_ACCESS_EN */
-+ u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_SCB_ACCESS_EN_MASK);
-+ u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_CFG_READ_UR_MODE_MASK);
-+ u32p_replace_bits(&tmp, PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_128,
-+ PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_MASK);
-+ writel(tmp, base + PCIE_MISC_MISC_CTRL);
-+
-+ ret = brcm_pcie_get_rc_bar2_size_and_offset(pcie, &rc_bar2_size,
-+ &rc_bar2_offset);
-+ if (ret)
-+ return ret;
-+
-+ tmp = lower_32_bits(rc_bar2_offset);
-+ u32p_replace_bits(&tmp, brcm_pcie_encode_ibar_size(rc_bar2_size),
-+ PCIE_MISC_RC_BAR2_CONFIG_LO_SIZE_MASK);
-+ writel(tmp, base + PCIE_MISC_RC_BAR2_CONFIG_LO);
-+ writel(upper_32_bits(rc_bar2_offset),
-+ base + PCIE_MISC_RC_BAR2_CONFIG_HI);
-+
-+ scb_size_val = rc_bar2_size ?
-+ ilog2(rc_bar2_size) - 15 : 0xf; /* 0xf is 1GB */
-+ tmp = readl(base + PCIE_MISC_MISC_CTRL);
-+ u32p_replace_bits(&tmp, scb_size_val,
-+ PCIE_MISC_MISC_CTRL_SCB0_SIZE_MASK);
-+ writel(tmp, base + PCIE_MISC_MISC_CTRL);
-+
-+ /* disable the PCIe->GISB memory window (RC_BAR1) */
-+ tmp = readl(base + PCIE_MISC_RC_BAR1_CONFIG_LO);
-+ tmp &= ~PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK;
-+ writel(tmp, base + PCIE_MISC_RC_BAR1_CONFIG_LO);
-+
-+ /* disable the PCIe->SCB memory window (RC_BAR3) */
-+ tmp = readl(base + PCIE_MISC_RC_BAR3_CONFIG_LO);
-+ tmp &= ~PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK;
-+ writel(tmp, base + PCIE_MISC_RC_BAR3_CONFIG_LO);
-+
-+ /* Mask all interrupts since we are not handling any yet */
-+ writel(0xffffffff, pcie->base + PCIE_MSI_INTR2_MASK_SET);
-+
-+ /* clear any interrupts we find on boot */
-+ writel(0xffffffff, pcie->base + PCIE_MSI_INTR2_CLR);
-+
-+ if (pcie->gen)
-+ brcm_pcie_set_gen(pcie, pcie->gen);
-+
-+ /* Unassert the fundamental reset */
-+ brcm_pcie_perst_set(pcie, 0);
-+
-+ /*
-+ * Give the RC/EP time to wake up, before trying to configure RC.
-+ * Intermittently check status for link-up, up to a total of 100ms.
-+ */
-+ for (i = 0; i < 100 && !brcm_pcie_link_up(pcie); i += 5)
-+ msleep(5);
-+
-+ if (!brcm_pcie_link_up(pcie)) {
-+ dev_err(dev, "link down\n");
-+ return -ENODEV;
-+ }
-+
-+ if (!brcm_pcie_rc_mode(pcie)) {
-+ dev_err(dev, "PCIe misconfigured; is in EP mode\n");
-+ return -EINVAL;
-+ }
-+
-+ resource_list_for_each_entry(entry, &bridge->windows) {
-+ res = entry->res;
-+
-+ if (resource_type(res) != IORESOURCE_MEM)
-+ continue;
-+
-+ if (num_out_wins >= BRCM_NUM_PCIE_OUT_WINS) {
-+ dev_err(pcie->dev, "too many outbound wins\n");
-+ return -EINVAL;
-+ }
-+
-+ brcm_pcie_set_outbound_win(pcie, num_out_wins, res->start,
-+ res->start - entry->offset,
-+ res->end - res->start + 1);
-+ num_out_wins++;
-+ }
-+
-+ /*
-+ * For config space accesses on the RC, show the right class for
-+ * a PCIe-PCIe bridge (the default setting is to be EP mode).
-+ */
-+ tmp = readl(base + PCIE_RC_CFG_PRIV1_ID_VAL3);
-+ u32p_replace_bits(&tmp, 0x060400,
-+ PCIE_RC_CFG_PRIV1_ID_VAL3_CLASS_CODE_MASK);
-+ writel(tmp, base + PCIE_RC_CFG_PRIV1_ID_VAL3);
-+
-+ if (pcie->ssc) {
-+ ret = brcm_pcie_set_ssc(pcie);
-+ if (ret == 0)
-+ ssc_good = true;
-+ else
-+ dev_err(dev, "failed attempt to enter ssc mode\n");
-+ }
-+
-+ lnksta = readw(base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKSTA);
-+ cls = FIELD_GET(PCI_EXP_LNKSTA_CLS, lnksta);
-+ nlw = FIELD_GET(PCI_EXP_LNKSTA_NLW, lnksta);
-+ dev_info(dev, "link up, %s x%u %s\n",
-+ PCIE_SPEED2STR(cls + PCI_SPEED_133MHz_PCIX_533),
-+ nlw, ssc_good ? "(SSC)" : "(!SSC)");
-+
-+ /* PCIe->SCB endian mode for BAR */
-+ tmp = readl(base + PCIE_RC_CFG_VENDOR_VENDOR_SPECIFIC_REG1);
-+ u32p_replace_bits(&tmp, PCIE_RC_CFG_VENDOR_SPCIFIC_REG1_LITTLE_ENDIAN,
-+ PCIE_RC_CFG_VENDOR_VENDOR_SPECIFIC_REG1_ENDIAN_MODE_BAR2_MASK);
-+ writel(tmp, base + PCIE_RC_CFG_VENDOR_VENDOR_SPECIFIC_REG1);
-+
-+ /*
-+ * Refclk from RC should be gated with CLKREQ# input when ASPM L0s,L1
-+ * is enabled => setting the CLKREQ_DEBUG_ENABLE field to 1.
-+ */
-+ tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+ tmp |= PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK;
-+ writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+
-+ return 0;
-+}
-+
-+/* L23 is a low-power PCIe link state */
-+static void brcm_pcie_enter_l23(struct brcm_pcie *pcie)
-+{
-+ void __iomem *base = pcie->base;
-+ int l23, i;
-+ u32 tmp;
-+
-+ /* Assert request for L23 */
-+ tmp = readl(base + PCIE_MISC_PCIE_CTRL);
-+ u32p_replace_bits(&tmp, 1, PCIE_MISC_PCIE_CTRL_PCIE_L23_REQUEST_MASK);
-+ writel(tmp, base + PCIE_MISC_PCIE_CTRL);
-+
-+ /* Wait up to 36 msec for L23 */
-+ tmp = readl(base + PCIE_MISC_PCIE_STATUS);
-+ l23 = FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_LINK_IN_L23_MASK, tmp);
-+ for (i = 0; i < 15 && !l23; i++) {
-+ usleep_range(2000, 2400);
-+ tmp = readl(base + PCIE_MISC_PCIE_STATUS);
-+ l23 = FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_LINK_IN_L23_MASK,
-+ tmp);
-+ }
-+
-+ if (!l23)
-+ dev_err(pcie->dev, "failed to enter low-power link state\n");
-+}
-+
-+static void brcm_pcie_turn_off(struct brcm_pcie *pcie)
-+{
-+ void __iomem *base = pcie->base;
-+ int tmp;
-+
-+ if (brcm_pcie_link_up(pcie))
-+ brcm_pcie_enter_l23(pcie);
-+ /* Assert fundamental reset */
-+ brcm_pcie_perst_set(pcie, 1);
-+
-+ /* Deassert request for L23 in case it was asserted */
-+ tmp = readl(base + PCIE_MISC_PCIE_CTRL);
-+ u32p_replace_bits(&tmp, 0, PCIE_MISC_PCIE_CTRL_PCIE_L23_REQUEST_MASK);
-+ writel(tmp, base + PCIE_MISC_PCIE_CTRL);
-+
-+ /* Turn off SerDes */
-+ tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+ u32p_replace_bits(&tmp, 1, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK);
-+ writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
-+
-+ /* Shutdown PCIe bridge */
-+ brcm_pcie_bridge_sw_init_set(pcie, 1);
-+}
-+
-+static void __brcm_pcie_remove(struct brcm_pcie *pcie)
-+{
-+ brcm_pcie_turn_off(pcie);
-+ clk_disable_unprepare(pcie->clk);
-+ clk_put(pcie->clk);
-+}
-+
-+static int brcm_pcie_remove(struct platform_device *pdev)
-+{
-+ struct brcm_pcie *pcie = platform_get_drvdata(pdev);
-+
-+ pci_stop_root_bus(pcie->root_bus);
-+ pci_remove_root_bus(pcie->root_bus);
-+ __brcm_pcie_remove(pcie);
-+
-+ return 0;
-+}
-+
-+static int brcm_pcie_probe(struct platform_device *pdev)
-+{
-+ struct device_node *np = pdev->dev.of_node;
-+ struct pci_host_bridge *bridge;
-+ struct brcm_pcie *pcie;
-+ struct pci_bus *child;
-+ struct resource *res;
-+ int ret;
-+
-+ bridge = devm_pci_alloc_host_bridge(&pdev->dev, sizeof(*pcie));
-+ if (!bridge)
-+ return -ENOMEM;
-+
-+ pcie = pci_host_bridge_priv(bridge);
-+ pcie->dev = &pdev->dev;
-+ pcie->np = np;
-+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ pcie->base = devm_ioremap_resource(&pdev->dev, res);
-+ if (IS_ERR(pcie->base))
-+ return PTR_ERR(pcie->base);
-+
-+ pcie->clk = devm_clk_get_optional(&pdev->dev, "sw_pcie");
-+ if (IS_ERR(pcie->clk))
-+ return PTR_ERR(pcie->clk);
-+
-+ ret = of_pci_get_max_link_speed(np);
-+ pcie->gen = (ret < 0) ? 0 : ret;
-+
-+ pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
-+
-+ ret = pci_parse_request_of_pci_ranges(pcie->dev, &bridge->windows,
-+ &bridge->dma_ranges, NULL);
-+ if (ret)
-+ return ret;
-+
-+ ret = clk_prepare_enable(pcie->clk);
-+ if (ret) {
-+ dev_err(&pdev->dev, "could not enable clock\n");
-+ return ret;
-+ }
-+
-+ ret = brcm_pcie_setup(pcie);
-+ if (ret)
-+ goto fail;
-+
-+ bridge->dev.parent = &pdev->dev;
-+ bridge->busnr = 0;
-+ bridge->ops = &brcm_pcie_ops;
-+ bridge->sysdata = pcie;
-+ bridge->map_irq = of_irq_parse_and_map_pci;
-+ bridge->swizzle_irq = pci_common_swizzle;
-+
-+ ret = pci_scan_root_bus_bridge(bridge);
-+ if (ret < 0) {
-+ dev_err(pcie->dev, "Scanning root bridge failed\n");
-+ goto fail;
-+ }
-+
-+ pci_assign_unassigned_bus_resources(bridge->bus);
-+ list_for_each_entry(child, &bridge->bus->children, node)
-+ pcie_bus_configure_settings(child);
-+ pci_bus_add_devices(bridge->bus);
-+ platform_set_drvdata(pdev, pcie);
-+ pcie->root_bus = bridge->bus;
-+
-+ return 0;
-+fail:
-+ __brcm_pcie_remove(pcie);
-+ return ret;
-+}
-+
-+static const struct of_device_id brcm_pcie_match[] = {
-+ { .compatible = "brcm,bcm2711-pcie" },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, brcm_pcie_match);
-+
-+static struct platform_driver brcm_pcie_driver = {
-+ .probe = brcm_pcie_probe,
-+ .remove = brcm_pcie_remove,
-+ .driver = {
-+ .name = "brcm-pcie",
-+ .of_match_table = brcm_pcie_match,
-+ },
-+};
-+module_platform_driver(brcm_pcie_driver);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_DESCRIPTION("Broadcom STB PCIe RC driver");
-+MODULE_AUTHOR("Broadcom");
-
-From patchwork Mon Dec 16 11:01:10 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-X-Patchwork-Id: 11293819
-Return-Path:
- <SRS0=BOSQ=2G=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FB1A930
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:26 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id DA5D2206EC
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:25 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="L57a4G/z"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA5D2206EC
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=suse.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
- List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
- Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
- Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
- List-Owner; bh=iItojdIKeV2oJC/4nHltnSdo0OFytKQEQSG83gc3mIo=; b=L57a4G/zV1L3EX
- zFjTyLpmW4uweymZSoPuNKRbbLfHfV8GJzdk0+AIcGY8T/0LDSubyqm52QwbEIKIZF6q1tYQMV01x
- dCx/B3rV8B0EcUM/RedeUUqXgMXKYn7pdmzUYR2jRB1NEOucFv6xZA1Ap8ZF1k7A2oACSkf/SBoXA
- PKbjs2hB/33AoX7kK98vVxVctzuUBE2CkGB419pPh1eXx3QyybSGYoBsNLsQ1BFfL3YwCV2unHoCx
- h4QSzJ7vBkuNHDVCdq/t6NRFs98dk6ooDHlISOhJW6F3bdR36Vx1/+5tC1MBjm/Wy1oZmLGR+MeSo
- 0J11yccg2BRitcgEv2gw==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo8u-00043K-US; Mon, 16 Dec 2019 11:02:24 +0000
-Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de)
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo83-00037J-Ob; Mon, 16 Dec 2019 11:01:35 +0000
-X-Virus-Scanned: by amavisd-new at test-mx.suse.de
-Received: from relay2.suse.de (unknown [195.135.220.254])
- by mx1.suse.de (Postfix) with ESMTP id 502A3AC7D;
- Mon, 16 Dec 2019 11:01:30 +0000 (UTC)
-From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-To: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org,
- Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
- Florian Fainelli <f.fainelli@gmail.com>,
- bcm-kernel-feedback-list@broadcom.com,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Subject: [PATCH v5 4/6] PCI: brcmstb: Add MSI support
-Date: Mon, 16 Dec 2019 12:01:10 +0100
-Message-Id: <20191216110113.30436-5-nsaenzjulienne@suse.de>
-X-Mailer: git-send-email 2.24.0
-In-Reply-To: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-References: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-MIME-Version: 1.0
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20191216_030132_128008_DE7B462C
-X-CRM114-Status: GOOD ( 23.12 )
-X-Spam-Score: -2.3 (--)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-2.3 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [195.135.220.15 listed in wl.mailspike.net]
- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,
- medium trust [195.135.220.15 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: mbrugger@suse.com, linux-pci@vger.kernel.org, phil@raspberrypi.org,
- jeremy.linton@arm.com, wahrenst@gmx.net, james.quinlan@broadcom.com,
- Bjorn Helgaas <bhelgaas@google.com>, linux-arm-kernel@lists.infradead.org,
- linux-rpi-kernel@lists.infradead.org
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-From: Jim Quinlan <james.quinlan@broadcom.com>
-
-This adds MSI support to the Broadcom STB PCIe host controller. The MSI
-controller is physically located within the PCIe block, however, there
-is no reason why the MSI controller could not be moved elsewhere in the
-future. MSIX is not supported by the HW.
-
-Since the internal Brcmstb MSI controller is intertwined with the PCIe
-controller, it is not its own platform device but rather part of the
-PCIe platform device.
-
-Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
-Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-Reviewed-by: Marc Zyngier <maz@kernel.org>
-Reviewed-by: Andrew Murray <andrew.murray@arm.com>
----
-
-Changes since v3 (kept Marc's reviewed by as changes seem small enough):
- - Use define to access MSI_DATA_CONFIG_VAL
- - Update commit message
-
-Changes since v2:
- - Use standard APIs on register operations
- - Get rid of revision code
- - Update rules to msi_target_addr selection
- - Remove unwarranted MSI_FLAG_PCI_MSIX
- - Small cosmetic changes
-
-Changes since v1:
- - Move revision code and some registers to this patch
- - Use PCIE_MSI_IRQ_DOMAIN in Kconfig
- - Remove redundant register read from ISR
- - Fail probe on MSI init error
- - Get rid of msi_internal
- - Use bitmap family of functions
- - Use edge triggered setup
- - Add comment regarding MultiMSI
- - Simplify compose_msi_msg to avoid reg read
-
-This is based on Jim's original submission[1] with some slight changes
-regarding how pcie->msi_target_addr is decided.
-
-[1] https://patchwork.kernel.org/patch/10605955/
-
- drivers/pci/controller/Kconfig | 1 +
- drivers/pci/controller/pcie-brcmstb.c | 261 +++++++++++++++++++++++++-
- 2 files changed, 261 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
-index 27504f108ee5..918e283bbff1 100644
---- a/drivers/pci/controller/Kconfig
-+++ b/drivers/pci/controller/Kconfig
-@@ -257,6 +257,7 @@ config PCIE_BRCMSTB
- tristate "Broadcom Brcmstb PCIe host controller"
- depends on ARCH_BCM2835 || COMPILE_TEST
- depends on OF
-+ depends on PCI_MSI_IRQ_DOMAIN
- help
- Say Y here to enable PCIe host controller support for
- Broadcom STB based SoCs, like the Raspberry Pi 4.
-diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
-index dd681164faa0..7ba06a0e1a71 100644
---- a/drivers/pci/controller/pcie-brcmstb.c
-+++ b/drivers/pci/controller/pcie-brcmstb.c
-@@ -2,6 +2,7 @@
- /* Copyright (C) 2009 - 2019 Broadcom */
-
- #include <linux/bitfield.h>
-+#include <linux/bitops.h>
- #include <linux/clk.h>
- #include <linux/compiler.h>
- #include <linux/delay.h>
-@@ -9,11 +10,13 @@
- #include <linux/interrupt.h>
- #include <linux/io.h>
- #include <linux/ioport.h>
-+#include <linux/irqchip/chained_irq.h>
- #include <linux/irqdomain.h>
- #include <linux/kernel.h>
- #include <linux/list.h>
- #include <linux/log2.h>
- #include <linux/module.h>
-+#include <linux/msi.h>
- #include <linux/of_address.h>
- #include <linux/of_irq.h>
- #include <linux/of_pci.h>
-@@ -67,6 +70,12 @@
- #define PCIE_MISC_RC_BAR3_CONFIG_LO 0x403c
- #define PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK 0x1f
-
-+#define PCIE_MISC_MSI_BAR_CONFIG_LO 0x4044
-+#define PCIE_MISC_MSI_BAR_CONFIG_HI 0x4048
-+
-+#define PCIE_MISC_MSI_DATA_CONFIG 0x404c
-+#define PCIE_MISC_MSI_DATA_CONFIG_VAL 0xffe06540
-+
- #define PCIE_MISC_PCIE_CTRL 0x4064
- #define PCIE_MISC_PCIE_CTRL_PCIE_L23_REQUEST_MASK 0x1
-
-@@ -114,6 +123,11 @@
-
- /* PCIe parameters */
- #define BRCM_NUM_PCIE_OUT_WINS 0x4
-+#define BRCM_INT_PCI_MSI_NR 32
-+
-+/* MSI target adresses */
-+#define BRCM_MSI_TARGET_ADDR_LT_4GB 0x0fffffffcULL
-+#define BRCM_MSI_TARGET_ADDR_GT_4GB 0xffffffffcULL
-
- /* MDIO registers */
- #define MDIO_PORT0 0x0
-@@ -135,6 +149,19 @@
- #define SSC_STATUS_SSC_MASK 0x400
- #define SSC_STATUS_PLL_LOCK_MASK 0x800
-
-+struct brcm_msi {
-+ struct device *dev;
-+ void __iomem *base;
-+ struct device_node *np;
-+ struct irq_domain *msi_domain;
-+ struct irq_domain *inner_domain;
-+ struct mutex lock; /* guards the alloc/free operations */
-+ u64 target_addr;
-+ int irq;
-+ /* used indicates which MSI interrupts have been alloc'd */
-+ unsigned long used;
-+};
-+
- /* Internal PCIe Host Controller Information.*/
- struct brcm_pcie {
- struct device *dev;
-@@ -144,6 +171,8 @@ struct brcm_pcie {
- struct device_node *np;
- bool ssc;
- int gen;
-+ u64 msi_target_addr;
-+ struct brcm_msi *msi;
- };
-
- /*
-@@ -309,6 +338,214 @@ static void brcm_pcie_set_outbound_win(struct brcm_pcie *pcie,
- writel(tmp, pcie->base + PCIE_MEM_WIN0_LIMIT_HI(win));
- }
-
-+static struct irq_chip brcm_msi_irq_chip = {
-+ .name = "BRCM STB PCIe MSI",
-+ .irq_ack = irq_chip_ack_parent,
-+ .irq_mask = pci_msi_mask_irq,
-+ .irq_unmask = pci_msi_unmask_irq,
-+};
-+
-+static struct msi_domain_info brcm_msi_domain_info = {
-+ /* Multi MSI is supported by the controller, but not by this driver */
-+ .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS),
-+ .chip = &brcm_msi_irq_chip,
-+};
-+
-+static void brcm_pcie_msi_isr(struct irq_desc *desc)
-+{
-+ struct irq_chip *chip = irq_desc_get_chip(desc);
-+ unsigned long status, virq;
-+ struct brcm_msi *msi;
-+ struct device *dev;
-+ u32 bit;
-+
-+ chained_irq_enter(chip, desc);
-+ msi = irq_desc_get_handler_data(desc);
-+ dev = msi->dev;
-+
-+ status = readl(msi->base + PCIE_MSI_INTR2_STATUS);
-+ for_each_set_bit(bit, &status, BRCM_INT_PCI_MSI_NR) {
-+ virq = irq_find_mapping(msi->inner_domain, bit);
-+ if (virq)
-+ generic_handle_irq(virq);
-+ else
-+ dev_dbg(dev, "unexpected MSI\n");
-+ }
-+
-+ chained_irq_exit(chip, desc);
-+}
-+
-+static void brcm_msi_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
-+{
-+ struct brcm_msi *msi = irq_data_get_irq_chip_data(data);
-+
-+ msg->address_lo = lower_32_bits(msi->target_addr);
-+ msg->address_hi = upper_32_bits(msi->target_addr);
-+ msg->data = (0xffff & PCIE_MISC_MSI_DATA_CONFIG_VAL) | data->hwirq;
-+}
-+
-+static int brcm_msi_set_affinity(struct irq_data *irq_data,
-+ const struct cpumask *mask, bool force)
-+{
-+ return -EINVAL;
-+}
-+
-+static void brcm_msi_ack_irq(struct irq_data *data)
-+{
-+ struct brcm_msi *msi = irq_data_get_irq_chip_data(data);
-+
-+ writel(1 << data->hwirq, msi->base + PCIE_MSI_INTR2_CLR);
-+}
-+
-+
-+static struct irq_chip brcm_msi_bottom_irq_chip = {
-+ .name = "BRCM STB MSI",
-+ .irq_compose_msi_msg = brcm_msi_compose_msi_msg,
-+ .irq_set_affinity = brcm_msi_set_affinity,
-+ .irq_ack = brcm_msi_ack_irq,
-+};
-+
-+static int brcm_msi_alloc(struct brcm_msi *msi)
-+{
-+ int hwirq;
-+
-+ mutex_lock(&msi->lock);
-+ hwirq = bitmap_find_free_region(&msi->used, BRCM_INT_PCI_MSI_NR, 0);
-+ mutex_unlock(&msi->lock);
-+
-+ return hwirq;
-+}
-+
-+static void brcm_msi_free(struct brcm_msi *msi, unsigned long hwirq)
-+{
-+ mutex_lock(&msi->lock);
-+ bitmap_release_region(&msi->used, hwirq, 0);
-+ mutex_unlock(&msi->lock);
-+}
-+
-+static int brcm_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
-+ unsigned int nr_irqs, void *args)
-+{
-+ struct brcm_msi *msi = domain->host_data;
-+ int hwirq;
-+
-+ hwirq = brcm_msi_alloc(msi);
-+
-+ if (hwirq < 0)
-+ return hwirq;
-+
-+ irq_domain_set_info(domain, virq, (irq_hw_number_t)hwirq,
-+ &brcm_msi_bottom_irq_chip, domain->host_data,
-+ handle_edge_irq, NULL, NULL);
-+ return 0;
-+}
-+
-+static void brcm_irq_domain_free(struct irq_domain *domain,
-+ unsigned int virq, unsigned int nr_irqs)
-+{
-+ struct irq_data *d = irq_domain_get_irq_data(domain, virq);
-+ struct brcm_msi *msi = irq_data_get_irq_chip_data(d);
-+
-+ brcm_msi_free(msi, d->hwirq);
-+}
-+
-+static const struct irq_domain_ops msi_domain_ops = {
-+ .alloc = brcm_irq_domain_alloc,
-+ .free = brcm_irq_domain_free,
-+};
-+
-+static int brcm_allocate_domains(struct brcm_msi *msi)
-+{
-+ struct fwnode_handle *fwnode = of_node_to_fwnode(msi->np);
-+ struct device *dev = msi->dev;
-+
-+ msi->inner_domain = irq_domain_add_linear(NULL, BRCM_INT_PCI_MSI_NR,
-+ &msi_domain_ops, msi);
-+ if (!msi->inner_domain) {
-+ dev_err(dev, "failed to create IRQ domain\n");
-+ return -ENOMEM;
-+ }
-+
-+ msi->msi_domain = pci_msi_create_irq_domain(fwnode,
-+ &brcm_msi_domain_info,
-+ msi->inner_domain);
-+ if (!msi->msi_domain) {
-+ dev_err(dev, "failed to create MSI domain\n");
-+ irq_domain_remove(msi->inner_domain);
-+ return -ENOMEM;
-+ }
-+
-+ return 0;
-+}
-+
-+static void brcm_free_domains(struct brcm_msi *msi)
-+{
-+ irq_domain_remove(msi->msi_domain);
-+ irq_domain_remove(msi->inner_domain);
-+}
-+
-+static void brcm_msi_remove(struct brcm_pcie *pcie)
-+{
-+ struct brcm_msi *msi = pcie->msi;
-+
-+ if (!msi)
-+ return;
-+ irq_set_chained_handler(msi->irq, NULL);
-+ irq_set_handler_data(msi->irq, NULL);
-+ brcm_free_domains(msi);
-+}
-+
-+static void brcm_msi_set_regs(struct brcm_msi *msi)
-+{
-+ writel(0xffffffff, msi->base + PCIE_MSI_INTR2_MASK_CLR);
-+
-+ /*
-+ * The 0 bit of PCIE_MISC_MSI_BAR_CONFIG_LO is repurposed to MSI
-+ * enable, which we set to 1.
-+ */
-+ writel(lower_32_bits(msi->target_addr) | 0x1,
-+ msi->base + PCIE_MISC_MSI_BAR_CONFIG_LO);
-+ writel(upper_32_bits(msi->target_addr),
-+ msi->base + PCIE_MISC_MSI_BAR_CONFIG_HI);
-+
-+ writel(PCIE_MISC_MSI_DATA_CONFIG_VAL,
-+ msi->base + PCIE_MISC_MSI_DATA_CONFIG);
-+}
-+
-+static int brcm_pcie_enable_msi(struct brcm_pcie *pcie)
-+{
-+ struct brcm_msi *msi;
-+ int irq, ret;
-+ struct device *dev = pcie->dev;
-+
-+ irq = irq_of_parse_and_map(dev->of_node, 1);
-+ if (irq <= 0) {
-+ dev_err(dev, "cannot map MSI interrupt\n");
-+ return -ENODEV;
-+ }
-+
-+ msi = devm_kzalloc(dev, sizeof(struct brcm_msi), GFP_KERNEL);
-+ if (!msi)
-+ return -ENOMEM;
-+
-+ msi->dev = dev;
-+ msi->base = pcie->base;
-+ msi->np = pcie->np;
-+ msi->target_addr = pcie->msi_target_addr;
-+ msi->irq = irq;
-+
-+ ret = brcm_allocate_domains(msi);
-+ if (ret)
-+ return ret;
-+
-+ irq_set_chained_handler_and_data(msi->irq, brcm_pcie_msi_isr, msi);
-+
-+ brcm_msi_set_regs(msi);
-+ pcie->msi = msi;
-+
-+ return 0;
-+}
-+
- /* The controller is capable of serving in both RC and EP roles */
- static bool brcm_pcie_rc_mode(struct brcm_pcie *pcie)
- {
-@@ -490,6 +727,18 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
- PCIE_MISC_MISC_CTRL_SCB0_SIZE_MASK);
- writel(tmp, base + PCIE_MISC_MISC_CTRL);
-
-+ /*
-+ * We ideally want the MSI target address to be located in the 32bit
-+ * addressable memory area. Some devices might depend on it. This is
-+ * possible either when the inbound window is located above the lower
-+ * 4GB or when the inbound area is smaller than 4GB (taking into
-+ * account the rounding-up we're forced to perform).
-+ */
-+ if (rc_bar2_offset >= SZ_4G || (rc_bar2_size + rc_bar2_offset) < SZ_4G)
-+ pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_LT_4GB;
-+ else
-+ pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_GT_4GB;
-+
- /* disable the PCIe->GISB memory window (RC_BAR1) */
- tmp = readl(base + PCIE_MISC_RC_BAR1_CONFIG_LO);
- tmp &= ~PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK;
-@@ -639,6 +888,7 @@ static void brcm_pcie_turn_off(struct brcm_pcie *pcie)
-
- static void __brcm_pcie_remove(struct brcm_pcie *pcie)
- {
-+ brcm_msi_remove(pcie);
- brcm_pcie_turn_off(pcie);
- clk_disable_unprepare(pcie->clk);
- clk_put(pcie->clk);
-@@ -657,7 +907,7 @@ static int brcm_pcie_remove(struct platform_device *pdev)
-
- static int brcm_pcie_probe(struct platform_device *pdev)
- {
-- struct device_node *np = pdev->dev.of_node;
-+ struct device_node *np = pdev->dev.of_node, *msi_np;
- struct pci_host_bridge *bridge;
- struct brcm_pcie *pcie;
- struct pci_bus *child;
-@@ -701,6 +951,15 @@ static int brcm_pcie_probe(struct platform_device *pdev)
- if (ret)
- goto fail;
-
-+ msi_np = of_parse_phandle(pcie->np, "msi-parent", 0);
-+ if (pci_msi_enabled() && msi_np == pcie->np) {
-+ ret = brcm_pcie_enable_msi(pcie);
-+ if (ret) {
-+ dev_err(pcie->dev, "probe of internal MSI failed");
-+ goto fail;
-+ }
-+ }
-+
- bridge->dev.parent = &pdev->dev;
- bridge->busnr = 0;
- bridge->ops = &brcm_pcie_ops;
-
-From patchwork Mon Dec 16 11:01:12 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-X-Patchwork-Id: 11293821
-Return-Path:
- <SRS0=BOSQ=2G=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 224E3930
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:45 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id F26AB206EC
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 16 Dec 2019 11:02:44 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="eMDipuhg"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F26AB206EC
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=suse.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
- List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
- Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
- Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
- List-Owner; bh=89gvO/q/aU2KdnEtpUR7fViPlJcU9Hv2PR7UHxNLFTg=; b=eMDipuhg+M9lCx
- 8ENnzwQAiTmaNTilNadUK3F2Z1K6tk8e2VJcgmacOjfEF5yQspDGCxaemBhqrfFpIVaPIgd6D+2Ru
- 5oQaG8pyaOReVRpAa2xgws20vpYXVku0j4jel8gsAEXtyMKIFMqqUgQGKCTatNP4An1aMP6c5EC5z
- mkmzodfHSJPOATqU55l6AcamhGlfLO/xNXUEIFVQz891R1m8FQO6pnryIa7IYr3d3TkinptRk6hFO
- 60i+H50v2/NzmROaDORveKAO9a6APoqlzLK9sj8ehy3lVItSguKco7jnrBapYOPYcNgdMp2PrnkHq
- QFDUmvLZNnAqN+ez5NkA==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo9D-0004J8-3H; Mon, 16 Dec 2019 11:02:43 +0000
-Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de)
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1igo86-00039m-4x; Mon, 16 Dec 2019 11:01:36 +0000
-X-Virus-Scanned: by amavisd-new at test-mx.suse.de
-Received: from relay2.suse.de (unknown [195.135.220.254])
- by mx1.suse.de (Postfix) with ESMTP id BD4CDACD7;
- Mon, 16 Dec 2019 11:01:32 +0000 (UTC)
-From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
-To: andrew.murray@arm.com,
- maz@kernel.org,
- linux-kernel@vger.kernel.org
-Subject: [PATCH v5 6/6] arm64: defconfig: Enable Broadcom's STB PCIe
- controller
-Date: Mon, 16 Dec 2019 12:01:12 +0100
-Message-Id: <20191216110113.30436-7-nsaenzjulienne@suse.de>
-X-Mailer: git-send-email 2.24.0
-In-Reply-To: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-References: <20191216110113.30436-1-nsaenzjulienne@suse.de>
-MIME-Version: 1.0
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20191216_030134_339113_ECC8A7D7
-X-CRM114-Status: UNSURE ( 8.26 )
-X-CRM114-Notice: Please train this message.
-X-Spam-Score: -2.3 (--)
-X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
- Content analysis details: (-2.3 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [195.135.220.15 listed in wl.mailspike.net]
- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,
- medium trust [195.135.220.15 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: linux-arm-kernel@lists.infradead.org, f.fainelli@gmail.com,
- linux-pci@vger.kernel.org, phil@raspberrypi.org, jeremy.linton@arm.com,
- mbrugger@suse.com, wahrenst@gmx.net, james.quinlan@broadcom.com,
- Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>,
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- linux-rpi-kernel@lists.infradead.org
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-For now mainly used in the Raspberry Pi 4.
-
-Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
----
- arch/arm64/configs/defconfig | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
-index 2646fc76b8db..2b80980ef576 100644
---- a/arch/arm64/configs/defconfig
-+++ b/arch/arm64/configs/defconfig
-@@ -192,6 +192,7 @@ CONFIG_PCIE_ALTERA_MSI=y
- CONFIG_PCI_HOST_THUNDER_PEM=y
- CONFIG_PCI_HOST_THUNDER_ECAM=y
- CONFIG_PCIE_ROCKCHIP_HOST=m
-+CONFIG_PCIE_BRCMSTB=m
- CONFIG_PCI_LAYERSCAPE=y
- CONFIG_PCI_HISI=y
- CONFIG_PCIE_QCOM=y
diff --git a/alsa-5.6.patch b/alsa-5.6.patch
deleted file mode 100644
index b128cc7e6..000000000
--- a/alsa-5.6.patch
+++ /dev/null
@@ -1,390 +0,0 @@
-From 4ef91c45a5a283dc8899402bc68adfe0aa9a026d Mon Sep 17 00:00:00 2001
-From: Jaroslav Kysela <perex@perex.cz>
-Date: Wed, 4 Dec 2019 15:15:44 -0600
-Subject: [PATCH 1/4] ASoC: intel/skl/hda - export number of digital
- microphones via control components
-
-It is required for the auto-detection in the user space (for UCM).
-
-Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
-Cc: Mark Brown <broonie@kernel.org>
-Link: https://lore.kernel.org/r/20191204211556.12671-2-pierre-louis.bossart@linux.intel.com
-Signed-off-by: Mark Brown <broonie@kernel.org>
-
-Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
-(cherry picked from commit 8cd9956f61c65022209ce6d1e55ed12aea12357d)
-Bugzilla: 1772498
----
- sound/soc/intel/boards/skl_hda_dsp_generic.c | 8 ++++++++
- sound/soc/sof/intel/hda.c | 3 ++-
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
-index 4e45901e3a2f..11eaee9ae41f 100644
---- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
-+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
-@@ -100,6 +100,8 @@ static struct snd_soc_card hda_soc_card = {
- .late_probe = skl_hda_card_late_probe,
- };
-
-+static char hda_soc_components[30];
-+
- #define IDISP_DAI_COUNT 3
- #define HDAC_DAI_COUNT 2
- #define DMIC_DAI_COUNT 2
-@@ -183,6 +185,12 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
- hda_soc_card.dev = &pdev->dev;
- snd_soc_card_set_drvdata(&hda_soc_card, ctx);
-
-+ if (mach->mach_params.dmic_num > 0) {
-+ snprintf(hda_soc_components, sizeof(hda_soc_components),
-+ "cfg-dmics:%d", mach->mach_params.dmic_num);
-+ hda_soc_card.components = hda_soc_components;
-+ }
-+
- return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
- }
-
-diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
-index 91bd88fddac7..eea01f75d23d 100644
---- a/sound/soc/sof/intel/hda.c
-+++ b/sound/soc/sof/intel/hda.c
-@@ -351,7 +351,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
- const char *tplg_filename;
- const char *idisp_str;
- const char *dmic_str;
-- int dmic_num;
-+ int dmic_num = 0;
- int codec_num = 0;
- int i;
- #endif
-@@ -472,6 +472,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
- mach_params->codec_mask = bus->codec_mask;
- mach_params->platform = dev_name(sdev->dev);
- mach_params->common_hdmi_codec_drv = hda_codec_use_common_hdmi;
-+ mach_params->dmic_num = dmic_num;
- }
-
- /* create codec instances */
---
-2.20.1
-
-
-From 89be5f69889f7e9aeab05279869bba3e9e0d2002 Mon Sep 17 00:00:00 2001
-From: Jaroslav Kysela <perex@perex.cz>
-Date: Wed, 4 Dec 2019 15:15:45 -0600
-Subject: [PATCH 2/4] ASoC: Intel - use control components to describe card
- config
-
-Use the control interface (field 'components' in the info structure)
-to pass the I/O configuration details. The goal is to replace
-the card long name with this.
-
-Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
-Cc: Mark Brown <broonie@kernel.org>
-Link: https://lore.kernel.org/r/20191204211556.12671-3-pierre-louis.bossart@linux.intel.com
-Signed-off-by: Mark Brown <broonie@kernel.org>
-
-Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
-(cherry picked from commit 0d5c8187562848b619a35f2ffc5e18ce703e9f3d)
-Bugzilla: 1772498
----
- sound/soc/intel/boards/bytcht_es8316.c | 9 ++++++++-
- sound/soc/intel/boards/bytcr_rt5640.c | 6 ++++++
- sound/soc/intel/boards/bytcr_rt5651.c | 18 +++++++++++-------
- 3 files changed, 25 insertions(+), 8 deletions(-)
-
-diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
-index 46612331f5ea..efa33f30dcac 100644
---- a/sound/soc/intel/boards/bytcht_es8316.c
-+++ b/sound/soc/intel/boards/bytcht_es8316.c
-@@ -361,6 +361,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
- /* SoC card */
- static char codec_name[SND_ACPI_I2C_ID_LEN];
- static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
-+static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */
-
- static int byt_cht_es8316_suspend(struct snd_soc_card *card)
- {
-@@ -572,11 +573,17 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
- }
- }
-
-- /* register the soc card */
-+ snprintf(components_string, sizeof(components_string),
-+ "cfg-spk:%s cfg-mic:%s",
-+ (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2",
-+ mic_name[BYT_CHT_ES8316_MAP(quirk)]);
-+ byt_cht_es8316_card.components = components_string;
- snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
- (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
- mic_name[BYT_CHT_ES8316_MAP(quirk)]);
- byt_cht_es8316_card.long_name = long_name;
-+
-+ /* register the soc card */
- snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
-
- ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card);
-diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
-index dd2b5ad08659..7bc6d3cec94c 100644
---- a/sound/soc/intel/boards/bytcr_rt5640.c
-+++ b/sound/soc/intel/boards/bytcr_rt5640.c
-@@ -1083,6 +1083,7 @@ static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
- static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */
- static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
- static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
-+static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */
-
- static int byt_rt5640_suspend(struct snd_soc_card *card)
- {
-@@ -1305,6 +1306,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
- }
- }
-
-+ snprintf(byt_rt5640_components, sizeof(byt_rt5640_components),
-+ "cfg-spk:%s cfg-mic:%s",
-+ (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2",
-+ map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
-+ byt_rt5640_card.components = byt_rt5640_components;
- snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
- "bytcr-rt5640-%s-spk-%s-mic",
- (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
-diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
-index 4606f6f582d6..80a5674ddb1b 100644
---- a/sound/soc/intel/boards/bytcr_rt5651.c
-+++ b/sound/soc/intel/boards/bytcr_rt5651.c
-@@ -798,6 +798,7 @@ static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
- static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */
- static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
- static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
-+static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */
-
- static int byt_rt5651_suspend(struct snd_soc_card *card)
- {
-@@ -876,7 +877,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
- const char *platform_name;
- struct acpi_device *adev;
- struct device *codec_dev;
-- const char *hp_swapped;
- bool is_bytcr = false;
- int ret_val = 0;
- int dai_index = 0;
-@@ -1080,16 +1080,20 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
- }
- }
-
-- if (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED)
-- hp_swapped = "-hp-swapped";
-- else
-- hp_swapped = "";
--
-+ snprintf(byt_rt5651_components, sizeof(byt_rt5651_components),
-+ "cfg-spk:%s cfg-mic:%s%s",
-+ (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? "1" : "2",
-+ mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)],
-+ (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
-+ " cfg-hp:lrswap" : "");
-+ byt_rt5651_card.components = byt_rt5651_components;
- snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
- "bytcr-rt5651-%s-spk-%s-mic%s",
- (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
- "mono" : "stereo",
-- mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped);
-+ mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)],
-+ (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
-+ "-hp-swapped" : "");
- byt_rt5651_card.long_name = byt_rt5651_long_name;
-
- /* override plaform name, if required */
---
-2.20.1
-
-
-From 36c175e19e9cbb685708519d41e27cd803206737 Mon Sep 17 00:00:00 2001
-From: Jaroslav Kysela <perex@perex.cz>
-Date: Wed, 4 Dec 2019 15:15:46 -0600
-Subject: [PATCH 3/4] ASoC: Intel - do not describe I/O configuration in the
- long card name
-
-The long card name might be used in GUI. This information should be hidden.
-
-Add CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES configuration option.
-
-Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
-Cc: Mark Brown <broonie@kernel.org>
-Link: https://lore.kernel.org/r/20191204211556.12671-4-pierre-louis.bossart@linux.intel.com
-Signed-off-by: Mark Brown <broonie@kernel.org>
-
-Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
-(cherry picked from commit b5706f8ec29fb461571d25e3e813ede121fe31cd)
-Bugzilla: 1772498
----
- sound/soc/intel/boards/Kconfig | 13 +++++++++++++
- sound/soc/intel/boards/bytcht_es8316.c | 4 ++++
- sound/soc/intel/boards/bytcr_rt5640.c | 4 ++++
- sound/soc/intel/boards/bytcr_rt5651.c | 4 ++++
- 4 files changed, 25 insertions(+)
-
-diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
-index ef20316e83d1..145eb55bd691 100644
---- a/sound/soc/intel/boards/Kconfig
-+++ b/sound/soc/intel/boards/Kconfig
-@@ -13,6 +13,19 @@ menuconfig SND_SOC_INTEL_MACH
-
- if SND_SOC_INTEL_MACH
-
-+config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
-+ bool "Use more user friendly long card names"
-+ help
-+ Some drivers report the I/O configuration to userspace through the
-+ soundcard's long card name in the control user space AP. An unfortunate
-+ side effect is that this long name may also be used by the GUI,
-+ confusing users with information they don't need.
-+ This option prevents the long name from being modified, and the I/O
-+ configuration will be provided through a different component interface.
-+ Select Y if userspace like UCM (Use Case Manager) uses the component
-+ interface.
-+ If unsure select N.
-+
- if SND_SOC_INTEL_HASWELL
-
- config SND_SOC_INTEL_HASWELL_MACH
-diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
-index efa33f30dcac..12a1c5255484 100644
---- a/sound/soc/intel/boards/bytcht_es8316.c
-+++ b/sound/soc/intel/boards/bytcht_es8316.c
-@@ -360,7 +360,9 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
-
- /* SoC card */
- static char codec_name[SND_ACPI_I2C_ID_LEN];
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
-+#endif
- static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */
-
- static int byt_cht_es8316_suspend(struct snd_soc_card *card)
-@@ -578,10 +580,12 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
- (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2",
- mic_name[BYT_CHT_ES8316_MAP(quirk)]);
- byt_cht_es8316_card.components = components_string;
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
- (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
- mic_name[BYT_CHT_ES8316_MAP(quirk)]);
- byt_cht_es8316_card.long_name = long_name;
-+#endif
-
- /* register the soc card */
- snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
-diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
-index 7bc6d3cec94c..648fcc1d07b5 100644
---- a/sound/soc/intel/boards/bytcr_rt5640.c
-+++ b/sound/soc/intel/boards/bytcr_rt5640.c
-@@ -1082,7 +1082,9 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
- static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
- static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */
- static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
-+#endif
- static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */
-
- static int byt_rt5640_suspend(struct snd_soc_card *card)
-@@ -1311,12 +1313,14 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
- (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2",
- map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
- byt_rt5640_card.components = byt_rt5640_components;
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
- "bytcr-rt5640-%s-spk-%s-mic",
- (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
- "mono" : "stereo",
- map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
- byt_rt5640_card.long_name = byt_rt5640_long_name;
-+#endif
-
- /* override plaform name, if required */
- platform_name = mach->mach_params.platform;
-diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
-index 80a5674ddb1b..c0d322a859f7 100644
---- a/sound/soc/intel/boards/bytcr_rt5651.c
-+++ b/sound/soc/intel/boards/bytcr_rt5651.c
-@@ -797,7 +797,9 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
- static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
- static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */
- static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
-+#endif
- static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */
-
- static int byt_rt5651_suspend(struct snd_soc_card *card)
-@@ -1087,6 +1089,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
- (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
- " cfg-hp:lrswap" : "");
- byt_rt5651_card.components = byt_rt5651_components;
-+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
- snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
- "bytcr-rt5651-%s-spk-%s-mic%s",
- (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
-@@ -1095,6 +1098,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
- (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
- "-hp-swapped" : "");
- byt_rt5651_card.long_name = byt_rt5651_long_name;
-+#endif
-
- /* override plaform name, if required */
- platform_name = mach->mach_params.platform;
---
-2.20.1
-
-
-From 9aa9b367e35494f2d02112ca440a78908f645a04 Mon Sep 17 00:00:00 2001
-From: Jaroslav Kysela <perex@perex.cz>
-Date: Fri, 22 Nov 2019 09:31:03 +0100
-Subject: [PATCH 4/4] ASoC: SOF - topology - do not change the link triger
- order for old firmare
-
-This is patch for SOF v1.3 firmware. The DSP firmware will crash
-without this patch. The 1.4.1 firmare has this issue fixed.
-
-BugLink: https://github.com/thesofproject/sof/issues/2102
-Signed-off-by: Jaroslav Kysela <perex@perex.cz>
----
- sound/soc/sof/topology.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
-index d82ab981e840..cbbbf96416ef 100644
---- a/sound/soc/sof/topology.c
-+++ b/sound/soc/sof/topology.c
-@@ -2971,6 +2971,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index,
- struct snd_soc_tplg_private *private = &cfg->priv;
- struct sof_ipc_dai_config config;
- struct snd_soc_tplg_hw_config *hw_config;
-+ struct sof_ipc_fw_version *v = &sdev->fw_ready.version;
- int num_hw_configs;
- int ret;
- int i = 0;
-@@ -2988,9 +2989,12 @@ static int sof_link_load(struct snd_soc_component *scomp, int index,
- if (!link->no_pcm) {
- link->nonatomic = true;
-
-- /* set trigger order */
-- link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST;
-- link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST;
-+ /* this causes DSP panic on firmware v1.3 */
-+ if (SOF_ABI_VER(v->major, v->minor, v->micro) > SOF_ABI_VER(3, 7, 0)) {
-+ /* set trigger order */
-+ link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST;
-+ link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST;
-+ }
-
- /* nothing more to do for FE dai links */
- return 0;
---
-2.20.1
-
diff --git a/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch b/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch
deleted file mode 100644
index 87ef3d967..000000000
--- a/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch
+++ /dev/null
@@ -1,868 +0,0 @@
-From patchwork Mon Jan 27 18:15:05 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
-X-Patchwork-Id: 11353081
-Return-Path:
- <SRS0=MBPz=3Q=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E75D71398
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:15:48 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id C51652087F
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:15:48 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="boj1KSY/"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C51652087F
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=i2se.com
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=vI+2qhhQ/ad2gqCbe5hUTYTYVj8IfAamleiL75V5TSM=; b=boj1KSY/v7nluMqljONFMsrQpY
- TIwo7rcohwHGuN2fwWIQvlOtuoNfi2Fq0p3Scukv0Q2ADP7S7q291VcafNnFU5KN1MrzMbRGe4GnM
- P3V6kUvf56szm1T1NS1MkTH0UxtSeASAdrde8x8OVZKQoaCTk7UON0PPOY27cnqVlh3c0YEdnjw7O
- mqUMZ1W2xfP/jLVZPipZOqiUkCPtyOl7fcUXPVJInCLU8Ap12h/ucwxm6p7sL/miLW+RLo0gKtso8
- vE/Ub+gXij8pNQBcHeQOS3T5w7YYAKX0ckGovHYTGCE5G9DP0PYvWHj2aUr39vu4U7SF87h2rVwQ8
- lsj/6XEg==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vL-0007qT-4l; Mon, 27 Jan 2020 18:15:47 +0000
-Received: from mout.kundenserver.de ([212.227.126.130])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vI-0007pK-OI
- for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:46 +0000
-Received: from localhost.localdomain ([37.4.249.152]) by
- mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis)
- id 1MRmwM-1j2Dig1rly-00TAt5; Mon, 27 Jan 2020 19:15:40 +0100
-From: Stefan Wahren <stefan.wahren@i2se.com>
-To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Linus Walleij <linus.walleij@linaro.org>, Ray Jui <rjui@broadcom.com>,
- Scott Branden <sbranden@broadcom.com>
-Subject: [RFC PATCH 1/4] pinctrl: bcm2835: Drop unused define
-Date: Mon, 27 Jan 2020 19:15:05 +0100
-Message-Id: <1580148908-4863-2-git-send-email-stefan.wahren@i2se.com>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-X-Provags-ID: V03:K1:lGg05mfNcExFSuIdqSja3VB+cOAOOVkxA1mUl+WjJLfuDEYN48s
- KCpfgqk9HemEgzwKhTMkYEgexHNzZfeVG5k5xAbv9CDheeQx24pa/Pz7dPaHD9i2zVtcPEX
- ugday3kFGFOvKGH3QCW8oxkE91P2/fJaGsnynRzDkoSe3RjqXABLPjZW+febQ6xUrd9aF8p
- OvDdu6E+cBesU1loyk22g==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:FBYTcl5hsyU=:/uJXPKY5G3RK2HKm3g2afF
- CA5JAlk5ZwkebJLV4bbQfKqE89ChkfNCYzAIhT9SgQhi22RYSBr1LmN//FwU0R3diFEvflVI4
- OPkci48gv0sh+mZnsk9a5fiLs2oAnSh5hggie4G8ZelqhAZ6n4CYEWIp+lz1bo5KPywuZxqek
- T8GpkbU4eb/oEicxOhC8lN0DwOFD5W3GliKQ1IpWDarfz8Y9a4d+EgeY0+iBjelJHlfR3e1Q4
- 5TOF82NxXDkBp/4GoxSxM5JDUgoTnPvWCJ7ZFIchyrHbjc5NauAb/4e//OnNTPB8e7bKoOaH2
- HQ6XUp0Da/6crl8QtfuGEbHRAtkNZFJTRdT07zQtpcH89Cqto3IYQ9ND/7ijWcWxu5wb7Ve34
- RPM8gzArJAvou4fFeqPnnHkVmPuq3p5Xua81P7sTqXQN3m5U5RqmH8Lzr8w92FQrloZ2SMe9z
- XjYOrjAoxuxpe2x+H3tUoY4PwEgZjz7swAA8BeyYnRzumaAVvQgvNKrW2Qj9V73nKPwgtehvz
- hZDfvJgFBHEyfHVj4Fcz+N3r4xFIWS5o2UW5P2M2L2v7bQsckL4EkHWUHSjK5sJhQVDongIHo
- /+aJJViGcVBiAGrzvEW2ksFVnPP5X7R2pBxPckyIx3WhJaGzC1OGqA3Wg/a2k08Ewtt7m2DXz
- yYvnBfgEsV57VS3aLe8dsbJ2HqKMcqeahm6FQesAnangl4BtG6RH1BMKAaaaMeuJm2DQO+UUA
- PELxUMq3dBDAOEuSMNSdvN15BCqDxAajjVLnv+b/+pnKsJ/31p3YVryA78eJ6/kZm1a/DobHg
- vNu1QLjbpYkq/WH/K/LaUxt+YpwMi8egvQPLH32zMRACRbsqlMQ7nAGsZtdEkU8zYbp38yV
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200127_101545_079150_4EC20A38
-X-CRM114-Status: GOOD ( 11.11 )
-X-Spam-Score: 0.0 (/)
-X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
- Content analysis details: (0.0 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.126.130 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Stefan Wahren <stefan.wahren@i2se.com>, linux-gpio@vger.kernel.org,
- bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org,
- devicetree@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-There is no usage for this define, so drop it.
-
-Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
----
- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-index 0de1a3a..3fc2638 100644
---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-@@ -40,9 +40,6 @@
- #define BCM2835_NUM_BANKS 2
- #define BCM2835_NUM_IRQS 3
-
--#define BCM2835_PIN_BITMAP_SZ \
-- DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8)
--
- /* GPIO register offsets */
- #define GPFSEL0 0x0 /* Function Select */
- #define GPSET0 0x1c /* Pin Output Set */
-
-From patchwork Mon Jan 27 18:15:06 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
-X-Patchwork-Id: 11353087
-Return-Path:
- <SRS0=MBPz=3Q=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0A70159A
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:30 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id A832D214AF
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:30 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="BBcc5MYW"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A832D214AF
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=i2se.com
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=zl633DOCOOf5sEmBHgEEmRs3zIL6xCyAbRmQHF/5twU=; b=BBcc5MYWdf7TBI7GF8KvMnZTXP
- vwSri+G4Xg+SfQ0x1b4jtd8AwTGL1tYuyopmjQCdIt42APOehPRUttV2YvvQ9suKeJoNobnLxLcBr
- zvQYgSNAwt21baLbOyQi0HJWd2BzeIpRw419olVPp37cUGLwE4hpNIv0peCB/6uhTDXyN4YPrXKmW
- P7fz/gK+8yj6qz6VZeILYNYiE5DjbkwPSIoD8X/NZhppDvPNCkO3tmD4Z1UQDhMoZNooqIWcGRKIh
- umTkq58tIYGNOTccLaKvcW8Elm9ZHK7ssai4uhpgfmL0tId3saEqMuJzSccyqF6ENztpgOra2qWKS
- cVX67vMA==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vz-0008UK-VC; Mon, 27 Jan 2020 18:16:27 +0000
-Received: from mout.kundenserver.de ([212.227.126.135])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vJ-0007pN-PH
- for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000
-Received: from localhost.localdomain ([37.4.249.152]) by
- mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis)
- id 1MdvVu-1jTpmM3Tfy-00b6tv; Mon, 27 Jan 2020 19:15:40 +0100
-From: Stefan Wahren <stefan.wahren@i2se.com>
-To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Linus Walleij <linus.walleij@linaro.org>, Ray Jui <rjui@broadcom.com>,
- Scott Branden <sbranden@broadcom.com>
-Subject: [RFC PATCH 2/4] pinctrl: bcm2835: Refactor platform data
-Date: Mon, 27 Jan 2020 19:15:06 +0100
-Message-Id: <1580148908-4863-3-git-send-email-stefan.wahren@i2se.com>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-X-Provags-ID: V03:K1:VruPCfmk9mM3xiAf4DG/6aoXzCy4UDEsxr5SC+GDP4iRdgXZX29
- MFCNoD27qBqcSq1LjDl1+NGtNJ3+c1twK3aKoFUdWC05HKxzJPuizB6xDkWYoCIsLzUx75H
- HiA0SBUlw/LN+bHlzoczcUQzu+qFL0N3XAwKX9HxzpPzSFwl1lRDgLB6suBZjq4VTFrw6QP
- xptjL6VDFkgqBb05XjOfA==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:f2Tec5CMQUc=:niiLUGM7C+e//7RIjf+wMq
- wLFHtqjv1ynGaEgrTEwtjnWYqI/r72m4A6fdxd06jGD2Uyp8tpT//zGZgAMatxGP2tJCKPrs8
- H50QvZYrkhyeWT1e/b/43xnEBFcJ26c6kKbSdwNEaPpeQ2pSXrJ+fWFg4rgyr2kyb0a6fODwi
- glMJlRcbMvRam6bDw57BliG4DhkYgMl0WB+vE3ztB/xJo+NhTzPKfEpK10WVhz1N+MdOE8gPM
- Ed3HaUcq1KYSZvZRKVS8rOnqLfx2aLsXvrn+YKEvs5xzV1w8QpRWEIYZcLOwKvY23kJzQG9eq
- MIIG4Or4qhijuBXiW2q6mwUPh2z1lLVKOHwzEHdCAb+4bDlzo8dAxIoc40B0H6ZxVg4/5LHFJ
- La0bD0qwfKTemPRPvdCrUGRjVY38hB0RBGSXLrWBfL0PkTsuaEeRZvCVEY80YYfxmOaIKNCZI
- KTZTGrVvZWUrz2smObUJlIIzYVznL4L5rWMZjNaLpWxwyNpAg0eDTqVYFmDT+qIxNN4PgQhRy
- tSUqMKFEgm7xT/YoZD4jdOe5rJJ0dEmy9DgnlvjmjzCBjXAGdPFrFO9kKivLmdSPaubJ7DdcC
- tcrGiqydtDkturFJvTsQYH+PmTQvbe4oBqgNIRZo8f1X5RgRS0fFLp3LA8/+FKUufNNqrLMao
- +41TZ2JeFAJBnB9x8z5VMa7EVYvu5Vv7a6UPbF0i7yUPlzFy4OB0vDTMzjH7rW414iarBNvIy
- QDypz6a5PwveJ4Fe9ATD7LILVISmcIjM7r29JF4LAmFeYo0lVn6a4kM0PnIwd/wQsax1Rp9/Y
- J1/TI8TQICVBl0N9CsxgAPc+X49YqHbFXpoqbsqqK9BIb3Bj+cJJ6Owe9HtjZLb6ifZLnyA
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200127_101546_108760_0514F0F4
-X-CRM114-Status: GOOD ( 14.77 )
-X-Spam-Score: 0.0 (/)
-X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
- Content analysis details: (0.0 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.126.135 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Stefan Wahren <stefan.wahren@i2se.com>, linux-gpio@vger.kernel.org,
- bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org,
- devicetree@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This prepares the platform data to be easier to extend for more GPIOs.
-Except of this there is no functional change.
-
-Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
----
- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 57 +++++++++++++++++++++++++++--------
- 1 file changed, 44 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-index 3fc2638..ffd069a 100644
---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-@@ -82,6 +82,7 @@ struct bcm2835_pinctrl {
-
- struct pinctrl_dev *pctl_dev;
- struct gpio_chip gpio_chip;
-+ struct pinctrl_desc pctl_desc;
- struct pinctrl_gpio_range gpio_range;
-
- raw_spinlock_t irq_lock[BCM2835_NUM_BANKS];
-@@ -1051,7 +1052,7 @@ static const struct pinconf_ops bcm2711_pinconf_ops = {
- .pin_config_set = bcm2711_pinconf_set,
- };
-
--static struct pinctrl_desc bcm2835_pinctrl_desc = {
-+static const struct pinctrl_desc bcm2835_pinctrl_desc = {
- .name = MODULE_NAME,
- .pins = bcm2835_gpio_pins,
- .npins = ARRAY_SIZE(bcm2835_gpio_pins),
-@@ -1061,19 +1062,47 @@ static struct pinctrl_desc bcm2835_pinctrl_desc = {
- .owner = THIS_MODULE,
- };
-
--static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
-+static const struct pinctrl_desc bcm2711_pinctrl_desc = {
-+ .name = MODULE_NAME,
-+ .pins = bcm2835_gpio_pins,
-+ .npins = ARRAY_SIZE(bcm2835_gpio_pins),
-+ .pctlops = &bcm2835_pctl_ops,
-+ .pmxops = &bcm2835_pmx_ops,
-+ .confops = &bcm2711_pinconf_ops,
-+ .owner = THIS_MODULE,
-+};
-+
-+static const struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
- .name = MODULE_NAME,
- .npins = BCM2835_NUM_GPIOS,
- };
-
-+struct bcm_plat_data {
-+ const struct gpio_chip *gpio_chip;
-+ const struct pinctrl_desc *pctl_desc;
-+ const struct pinctrl_gpio_range *gpio_range;
-+};
-+
-+static const struct bcm_plat_data bcm2835_plat_data = {
-+ .gpio_chip = &bcm2835_gpio_chip,
-+ .pctl_desc = &bcm2835_pinctrl_desc,
-+ .gpio_range = &bcm2835_pinctrl_gpio_range,
-+};
-+
-+static const struct bcm_plat_data bcm2711_plat_data = {
-+ .gpio_chip = &bcm2835_gpio_chip,
-+ .pctl_desc = &bcm2711_pinctrl_desc,
-+ .gpio_range = &bcm2835_pinctrl_gpio_range,
-+};
-+
- static const struct of_device_id bcm2835_pinctrl_match[] = {
- {
- .compatible = "brcm,bcm2835-gpio",
-- .data = &bcm2835_pinconf_ops,
-+ .data = &bcm2835_plat_data,
- },
- {
- .compatible = "brcm,bcm2711-gpio",
-- .data = &bcm2711_pinconf_ops,
-+ .data = &bcm2711_plat_data,
- },
- {}
- };
-@@ -1083,6 +1112,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
- struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
- struct bcm2835_pinctrl *pc;
-+ struct bcm_plat_data *pdata;
- struct gpio_irq_chip *girq;
- struct resource iomem;
- int err, i;
-@@ -1108,7 +1138,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
- if (IS_ERR(pc->base))
- return PTR_ERR(pc->base);
-
-- pc->gpio_chip = bcm2835_gpio_chip;
-+ match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
-+ if (!match)
-+ return -EINVAL;
-+
-+ pdata = (struct bcm_plat_data *)match->data;
-+
-+ memcpy(&pc->gpio_chip, pdata->gpio_chip, sizeof(pc->gpio_chip));
- pc->gpio_chip.parent = dev;
- pc->gpio_chip.of_node = np;
-
-@@ -1159,19 +1195,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
- return err;
- }
-
-- match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
-- if (match) {
-- bcm2835_pinctrl_desc.confops =
-- (const struct pinconf_ops *)match->data;
-- }
--
-- pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
-+ memcpy(&pc->pctl_desc, pdata->pctl_desc, sizeof(pc->pctl_desc));
-+ pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc);
- if (IS_ERR(pc->pctl_dev)) {
- gpiochip_remove(&pc->gpio_chip);
- return PTR_ERR(pc->pctl_dev);
- }
-
-- pc->gpio_range = bcm2835_pinctrl_gpio_range;
-+ memcpy(&pc->gpio_range, pdata->gpio_range, sizeof(pc->gpio_range));
- pc->gpio_range.base = pc->gpio_chip.base;
- pc->gpio_range.gc = &pc->gpio_chip;
- pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range);
-
-From patchwork Mon Jan 27 18:15:07 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
-X-Patchwork-Id: 11353089
-Return-Path:
- <SRS0=MBPz=3Q=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01D8B159A
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:42 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id A3164214AF
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:41 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="OgchXKpW"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3164214AF
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=i2se.com
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=XmwwFukBgBjwO0LJL+fK3hmGj90hC5ef7Vri1vGrDvw=; b=OgchXKpWUifGHBapyBCQRZf4Oe
- Leu+Cl9F+oT35HizJxpDIqWCQOPGA84tYHVdL8DHnOR2sS8sgHpZTWMKe0QSgr3SUuLaQ2diawm04
- B9CSuvfP5yx9MActAPcuhQbMJldRfdt0X+pqyeQf6kaHPaj2JnqRwXWOofaMYeLQwl9zbqEB1B5Ss
- FGQnyl0V9sMSPydz6oe5UALnFguup+uWjm3ybTj1yEDhm5vypOqzhTm3vwrvY0CtmPhS3f3vx5F/7
- qNeG7wpGbnUw9b2Ta44QWFyROWbi81UIHkON1Rn1lw/J5gf470beknQM/5fyv2iHMWMVIopDs2Qpo
- Jxtt2SIA==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8wC-0000I4-7V; Mon, 27 Jan 2020 18:16:40 +0000
-Received: from mout.kundenserver.de ([212.227.126.135])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vJ-0007pO-PH
- for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000
-Received: from localhost.localdomain ([37.4.249.152]) by
- mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis)
- id 1MIxFi-1jB3PL0sMU-00KPSh; Mon, 27 Jan 2020 19:15:41 +0100
-From: Stefan Wahren <stefan.wahren@i2se.com>
-To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Linus Walleij <linus.walleij@linaro.org>, Ray Jui <rjui@broadcom.com>,
- Scott Branden <sbranden@broadcom.com>
-Subject: [RFC PATCH 3/4] pinctrl: bcm2835: Add support for all GPIOs on
- BCM2711
-Date: Mon, 27 Jan 2020 19:15:07 +0100
-Message-Id: <1580148908-4863-4-git-send-email-stefan.wahren@i2se.com>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-X-Provags-ID: V03:K1:X6IS1XjHy4cJfxjoudVoDX/cZvMR/vfdQSMdLzkgWq1irgCvB38
- RaAG8s5bLq+gwxv7sq4OOzzzIjMwUf3oUytVqdip8Emtgr3GiNEl2vBd272/sh3B1OJanK8
- goehy07Y9M/B0RMRS8QYkknz5PIlSimkZBJKjNE686UdoJg1We/vhXibKmf8z5kreTjrWe3
- q1JcyYfqP1itQAVjziUtQ==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:LyL94am3zLA=:BmnKGYucrjNaj35BCZWbP5
- JzGddQvqDkhH/CCngNEO2dMwjvlnPKHh/PEbdrGp6m9QHAmq4UkqMbHYKp4XqoYGKvPoozwfP
- FP1S21DqEh5BYA0hhWgk2maxuudk085Kg/UXpitwP437bovAei4bfR+gXu53083PnNenJAm4p
- xAhXuwmTwnWKv+qAem9IrQUBQtWZqTLIoviS/rBI58lKIF9owSsmboh1lagz+7EGkpnXhcae1
- 0MbckaZUNlfNjiRnq4V+VHRLEiPKWNxiGYMIefuH9JuPr6WXJPFk7fJo8OZ45VvNntUoYSSpc
- j0n6iO9I7UbYvyi7+SAmts7a4bZF+1qLxOl9S9cCBKPRGH2Z3kUCuTwNYlPjcUQyn6uqO0Mlx
- c+13a6OSMjdDPVRDOntBqI0l4rsK062Ig/ZwiteVVX/T7ZtOdNR2v9sRVAnh/w8iyF4VHZ0GC
- ULTnZeoeqfXKRaXEz7sGaOev/A5I1h35g02J5m9TlwjHQiNzKPNc45U2Rab8osp5QUPpRpD1N
- 4TUS9baKQp8dfAHyEkc1gBlk0cb1zDcQJMX7bQVUSSxSFx0otQCiojOcWf2PP2Hf1NREQw+82
- UV3Z09N/3ny3u6Qu0dI11Kin/x4ZubPCk2Z9H663jrHUxQP4afxI/ZCeRjqTIpU8chYef1IHT
- v3ZX4UpNi6S2kossS/nmFNqzdzxsOnNFseX4lA9Pp5DREJwDVh4t9UFpY49YOKaWkmqBFAAh4
- O7NlyceEWWYXkJh8pRPkdftSVQVKKjtoc+mmNdZ6A/MFCjlN4hQ4NzpeCvIGk1Jp/tUXAyMDV
- jBtNPE8cgg54eLvhAbGLfFWVNbu8UAkmntw7HjfU+o9g9ylEQ02IihlbByt5l+e7GdgBJm5
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200127_101546_105798_68395F22
-X-CRM114-Status: GOOD ( 17.25 )
-X-Spam-Score: 0.0 (/)
-X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
- Content analysis details: (0.0 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.126.135 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Stefan Wahren <stefan.wahren@i2se.com>, linux-gpio@vger.kernel.org,
- bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org,
- devicetree@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-The BCM2711 supports 58 GPIOs. So extend pinctrl and GPIOs accordingly.
-
-Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
----
- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 54 +++++++++++++++++++++++++++--------
- 1 file changed, 42 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-index ffd069a..41e7bf9 100644
---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
-@@ -37,6 +37,7 @@
-
- #define MODULE_NAME "pinctrl-bcm2835"
- #define BCM2835_NUM_GPIOS 54
-+#define BCM2711_NUM_GPIOS 58
- #define BCM2835_NUM_BANKS 2
- #define BCM2835_NUM_IRQS 3
-
-@@ -78,7 +79,7 @@ struct bcm2835_pinctrl {
-
- /* note: locking assumes each bank will have its own unsigned long */
- unsigned long enabled_irq_map[BCM2835_NUM_BANKS];
-- unsigned int irq_type[BCM2835_NUM_GPIOS];
-+ unsigned int irq_type[BCM2711_NUM_GPIOS];
-
- struct pinctrl_dev *pctl_dev;
- struct gpio_chip gpio_chip;
-@@ -145,6 +146,10 @@ static struct pinctrl_pin_desc bcm2835_gpio_pins[] = {
- BCM2835_GPIO_PIN(51),
- BCM2835_GPIO_PIN(52),
- BCM2835_GPIO_PIN(53),
-+ BCM2835_GPIO_PIN(54),
-+ BCM2835_GPIO_PIN(55),
-+ BCM2835_GPIO_PIN(56),
-+ BCM2835_GPIO_PIN(57),
- };
-
- /* one pin per group */
-@@ -203,6 +208,10 @@ static const char * const bcm2835_gpio_groups[] = {
- "gpio51",
- "gpio52",
- "gpio53",
-+ "gpio54",
-+ "gpio55",
-+ "gpio56",
-+ "gpio57",
- };
-
- enum bcm2835_fsel {
-@@ -353,6 +362,22 @@ static const struct gpio_chip bcm2835_gpio_chip = {
- .can_sleep = false,
- };
-
-+static const struct gpio_chip bcm2711_gpio_chip = {
-+ .label = "pinctrl-bcm2711",
-+ .owner = THIS_MODULE,
-+ .request = gpiochip_generic_request,
-+ .free = gpiochip_generic_free,
-+ .direction_input = bcm2835_gpio_direction_input,
-+ .direction_output = bcm2835_gpio_direction_output,
-+ .get_direction = bcm2835_gpio_get_direction,
-+ .get = bcm2835_gpio_get,
-+ .set = bcm2835_gpio_set,
-+ .set_config = gpiochip_generic_config,
-+ .base = -1,
-+ .ngpio = BCM2711_NUM_GPIOS,
-+ .can_sleep = false,
-+};
-+
- static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
- unsigned int bank, u32 mask)
- {
-@@ -399,7 +424,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
- bcm2835_gpio_irq_handle_bank(pc, 0, 0xf0000000);
- bcm2835_gpio_irq_handle_bank(pc, 1, 0x00003fff);
- break;
-- case 2: /* IRQ2 covers GPIOs 46-53 */
-+ case 2: /* IRQ2 covers GPIOs 46-57 */
- bcm2835_gpio_irq_handle_bank(pc, 1, 0x003fc000);
- break;
- }
-@@ -618,7 +643,7 @@ static struct irq_chip bcm2835_gpio_irq_chip = {
-
- static int bcm2835_pctl_get_groups_count(struct pinctrl_dev *pctldev)
- {
-- return ARRAY_SIZE(bcm2835_gpio_groups);
-+ return BCM2835_NUM_GPIOS;
- }
-
- static const char *bcm2835_pctl_get_group_name(struct pinctrl_dev *pctldev,
-@@ -776,7 +801,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
- err = of_property_read_u32_index(np, "brcm,pins", i, &pin);
- if (err)
- goto out;
-- if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
-+ if (pin >= pc->pctl_desc.npins) {
- dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n",
- np, pin);
- err = -EINVAL;
-@@ -852,7 +877,7 @@ static int bcm2835_pmx_get_function_groups(struct pinctrl_dev *pctldev,
- {
- /* every pin can do every function */
- *groups = bcm2835_gpio_groups;
-- *num_groups = ARRAY_SIZE(bcm2835_gpio_groups);
-+ *num_groups = BCM2835_NUM_GPIOS;
-
- return 0;
- }
-@@ -1055,7 +1080,7 @@ static const struct pinconf_ops bcm2711_pinconf_ops = {
- static const struct pinctrl_desc bcm2835_pinctrl_desc = {
- .name = MODULE_NAME,
- .pins = bcm2835_gpio_pins,
-- .npins = ARRAY_SIZE(bcm2835_gpio_pins),
-+ .npins = BCM2835_NUM_GPIOS,
- .pctlops = &bcm2835_pctl_ops,
- .pmxops = &bcm2835_pmx_ops,
- .confops = &bcm2835_pinconf_ops,
-@@ -1063,9 +1088,9 @@ static const struct pinctrl_desc bcm2835_pinctrl_desc = {
- };
-
- static const struct pinctrl_desc bcm2711_pinctrl_desc = {
-- .name = MODULE_NAME,
-+ .name = "pinctrl-bcm2711",
- .pins = bcm2835_gpio_pins,
-- .npins = ARRAY_SIZE(bcm2835_gpio_pins),
-+ .npins = BCM2711_NUM_GPIOS,
- .pctlops = &bcm2835_pctl_ops,
- .pmxops = &bcm2835_pmx_ops,
- .confops = &bcm2711_pinconf_ops,
-@@ -1077,6 +1102,11 @@ static const struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
- .npins = BCM2835_NUM_GPIOS,
- };
-
-+static const struct pinctrl_gpio_range bcm2711_pinctrl_gpio_range = {
-+ .name = "pinctrl-bcm2711",
-+ .npins = BCM2711_NUM_GPIOS,
-+};
-+
- struct bcm_plat_data {
- const struct gpio_chip *gpio_chip;
- const struct pinctrl_desc *pctl_desc;
-@@ -1090,9 +1120,9 @@ static const struct bcm_plat_data bcm2835_plat_data = {
- };
-
- static const struct bcm_plat_data bcm2711_plat_data = {
-- .gpio_chip = &bcm2835_gpio_chip,
-+ .gpio_chip = &bcm2711_gpio_chip,
- .pctl_desc = &bcm2711_pinctrl_desc,
-- .gpio_range = &bcm2835_pinctrl_gpio_range,
-+ .gpio_range = &bcm2711_pinctrl_gpio_range,
- };
-
- static const struct of_device_id bcm2835_pinctrl_match[] = {
-@@ -1118,8 +1148,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
- int err, i;
- const struct of_device_id *match;
-
-- BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS);
-- BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS);
-+ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2711_NUM_GPIOS);
-+ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2711_NUM_GPIOS);
-
- pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL);
- if (!pc)
-
-From patchwork Mon Jan 27 18:15:08 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
-X-Patchwork-Id: 11353085
-Return-Path:
- <SRS0=MBPz=3Q=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDFA01398
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:18 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 9B66F214AF
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 27 Jan 2020 18:16:18 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="ezMQm6le"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B66F214AF
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=i2se.com
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:
- In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=DPuQWycqdw9CxoKuQR42+vWv5iNmyUIYkTHQf1KLxgY=; b=ezMQm6leJB6R6ZsKnfpCgXjitb
- W3Nw1Je9MEi8SZ9v+eC3CeiTFqVt/5x1h0N8bH5ZGdptzjP+SrRIS6oD0h4pJFGg6ugBUnLmcef06
- eNSulzVLTX6qsyPkqj4pRr4fXRyP4R9Om3GidBwWl8vRQ0LLc8ssJkt/K9nW7BslGHjMmEwd+QSiF
- t7aYAjYBf45g9TP/aPeAlsgEUzpwNrdiQB0+jY4cWlMTSrz+61Fp9Ay+NopbRoQ+ZY6VHVCHoXwma
- eg91Z/Mc359cQ4CBaUn20N4gS5IUc0CMh77YTOYq3QHaJUuO5FR7ARenQTie073XFTCQtrkfCIXeJ
- h8y1Bvlw==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vl-0008F1-HZ; Mon, 27 Jan 2020 18:16:13 +0000
-Received: from mout.kundenserver.de ([212.227.126.134])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1iw8vL-0007pp-4e
- for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000
-Received: from localhost.localdomain ([37.4.249.152]) by
- mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis)
- id 1MIdS1-1iqMAq2lZF-00EeIy; Mon, 27 Jan 2020 19:15:41 +0100
-From: Stefan Wahren <stefan.wahren@i2se.com>
-To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
- Florian Fainelli <f.fainelli@gmail.com>,
- Linus Walleij <linus.walleij@linaro.org>, Ray Jui <rjui@broadcom.com>,
- Scott Branden <sbranden@broadcom.com>
-Subject: [RFC PATCH 4/4] ARM: dts: bcm2711-rpi-4-b: Add SoC GPIO labels
-Date: Mon, 27 Jan 2020 19:15:08 +0100
-Message-Id: <1580148908-4863-5-git-send-email-stefan.wahren@i2se.com>
-X-Mailer: git-send-email 2.7.4
-In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com>
-X-Provags-ID: V03:K1:Gxba3mqtzEfAZsLaIh9BPR5KGgNDsOM8n/SyTdefyB0S+Ix6nQ6
- 3ZLcgMmQ0ZYCLRjSx9LHkgciD9ISLplz152G/qC58KgorZhlZLhVE974IeKAkTW7W6RIHig
- h04Lium+H3BT4cdz+bIAKz1RoTVdqSRp3Bov22Fv5E4IbNQGvAgEx4Sh7aDH+pVGti//bPm
- sxDDXE5ZOXGV0qV3mvozA==
-X-Spam-Flag: NO
-X-UI-Out-Filterresults: notjunk:1;V03:K0:cCaO9H+V7fw=:e54AxDo4xa1RNP7BrlXkUw
- hcxiAvXNAIgIOvr2ULYOCL0TL9NzkdUBAFNQCWXg+9tQt4S1g6hU8gHkciuR6wa+2Cp8Xx5tX
- +llHcigXOC2W2A3/H9CyAonFLfN2LtqKP65pY2L50CbaZwjnsBqXhx204sIbiRowV9mxvafPo
- t2qbrWIi7u6FIMFVrCPP6wE54WKajQz0y/dLzyYY97zKFvnWCVnVi+wqat0odNyoSPsqVn0bZ
- IosK/ArAU/cdn47p/tTAICkZ4LT3Hej8lWbLgs37gDw8DDTbDojBGQNroAepDuL3/RNn+lzON
- kdG+mueLFX0OBuSSfviiSheetOwE1yiesBRvOGGH8SPAdosy99GUDu9JWlb+5Nu0T59IQTm7O
- Fjvqcu1fiL9L6Qw24XdH9osD6cr2kE4395AH6pP7KLf3KbZClN203u6SfTB9Xw5mAK1mLTOJO
- 8C2OC1qX/NFSNffy6qM68jxJ+dRjhB2kyFtiquL5w85hQ9A+0UHh47pQP+vii1XlpE/xYDuRX
- VqTiy7fJn8xtcDs0VAoOVnelun1+ppzMdObQpGWaheuA29O4gvaKjA55oKwCw1zzpVOzHmLAg
- FhqvMZv3NiqUlLpj85vqbQT9r4U6POpxLorzLyvoarWOy7nvAyVdepSLB7BhbJWwrIbzeiFNd
- 2mNR6PTfFZbsMkXdj67sk75MnEgUMjxerASnkhv0xHqQXo/rbdc2HX7fC/1Ft04B1HJextbil
- GrPQ6dSPe5SCpjQP6yd9yhLNoaLeNEHpY5Ds0M1hULtqYkJiubORBMvp9H1mmjV7o5UCHqlOW
- S9QPe97AN6cfCJGvjb5uYcfneUnc1K0Bj8mmXat9B6fHaxA7pDEsAS1Cy0OgtFjH/t37B1P
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200127_101547_491226_F9BAEAA0
-X-CRM114-Status: GOOD ( 13.91 )
-X-Spam-Score: 0.0 (/)
-X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
- Content analysis details: (0.0 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
- no trust [212.227.126.134 listed in list.dnswl.org]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- -0.0 SPF_PASS SPF: sender matches SPF record
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Stefan Wahren <stefan.wahren@i2se.com>, linux-gpio@vger.kernel.org,
- bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org,
- devicetree@vger.kernel.org
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-This adds the labels for all the SoC GPIOs on the Raspberry Pi 4.
-
-Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
----
- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 74 +++++++++++++++++++++++++++++++++++
- 1 file changed, 74 insertions(+)
-
-diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
-index 1b5a835..6607e2e 100644
---- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
-+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
-@@ -71,6 +71,80 @@
- };
- };
-
-+&gpio {
-+ /*
-+ * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
-+ * the official GPU firmware DT blob.
-+ *
-+ * Legend:
-+ * "NC" = not connected (no rail from the SoC)
-+ * "FOO" = GPIO line named "FOO" on the schematic
-+ * "FOO_N" = GPIO line named "FOO" on schematic, active low
-+ */
-+ gpio-line-names = "ID_SDA",
-+ "ID_SCL",
-+ "SDA1",
-+ "SCL1",
-+ "GPIO_GCLK",
-+ "GPIO5",
-+ "GPIO6",
-+ "SPI_CE1_N",
-+ "SPI_CE0_N",
-+ "SPI_MISO",
-+ "SPI_MOSI",
-+ "SPI_SCLK",
-+ "GPIO12",
-+ "GPIO13",
-+ /* Serial port */
-+ "TXD1",
-+ "RXD1",
-+ "GPIO16",
-+ "GPIO17",
-+ "GPIO18",
-+ "GPIO19",
-+ "GPIO20",
-+ "GPIO21",
-+ "GPIO22",
-+ "GPIO23",
-+ "GPIO24",
-+ "GPIO25",
-+ "GPIO26",
-+ "GPIO27",
-+ "RGMII_MDIO",
-+ "RGMIO_MDC",
-+ /* Used by BT module */
-+ "CTS0",
-+ "RTS0",
-+ "TXD0",
-+ "RXD0",
-+ /* Used by Wifi */
-+ "SD1_CLK",
-+ "SD1_CMD",
-+ "SD1_DATA0",
-+ "SD1_DATA1",
-+ "SD1_DATA2",
-+ "SD1_DATA3",
-+ /* Shared with SPI flash */
-+ "PWM0_MISO",
-+ "PWM1_MOSI",
-+ "STATUS_LED_G_CLK",
-+ "SPIFLASH_CE_N",
-+ "SDA0",
-+ "SCL0",
-+ "RGMII_RXCLK",
-+ "RGMII_RXCTL",
-+ "RGMII_RXD0",
-+ "RGMII_RXD1",
-+ "RGMII_RXD2",
-+ "RGMII_RXD3",
-+ "RGMII_TXCLK",
-+ "RGMII_TXCTL",
-+ "RGMII_TXD0",
-+ "RGMII_TXD1",
-+ "RGMII_TXD2",
-+ "RGMII_TXD3";
-+};
-+
- &pwm1 {
- pinctrl-names = "default";
- pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
diff --git a/arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch b/arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch
deleted file mode 100644
index 3628a7e6b..000000000
--- a/arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 59780095ba35a49946e726c88caff6f65f3e433a Mon Sep 17 00:00:00 2001
-From: Peter Robinson <pbrobinson@gmail.com>
-Date: Tue, 30 Jul 2019 14:22:36 +0100
-Subject: [PATCH] arm64: tegra: Jetson TX2: Allow bootloader to configure
- Ethernet MAC
-
-Add an ethernet alias so that a stable MAC address is added to the
-device tree for the wired ethernet interface.
-
-Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
----
- arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
-index 5e18acf5cfad..947744d0f04c 100644
---- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
-+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
-@@ -8,6 +8,7 @@
- compatible = "nvidia,p3310", "nvidia,tegra186";
-
- aliases {
-+ ethernet0 = "/ethernet@2490000";
- sdhci0 = "/sdhci@3460000";
- sdhci1 = "/sdhci@3400000";
- serial0 = &uarta;
---
-2.21.0
-
diff --git a/arm64-tegra-jetson-tx1-fixes.patch b/arm64-tegra-jetson-tx1-fixes.patch
deleted file mode 100644
index 0f476970f..000000000
--- a/arm64-tegra-jetson-tx1-fixes.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From aea4a7a551fd7342299d34f04a8b75f58644ac07 Mon Sep 17 00:00:00 2001
-From: Peter Robinson <pbrobinson@gmail.com>
-Date: Sat, 23 Mar 2019 17:45:10 +0000
-Subject: [PATCH 2/3] arm64: tegra210: Jetson TX1: disable display panel and
- associated backlight
-
-The Jetson TX1 dev kit doesn't ship with a screen by default and if
-it's not there it appears to crash on boot so disable them both by
-default until we work out the problem.
-
-Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
----
- arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
-index 37e3c46e753f..a16f24f1d5ff 100644
---- a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
-+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
-@@ -36,7 +36,7 @@
-
- host1x@50000000 {
- dsi@54300000 {
-- status = "okay";
-+ status = "disabled";
-
- avdd-dsi-csi-supply = <&vdd_dsi_csi>;
-
-@@ -54,6 +54,8 @@
-
- i2c@7000c400 {
- backlight: backlight@2c {
-+ status = "disabled";
-+
- compatible = "ti,lp8557";
- reg = <0x2c>;
-
---
-2.20.1
diff --git a/bcm2835-irqchip-Quiesce-IRQs-left-enabled-by-bootloader.patch b/bcm2835-irqchip-Quiesce-IRQs-left-enabled-by-bootloader.patch
deleted file mode 100644
index 9cb8ff5d7..000000000
--- a/bcm2835-irqchip-Quiesce-IRQs-left-enabled-by-bootloader.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-From patchwork Mon Feb 10 09:52:20 2020
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Lukas Wunner <lukas@wunner.de>
-X-Patchwork-Id: 11372935
-Return-Path:
- <SRS0=uiPw=36=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
-Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
- [172.30.200.123])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E6F4109A
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 10 Feb 2020 09:52:52 +0000 (UTC)
-Received: from bombadil.infradead.org (bombadil.infradead.org
- [198.137.202.133])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by mail.kernel.org (Postfix) with ESMTPS id 3ABD621835
- for <patchwork-linux-arm@patchwork.kernel.org>;
- Mon, 10 Feb 2020 09:52:52 +0000 (UTC)
-Authentication-Results: mail.kernel.org;
- dkim=pass (2048-bit key) header.d=lists.infradead.org
- header.i=@lists.infradead.org header.b="sLV1I6RP"
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ABD621835
-Authentication-Results: mail.kernel.org;
- dmarc=none (p=none dis=none) header.from=wunner.de
-Authentication-Results: mail.kernel.org;
- spf=none
- smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
- d=lists.infradead.org; s=bombadil.20170209; h=Sender:
- Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
- List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:To:Subject:Date:
- From:References:In-Reply-To:Message-Id:Reply-To:Content-ID:
- Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
- :Resent-Message-ID:List-Owner;
- bh=52m4zqqDQ15r/4EHqLM3tCdaghuCQFRSRI636FPzyTg=; b=sLV1I6RPSfIAq0DmE3ADnTyGjh
- NnOUSjVDCUDlMsaRe7dhAfC7D3enDiNCrnGXNT3kb6+57+bXrj31EU+9NhIevN+Rr+lrXe+8PaWKw
- Q2LbzZDJ3owcXTu2EZAYrQPHg/BScQT5NiMMHrLmISp9B3erAO45imXsyolyfBhUFbvxPY/ijVw2C
- rPXYS/w47IaC6T79wZVTZ1Iuqn0jR/qvksA7yRUBMTsnHcc3fv6yuD+cD0BFmmao7LAxKlA3uu8Ba
- MXB0/7aQIlb5yOssEfnwThbbnbrpxmnIS0CT00K1yAYIkzDAv7lS7imZ5qTy2uahyJFWjQF8T++wX
- TgZL/6mQ==;
-Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
- by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
- id 1j15kG-0008ES-UU; Mon, 10 Feb 2020 09:52:48 +0000
-Received: from mailout1.hostsharing.net ([83.223.95.204])
- by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
- id 1j15kC-0008Cu-Hl; Mon, 10 Feb 2020 09:52:46 +0000
-Received: from h08.hostsharing.net (h08.hostsharing.net
- [IPv6:2a01:37:1000::53df:5f1c:0])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (Client CN "*.hostsharing.net",
- Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified))
- by mailout1.hostsharing.net (Postfix) with ESMTPS id 32EE510192623;
- Mon, 10 Feb 2020 10:52:31 +0100 (CET)
-Received: from localhost (unknown [87.130.102.138])
- (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
- (No client certificate requested)
- by h08.hostsharing.net (Postfix) with ESMTPSA id E85DF60AD5E1;
- Mon, 10 Feb 2020 10:52:30 +0100 (CET)
-X-Mailbox-Line: From 8be2f3e95fb29abdf80240f2b8a38621c42eb2a9 Mon Sep 17
- 00:00:00 2001
-Message-Id:
- <8be2f3e95fb29abdf80240f2b8a38621c42eb2a9.1581327911.git.lukas@wunner.de>
-In-Reply-To: <713627a200d9c8fd7cac424d69e98166@kernel.org>
-References: <713627a200d9c8fd7cac424d69e98166@kernel.org>
-From: Lukas Wunner <lukas@wunner.de>
-Date: Mon, 10 Feb 2020 10:52:20 +0100
-Subject: [PATCH v2] irqchip/bcm2835: Quiesce IRQs left enabled by bootloader
-To: Thomas Gleixner <tglx@linutronix.de>, Jason Cooper <jason@lakedaemon.net>,
- Marc Zyngier <maz@kernel.org>,
- "Nicolas Saenz Julienne" <nsaenzjulienne@suse.de>
-X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
-X-CRM114-CacheID: sfid-20200210_015244_903439_EE700514
-X-CRM114-Status: GOOD ( 18.64 )
-X-Spam-Score: -0.7 (/)
-X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
- Content analysis details: (-0.7 points)
- pts rule name description
- ---- ----------------------
- --------------------------------------------------
- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/,
- low trust [83.223.95.204 listed in list.dnswl.org]
- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
- [83.223.95.204 listed in wl.mailspike.net]
- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
- 0.0 SPF_NONE SPF: sender does not publish an SPF Record
- 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
-X-BeenThere: linux-arm-kernel@lists.infradead.org
-X-Mailman-Version: 2.1.29
-Precedence: list
-List-Id: <linux-arm-kernel.lists.infradead.org>
-List-Unsubscribe:
- <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
-List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
-List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
-List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
-List-Subscribe:
- <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
- <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
-Cc: Florian Fainelli <f.fainelli@gmail.com>,
- Kristina Brooks <notstina@gmail.com>, Scott Branden <sbranden@broadcom.com>,
- Ray Jui <rjui@broadcom.com>, Serge Schneider <serge@raspberrypi.org>,
- linux-kernel@vger.kernel.org, Phil Elwell <phil@raspberrypi.org>,
- Matthias Brugger <mbrugger@suse.com>, bcm-kernel-feedback-list@broadcom.com,
- linux-rpi-kernel@lists.infradead.org, Martin Sperl <kernel@martin.sperl.org>,
- linux-arm-kernel@lists.infradead.org, Stefan Wahren <wahrenst@gmx.net>
-MIME-Version: 1.0
-Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
-Errors-To:
- linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
-
-Customers of our "Revolution Pi" open source PLCs (which are based on
-the Raspberry Pi) have reported random lockups as well as jittery eMMC,
-UART and SPI latency. We were able to reproduce the lockups in our lab
-and hooked up a JTAG debugger:
-
-It turns out that the USB controller's interrupt is already enabled when
-the kernel boots. All interrupts are disabled when the chip comes out
-of power-on reset, according to the spec. So apparently the bootloader
-enables the interrupt but neglects to disable it before handing over
-control to the kernel.
-
-The bootloader is a closed source blob provided by the Raspberry Pi
-Foundation. Development of an alternative open source bootloader was
-begun by Kristina Brooks but it's not fully functional yet. Usage of
-the blob is thus without alternative for the time being.
-
-The Raspberry Pi Foundation's downstream kernel has a performance-
-optimized USB driver (which we use on our Revolution Pi products).
-The driver takes advantage of the FIQ fast interrupt. Because the
-regular USB interrupt was left enabled by the bootloader, both the
-FIQ and the normal interrupt is enabled once the USB driver probes.
-
-The spec has the following to say on simultaneously enabling the FIQ
-and the normal interrupt of a peripheral:
-
-"One interrupt source can be selected to be connected to the ARM FIQ
- input. An interrupt which is selected as FIQ should have its normal
- interrupt enable bit cleared. Otherwise a normal and an FIQ interrupt
- will be fired at the same time. Not a good idea!"
- ^^^^^^^^^^^^^^^
-https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
-page 110
-
-On a multicore Raspberry Pi, the Foundation's kernel routes all normal
-interrupts to CPU 0 and the FIQ to CPU 1. Because both the FIQ and the
-normal interrupt is enabled, a USB interrupt causes CPU 0 to spin in
-bcm2836_chained_handle_irq() until the FIQ on CPU 1 has cleared it.
-Interrupts with a lower priority than USB are starved as long.
-
-That explains the jittery eMMC, UART and SPI latency: On one occasion
-I've seen CPU 0 blocked for no less than 2.9 msec. Basically,
-everything not USB takes a performance hit: Whereas eMMC throughput
-on a Compute Module 3 remains relatively constant at 23.5 MB/s with
-this commit, it irregularly dips to 23.0 MB/s without this commit.
-
-The lockups occur when CPU 0 receives a USB interrupt while holding a
-lock which CPU 1 is trying to acquire while the FIQ is temporarily
-disabled on CPU 1.
-
-I've tested old releases of the Foundation's bootloader as far back as
-1.20160202-1 and they all leave the USB interrupt enabled. Still older
-releases fail to boot a contemporary kernel on a Compute Module 1 or 3,
-which are the only Raspberry Pi variants I have at my disposal for
-testing.
-
-Fix by disabling IRQs left enabled by the bootloader. Although the
-impact is most pronounced on the Foundation's downstream kernel,
-it seems prudent to apply the fix to the upstream kernel to guard
-against such mistakes in any present and future bootloader.
-
-Signed-off-by: Lukas Wunner <lukas@wunner.de>
-Cc: Serge Schneider <serge@raspberrypi.org>
-Cc: Kristina Brooks <notstina@gmail.com>
-Cc: stable@vger.kernel.org
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
----
-Changes since v1:
-* Use "relaxed" MMIO accessors to avoid memory barriers (Marc)
-* Use u32 instead of int for register access (Marc)
-* Quiesce FIQ as well (Marc)
-* Quiesce IRQs after mapping them for better readability
-* Drop alternative approach from commit message (Marc)
-
-Link to v1:
-https://lore.kernel.org/lkml/988737dbbc4e499c2faaaa4e567ba3ed8deb9a89.1581089797.git.lukas@wunner.de/
-
- drivers/irqchip/irq-bcm2835.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
-index 418245d31921..63539c88ac3a 100644
---- a/drivers/irqchip/irq-bcm2835.c
-+++ b/drivers/irqchip/irq-bcm2835.c
-@@ -61,6 +61,7 @@
- | SHORTCUT1_MASK | SHORTCUT2_MASK)
-
- #define REG_FIQ_CONTROL 0x0c
-+#define REG_FIQ_ENABLE 0x80
-
- #define NR_BANKS 3
- #define IRQS_PER_BANK 32
-@@ -135,6 +136,7 @@ static int __init armctrl_of_init(struct device_node *node,
- {
- void __iomem *base;
- int irq, b, i;
-+ u32 reg;
-
- base = of_iomap(node, 0);
- if (!base)
-@@ -157,6 +159,19 @@ static int __init armctrl_of_init(struct device_node *node,
- handle_level_irq);
- irq_set_probe(irq);
- }
-+
-+ reg = readl_relaxed(intc.enable[b]);
-+ if (reg) {
-+ writel_relaxed(reg, intc.disable[b]);
-+ pr_err(FW_BUG "Bootloader left irq enabled: "
-+ "bank %d irq %*pbl\n", b, IRQS_PER_BANK, &reg);
-+ }
-+ }
-+
-+ reg = readl_relaxed(base + REG_FIQ_CONTROL);
-+ if (reg & REG_FIQ_ENABLE) {
-+ writel_relaxed(0, base + REG_FIQ_CONTROL);
-+ pr_err(FW_BUG "Bootloader left fiq enabled\n");
- }
-
- if (is_2836) {
diff --git a/bcm283x-gpu-drm-v3d-Add-ARCH_BCM2835-to-DRM_V3D-Kconfig.patch b/bcm283x-gpu-drm-v3d-Add-ARCH_BCM2835-to-DRM_V3D-Kconfig.patch
deleted file mode 100644
index a11f2ce1a..000000000
--- a/bcm283x-gpu-drm-v3d-Add-ARCH_BCM2835-to-DRM_V3D-Kconfig.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 9ad059ee412caed3fc8666dadf0d2e897d621958 Mon Sep 17 00:00:00 2001
-From: Peter Robinson <pbrobinson@gmail.com>
-Date: Wed, 18 Dec 2019 08:03:36 +0000
-Subject: [PATCH] gpu/drm/v3d: Add ARCH_BCM2835 to DRM_V3D Kconfig
-
-On arm64 the config ARCH_BCM doesn't exist so to be able to
-build for platforms such as the Raspberry Pi 4 we need to add
-ARCH_BCM2835 similar to what has been done on vc4.
-
-Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
----
- drivers/gpu/drm/v3d/Kconfig | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-