diff options
author | Justin M. Forbes <jforbes@redhat.com> | 2015-01-13 16:51:24 -0600 |
---|---|---|
committer | Justin M. Forbes <jforbes@redhat.com> | 2015-01-13 16:51:24 -0600 |
commit | c1b14f57bf2812bef1a12dec0ed58a5463d64382 (patch) | |
tree | 186fa5bd6f8bd2dbe4a4a863509e929a5d9e06a0 | |
parent | dca3c158ea1942845f8d148e06bf13908574959d (diff) | |
download | kernel-c1b14f57bf2812bef1a12dec0ed58a5463d64382.tar.gz kernel-c1b14f57bf2812bef1a12dec0ed58a5463d64382.tar.xz kernel-c1b14f57bf2812bef1a12dec0ed58a5463d64382.zip |
Linux v3.18.2
38 files changed, 6635 insertions, 5734 deletions
diff --git a/ARM-tegra-usb-no-reset.patch b/ARM-tegra-usb-no-reset.patch index f67d5038..2b1058b2 100644 --- a/ARM-tegra-usb-no-reset.patch +++ b/ARM-tegra-usb-no-reset.patch @@ -9,23 +9,23 @@ 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 674c262907d9..d3e4c73d56a2 100644 +index b649fef2e35d..fb89290710ad 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5041,6 +5041,13 @@ static void hub_events(void) - (u16) hub->change_bits[0], - (u16) hub->event_bits[0]); +@@ -5023,6 +5023,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) && -+ (hub->event_bits[0] == 0x2)) -+ hub->event_bits[0] = 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) && ++ (hub->event_bits[0] == 0x2)) ++ hub->event_bits[0] = 0; ++ } + - /* Lock the device, then check to see if we were - * disconnected while waiting for the lock to succeed. */ - usb_lock_device(hdev); + /* Lock the device, then check to see if we were + * disconnected while waiting for the lock to succeed. */ + usb_lock_device(hdev); -- 2.1.0 diff --git a/Add-an-EFI-signature-blob-parser-and-key-loader.patch b/Add-an-EFI-signature-blob-parser-and-key-loader.patch index 0a121de2..7c5c7e7c 100644 --- a/Add-an-EFI-signature-blob-parser-and-key-loader.patch +++ b/Add-an-EFI-signature-blob-parser-and-key-loader.patch @@ -159,12 +159,12 @@ index 000000000000..424896a0b169 + return 0; +} diff --git a/include/linux/efi.h b/include/linux/efi.h -index 5ce40e215f15..41359e548bcb 100644 +index 58d7feadd149..b1d686e9175e 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -906,6 +906,10 @@ extern bool efi_poweroff_required(void); - (md) <= (efi_memory_desc_t *)((m)->map_end - (m)->desc_size); \ - (md) = (void *)(md) + (m)->desc_size) +@@ -919,6 +919,10 @@ extern bool efi_poweroff_required(void); + char * __init efi_md_typeattr_format(char *buf, size_t size, + const efi_memory_desc_t *md); +struct key; +extern int __init parse_efi_signature_list(const void *data, size_t size, diff --git a/HID-wacom-Add-support-for-the-Cintiq-Companion.patch b/HID-wacom-Add-support-for-the-Cintiq-Companion.patch deleted file mode 100644 index 3a09a56b..00000000 --- a/HID-wacom-Add-support-for-the-Cintiq-Companion.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Benjamin Tissoires <benjamin.tissoires@redhat.com> -Date: Wed, 3 Sep 2014 15:43:25 -0400 -Subject: [PATCH] HID: wacom: Add support for the Cintiq Companion - -The Wacom Cintiq Companion shares the same sensor than the Cintiq -Companion Hybrid, with the exception of the different PIDs. - -Bugzilla: 1134969 -Upstream-status: Queued for 3.18 - -Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> ---- - drivers/hid/wacom_wac.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c -index aa6a08eb7ad6..c3cbbfb5811f 100644 ---- a/drivers/hid/wacom_wac.c -+++ b/drivers/hid/wacom_wac.c -@@ -2573,6 +2573,14 @@ static const struct wacom_features wacom_features_0x309 = - { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */ - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10, - .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; -+static const struct wacom_features wacom_features_0x30A = -+ { "Wacom ISDv5 30A", 59352, 33648, 2047, 63, -+ CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 200, 200, -+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30C }; -+static const struct wacom_features wacom_features_0x30C = -+ { "Wacom ISDv5 30C", .type = WACOM_24HDT, /* Touch */ -+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30A, .touch_max = 10, -+ .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; - - #define USB_DEVICE_WACOM(prod) \ - HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ -@@ -2708,6 +2716,8 @@ const struct hid_device_id wacom_ids[] = { - { USB_DEVICE_WACOM(0x304) }, - { USB_DEVICE_WACOM(0x307) }, - { USB_DEVICE_WACOM(0x309) }, -+ { USB_DEVICE_WACOM(0x30A) }, -+ { USB_DEVICE_WACOM(0x30C) }, - { USB_DEVICE_WACOM(0x30E) }, - { USB_DEVICE_WACOM(0x314) }, - { USB_DEVICE_WACOM(0x315) }, --- -2.1.0 - diff --git a/arm64-fix-xgene_enet_process_ring.patch b/arm64-fix-xgene_enet_process_ring.patch deleted file mode 100644 index ea23d75c..00000000 --- a/arm64-fix-xgene_enet_process_ring.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -390,7 +390,7 @@ static int xgene_enet_process_ring(struct xgene_enet_desc_ring *ring, - } - } - -- return budget; -+ return count; - } - - static int xgene_enet_napi(struct napi_struct *napi, const int budget) diff --git a/arm64-force-serial-to-be-active-consdev.patch b/arm64-force-serial-to-be-active-consdev.patch deleted file mode 100644 index 203dcefe..00000000 --- a/arm64-force-serial-to-be-active-consdev.patch +++ /dev/null @@ -1,84 +0,0 @@ -From rharm-kernel-patches-bounces@redhat.com Fri Nov 21 18:21:38 2014 -From: Mark Salter <msalter@redhat.com> -To: rharm-kernel-patches@redhat.com -Subject: [PATCH] tty/pl011: make ttyAMA0 the active console device -Date: Fri, 21 Nov 2014 18:21:30 -0500 -Message-Id: <1416612090-31594-1-git-send-email-msalter@redhat.com> - -Upstream: No. Temporary workaround to avoid console= -Testing: Seattle booting with devicetree - -The pl011 uart driver doesn't register itself as a console -until device_initcall time. This allows the virtual console -driver to register the active console if no console= is -given on the cmdline. This patch allows ttyAMA0 to take -over the active console device role from any existing -console device if no console= is given on the cmdline. - -Signed-off-by: Mark Salter <msalter@redhat.com> ---- - drivers/tty/serial/amba-pl011.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index 8572f2a..454aa26 100644 ---- a/drivers/tty/serial/amba-pl011.c -+++ b/drivers/tty/serial/amba-pl011.c -@@ -2182,7 +2182,15 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) - } - } - -+ /* -+ * temp hack to avoid need for console= on cmdline -+ * this can go away when we switch completely to acpi -+ */ -+ if (amba_reg.cons && !console_set_on_cmdline && uap->port.line == 0) -+ amba_reg.cons->flags |= CON_CONSDEV; - ret = uart_add_one_port(&amba_reg, &uap->port); -+ if (amba_reg.cons && !console_set_on_cmdline && uap->port.line == 0) -+ amba_reg.cons->flags &= ~CON_CONSDEV; - if (ret) { - amba_ports[i] = NULL; - uart_unregister_driver(&amba_reg); --- -1.9.3 - -From rharm-kernel-patches-bounces@redhat.com Tue Nov 18 22:09:42 2014 -From: Mark Salter <msalter@redhat.com> -To: rharm-kernel-patches@redhat.com -Subject: [PATCH v2] tty/sbsauart: make ttySBSA the active console device -Date: Tue, 18 Nov 2014 22:09:04 -0500 -Message-Id: <1416366544-31116-2-git-send-email-msalter@redhat.com> - -The sbsauart driver doesn't register itself as a console -until module_initcall time. This allows the virtual console -driver to register the active console if no console= is -given on the cmdline. This patch allows ttySBSA to take -over the active console device role from any existing -console device if no console= is given on the cmdline. - -Upstream: No -Testing: Seattle and Foundation Model - -Signed-off-by: Mark Salter <msalter@redhat.com> ---- - drivers/tty/sbsauart.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/tty/sbsauart.c b/drivers/tty/sbsauart.c -index 3a3ff88..e7d35d5 100644 ---- a/drivers/tty/sbsauart.c -+++ b/drivers/tty/sbsauart.c -@@ -280,6 +280,9 @@ static int sbsa_tty_probe(struct platform_device *pdev) - qtty->console.device = sbsa_tty_console_device; - qtty->console.setup = sbsa_tty_console_setup; - qtty->console.flags = CON_PRINTBUFFER; -+ /* if no console= on cmdline, make this the console device */ -+ if (!console_set_on_cmdline) -+ qtty->console.flags |= CON_CONSDEV; - qtty->console.index = pdev->id; - register_console(&qtty->console); - --- -1.9.3 - diff --git a/arm64-vgic-error-to-info.patch b/arm64-vgic-error-to-info.patch deleted file mode 100644 index 8f71f97e..00000000 --- a/arm64-vgic-error-to-info.patch +++ /dev/null @@ -1,40 +0,0 @@ -commit 701e24e5a9e59b17bbfc9a3bdbd61f346cd468ea -Author: Donald Dutile <ddutile@redhat.com> -Date: Tue Sep 16 18:53:48 2014 -0400 - - arm64: kvm: Change vgic resource size error to info - - A new check was added to upstream to ensure a full - kernel page was allocated to the vgic. The check failed - kvm configuration if the condition wasn't met. - This 'feature' has been around and there isn't a security - issue in Acadia. Change error to info & continue configuration - for now. - A future patch using ACPI &/or a DT update will make this patch - go away in a future snap release. - - Signed-off-by: Donald Dutile <ddutile@redhat.com> - -diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c -index 416baed..f43488c 100644 ---- a/virt/kvm/arm/vgic-v2.c -+++ b/virt/kvm/arm/vgic-v2.c -@@ -240,11 +240,18 @@ int vgic_v2_probe(struct device_node *vgic_node, - } - - if (!PAGE_ALIGNED(resource_size(&vcpu_res))) { -+#if 0 /* not for upstream, firmware fix */ - kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n", - (unsigned long long)resource_size(&vcpu_res), - PAGE_SIZE); - ret = -ENXIO; - goto out_unmap; -+#else -+ kvm_info("GICV size 0x%llx not a multiple of page size 0x%lx\n", -+ (unsigned long long)resource_size(&vcpu_res), -+ PAGE_SIZE); -+ kvm_info("Update DT to assign GICV a multiple of kernel page size \n"); -+#endif - } - - vgic->vcpu_base = vcpu_res.start; diff --git a/config-arm-generic b/config-arm-generic index d253e6f8..c0fa94dd 100644 --- a/config-arm-generic +++ b/config-arm-generic @@ -24,8 +24,6 @@ CONFIG_RESET_CONTROLLER=y CONFIG_RESET_GPIO=y CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RTC_DRV_SNVS is not set -# CONFIG_RTC_DRV_HYM8563 is not set CONFIG_BACKLIGHT_PWM=m CONFIG_INPUT_PWM_BEEPER=m CONFIG_ARM_SP805_WATCHDOG=m @@ -70,10 +68,10 @@ CONFIG_POWER_RESET_VEXPRESS=y CONFIG_REGULATOR_VEXPRESS=m CONFIG_SENSORS_VEXPRESS=m CONFIG_CLKSRC_VERSATILE=y +CONFIG_POWER_RESET_VERSATILE=y # CONFIG_ARM_CHARLCD is not set # Power/Thermal/Cpufreq -CONFIG_GENERIC_CPUFREQ_CPU0=m # CONFIG_ARM_DT_BL_CPUFREQ is not set # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set @@ -88,22 +86,27 @@ CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IOMMU=y CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=m CONFIG_OF_MTD=y CONFIG_OF_NET=y CONFIG_OF_PCI_IRQ=m CONFIG_OF_PCI=m CONFIG_OF_RESERVED_MEM=y +CONFIG_OF_RESOLVE=y CONFIG_PATA_OF_PLATFORM=m # CONFIG_OF_SELFTEST is not set CONFIG_SERIAL_OF_PLATFORM=y CONFIG_THERMAL_OF=y +# CONFIG_OF_MDIO is not set +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set + # External Connectors CONFIG_EXTCON=m CONFIG_EXTCON_GPIO=m CONFIG_EXTCON_ADC_JACK=m # CONFIG_EXTCON_SM5502 is not set +# CONFIG_EXTCON_RT8973A is not set # MTD CONFIG_MTD_BLKDEVS=m @@ -127,9 +130,9 @@ CONFIG_GPIO_WATCHDOG=m CONFIG_GPIOLIB=y CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y CONFIG_ARCH_REQUIRE_GPIOLIB=y -CONFIG_MDIO_GPIO=m CONFIG_BACKLIGHT_GPIO=m CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_RESET_RESTART=y #i2c @@ -184,6 +187,8 @@ CONFIG_CMA_AREAS=7 # CONFIG_IRQ_DOMAIN_DEBUG is not set # CONFIG_LOCK_STAT is not set +# CONFIG_CADENCE_WATCHDOG is not set + # CONFIG_DRM_ARMADA is not set # CONFIG_DRM_TEGRA is not set # CONFIG_SHMOBILE_IOMMU is not set diff --git a/config-arm64 b/config-arm64 index 37b4d3ad..9fd40b9f 100644 --- a/config-arm64 +++ b/config-arm64 @@ -8,6 +8,7 @@ CONFIG_SCHED_SMT=y # arm64 only SoCs CONFIG_ARCH_XGENE=y +# CONFIG_ARCH_THUNDER is not set # CONFIG_AMBA_PL08X is not set CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y @@ -17,7 +18,6 @@ CONFIG_ARM64_64K_PAGES=y CONFIG_BCMA_POSSIBLE=y CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -CONFIG_BQL=y CONFIG_BRCMUTIL=m CONFIG_BUG=y CONFIG_CLKDEV_LOOKUP=y @@ -42,7 +42,6 @@ CONFIG_HZ=100 CONFIG_KVM=y CONFIG_KVM_ARM_MAX_VCPUS=8 -CONFIG_LOG_BUF_SHIFT=14 CONFIG_NFS_ACL_SUPPORT=y CONFIG_NFS_COMMON=y @@ -53,7 +52,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y # CONFIG_PL330_DMA is not set CONFIG_RCU_FANOUT=64 # CONFIG_RTC_DRV_PL030 is not set -# CONFIG_RTC_DRV_PL031 is not set +CONFIG_RTC_DRV_PL031=y CONFIG_SERIAL_8250_DMA=y # CONFIG_SERIAL_AMBA_PL010 is not set CONFIG_SPARSE_IRQ=y @@ -69,6 +68,7 @@ CONFIG_EFI_VARS=y CONFIG_EFIVAR_FS=y CONFIG_EFI_VARS_PSTORE=y CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y +CONFIG_RTC_DRV_EFI=y CONFIG_ARM64_CRYPTO=y CONFIG_CRYPTO_SHA1_ARM64_CE=m @@ -82,6 +82,7 @@ CONFIG_CRYPTO_DEV_CCP=y CONFIG_CRYPTO_DEV_CCP_DD=m CONFIG_CRYPTO_DEV_CCP_CRYPTO=m +CONFIG_ARM64_CPUIDLE=y # APM Xgene CONFIG_POWER_RESET_XGENE=y @@ -91,13 +92,8 @@ CONFIG_AHCI_XGENE=y CONFIG_PHY_XGENE=y CONFIG_NET_XGENE=y CONFIG_RTC_DRV_XGENE=m -CONFIG_RTC_DRV_EFI=y - -# not arm64 -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +CONFIG_HW_RANDOM_XGENE=m +CONFIG_GPIO_XGENE=y # busted build for various reasons # uses pci_* for some reason to allocate DMA buffers @@ -120,7 +116,6 @@ CONFIG_NET_SB1000=y CONFIG_SBSAUART_TTY=y CONFIG_I2C_SCMI=m CONFIG_SENSORS_ACPI_POWER=m -CONFIG_IMX_THERMAL=m CONFIG_PWM_LPSS=m CONFIG_ACPI=y CONFIG_ACPI_PROCFS_POWER=y @@ -133,8 +128,17 @@ CONFIG_ACPI_CONTAINER=y CONFIG_ACPI_HED=m CONFIG_ACPI_CUSTOM_METHOD=m -CONFIG_AMD_XGBE=y -CONFIG_AMD_XGBE_PHY=y +CONFIG_AMD_XGBE=m +CONFIG_AMD_XGBE_PHY=m # CONFIG_AMD_XGBE_DCB is not set +# CONFIG_IMX_THERMAL is not set + +# still? 2014-11-11 +# CONFIG_BPF_JIT is not set + +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DMI_SYSFS=y + CONFIG_SATA_AHCI_PLATFORM=y diff --git a/config-armv7 b/config-armv7 index 133a3106..652d2248 100644 --- a/config-armv7 +++ b/config-armv7 @@ -65,6 +65,7 @@ CONFIG_SND_KIRKWOOD_SOC_ARMADA370_DB=m CONFIG_USB_EHCI_HCD_ORION=m CONFIG_MMC_SDHCI_PXAV3=m CONFIG_MVPP2=m +CONFIG_COMMON_CLK_SI5351=m # CONFIG_CACHE_FEROCEON_L2 is not set # CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set @@ -164,6 +165,7 @@ CONFIG_RTC_DRV_PALMAS=m CONFIG_OMAP5_DSS_HDMI=y CONFIG_OMAP5_DSS_HDMI_AUDIO=y CONFIG_COMMON_CLK_PALMAS=m +CONFIG_INPUT_PALMAS_PWRBUTTON=m CONFIG_WL_TI=y CONFIG_WLCORE_SDIO=m @@ -184,10 +186,9 @@ CONFIG_INPUT_TWL4030_VIBRA=m CONFIG_INPUT_TWL6040_VIBRA=m CONFIG_KEYBOARD_OMAP4=m CONFIG_KEYBOARD_TWL4030=m +CONFIG_LEDS_TCA6507=m -# OMAP thermal temp. Can likely be built as module but doesn't autoload so build in to ensure performance on PandaES -CONFIG_TI_SOC_THERMAL=y -CONFIG_TI_THERMAL=y +# OMAP thermal temp. CONFIG_OMAP4_THERMAL=y CONFIG_OMAP5_THERMAL=y @@ -249,9 +250,6 @@ CONFIG_VIDEO_OMAP3=m # The ones below are for TI Davinci # CONFIG_VIDEO_DM6446_CCDC is not set # CONFIG_VIDEO_DM355_CCDC is not set -# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver -CONFIG_V4L_TEST_DRIVERS=y -CONFIG_VIDEO_VIVI=m CONFIG_SND_OMAP_SOC=m CONFIG_SND_SOC_I2C_AND_SPI=m @@ -267,6 +265,7 @@ CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m CONFIG_SND_OMAP_SOC_RX51=m CONFIG_SND_SOC_TLV320AIC23=m CONFIG_SND_SOC_TLV320AIC3X=m +CONFIG_SND_SOC_TPA6130A2=m CONFIG_SND_SOC_TWL4030=m CONFIG_SND_SOC_TWL6040=m CONFIG_SND_SOC_PCM1792A=m @@ -321,10 +320,16 @@ CONFIG_ARCH_MSM8960=y CONFIG_ARCH_MSM8974=y CONFIG_SERIAL_MSM=y CONFIG_SERIAL_MSM_CONSOLE=y +CONFIG_SERIAL_MSM_HS=m CONFIG_PINCTRL_APQ8064=m +CONFIG_PINCTRL_APQ8084=m CONFIG_PINCTRL_IPQ8064=m CONFIG_PINCTRL_MSM8960=m +CONFIG_PINCTRL_MSM8X74=m CONFIG_COMMON_CLK_QCOM=m +CONFIG_MFD_QCOM_RPM=m +CONFIG_MFD_PM8921_CORE=m +CONFIG_REGULATOR_QCOM_RPM=m CONFIG_APQ_GCC_8084=m CONFIG_APQ_MMCC_8084=m CONFIG_IPQ_GCC_806X=m @@ -340,16 +345,24 @@ CONFIG_GPIO_MSM_V2=m CONFIG_POWER_RESET_MSM=y CONFIG_USB_MSM_OTG=m CONFIG_MMC_SDHCI_MSM=m +CONFIG_MMC_QCOM_DML=m CONFIG_QCOM_BAM_DMA=m CONFIG_QCOM_GSBI=m CONFIG_PHY_QCOM_APQ8064_SATA=m CONFIG_PHY_QCOM_IPQ806X_SATA=m +CONFIG_USB_DWC3_QCOM=m CONFIG_CRYPTO_DEV_QCE=m CONFIG_MSM_IOMMU=y CONFIG_DRM_MSM=m CONFIG_DRM_MSM_FBDEV=y CONFIG_USB_EHCI_MSM=m +CONFIG_MFD_PM8XXX=m +CONFIG_KEYBOARD_PMIC8XXX=m +CONFIG_INPUT_PM8XXX_VIBRATOR=m +CONFIG_INPUT_PMIC8XXX_PWRKEY=m +CONFIG_RTC_DRV_PM8XXX=m # CONFIG_DRM_MSM_REGISTER_LOGGING is not set +CONFIG_QCOM_WDT=m # i.MX # CONFIG_MXC_DEBUG_BOARD is not set @@ -400,6 +413,7 @@ CONFIG_RTC_DRV_SNVS=m # CONFIG_FB_IMX is not set CONFIG_SND_IMX_SOC=m +CONFIG_SND_SOC_FSL_ASOC_CARD=m CONFIG_SND_SOC_FSL_ASRC=m CONFIG_SND_SOC_FSL_ESAI=m CONFIG_SND_SOC_FSL_SAI=m @@ -408,14 +422,21 @@ CONFIG_SND_SOC_FSL_SSI=m CONFIG_SND_SOC_FSL_UTILS=m CONFIG_SND_SOC_IMX_SSI=m CONFIG_SND_SOC_IMX_AUDMUX=m +CONFIG_SND_SOC_IMX_ES8328=m CONFIG_SND_SOC_IMX_PCM_FIQ=m CONFIG_SND_SOC_IMX_PCM_DMA=m CONFIG_SND_SOC_IMX_SGTL5000=m CONFIG_SND_SOC_IMX_WM8962=m CONFIG_SND_SOC_IMX_MC13783=m CONFIG_SND_SOC_IMX_SPDIF=m +CONFIG_SND_SOC_CS42XX8_I2C=m +CONFIG_SND_SOC_ES8328=m +CONFIG_SND_SOC_ES8328_I2C=m +CONFIG_SND_SOC_ES8328_SPI=m CONFIG_SND_SOC_EUKREA_TLV320=m +CONFIG_SND_SOC_SGTL5000=m CONFIG_SND_SOC_WM8731=m +CONFIG_SND_SOC_WM8962=m CONFIG_USB_IMX21_HCD=m CONFIG_USB_MXS_PHY=m @@ -480,12 +501,26 @@ CONFIG_REGULATOR_DA9055=m CONFIG_ARCH_EXYNOS4=y CONFIG_SOC_EXYNOS4212=y CONFIG_SOC_EXYNOS4412=y +CONFIG_ARM_EXYNOS4210_CPUFREQ=y +CONFIG_ARM_EXYNOS4X12_CPUFREQ=y +CONFIG_AK8975=m +CONFIG_CM36651=m +CONFIG_KEYBOARD_SAMSUNG=m # Rockchips CONFIG_I2C_RK3X=m CONFIG_SPI_ROCKCHIP=m CONFIG_SND_SOC_ROCKCHIP=m CONFIG_PWM_ROCKCHIP=m +CONFIG_ROCKCHIP_SARADC=m +CONFIG_ROCKCHIP_IODOMAIN=m +CONFIG_MMC_DW_ROCKCHIP=m +CONFIG_EMAC_ROCKCHIP=m +CONFIG_MFD_RK808=m +CONFIG_COMMON_CLK_RK808=m +CONFIG_REGULATOR_RK808=m +CONFIG_RTC_DRV_HYM8563=m +CONFIG_ROCKCHIP_SARADC=m # ST Ericsson CONFIG_MACH_HREFV60=y @@ -508,6 +543,8 @@ CONFIG_AHCI_ST=m CONFIG_INPUT_AB8500_PONKEY=m CONFIG_REGULATOR_AB8500=y CONFIG_AB8500_USB=m +CONFIG_USB_MUSB_UX500=m +CONFIG_USB_UX500_DMA=y CONFIG_RTC_DRV_AB8500=m CONFIG_PWM_AB8500=m CONFIG_SND_SOC_UX500=m @@ -572,19 +609,18 @@ CONFIG_RTC_DRV_TPS6586X=m CONFIG_SERIO_OLPC_APSP=m # Zynq-7xxx -# likely needs usb still CONFIG_SERIAL_UARTLITE=y CONFIG_SERIAL_UARTLITE_CONSOLE=y CONFIG_SERIAL_XILINX_PS_UART=y CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y CONFIG_COMMON_CLK_AXI_CLKGEN=m +CONFIG_COMMON_CLK_SI570=m CONFIG_ARM_ZYNQ_CPUIDLE=y CONFIG_LATTICE_ECP3_CONFIG=m CONFIG_NET_VENDOR_XILINX=y CONFIG_XILINX_EMACLITE=m CONFIG_GPIO_XILINX=y -# Broken -# CONFIG_GPIO_ZYNQ is not set +CONFIG_GPIO_ZYNQ=m CONFIG_I2C_XILINX=m CONFIG_SPI_XILINX=m CONFIG_SPI_CADENCE=m @@ -600,6 +636,10 @@ CONFIG_XILLYBUS=m CONFIG_XILLYBUS_PCIE=m CONFIG_XILLYBUS_OF=m CONFIG_GS_FPGABOOT=m +CONFIG_USB_GADGET_XILINX=m +CONFIG_PCIE_XILINX=y +CONFIG_CADENCE_WATCHDOG=m +CONFIG_REGULATOR_ISL9305=m # Multi function devices CONFIG_MFD_88PM800=m diff --git a/config-armv7-generic b/config-armv7-generic index c9176527..cd5f89b3 100644 --- a/config-armv7-generic +++ b/config-armv7-generic @@ -61,6 +61,7 @@ CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y # CONFIG_ARCH_HI3xxx is not set # CONFIG_ARCH_HISI is not set # CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set # CONFIG_ARCH_QCOM is not set # CONFIG_ARCH_S5PV210 is not set # CONFIG_ARCH_SHMOBILE_MULTI is not set @@ -112,11 +113,17 @@ CONFIG_SCHED_SMT=y CONFIG_RCU_FANOUT=32 +# Power management / thermal / cpu scaling CONFIG_CPU_IDLE=y # CONFIG_CPU_IDLE_GOV_LADDER is not set CONFIG_CPU_IDLE_GOV_MENU=y # CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set +CONFIG_PM_OPP=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_PSCI=y +CONFIG_THERMAL=y +CONFIG_CPUFREQ_DT=y # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 @@ -188,6 +195,7 @@ CONFIG_REGULATOR_AXP20X=m CONFIG_IR_SUNXI=m CONFIG_MDIO_SUN4I=m CONFIG_SUN4I_EMAC=m +CONFIG_RTC_DRV_SUN6I=m # Exynos CONFIG_ARCH_EXYNOS3=y @@ -202,8 +210,6 @@ CONFIG_SOC_EXYNOS5410=y CONFIG_SOC_EXYNOS5800=y CONFIG_SERIAL_SAMSUNG=y CONFIG_SERIAL_SAMSUNG_CONSOLE=y -CONFIG_ARM_EXYNOS4210_CPUFREQ=y -CONFIG_ARM_EXYNOS4X12_CPUFREQ=y CONFIG_ARM_EXYNOS5250_CPUFREQ=y CONFIG_ARM_EXYNOS5440_CPUFREQ=y CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW=y @@ -215,6 +221,7 @@ CONFIG_I2C_S3C2410=m CONFIG_SPI_S3C64XX=m CONFIG_EXYNOS_THERMAL=m CONFIG_EXYNOS_THERMAL_CORE=y +CONFIG_EXYNOS_ADC=m CONFIG_MMC_SDHCI_S3C=m CONFIG_MMC_SDHCI_S3C_DMA=y CONFIG_MMC_DW_EXYNOS=m @@ -234,6 +241,9 @@ CONFIG_REGULATOR_S2MPS11=m CONFIG_REGULATOR_S5M8767=m CONFIG_TCG_TIS_I2C_INFINEON=m CONFIG_RTC_DRV_S5M=m +CONFIG_MFD_WM8994=m +CONFIG_GPIO_WM8994=m +CONFIG_REGULATOR_WM8994=m # CONFIG_RTC_DRV_S3C is not set CONFIG_EXYNOS_VIDEO=y @@ -254,7 +264,14 @@ CONFIG_DRM_EXYNOS_ROTATOR=y CONFIG_DRM_EXYNOS_VIDI=y CONFIG_PHY_EXYNOS_DP_VIDEO=m # CONFIG_FB_S3C is not set -# CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS is not set +CONFIG_PHY_EXYNOS_MIPI_VIDEO=m +CONFIG_PHY_EXYNOS_DP_VIDEO=m +CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=y +CONFIG_VIDEO_EXYNOS_FIMC_LITE=m +CONFIG_VIDEO_EXYNOS4_FIMC_IS=m +CONFIG_VIDEO_EXYNOS4_ISP_DMA_CAPTURE=y +CONFIG_VIDEO_S5P_FIMC=m +CONFIG_VIDEO_S5P_MIPI_CSIS=m CONFIG_VIDEO_SAMSUNG_S5P_G2D=m CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m CONFIG_VIDEO_SAMSUNG_S5P_MFC=m @@ -267,11 +284,10 @@ CONFIG_SND_SOC_SAMSUNG_SMDK_WM8994=m CONFIG_SND_SOC_SMDK_WM8994_PCM=m CONFIG_SND_SOC_SNOW=m CONFIG_SND_SOC_ODROIDX2=m -# CONFIG_GPIO_WM8994 is not set -# CONFIG_REGULATOR_WM8994 is not set # CONFIG_EXYNOS_IOMMU_DEBUG is not set # CONFIG_SAMSUNG_PM_DEBUG is not set # CONFIG_SAMSUNG_PM_CHECK is not set +# CONFIG_ARM_EXYNOS5_BUS_DEVFREQ is not set # Arndale/Origen CONFIG_MFD_MAX8997=y @@ -281,12 +297,15 @@ CONFIG_REGULATOR_MAX77686=m CONFIG_REGULATOR_S2MPA01=m CONFIG_REGULATOR_S5M8767=m CONFIG_COMMON_CLK_MAX77686=m +CONFIG_COMMON_CLK_MAX77802=m CONFIG_COMMON_CLK_S2MPS11=m CONFIG_INPUT_MAX8997_HAPTIC=m CONFIG_CHARGER_MAX8997=m CONFIG_LEDS_MAX8997=m CONFIG_RTC_DRV_MAX8997=m CONFIG_RTC_DRV_MAX77686=m +CONFIG_RTC_DRV_MAX77802=m +CONFIG_RTC_DRV_RK808=m CONFIG_EXTCON_MAX8997=m # Tegra @@ -333,6 +352,10 @@ CONFIG_MFD_AS3722=y CONFIG_REGULATOR_AS3722=m CONFIG_RTC_DRV_AS3722=y +# TI Generic +CONFIG_TI_SOC_THERMAL=m +CONFIG_TI_THERMAL=y + # DRM panels CONFIG_DRM_PANEL=y CONFIG_DRM_PANEL_SIMPLE=m @@ -350,12 +373,10 @@ CONFIG_REGMAP_IRQ=y # Power management CONFIG_PM_OPP=y CONFIG_ARM_CPU_SUSPEND=y -CONFIG_GENERIC_CPUFREQ_CPU0=m # usb CONFIG_USB_OHCI_HCD_PLATFORM=m CONFIG_USB_EHCI_HCD_PLATFORM=m -# CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OTG_BLACKLIST_HUB is not set CONFIG_USB_ULPI=y CONFIG_AX88796=m @@ -366,6 +387,7 @@ CONFIG_USB_OTG=y CONFIG_USB_GADGET=m CONFIG_USB_GADGET_VBUS_DRAW=100 CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +# CONFIG_USB_GADGET_XILINX is not set CONFIG_USB_MUSB_HDRC=m CONFIG_USB_MUSB_DUAL_ROLE=y CONFIG_USB_MUSB_DSPS=m @@ -435,20 +457,20 @@ CONFIG_GENERIC_PINCONF=y # CONFIG_PINCTRL_MSM8X74 is not set # CONFIG_PINCTRL_BCM281XX is not set # CONFIG_PINCTRL_APQ8064 is not set +# CONFIG_PINCTRL_APQ8084 is not set # CONFIG_PINCTRL_IPQ8064 is not set # CONFIG_PINCTRL_MSM8960 is not set # GPIO # CONFIG_GPIO_EM is not set CONFIG_GPIO_74X164=m -CONFIG_GPIO_ADNP=m -CONFIG_GPIO_MCP23S08=m CONFIG_GPIO_MAX7301=m CONFIG_GPIO_MC33880=m CONFIG_GPIO_TPS65910=y CONFIG_GPIO_TPS65912=m # CONFIG_GPIO_ZEVIO is not set CONFIG_LEDS_GPIO=m +CONFIG_LEDS_GPIO_REGISTER=y CONFIG_MDIO_BUS_MUX=m CONFIG_MDIO_BUS_MUX_GPIO=m CONFIG_MDIO_BUS_MUX_MMIOREG=m @@ -457,6 +479,7 @@ CONFIG_INPUT_GPIO_BEEPER=m CONFIG_INPUT_GPIO_TILT_POLLED=m CONFIG_INPUT_MATRIXKMAP=m CONFIG_KEYBOARD_GPIO=m +CONFIG_KEYBOARD_GPIO_POLLED=m CONFIG_KEYBOARD_MATRIX=m # CONFIG_GPIO_RCAR is not set CONFIG_W1_MASTER_GPIO=m @@ -503,10 +526,6 @@ CONFIG_EDAC_LEGACY_SYSFS=y # Watchdog -# Thermal / powersaving -CONFIG_THERMAL=y -CONFIG_ARM_PSCI=y - # Mailbox CONFIG_MAILBOX=y @@ -531,6 +550,7 @@ CONFIG_MTD_NAND_PXA3xx=m CONFIG_MTD_NAND_RICOH=m CONFIG_MTD_NAND_TMIO=m CONFIG_MTD_SPI_NOR=m +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set CONFIG_MTD_SPINAND_MT29F=m CONFIG_MTD_SPINAND_ONDIEECC=y CONFIG_MTD_SST25L=m @@ -549,6 +569,8 @@ CONFIG_SPI_DW_MMIO=m CONFIG_SPI_DW_PCI=m # CONFIG_MMC_DW_IDMAC is not set # CONFIG_MMC_DW_K3 is not set +# CONFIG_MMC_QCOM_DML is not set +# CONFIG_MMC_DW_ROCKCHIP is not set CONFIG_USB_DWC2=y CONFIG_USB_DWC2_HOST=m CONFIG_USB_DWC2_PLATFORM=y @@ -561,6 +583,7 @@ CONFIG_USB_DWC3_OMAP=m CONFIG_USB_DWC3_PCI=m # CONFIG_USB_DWC3_DEBUG is not set # CONFIG_USB_DWC3_KEYSTONE is not set +# CONFIG_USB_DWC3_QCOM is not set # CONFIG_DWC3_HOST_USB3_LPM_ENABLE is not set CONFIG_DW_WATCHDOG=m CONFIG_PCIE_DW=y @@ -623,10 +646,18 @@ CONFIG_SND_SOC_SPDIF=m # CONFIG_SND_SOC_ALC5623 is not set # CONFIG_SND_SOC_CS42L56 is not set # CONFIG_SND_SOC_STA350 is not set +# CONFIG_SND_SOC_CS35L32 is not set +# CONFIG_SND_SOC_ES8328 is not set +# CONFIG_SND_SOC_SSM2602_SPI is not set +# CONFIG_SND_SOC_SSM2602_I2C is not set +# CONFIG_SND_SOC_SSM4567 is not set +# CONFIG_SND_SOC_WM8978 is not set # CONFIG_SND_ATMEL_SOC is not set # CONFIG_SND_SOC_TLV320AIC31XX is not set # CONFIG_SND_SOC_TAS2552 is not set # CONFIG_SND_SOC_CS4265 is not set +# CONFIG_SND_SOC_IMX_ES8328 is not set +# CONFIG_SND_SOC_FSL_ASOC_CARD is not set # CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_SOC_ROCKCHIP is not set @@ -687,7 +718,11 @@ CONFIG_REGULATOR_TPS80031=m CONFIG_REGULATOR_LTC3589=m CONFIG_REGULATOR_ANATOP=m CONFIG_REGULATOR_DA9211=m +CONFIG_REGULATOR_ISL9305=m +CONFIG_REGULATOR_MAX77802=m +CONFIG_REGULATOR_PWM=m +CONFIG_POWER_AVS=y CONFIG_CHARGER_MANAGER=y CONFIG_CHARGER_BQ2415X=m CONFIG_CHARGER_BQ24190=m @@ -696,6 +731,7 @@ CONFIG_CHARGER_GPIO=m CONFIG_CHARGER_TPS65090=m CONFIG_PDA_POWER=m CONFIG_GENERIC_ADC_BATTERY=m +CONFIG_BATTERY_SBS=m # Sensors CONFIG_TMP006=m @@ -707,6 +743,8 @@ CONFIG_SENSORS_ADCXX=m CONFIG_SENSORS_ADS7871=m CONFIG_SENSORS_GPIO_FAN=m CONFIG_SENSORS_HTU21=m +CONFIG_SENSORS_ISL29018=m +CONFIG_SENSORS_ISL29028=m CONFIG_SENSORS_LIS3_SPI=m CONFIG_SENSORS_LM70=m CONFIG_SENSORS_MAX1111=m @@ -735,8 +773,10 @@ CONFIG_TOUCHSCREEN_AD7877=m CONFIG_TOUCHSCREEN_MC13783=m CONFIG_TOUCHSCREEN_TSC2005=m +CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_DAC124S085=m CONFIG_LEDS_PWM=m +CONFIG_LEDS_SYSCON=y CONFIG_BMP085_SPI=m CONFIG_SRAM=y @@ -784,9 +824,6 @@ CONFIG_MFD_CROS_EC_SPI=m CONFIG_KEYBOARD_CROS_EC=m CONFIG_I2C_CROS_EC_TUNNEL=m -# Should be in generic -CONFIG_BPF_JIT=y - # Needs work/investigation # CONFIG_ARM_KPROBES_TEST is not set diff --git a/config-armv7-lpae b/config-armv7-lpae index 661ce368..b08f4daa 100644 --- a/config-armv7-lpae +++ b/config-armv7-lpae @@ -62,7 +62,8 @@ CONFIG_POWER_RESET_KEYSTONE=y CONFIG_DAVINCI_WATCHDOG=m CONFIG_SPI_DAVINCI=m CONFIG_TI_DAVINCI_MDIO=m -# CONFIG_TI_SOC_THERMAL is not set +CONFIG_KEYSTONE_IRQ=m +CONFIG_PCI_KEYSTONE=y # Tegra (non A15 device options) # CONFIG_ARCH_TEGRA_2x_SOC is not set diff --git a/config-generic b/config-generic index c3f8d1e0..4b51c0a8 100644 --- a/config-generic +++ b/config-generic @@ -391,6 +391,7 @@ CONFIG_VHOST_SCSI=m # SCSI device support # CONFIG_SCSI=y +# CONFIG_SCSI_MQ_DEFAULT is not set CONFIG_SCSI_ENCLOSURE=m CONFIG_SCSI_PROC_FS=y @@ -705,11 +706,11 @@ CONFIG_FIREWIRE_NOSY=m # CONFIG_NET=y -CONFIG_NET_DMA=y - CONFIG_NETLINK_MMAP=y CONFIG_NETLINK_DIAG=m +CONFIG_BPF_JIT=y + CONFIG_TCP_CONG_ADVANCED=y CONFIG_TCP_CONG_BIC=m CONFIG_TCP_CONG_CUBIC=y @@ -717,6 +718,7 @@ CONFIG_TCP_CONG_HTCP=m CONFIG_TCP_CONG_HSTCP=m CONFIG_TCP_CONG_HYBLA=m CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_DCTCP=m CONFIG_TCP_CONG_LP=m CONFIG_TCP_CONG_SCALABLE=m CONFIG_TCP_CONG_VEGAS=m @@ -758,6 +760,8 @@ CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y CONFIG_SYN_COOKIES=y CONFIG_NET_IPVTI=m +CONFIG_NET_FOU=m +CONFIG_GENEVE=m CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m @@ -776,6 +780,7 @@ CONFIG_IP_VS_PROTO_UDP=y CONFIG_IP_VS_PROTO_ESP=y CONFIG_IP_VS_PROTO_AH=y CONFIG_IP_VS_PROTO_SCTP=y +CONFIG_IP_VS_FO=m CONFIG_IP_VS_IPV6=y CONFIG_IP_VS_RR=m CONFIG_IP_VS_WRR=m @@ -1017,12 +1022,16 @@ CONFIG_NFT_HASH=m CONFIG_NFT_COUNTER=m CONFIG_NFT_LOG=m CONFIG_NFT_LIMIT=m +CONFIG_NFT_MASQ=m +CONFIG_NFT_MASQ_IPV4=m +CONFIG_NFT_MASQ_IPV6=m CONFIG_NFT_NAT=m CONFIG_NFT_QUEUE=m CONFIG_NFT_REJECT=m CONFIG_NFT_COMPAT=m CONFIG_NF_TABLES_IPV4=m +CONFIG_NF_REJECT_IPV6=m CONFIG_NFT_REJECT_IPV4=m CONFIG_NFT_CHAIN_ROUTE_IPV4=m CONFIG_NFT_CHAIN_NAT_IPV4=m @@ -1082,6 +1091,7 @@ CONFIG_IP_SET_HASH_IPMARK=m CONFIG_IP_SET_HASH_IPPORT=m CONFIG_IP_SET_HASH_IPPORTIP=m CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_MAC=m CONFIG_IP_SET_HASH_NETPORTNET=m CONFIG_IP_SET_HASH_NET=m CONFIG_IP_SET_HASH_NETNET=m @@ -1207,6 +1217,7 @@ CONFIG_BATMAN_ADV_MCAST=y CONFIG_OPENVSWITCH=m CONFIG_OPENVSWITCH_GRE=y CONFIG_OPENVSWITCH_VXLAN=y +CONFIG_OPENVSWITCH_GENEVE=y CONFIG_VSOCKETS=m @@ -1306,6 +1317,8 @@ CONFIG_ETHERNET=y CONFIG_NET_VENDOR_ADAPTEC=y CONFIG_ADAPTEC_STARFIRE=m +# CONFIG_NET_VENDOR_AGERE is not set + CONFIG_NET_VENDOR_ALTEON=y CONFIG_ACENIC=m # CONFIG_ACENIC_OMIT_TIGON_I is not set @@ -1321,6 +1334,7 @@ CONFIG_PCMCIA_NMCLAN=m CONFIG_NET_VENDOR_ARC=y CONFIG_ARC_EMAC=m +# CONFIG_EMAC_ROCKCHIP is not set CONFIG_NET_VENDOR_ATHEROS=y CONFIG_ALX=m @@ -1402,7 +1416,8 @@ CONFIG_I40E=m # CONFIG_I40E_VXLAN is not set # CONFIG_I40E_DCB is not set CONFIG_I40EVF=m - +CONFIG_FM10K=m +# CONFIG_FM10K_VXLAN is not set # CONFIG_NET_VENDOR_I825XX is not set CONFIG_NET_VENDOR_MARVELL=y @@ -1454,6 +1469,8 @@ CONFIG_QLCNIC_HWMON=y CONFIG_QLGE=m CONFIG_NETXEN_NIC=m +# CONFIG_NET_VENDOR_QUALCOMM is not set + CONFIG_NET_VENDOR_REALTEK=y CONFIG_ATP=m CONFIG_8139CP=m @@ -1526,6 +1543,7 @@ CONFIG_DAVICOM_PHY=m CONFIG_DP83640_PHY=m CONFIG_FIXED_PHY=y CONFIG_MDIO_BITBANG=m +CONFIG_MDIO_BCM_UNIMAC=m CONFIG_NATIONAL_PHY=m CONFIG_ICPLUS_PHY=m CONFIG_BCM63XX_PHY=m @@ -1652,11 +1670,14 @@ CONFIG_ATH9K_BTCOEX_SUPPORT=y # CONFIG_ATH9K_HTC_DEBUGFS is not set # CONFIG_ATH9K_STATION_STATISTICS is not set # CONFIG_ATH9K_WOW is not set +# CONFIG_ATH9K_DYNACK is not set +# CONFIG_ATH9K_CHANNEL_CONTEXT is not set # CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m # CONFIG_ATH10K_DEBUG is not set # CONFIG_ATH10K_TRACING is not set +# CONFIG_ATH_TRACEPOINTS is not set CONFIG_ATH10K_DEBUGFS=y CONFIG_WCN36XX=m # CONFIG_WCN36XX_DEBUGFS is not set @@ -1723,12 +1744,15 @@ CONFIG_LIBERTAS_SDIO=m # CONFIG_LIBERTAS_THINFIRM is not set # CONFIG_LIBERTAS_SPI is not set CONFIG_LIBERTAS_MESH=y + CONFIG_IWLWIFI=m CONFIG_IWLDVM=m CONFIG_IWLMVM=m # CONFIG_IWLWIFI_BCAST_FILTERING is not set +# CONFIG_IWLWIFI_UAPSD is not set CONFIG_IWLWIFI_DEBUG=y CONFIG_IWLWIFI_DEBUGFS=y + CONFIG_IWLEGACY=m CONFIG_IWLEGACY_DEBUG=y CONFIG_IWLEGACY_DEBUGFS=y @@ -1736,6 +1760,7 @@ CONFIG_IWL4965=y CONFIG_IWL3945=m # CONFIG_IWM is not set # CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE is not set + CONFIG_MAC80211_HWSIM=m CONFIG_P54_COMMON=m CONFIG_P54_USB=m @@ -1792,9 +1817,11 @@ CONFIG_RTL8192CE=m CONFIG_RTL8192SE=m CONFIG_RTL8192CU=m CONFIG_RTL8192DE=m +CONFIG_RTL8192EE=m CONFIG_RTL8723AE=m CONFIG_RTL8723BE=m CONFIG_RTL8188EE=m +CONFIG_RTL8821AE=m CONFIG_MWIFIEX=m CONFIG_MWIFIEX_SDIO=m @@ -2118,6 +2145,8 @@ CONFIG_INPUT_SPARSEKMAP=m CONFIG_INPUT_CMA3000=m CONFIG_INPUT_CMA3000_I2C=m CONFIG_INPUT_IDEAPAD_SLIDEBAR=m +# CONFIG_INPUT_DRV260X_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set # # Input I/O drivers @@ -2259,6 +2288,7 @@ CONFIG_TOUCHSCREEN_ZFORCE=m # CONFIG_TOUCHSCREEN_ADS7846 is not set # CONFIG_TOUCHSCREEN_AD7877 is not set # CONFIG_TOUCHSCREEN_TSC2005 is not set +# CONFIG_TOUCHSCREEN_AR1021_I2C is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m @@ -2617,8 +2647,10 @@ CONFIG_HID_SENSOR_IIO_TRIGGER=m # CONFIG_AD5380 is not set # CONFIG_AD5064 is not set # CONFIG_BMA180 is not set +# CONFIG_BMC150_ACCEL is not set # CONFIG_MAX1363 is not set # CONFIG_MAX517 is not set +# CONFIG_MAX5821 is not set # CONFIG_MCP4725 is not set # CONFIG_ITG3200 is not set # CONFIG_APDS9300 is not set @@ -2632,10 +2664,9 @@ CONFIG_HID_SENSOR_IIO_TRIGGER=m # CONFIG_TSL4531 is not set # CONFIG_NAU7802 is not set # CONFIG_TI_ADC081C is not set -# CONFIG_EXYNOS_ADC is not set +# CONFIG_TI_ADC128S052 is not set # CONFIG_VIPERBOARD_ADC is not set # CONFIG_VF610_ADC is not set -# CONFIG_XILINX_XADC is not set # CONFIG_INV_MPU6050_IIO is not set CONFIG_IIO_ST_GYRO_3AXIS=m CONFIG_IIO_ST_MAGN_3AXIS=m @@ -2643,6 +2674,7 @@ CONFIG_IIO_ST_ACCEL_3AXIS=m CONFIG_HID_SENSOR_INCLINOMETER_3D=m CONFIG_HID_SENSOR_DEVICE_ROTATION=m # CONFIG_ADJD_S311 is not set +# CONFIG_AL3320A is not set # CONFIG_SENSORS_TSL2563 is not set # CONFIG_SENSORS_HMC5843_I2C is not set # CONFIG_VCNL4000 is not set @@ -2681,6 +2713,7 @@ CONFIG_HID_SENSOR_DEVICE_ROTATION=m # CONFIG_ADIS16136 is not set # CONFIG_ADIS16260 is not set # CONFIG_ADXRS450 is not set +# CONFIG_BMG160 is not set # CONFIG_ADIS16400 is not set # CONFIG_ADIS16480 is not set # CONFIG_DHT11 is not set @@ -2688,7 +2721,7 @@ CONFIG_HID_SENSOR_DEVICE_ROTATION=m # CONFIG_MPL115 is not set # CONFIG_SI7005 is not set # CONFIG_AS3935 is not set -# CONFIG_KXCJK1013 is not set +CONFIG_KXCJK1013=m # CONFIG_ISL29125 is not set # CONFIG_TCS3414 is not set # CONFIG_AK09911 is not set @@ -2724,13 +2757,8 @@ CONFIG_HID_SENSOR_DEVICE_ROTATION=m # CONFIG_AD7816 is not set # CONFIG_AD7192 is not set # CONFIG_AD7280 is not set -# CONFIG_AD5930 is not set # CONFIG_AD9832 is not set # CONFIG_AD9834 is not set -# CONFIG_AD9850 is not set -# CONFIG_AD9852 is not set -# CONFIG_AD9910 is not set -# CONFIG_AD9951 is not set # CONFIG_ADIS16060 is not set # CONFIG_ADE7753 is not set # CONFIG_ADE7754 is not set @@ -2859,6 +2887,7 @@ CONFIG_RTC_DRV_DS1742=m CONFIG_RTC_DRV_DS1374=m # CONFIG_RTC_DRV_EP93XX is not set CONFIG_RTC_DRV_FM3130=m +# CONFIG_RTC_DRV_HYM8563 is not set CONFIG_RTC_DRV_ISL1208=m CONFIG_RTC_DRV_M41T80=m CONFIG_RTC_DRV_M41T80_WDT=y @@ -2870,6 +2899,7 @@ CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_PCF8583=m CONFIG_RTC_DRV_RS5C372=m # CONFIG_RTC_DRV_SA1100 is not set +# CONFIG_RTC_DRV_SNVS is not set # CONFIG_RTC_DRV_TEST is not set CONFIG_RTC_DRV_X1205=m CONFIG_RTC_DRV_PCF8523=m @@ -3077,6 +3107,8 @@ CONFIG_VIDEO_TM6000_DVB=m CONFIG_VIDEO_TLG2300=m # CONFIG_VIDEO_TIMBERDALE is not set # CONFIG_VIDEO_M5MOLS is not set +# CONFIG_VIDEO_TW68 is not set +# CONFIG_VIDEO_VIVID is not set # CONFIG_EXYNOS_VIDEO is not set CONFIG_VIDEO_USBTV=m # CONFIG_VIDEO_AU0828_RC is not set @@ -3117,6 +3149,7 @@ CONFIG_DVB_DYNAMIC_MINORS=y CONFIG_DVB_BT8XX=m CONFIG_DVB_BUDGET_CORE=m CONFIG_DVB_PLUTO2=m +# CONFIG_DVB_PT3 is not set CONFIG_SMS_SIANO_MDTV=m CONFIG_SMS_SIANO_RC=y # CONFIG_SMS_SIANO_DEBUGFS is not set @@ -3184,6 +3217,7 @@ CONFIG_DVB_USB_AZ6007=m CONFIG_DVB_USB_LME2510=m CONFIG_DVB_USB_RTL28XXU=m CONFIG_DVB_USB_AF9035=m +CONFIG_DVB_USB_DVBSKY=m CONFIG_DVB_PT1=m @@ -3229,6 +3263,7 @@ CONFIG_IR_IGUANA=m CONFIG_IR_TTUSBIR=m CONFIG_IR_GPIO_CIR=m CONFIG_IR_XMP_DECODER=m +CONFIG_IR_HIX5HD2=m CONFIG_V4L_MEM2MEM_DRIVERS=y # CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set @@ -3499,7 +3534,7 @@ CONFIG_SND_FIREWIRE_SPEAKERS=m CONFIG_SND_ISIGHT=m CONFIG_SND_SCS1X=m CONFIG_SND_DICE=m -# CONFIG_SND_FIREWORKS is not set +CONFIG_SND_FIREWORKS=m # CONFIG_SND_BEBOB is not set # @@ -3619,6 +3654,7 @@ CONFIG_HID_ICADE=m CONFIG_HID_TWINHAN=m CONFIG_HID_ORTEK=m CONFIG_HID_PANTHERLORD=m +CONFIG_HID_PENMOUNT=m CONFIG_HID_PETALYNX=m CONFIG_HID_PICOLCD=m CONFIG_HID_RMI=m @@ -3733,6 +3769,7 @@ CONFIG_USB_S2255=m # CONFIG_VIDEO_SH_MOBILE_CSI2 is not set CONFIG_USB_ZR364XX=m # CONFIG_SOC_CAMERA is not set +# CONFIG_SOC_TI is not set # # USB Network adaptors @@ -3837,7 +3874,6 @@ CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_MOS7720=m CONFIG_USB_SERIAL_MOS7715_PARPORT=y # CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_ZTE is not set CONFIG_USB_SERIAL_MOS7840=m # CONFIG_USB_SERIAL_MXUPORT is not set CONFIG_USB_SERIAL_NAVMAN=m @@ -3881,14 +3917,10 @@ CONFIG_USB_PHY=y # CONFIG_USB_OTG_FSM is not set # CONFIG_GENERIC_PHY is not set -# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set -# CONFIG_PHY_EXYNOS_DP_VIDEO is not set # CONFIG_PHY_ST_SPEAR1310_MIPHY is not set # CONFIG_PHY_ST_SPEAR1340_MIPHY is not set # CONFIG_AM335X_PHY_USB is not set # CONFIG_SAMSUNG_USBPHY is not set -# CONFIG_SAMSUNG_USB2PHY is not set -# CONFIG_SAMSUNG_USB3PHY is not set # CONFIG_BCM_KONA_USB2_PHY is not set # CONFIG_USB_RCAR_PHY is not set CONFIG_USB_ATM=m @@ -3936,6 +3968,8 @@ CONFIG_USB_XUSBATM=m # CONFIG_USB_DWC2 is not set # CONFIG_USB_ISP1301 is not set # CONFIG_USB_OTG is not set +# CONFIG_USB_OTG_WHITELIST is not set +CONFIG_USB_LED_TRIG=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y @@ -4013,6 +4047,10 @@ CONFIG_MFD_VIPERBOARD=m # CONFIG_MFD_TPS65912_SPI is not set # CONFIG_MFD_MC13XXX_SPI is not set # CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_MFD_RK808 is not set +# CONFIG_MFD_RN5T618 is not set # CONFIG_EZX_PCAP is not set # CONFIG_INTEL_SOC_PMIC is not set @@ -4148,6 +4186,7 @@ CONFIG_9P_FSCACHE=y CONFIG_9P_FS_POSIX_ACL=y CONFIG_9P_FS_SECURITY=y CONFIG_FUSE_FS=m +CONFIG_OVERLAY_FS=m # CONFIG_OMFS_FS is not set CONFIG_CUSE=m CONFIG_F2FS_FS=m @@ -4452,6 +4491,7 @@ CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_BLKCIPHER=y # CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_MCRYPTD is not set CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_ANUBIS=m @@ -4630,6 +4670,7 @@ CONFIG_THERMAL_HWMON=y CONFIG_THERMAL_GOV_FAIR_SHARE=y # CONFIG_THERMAL_GOV_USER_SPACE is not set CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_BANG_BANG is not set # CONFIG_THERMAL_EMULATION is not set # CONFIG_THERMAL_OF is not set # CONFIG_CPU_THERMAL is not set @@ -4726,6 +4767,7 @@ CONFIG_LEDS_DELL_NETBOOKS=m # CONFIG_LEDS_PWM is not set # CONFIG_LEDS_LP8501 is not set # CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_SYSCON is not set CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=m CONFIG_LEDS_TRIGGER_ONESHOT=m @@ -4798,6 +4840,7 @@ CONFIG_OPTPROBES=y CONFIG_HZ_1000=y CONFIG_NO_HZ=y +# CONFIG_SCHED_STACK_END_CHECK is not set CONFIG_TIMER_STATS=y CONFIG_HIGH_RES_TIMERS=y CONFIG_PERF_EVENTS=y @@ -4838,6 +4881,8 @@ CONFIG_APM_POWER=m # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24735 is not set CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_LTC2952 is not set +# CONFIG_POWER_RESET_SYSCON is not set # CONFIG_PDA_POWER is not set @@ -4921,6 +4966,8 @@ CONFIG_NET_DSA=m CONFIG_NET_DSA_MV88E6060=m CONFIG_NET_DSA_MV88E6131=m CONFIG_NET_DSA_MV88E6123_61_65=m +CONFIG_NET_DSA_MV88E6171=m +CONFIG_NET_DSA_BCM_SF2=m # Used by Maemo, we don't care. # CONFIG_PHONET is not set @@ -4936,6 +4983,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=m CONFIG_WM8350_POWER=m # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_PCI_SKELETON is not set CONFIG_USB_WUSB=m CONFIG_USB_WUSB_CBAF=m @@ -4980,9 +5028,6 @@ CONFIG_RTL8192E=m # CONFIG_INPUT_GPIO is not set # CONFIG_VIDEO_CX25821 is not set # CONFIG_R8188EU is not set -# Larry Finger maintains (rhbz 1113422) -CONFIG_R8192EE=m -# CONFIG_R8821AE is not set # CONFIG_RTL8192U is not set CONFIG_R8723AU=m # Jes Sorensen maintains this (rhbz 1100162) # CONFIG_8723AU_AP_MODE is not set @@ -5014,7 +5059,6 @@ CONFIG_USBIP_HOST=m # CONFIG_DGNC is not set # CONFIG_RTS5208 is not set # CONFIG_GS_FPGABOOT is not set -# CONFIG_BT_NOKIA_H4P is not set # CONFIG_UNISYSSPAR is not set # CONFIG_MEDIA_TUNER_MSI001 is not set # END OF STAGING @@ -5026,6 +5070,8 @@ CONFIG_USBIP_HOST=m CONFIG_NOP_USB_XCEIV=m +# CONFIG_INTEGRITY is not set + # CONFIG_IMA is not set CONFIG_IMA_MEASURE_PCR_IDX=10 CONFIG_IMA_LSM_RULES=y @@ -5046,6 +5092,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_RCU_TRACE is not set # CONFIG_RCU_CPU_STALL_INFO is not set +# CONFIG_TASKS_RCU is not set # CONFIG_RCU_USER_QS is not set CONFIG_SPARSE_RCU_POINTER=y @@ -5097,6 +5144,7 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_PCA953X is not set # CONFIG_GPIO_PCF857X is not set # CONFIG_GPIO_CS5535 is not set +# CONFIG_GPIO_ADNP is not set # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_IT8761E is not set # CONFIG SB105x is not set @@ -5124,6 +5172,7 @@ CONFIG_GPIO_VIPERBOARD=m # CONFIG_GPIO_74X164 is not set # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MC33880 is not set +# CONFIG_GPIO_MCP23S08 is not set # FIXME: Why? @@ -5147,6 +5196,7 @@ CONFIG_TCM_IBLOCK=m CONFIG_TCM_FILEIO=m CONFIG_TCM_PSCSI=m CONFIG_TCM_FC=m +CONFIG_TCM_USER=m CONFIG_HWSPINLOCK=m @@ -5155,7 +5205,7 @@ CONFIG_PSTORE_RAM=m # CONFIG_PSTORE_CONSOLE is not set # CONFIG_PSTORE_FTRACE is not set -# CONFIG_TEST_MODULE is not set +# CONFIG_TEST_LKM is not set # CONFIG_TEST_USER_COPY is not set # CONFIG_TEST_BPF is not set # CONFIG_TEST_UDELAY is not set @@ -5201,8 +5251,19 @@ CONFIG_POWERCAP=y # CONFIG_ARM_ARCH_TIMER_EVTSTREAM is not set +# CONFIG_HMC_DRV is not set + # CONFIG_PM_DEVFREQ is not set +# CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set +# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set +# CONFIG_DEVFREQ_GOV_POWERSAVE is not set +# CONFIG_DEVFREQ_GOV_USERSPACE is not set + +# CONFIG_CPUFREQ_DT is not set + # CONFIG_MODULE_SIG is not set +# FIXME: Revisit this to see if we can use it instead of the spec file stuff +# CONFIG_MODULE_COMPRESS is not set # CONFIG_SYSTEM_TRUSTED_KEYRING is not set # CONFIG_SYSTEM_BLACKLIST_KEYRING is not set @@ -5212,3 +5273,8 @@ CONFIG_POWERCAP=y # CONFIG_GLOB_SELFTEST is not set # CONFIG_SBSAUART_TTY is not set + +# CONFIG_SERIAL_8250_FINTEK is not set + +# set in x86-generic presently +# CONFIG_TOUCHSCREEN_GOODIX is not set diff --git a/config-powerpc-generic b/config-powerpc-generic index bc0f9433..ce4da577 100644 --- a/config-powerpc-generic +++ b/config-powerpc-generic @@ -309,7 +309,6 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_PPC_MPC512x is not set # CONFIG_RTC_DRV_MPC5121 is not set -# CONFIG_RTC_DRV_HYM8563 is not set # CONFIG_MPC512X_DMA is not set @@ -323,8 +322,6 @@ CONFIG_I2C_MPC=m # CONFIG_CRYPTO_DEV_FSL_CAAM is not set # CONFIG_CRYPTO_SHA1_PPC is not set -# CONFIG_GPIO_MCP23S08 is not set - # CONFIG_CAN_FLEXCAN is not set # CONFIG_NET_VENDOR_XILINX is not set # CONFIG_PPC_EPAPR_HV_BYTECHAN is not set @@ -351,15 +348,14 @@ CONFIG_RCU_FANOUT_LEAF=16 CONFIG_PPC_DENORMALISATION=y # CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_GPIO_ADNP is not set # CONFIG_MFD_SYSCON is not set -# CONFIG_RTC_DRV_SNVS is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_FB_SSD1307=m CONFIG_INPUT_PWM_BEEPER=m CONFIG_BACKLIGHT_PWM=m diff --git a/config-powerpc64 b/config-powerpc64 index e24be4fa..49b4f2e7 100644 --- a/config-powerpc64 +++ b/config-powerpc64 @@ -171,8 +171,8 @@ CONFIG_CRYPTO_842=m CONFIG_CRYPTO_DEV_NX_ENCRYPT=m CONFIG_CRYPTO_DEV_NX_COMPRESS=m +CONFIG_CXL=m -CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_PID is not set # CONFIG_PPC_ICSWX_USE_SIGILL is not set # CONFIG_PCIEPORTBUS is not set diff --git a/config-powerpc64p7 b/config-powerpc64p7 index 60baede6..6a5e1c6d 100644 --- a/config-powerpc64p7 +++ b/config-powerpc64p7 @@ -161,8 +161,8 @@ CONFIG_CRYPTO_842=m CONFIG_CRYPTO_DEV_NX_ENCRYPT=m CONFIG_CRYPTO_DEV_NX_COMPRESS=m +CONFIG_CXL=m -CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_PID is not set # CONFIG_PPC_ICSWX_USE_SIGILL is not set # CONFIG_PCIEPORTBUS is not set diff --git a/config-s390x b/config-s390x index 78ba8e94..9534f51b 100644 --- a/config-s390x +++ b/config-s390x @@ -83,7 +83,6 @@ CONFIG_TN3270_FS=m # CONFIG_S390_TAPE_34XX=m -# CONFIG_PPP is not set # CONFIG_SLIP is not set # @@ -213,7 +212,6 @@ CONFIG_SCHED_BOOK=y CONFIG_CRYPTO_GHASH_S390=m -CONFIG_BPF_JIT=y # CONFIG_TRANSPARENT_HUGEPAGE is not set CONFIG_SCM_BUS=y CONFIG_EADM_SCH=m diff --git a/config-x86-32-generic b/config-x86-32-generic index 13e1bac7..5daa9b8a 100644 --- a/config-x86-32-generic +++ b/config-x86-32-generic @@ -78,7 +78,6 @@ CONFIG_X86_SPEEDSTEP_LIB=y CONFIG_X86_LONGRUN=y # CONFIG_X86_LONGHAUL is not set # CONFIG_X86_CPUFREQ_NFORCE2 is not set -# CONFIG_GENERIC_CPUFREQ_CPU0 is not set # e_powersaver is dangerous # CONFIG_X86_E_POWERSAVER is not set @@ -168,6 +167,7 @@ CONFIG_XO1_RFKILL=m CONFIG_X86_32_IRIS=m CONFIG_POWER_RESET_GPIO=y +# CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -206,14 +206,10 @@ CONFIG_BACKLIGHT_PWM=m # CONFIG_MDIO_BUS_MUX_GPIO is not set # CONFIG_MDIO_BUS_MUX_MMIOREG is not set # CONFIG_GPIO_SODAVILLE is not set -# CONFIG_GPIO_ADNP is not set # CONFIG_BACKLIGHT_OT200 is not set -# CONFIG_RTC_DRV_SNVS is not set -# CONFIG_RTC_DRV_HYM8563 is not set # CONFIG_MLX5_INFINIBAND is not set # CONFIG_PINCTRL_SINGLE is not set -# CONFIG_PINCTRL_MSM8X74 is not set # CONFIG_PINCTRL_BCM281XX is not set # CONFIG_PINCTRL_APQ8064 is not set # CONFIG_PINCTRL_IPQ8064 is not set diff --git a/config-x86-generic b/config-x86-generic index 1d392375..f3700a25 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -240,6 +240,7 @@ CONFIG_INTEL_SMARTCONNECT=y CONFIG_PVPANIC=m # CONFIG_TOUCHSCREEN_INTEL_MID is not set +CONFIG_TOUCHSCREEN_GOODIX=m # CONFIG_SMSC37B787_WDT is not set CONFIG_VIA_WDT=m @@ -293,6 +294,8 @@ CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m CONFIG_XEN_SELFBALLOONING=y CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_ACPI_PROCESSOR=m +# CONFIG_XEN_SCSI_FRONTEND is not set +# CONFIG_XEN_SCSI_BACKEND is not set CONFIG_MTD_ESB2ROM=m CONFIG_MTD_CK804XROM=m @@ -376,7 +379,6 @@ CONFIG_LPC_ICH=m CONFIG_GPIO_ICH=m # CONFIG_GPIO_LYNXPOINT is not set -# CONFIG_GPIO_MCP23S08 is not set # CONFIG_GPIO_F7188X is not set # These should all go away with IC2_ACPI is fixed @@ -406,7 +408,6 @@ CONFIG_GPIO_ICH=m # CONFIG_TWL4030_CORE is not set # CONFIG_TWL6040_CORE is not set - CONFIG_PCI_CNB20LE_QUIRK=y CONFIG_ACPI_EC_DEBUGFS=m @@ -480,15 +481,19 @@ CONFIG_NFC_MICROREAD_MEI=m # CONFIG_X86_GOLDFISH is not set CONFIG_X86_INTEL_LPSS=y +CONFIG_IOSF_MBI=m +# CONFIG_IOSF_MBI_DEBUG is not set CONFIG_PWM_LPSS=m +CONFIG_PWM_LPSS_PCI=m +CONFIG_PWM_LPSS_PLATFORM=m CONFIG_PINCTRL=y CONFIG_PINCTRL_BAYTRAIL=y # CONFIG_INTEL_POWERCLAMP is not set CONFIG_X86_PKG_TEMP_THERMAL=m -CONFIG_ACPI_INT3403_THERMAL=m CONFIG_INTEL_SOC_DTS_THERMAL=m CONFIG_INTEL_RAPL=m +CONFIG_INT340X_THERMAL=m CONFIG_VMWARE_VMCI=m CONFIG_VMWARE_VMCI_VSOCKETS=m diff --git a/config-x86_64-generic b/config-x86_64-generic index de467132..89b7070e 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -57,6 +57,7 @@ CONFIG_INTEL_MIC_X100_DMA=m # SHPC has half-arsed PCI probing, which makes it load on too many systems CONFIG_HOTPLUG_PCI_SHPC=m +# CONFIG_CRYPTO_SHA1_MB is not set CONFIG_CRYPTO_AES_X86_64=y CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m CONFIG_CRYPTO_TWOFISH_X86_64=m @@ -152,8 +153,6 @@ CONFIG_FUNCTION_GRAPH_TRACER=y CONFIG_I7300_IDLE=m -CONFIG_BPF_JIT=y - # https://fedoraproject.org/wiki/Features/Checkpoint_Restore CONFIG_CHECKPOINT_RESTORE=y diff --git a/crash-driver.patch b/crash-driver.patch index 3515471e..5a8fa876 100644 --- a/crash-driver.patch +++ b/crash-driver.patch @@ -269,7 +269,7 @@ index 000000000000..fd4736ec99f5 + +#endif /* _X86_CRASH_H */ diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 6e9f74a5c095..ee6bae16b04c 100644 +index efefd12a0f7b..6a318132b7ee 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -4,6 +4,9 @@ @@ -283,13 +283,13 @@ index 6e9f74a5c095..ee6bae16b04c 100644 config DEVKMEM diff --git a/drivers/char/Makefile b/drivers/char/Makefile -index a324f9303e36..33ce2fb1d0a3 100644 +index d06cde26031b..0832636fd9bc 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile -@@ -61,3 +61,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o - js-rtc-y = rtc.o +@@ -62,3 +62,5 @@ js-rtc-y = rtc.o obj-$(CONFIG_TILE_SROM) += tile-srom.o + obj-$(CONFIG_XILLYBUS) += xillybus/ + +obj-$(CONFIG_CRASH) += crash.o diff --git a/drivers/char/crash.c b/drivers/char/crash.c diff --git a/deal-with-deadlock-in-d_walk.patch b/deal-with-deadlock-in-d_walk.patch deleted file mode 100644 index 5f9087b4..00000000 --- a/deal-with-deadlock-in-d_walk.patch +++ /dev/null @@ -1,86 +0,0 @@ -From: Al Viro <viro@zeniv.linux.org.uk> -Date: Sun, 26 Oct 2014 19:31:10 -0400 -Subject: [PATCH] deal with deadlock in d_walk() - -... by not hitting rename_retry for reasons other than rename having -happened. In other words, do _not_ restart when finding that -between unlocking the child and locking the parent the former got -into __dentry_kill(). Skip the killed siblings instead... - -Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> ---- - fs/dcache.c | 31 ++++++++++++++++--------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/fs/dcache.c b/fs/dcache.c -index 8d7c2b34cb3f..e6c207134a14 100644 ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -465,7 +465,7 @@ static void __dentry_kill(struct dentry *dentry) - } - /* if it was on the hash then remove it */ - __d_drop(dentry); -- list_del(&dentry->d_child); -+ __list_del_entry(&dentry->d_child); - /* - * Inform d_walk() that we are no longer attached to the - * dentry tree -@@ -1113,33 +1113,31 @@ resume: - /* - * All done at this level ... ascend and resume the search. - */ -+ rcu_read_lock(); -+ascend: - if (this_parent != parent) { - struct dentry *child = this_parent; - this_parent = child->d_parent; - -- rcu_read_lock(); - spin_unlock(&child->d_lock); - spin_lock(&this_parent->d_lock); - -- /* -- * might go back up the wrong parent if we have had a rename -- * or deletion -- */ -- if (this_parent != child->d_parent || -- (child->d_flags & DCACHE_DENTRY_KILLED) || -- need_seqretry(&rename_lock, seq)) { -- spin_unlock(&this_parent->d_lock); -- rcu_read_unlock(); -+ /* might go back up the wrong parent if we have had a rename. */ -+ if (need_seqretry(&rename_lock, seq)) - goto rename_retry; -+ next = child->d_child.next; -+ while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { -+ if (next == &this_parent->d_subdirs) -+ goto ascend; -+ child = list_entry(next, struct dentry, d_child); -+ next = next->next; - } - rcu_read_unlock(); -- next = child->d_child.next; - goto resume; - } -- if (need_seqretry(&rename_lock, seq)) { -- spin_unlock(&this_parent->d_lock); -+ if (need_seqretry(&rename_lock, seq)) - goto rename_retry; -- } -+ rcu_read_unlock(); - if (finish) - finish(data); - -@@ -1149,6 +1147,9 @@ out_unlock: - return; - - rename_retry: -+ spin_unlock(&this_parent->d_lock); -+ rcu_read_unlock(); -+ BUG_ON(seq & 1); - if (!retry) - return; - seq = 1; --- -2.1.0 - diff --git a/disable-libdw-unwind-on-non-x86.patch b/disable-libdw-unwind-on-non-x86.patch deleted file mode 100644 index e2388091..00000000 --- a/disable-libdw-unwind-on-non-x86.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: "kernel-team@fedoraproject.org" <kernel-team@fedoraproject.org> -Date: Fri, 18 Apr 2014 06:58:29 -0400 -Subject: [PATCH] disable libdw unwind on non-x86 - -Bugzilla: 1025603 -Upstream-status: ?? ---- - tools/perf/config/Makefile | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile -index 1f67aa02d240..86c21a24da46 100644 ---- a/tools/perf/config/Makefile -+++ b/tools/perf/config/Makefile -@@ -52,6 +52,10 @@ ifeq ($(ARCH),powerpc) - CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX - endif - -+ifneq ($(ARCH),x86) -+ NO_LIBDW_DWARF_UNWIND := 1 -+endif -+ - ifeq ($(LIBUNWIND_LIBS),) - NO_LIBUNWIND := 1 - else --- -2.1.0 - diff --git a/filter-aarch64.sh b/filter-aarch64.sh index fa0154bb..c4d6daa4 100644 --- a/filter-aarch64.sh +++ b/filter-aarch64.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn leds media memstick message mmc mtd nfc ntb pcmcia platform power ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject " +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user" diff --git a/filter-armv7hl.sh b/filter-armv7hl.sh index 54b4f952..162df32b 100644 --- a/filter-armv7hl.sh +++ b/filter-armv7hl.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn media memstick message nfc ntb pcmcia platform ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user" diff --git a/filter-i686.sh b/filter-i686.sh index 7bc5b38d..430ccf72 100644 --- a/filter-i686.sh +++ b/filter-i686.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn leds media memstick message mfd mmc mtd nfc ntb pcmcia platform power ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub hid-sensor-magn-3d hid-sensor-incl-3d hid-sensor-gyro-3d hid-sensor-iio-common hid-sensor-accel-3d hid-sensor-trigger hid-sensor-als hid-sensor-rotation" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub hid-sensor-magn-3d hid-sensor-incl-3d hid-sensor-gyro-3d hid-sensor-iio-common hid-sensor-accel-3d hid-sensor-trigger hid-sensor-als hid-sensor-rotation target_core_user" diff --git a/filter-modules.sh b/filter-modules.sh index 6020ecce..d5f56e5d 100755 --- a/filter-modules.sh +++ b/filter-modules.sh @@ -32,7 +32,7 @@ netprots="appletalk atm ax25 batman-adv bluetooth dccp dsa ieee802154 irda l2tp drmdrvs="ast gma500 mgag200 via nouveau" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub target_core_user" # Grab the arch-specific filter list overrides source ./filter-$2.sh diff --git a/filter-ppc64.sh b/filter-ppc64.sh index 99a41b8e..be4d9878 100644 --- a/filter-ppc64.sh +++ b/filter-ppc64.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn leds media memstick message mmc mtd nfc ntb pcmcia platform power ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user" diff --git a/filter-ppc64le.sh b/filter-ppc64le.sh index 51635e2f..664d59e4 100644 --- a/filter-ppc64le.sh +++ b/filter-ppc64le.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn leds media memstick message mmc mtd nfc ntb pcmcia platform power ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user" diff --git a/filter-ppc64p7.sh b/filter-ppc64p7.sh index 0389c4ce..cf3a0e0f 100644 --- a/filter-ppc64p7.sh +++ b/filter-ppc64p7.sh @@ -11,4 +11,4 @@ driverdirs="atm auxdisplay bcma bluetooth fmc infiniband isdn leds media memstick message mmc mtd nfc ntb pcmcia platform power ssb staging uio uwb" -singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject" +singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs iscsi_tcp megaraid pmcraid qla1280 9pnet_rdma svcrdma xprtrdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user" diff --git a/kernel-arm64.patch b/kernel-arm64.patch index eeb1dcf3..4a125b93 100644 --- a/kernel-arm64.patch +++ b/kernel-arm64.patch @@ -1,442 +1,2079 @@ -diff --git a/Documentation/acpi/properties.txt b/Documentation/acpi/properties.txt +commit 0335b5034b998e978bf9343da77246bcbad33981 +Author: Mark Salter <msalter@redhat.com> +Date: Wed Nov 19 10:32:11 2014 -0500 + + arm64: explicitly set noncoherent ops for _CCA handling + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 4a2d43442e20a24b78594d12914706deddc119de +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 17:09:29 2014 -0500 + + DO NOT UPSTREAM - pci/xgene: Provide fixup for ACPI MCFG support + + Xgene doesn't decode bus bits of mmconfig region and only + supports devfn 0 of bus 0. For other buses/devices, some + internal registers need to be poked. This patch provides + a fixup to support ACPI MCFG tables. This is a horrible + hack allowing the hardware to be used for PCI testing, but + it is not intended to be a long term patch. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit b93f804830d9ef6d572dd6be9734108199141b87 +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 17:33:18 2014 -0500 + + DO NOT UPSTREAM - provide hook for MCFG fixups + + This is a temprary mechanism needed by at least one early + arm64 hardware platform with broken MCFG support. This is + not intended for upstream and will go away as soon as newer + hardware with fully compliant ECAM becomes available. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 2d76cb937a6c0010d1de181d0142f0822df5071d +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 17:30:25 2014 -0500 + + arm64/pci/acpi: initial support for ACPI probing of PCI + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit a438ff7be0140738b1224d5ade6345a9febad279 +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 17:23:57 2014 -0500 + + arm64/acpi/pci: add support for parsing MCFG table + + Add support for parsing MCFG table and provide functions to read/write + PCI configuration space based on the parsed info. This provides the + low-level raw_pci_read/raw_pci_write functionality. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 814b22167d35b18fc3de745277a2190ff0841585 +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 16:42:14 2014 -0500 + + DO NOT UPSTREAM - pci/xgene: workaround CRS issue + + CRS is not behaving properly for some reason. Until this + gets diagnosed properly, pretend not to support it in order + to prevent hangs in 3.18 kernel. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit b90d000000801b473ed4c69757d3be9e433b6c5e +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 16:31:05 2014 -0500 + + iommu/arm-smmu: fix NULL dereference with ACPI PCI devices + + Fix a NULL dereference in find_mmu_master which occurs when + booting with ACPI. In that case, PCI bridges with not have + an of_node. Add a check for NULL of_node and bail out if that + is the case. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 243e5c1dc198958ce862e39d33efc798a47b339a +Author: Mark Salter <msalter@redhat.com> +Date: Mon Nov 10 21:35:11 2014 -0500 + + DO NOT UPSTREAM - arm64: fix dma_ops for ACPI and PCI devices + + Commit 2189064795dc3fb4101e5: + + arm64: Implement set_arch_dma_coherent_ops() to replace bus notifiers + + removed the bus notifiers from dma-mapping.c. This patch + adds the notifier back for ACPI and PCI devices until a + better permanent solution is worked out. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 612eea3ae291b28f7ed50ccf50bd1685a2a7f753 +Author: Mark Salter <msalter@redhat.com> +Date: Thu Aug 14 12:32:13 2014 -0400 + + acpi: add utility to test for device dma coherency + + ACPI 5.1 adds a _CCA object to indicate memory coherency + of a bus master device. It is an integer with zero meaning + non-coherent and one meaning coherent. This attribute may + be inherited from a parent device. It may also be missing + entirely, in which case, an architecture-specific default + is assumed. + + This patch adds a utility function to parse a device handle + (and its parents) for a _CCA object and return the coherency + attribute if found. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 3d509a508c6fd70eb0fb2f0e82d08d92cc96568c +Author: Mark Salter <msalter@redhat.com> +Date: Sat Nov 22 12:08:53 2014 -0500 + + DO NOT UPSTREAM - arm64: kvm: Change vgic resource size error to info + + From: Donald Dutile <ddutile@redhat.com> + + A new check was added to upstream to ensure a full + kernel page was allocated to the vgic. The check failed + kvm configuration if the condition wasn't met. An arm64 + kernel with 64K pagesize and certain early firmware will + fail this test. Change error to info & continue configuration + for now. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 2b5dd4609e947b418afbbeae95da7f34594bc048 +Author: Wei Huang <wei@redhat.com> +Date: Sat Nov 22 10:38:45 2014 -0500 + + KVM/ACPI: Enable ACPI support for KVM virt GIC + + This patches enables ACPI support for KVM virtual GIC. KVM parses + ACPI table for virt GIC related information when DT table is not + present. This is done by retrieving the information defined in + generic_interrupt entry of MADT table. + + Note: Alexander Spyridakis from Virtual Open System posts a + _very_ similar patch to enable acpi-kvm. This patch borrows some + ideas from his patch. + + Signed-off-by: Wei Huang <wei@redhat.com> + [combined with subsequent patch to use acpi_disabled] + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 756fc31666a4a3094727da5274fc0705a05f13a3 +Author: Wei Huang <wei@redhat.com> +Date: Sat Nov 22 10:18:57 2014 -0500 + + KVM/ACPI: Enable ACPI support for virt arch timer + + This patches enables ACPI support for KVM virtual arch_timer. It + allows KVM to parse ACPI table for virt arch_timer PPI when DT table + is not present. This is done by retrieving the information from + arch_timer_ppi array in arm_arch_timer driver. + + Signed-off-by: Wei Huang <wei@redhat.com> + [combined with subsequent patch to use acpi_disabled] + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit b189108603f6db4a11e0c30050e840e8bb36f098 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Tue Nov 18 21:52:34 2014 +0100 + + arm, arm64: KVM: handle potential incoherency of readonly memslots + + Upstream posting: + http://thread.gmane.org/gmane.comp.emulators.kvm.devel/129475/focus=129477 + + Readonly memslots are often used to implement emulation of ROMs and + NOR flashes, in which case the guest may legally map these regions as + uncached. + To deal with the incoherency associated with uncached guest mappings, + treat all readonly memslots as incoherent, and ensure that pages that + belong to regions tagged as such are flushed to DRAM before being passed + to the guest. + + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + + Acadia backport notes: + + - we have a few more conflicts here. The main thing is that our + kvm_arch_prepare_memory_region() is "empty" at the moment; in upstream + Ard introduced performance related, host device related code there, in + commit 8eef91239. + + What we certainly need to grab from commit 8eef91239 is the acquiring of + "kvm->mmu_lock" (which is visible in the upstream patch context too), + and the filtering against + + (change != KVM_MR_CREATE && change != KVM_MR_MOVE) + + near the top of the function (which is not visible in the upstream patch + context). (If (change == KVM_MR_DELETE), then the caller has set up + "memslot" in such a way that calling stage2_flush_memslot() on it is + invalid, and it would actually crash the host -- speaking from + experience. :)) + + - The hunk that seems to matter in practice, in my testing on Mustang, is + the "fault_ipa_uncached" assignment one (which affects the the + demand-paged case, ie. the coherent_cache_guest_page() function, + modified in the previous patch). + + The kvm_arch_prepare_memory_region() hunk exists for completeness of + implementation, and while it could certainly make a difference, I've + never seen it make one, in my testing. We should pick it up nonetheless. + + Signed-off-by: Laszlo Ersek <lersek@redhat.com> + +commit 8ab19d68b49c2f6a9f0e6226c51bf9b2fe553022 +Author: Laszlo Ersek <lersek@redhat.com> +Date: Tue Nov 18 21:52:33 2014 +0100 + + arm, arm64: KVM: allow forced dcache flush on page faults + + Upstream posting: + http://thread.gmane.org/gmane.comp.emulators.kvm.devel/129475/focus=129476 + + From: Laszlo Ersek <lersek@redhat.com> + + To allow handling of incoherent memslots in a subsequent patch, this + patch adds a paramater 'ipa_uncached' to cache_coherent_guest_page() + so that we can instruct it to flush the page's contents to DRAM even + if the guest has caching globally enabled. + + Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + + Acadia backport notes: + - minimal context conflict in user_mem_abort(): upstream passes + + pgprot_val(mem_type) == pgprot_val(PAGE_S2_DEVICE) + + as last parameter of stage2_set_pte(), while we do a direct comparison. + + (See upstream commit 3d08c629, "arm: kvm: STRICT_MM_TYPECHECKS fix for + user_mem_abort".) + + Signed-off-by: Laszlo Ersek <lersek@redhat.com> + +commit 1ac87393dff5d6fb10edfba84dfff89f57a7224a +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Tue Nov 18 21:52:32 2014 +0100 + + kvm: add a memslot flag for incoherent memory regions + + Upstream posting: + http://thread.gmane.org/gmane.comp.emulators.kvm.devel/129475 + + Memory regions may be incoherent with the caches, typically when the + guest has mapped a host system RAM backed memory region as uncached. + Add a flag KVM_MEMSLOT_INCOHERENT so that we can tag these memslots + and handle them appropriately when mapping them. + + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Signed-off-by: Laszlo Ersek <lersek@redhat.com> + +commit 2a0a5cbf98c94e2906d9a357a63fbbb153488e1c +Author: Tom Lendacky <thomas.lendacky@amd.com> +Date: Mon Sep 15 17:02:52 2014 -0600 + + amd-xgbe: AMD 10GbE driver APCI support for A0 + + This patch provides ACPI support for the AMD 10GbE device driver + and AMD 10GbE phy driver. + + Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> + +commit 807e95abb96e7868e1c8e863a92298937a69d437 +Author: Mark Salter <msalter@redhat.com> +Date: Tue Oct 7 12:54:08 2014 -0400 + + xgene acpi network - first cut + +commit bdecd2af5d4234ed50042ab28a21736edcec6d41 +Author: Geert Uytterhoeven <geert+renesas@glider.be> +Date: Thu Nov 6 12:23:23 2014 +0100 + + leds: leds-gpio: Fix legacy GPIO number case + + In the legacy case, led_dat->gpiod is initialized correctly, but + overwritten later by template->gpiod, which is NULL, causing leds-gpio + to fail with: + + gpiod_direction_output: invalid GPIO + leds-gpio: probe of leds-gpio failed with error -22 + + Move the initialization of led_dat->gpiod from template->gpiod up, and + always use led_dat->gpiod later, to fix this. + + Fixes: 5c51277a9ababfa4 (leds: leds-gpio: Add support for GPIO descriptors) + Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> + Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 42b0d1b64cdf1c8d37e69ff7cff45852f7a16f65 +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Wed Nov 5 00:29:07 2014 +0100 + + ACPI / property: Drop size_prop from acpi_dev_get_property_reference() + + The size_prop argument of the recently added function + acpi_dev_get_property_reference() is not used by the only current + caller of that function and is very unlikely to be used at any time + going forward. + + Namely, for a property whose value is a list of items each containing + a references to a device object possibly accompanied by some integers, + the number of items in the list can always be computed as the number + of elements of type ACPI_TYPE_LOCAL_REFERENCE in the property package. + Thus it should never be necessary to provide an additional "cells" + property with a value equal to the number of items in that list. It + also should never be necessary to provide a "cells" property specifying + how many integers are supposed to be following each reference. + + For this reason, drop the size_prop argument from + acpi_dev_get_property_reference() and update its caller accordingly. + + Link: http://marc.info/?l=linux-kernel&m=141511255610556&w=2 + Suggested-by: Grant Likely <grant.likely@linaro.org> + Acked-by: Grant Likely <grant.likely@linaro.org> + Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit c3f29cda7420da6a721d40d116f369cfc1533d38 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Fri Oct 31 13:40:58 2014 +0200 + + leds: leds-gpio: Convert gpio_blink_set() to use GPIO descriptors + + Commit 21f2aae91e902aad ("leds: leds-gpio: Add support for GPIO + descriptors") already converted most of the driver to use GPIO descriptors. + What is still missing is the platform specific hook gpio_blink_set() and + board files which pass legacy GPIO numbers to this driver in platform data. + + In this patch we handle the former and convert gpio_blink_set() to take + GPIO descriptor instead. In order to do this we convert the existing four + users to accept GPIO descriptor and translate it to legacy GPIO number in + the platform code. This effectively "pushes" legacy GPIO number usage from + the driver to platforms. + + Also add comment to the remaining block describing that it is legacy code + path and we are getting rid of it eventually. + + Suggested-by: Linus Walleij <linus.walleij@linaro.org> + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Andrew Lunn <andrew@lunn.ch> + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> + Acked-by: Alexandre Courbot <acourbot@nvidia.com> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 4117b39d39f59d2497ceac1091ec54aa3056cb4f +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Mon Nov 3 23:39:57 2014 +0100 + + ACPI / GPIO: Document ACPI GPIO mappings API + + Document the previously introduced method that can be used by device + drivers to provide the GPIO subsystem with mappings between GPIO names + (connection IDs) and GpioIo()/GpioInt() resources in _CRS. + + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> + +commit d9345c86ad290bb4ca98b37520f94fc8075b2b94 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Mon Oct 27 12:15:14 2014 +0200 + + net: rfkill: gpio: Add default GPIO driver mappings for ACPI + + The driver uses devm_gpiod_get_index(..., index) so that the index refers + directly to the GpioIo resource under the ACPI device. The problem with + this is that if the ordering changes we get wrong GPIOs. + + With ACPI 5.1 _DSD we can now use names instead to reference GPIOs + analogous to Device Tree. However, we still have systems out there that do + not provide _DSD at all. These systems must be supported as well. + + Luckily we now have acpi_dev_add_driver_gpios() that can be used to provide + mappings for systems where _DSD is not provided and still take advantage of + _DSD if it exists. + + This patch changes the driver to create default GPIO mappings if we are + running on ACPI system. + + While there we can drop the indices completely and use devm_gpiod_get() + with name instead. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Reviewed-by: Johannes Berg <johannes@sipsolutions.net> + Acked-by: John W. Linville <linville@tuxdriver.com> + Acked-by: Linus Walleij <linus.walleij@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 22cb8c44e198b7e3f3299324edbcaa1389016d52 +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Mon Nov 3 23:39:41 2014 +0100 + + ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs + + Provide a way for device drivers using GPIOs described by ACPI + GpioIo resources in _CRS to tell the GPIO subsystem what names + (connection IDs) to associate with specific GPIO pins defined + in there. + + To do that, a driver needs to define a mapping table as a + NULL-terminated array of struct acpi_gpio_mapping objects + that each contain a name, a pointer to an array of line data + (struct acpi_gpio_params) objects and the size of that array. + + Each struct acpi_gpio_params object consists of three fields, + crs_entry_index, line_index, active_low, representing the index of + the target GpioIo()/GpioInt() resource in _CRS starting from zero, + the index of the target line in that resource starting from zero, + and the active-low flag for that line, respectively. + + Next, the mapping table needs to be passed as the second + argument to acpi_dev_add_driver_gpios() that will register it with + the ACPI device object pointed to by its first argument. That + should be done in the driver's .probe() routine. + + On removal, the driver should unregister its GPIO mapping table + by calling acpi_dev_remove_driver_gpios() on the ACPI device + object where that table was previously registered. + + Included are fixes from Mika Westerberg. + + Acked-by: Alexandre Courbot <acourbot@nvidia.com> + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit c70e2807a8bacbdfed992b58ca24eb152a778a01 +Author: Aaron Lu <aaron.lu@intel.com> +Date: Tue Oct 21 13:34:00 2014 +0200 + + input: gpio_keys_polled: Make use of device property API + + Make use of device property API in this driver so that both OF based + system and ACPI based system can use this driver. + + Signed-off-by: Aaron Lu <aaron.lu@intel.com> + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 29257e751014d0d43f78bcfecd9a56a603096c95 +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Mon Oct 27 23:30:10 2014 +0100 + + leds: leds-gpio: Make use of device property API + + Make use of device property API in this driver so that both OF and ACPI + based system can use the same driver. + + This change contains material from Max Eliaser and Mika Westerberg. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Bryan Wu <cooloney@gmail.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 08ddbc9678ce8465f17acc8e1b1b67442593d1b5 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue Oct 21 13:33:59 2014 +0200 + + gpio: Support for unified device properties interface + + Some drivers need to deal with only firmware representation of its + GPIOs. An example would be a GPIO button array driver where each button + is described as a separate firmware node in device tree. Typically these + child nodes do not have physical representation in the Linux device + model. + + In order to help device drivers to handle such firmware child nodes we + add dev[m]_get_named_gpiod_from_child() that takes a child firmware + node pointer as its second argument (the first one is the parent device + itself), finds the GPIO using whatever is the underlying firmware + method, and requests the GPIO properly. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Alexandre Courbot <acourbot@nvidia.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 880614f83402ae8b408f33cb252505da0760f3e5 +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Tue Nov 4 14:03:59 2014 +0100 + + Driver core: Unified interface for firmware node properties + + Add new generic routines are provided for retrieving properties from + device description objects in the platform firmware in case there are + no struct device objects for them (either those objects have not been + created yet or they do not exist at all). + + The following functions are provided: + + fwnode_property_present() + fwnode_property_read_u8() + fwnode_property_read_u16() + fwnode_property_read_u32() + fwnode_property_read_u64() + fwnode_property_read_string() + fwnode_property_read_u8_array() + fwnode_property_read_u16_array() + fwnode_property_read_u32_array() + fwnode_property_read_u64_array() + fwnode_property_read_string_array() + + in analogy with the corresponding functions for struct device added + previously. For all of them, the first argument is a pointer to struct + fwnode_handle (new type) that allows a device description object + (depending on what platform firmware interface is in use) to be + obtained. + + Add a new macro device_for_each_child_node() for iterating over the + children of the device description object associated with a given + device and a new function device_get_child_node_count() returning the + number of a given device's child nodes. + + The interface covers both ACPI and Device Trees. + + Suggested-by: Grant Likely <grant.likely@linaro.org> + Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit b5923f9dc379c1861a70d8836c7d9976d9521390 +Author: Aaron Lu <aaron.lu@intel.com> +Date: Tue Oct 21 23:30:25 2014 +0200 + + input: gpio_keys_polled: Add support for GPIO descriptors + + GPIO descriptors are the preferred way over legacy GPIO numbers + nowadays. Convert the driver to use GPIO descriptors internally but + still allow passing legacy GPIO numbers from platform data to support + existing platforms. + + Signed-off-by: Aaron Lu <aaron.lu@intel.com> + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Alexandre Courbot <acourbot@nvidia.com> + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> + Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 5c3c4fe36a05672113646f8fb839e4c91256ef5d +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Mon Oct 27 23:29:32 2014 +0100 + + leds: leds-gpio: Add support for GPIO descriptors + + GPIO descriptors are the preferred way over legacy GPIO numbers + nowadays. Convert the driver to use GPIO descriptors internally but + still allow passing legacy GPIO numbers from platform data to support + existing platforms. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Alexandre Courbot <acourbot@nvidia.com> + Acked-by: Bryan Wu <cooloney@gmail.com> + Acked-by: Arnd Bergmann <arnd@arndb.de> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit 8105c03352f32060c765837cbb7d619e075289d9 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue Oct 21 13:33:56 2014 +0200 + + gpio: sch: Consolidate core and resume banks + + This is actually a single device with two sets of identical registers, + which just happen to start from a different offset. Instead of having + separate GPIO chips created we consolidate them to be single GPIO chip. + + In addition having a single GPIO chip allows us to handle ACPI GPIO + translation in the core in a more generic way, since the two GPIO chips + share the same parent ACPI device. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Linus Walleij <linus.walleij@linaro.org> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit ce0e2672808ce2805d0aadfd12d94e2dd6be5ab9 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Wed Oct 29 15:41:01 2014 +0100 + + gpio / ACPI: Add support for _DSD device properties + + With release of ACPI 5.1 and _DSD method we can finally name GPIOs (and + other things as well) returned by _CRS. Previously we were only able to + use integer index to find the corresponding GPIO, which is pretty error + prone if the order changes. + + With _DSD we can now query GPIOs using name instead of an integer index, + like the below example shows: + + // Bluetooth device with reset and shutdown GPIOs + Device (BTH) + { + Name (_HID, ...) + + Name (_CRS, ResourceTemplate () + { + GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, + "\\_SB.GPO0", 0, ResourceConsumer) {15} + GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, + "\\_SB.GPO0", 0, ResourceConsumer) {27, 31} + }) + + Name (_DSD, Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }}, + Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }}, + } + }) + } + + The format of the supported GPIO property is: + + Package () { "name", Package () { ref, index, pin, active_low }} + + ref - The device that has _CRS containing GpioIo()/GpioInt() resources, + typically this is the device itself (BTH in our case). + index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. + pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero. + active_low - If 1 the GPIO is marked as active_low. + + Since ACPI GpioIo() resource does not have field saying whether it is + active low or high, the "active_low" argument can be used here. Setting + it to 1 marks the GPIO as active low. + + In our Bluetooth example the "reset-gpio" refers to the second GpioIo() + resource, second pin in that resource with the GPIO number of 31. + + This patch implements necessary support to gpiolib for extracting GPIOs + using _DSD device properties. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Linus Walleij <linus.walleij@linaro.org> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit e072a051ef3a5d612949dc22ca71e40dbe978ed1 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue Oct 21 13:33:56 2014 +0200 + + misc: at25: Make use of device property API + + Make use of device property API in this driver so that both DT and ACPI + based systems can use this driver. + + In addition we hard-code the name of the chip to be "at25" for the + reason that there is no common mechanism to fetch name of the firmware + node. The only existing user (arch/arm/boot/dts/phy3250.dts) uses the + same name so it should continue to work. + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit e176d66bf1a8e613e501dae1fc6798e1a42b7062 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue Oct 21 13:33:56 2014 +0200 + + ACPI: Allow drivers to match using Device Tree compatible property + + We have lots of existing Device Tree enabled drivers and allocating + separate _HID for each is not feasible. Instead we allocate special _HID + "PRP0001" that means that the match should be done using Device Tree + compatible property using driver's .of_match_table instead if the driver + is missing .acpi_match_table. + + If there is a need to distinguish from where the device is enumerated + (DT/ACPI) driver can check dev->of_node or ACPI_COMPATION(dev). + + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit e30b98eab5645fa42d372cc1be44e22db5f5e9b8 +Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> +Date: Tue Nov 4 01:28:56 2014 +0100 + + Driver core: Unified device properties interface for platform firmware + + Add a uniform interface by which device drivers can request device + properties from the platform firmware by providing a property name + and the corresponding data type. The purpose of it is to help to + write portable code that won't depend on any particular platform + firmware interface. + + The following general helper functions are added: + + device_property_present() + device_property_read_u8() + device_property_read_u16() + device_property_read_u32() + device_property_read_u64() + device_property_read_string() + device_property_read_u8_array() + device_property_read_u16_array() + device_property_read_u32_array() + device_property_read_u64_array() + device_property_read_string_array() + + The first one allows the caller to check if the given property is + present. The next 5 of them allow single-valued properties of + various types to be retrieved in a uniform way. The remaining 5 are + for reading properties with multiple values (arrays of either numbers + or strings). + + The interface covers both ACPI and Device Trees. + + This change set includes material from Mika Westerberg and Aaron Lu. + + Signed-off-by: Aaron Lu <aaron.lu@intel.com> + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit a8762c178234b62dce5e55df8de8528857a47bb7 +Author: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue Oct 21 13:33:55 2014 +0200 + + ACPI: Add support for device specific properties + + Device Tree is used in many embedded systems to describe the system + configuration to the OS. It supports attaching properties or name-value + pairs to the devices it describe. With these properties one can pass + additional information to the drivers that would not be available + otherwise. + + ACPI is another configuration mechanism (among other things) typically + seen, but not limited to, x86 machines. ACPI allows passing arbitrary + data from methods but there has not been mechanism equivalent to Device + Tree until the introduction of _DSD in the recent publication of the + ACPI 5.1 specification. + + In order to facilitate ACPI usage in systems where Device Tree is + typically used, it would be beneficial to standardize a way to retrieve + Device Tree style properties from ACPI devices, which is what we do in + this patch. + + If a given device described in ACPI namespace wants to export properties it + must implement _DSD method (Device Specific Data, introduced with ACPI 5.1) + that returns the properties in a package of packages. For example: + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () {"name1", <VALUE1>}, + Package () {"name2", <VALUE2>}, + ... + } + }) + + The UUID reserved for properties is daffd814-6eba-4d8c-8a91-bc9bbf4aa301 + and is documented in the ACPI 5.1 companion document called "_DSD + Implementation Guide" [1], [2]. + + We add several helper functions that can be used to extract these + properties and convert them to different Linux data types. + + The ultimate goal is that we only have one device property API that + retrieves the requested properties from Device Tree or from ACPI + transparent to the caller. + + [1] http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm + [2] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf + + Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> + Reviewed-by: Josh Triplett <josh@joshtriplett.org> + Reviewed-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Darren Hart <dvhart@linux.intel.com> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> + Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> + +commit a9240791b83abd372e4efb77f20444c27a56ebae +Author: Mark Salter <msalter@redhat.com> +Date: Tue Sep 30 17:19:24 2014 -0400 + + arm64: avoid need for console= to enable serial console + + Tell kernel to prefer one of the serial ports on platforms + pl011, 8250, or sbsa uarts. console= on command line will + override these assumed preferences. This is just a hack to + get the behavior we want from SPCR table support. Once SPCR + is supported, we can drop this. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 6fee3b2bd2ad6349e7bb3082393bf6355e01ce6f +Author: Tom Lendacky <thomas.lendacky@amd.com> +Date: Tue Sep 9 23:33:17 2014 -0400 + + drivers: net: AMD Seattle XGBE PHY support for A0 silicon + + This patch modifies the upstream AMD XGBE PHY driver to support + A0 Seattle silicon in currently shipping systems. The upstream + Linux driver is targetted for Seattle B0 silicon. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 0a0eea6d358d51ab381e2945c0e9db2f6cc06157 +Author: Tom Lendacky <thomas.lendacky@amd.com> +Date: Tue Sep 9 23:34:07 2014 -0400 + + drivers: net: AMD Seattle XGBE 10GbE support for A0 silicon + + This patch modifies the upstream AMD 10GbE XGBE Ethernet driver to + support A0 Seattle silicon in currently shipping systems. The + upstream Linux driver is targetted for Seattle B0 silicon. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit ff93b53f3ca8748529855d421bf79329086544cd +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Fri Jul 26 17:55:02 2013 +0100 + + virtio-mmio: add ACPI probing + + Added the match table and pointers for ACPI probing to the driver. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + +commit 5315cb5a532e900612ac1202507551761e8bd13c +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Wed Jul 24 11:29:48 2013 +0100 + + net: smc91x: add ACPI probing support. + + Add device ID LINA0003 for this device and add the match table. + + As its a platform device it needs no other code and will be probed in by + acpi_platform once device ID is added. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + +commit 640f607f1fa10c7c0cd6025dde8883d02fc9b411 +Author: Mark Salter <msalter@redhat.com> +Date: Sun Sep 14 09:44:44 2014 -0400 + + Revert "ahci_xgene: Skip the PHY and clock initialization if already configured by the firmware." + + This reverts commit 0bed13bebd6c99d097796d2ca6c4f10fb5b2eabc. + + Temporarily revert for backwards compatibility with rh-0.12-1 firmware + +commit e8afbea7e3e11f37c234770d72725894f92de415 +Author: Mark Salter <msalter@redhat.com> +Date: Mon Aug 11 13:46:43 2014 -0400 + + xgene: add support for ACPI-probed serial port + +commit 3d0ad3e452a81a32842d85dbb88078b74582efb5 +Author: Mark Salter <msalter@redhat.com> +Date: Sat Aug 9 12:01:20 2014 -0400 + + sata/xgene: support acpi probing + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit a42353df5a2f741e8d2e356c3f053aac8d3eff0e +Author: Mark Salter <msalter@redhat.com> +Date: Thu Sep 18 15:05:23 2014 -0400 + + arm64: add sev to parking protocol + + Parking protocol wakes secondary cores with an interrupt. + This patch adds an additional sev() to send an event. This + is a temporary hack for APM Mustang board and not intended + for upstream. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit d81f088880b9d763a7006e40dff6bb526c534255 +Author: Mark Salter <msalter@redhat.com> +Date: Tue Sep 9 22:59:48 2014 -0400 + + arm64: add parking protocol support + + This is a first-cut effort at parking protocol support. It is + very much a work in progress (as is the spec it is based on). + This code deviates from the current spec in a number of ways + to work around current firmware issues and issues with kernels + using 64K page sizes. + + caveat utilitor + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 475b6ce1555e1146761b53c550f2ac019311739f +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Thu Aug 28 14:26:16 2014 -0400 + + ARM64 / ACPI: Introduce some PCI functions when PCI is enabled + + Introduce some PCI functions to make ACPI can be compiled when + CONFIG_PCI is enabled, these functions should be revisited when + implemented on ARM64. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + [fixed up for 3.17-rc] + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit cb6ebe40936adc5c3154abbec6f89ccb8a0536b7 +Author: Al Stone <ahs3@redhat.com> +Date: Thu Aug 28 13:14:16 2014 -0400 + + Fix arm64 compilation error in PNP code + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit b7fc0378e13207a53a3e8466ba6329cfbcaa0526 +Author: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> +Date: Tue Sep 9 15:37:15 2014 -0500 + + ata: ahci_platform: Add ACPI support for AMD Seattle SATA controller + + This patch adds ACPI support for non-PCI SATA contoller in ahci_platform driver. + It adds ACPI matching table in ahci_platform to support AMD Seattle SATA controller + with following ASL structure in DSDT: + + Device (SATA0) + { + Name(_HID, "AMDI0600") // Seattle AHSATA + Name (_CCA, 1) // Cache-coherent controller + Name (_CRS, ResourceTemplate () + { + Memory32Fixed (ReadWrite, 0xE0300000, 0x00010000) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,,,) { 387 } + }) + } + + Since ATA driver should not require PCI support for ATA_ACPI, + this patch also removes dependency in the driver/ata/Kconfig. + + Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> + +commit c5b655e6af273a61e7ec3653deb3550ae4f7abf1 +Author: Mark Salter <msalter@redhat.com> +Date: Wed Nov 19 10:08:29 2014 -0500 + + tty/sbsauart: make ttySBSA the active console device + + The sbsauart driver doesn't register itself as a console + until module_initcall time. This allows the virtual console + driver to register the active console if no console= is + given on the cmdline. This patch allows ttySBSA to take + over the active console device role from any existing + console device if no console= is given on the cmdline. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 6bee52af3d281d91b871f6876138fa51a41f0472 +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Wed Aug 13 13:47:18 2014 +0100 + + tty: SBSA compatible UART + + This is a subset of pl011 UART which does not supprt DMA or baud rate + changing. It does, however, provide earlycon support (i.e., using + "earlycon=ttySBSA" on the kernel command line). + + It is specified in the Server Base System Architecture document from + ARM. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + +commit a66f13e7c17cf7283b9987da2349c0a5c204fa4b +Author: Mark Salter <msalter@redhat.com> +Date: Mon Sep 8 11:58:46 2014 -0400 + + acpi: fix acpi_os_ioremap for arm64 + + The acpi_os_ioremap() function may be used to map normal RAM or IO + regions. The current implementation simply uses ioremap_cache(). This + will work for some architectures, but arm64 ioremap_cache() cannot be + used to map IO regions which don't support caching. So for arm64, use + ioremap() for non-RAM regions. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit b00f36975b651c0afbddee49e84109694e610f43 +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Mon Sep 8 10:36:44 2014 -0400 + + acpi: add arm to the platforms that use ioremap + + Now with the base changes to the arm memory mapping it is safe + to convert to using ioremap to map in the tables. + + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + +commit 4f6ca522fc13d8c13c844a2c2f9eafe091a336a9 +Author: Mark Salter <msalter@redhat.com> +Date: Mon Sep 8 17:04:28 2014 -0400 + + acpi/arm64: NOT FOR UPSTREAM - remove EXPERT dependency + + For convenience to keep existing configs working, remove + CONFIG_EXPERT dependency from ACPI for ARM64. This shouldn't + go upstream just yet. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 91eaa3c5387ebcf698b070a4c21e39e5240699ba +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Fri Oct 17 21:37:14 2014 +0800 + + Documentation: ACPI for ARM64 + + Add documentation for the guidelines of how to use ACPI + on ARM64. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit ef17919599275fd58edb255ecf69807653cdd763 +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Fri Oct 17 21:37:13 2014 +0800 + + ARM64 / ACPI: Enable ARM64 in Kconfig + + Add Kconfigs to build ACPI on ARM64, and make ACPI available on ARM64. + + acpi_idle driver is x86/IA64 dependent now, so make CONFIG_ACPI_PROCESSOR + depend on X86 || IA64, and implement it on ARM64 in the future. + + Reviewed-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 7d78ff059af78cc5a80576314c38584834557fc1 +Author: Al Stone <al.stone@linaro.org> +Date: Fri Oct 17 21:37:12 2014 +0800 + + ARM64 / ACPI: Select ACPI_REDUCED_HARDWARE_ONLY if ACPI is enabled on ARM64 + + ACPI reduced hardware mode is disabled by default, but ARM64 + can only run properly in ACPI hardware reduced mode, so select + ACPI_REDUCED_HARDWARE_ONLY if ACPI is enabled on ARM64. + + Reviewed-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 8a387ea5071c9d8bdaf5305320130022ec1d4f7d +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:11 2014 +0800 + + ARM64 / ACPI: Parse GTDT to initialize arch timer + + Using the information presented by GTDT to initialize the arch + timer (not memory-mapped). + + Originally-by: Amit Daniel Kachhap <amit.daniel@samsung.com> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 7523c8b3b0d23629781c4581272c0647fa543af5 +Author: Tomasz Nowicki <tomasz.nowicki@linaro.org> +Date: Fri Oct 17 21:37:10 2014 +0800 + + ARM64 / ACPI: Add GICv2 specific ACPI boot support + + ACPI kernel uses MADT table for proper GIC initialization. It needs to + parse GIC related subtables, collect CPU interface and distributor + addresses and call driver initialization function (which is hardware + abstraction agnostic). In a similar way, FDT initialize GICv1/2. + + NOTE: This commit allow to initialize GICv1/2 basic functionality. + GICv2 vitalization extension, GICv3/4 and ITS are considered as next + steps. + + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 743691994f2fb03bc05f539a42ba6ccccb5d18b8 +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:09 2014 +0800 + + ARM64 / ACPI: Introduce ACPI_IRQ_MODEL_GIC and register device's gsi + + Introduce ACPI_IRQ_MODEL_GIC which is needed for ARM64 as GIC is + used, and then register device's gsi with the core IRQ subsystem. + + acpi_register_gsi() is similar to DT based irq_of_parse_and_map(), + since gsi is unique in the system, so use hwirq number directly + for the mapping. + + Originally-by: Amit Daniel Kachhap <amit.daniel@samsung.com> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 0c4d9983cb7b50351aad0aa32e8b6134adaabb0d +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:08 2014 +0800 + + ACPI / processor: Make it possible to get CPU hardware ID via GICC + + Introduce a new function map_gicc_mpidr() to allow MPIDRs to be obtained + from the GICC Structure introduced by ACPI 5.1. + + MPIDR is the CPU hardware ID as local APIC ID on x86 platform, so we use + MPIDR not the GIC CPU interface ID to identify CPUs. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit cb6b980abe388e25e357f73c5780aa1cf1b2e337 +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:07 2014 +0800 + + ARM64 / ACPI: Parse MADT for SMP initialization + + MADT contains the information for MPIDR which is essential for + SMP initialization, parse the GIC cpu interface structures to + get the MPIDR value and map it to cpu_logical_map(), and add + enabled cpu with valid MPIDR into cpu_possible_map. + + ACPI 5.1 only has two explicit methods to boot up SMP, PSCI and + Parking protocol, but the Parking protocol is only specified for + ARMv7 now, so make PSCI as the only way for the SMP boot protocol + before some updates for the ACPI spec or the Parking protocol spec. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + +commit 74a72e003ae388f460294a0910a536aced8ce93c +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:06 2014 +0800 + + ACPI / table: Print GIC information when MADT is parsed + + When MADT is parsed, print GIC information to make the boot + log look pretty: + + ACPI: GICC (acpi_id[0x0000] address[00000000e112f000] MPDIR[0x0] enabled) + ACPI: GICC (acpi_id[0x0001] address[00000000e112f000] MPDIR[0x1] enabled) + ... + ACPI: GICC (acpi_id[0x0201] address[00000000e112f000] MPDIR[0x201] enabled) + + These information will be very helpful to bring up early systems to + see if acpi_id and MPIDR are matched or not as spec defined. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + +commit 059facbd0f0664aaaf6d732ce02b2f56ea6ad98f +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:05 2014 +0800 + + ARM64 / ACPI: Parse FADT table to get PSCI flags for PSCI init + + There are two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set, + the former signals to the OS that the firmware is PSCI compliant. + The latter selects the appropriate conduit for PSCI calls by + toggling between Hypervisor Calls (HVC) and Secure Monitor Calls + (SMC). + + FADT table contains such information, parse FADT to get the flags + for PSCI init. Since ACPI 5.1 doesn't support self defined PSCI + function IDs, which means that only PSCI 0.2+ is supported in ACPI. + + At the same time, only ACPI 5.1 or higher verison supports PSCI, + and FADT Major.Minor version was introduced in ACPI 5.1, so we + will check the version and only parse FADT table with version >= 5.1. + + If firmware provides ACPI tables with ACPI version less than 5.1, + OS will be messed up with those information and have no way to init + smp and GIC, so disable ACPI if we get an FADT table with version + less that 5.1. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + +commit 7ec63267bb1630c62e5f7fd2eb75a9a31131c89a +Author: Hanjun Guo <hanjun.guo@linaro.org> +Date: Fri Oct 17 21:37:04 2014 +0800 + + ARM64 / ACPI: Make PCI optional for ACPI on ARM64 + + As PCI for ARM64 is not ready, so introduce some stub functions + to make PCI optional for ACPI, and make ACPI core run without + CONFIG_PCI on ARM64. + + Since ACPI on X86 and IA64 depends on PCI and this patch only makes + PCI optional for ARM64, it will not break anything on X86 and IA64. + + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 2f1dd91e7866f2b617af29e9973b88b2cc2e00d6 +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Fri Oct 17 21:37:03 2014 +0800 + + ARM64 / ACPI: If we chose to boot from acpi then disable FDT + + If the early boot methods of acpi are happy that we have valid ACPI + tables and acpi=force has been passed, then do not unflat devicetree + effectively disabling further hardware probing from DT. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 6941a3cced9ca3d29e6e9c8b0f43917526b74789 +Author: Al Stone <al.stone@linaro.org> +Date: Fri Oct 17 21:37:02 2014 +0800 + + ARM64 / ACPI: Introduce early_param for "acpi" and pass acpi=force to enable ACPI + + Introduce one early parameters "off" and "force" for "acpi", acpi=off + will be the default behavior for ARM64, so introduce acpi=force to + enable ACPI on ARM64. + + Disable ACPI before early parameters parsed, and enable it to pass + "acpi=force" if people want use ACPI on ARM64. This ensures DT be + the prefer one if ACPI table and DT both are provided at this moment. + + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 8764d6bd07827a2a29eaaa382fc397527ad1ba19 +Author: Graeme Gregory <graeme.gregory@linaro.org> +Date: Fri Oct 17 21:37:01 2014 +0800 + + ARM64 / ACPI: Introduce sleep-arm.c + + ACPI 5.1 does not currently support S states for ARM64 hardware but + ACPI code will call acpi_target_system_state() for device power + managment, so introduce sleep-arm.c to allow other drivers to function + until S states are defined. + + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit 37144fd61ca68e9d542e875187739c982c8d3662 +Author: Al Stone <al.stone@linaro.org> +Date: Fri Oct 17 21:37:00 2014 +0800 + + ARM64 / ACPI: Get RSDP and ACPI boot-time tables + + As we want to get ACPI tables to parse and then use the information + for system initialization, we should get the RSDP (Root System + Description Pointer) first, it then locates Extended Root Description + Table (XSDT) which contains all the 64-bit physical address that + pointer to other boot-time tables. + + Introduce acpi.c and its related head file in this patch to provide + fundamental needs of extern variables and functions for ACPI core, + and then get boot-time tables as needed. + - asm/acenv.h for arch specific ACPICA environments and + implementation, It is needed unconditionally by ACPI core; + - asm/acpi.h for arch specific variables and functions needed by + ACPI driver core; + - acpi.c for ARM64 related ACPI implementation for ACPI driver + core; + + acpi_boot_table_init() is introduced to get RSDP and boot-time tables, + it will be called in setup_arch() before paging_init(), so we should + use eary_memremap() mechanism here to get the RSDP and all the table + pointers. + + Signed-off-by: Al Stone <al.stone@linaro.org> + Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit a4f035d2876b41b6f224321da6b6278de577d4c5 +Author: Tomasz Nowicki <tomasz.nowicki@linaro.org> +Date: Fri Oct 17 21:36:59 2014 +0800 + + ACPI / table: Count matched and successfully parsed entries without specifying max entries + + It is very useful to traverse all available table entries without max + number of expected entries type. Current acpi_parse_entries() + implementation gives that feature but it does not count those entries, + it returns 0 instead, so fix it to count matched and successfully + entries and return it. + + NOTE: This change has no impact to x86 and ia64 archs since existing code + checks for error occurrence only (acpi_parse_entries(...,0) < 0). + + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit b3055f38d52f5be0103b436a1b04fbf3947aaa39 +Author: Ashwin Chaugule <ashwin.chaugule@linaro.org> +Date: Fri Oct 17 21:36:58 2014 +0800 + + ACPI / table: Add new function to get table entries + + The acpi_table_parse() function has a callback that + passes a pointer to a table_header. Add a new function + which takes this pointer and parses its entries. This + eliminates the need to re-traverse all the tables for + each call. e.g. as in acpi_table_parse_madt() which is + normally called after acpi_table_parse(). + + Acked-by: Grant Likely <grant.likely@linaro.org> + Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> + Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> + Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> + +commit fff62dfc1d7ab6ad3d528b008413fd116d208150 +Author: Mark Salter <msalter@redhat.com> +Date: Sat Nov 8 22:25:48 2014 -0500 + + arm64: use UEFI for reboot + + Wire in support for UEFI reboot. We want UEFI reboot to have + highest priority for capsule support. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 997a0488adb3f525aedb678b584f2733f43e248e +Author: Mark Salter <msalter@redhat.com> +Date: Sat Nov 8 15:25:41 2014 -0500 + + arm64: use UEFI as last resort for poweroff + + Wire in support for poweroff via UEFI. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit 5b823d4bf52286f97dc76683b533ae5c08763897 +Author: Mark Salter <msalter@redhat.com> +Date: Thu Jul 17 13:34:50 2014 -0400 + + ahci_xgene: add errata workaround for ATA_CMD_SMART + + commit 2a0bdff6b958d1b2: + + ahci_xgene: fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command. + + added a workaround for X-Gene AHCI controller errata. This was done + for all ATA_CMD_ID_ATA commands. The errata also appears to affect + ATA_CMD_SMART commands as well. This was discovered when running + smartd or just smartctl -x. This patch adds a dma engine restart for + ATA_CMD_SMART commands which clears up the issues seen with smartd. + + Signed-off-by: Mark Salter <msalter@redhat.com> + +commit f866806e1ca75a0efc62cda59559286faa7c9926 +Author: Kyle McMartin <kmcmarti@redhat.com> +Date: Tue May 13 22:25:26 2014 -0400 + + arm64: don't set READ_IMPLIES_EXEC for EM_AARCH64 ELF objects + + Message-id: <20140513222526.GC26038@redacted.bos.redhat.com> + Patchwork-id: 79789 + O-Subject: [ACADIA PATCH] arm64: don't set READ_IMPLIES_EXEC for EM_AARCH64 ELF objects + Bugzilla: 1085528 + + BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1085528 + Upstream: submitted soon + + [Sadly this isn't (yet) sufficient... but it fixes at least one issue + here... cat /proc/$$/personality shows READ_IMPLIES_EXEC before. I'll + try to figure the rest out tomorrow.] + + Currently, we're accidentally ending up with executable stacks on + AArch64 when the ABI says we shouldn't be, and relying on glibc to fix + things up for us when we're loaded. However, SELinux will deny us + mucking with the stack, and hit us with execmem AVCs. + + The reason this is happening is somewhat complex: + + fs/binfmt_elf.c:load_elf_binary() + - initializes executable_stack = EXSTACK_DEFAULT implying the + architecture should make up its mind. + - does a pile of loading goo + - runs through the program headers, looking for PT_GNU_STACK + and setting (or unsetting) executable_stack if it finds it. + + This is our first problem, we won't generate these unless an + executable stack is explicitly requested. + + - more ELF loading goo + - sets whether we're a compat task or not (TIF_32BIT) based on compat.h + - for compat reasons (pre-GNU_STACK) checks if the READ_IMPLIES_EXEC + flag should be set for ancient toolchains + + Here's our second problem, we test if read_implies_exec based on + stk != EXSTACK_DISABLE_X, which is true since stk == EXSTACK_DEFAULT. + + So we set current->personality |= READ_IMPLIES_EXEC like a broken + legacy toolchain would want. + + - Now we call setup_arg_pages to set up the stack... + + fs/exec.c:setup_arg_pages() + - lots of magic happens here + - vm_flags gets initialized to VM_STACK_FLAGS + + Here's our third problem, VM_STACK_FLAGS on arm64 is + VM_DEFAULT_DATA_FLAG which tests READ_IMPLIES_EXEC and sets VM_EXEC + if it's true. So we end up with an executable stack mapping, since we + don't have executable_stack set (it's still EXSTACK_DEFAULT at this + point) to unset it anywhere. + + Bang. execstack AVC when the program starts running. + + The easiest way I can see to fix this is to test if we're a legacy task + and fix it up there. But that's not as simple as it sounds, because + the 32-bit ABI depends on what revision of the CPU we've enabled (not + that it matters since we're ARMv8...) Regardless, in the compat case, + set READ_IMPLIES_EXEC if we've found a GNU_STACK header which explicitly + requested it as in arch/arm/kernel/elf.c:arm_elf_read_implies_exec(). + + Signed-off-by: Kyle McMartin <kmcmarti@redhat.com> + Signed-off-by: Donald Dutile <ddutile@redhat.com> + +commit a68d368ceb495cabafe82cdd0b83ec1e271a7f9d +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Fri Nov 7 14:12:34 2014 +0000 + + arm64: kvm: eliminate literal pool entries + + Replace two instances of 'ldr xN, =(constant)' in the world switch + hot path with 'mov' instructions. + + Acked-by: Marc Zyngier <marc.zyngier@arm.com> + Acked-by: Christoffer Dall <christoffer.dall@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 246a31b3a8f065e831a6d8d9fd96f3a8e17dbdb9 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Fri Nov 7 14:12:33 2014 +0000 + + arm64: ftrace: eliminate literal pool entries + + Replace ldr xN, =<symbol> with adrp/add or adrp/ldr [as appropriate] + in the implementation of _mcount(), which may be called very often. + + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit ecd0f8e21514e8ac758ed16a188faaa4c5ef75c7 +Author: Mark Rutland <mark.rutland@arm.com> +Date: Tue Nov 4 10:50:16 2014 +0000 + + arm64: log physical ID of boot CPU + + In certain debugging scenarios it's useful to know the physical ID (i.e. + the MPIDR_EL1.Aff* fields) of the boot CPU, but we don't currently log + this as we do for 32-bit ARM kernels. + + This patch makes the kernel log the physical ID of the boot CPU early in + the boot process. The CPU logical map initialisation is folded in to + smp_setup_processor_id (which contrary to its name is also called by UP + kernels). This is called before setup_arch, so should not adversely + affect existing cpu_logical_map users. + + Acked-by: Sudeep Holla <sudeep.holla@arm.com> + Acked-by: Catalin Marinas <catalin.marinas@arm.com> + Acked-by: Lorenzo Pieralisis <lorenzo.pieralisi@arm.com> + Signed-off-by: Mark Rutland <mark.rutland@arm.com> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 2899d6ea451eb0037427bbf430069f73cb76becc +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Mon Nov 3 16:50:01 2014 +0000 + + arm64/crypto: use crypto instructions to generate AES key schedule + + This patch implements the AES key schedule generation using ARMv8 + Crypto Instructions. It replaces the table based C implementation + in aes_generic.ko, which means we can drop the dependency on that + module. + + Tested-by: Steve Capper <steve.capper@linaro.org> + Acked-by: Steve Capper <steve.capper@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 67b1122c25f0c7a9a126ebabcd2085ef99640c13 +Author: Geoff Levand <geoff@infradead.org> +Date: Fri Oct 31 23:06:47 2014 +0000 + + arm64/kvm: Fix assembler compatibility of macros + + Some of the macros defined in kvm_arm.h are useful in assembly files, but are + not compatible with the assembler. Change any C language integer constant + definitions using appended U, UL, or ULL to the UL() preprocessor macro. Also, + add a preprocessor include of the asm/memory.h file which defines the UL() + macro. + + Fixes build errors like these when using kvm_arm.h in assembly + source files: + + Error: unexpected characters following instruction at operand 3 -- `and x0,x1,#((1U<<25)-1)' + + Acked-by: Mark Rutland <mark.rutland@arm.com> + Signed-off-by: Geoff Levand <geoff@infradead.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 6a3c07e9aa03b7fbec14ab8bc21fce8590f12d83 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Tue Oct 28 12:24:20 2014 +0000 + + arm64/dt: add machine name to kernel call stack dump output + + This installs the machine name as recorded by setup_machine_fdt() + as dump stack arch description. This results in the string to be + included in call stack dumps, as is shown here: + + ... + Bad mode in Synchronous Abort handler detected, code 0x84000005 + CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc2+ #548 + > Hardware name: linux,dummy-virt (DT) + task: ffffffc07c870000 ti: ffffffc07c878000 task.ti: ffffffc07c878000 + PC is at 0x0 + ... + + Note that systems that support DMI/SMBIOS may override this later. + + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 7c0569a739d0f1dd8ffd709cf37c53bb42143687 +Author: Steve Capper <steve.capper@linaro.org> +Date: Fri Oct 24 13:22:20 2014 +0100 + + arm64: xchg: Implement cmpxchg_double + + The arm64 architecture has the ability to exclusively load and store + a pair of registers from an address (ldxp/stxp). Also the SLUB can take + advantage of a cmpxchg_double implementation to avoid taking some + locks. + + This patch provides an implementation of cmpxchg_double for 64-bit + pairs, and activates the logic required for the SLUB to use these + functions (HAVE_ALIGNED_STRUCT_PAGE and HAVE_CMPXCHG_DOUBLE). + + Also definitions of this_cpu_cmpxchg_8 and this_cpu_cmpxchg_double_8 + are wired up to cmpxchg_local and cmpxchg_double_local (rather than the + stock implementations that perform non-atomic operations with + interrupts disabled) as they are used by the SLUB. + + On a Juno platform running on only the A57s I get quite a noticeable + performance improvement with 5 runs of hackbench on v3.17: + + Baseline | With Patch + -----------------+----------- + Mean 119.2312 | 106.1782 + StdDev 0.4919 | 0.4494 + + (times taken to complete `./hackbench 100 process 1000', in seconds) + + Signed-off-by: Steve Capper <steve.capper@linaro.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 7acf53bfb80c2823d233c14d33cfd2d119713b89 +Author: Joonwoo Park <joonwoop@codeaurora.org> +Date: Tue Oct 21 01:59:03 2014 +0100 + + arm64: optimize memcpy_{from,to}io() and memset_io() + + Optimize memcpy_{from,to}io() and memset_io() by transferring in 64 bit + as much as possible with minimized barrier usage. This simplest + optimization brings faster throughput compare to current byte-by-byte read + and write with barrier in the loop. Code's skeleton is taken from the + powerpc. + + Link: http://lkml.kernel.org/p/20141020133304.GH23751@e104818-lin.cambridge.arm.com + Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> + Reviewed-by: Trilok Soni <tsoni@codeaurora.org> + Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org> + Signed-off-by: Will Deacon <will.deacon@arm.com> + +commit 1971c19fb2a38a1d94cedada404760a917c36cd4 +Author: Mark Rutland <mark.rutland@arm.com> +Date: Thu Oct 23 16:33:33 2014 +0100 + + efi: efi-stub: notify on DTB absence + + In the absence of a DTB configuration table, the EFI stub will happily + continue attempting to boot a kernel, despite the fact that this kernel + may not function without a description of the hardware. In this case, as + with a typo'd "dtb=" option (e.g. "dbt=") or many other possible + failures, the only output seen by the user will be the rather terse + output from the EFI stub: + + EFI stub: Booting Linux Kernel... + + To aid those attempting to debug such failures, this patch adds a notice + when no DTB is found, making the output more helpful: + + EFI stub: Booting Linux Kernel... + EFI stub: Generating empty DTB + + Additionally, a positive acknowledgement is added when a user-specified + DTB is in use: + + EFI stub: Booting Linux Kernel... + EFI stub: Using DTB from command line + + Similarly, a positive acknowledgement is added when a DTB from a + configuration table is in use: + + EFI stub: Booting Linux Kernel... + EFI stub: Using DTB from configuration table + + Signed-off-by: Mark Rutland <mark.rutland@arm.com> + Acked-by: Leif Lindholm <leif.lindholm@linaro.org> + Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + Acked-by: Roy Franz <roy.franz@linaro.org> + Acked-by: Matt Fleming <matt.fleming@intel.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 7652016ff98e614ed2e3abac19b996af02434293 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Wed Oct 15 09:36:50 2014 +0200 + + arm64: dmi: set DMI string as dump stack arch description + + This sets the DMI string, containing system type, serial number, + firmware version etc. as dump stack arch description, so that oopses + and other kernel stack dumps automatically have this information + included, if available. + + Tested-by: Leif Lindholm <leif.lindholm@linaro.org> + Acked-by: Leif Lindholm <leif.lindholm@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 2586f232bd388d2223f3c7bcba446b2bd25d8e3d +Author: Yi Li <yi.li@linaro.org> +Date: Sat Oct 4 23:46:43 2014 +0800 + + arm64: dmi: Add SMBIOS/DMI support + + SMBIOS is important for server hardware vendors. It implements a spec for + providing descriptive information about the platform. Things like serial + numbers, physical layout of the ports, build configuration data, and the like. + + Signed-off-by: Yi Li <yi.li@linaro.org> + Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> + Tested-by: Leif Lindholm <leif.lindholm@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 16b52b24f3d7a4f1555e4233398172b32306c1e4 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Tue Oct 14 16:41:27 2014 +0200 + + dmi: add support for SMBIOS 3.0 64-bit entry point + + The DMTF SMBIOS reference spec v3.0.0 defines a new 64-bit entry point, + which enables support for SMBIOS structure tables residing at a physical + offset over 4 GB. This is especially important for upcoming arm64 + platforms whose system RAM resides entirely above the 4 GB boundary. + + For the UEFI case, this code attempts to detect the new SMBIOS 3.0 + header magic at the offset passed in the SMBIOS3_TABLE_GUID UEFI + configuration table. If this configuration table is not provided, or + if we fail to parse the header, we fall back to using the legacy + SMBIOS_TABLE_GUID configuration table. This is in line with the spec, + that allows both configuration tables to be provided, but mandates that + they must point to the same structure table, unless the version pointed + to by the 64-bit entry point is a superset of the 32-bit one. + + For the non-UEFI case, the detection logic is modified to look for the + SMBIOS 3.0 header magic before it looks for the legacy header magic. + + Note that this patch is based on version 3.0.0d [draft] of the + specification, which is expected not to deviate from the final version + in ways that would affect the correctness of this implementation. + + Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> + Acked-by: Leif Lindholm <leif.lindholm@linaro.org> + Tested-by: Leif Lindholm <leif.lindholm@linaro.org> + Cc: Andrew Morton <akpm@linux-foundation.org> + Cc: Tony Luck <tony.luck@intel.com> + Acked-by: Matt Fleming <matt.fleming@intel.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 016f4b4f5cee9ddd8c243a36c220a65bdfb82dc8 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Tue Oct 14 16:34:47 2014 +0200 + + efi: dmi: add support for SMBIOS 3.0 UEFI configuration table + + This adds support to the UEFI side for detecting the presence of + a SMBIOS 3.0 64-bit entry point. This allows the actual SMBIOS + structure table to reside at a physical offset over 4 GB, which + cannot be supported by the legacy SMBIOS 32-bit entry point. + + Since the firmware can legally provide both entry points, store + the SMBIOS 3.0 entry point in a separate variable, and let the + DMI decoding layer decide which one will be used. + + Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> + Acked-by: Leif Lindholm <leif.lindholm@linaro.org> + Acked-by: Matt Fleming <matt.fleming@intel.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit ac627ea950e853f0a3f91607fb16cb9477f434d7 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Fri Oct 17 12:44:11 2014 +0200 + + arm64/efi: drop redundant set_bit(EFI_CONFIG_TABLES) + + The EFI_CONFIG_TABLES bit already gets set by efi_config_init(), + so there is no reason to set it again after this function returns + successfully. + + Acked-by: Will Deacon <will.deacon@arm.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 850ba08a3f4756a8340edadd4fdeccd881813ba5 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Mon Oct 20 15:31:57 2014 +0200 + + arm64/efi: invert UEFI memory region reservation logic + + Instead of reserving the memory regions based on which types we know + need to be reserved, consider only regions of the following types as + free for general use by the OS: + + EFI_LOADER_CODE + EFI_LOADER_DATA + EFI_BOOT_SERVICES_CODE + EFI_BOOT_SERVICES_DATA + EFI_CONVENTIONAL_MEMORY + + Note that this also fixes a problem with the original code, which would + misidentify a EFI_RUNTIME_SERVICES_DATA region as not reserved if it + does not have the EFI_MEMORY_RUNTIME attribute set. However, it is + perfectly legal for the firmware not to request a virtual mapping for + EFI_RUNTIME_SERVICES_DATA regions that contain configuration tables, in + which case the EFI_MEMORY_RUNTIME attribute would not be set. + + Acked-by: Roy Franz <roy.franz@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 2787807ca4f5f7df82a5c54312753b157e8c052e +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Fri Oct 10 18:42:55 2014 +0200 + + arm64/efi: set PE/COFF file alignment to 512 bytes + + Change our PE/COFF header to use the minimum file alignment of + 512 bytes (0x200), as mandated by the PE/COFF spec v8.3 + + Also update the linker script so that the Image file itself is also a + round multiple of FileAlignment. + + Acked-by: Catalin Marinas <catalin.marinas@arm.com> + Acked-by: Roy Franz <roy.franz@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 7bd0585d9ab62d9787c389d3b62141b76319e5f7 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Fri Oct 10 11:25:24 2014 +0200 + + arm64/efi: set PE/COFF section alignment to 4 KB + + Position independent AArch64 code needs to be linked and loaded at the + same relative offset from a 4 KB boundary, or adrp/add and adrp/ldr + pairs will not work correctly. (This is how PC relative symbol + references with a 4 GB reach are emitted) + + We need to declare this in the PE/COFF header, otherwise the PE/COFF + loader may load the Image and invoke the stub at an offset which + violates this rule. + + Reviewed-by: Roy Franz <roy.franz@linaro.org> + Acked-by: Mark Rutland <mark.rutland@arm.com> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + +commit 5a0edb2dbdf9327322ae57e8e16d162c2a371318 +Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Date: Wed Oct 8 16:11:27 2014 +0200 + + arm64/efi: efistub: jump to 'stext' directly, not through the header + + After the EFI stub has done its business, it jumps into the kernel by + branching to offset #0 of the loaded Image, which is where it expects + to find the header containing a 'branch to stext' instruction. + + However, the UEFI spec 2.1.1 states the following regarding PE/COFF + image loading: + "A UEFI image is loaded into memory through the LoadImage() Boot + Service. This service loads an image with a PE32+ format into memory. + This PE32+ loader is required to load all sections of the PE32+ image + into memory." + + In other words, it is /not/ required to load parts of the image that are + not covered by a PE/COFF section, so it may not have loaded the header + at the expected offset, as it is not covered by any PE/COFF section. + + So instead, jump to 'stext' directly, which is at the base of the + PE/COFF .text section, by supplying a symbol 'stext_offset' to + efi-entry.o which contains the relative offset of stext into the Image. + Also replace other open coded calculations of the same value with a + reference to 'stext_offset' + + Acked-by: Mark Rutland <mark.rutland@arm.com> + Acked-by: Roy Franz <roy.franz@linaro.org> + Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> + + Documentation/acpi/gpio-properties.txt | 96 +++ + Documentation/arm64/arm-acpi.txt | 323 ++++++++++ + Documentation/gpio/consumer.txt | 18 + + Documentation/kernel-parameters.txt | 3 +- + arch/arm/include/asm/kvm_mmu.h | 5 +- + arch/arm/kvm/mmu.c | 22 +- + arch/arm/mach-s3c24xx/h1940-bluetooth.c | 4 +- + arch/arm/mach-s3c24xx/h1940.h | 4 +- + arch/arm/mach-s3c24xx/mach-h1940.c | 3 +- + arch/arm/mach-s3c24xx/mach-rx1950.c | 3 +- + arch/arm/plat-orion/gpio.c | 3 +- + arch/arm/plat-orion/include/plat/orion-gpio.h | 5 +- + arch/arm64/Kconfig | 22 + + arch/arm64/Makefile | 1 + + arch/arm64/crypto/Kconfig | 5 +- + arch/arm64/crypto/aes-ce-ccm-glue.c | 4 +- + arch/arm64/crypto/aes-ce-cipher.c | 112 +++- + arch/arm64/crypto/aes-ce-setkey.h | 5 + + arch/arm64/crypto/aes-glue.c | 18 +- + arch/arm64/include/asm/acenv.h | 18 + + arch/arm64/include/asm/acpi.h | 102 +++ + arch/arm64/include/asm/cmpxchg.h | 71 +++ + arch/arm64/include/asm/cpu_ops.h | 1 + + arch/arm64/include/asm/dmi.h | 31 + + arch/arm64/include/asm/elf.h | 3 +- + arch/arm64/include/asm/kvm_arm.h | 21 +- + arch/arm64/include/asm/kvm_mmu.h | 5 +- + arch/arm64/include/asm/pci.h | 51 ++ + arch/arm64/include/asm/psci.h | 3 +- + arch/arm64/include/asm/smp.h | 10 +- + arch/arm64/kernel/Makefile | 4 +- + arch/arm64/kernel/acpi.c | 398 ++++++++++++ + arch/arm64/kernel/cpu_ops.c | 8 +- + arch/arm64/kernel/efi-entry.S | 3 +- + arch/arm64/kernel/efi.c | 74 ++- + arch/arm64/kernel/entry-ftrace.S | 21 +- + arch/arm64/kernel/head.S | 24 +- + arch/arm64/kernel/io.c | 66 +- + arch/arm64/kernel/pci.c | 97 ++- + arch/arm64/kernel/psci.c | 78 ++- + arch/arm64/kernel/setup.c | 51 +- + arch/arm64/kernel/smp.c | 2 +- + arch/arm64/kernel/smp_parking_protocol.c | 110 ++++ + arch/arm64/kernel/time.c | 7 + + arch/arm64/kernel/vmlinux.lds.S | 17 + + arch/arm64/kvm/hyp.S | 4 +- + arch/arm64/mm/dma-mapping.c | 112 ++++ + arch/arm64/pci/Makefile | 2 + + arch/arm64/pci/mmconfig.c | 292 +++++++++ + arch/arm64/pci/pci.c | 461 ++++++++++++++ + drivers/acpi/Kconfig | 6 +- + drivers/acpi/Makefile | 7 +- + drivers/acpi/bus.c | 3 + + drivers/acpi/internal.h | 11 + + drivers/acpi/osl.c | 6 +- + drivers/acpi/processor_core.c | 37 ++ + drivers/acpi/property.c | 551 ++++++++++++++++ + drivers/acpi/scan.c | 129 +++- + drivers/acpi/sleep-arm.c | 28 + + drivers/acpi/tables.c | 115 +++- + drivers/acpi/utils.c | 26 + + drivers/ata/Kconfig | 2 +- + drivers/ata/ahci_platform.c | 13 + + drivers/ata/ahci_xgene.c | 30 +- + drivers/base/Makefile | 2 +- + drivers/base/property.c | 431 +++++++++++++ + drivers/clocksource/arm_arch_timer.c | 120 +++- + drivers/firmware/dmi_scan.c | 79 ++- + drivers/firmware/efi/efi.c | 4 + + drivers/firmware/efi/libstub/arm-stub.c | 11 +- + drivers/gpio/devres.c | 32 + + drivers/gpio/gpio-sch.c | 293 ++++----- + drivers/gpio/gpiolib-acpi.c | 117 +++- + drivers/gpio/gpiolib.c | 85 ++- + drivers/gpio/gpiolib.h | 7 +- + drivers/input/keyboard/gpio_keys_polled.c | 112 ++-- + drivers/iommu/arm-smmu.c | 8 +- + drivers/irqchip/irq-gic-v3.c | 10 + + drivers/irqchip/irq-gic.c | 116 ++++ + drivers/irqchip/irqchip.c | 3 + + drivers/leds/leds-gpio.c | 140 ++-- + drivers/misc/eeprom/at25.c | 34 +- + drivers/net/ethernet/amd/Kconfig | 2 +- + drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 16 +- + drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 + + drivers/net/ethernet/amd/xgbe/xgbe-main.c | 289 +++++++-- + drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 20 +- + drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | 4 +- + drivers/net/ethernet/amd/xgbe/xgbe.h | 13 + + drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 69 +- + drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 68 +- + drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 1 + + drivers/net/ethernet/smsc/smc91x.c | 10 + + drivers/net/phy/Kconfig | 2 +- + drivers/net/phy/amd-xgbe-phy.c | 777 ++++++++++++----------- + drivers/of/base.c | 33 + + drivers/pci/host/pci-xgene.c | 167 +++++ + drivers/pnp/resource.c | 2 + + drivers/tty/Kconfig | 6 + + drivers/tty/Makefile | 1 + + drivers/tty/sbsauart.c | 358 +++++++++++ + drivers/tty/serial/8250/8250_dw.c | 9 + + drivers/virtio/virtio_mmio.c | 12 +- + drivers/xen/efi.c | 1 + + include/acpi/acpi_bus.h | 30 + + include/acpi/acpi_io.h | 6 + + include/asm-generic/vmlinux.lds.h | 7 + + include/kvm/arm_vgic.h | 20 +- + include/linux/acpi.h | 141 +++- + include/linux/clocksource.h | 6 + + include/linux/efi.h | 6 +- + include/linux/gpio/consumer.h | 7 + + include/linux/gpio_keys.h | 3 + + include/linux/irqchip/arm-gic-acpi.h | 31 + + include/linux/irqchip/arm-gic.h | 2 + + include/linux/kvm_host.h | 1 + + include/linux/leds.h | 3 +- + include/linux/of.h | 34 + + include/linux/pci.h | 37 +- + include/linux/property.h | 143 +++++ + net/rfkill/rfkill-gpio.c | 18 +- + virt/kvm/arm/arch_timer.c | 107 ++-- + virt/kvm/arm/vgic-v2.c | 86 ++- + virt/kvm/arm/vgic-v3.c | 8 +- + virt/kvm/arm/vgic.c | 30 +- + 125 files changed, 6843 insertions(+), 1117 deletions(-) + +diff --git a/Documentation/acpi/gpio-properties.txt b/Documentation/acpi/gpio-properties.txt new file mode 100644 -index 0000000..13a93c5 +index 0000000..ae36fcf --- /dev/null -+++ b/Documentation/acpi/properties.txt -@@ -0,0 +1,410 @@ -+ACPI device properties -+====================== -+This document describes the format and interfaces of ACPI device -+properties as specified in "Device Properties UUID For _DSD" available -+here: -+ -+http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf -+ -+1. Introduction -+--------------- -+In systems that use ACPI and want to take advantage of device specific -+properties, there needs to be a standard way to return and extract -+name-value pairs for a given ACPI device. -+ -+An ACPI device that wants to export its properties must implement a -+static name called _DSD that takes no arguments and returns a package of -+packages: -+ -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"name1", <VALUE1>}, -+ Package () {"name2", <VALUE2>} -+ } -+ }) -+ -+The UUID identifies contents of the following package. In case of ACPI -+device properties it is daffd814-6eba-4d8c-8a91-bc9bbf4aa301. -+ -+In each returned package, the first item is the name and must be a string. -+The corresponding value can be a string, integer, reference, or package. If -+a package it may only contain strings, integers, and references. -+ -+An example device where we might need properties is a device that uses -+GPIOs. In addition to the GpioIo/GpioInt resources the driver needs to -+know which GPIO is used for which purpose. -+ -+To solve this we add the following ACPI device properties to the device: -+ -+ Device (DEV0) -+ { -+ Name (_CRS, ResourceTemplate () { -+ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, -+ "\\_SB.PCI0.LPC", 0, ResourceConsumer) {0} -+ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, -+ "\\_SB.PCI0.LPC", 0, ResourceConsumer) {1} -+ ... -+ }) -+ -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"reset-gpio", {^DEV0, 0, 0, 0}}, -+ Package () {"shutdown-gpio", {^DEV0, 1, 0, 0}}, -+ } -+ }) -+ } -+ -+Now the device driver can reference the GPIOs using names instead of -+using indexes. -+ -+If there is an existing Device Tree binding for a device, it is expected -+that the same bindings are used with ACPI properties, so that the driver -+dealing with the device needs only minor modifications if any. -+ -+2. Formal definition of properties -+---------------------------------- -+The following chapters define the currently supported properties. For -+these there exists a helper function that can be used to extract the -+property value. -+ -+2.1 Integer types -+----------------- -+ACPI integers are always 64-bit. However, for drivers the full range is -+typically not needed so we provide a set of functions which convert the -+64-bit integer to a smaller Linux integer type. -+ -+An integer property looks like this: -+ -+ Package () {"i2c-sda-hold-time-ns", 300}, -+ Package () {"clock-frequency", 400000}, -+ -+To read a property value, use a unified property accessor as shown -+below: -+ -+ u32 val; -+ int ret; -+ -+ ret = device_property_read_u32(dev, "clock-frequency", &val); -+ if (ret) -+ /* Handle error */ -+ -+The function returns 0 if the property is copied to 'val' or negative -+errno if something went wrong (or the property does not exist). -+ -+2.2 Integer arrays -+------------------ -+An integer array is a package holding only integers. Arrays can be used to -+represent different things like Linux input key codes to GPIO mappings, pin -+control settings, dma request lines, etc. -+ -+An integer array looks like this: -+ -+ Package () { -+ "max8952,dvs-mode-microvolt", -+ Package () { -+ 1250000, -+ 1200000, -+ 1050000, -+ 950000, -+ } -+ } -+ -+The above array property can be accessed like: -+ -+ u32 voltages[4]; -+ int ret; -+ -+ ret = device_property_read_u32_array(dev, "max8952,dvs-mode-microvolt", -+ voltages, ARRAY_SIZE(voltages)); -+ if (ret) -+ /* Handle error */ -+ -+ -+All functions copy the resulting values cast to a requested type to the -+caller supplied array. If you pass NULL in the value pointer ('voltages' in -+this case), the function returns number of items in the array. This can be -+useful if caller does not know size of the array beforehand. -+ -+2.3 Strings -+----------- -+String properties can be used to describe many things like labels for GPIO -+buttons, compability ids, etc. -+ -+A string property looks like this: -+ -+ Package () {"pwm-names", "backlight"}, -+ Package () {"label", "Status-LED"}, -+ -+You can use device_property_read_string() to extract strings: -+ -+ const char *val; -+ int ret; -+ -+ ret = device_property_read_string(dev, "label", &val); -+ if (ret) -+ /* Handle error */ -+ -+Note that the function does not copy the returned string but instead the -+value is modified to point to the string property itself. -+ -+The memory is owned by the associated ACPI device object and released -+when it is removed. The user need not free the associated memory. -+ -+2.4 String arrays -+----------------- -+String arrays can be useful in describing a list of labels, names for -+DMA channels, etc. -+ -+A string array property looks like this: -+ -+ Package () {"dma-names", Package () {"tx", "rx", "rx-tx"}}, -+ Package () {"clock-output-names", Package () {"pll", "pll-switched"}}, -+ -+And these can be read in similar way that the integer arrrays: -+ -+ const char *dma_names[3]; -+ int ret; -+ -+ ret = device_property_read_string_array(dev, "dma-names", dma_names, -+ ARRAY_SIZE(dma_names)); -+ if (ret) -+ /* Handle error */ -+ -+The memory management rules follow what is specified for single strings. -+Specifically the returned pointers should be treated as constant and not to -+be freed. That is done automatically when the correspondig ACPI device -+object is released. -+ -+2.5 Object references -+--------------------- -+An ACPI object reference is used to refer to some object in the -+namespace. For example, if a device has dependencies with some other -+object, an object reference can be used. -+ -+An object reference looks like this: -+ -+ Package () {"dev0", \_SB.DEV0}, -+ -+At the time of writing this, there is no unified device_property_* accessor -+for references so one needs to use the following ACPI helper function: -+ -+ int acpi_dev_get_property_reference(struct acpi_device *adev, -+ const char *name, -+ const char *size_prop, int index, -+ struct acpi_reference_args *args); -+ -+The referenced ACPI device is returned in args->adev if found. -+ -+In addition to simple object references it is also possible to have object -+references with arguments. These are represented in ASL as follows: -+ -+ Device (\_SB.PCI0.PWM) -+ { -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"#pwm-cells", 2} -+ } -+ }) -+ } -+ -+ Device (\_SB.PCI0.BL) -+ { -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () { -+ "pwms", -+ Package () { -+ \_SB.PCI0.PWM, 0, 5000000, -+ \_SB.PCI0.PWM, 1, 4500000, -+ } -+ } -+ } -+ }) -+ } -+ -+In the above example, the referenced device declares a property that -+returns the number of expected arguments (here it is "#pwm-cells"). If -+no such property is given we assume that all the integers following the -+reference are arguments. -+ -+In the above example PWM device expects 2 additional arguments. This -+will be validated by the ACPI property core. -+ -+The additional arguments must be integers. Nothing else is supported. -+ -+It is possible, as in the above example, to have multiple references -+with varying number of integer arguments. It is up to the referenced -+device to declare how many arguments it expects. The 'index' parameter -+selects which reference is returned. -+ -+One can use acpi_dev_get_property_reference() as well to extract the -+information in additional parameters: -+ -+ struct acpi_reference_args args; -+ struct acpi_device *adev = /* this will point to the BL device */ -+ int ret; -+ -+ /* extract the first reference */ -+ acpi_dev_get_property_reference(adev, "pwms", "#pwm-cells", 0, &args); -+ -+ BUG_ON(args.nargs != 2); -+ BUG_ON(args.args[0] != 0); -+ BUG_ON(args.args[1] != 5000000); -+ -+ /* extract the second reference */ -+ acpi_dev_get_property_reference(adev, "pwms", "#pwm-cells", 1, &args); -+ -+ BUG_ON(args.nargs != 2); -+ BUG_ON(args.args[0] != 1); -+ BUG_ON(args.args[1] != 4500000); -+ -+In addition to arguments, args.adev now points to the ACPI device that -+corresponds to \_SB.PCI0.PWM. -+ -+It is intended that this function is not used directly but instead -+subsystems like pwm implement their ACPI support on top of this function -+in such way that it is hidden from the client drivers, such as via -+pwm_get(). -+ -+3. Device property hierarchies -+------------------------------ -+Devices are organized in a tree within the Linux kernel. It follows that -+the configuration data would also be hierarchical. In order to reach -+equivalence with Device Tree, the ACPI mechanism must also provide some -+sort of tree-like representation. Fortunately, the ACPI namespace is -+already such a structure. -+ -+For example, we could have the following device in ACPI namespace. The -+KEYS device is much like gpio_keys_polled.c in that it includes "pseudo" -+devices for each GPIO: -+ -+ Device (KEYS) -+ { -+ Name (_CRS, ResourceTemplate () { -+ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, -+ "\\_SB.PCI0.LPC", 0, ResourceConsumer) {0} -+ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, -+ "\\_SB.PCI0.LPC", 0, ResourceConsumer) {1} -+ ... -+ }) -+ -+ // "pseudo" devices declared under the parent device -+ Device (BTN0) { -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"label", "minnow_btn0"} -+ Package () {"gpios", Package () {^KEYS, 0, 0, 1}} -+ } -+ }) -+ } -+ -+ Device (BTN1) { -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"label", "minnow_btn1"} -+ Package () {"gpios", Package () {^KEYS, 1, 0, 1}} -+ } -+ }) -+ } -+ } -+ -+We can extract the above in gpio_keys_polled.c like: -+ -+ static int gpio_keys_polled_create_button(struct device *dev, void *child, -+ void *data) -+ { -+ struct button_data *bdata = data; -+ const char *label = NULL; -+ -+ /* -+ * We need to use device_child_ variant here to access -+ * properties of the child. -+ */ -+ device_child_property_read_string(dev, child, "label", &label); -+ /* and so on */ -+ } -+ -+ static void gpio_keys_polled_probe(struct device *dev) -+ { -+ /* Properties for the KEYS device itself */ -+ device_property_read(dev, ...); -+ -+ /* -+ * Iterate over button devices and extract their -+ * firmware configuration. -+ */ -+ ret = device_for_each_child_node(dev, gpio_keys_polled_create_button, -+ &bdata); -+ if (ret) -+ /* Handle error */ -+ } -+ -+Note that you still need proper error handling which is omitted in the -+above example. -+ -+4. Existing Device Tree enabled drivers -+--------------------------------------- -+At the time of writing this, there are ~250 existing DT enabled drivers. -+Allocating _HID/_CID for each would not be feasible. To make sure that -+those drivers can still be used on ACPI systems, we provide an -+alternative way to get these matched. -+ -+There is a special _HID "PRP0001" which means that use the DT bindings -+for matching this device to a driver. The driver needs to have -+.of_match_table filled in even when !CONFIG_OF. -+ -+An example device would be leds that can be controlled via GPIOs. This -+is represented as "leds-gpio" device and looks like this in the ACPI -+namespace: -+ -+ Device (LEDS) -+ { -+ Name (_DSD, Package () { -+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), -+ Package () { -+ Package () {"compatible", Package () {"gpio-leds"}}, -+ } -+ }) -+ ... -+ } -+ -+In order to get the existing drivers/leds/leds-gpio.c bound to this -+device, we take advantage of "PRP0001": -+ -+ /* Following already exists in the driver */ -+ static const struct of_device_id of_gpio_leds_match[] = { -+ { .compatible = "gpio-leds", }, -+ {}, -+ }; -+ MODULE_DEVICE_TABLE(of, of_gpio_leds_match); -+ -+ /* This we add to the driver to get it probed */ -+ static const struct acpi_device_id acpi_gpio_leds_match[] = { -+ { "PRP0001" }, /* Device Tree shoehorned into ACPI */ -+ {}, -+ }; -+ MODULE_DEVICE_TABLE(acpi, acpi_gpio_leds_match); -+ -+ static struct platform_driver gpio_led_driver = { -+ .driver = { -+ /* -+ * No of_match_ptr() here because we want this -+ * table to be visible even when !CONFIG_OF to -+ * match against "compatible" in _DSD. -+ */ -+ .of_match_table = of_gpio_leds_match, -+ .acpi_match_table = acpi_gpio_leds_match, -+ }, -+ }; -+ -+Once ACPI core sees "PRP0001" and that the device has "compatible" -+property it will do the match using .of_match_table instead. ++++ b/Documentation/acpi/gpio-properties.txt +@@ -0,0 +1,96 @@ ++_DSD Device Properties Related to GPIO ++-------------------------------------- ++ ++With the release of ACPI 5.1 and the _DSD configuration objecte names ++can finally be given to GPIOs (and other things as well) returned by ++_CRS. Previously, we were only able to use an integer index to find ++the corresponding GPIO, which is pretty error prone (it depends on ++the _CRS output ordering, for example). ++ ++With _DSD we can now query GPIOs using a name instead of an integer ++index, like the ASL example below shows: ++ ++ // Bluetooth device with reset and shutdown GPIOs ++ Device (BTH) ++ { ++ Name (_HID, ...) ++ ++ Name (_CRS, ResourceTemplate () ++ { ++ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, ++ "\\_SB.GPO0", 0, ResourceConsumer) {15} ++ GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, ++ "\\_SB.GPO0", 0, ResourceConsumer) {27, 31} ++ }) ++ ++ Name (_DSD, Package () ++ { ++ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ++ Package () ++ { ++ Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }}, ++ Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }}, ++ } ++ }) ++ } ++ ++The format of the supported GPIO property is: ++ ++ Package () { "name", Package () { ref, index, pin, active_low }} ++ ++ ref - The device that has _CRS containing GpioIo()/GpioInt() resources, ++ typically this is the device itself (BTH in our case). ++ index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. ++ pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero. ++ active_low - If 1 the GPIO is marked as active_low. ++ ++Since ACPI GpioIo() resource does not have a field saying whether it is ++active low or high, the "active_low" argument can be used here. Setting ++it to 1 marks the GPIO as active low. ++ ++In our Bluetooth example the "reset-gpio" refers to the second GpioIo() ++resource, second pin in that resource with the GPIO number of 31. ++ ++ACPI GPIO Mappings Provided by Drivers ++-------------------------------------- ++ ++There are systems in which the ACPI tables do not contain _DSD but provide _CRS ++with GpioIo()/GpioInt() resources and device drivers still need to work with ++them. ++ ++In those cases ACPI device identification objects, _HID, _CID, _CLS, _SUB, _HRV, ++available to the driver can be used to identify the device and that is supposed ++to be sufficient to determine the meaning and purpose of all of the GPIO lines ++listed by the GpioIo()/GpioInt() resources returned by _CRS. In other words, ++the driver is supposed to know what to use the GpioIo()/GpioInt() resources for ++once it has identified the device. Having done that, it can simply assign names ++to the GPIO lines it is going to use and provide the GPIO subsystem with a ++mapping between those names and the ACPI GPIO resources corresponding to them. ++ ++To do that, the driver needs to define a mapping table as a NULL-terminated ++array of struct acpi_gpio_mapping objects that each contain a name, a pointer ++to an array of line data (struct acpi_gpio_params) objects and the size of that ++array. Each struct acpi_gpio_params object consists of three fields, ++crs_entry_index, line_index, active_low, representing the index of the target ++GpioIo()/GpioInt() resource in _CRS starting from zero, the index of the target ++line in that resource starting from zero, and the active-low flag for that line, ++respectively, in analogy with the _DSD GPIO property format specified above. ++ ++For the example Bluetooth device discussed previously the data structures in ++question would look like this: ++ ++static const struct acpi_gpio_params reset_gpio = { 1, 1, false }; ++static const struct acpi_gpio_params shutdown_gpio = { 0, 0, false }; ++ ++static const struct acpi_gpio_mapping bluetooth_acpi_gpios[] = { ++ { "reset-gpio", &reset_gpio, 1 }, ++ { "shutdown-gpio", &shutdown_gpio, 1 }, ++ { }, ++}; + -+It is preferred that new devices get a proper _HID allocated for them -+instead of inventing new DT "compatible" devices. ++Next, the mapping table needs to be passed as the second argument to ++acpi_dev_add_driver_gpios() that will register it with the ACPI device object ++pointed to by its first argument. That should be done in the driver's .probe() ++routine. On removal, the driver should unregister its GPIO mapping table by ++calling acpi_dev_remove_driver_gpios() on the ACPI device object where that ++table was previously registered. diff --git a/Documentation/arm64/arm-acpi.txt b/Documentation/arm64/arm-acpi.txt new file mode 100644 -index 0000000..b7dc826 +index 0000000..17cf96d --- /dev/null +++ b/Documentation/arm64/arm-acpi.txt -@@ -0,0 +1,218 @@ +@@ -0,0 +1,323 @@ +ACPI on ARMv8 Servers +--------------------- -+ +ACPI can be used for ARMv8 general purpose servers designed to follow -+the SBSA specification (currently available to people with an ARM login at -+http://silver.arm.com). ++the ARM SBSA (Server Base System Architecture) specification, currently ++available to those with an ARM login at http://silver.arm.com. ++ ++The ARMv8 kernel implements the reduced hardware model of ACPI version ++5.1 and its corresponding errata. Links to the specification and all ++external documents it refers to are managed by the UEFI Forum. The ++specification is available at http://www.uefi.org/specifications and ++external documents can be found via http://www.uefi.org/acpi. + -+The kernel will implement minimum ACPI version is 5.1 + errata as released by -+the UEFI Forum, which is available at <http://www.uefi.org/acpi/specs>. ++If an ARMv8 system does not meet the requirements of the SBSA, or cannot ++be described using the mechanisms defined in the required ACPI specifications, ++then it is likely that Device Tree (DT) is more suitable than ACPI for the ++hardware. + -+If the machine does not meet the requirements of the SBSA, or cannot be -+described in the required ACPI specifications then it is likely that Device Tree -+(DT) is more suitable for the hardware. + +Relationship with Device Tree +----------------------------- -+ +ACPI support in drivers and subsystems for ARMv8 should never be mutually +exclusive with DT support at compile time. + @@ -447,131 +2084,226 @@ index 0000000..b7dc826 +of booting with either scheme (in kernels with both schemes enabled at compile +time). + -+When booting using ACPI tables the /chosen node in DT will still be parsed -+to extract the kernel command line and initrd path. No other section of -+the DT will be used. ++When booting using ACPI tables, the /chosen node in DT will still be parsed ++to extract the kernel command line and initrd path. No other section of the ++DT will be used. ++ + +Booting using ACPI tables +------------------------- -+ -+Currently, the only defined method to pass ACPI tables to the kernel on ARMv8 ++The only defined method for passing ACPI tables to the kernel on ARMv8 +is via the UEFI system configuration table. + -+The UEFI implementation MUST set the ACPI_20_TABLE_GUID to point to the -+RSDP table (the table with the ACPI signature "RSD PTR "). ++Processing of ACPI tables may be disabled by passing acpi=off on the kernel ++command line; this is the default behavior. If acpi=force is used, the kernel ++will ONLY use device configuration information contained in the ACPI tables. + -+The pointer to the RSDP table will be retrieved from EFI by the ACPI core. ++In order for the kernel to load and use ACPI tables, the UEFI implementation ++MUST set the ACPI_20_TABLE_GUID to point to the RSDP table (the table with ++the ACPI signature "RSD PTR "). If this pointer is incorrect and acpi=force ++is used, the kernel will disable ACPI and try to use DT to boot. + -+Processing of ACPI tables may be disabled by passing acpi=off on the kernel -+command line. ++If the pointer to the RSDP table is correct, the table will be mapped into ++the kernel by the ACPI core, using the address provided by UEFI. + -+DO use an XSDT; RSDTs are deprecated and should not be used on arm64. They -+only allow for 32-bit addresses. ++The ACPI core will then locate and map in all other ACPI tables provided by ++using the addresses in the RSDP table to find the XSDT (eXtended System ++Description Table). The XSDT in turn provides the addresses to all other ++ACPI tables provided by the system firmware; the ACPI core will then traverse ++this table and map in the tables listed. + -+DO NOT use the 32-bit address fields in the FADT; they are deprecated. The -+64-bit alternatives MUST be used. ++The ACPI core will ignore any provided RSDT (Root System Description Table). ++RSDTs have been deprecated and are ignored on arm64 since they only allow ++for 32-bit addresses. + -+The minimum set of tables MUST include RSDP, XSDT, FACS, FADT, DSDT, MADT -+and GTDT. If PCI is used the MCFG table MUST also be present. ++Further, the ACPI core will only use the 64-bit address fields in the FADT ++(Fixed ACPI Description Table). Any 32-bit address fields in the FADT will ++be ignored on arm64. + -+ACPI Detection -+-------------- ++Hardware reduced mode (see Section 4.1 of the ACPI 5.1 specification) will ++be enforced by the ACPI core on arm64. Doing so allows the ACPI core to ++run less complex code since it no longer has to provide support for legacy ++hardware from other architectures. + -+Drivers should determine their probe() type by checking for ACPI_HANDLE, -+or .of_node, or other information in the device structure. This is -+detailed further in the "Driver Recommendations" section. ++For the ACPI core to operate properly, and in turn provide the information ++the kernel needs to configure devices, it expects to find the following ++tables (all section numbers refer to the ACPI 5.1 specfication): + -+In non-driver code If the presence of ACPI needs to be detected at runtime, -+then check the value of acpi_disabled. If CONFIG_ACPI is not set, -+acpi_disabled will always be 1. ++ -- RSDP (Root System Description Pointer), section 5.2.5 + -+Device Enumeration -+------------------ ++ -- XSDT (eXtended System Description Table), section 5.2.8 + -+Device descriptions in ACPI should use standard recognized ACPI interfaces. -+These are far simpler than the information provided via Device Tree. Drivers -+should take into account this simplicity and work with sensible defaults. ++ -- FACS (Firmware ACPI Control Structure), section 5.2.10 ++ ++ -- FADT (Fixed ACPI Description Table), section 5.2.9 + -+On no account should a Device Tree attempt to be replicated in ASL using such -+constructs as Name(KEY0, "Value1") type constructs. Additional driver specific -+data should be represented with the appropriate _DSD (ACPI Section 6.2.5) -+structure. _DSM (ACPI Section 9.14.1) should only be used if _DSD cannot -+represent the data required. ++ -- DSDT (Differentiated System Description Table), section ++ 5.2.11.1 + -+This data should be rare and not OS specific. For x86 ACPI has taken to -+identifying itself as Windows because it was found that only one path was -+routinely tested. For ARMv8 it would be preferable to have only one well -+tested path. ++ -- MADT (Multiple APIC Description Table), section 5.2.12 + -+_DSD covers more than the generic server case and care should be taken not to -+replicate highly specific embedded behaviour from DT into generic servers. ++ -- GTDT (Generic Timer Description Table), section 5.2.24 + -+Common _DSD bindings should be submitted to ASWG to be included in the -+document :- ++ -- If PCI is supported, the MCFG (Memory mapped ConFiGuration ++ Table), section 5.2.6, specifically Table 5-31. + -+http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm ++If the above tables are not all present, the kernel may or may not be ++able to boot properly since it may not be able to configure all of the ++devices available. ++ ++ ++ACPI Detection ++-------------- ++Drivers should determine their probe() type by checking for a null ++value for ACPI_HANDLE, or checking .of_node, or other information in ++the device structure. This is detailed further in the "Driver ++Recommendations" section. ++ ++In non-driver code, if the presence of ACPI needs to be detected at ++runtime, then check the value of acpi_disabled. If CONFIG_ACPI is not ++set, acpi_disabled will always be 1. ++ ++ ++Device Enumeration ++------------------ ++Device descriptions in ACPI should use standard recognized ACPI interfaces. ++These can contain less information than is typically provided via a Device ++Tree description for the same device. This is also one of the reasons that ++ACPI can be useful -- the driver takes into account that it may have less ++detailed information about the device and uses sensible defaults instead. ++If done properly in the driver, the hardware can change and improve over ++time without the driver having to change at all. ++ ++Clocks provide an excellent example. In DT, clocks need to be specified ++and the drivers need to take them into account. In ACPI, the assumption ++is that UEFI will leave the device in a reasonable default state, including ++any clock settings. If for some reason the driver needs to change a clock ++value, this can be done in an ACPI method; all the driver needs to do is ++invoke the method and not concern itself with what the method needs to do ++to change the clock. Changing the hardware can then take place over time ++by changing what the ACPI method does, and not the driver. ++ ++ACPI drivers should only look at one specific ASL object -- the _DSD object ++-- for device driver parameters (known in DT as "bindings", or "Device ++Properties" in ACPI). Not all DT bindings will be recognized. The UEFI ++Forum provides a mechanism for registering such bindings [URL TBD by ASWG] ++so that they may be used on any operating system supporting ACPI. Device ++properties that have not been registered with the UEFI Forum should not be ++used. ++ ++Drivers should look for device properties in the _DSD object ONLY; the _DSD ++object is described in the ACPI specification section 6.2.5, but more ++specifically, use the _DSD Device Properties UUID: ++ ++ -- UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 ++ ++ -- http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf) ++ ++The kernel has an interface for looking up device properties in a manner ++independent of whether DT or ACPI is being used and that interface should ++be used; it can eliminate some duplication of code paths in driver probing ++functions and discourage divergence between DT bindings and ACPI device ++properties. ++ ++ACPI tables are described with a formal language called ASL, the ACPI ++Source Language (section 19 of the specification). This means that there ++are always multiple ways to describe the same thing -- including device ++properties. For example, device properties could use an ASL construct ++that looks like this: Name(KEY0, "value0"). An ACPI device driver would ++then retrieve the value of the property by evaluating the KEY0 object. ++However, using Name() this way has multiple problems: (1) ACPI limits ++names ("KEY0") to four characters unlike DT; (2) there is no industry ++wide registry that maintains a list of names, minimzing re-use; (3) ++there is also no registry for the definition of property values ("value0"), ++again making re-use difficult; and (4) how does one maintain backward ++compatibility as new hardware comes out? The _DSD method was created ++to solve precisely these sorts of problems; Linux drivers should ALWAYS ++use the _DSD method for device properties and nothing else. ++ ++The _DSM object (ACPI Section 9.14.1) could also be used for conveying ++device properties to a driver. Linux drivers should only expect it to ++be used if _DSD cannot represent the data required, and there is no way ++to create a new UUID for the _DSD object. Note that there is even less ++regulation of the use of _DSM than there is of _DSD. Drivers that depend ++on the contents of _DSM objects will be more difficult to maintain over ++time because of this. ++ ++The _DSD object is a very flexible mechanism in ACPI, as are the registered ++Device Properties. This flexibility allows _DSD to cover more than just the ++generic server case and care should be taken in device drivers not to expect ++it to replicate highly specific embedded behaviour from DT. ++ ++Both DT bindings and ACPI device properties for device drivers have review ++processes. Use them. And, before creating new device properties, check to ++be sure that they have not been defined before and either registered in the ++Linux kernel documentation or the UEFI Forum. If the device drivers supports ++ACPI and DT, please make sure the device properties are consistent in both ++places. + -+If these bindings are mirrored from DT care should be taken to ensure they are -+reviewed as DT bindings before submission to limit divergance in bindings. + +Programmable Power Control Resources +------------------------------------ -+ +Programmable power control resources include such resources as voltage/current +providers (regulators) and clock sources. + -+For power control of these resources they should be represented with Power -+Resource Objects (ACPI Section 7.1). The ACPI core will then handle correctly -+enabling/disabling of resources as they are needed. ++The kernel assumes that power control of these resources is represented with ++Power Resource Objects (ACPI section 7.1). The ACPI core will then handle ++correctly enabling and disabling resources as they are needed. In order to ++get that to work, ACPI assumes each device has defined D-states and that these ++can be controlled through the optional ACPI methods _PS0, _PS1, _PS2, and _PS3; ++in ACPI, _PS0 is the method to invoke to turn a device full on, and _PS3 is for ++turning a device full off. ++ ++The kernel ACPI code will also assume that the _PS? methods follow the normal ++ACPI rules for such methods: + -+The ACPI 5.1 specification does not contain any standard binding for these -+objects to enable programmable levels or rates so this should be avoided if -+possible and the resources set to appropriate levels by the firmware. If this is -+not possible then any manipulation should be abstracted in ASL. ++ -- If either _PS0 or _PS3 is implemented, then the other method must also ++ be implemented. + -+Each device in ACPI has D-states and these can be controlled through -+the optional methods _PS0..._PS3 where _PS0 is full on and _PS3 is full off. ++ -- If a device requires usage or setup of a power resource when on, the ASL ++ should organize that it is allocated/enabled using the _PS0 method. + -+If either _PS0 or _PS3 is implemented, then the other method must also be -+implemented. ++ -- Resources allocated or enabled in the _PS0 method should be disabled ++ or de-allocated in the _PS3 method. + -+If a device requires usage or setup of a power resource when on, the ASL -+should organize that it is allocated/enabled using the _PS0 method. ++ -- Firmware will leave the resources in a reasonable state before handing ++ over control to the kernel. + -+Resources allocated/enabled in the _PS0 method should be disabled/de-allocated -+in the _PS3 method. ++Such code in _PS? methods will of course be very platform specific. But, ++this allows the driver to abstract out the interface for operating the device ++and avoid having to read special non-standard values from ACPI tables. Further, ++abstracting the use of these resources allows the hardware to change over time ++without requiring updates to the driver. + -+Such code in _PS? methods will of course be very platform specific but -+should allow the driver to operate the device without special non-standard -+values being read from ASL. Further, abstracting the use of these resources -+allows hardware revisions without requiring updates to the kernel. + +Clocks +------ ++ACPI makes the assumption that clocks are initialized by the firmware -- ++UEFI, in this case -- to some working value before control is handed over ++to the kernel. This has implications for devices such as UARTs, or SoC ++driven LCD displays, for example. + -+Like clocks that are part of the power resources there is no standard way -+to represent a clock tree in ACPI 5.1 in a similar manner to how it is -+described in DT. -+ -+Devices affected by this include things like UARTs, SoC driven LCD displays, -+etc. ++When the kernel boots, the clock is assumed to be set to reasonable ++working value. If for some reason the frequency needs to change -- e.g., ++throttling for power management -- the device driver should expect that ++process to be abstracted out into some ACPI method that can be invoked ++(please see the ACPI specification for further recommendations on standard ++methods to be expected). If is not, there is no direct way for ACPI to ++control the clocks. + -+The firmware (for example, UEFI) should initialize these clocks to fixed working -+values before the kernel is executed. + +Driver Recommendations +---------------------- ++DO NOT remove any DT handling when adding ACPI support for a driver. The ++same device may be used on many different systems. + -+DO NOT remove any FDT handling when adding ACPI support for a driver. Different -+systems may use the same device. -+ -+DO try and keep complex sections of ACPI and DT functionality separate. This -+may mean a patch to break out some complex DT to another function before -+the patch to add ACPI. This may happen in other functions but is most likely -+in probe function. This gives a clearer flow of data for reviewing driver -+source. -+ -+probe() :- ++DO try to structure the driver so that it is data driven. That is, set up ++a struct containing internal per-device state based on defaults and whatever ++else must be discovered by the driver probe function. Then, have the rest ++of the driver operate off of the contents of that struct. Doing so should ++allow most divergence between ACPI and DT functionality to be kept local to ++the probe function instead of being scattered throughout the driver. For ++example: + +static int device_probe_dt(struct platform_device *pdev) +{ @@ -602,10 +2334,9 @@ index 0000000..b7dc826 + ... +} + -+DO keep the MODULE_DEVICE_TABLE entries together in the driver to make it clear -+the different names the driver is probed for, both from DT and from ACPI. -+ -+module device tables :- ++DO keep the MODULE_DEVICE_TABLE entries together in the driver to make it ++clear the different names the driver is probed for, both from DT and from ++ACPI: + +static struct of_device_id virtio_mmio_match[] = { + { .compatible = "virtio,mmio", }, @@ -619,90 +2350,64 @@ index 0000000..b7dc826 +}; +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match); + ++ +ASWG +---- -+ -+The following areas are not yet well defined for ARM in the current ACPI -+specification and are expected to be worked through in the UEFI ACPI -+Specification Working Group (ASWG) <http://www.uefi.org/workinggroups>. -+Participation in this group is open to all UEFI members. -+ -+ - ACPI based CPU topology -+ - ACPI based Power management -+ - CPU idle control based on PSCI -+ - CPU performance control (CPPC) -+ - ACPI based SMMU -+ - ITS support for GIC in MADT -+ -+No code shall be accepted into the kernel unless it complies with the released -+standards from UEFI ASWG. If there are features missing from ACPI to make it -+function on a platform, ECRs should be submitted to ASWG and go through the -+approval process. -diff --git a/Documentation/devicetree/bindings/pci/xgene-pci.txt b/Documentation/devicetree/bindings/pci/xgene-pci.txt -new file mode 100644 -index 0000000..1070b06 ---- /dev/null -+++ b/Documentation/devicetree/bindings/pci/xgene-pci.txt -@@ -0,0 +1,57 @@ -+* AppliedMicro X-Gene PCIe interface -+ -+Required properties: -+- device_type: set to "pci" -+- compatible: should contain "apm,xgene-pcie" to identify the core. -+- reg: A list of physical base address and length for each set of controller -+ registers. Must contain an entry for each entry in the reg-names -+ property. -+- reg-names: Must include the following entries: -+ "csr": controller configuration registers. -+ "cfg": pcie configuration space registers. -+- #address-cells: set to <3> -+- #size-cells: set to <2> -+- ranges: ranges for the outbound memory, I/O regions. -+- dma-ranges: ranges for the inbound memory regions. -+- #interrupt-cells: set to <1> -+- interrupt-map-mask and interrupt-map: standard PCI properties -+ to define the mapping of the PCIe interface to interrupt -+ numbers. -+- clocks: from common clock binding: handle to pci clock. -+ -+Optional properties: -+- status: Either "ok" or "disabled". -+- dma-coherent: Present if dma operations are coherent -+ -+Example: -+ -+SoC specific DT Entry: -+ -+ pcie0: pcie@1f2b0000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f2b0000 0x0 0x00010000 /* Controller registers */ -+ 0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */ -+ 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xc4 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xc5 0x1>; -+ dma-coherent; -+ clocks = <&pcie0clk 0>; -+ }; -+ -+ -+Board specific DT Entry: -+ &pcie0 { -+ status = "ok"; -+ }; ++The following areas are not yet fully defined for ARM in the 5.1 version ++of the ACPI specification and are expected to be worked through in the ++UEFI ACPI Specification Working Group (ASWG): ++ ++ -- ACPI based CPU topology ++ -- ACPI based Power management ++ -- CPU idle control based on PSCI ++ -- CPU performance control (CPPC) ++ -- ACPI based SMMU ++ -- ITS support for GIC in MADT ++ ++Participation in this group is open to all UEFI members. Please see ++http://www.uefi.org/workinggroup for details on group membership. ++ ++It is the intent of the ARMv8 ACPI kernel code to follow the ACPI specification ++as closely as possible, and to only implement functionality that complies with ++the released standards from UEFI ASWG. As a practical matter, there will be ++vendors that provide bad ACPI tables or violate the standards in some way. ++If this is because of errors, quirks and fixups may be necessary, but will ++be avoided if possible. If there are features missing from ACPI that preclude ++it from being used on a platform, ECRs (Engineering Change Requests) should be ++submitted to ASWG and go through the normal approval process; for those that ++are not UEFI members, many other members of the Linux community are and would ++likely be willing to assist in submitting ECRs. +diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt +index 6ce5441..859918d 100644 +--- a/Documentation/gpio/consumer.txt ++++ b/Documentation/gpio/consumer.txt +@@ -219,6 +219,24 @@ part of the IRQ interface, e.g. IRQF_TRIGGER_FALLING, as are system wakeup + capabilities. + + ++GPIOs and ACPI ++============== ++ ++On ACPI systems, GPIOs are described by GpioIo()/GpioInt() resources listed by ++the _CRS configuration objects of devices. Those resources do not provide ++connection IDs (names) for GPIOs, so it is necessary to use an additional ++mechanism for this purpose. ++ ++Systems compliant with ACPI 5.1 or newer may provide a _DSD configuration object ++which, among other things, may be used to provide connection IDs for specific ++GPIOs described by the GpioIo()/GpioInt() resources in _CRS. If that is the ++case, it will be handled by the GPIO subsystem automatically. However, if the ++_DSD is not present, the mappings between GpioIo()/GpioInt() resources and GPIO ++connection IDs need to be provided by device drivers. ++ ++For details refer to Documentation/acpi/gpio-properties.txt ++ ++ + Interacting With the Legacy GPIO Subsystem + ========================================== + Many kernel subsystems still handle GPIOs using the legacy integer-based diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 10d51c2..9464c6d 100644 +index 479f332..6187d9b 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -165,7 +165,7 @@ multipliers 'Kilo', 'Mega', and 'Giga', equalling 2^10, 2^20, and 2^30 @@ -710,7 +2415,7 @@ index 10d51c2..9464c6d 100644 - acpi= [HW,ACPI,X86] -+ acpi= [HW,ACPI,X86,ARM] ++ acpi= [HW,ACPI,X86,ARM64] Advanced Configuration and Power Interface Format: { force | off | strict | noirq | rsdt } force -- enable ACPI if default was off @@ -718,255 +2423,242 @@ index 10d51c2..9464c6d 100644 strictly ACPI specification compliant. rsdt -- prefer RSDT over (default) XSDT copy_dsdt -- copy DSDT to memory -+ For ARM64, ONLY "acpi=off" is available. ++ For ARM64, ONLY "acpi=off" or "acpi=force" are available See also Documentation/power/runtime_pm.txt, pci=noacpi -diff --git a/MAINTAINERS b/MAINTAINERS -index f10ed39..a8c9b14 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -6946,6 +6946,14 @@ L: linux-pci@vger.kernel.org - S: Maintained - F: drivers/pci/host/*spear* - -+PCI DRIVER FOR APPLIEDMICRO XGENE -+M: Tanmay Inamdar <tinamdar@apm.com> -+L: linux-pci@vger.kernel.org -+L: linux-arm-kernel@lists.infradead.org -+S: Maintained -+F: Documentation/devicetree/bindings/pci/xgene-pci.txt -+F: drivers/pci/host/pci-xgene.c -+ - PCMCIA SUBSYSTEM - P: Linux PCMCIA Team - L: linux-pcmcia@lists.infradead.org -diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h -index 3d23418..1805674 100644 ---- a/arch/arm/include/asm/io.h -+++ b/arch/arm/include/asm/io.h -@@ -178,6 +178,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr) - - /* PCI fixed i/o mapping */ - #define PCI_IO_VIRT_BASE 0xfee00000 -+#define PCI_IOBASE ((void __iomem *)PCI_IO_VIRT_BASE) - - #if defined(CONFIG_PCI) - void pci_ioremap_set_mem_type(int mem_type); diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h -index 5cc0b0f..03a08bb 100644 +index acb0d57..f867060 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h -@@ -21,6 +21,7 @@ - - #include <asm/memory.h> - #include <asm/page.h> -+#include <asm/kvm_arm.h> - - /* - * We directly use the kernel VA for the HYP, as we can directly share -@@ -178,6 +179,18 @@ static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, - - void stage2_flush_vm(struct kvm *kvm); - -+static inline int kvm_get_phys_addr_shift(void) -+{ -+ return KVM_PHYS_SHIFT; -+} -+ -+ -+static inline u32 get_vttbr_baddr_mask(void) -+{ -+ return VTTBR_BADDR_MASK; -+} -+ -+ - #endif /* !__ASSEMBLY__ */ - - #endif /* __ARM_KVM_MMU_H__ */ -diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c -index a99e0cd..d0fca8f 100644 ---- a/arch/arm/kvm/arm.c -+++ b/arch/arm/kvm/arm.c -@@ -37,6 +37,7 @@ - #include <asm/mman.h> - #include <asm/tlbflush.h> - #include <asm/cacheflush.h> -+#include <asm/cputype.h> - #include <asm/virt.h> - #include <asm/kvm_arm.h> - #include <asm/kvm_asm.h> -@@ -61,6 +62,12 @@ static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1); - static u8 kvm_next_vmid; - static DEFINE_SPINLOCK(kvm_vmid_lock); +@@ -161,9 +161,10 @@ static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) + } -+#ifdef CONFIG_ARM64 -+static u64 vttbr_baddr_mask; -+#else -+static u32 vttbr_baddr_mask; -+#endif -+ - static bool vgic_present; + static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, +- unsigned long size) ++ unsigned long size, ++ bool ipa_uncached) + { +- if (!vcpu_has_cache_enabled(vcpu)) ++ if (!vcpu_has_cache_enabled(vcpu) || ipa_uncached) + kvm_flush_dcache_to_poc((void *)hva, size); + + /* +diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c +index 8664ff1..8fa2060 100644 +--- a/arch/arm/kvm/mmu.c ++++ b/arch/arm/kvm/mmu.c +@@ -853,6 +853,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, + struct vm_area_struct *vma; + pfn_t pfn; + pgprot_t mem_type = PAGE_S2; ++ bool fault_ipa_uncached; + + write_fault = kvm_is_write_fault(vcpu); + if (fault_status == FSC_PERM && !write_fault) { +@@ -919,6 +920,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, + if (!hugetlb && !force_pte) + hugetlb = transparent_hugepage_adjust(&pfn, &fault_ipa); + ++ fault_ipa_uncached = memslot->flags & KVM_MEMSLOT_INCOHERENT; ++ + if (hugetlb) { + pmd_t new_pmd = pfn_pmd(pfn, mem_type); + new_pmd = pmd_mkhuge(new_pmd); +@@ -926,7 +929,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, + kvm_set_s2pmd_writable(&new_pmd); + kvm_set_pfn_dirty(pfn); + } +- coherent_cache_guest_page(vcpu, hva & PMD_MASK, PMD_SIZE); ++ coherent_cache_guest_page(vcpu, hva & PMD_MASK, PMD_SIZE, ++ fault_ipa_uncached); + ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd); + } else { + pte_t new_pte = pfn_pte(pfn, mem_type); +@@ -934,7 +938,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, + kvm_set_s2pte_writable(&new_pte); + kvm_set_pfn_dirty(pfn); + } +- coherent_cache_guest_page(vcpu, hva, PAGE_SIZE); ++ coherent_cache_guest_page(vcpu, hva, PAGE_SIZE, ++ fault_ipa_uncached); + ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, + pgprot_val(mem_type) == pgprot_val(PAGE_S2_DEVICE)); + } +@@ -1245,6 +1250,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, + (KVM_PHYS_SIZE >> PAGE_SHIFT)) + return -EFAULT; - static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) -@@ -429,8 +436,14 @@ static void update_vttbr(struct kvm *kvm) - /* update vttbr to be used with the new vmid */ - pgd_phys = virt_to_phys(kvm->arch.pgd); - vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK; -- kvm->arch.vttbr = pgd_phys & VTTBR_BADDR_MASK; -- kvm->arch.vttbr |= vmid; ++ spin_lock(&kvm->mmu_lock); ++ stage2_flush_memslot(kvm, memslot); ++ spin_unlock(&kvm->mmu_lock); + + /* + * A memory region could potentially cover multiple VMAs, and any holes + * between them, so iterate over all of them to find out if we can map +@@ -1310,6 +1319,15 @@ void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free, + int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot, + unsigned long npages) + { + /* -+ * If the VTTBR isn't aligned there is something wrong with the system -+ * or kernel. ++ * Readonly memslots are not incoherent with the caches by definition, ++ * but in practice, they are used mostly to emulate ROMs or NOR flashes ++ * that the guest may consider devices and hence map as uncached. ++ * To prevent incoherency issues in these cases, tag all readonly ++ * regions as incoherent. + */ -+ BUG_ON(pgd_phys & ~vttbr_baddr_mask); -+ -+ kvm->arch.vttbr = pgd_phys | vmid; - - spin_unlock(&kvm_vmid_lock); ++ if (slot->flags & KVM_MEM_READONLY) ++ slot->flags |= KVM_MEMSLOT_INCOHERENT; + return 0; } -@@ -1015,6 +1028,12 @@ int kvm_arch_init(void *opaque) - } + +diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c +index b4d14b8..9c8b127 100644 +--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c ++++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c +@@ -41,7 +41,7 @@ static void h1940bt_enable(int on) + mdelay(10); + gpio_set_value(S3C2410_GPH(1), 0); + +- h1940_led_blink_set(-EINVAL, GPIO_LED_BLINK, NULL, NULL); ++ h1940_led_blink_set(NULL, GPIO_LED_BLINK, NULL, NULL); + } + else { + gpio_set_value(S3C2410_GPH(1), 1); +@@ -50,7 +50,7 @@ static void h1940bt_enable(int on) + mdelay(10); + gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0); + +- h1940_led_blink_set(-EINVAL, GPIO_LED_NO_BLINK_LOW, NULL, NULL); ++ h1940_led_blink_set(NULL, GPIO_LED_NO_BLINK_LOW, NULL, NULL); } + } -+ vttbr_baddr_mask = get_vttbr_baddr_mask(); -+ if (vttbr_baddr_mask == ~0) { -+ kvm_err("Cannot set vttbr_baddr_mask\n"); -+ return -EINVAL; -+ } +diff --git a/arch/arm/mach-s3c24xx/h1940.h b/arch/arm/mach-s3c24xx/h1940.h +index 2950cc4..596d9f6 100644 +--- a/arch/arm/mach-s3c24xx/h1940.h ++++ b/arch/arm/mach-s3c24xx/h1940.h +@@ -19,8 +19,10 @@ + #define H1940_SUSPEND_RESUMEAT (0x30081000) + #define H1940_SUSPEND_CHECK (0x30080000) + ++struct gpio_desc; + - cpu_notifier_register_begin(); + extern void h1940_pm_return(void); +-extern int h1940_led_blink_set(unsigned gpio, int state, ++extern int h1940_led_blink_set(struct gpio_desc *desc, int state, + unsigned long *delay_on, + unsigned long *delay_off); - err = init_hyp_mode(); -diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c -index 05e1f73..c186a17 100644 ---- a/arch/arm/mach-integrator/pci_v3.c -+++ b/arch/arm/mach-integrator/pci_v3.c -@@ -660,6 +660,7 @@ static void __init pci_v3_preinit(void) - { - unsigned long flags; - unsigned int temp; -+ phys_addr_t io_address = pci_pio_to_address(io_mem.start); +diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c +index d35ddc1..d40d4f5 100644 +--- a/arch/arm/mach-s3c24xx/mach-h1940.c ++++ b/arch/arm/mach-s3c24xx/mach-h1940.c +@@ -359,10 +359,11 @@ static struct platform_device h1940_battery = { - pcibios_min_mem = 0x00100000; + static DEFINE_SPINLOCK(h1940_blink_spin); -@@ -701,7 +702,7 @@ static void __init pci_v3_preinit(void) - /* - * Setup window 2 - PCI IO - */ -- v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_mem.start) | -+ v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_address) | - V3_LB_BASE_ENABLE); - v3_writew(V3_LB_MAP2, v3_addr_to_lb_map2(0)); - -@@ -742,6 +743,7 @@ static void __init pci_v3_preinit(void) - static void __init pci_v3_postinit(void) +-int h1940_led_blink_set(unsigned gpio, int state, ++int h1940_led_blink_set(struct gpio_desc *desc, int state, + unsigned long *delay_on, unsigned long *delay_off) + { + int blink_gpio, check_gpio1, check_gpio2; ++ int gpio = desc ? desc_to_gpio(desc) : -EINVAL; + + switch (gpio) { + case H1940_LATCH_LED_GREEN: +diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c +index c3f2682..1d35ff3 100644 +--- a/arch/arm/mach-s3c24xx/mach-rx1950.c ++++ b/arch/arm/mach-s3c24xx/mach-rx1950.c +@@ -250,9 +250,10 @@ static void rx1950_disable_charger(void) + + static DEFINE_SPINLOCK(rx1950_blink_spin); + +-static int rx1950_led_blink_set(unsigned gpio, int state, ++static int rx1950_led_blink_set(struct gpio_desc *desc, int state, + unsigned long *delay_on, unsigned long *delay_off) { - unsigned int pci_cmd; -+ phys_addr_t io_address = pci_pio_to_address(io_mem.start); ++ int gpio = desc_to_gpio(desc); + int blink_gpio, check_gpio; - pci_cmd = PCI_COMMAND_MEMORY | - PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE; -@@ -758,7 +760,7 @@ static void __init pci_v3_postinit(void) - "interrupt: %d\n", ret); - #endif + switch (gpio) { +diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c +index e048f61..e53fc8d 100644 +--- a/arch/arm/plat-orion/gpio.c ++++ b/arch/arm/plat-orion/gpio.c +@@ -306,9 +306,10 @@ EXPORT_SYMBOL(orion_gpio_set_blink); -- register_isa_ports(non_mem.start, io_mem.start, 0); -+ register_isa_ports(non_mem.start, io_address, 0); - } + #define ORION_BLINK_HALF_PERIOD 100 /* ms */ +-int orion_gpio_led_blink_set(unsigned gpio, int state, ++int orion_gpio_led_blink_set(struct gpio_desc *desc, int state, + unsigned long *delay_on, unsigned long *delay_off) + { ++ unsigned gpio = desc_to_gpio(desc); + + if (delay_on && delay_off && !*delay_on && !*delay_off) + *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; +diff --git a/arch/arm/plat-orion/include/plat/orion-gpio.h b/arch/arm/plat-orion/include/plat/orion-gpio.h +index e763988..e856b07 100644 +--- a/arch/arm/plat-orion/include/plat/orion-gpio.h ++++ b/arch/arm/plat-orion/include/plat/orion-gpio.h +@@ -14,12 +14,15 @@ + #include <linux/init.h> + #include <linux/types.h> + #include <linux/irqdomain.h> ++ ++struct gpio_desc; ++ /* -@@ -867,33 +869,32 @@ static int __init pci_v3_probe(struct platform_device *pdev) - - for_each_of_pci_range(&parser, &range) { - if (!range.flags) { -- of_pci_range_to_resource(&range, np, &conf_mem); -+ ret = of_pci_range_to_resource(&range, np, &conf_mem); - conf_mem.name = "PCIv3 config"; - } - if (range.flags & IORESOURCE_IO) { -- of_pci_range_to_resource(&range, np, &io_mem); -+ ret = of_pci_range_to_resource(&range, np, &io_mem); - io_mem.name = "PCIv3 I/O"; - } - if ((range.flags & IORESOURCE_MEM) && - !(range.flags & IORESOURCE_PREFETCH)) { - non_mem_pci = range.pci_addr; - non_mem_pci_sz = range.size; -- of_pci_range_to_resource(&range, np, &non_mem); -+ ret = of_pci_range_to_resource(&range, np, &non_mem); - non_mem.name = "PCIv3 non-prefetched mem"; - } - if ((range.flags & IORESOURCE_MEM) && - (range.flags & IORESOURCE_PREFETCH)) { - pre_mem_pci = range.pci_addr; - pre_mem_pci_sz = range.size; -- of_pci_range_to_resource(&range, np, &pre_mem); -+ ret = of_pci_range_to_resource(&range, np, &pre_mem); - pre_mem.name = "PCIv3 prefetched mem"; - } -- } - -- if (!conf_mem.start || !io_mem.start || -- !non_mem.start || !pre_mem.start) { -- dev_err(&pdev->dev, "missing ranges in device node\n"); -- return -EINVAL; -+ if (ret < 0) { -+ dev_err(&pdev->dev, "missing ranges in device node\n"); -+ return ret; -+ } - } + * Orion-specific GPIO API extensions. + */ + void orion_gpio_set_unused(unsigned pin); + void orion_gpio_set_blink(unsigned pin, int blink); +-int orion_gpio_led_blink_set(unsigned gpio, int state, ++int orion_gpio_led_blink_set(struct gpio_desc *desc, int state, + unsigned long *delay_on, unsigned long *delay_off); - pci_v3.map_irq = of_irq_parse_and_map_pci; + #define GPIO_INPUT_OK (1 << 0) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index fd4e81a..e57b91a 100644 +index 9532f8d..80a82ac 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -1,5 +1,6 @@ - config ARM64 - def_bool y -+ select ACPI_REDUCED_HARDWARE_ONLY if ACPI +@@ -4,6 +4,7 @@ config ARM64 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_SG_CHAIN select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST -@@ -81,7 +82,7 @@ config MMU - def_bool y - - config NO_IOPORT_MAP -- def_bool y -+ def_bool y if !PCI - - config STACKTRACE_SUPPORT - def_bool y -@@ -156,6 +157,26 @@ menu "Bus support" - config ARM_AMBA - bool - -+config PCI -+ bool "PCI support" -+ help -+ This feature enables support for PCI bus system. If you say Y -+ here, the kernel will include drivers and infrastructure code -+ to support PCI bus devices. -+ -+config PCI_DOMAINS -+ def_bool PCI -+ -+config PCI_DOMAINS_GENERIC -+ def_bool PCI -+ -+config PCI_SYSCALL -+ def_bool PCI -+ -+source "drivers/pci/Kconfig" -+source "drivers/pci/pcie/Kconfig" -+source "drivers/pci/hotplug/Kconfig" -+ - endmenu - - menu "Kernel Features" -@@ -235,6 +256,9 @@ config SMP ++ select ACPI_REDUCED_HARDWARE_ONLY if ACPI + select ARCH_USE_CMPXCHG_LOCKREF + select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_WANT_OPTIONAL_GPIOLIB +@@ -34,6 +35,7 @@ config ARM64 + select GENERIC_TIME_VSYSCALL + select HANDLE_DOMAIN_IRQ + select HARDIRQS_SW_RESEND ++ select HAVE_ALIGNED_STRUCT_PAGE if SLUB + select HAVE_ARCH_AUDITSYSCALL + select HAVE_ARCH_JUMP_LABEL + select HAVE_ARCH_KGDB +@@ -41,6 +43,7 @@ config ARM64 + select HAVE_BPF_JIT + select HAVE_C_RECORDMCOUNT + select HAVE_CC_STACKPROTECTOR ++ select HAVE_CMPXCHG_DOUBLE + select HAVE_DEBUG_BUGVERBOSE + select HAVE_DEBUG_KMEMLEAK + select HAVE_DMA_API_DEBUG +@@ -185,6 +188,9 @@ config PCI_DOMAINS_GENERIC + config PCI_SYSCALL + def_bool PCI + ++config PCI_MMCONFIG ++ def_bool y if PCI && ACPI ++ + source "drivers/pci/Kconfig" + source "drivers/pci/pcie/Kconfig" + source "drivers/pci/hotplug/Kconfig" +@@ -268,6 +274,9 @@ config SMP If you don't know what to do here, say N. @@ -976,7 +2668,25 @@ index fd4e81a..e57b91a 100644 config SCHED_MC bool "Multi-core scheduler support" depends on SMP -@@ -421,6 +445,8 @@ source "drivers/Kconfig" +@@ -401,6 +410,17 @@ config EFI + allow the kernel to be booted as an EFI application. This + is only useful on systems that have UEFI firmware. + ++config DMI ++ bool "Enable support for SMBIOS (DMI) tables" ++ depends on EFI ++ default y ++ help ++ This enables SMBIOS/DMI feature for systems. ++ ++ This option is only useful on systems that have UEFI firmware. ++ However, even with this option, the resultant kernel should ++ continue to boot on existing non-UEFI platforms. ++ + endmenu + + menu "Userspace binary formats" +@@ -454,6 +474,8 @@ source "drivers/Kconfig" source "drivers/firmware/Kconfig" @@ -986,10 +2696,10 @@ index fd4e81a..e57b91a 100644 source "arch/arm64/kvm/Kconfig" diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile -index 2df5e5d..bddd4e3 100644 +index 20901ff..983d72a 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile -@@ -50,6 +50,7 @@ core-y += arch/arm64/kernel/ arch/arm64/mm/ +@@ -49,6 +49,7 @@ core-$(CONFIG_NET) += arch/arm64/net/ core-$(CONFIG_KVM) += arch/arm64/kvm/ core-$(CONFIG_XEN) += arch/arm64/xen/ core-$(CONFIG_CRYPTO) += arch/arm64/crypto/ @@ -997,213 +2707,271 @@ index 2df5e5d..bddd4e3 100644 libs-y := arch/arm64/lib/ $(libs-y) libs-y += $(LIBGCC) libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/ -diff --git a/arch/arm64/boot/dts/apm-mustang.dts b/arch/arm64/boot/dts/apm-mustang.dts -index b2f5622..f649000 100644 ---- a/arch/arm64/boot/dts/apm-mustang.dts -+++ b/arch/arm64/boot/dts/apm-mustang.dts -@@ -25,6 +25,14 @@ - }; - }; +diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig +index 5562652..a38b02c 100644 +--- a/arch/arm64/crypto/Kconfig ++++ b/arch/arm64/crypto/Kconfig +@@ -27,20 +27,19 @@ config CRYPTO_AES_ARM64_CE + tristate "AES core cipher using ARMv8 Crypto Extensions" + depends on ARM64 && KERNEL_MODE_NEON + select CRYPTO_ALGAPI +- select CRYPTO_AES + + config CRYPTO_AES_ARM64_CE_CCM + tristate "AES in CCM mode using ARMv8 Crypto Extensions" + depends on ARM64 && KERNEL_MODE_NEON + select CRYPTO_ALGAPI +- select CRYPTO_AES ++ select CRYPTO_AES_ARM64_CE + select CRYPTO_AEAD + + config CRYPTO_AES_ARM64_CE_BLK + tristate "AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions" + depends on ARM64 && KERNEL_MODE_NEON + select CRYPTO_BLKCIPHER +- select CRYPTO_AES ++ select CRYPTO_AES_ARM64_CE + select CRYPTO_ABLK_HELPER + + config CRYPTO_AES_ARM64_NEON_BLK +diff --git a/arch/arm64/crypto/aes-ce-ccm-glue.c b/arch/arm64/crypto/aes-ce-ccm-glue.c +index 9e6cdde..0ac73b8 100644 +--- a/arch/arm64/crypto/aes-ce-ccm-glue.c ++++ b/arch/arm64/crypto/aes-ce-ccm-glue.c +@@ -16,6 +16,8 @@ + #include <linux/crypto.h> + #include <linux/module.h> -+&pcie0clk { -+ status = "ok"; -+}; ++#include "aes-ce-setkey.h" + -+&pcie0 { -+ status = "ok"; -+}; + static int num_rounds(struct crypto_aes_ctx *ctx) + { + /* +@@ -48,7 +50,7 @@ static int ccm_setkey(struct crypto_aead *tfm, const u8 *in_key, + struct crypto_aes_ctx *ctx = crypto_aead_ctx(tfm); + int ret; + +- ret = crypto_aes_expand_key(ctx, in_key, key_len); ++ ret = ce_aes_expandkey(ctx, in_key, key_len); + if (!ret) + return 0; + +diff --git a/arch/arm64/crypto/aes-ce-cipher.c b/arch/arm64/crypto/aes-ce-cipher.c +index 2075e1a..ce47792 100644 +--- a/arch/arm64/crypto/aes-ce-cipher.c ++++ b/arch/arm64/crypto/aes-ce-cipher.c +@@ -14,6 +14,8 @@ + #include <linux/crypto.h> + #include <linux/module.h> + ++#include "aes-ce-setkey.h" + - &serial0 { - status = "ok"; - }; -diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi -index c0aceef..403197a 100644 ---- a/arch/arm64/boot/dts/apm-storm.dtsi -+++ b/arch/arm64/boot/dts/apm-storm.dtsi -@@ -269,6 +269,171 @@ - enable-mask = <0x2>; - clock-output-names = "rtcclk"; - }; -+ -+ pcie0clk: pcie0clk@1f2bc000 { -+ status = "disabled"; -+ compatible = "apm,xgene-device-clock"; -+ #clock-cells = <1>; -+ clocks = <&socplldiv2 0>; -+ reg = <0x0 0x1f2bc000 0x0 0x1000>; -+ reg-names = "csr-reg"; -+ clock-output-names = "pcie0clk"; -+ }; -+ -+ pcie1clk: pcie1clk@1f2cc000 { -+ status = "disabled"; -+ compatible = "apm,xgene-device-clock"; -+ #clock-cells = <1>; -+ clocks = <&socplldiv2 0>; -+ reg = <0x0 0x1f2cc000 0x0 0x1000>; -+ reg-names = "csr-reg"; -+ clock-output-names = "pcie1clk"; -+ }; -+ -+ pcie2clk: pcie2clk@1f2dc000 { -+ status = "disabled"; -+ compatible = "apm,xgene-device-clock"; -+ #clock-cells = <1>; -+ clocks = <&socplldiv2 0>; -+ reg = <0x0 0x1f2dc000 0x0 0x1000>; -+ reg-names = "csr-reg"; -+ clock-output-names = "pcie2clk"; -+ }; -+ -+ pcie3clk: pcie3clk@1f50c000 { -+ status = "disabled"; -+ compatible = "apm,xgene-device-clock"; -+ #clock-cells = <1>; -+ clocks = <&socplldiv2 0>; -+ reg = <0x0 0x1f50c000 0x0 0x1000>; -+ reg-names = "csr-reg"; -+ clock-output-names = "pcie3clk"; -+ }; -+ -+ pcie4clk: pcie4clk@1f51c000 { -+ status = "disabled"; -+ compatible = "apm,xgene-device-clock"; -+ #clock-cells = <1>; -+ clocks = <&socplldiv2 0>; -+ reg = <0x0 0x1f51c000 0x0 0x1000>; -+ reg-names = "csr-reg"; -+ clock-output-names = "pcie4clk"; -+ }; -+ }; -+ -+ pcie0: pcie@1f2b0000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f2b0000 0x0 0x00010000 /* Controller registers */ -+ 0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */ -+ 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xc4 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xc5 0x1>; -+ dma-coherent; -+ clocks = <&pcie0clk 0>; -+ }; -+ -+ pcie1: pcie@1f2c0000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f2c0000 0x0 0x00010000 /* Controller registers */ -+ 0xd0 0xd0000000 0x0 0x00040000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x0 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */ -+ 0x02000000 0x0 0x80000000 0xd1 0x80000000 0x00 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc8 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xc9 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xca 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xcb 0x1>; -+ dma-coherent; -+ clocks = <&pcie1clk 0>; -+ }; -+ -+ pcie2: pcie@1f2d0000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f2d0000 0x0 0x00010000 /* Controller registers */ -+ 0x90 0xd0000000 0x0 0x00040000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x0 0x00000000 0x90 0x10000000 0x0 0x00010000 /* io */ -+ 0x02000000 0x0 0x80000000 0x91 0x80000000 0x0 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xce 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xcf 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xd0 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xd1 0x1>; -+ dma-coherent; -+ clocks = <&pcie2clk 0>; -+ }; -+ -+ pcie3: pcie@1f500000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f500000 0x0 0x00010000 /* Controller registers */ -+ 0xa0 0xd0000000 0x0 0x00040000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x0 0x00000000 0xa0 0x10000000 0x0 0x00010000 /* io */ -+ 0x02000000 0x0 0x80000000 0xa1 0x80000000 0x0 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xd4 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xd5 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xd6 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xd7 0x1>; -+ dma-coherent; -+ clocks = <&pcie3clk 0>; -+ }; -+ -+ pcie4: pcie@1f510000 { -+ status = "disabled"; -+ device_type = "pci"; -+ compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; -+ #interrupt-cells = <1>; -+ #size-cells = <2>; -+ #address-cells = <3>; -+ reg = < 0x00 0x1f510000 0x0 0x00010000 /* Controller registers */ -+ 0xc0 0xd0000000 0x0 0x00200000>; /* PCI config space */ -+ reg-names = "csr", "cfg"; -+ ranges = <0x01000000 0x0 0x00000000 0xc0 0x10000000 0x0 0x00010000 /* io */ -+ 0x02000000 0x0 0x80000000 0xc1 0x80000000 0x0 0x80000000>; /* mem */ -+ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 -+ 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; -+ interrupt-map-mask = <0x0 0x0 0x0 0x7>; -+ interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xda 0x1 -+ 0x0 0x0 0x0 0x2 &gic 0x0 0xdb 0x1 -+ 0x0 0x0 0x0 0x3 &gic 0x0 0xdc 0x1 -+ 0x0 0x0 0x0 0x4 &gic 0x0 0xdd 0x1>; -+ dma-coherent; -+ clocks = <&pcie4clk 0>; - }; - - serial0: serial@1c020000 { -diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild -index 0b3fcf8..07cb417 100644 ---- a/arch/arm64/include/asm/Kbuild -+++ b/arch/arm64/include/asm/Kbuild -@@ -29,6 +29,7 @@ generic-y += mman.h - generic-y += msgbuf.h - generic-y += mutex.h - generic-y += pci.h -+generic-y += pci-bridge.h - generic-y += poll.h - generic-y += preempt.h - generic-y += resource.h + MODULE_DESCRIPTION("Synchronous AES cipher using ARMv8 Crypto Extensions"); + MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>"); + MODULE_LICENSE("GPL v2"); +@@ -124,6 +126,114 @@ static void aes_cipher_decrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[]) + kernel_neon_end(); + } + ++/* ++ * aes_sub() - use the aese instruction to perform the AES sbox substitution ++ * on each byte in 'input' ++ */ ++static u32 aes_sub(u32 input) ++{ ++ u32 ret; ++ ++ __asm__("dup v1.4s, %w[in] ;" ++ "movi v0.16b, #0 ;" ++ "aese v0.16b, v1.16b ;" ++ "umov %w[out], v0.4s[0] ;" ++ ++ : [out] "=r"(ret) ++ : [in] "r"(input) ++ : "v0","v1"); ++ ++ return ret; ++} ++ ++int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, ++ unsigned int key_len) ++{ ++ /* ++ * The AES key schedule round constants ++ */ ++ static u8 const rcon[] = { ++ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, ++ }; ++ ++ u32 kwords = key_len / sizeof(u32); ++ struct aes_block *key_enc, *key_dec; ++ int i, j; ++ ++ if (key_len != AES_KEYSIZE_128 && ++ key_len != AES_KEYSIZE_192 && ++ key_len != AES_KEYSIZE_256) ++ return -EINVAL; ++ ++ memcpy(ctx->key_enc, in_key, key_len); ++ ctx->key_length = key_len; ++ ++ kernel_neon_begin_partial(2); ++ for (i = 0; i < sizeof(rcon); i++) { ++ u32 *rki = ctx->key_enc + (i * kwords); ++ u32 *rko = rki + kwords; ++ ++ rko[0] = ror32(aes_sub(rki[kwords - 1]), 8) ^ rcon[i] ^ rki[0]; ++ rko[1] = rko[0] ^ rki[1]; ++ rko[2] = rko[1] ^ rki[2]; ++ rko[3] = rko[2] ^ rki[3]; ++ ++ if (key_len == AES_KEYSIZE_192) { ++ if (i >= 7) ++ break; ++ rko[4] = rko[3] ^ rki[4]; ++ rko[5] = rko[4] ^ rki[5]; ++ } else if (key_len == AES_KEYSIZE_256) { ++ if (i >= 6) ++ break; ++ rko[4] = aes_sub(rko[3]) ^ rki[4]; ++ rko[5] = rko[4] ^ rki[5]; ++ rko[6] = rko[5] ^ rki[6]; ++ rko[7] = rko[6] ^ rki[7]; ++ } ++ } ++ ++ /* ++ * Generate the decryption keys for the Equivalent Inverse Cipher. ++ * This involves reversing the order of the round keys, and applying ++ * the Inverse Mix Columns transformation on all but the first and ++ * the last one. ++ */ ++ key_enc = (struct aes_block *)ctx->key_enc; ++ key_dec = (struct aes_block *)ctx->key_dec; ++ j = num_rounds(ctx); ++ ++ key_dec[0] = key_enc[j]; ++ for (i = 1, j--; j > 0; i++, j--) ++ __asm__("ld1 {v0.16b}, %[in] ;" ++ "aesimc v1.16b, v0.16b ;" ++ "st1 {v1.16b}, %[out] ;" ++ ++ : [out] "=Q"(key_dec[i]) ++ : [in] "Q"(key_enc[j]) ++ : "v0","v1"); ++ key_dec[i] = key_enc[0]; ++ ++ kernel_neon_end(); ++ return 0; ++} ++EXPORT_SYMBOL(ce_aes_expandkey); ++ ++int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, ++ unsigned int key_len) ++{ ++ struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); ++ int ret; ++ ++ ret = ce_aes_expandkey(ctx, in_key, key_len); ++ if (!ret) ++ return 0; ++ ++ tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; ++ return -EINVAL; ++} ++EXPORT_SYMBOL(ce_aes_setkey); ++ + static struct crypto_alg aes_alg = { + .cra_name = "aes", + .cra_driver_name = "aes-ce", +@@ -135,7 +245,7 @@ static struct crypto_alg aes_alg = { + .cra_cipher = { + .cia_min_keysize = AES_MIN_KEY_SIZE, + .cia_max_keysize = AES_MAX_KEY_SIZE, +- .cia_setkey = crypto_aes_set_key, ++ .cia_setkey = ce_aes_setkey, + .cia_encrypt = aes_cipher_encrypt, + .cia_decrypt = aes_cipher_decrypt + } +diff --git a/arch/arm64/crypto/aes-ce-setkey.h b/arch/arm64/crypto/aes-ce-setkey.h +new file mode 100644 +index 0000000..f08a647 +--- /dev/null ++++ b/arch/arm64/crypto/aes-ce-setkey.h +@@ -0,0 +1,5 @@ ++ ++int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, ++ unsigned int key_len); ++int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, ++ unsigned int key_len); +diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glue.c +index 79cd911..801aae3 100644 +--- a/arch/arm64/crypto/aes-glue.c ++++ b/arch/arm64/crypto/aes-glue.c +@@ -16,9 +16,13 @@ + #include <linux/module.h> + #include <linux/cpufeature.h> + ++#include "aes-ce-setkey.h" ++ + #ifdef USE_V8_CRYPTO_EXTENSIONS + #define MODE "ce" + #define PRIO 300 ++#define aes_setkey ce_aes_setkey ++#define aes_expandkey ce_aes_expandkey + #define aes_ecb_encrypt ce_aes_ecb_encrypt + #define aes_ecb_decrypt ce_aes_ecb_decrypt + #define aes_cbc_encrypt ce_aes_cbc_encrypt +@@ -30,6 +34,8 @@ MODULE_DESCRIPTION("AES-ECB/CBC/CTR/XTS using ARMv8 Crypto Extensions"); + #else + #define MODE "neon" + #define PRIO 200 ++#define aes_setkey crypto_aes_set_key ++#define aes_expandkey crypto_aes_expand_key + #define aes_ecb_encrypt neon_aes_ecb_encrypt + #define aes_ecb_decrypt neon_aes_ecb_decrypt + #define aes_cbc_encrypt neon_aes_cbc_encrypt +@@ -79,10 +85,10 @@ static int xts_set_key(struct crypto_tfm *tfm, const u8 *in_key, + struct crypto_aes_xts_ctx *ctx = crypto_tfm_ctx(tfm); + int ret; + +- ret = crypto_aes_expand_key(&ctx->key1, in_key, key_len / 2); ++ ret = aes_expandkey(&ctx->key1, in_key, key_len / 2); + if (!ret) +- ret = crypto_aes_expand_key(&ctx->key2, &in_key[key_len / 2], +- key_len / 2); ++ ret = aes_expandkey(&ctx->key2, &in_key[key_len / 2], ++ key_len / 2); + if (!ret) + return 0; + +@@ -288,7 +294,7 @@ static struct crypto_alg aes_algs[] = { { + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, +- .setkey = crypto_aes_set_key, ++ .setkey = aes_setkey, + .encrypt = ecb_encrypt, + .decrypt = ecb_decrypt, + }, +@@ -306,7 +312,7 @@ static struct crypto_alg aes_algs[] = { { + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, +- .setkey = crypto_aes_set_key, ++ .setkey = aes_setkey, + .encrypt = cbc_encrypt, + .decrypt = cbc_decrypt, + }, +@@ -324,7 +330,7 @@ static struct crypto_alg aes_algs[] = { { + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_BLOCK_SIZE, +- .setkey = crypto_aes_set_key, ++ .setkey = aes_setkey, + .encrypt = ctr_encrypt, + .decrypt = ctr_encrypt, + }, diff --git a/arch/arm64/include/asm/acenv.h b/arch/arm64/include/asm/acenv.h new file mode 100644 index 0000000..b49166f @@ -1230,10 +2998,10 @@ index 0000000..b49166f +#endif /* _ASM_ACENV_H */ diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h new file mode 100644 -index 0000000..7f6cd91 +index 0000000..6e692f4 --- /dev/null +++ b/arch/arm64/include/asm/acpi.h -@@ -0,0 +1,99 @@ +@@ -0,0 +1,102 @@ +/* + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Al Stone <al.stone@linaro.org> @@ -1276,23 +3044,27 @@ index 0000000..7f6cd91 + acpi_noirq = 1; +} + -+/* MPIDR value provided in GICC structure is 64 bits, but -+ * the acpi processor driver use the 32 bits cpu hardware -+ * ID (apic_id on intel platform) everywhere, it is pretty -+ * hard to modify the acpi processor driver to accept the -+ * 64 bits MPIDR value, at the same time, only 32 bits of -+ * the MPIDR is used in the 64 bits MPIDR, just pack the -+ * Affx fields into a single 32 bit identifier to accommodate -+ * the acpi processor drivers. ++static inline void enable_acpi(void) ++{ ++ acpi_disabled = 0; ++ acpi_pci_disabled = 0; ++ acpi_noirq = 0; ++} ++ ++/* MPIDR value provided in GICC structure is 64 bits, but the ++ * existing apic_id (CPU hardware ID) using in acpi processor ++ * driver is 32-bit, to conform to the same datatype we need ++ * to repack the GICC structure MPIDR. ++ * ++ * Only 32 bits of MPIDR are used: ++ * ++ * Bits [0:7] Aff0; ++ * Bits [8:15] Aff1; ++ * Bits [16:23] Aff2; ++ * Bits [32:39] Aff3; + */ -+static inline u32 pack_mpidr_into_32_bits(u64 mpidr) ++static inline u32 pack_mpidr(u64 mpidr) +{ -+ /* -+ * Bits [0:7] Aff0; -+ * Bits [8:15] Aff1; -+ * Bits [16:23] Aff2; -+ * Bits [32:39] Aff3; -+ */ + return (u32) ((mpidr & 0xff00000000) >> 8) | mpidr; +} + @@ -1304,7 +3076,7 @@ index 0000000..7f6cd91 + * cpu_logical_map(cpu) is the mapping of MPIDR and the logical cpu, + * and MPIDR is the cpu hardware ID we needed to pack. + */ -+#define cpu_physical_id(cpu) pack_mpidr_into_32_bits(cpu_logical_map(cpu)) ++#define cpu_physical_id(cpu) pack_mpidr(cpu_logical_map(cpu)) + +/* + * It's used from ACPI core in kdump to boot UP system with SMP kernel, @@ -1324,29 +3096,161 @@ index 0000000..7f6cd91 +extern int acpi_get_cpu_parked_address(int cpu, u64 *addr); + +#else -+ ++static inline void disable_acpi(void) { } +static inline bool acpi_psci_present(void) { return false; } +static inline bool acpi_psci_use_hvc(void) { return false; } +static inline void acpi_smp_init_cpus(void) { } +static inline int acpi_get_cpu_parked_address(int cpu, u64 *addr) { return -EOPNOTSUPP; } -+ +#endif /* CONFIG_ACPI */ + +#endif /*_ASM_ACPI_H*/ +diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h +index ddb9d78..89e397b 100644 +--- a/arch/arm64/include/asm/cmpxchg.h ++++ b/arch/arm64/include/asm/cmpxchg.h +@@ -19,6 +19,7 @@ + #define __ASM_CMPXCHG_H + + #include <linux/bug.h> ++#include <linux/mmdebug.h> + + #include <asm/barrier.h> + +@@ -152,6 +153,51 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, + return oldval; + } + ++#define system_has_cmpxchg_double() 1 ++ ++static inline int __cmpxchg_double(volatile void *ptr1, volatile void *ptr2, ++ unsigned long old1, unsigned long old2, ++ unsigned long new1, unsigned long new2, int size) ++{ ++ unsigned long loop, lost; ++ ++ switch (size) { ++ case 8: ++ VM_BUG_ON((unsigned long *)ptr2 - (unsigned long *)ptr1 != 1); ++ do { ++ asm volatile("// __cmpxchg_double8\n" ++ " ldxp %0, %1, %2\n" ++ " eor %0, %0, %3\n" ++ " eor %1, %1, %4\n" ++ " orr %1, %0, %1\n" ++ " mov %w0, #0\n" ++ " cbnz %1, 1f\n" ++ " stxp %w0, %5, %6, %2\n" ++ "1:\n" ++ : "=&r"(loop), "=&r"(lost), "+Q" (*(u64 *)ptr1) ++ : "r" (old1), "r"(old2), "r"(new1), "r"(new2)); ++ } while (loop); ++ break; ++ default: ++ BUILD_BUG(); ++ } ++ ++ return !lost; ++} ++ ++static inline int __cmpxchg_double_mb(volatile void *ptr1, volatile void *ptr2, ++ unsigned long old1, unsigned long old2, ++ unsigned long new1, unsigned long new2, int size) ++{ ++ int ret; ++ ++ smp_mb(); ++ ret = __cmpxchg_double(ptr1, ptr2, old1, old2, new1, new2, size); ++ smp_mb(); ++ ++ return ret; ++} ++ + static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, + unsigned long new, int size) + { +@@ -182,6 +228,31 @@ static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, + __ret; \ + }) + ++#define cmpxchg_double(ptr1, ptr2, o1, o2, n1, n2) \ ++({\ ++ int __ret;\ ++ __ret = __cmpxchg_double_mb((ptr1), (ptr2), (unsigned long)(o1), \ ++ (unsigned long)(o2), (unsigned long)(n1), \ ++ (unsigned long)(n2), sizeof(*(ptr1)));\ ++ __ret; \ ++}) ++ ++#define cmpxchg_double_local(ptr1, ptr2, o1, o2, n1, n2) \ ++({\ ++ int __ret;\ ++ __ret = __cmpxchg_double((ptr1), (ptr2), (unsigned long)(o1), \ ++ (unsigned long)(o2), (unsigned long)(n1), \ ++ (unsigned long)(n2), sizeof(*(ptr1)));\ ++ __ret; \ ++}) ++ ++#define this_cpu_cmpxchg_8(ptr, o, n) \ ++ cmpxchg_local(raw_cpu_ptr(&(ptr)), o, n) ++ ++#define this_cpu_cmpxchg_double_8(ptr1, ptr2, o1, o2, n1, n2) \ ++ cmpxchg_double_local(raw_cpu_ptr(&(ptr1)), raw_cpu_ptr(&(ptr2)), \ ++ o1, o2, n1, n2) ++ + #define cmpxchg64(ptr,o,n) cmpxchg((ptr),(o),(n)) + #define cmpxchg64_local(ptr,o,n) cmpxchg_local((ptr),(o),(n)) + diff --git a/arch/arm64/include/asm/cpu_ops.h b/arch/arm64/include/asm/cpu_ops.h -index d7b4b38..d149580 100644 +index 6f8e2ef..978f567 100644 --- a/arch/arm64/include/asm/cpu_ops.h +++ b/arch/arm64/include/asm/cpu_ops.h -@@ -61,6 +61,7 @@ struct cpu_operations { +@@ -64,6 +64,7 @@ struct cpu_operations { }; extern const struct cpu_operations *cpu_ops[NR_CPUS]; +const struct cpu_operations *cpu_get_ops(const char *name); - extern int __init cpu_read_ops(struct device_node *dn, int cpu); - extern void __init cpu_read_bootcpu_ops(void); + int __init cpu_read_ops(struct device_node *dn, int cpu); + void __init cpu_read_bootcpu_ops(void); +diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h +new file mode 100644 +index 0000000..69d37d8 +--- /dev/null ++++ b/arch/arm64/include/asm/dmi.h +@@ -0,0 +1,31 @@ ++/* ++ * arch/arm64/include/asm/dmi.h ++ * ++ * Copyright (C) 2013 Linaro Limited. ++ * Written by: Yi Li (yi.li@linaro.org) ++ * ++ * based on arch/ia64/include/asm/dmi.h ++ * ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ */ ++ ++#ifndef __ASM_DMI_H ++#define __ASM_DMI_H ++ ++#include <linux/io.h> ++#include <linux/slab.h> ++ ++/* ++ * According to section 2.3.6 of the UEFI spec, the firmware should not ++ * request a virtual mapping for configuration tables such as SMBIOS. ++ * This means we have to map them before use. ++ */ ++#define dmi_early_remap(x, l) ioremap_cache(x, l) ++#define dmi_early_unmap(x, l) iounmap(x) ++#define dmi_remap(x, l) ioremap_cache(x, l) ++#define dmi_unmap(x) iounmap(x) ++#define dmi_alloc(l) kzalloc(l, GFP_KERNEL) ++ ++#endif diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h -index 01d3aab..8186df6 100644 +index 1f65be3..c0f89a0 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -114,7 +114,8 @@ typedef struct user_fpsimd_state elf_fpregset_t; @@ -1359,222 +3263,147 @@ index 01d3aab..8186df6 100644 #define CORE_DUMP_USE_REGSET #define ELF_EXEC_PAGESIZE PAGE_SIZE -diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h -index e0ecdcf..f998d90 100644 ---- a/arch/arm64/include/asm/io.h -+++ b/arch/arm64/include/asm/io.h -@@ -121,7 +121,8 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) - /* - * I/O port access primitives. - */ --#define IO_SPACE_LIMIT 0xffff -+#define arch_has_dev_port() (1) -+#define IO_SPACE_LIMIT (SZ_32M - 1) - #define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_32M)) - - static inline u8 inb(unsigned long addr) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h -index cc83520..ff4a4fa 100644 +index 7fd3e27..8afb863 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h -@@ -95,7 +95,6 @@ - /* TCR_EL2 Registers bits */ - #define TCR_EL2_TBI (1 << 20) - #define TCR_EL2_PS (7 << 16) --#define TCR_EL2_PS_40B (2 << 16) - #define TCR_EL2_TG0 (1 << 14) - #define TCR_EL2_SH0 (3 << 12) - #define TCR_EL2_ORGN0 (3 << 10) -@@ -104,8 +103,6 @@ - #define TCR_EL2_MASK (TCR_EL2_TG0 | TCR_EL2_SH0 | \ - TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ) - --#define TCR_EL2_FLAGS (TCR_EL2_PS_40B) -- - /* VTCR_EL2 Registers bits */ - #define VTCR_EL2_PS_MASK (7 << 16) - #define VTCR_EL2_TG0_MASK (1 << 14) -@@ -120,36 +117,28 @@ - #define VTCR_EL2_SL0_MASK (3 << 6) - #define VTCR_EL2_SL0_LVL1 (1 << 6) - #define VTCR_EL2_T0SZ_MASK 0x3f --#define VTCR_EL2_T0SZ_40B 24 -+#define VTCR_EL2_T0SZ(bits) (64 - (bits)) - - #ifdef CONFIG_ARM64_64K_PAGES - /* - * Stage2 translation configuration: -- * 40bits output (PS = 2) -- * 40bits input (T0SZ = 24) - * 64kB pages (TG0 = 1) - * 2 level page tables (SL = 1) - */ - #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ - VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ -- VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) --#define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) -+ VTCR_EL2_SL0_LVL1) - #else - /* - * Stage2 translation configuration: -- * 40bits output (PS = 2) -- * 40bits input (T0SZ = 24) - * 4kB pages (TG0 = 0) - * 3 level page tables (SL = 1) - */ - #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ - VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ -- VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) --#define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) -+ VTCR_EL2_SL0_LVL1) - #endif +@@ -18,6 +18,7 @@ + #ifndef __ARM64_KVM_ARM_H__ + #define __ARM64_KVM_ARM_H__ --#define VTTBR_BADDR_SHIFT (VTTBR_X - 1) --#define VTTBR_BADDR_MASK (((1LLU << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) - #define VTTBR_VMID_SHIFT (48LLU) - #define VTTBR_VMID_MASK (0xffLLU << VTTBR_VMID_SHIFT) ++#include <asm/memory.h> + #include <asm/types.h> + /* Hyp Configuration Register (HCR) bits */ +@@ -160,9 +161,9 @@ + #endif + + #define VTTBR_BADDR_SHIFT (VTTBR_X - 1) +-#define VTTBR_BADDR_MASK (((1LLU << (PHYS_MASK_SHIFT - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) +-#define VTTBR_VMID_SHIFT (48LLU) +-#define VTTBR_VMID_MASK (0xffLLU << VTTBR_VMID_SHIFT) ++#define VTTBR_BADDR_MASK (((UL(1) << (PHYS_MASK_SHIFT - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) ++#define VTTBR_VMID_SHIFT (UL(48)) ++#define VTTBR_VMID_MASK (UL(0xFF) << VTTBR_VMID_SHIFT) + + /* Hyp System Trap Register */ + #define HSTR_EL2_TTEE (1 << 16) +@@ -185,13 +186,13 @@ + + /* Exception Syndrome Register (ESR) bits */ + #define ESR_EL2_EC_SHIFT (26) +-#define ESR_EL2_EC (0x3fU << ESR_EL2_EC_SHIFT) +-#define ESR_EL2_IL (1U << 25) ++#define ESR_EL2_EC (UL(0x3f) << ESR_EL2_EC_SHIFT) ++#define ESR_EL2_IL (UL(1) << 25) + #define ESR_EL2_ISS (ESR_EL2_IL - 1) + #define ESR_EL2_ISV_SHIFT (24) +-#define ESR_EL2_ISV (1U << ESR_EL2_ISV_SHIFT) ++#define ESR_EL2_ISV (UL(1) << ESR_EL2_ISV_SHIFT) + #define ESR_EL2_SAS_SHIFT (22) +-#define ESR_EL2_SAS (3U << ESR_EL2_SAS_SHIFT) ++#define ESR_EL2_SAS (UL(3) << ESR_EL2_SAS_SHIFT) + #define ESR_EL2_SSE (1 << 21) + #define ESR_EL2_SRT_SHIFT (16) + #define ESR_EL2_SRT_MASK (0x1f << ESR_EL2_SRT_SHIFT) +@@ -205,16 +206,16 @@ + #define ESR_EL2_FSC_TYPE (0x3c) + + #define ESR_EL2_CV_SHIFT (24) +-#define ESR_EL2_CV (1U << ESR_EL2_CV_SHIFT) ++#define ESR_EL2_CV (UL(1) << ESR_EL2_CV_SHIFT) + #define ESR_EL2_COND_SHIFT (20) +-#define ESR_EL2_COND (0xfU << ESR_EL2_COND_SHIFT) ++#define ESR_EL2_COND (UL(0xf) << ESR_EL2_COND_SHIFT) + + + #define FSC_FAULT (0x04) + #define FSC_PERM (0x0c) + + /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */ +-#define HPFAR_MASK (~0xFUL) ++#define HPFAR_MASK (~UL(0xf)) + + #define ESR_EL2_EC_UNKNOWN (0x00) + #define ESR_EL2_EC_WFI (0x01) diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h -index 8e138c7..1c70b2f 100644 +index 0caf7a5..123b521 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h -@@ -167,5 +167,80 @@ static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, +@@ -243,9 +243,10 @@ static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) + } - void stage2_flush_vm(struct kvm *kvm); + static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, +- unsigned long size) ++ unsigned long size, ++ bool ipa_uncached) + { +- if (!vcpu_has_cache_enabled(vcpu)) ++ if (!vcpu_has_cache_enabled(vcpu) || ipa_uncached) + kvm_flush_dcache_to_poc((void *)hva, size); -+/* -+ * ARMv8 64K architecture limitations: -+ * 16 <= T0SZ <= 21 is valid under 3 level of translation tables -+ * 18 <= T0SZ <= 34 is valid under 2 level of translation tables -+ * 31 <= T0SZ <= 39 is valid under 1 level of transltaion tables -+ * -+ * ARMv8 4K architecture limitations: -+ * 16 <= T0SZ <= 24 is valid under 4 level of translation tables -+ * 21 <= T0SZ <= 33 is valid under 3 level of translation tables -+ * 30 <= T0SZ <= 39 is valid under 2 level of translation tables -+ * -+ * For 4K pages we only support 3 or 4 level, giving T0SZ a range of 16 to 33. -+ * For 64K pages we only support 2 or 3 level, giving T0SZ a range of 16 to 34. -+ * -+ * See Table D4-23 and Table D4-25 in ARM DDI 0487A.b to figure out -+ * the origin of the hardcoded values, 38 and 37. -+ */ -+ -+#ifdef CONFIG_ARM64_64K_PAGES -+static inline int t0sz_to_vttbr_x(int t0sz) -+{ -+ if (t0sz < 16 || t0sz > 34) { -+ kvm_err("Cannot support %d-bit address space\n", 64 - t0sz); -+ return -EINVAL; -+ } -+ -+ return 38 - t0sz; -+} -+#else /* 4K pages */ -+static inline int t0sz_to_vttbr_x(int t0sz) -+{ -+ if (t0sz < 16 || t0sz > 33) { -+ kvm_err("Cannot support %d-bit address space\n", 64 - t0sz); -+ return -EINVAL; -+ } -+ return 37 - t0sz; -+} -+#endif -+static inline int kvm_get_phys_addr_shift(void) -+{ -+ int pa_range = read_cpuid(ID_AA64MMFR0_EL1) & 0xf; -+ -+ switch (pa_range) { -+ case 0: return 32; -+ case 1: return 36; -+ case 2: return 40; -+ case 3: return 42; -+ case 4: return 44; -+ case 5: return 48; -+ default: -+ BUG(); -+ return 0; -+ } -+} -+ -+/** -+ * get_vttbr_baddr_mask - get mask value for vttbr base address -+ * -+ * In ARMv8, vttbr_baddr_mask cannot be determined in compile time since the -+ * stage2 input address size depends on hardware capability. Thus, we first -+ * need to read ID_AA64MMFR0_EL1.PARange and then set vttbr_baddr_mask with -+ * consideration of both the granule size and the level of translation tables. -+ */ -+static inline u64 get_vttbr_baddr_mask(void) -+{ -+ int t0sz, vttbr_x; + if (!icache_is_aliasing()) { /* PIPT */ +diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h +index 872ba93..2f287a6 100644 +--- a/arch/arm64/include/asm/pci.h ++++ b/arch/arm64/include/asm/pci.h +@@ -33,5 +33,56 @@ static inline int pci_proc_domain(struct pci_bus *bus) + } + #endif /* CONFIG_PCI */ + ++/* "PCI MMCONFIG %04x [bus %02x-%02x]" */ ++#define PCI_MMCFG_RESOURCE_NAME_LEN (22 + 4 + 2 + 2) + -+ t0sz = VTCR_EL2_T0SZ(kvm_get_phys_addr_shift()); -+ vttbr_x = t0sz_to_vttbr_x(t0sz); -+ if (vttbr_x < 0) -+ return ~0; -+ return GENMASK_ULL(48, (vttbr_x - 1)); ++#define PCI_MMCFG_BUS_OFFSET(bus) ((bus) << 20) + -+} ++struct acpi_device; + - #endif /* __ASSEMBLY__ */ - #endif /* __ARM64_KVM_MMU_H__ */ -diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h -new file mode 100644 -index 0000000..872ba93 ---- /dev/null -+++ b/arch/arm64/include/asm/pci.h -@@ -0,0 +1,37 @@ -+#ifndef __ASM_PCI_H -+#define __ASM_PCI_H -+#ifdef __KERNEL__ ++struct pci_sysdata { ++ int domain; /* PCI domain */ ++ int node; /* NUMA node */ ++ struct acpi_device *companion; /* ACPI companion device */ ++ void *iommu; /* IOMMU private data */ ++}; + -+#include <linux/types.h> -+#include <linux/slab.h> -+#include <linux/dma-mapping.h> ++struct acpi_pci_root; ++struct pci_mmcfg_region; + -+#include <asm/io.h> -+#include <asm-generic/pci-bridge.h> -+#include <asm-generic/pci-dma-compat.h> ++typedef int (*acpi_mcfg_fixup_t)(struct acpi_pci_root *root, ++ struct pci_mmcfg_region *cfg); + -+#define PCIBIOS_MIN_IO 0x1000 -+#define PCIBIOS_MIN_MEM 0 ++struct pci_mmcfg_region { ++ struct list_head list; ++ struct resource res; ++ int (*read)(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 *value); ++ int (*write)(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 value); ++ acpi_mcfg_fixup_t fixup; ++ void *data; ++ u64 address; ++ char __iomem *virt; ++ u16 segment; ++ u8 start_bus; ++ u8 end_bus; ++ char name[PCI_MMCFG_RESOURCE_NAME_LEN]; ++}; + -+/* -+ * Set to 1 if the kernel should re-assign all PCI bus numbers -+ */ -+#define pcibios_assign_all_busses() \ -+ (pci_has_flag(PCI_REASSIGN_ALL_BUS)) ++struct acpi_mcfg_fixup { ++ char oem_id[7]; ++ char oem_table_id[9]; ++ acpi_mcfg_fixup_t hook; ++}; + -+/* -+ * PCI address space differs from physical memory address space -+ */ -+#define PCI_DMA_BUS_IS_PHYS (0) ++/* Designate a routine to fix up buggy MCFG */ ++#define DECLARE_ACPI_MCFG_FIXUP(oem_id, table_id, hook) \ ++ static const struct acpi_mcfg_fixup __acpi_fixup_##hook __used \ ++ __attribute__((__section__(".acpi_fixup_mcfg"), aligned((sizeof(void *))))) \ ++ = { {oem_id}, {table_id}, hook }; + -+extern int isa_dma_bridge_buggy; ++extern struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus); + -+#ifdef CONFIG_PCI -+static inline int pci_proc_domain(struct pci_bus *bus) -+{ -+ return 1; -+} -+#endif /* CONFIG_PCI */ -+ -+#endif /* __KERNEL__ */ -+#endif /* __ASM_PCI_H */ -diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h -index ffe1ba0..a968523 100644 ---- a/arch/arm64/include/asm/pgtable.h -+++ b/arch/arm64/include/asm/pgtable.h -@@ -296,6 +296,8 @@ static inline int has_transparent_hugepage(void) - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) - #define pgprot_writecombine(prot) \ - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) -+#define pgprot_device(prot) \ -+ __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN) - #define __HAVE_PHYS_MEM_ACCESS_PROT - struct file; - extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, + #endif /* __KERNEL__ */ + #endif /* __ASM_PCI_H */ diff --git a/arch/arm64/include/asm/psci.h b/arch/arm64/include/asm/psci.h index e5312ea..2454bc5 100644 --- a/arch/arm64/include/asm/psci.h @@ -1589,7 +3418,7 @@ index e5312ea..2454bc5 100644 #endif /* __ASM_PSCI_H */ diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h -index a498f2c..2ebbd55 100644 +index 780f82c..3411561 100644 --- a/arch/arm64/include/asm/smp.h +++ b/arch/arm64/include/asm/smp.h @@ -39,9 +39,10 @@ extern void show_ipi_list(struct seq_file *p, int prec); @@ -1605,8 +3434,8 @@ index a498f2c..2ebbd55 100644 /* * Provide a function to raise an IPI cross call on CPUs in callmap. -@@ -49,6 +50,11 @@ extern void smp_init_cpus(void); - extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int)); +@@ -51,6 +52,11 @@ extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int)); + extern void (*__smp_cross_call)(const struct cpumask *, unsigned int); /* + * Provide a function to signal a parked secondary CPU. @@ -1618,7 +3447,7 @@ index a498f2c..2ebbd55 100644 */ asmlinkage void secondary_start_kernel(void); diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile -index df7ef87..b0bad2e 100644 +index 5bd029b..f4ba4fe 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -21,7 +21,8 @@ arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o \ @@ -1631,21 +3460,20 @@ index df7ef87..b0bad2e 100644 arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o -@@ -29,6 +30,8 @@ arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND) += sleep.o suspend.o - arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o +@@ -31,6 +32,7 @@ arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o arm64-obj-$(CONFIG_KGDB) += kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o -+arm64-obj-$(CONFIG_PCI) += pci.o + arm64-obj-$(CONFIG_PCI) += pci.o +arm64-obj-$(CONFIG_ACPI) += acpi.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c new file mode 100644 -index 0000000..5486426 +index 0000000..06a96be --- /dev/null +++ b/arch/arm64/kernel/acpi.c -@@ -0,0 +1,397 @@ +@@ -0,0 +1,398 @@ +/* + * ARM64 Specific Low-Level ACPI Boot Support + * @@ -1676,10 +3504,8 @@ index 0000000..5486426 +#include <asm/cputype.h> +#include <asm/cpu_ops.h> + -+#define ARM64_ACPI_DISABLED_DEFAULT 1 -+ +int acpi_noirq; /* skip ACPI IRQ initialization */ -+int acpi_disabled = ARM64_ACPI_DISABLED_DEFAULT; ++int acpi_disabled; +EXPORT_SYMBOL(acpi_disabled); + +int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */ @@ -1729,7 +3555,7 @@ index 0000000..5486426 + int cpu; + + if (mpidr == INVALID_HWID) { -+ pr_info("Skip invalid cpu hardware ID\n"); ++ pr_info("Skip MADT cpu entry with invalid MPIDR\n"); + return -EINVAL; + } + @@ -1753,7 +3579,7 @@ index 0000000..5486426 + for_each_possible_cpu(cpu) { + if (cpu_logical_map(cpu) == mpidr) { + pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n", -+ mpidr); ++ mpidr); + return -EINVAL; + } + } @@ -1761,7 +3587,10 @@ index 0000000..5486426 + /* allocate a logical cpu id for the new comer */ + cpu = cpumask_next_zero(-1, cpu_possible_mask); + } else { -+ /* First GICC entry must be BSP as ACPI spec said */ ++ /* ++ * First GICC entry must be BSP as ACPI spec said ++ * in section 5.2.12.15 ++ */ + if (cpu_logical_map(0) != mpidr) { + pr_err("First GICC entry with MPIDR 0x%llx is not BSP\n", + mpidr); @@ -1917,7 +3746,7 @@ index 0000000..5486426 + /* + * Revision in table header is the FADT Major revision, + * and there is a minor revision of FADT which was introduced -+ * by ACPI 5.1, we only deal with ACPI 5.1 or higher revision ++ * by ACPI 5.1, we only deal with ACPI 5.1 or newer revision + * to get arm boot flags, or we will disable ACPI. + */ + if (table->revision > 5 || @@ -1935,7 +3764,7 @@ index 0000000..5486426 + boot_method = "parking-protocol"; + + if (!boot_method) -+ pr_warn("has no boot support, will not bring up secondary CPUs\n"); ++ pr_warn("No boot method, will not bring up secondary CPUs\n"); + return -EOPNOTSUPP; + } + @@ -2014,9 +3843,9 @@ index 0000000..5486426 + + /* "acpi=off" disables both ACPI table parsing and interpreter */ + if (strcmp(arg, "off") == 0) -+ acpi_disabled = 1; -+ else if (strcmp(arg, "on") == 0) -+ acpi_disabled = 0; ++ disable_acpi(); ++ else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */ ++ enable_acpi(); + else + return -EINVAL; /* Core will print when we return error */ + @@ -2073,309 +3902,456 @@ index cce9524..1d90f31 100644 { const struct cpu_operations **ops = supported_cpu_ops; -diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c -index 1317fef..d27dd98 100644 ---- a/arch/arm64/kernel/efi-stub.c -+++ b/arch/arm64/kernel/efi-stub.c -@@ -28,20 +28,16 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, - kernel_size = _edata - _text; - if (*image_addr != (dram_base + TEXT_OFFSET)) { - kernel_memsize = kernel_size + (_end - _edata); -- status = efi_relocate_kernel(sys_table, image_addr, -- kernel_size, kernel_memsize, -- dram_base + TEXT_OFFSET, -- PAGE_SIZE); -+ status = efi_low_alloc(sys_table, kernel_memsize + TEXT_OFFSET, -+ SZ_2M, reserve_addr); - if (status != EFI_SUCCESS) { - pr_efi_err(sys_table, "Failed to relocate kernel\n"); - return status; - } -- if (*image_addr != (dram_base + TEXT_OFFSET)) { -- pr_efi_err(sys_table, "Failed to alloc kernel memory\n"); -- efi_free(sys_table, kernel_memsize, *image_addr); -- return EFI_LOAD_ERROR; -- } -- *image_size = kernel_memsize; -+ memcpy((void *)*reserve_addr + TEXT_OFFSET, (void *)*image_addr, -+ kernel_size); -+ *image_addr = *reserve_addr + TEXT_OFFSET; -+ *reserve_size = kernel_memsize + TEXT_OFFSET; - } - +diff --git a/arch/arm64/kernel/efi-entry.S b/arch/arm64/kernel/efi-entry.S +index d18a449..8ce9b05 100644 +--- a/arch/arm64/kernel/efi-entry.S ++++ b/arch/arm64/kernel/efi-entry.S +@@ -61,7 +61,8 @@ ENTRY(efi_stub_entry) + */ + mov x20, x0 // DTB address + ldr x0, [sp, #16] // relocated _text address +- mov x21, x0 ++ ldr x21, =stext_offset ++ add x21, x0, x21 + /* + * Calculate size of the kernel Image (same for original and copy). diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c -index 03aaa99..6c4de44 100644 +index 95c49eb..f9de195 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c -@@ -479,3 +479,14 @@ err_unmap: +@@ -11,6 +11,7 @@ + * + */ + ++#include <linux/dmi.h> + #include <linux/efi.h> + #include <linux/export.h> + #include <linux/memblock.h> +@@ -112,8 +113,6 @@ static int __init uefi_init(void) + efi.systab->hdr.revision & 0xffff, vendor); + + retval = efi_config_init(NULL); +- if (retval == 0) +- set_bit(EFI_CONFIG_TABLES, &efi.flags); + + out: + early_memunmap(efi.systab, sizeof(efi_system_table_t)); +@@ -125,17 +124,17 @@ out: + */ + static __init int is_reserve_region(efi_memory_desc_t *md) + { +- if (!is_normal_ram(md)) ++ switch (md->type) { ++ case EFI_LOADER_CODE: ++ case EFI_LOADER_DATA: ++ case EFI_BOOT_SERVICES_CODE: ++ case EFI_BOOT_SERVICES_DATA: ++ case EFI_CONVENTIONAL_MEMORY: + return 0; +- +- if (md->attribute & EFI_MEMORY_RUNTIME) +- return 1; +- +- if (md->type == EFI_ACPI_RECLAIM_MEMORY || +- md->type == EFI_RESERVED_TYPE) +- return 1; +- +- return 0; ++ default: ++ break; ++ } ++ return is_normal_ram(md); + } + + static __init void reserve_regions(void) +@@ -471,3 +470,54 @@ err_unmap: return -1; } early_initcall(arm64_enter_virtual_mode); + ++static int __init arm64_dmi_init(void) ++{ ++ /* ++ * On arm64, DMI depends on UEFI, and dmi_scan_machine() needs to ++ * be called early because dmi_id_init(), which is an arch_initcall ++ * itself, depends on dmi_scan_machine() having been called already. ++ */ ++ dmi_scan_machine(); ++ if (dmi_available) ++ dmi_set_dump_stack_arch_desc(); ++ return 0; ++} ++core_initcall(arm64_dmi_init); ++ +/* + * If nothing else is handling pm_power_off, use EFI + * -+ * This is called from a late_initcall after other mechanisms -+ * have had a chance to register a handler. ++ * When Guenter Roeck's power-off handler call chain patches land, ++ * we just need to return true unconditionally. + */ +bool efi_poweroff_required(void) +{ + return pm_power_off == NULL; +} ++ ++static int arm64_efi_restart(struct notifier_block *this, ++ unsigned long mode, void *cmd) ++{ ++ efi_reboot(reboot_mode, cmd); ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block arm64_efi_restart_nb = { ++ .notifier_call = arm64_efi_restart, ++ .priority = INT_MAX, ++}; ++ ++static int __init arm64_register_efi_restart(void) ++{ ++ int ret = 0; ++ ++ if (efi_enabled(EFI_RUNTIME_SERVICES)) { ++ ret = register_restart_handler(&arm64_efi_restart_nb); ++ if (ret) ++ pr_err("%s: cannot register restart handler, %d\n", ++ __func__, ret); ++ } ++ return ret; ++} ++late_initcall(arm64_register_efi_restart); +diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S +index 38e704e..08cafc5 100644 +--- a/arch/arm64/kernel/entry-ftrace.S ++++ b/arch/arm64/kernel/entry-ftrace.S +@@ -98,8 +98,8 @@ + ENTRY(_mcount) + mcount_enter + +- ldr x0, =ftrace_trace_function +- ldr x2, [x0] ++ adrp x0, ftrace_trace_function ++ ldr x2, [x0, #:lo12:ftrace_trace_function] + adr x0, ftrace_stub + cmp x0, x2 // if (ftrace_trace_function + b.eq skip_ftrace_call // != ftrace_stub) { +@@ -115,14 +115,15 @@ skip_ftrace_call: // return; + mcount_exit // return; + // } + skip_ftrace_call: +- ldr x1, =ftrace_graph_return +- ldr x2, [x1] // if ((ftrace_graph_return +- cmp x0, x2 // != ftrace_stub) +- b.ne ftrace_graph_caller +- +- ldr x1, =ftrace_graph_entry // || (ftrace_graph_entry +- ldr x2, [x1] // != ftrace_graph_entry_stub)) +- ldr x0, =ftrace_graph_entry_stub ++ adrp x1, ftrace_graph_return ++ ldr x2, [x1, #:lo12:ftrace_graph_return] ++ cmp x0, x2 // if ((ftrace_graph_return ++ b.ne ftrace_graph_caller // != ftrace_stub) ++ ++ adrp x1, ftrace_graph_entry // || (ftrace_graph_entry ++ adrp x0, ftrace_graph_entry_stub // != ftrace_graph_entry_stub)) ++ ldr x2, [x1, #:lo12:ftrace_graph_entry] ++ add x0, x0, #:lo12:ftrace_graph_entry_stub + cmp x0, x2 + b.ne ftrace_graph_caller // ftrace_graph_caller(); + diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S -index 8730690..0a6e4f9 100644 +index 0a6e4f9..5a76e3a 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S -@@ -151,7 +151,7 @@ optional_header: - .short 0x20b // PE32+ format - .byte 0x02 // MajorLinkerVersion - .byte 0x14 // MinorLinkerVersion -- .long _edata - stext // SizeOfCode -+ .long _end - stext // SizeOfCode +@@ -132,6 +132,8 @@ efi_head: + #endif + + #ifdef CONFIG_EFI ++ .globl stext_offset ++ .set stext_offset, stext - efi_head + .align 3 + pe_header: + .ascii "PE" +@@ -155,12 +157,12 @@ optional_header: .long 0 // SizeOfInitializedData .long 0 // SizeOfUninitializedData .long efi_stub_entry - efi_head // AddressOfEntryPoint -@@ -169,7 +169,7 @@ extra_header_fields: - .short 0 // MinorSubsystemVersion - .long 0 // Win32VersionValue - -- .long _edata - efi_head // SizeOfImage -+ .long _end - efi_head // SizeOfImage +- .long stext - efi_head // BaseOfCode ++ .long stext_offset // BaseOfCode + + extra_header_fields: + .quad 0 // ImageBase +- .long 0x20 // SectionAlignment +- .long 0x8 // FileAlignment ++ .long 0x1000 // SectionAlignment ++ .long PECOFF_FILE_ALIGNMENT // FileAlignment + .short 0 // MajorOperatingSystemVersion + .short 0 // MinorOperatingSystemVersion + .short 0 // MajorImageVersion +@@ -172,7 +174,7 @@ extra_header_fields: + .long _end - efi_head // SizeOfImage // Everything before the kernel image is considered part of the header - .long stext - efi_head // SizeOfHeaders -@@ -216,7 +216,7 @@ section_table: - .byte 0 +- .long stext - efi_head // SizeOfHeaders ++ .long stext_offset // SizeOfHeaders + .long 0 // CheckSum + .short 0xa // Subsystem (EFI application) + .short 0 // DllCharacteristics +@@ -217,16 +219,24 @@ section_table: .byte 0 .byte 0 // end of 0 padding of section name -- .long _edata - stext // VirtualSize -+ .long _end - stext // VirtualSize - .long stext - efi_head // VirtualAddress + .long _end - stext // VirtualSize +- .long stext - efi_head // VirtualAddress ++ .long stext_offset // VirtualAddress .long _edata - stext // SizeOfRawData - .long stext - efi_head // PointerToRawData -diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c -new file mode 100644 -index 0000000..ce5836c ---- /dev/null -+++ b/arch/arm64/kernel/pci.c -@@ -0,0 +1,70 @@ -+/* -+ * Code borrowed from powerpc/kernel/pci-common.c -+ * -+ * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM -+ * Copyright (C) 2014 ARM Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ */ +- .long stext - efi_head // PointerToRawData ++ .long stext_offset // PointerToRawData + + .long 0 // PointerToRelocations (0 for executables) + .long 0 // PointerToLineNumbers (0 for executables) + .short 0 // NumberOfRelocations (0 for executables) + .short 0 // NumberOfLineNumbers (0 for executables) + .long 0xe0500020 // Characteristics (section flags) +- .align 5 + -+#include <linux/init.h> -+#include <linux/io.h> -+#include <linux/kernel.h> -+#include <linux/mm.h> -+#include <linux/of_pci.h> -+#include <linux/of_platform.h> -+#include <linux/slab.h> ++ /* ++ * EFI will load stext onwards at the 4k section alignment ++ * described in the PE/COFF header. To ensure that instruction ++ * sequences using an adrp and a :lo12: immediate will function ++ * correctly at this alignment, we must ensure that stext is ++ * placed at a 4k boundary in the Image to begin with. ++ */ ++ .align 12 + #endif + + ENTRY(stext) +diff --git a/arch/arm64/kernel/io.c b/arch/arm64/kernel/io.c +index 7d37ead..354be2a 100644 +--- a/arch/arm64/kernel/io.c ++++ b/arch/arm64/kernel/io.c +@@ -25,12 +25,26 @@ + */ + void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count) + { +- unsigned char *t = to; +- while (count) { ++ while (count && (!IS_ALIGNED((unsigned long)from, 8) || ++ !IS_ALIGNED((unsigned long)to, 8))) { ++ *(u8 *)to = __raw_readb(from); ++ from++; ++ to++; + count--; +- *t = readb(from); +- t++; ++ } ++ ++ while (count >= 8) { ++ *(u64 *)to = __raw_readq(from); ++ from += 8; ++ to += 8; ++ count -= 8; ++ } ++ ++ while (count) { ++ *(u8 *)to = __raw_readb(from); + from++; ++ to++; ++ count--; + } + } + EXPORT_SYMBOL(__memcpy_fromio); +@@ -40,12 +54,26 @@ EXPORT_SYMBOL(__memcpy_fromio); + */ + void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count) + { +- const unsigned char *f = from; +- while (count) { ++ while (count && (!IS_ALIGNED((unsigned long)to, 8) || ++ !IS_ALIGNED((unsigned long)from, 8))) { ++ __raw_writeb(*(volatile u8 *)from, to); ++ from++; ++ to++; + count--; +- writeb(*f, to); +- f++; ++ } ++ ++ while (count >= 8) { ++ __raw_writeq(*(volatile u64 *)from, to); ++ from += 8; ++ to += 8; ++ count -= 8; ++ } ++ ++ while (count) { ++ __raw_writeb(*(volatile u8 *)from, to); ++ from++; + to++; ++ count--; + } + } + EXPORT_SYMBOL(__memcpy_toio); +@@ -55,10 +83,28 @@ EXPORT_SYMBOL(__memcpy_toio); + */ + void __memset_io(volatile void __iomem *dst, int c, size_t count) + { +- while (count) { ++ u64 qc = (u8)c; + -+#include <asm/pci-bridge.h> ++ qc |= qc << 8; ++ qc |= qc << 16; ++ qc |= qc << 32; + -+/* -+ * Called after each bus is probed, but before its children are examined -+ */ -+void pcibios_fixup_bus(struct pci_bus *bus) ++ while (count && !IS_ALIGNED((unsigned long)dst, 8)) { ++ __raw_writeb(c, dst); ++ dst++; + count--; +- writeb(c, dst); ++ } ++ ++ while (count >= 8) { ++ __raw_writeq(qc, dst); ++ dst += 8; ++ count -= 8; ++ } ++ ++ while (count) { ++ __raw_writeb(c, dst); + dst++; ++ count--; + } + } + EXPORT_SYMBOL(__memset_io); +diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c +index ce5836c..978cd21 100644 +--- a/arch/arm64/kernel/pci.c ++++ b/arch/arm64/kernel/pci.c +@@ -17,6 +17,8 @@ + #include <linux/of_pci.h> + #include <linux/of_platform.h> + #include <linux/slab.h> ++#include <linux/acpi.h> ++#include <linux/pci-acpi.h> + + #include <asm/pci-bridge.h> + +@@ -37,34 +39,99 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, + return res->start; + } + ++int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ -+ /* nothing to do, expected to be removed in the future */ ++ struct pci_sysdata *sd; ++ ++ if (!acpi_disabled) { ++ sd = bridge->bus->sysdata; ++ ACPI_COMPANION_SET(&bridge->dev, sd->companion); ++ } ++ return 0; +} + -+/* -+ * We don't have to worry about legacy ISA devices, so nothing to do here -+ */ -+resource_size_t pcibios_align_resource(void *data, const struct resource *res, -+ resource_size_t size, resource_size_t align) + /* + * Try to assign the IRQ number from DT when adding a new device + */ + int pcibios_add_device(struct pci_dev *dev) + { +- dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); ++ if (acpi_disabled) ++ dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); + + return 0; + } + ++void pcibios_add_bus(struct pci_bus *bus) +{ -+ return res->start; ++ if (!acpi_disabled) ++ acpi_pci_add_bus(bus); +} -+ -+/* -+ * Try to assign the IRQ number from DT when adding a new device -+ */ -+int pcibios_add_device(struct pci_dev *dev) + +-#ifdef CONFIG_PCI_DOMAINS_GENERIC +-static bool dt_domain_found = false; ++void pcibios_remove_bus(struct pci_bus *bus) +{ -+ dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); ++ if (!acpi_disabled) ++ acpi_pci_remove_bus(bus); ++} + ++int pcibios_enable_irq(struct pci_dev *dev) ++{ ++ if (!acpi_disabled && !pci_dev_msi_enabled(dev)) ++ acpi_pci_irq_enable(dev); + return 0; +} + -+ -+#ifdef CONFIG_PCI_DOMAINS_GENERIC -+static bool dt_domain_found = false; -+ -+void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) ++int pcibios_disable_irq(struct pci_dev *dev) +{ -+ int domain = of_get_pci_domain_nr(parent->of_node); -+ -+ if (domain >= 0) { -+ dt_domain_found = true; -+ } else if (dt_domain_found == true) { -+ dev_err(parent, "Node %s is missing \"linux,pci-domain\" property in DT\n", -+ parent->of_node->full_name); -+ return; -+ } else { -+ domain = pci_get_new_domain_nr(); -+ } -+ -+ bus->domain_nr = domain; ++ if (!acpi_disabled && !pci_dev_msi_enabled(dev)) ++ acpi_pci_irq_disable(dev); ++ return 0; +} -+#endif -diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c -index baf5afb..a0fb686 100644 ---- a/arch/arm64/kernel/perf_event.c -+++ b/arch/arm64/kernel/perf_event.c -@@ -29,6 +29,7 @@ - #include <linux/platform_device.h> - #include <linux/spinlock.h> - #include <linux/uaccess.h> -+#include <linux/acpi.h> - #include <asm/cputype.h> - #include <asm/irq.h> -@@ -1304,6 +1305,107 @@ static int __init register_pmu_driver(void) - } - device_initcall(register_pmu_driver); - -+#ifdef CONFIG_ACPI -+struct acpi_pmu_irq { -+ int gsi; -+ int trigger; -+}; -+ -+static struct acpi_pmu_irq acpi_pmu_irqs[NR_CPUS] __initdata; -+ -+static int __init -+acpi_parse_pmu_irqs(struct acpi_subtable_header *header, -+ const unsigned long end) ++int pcibios_enable_device(struct pci_dev *dev, int bars) +{ -+ struct acpi_madt_generic_interrupt *gic; -+ int cpu; -+ u64 mpidr; ++ int err; + -+ gic = (struct acpi_madt_generic_interrupt *)header; -+ if (BAD_MADT_ENTRY(gic, end)) -+ return -EINVAL; ++ err = pci_enable_resources(dev, bars); ++ if (err < 0) ++ return err; + -+ mpidr = gic->arm_mpidr & MPIDR_HWID_BITMASK; ++ if (!pci_dev_msi_enabled(dev)) ++ return pcibios_enable_irq(dev); ++ return 0; ++} + -+ for_each_possible_cpu(cpu) { -+ if (cpu_logical_map(cpu) != mpidr) -+ continue; ++#ifdef CONFIG_PCI_DOMAINS_GENERIC + void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) + { +- int domain = of_get_pci_domain_nr(parent->of_node); +- +- if (domain >= 0) { +- dt_domain_found = true; +- } else if (dt_domain_found == true) { +- dev_err(parent, "Node %s is missing \"linux,pci-domain\" property in DT\n", +- parent->of_node->full_name); +- return; +- } else { +- domain = pci_get_new_domain_nr(); +- } ++ int domain = -1; + +- bus->domain_nr = domain; ++ if (acpi_disabled) ++ domain = of_get_pci_domain_nr(parent->of_node); ++ else { ++ struct pci_sysdata *sd = bus->sysdata; + -+ acpi_pmu_irqs[cpu].gsi = gic->performance_interrupt; -+ if (gic->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE) -+ acpi_pmu_irqs[cpu].trigger = ACPI_EDGE_SENSITIVE; -+ else -+ acpi_pmu_irqs[cpu].trigger = ACPI_LEVEL_SENSITIVE; -+ return 0; ++ domain = sd->domain; + } ++ if (domain >= 0) ++ bus->domain_nr = domain; + } + #endif + -+ return -EINVAL; -+} -+ -+static int __init pmu_acpi_init(void) ++static int __init pcibios_assign_resources(void) +{ -+ struct platform_device *pdev; -+ struct acpi_pmu_irq *pirq = acpi_pmu_irqs; -+ struct resource *res, *r; -+ int err = -ENOMEM; -+ int i, count, irq; ++ struct pci_bus *root_bus; + + if (acpi_disabled) + return 0; + -+ count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT, -+ acpi_parse_pmu_irqs, num_possible_cpus()); -+ /* Must have irq for boot boot cpu, at least */ -+ if (count <= 0 || pirq->gsi == 0) -+ return -EINVAL; -+ -+ irq = acpi_register_gsi(NULL, pirq->gsi, pirq->trigger, -+ ACPI_ACTIVE_HIGH); -+ -+ if (irq_is_percpu(irq)) -+ count = 1; -+ -+ pdev = platform_device_alloc("arm-pmu", -1); -+ if (!pdev) -+ return err; -+ -+ res = kcalloc(count, sizeof(*res), GFP_KERNEL); -+ if (!res) -+ goto err_free_device; -+ -+ for (i = 0, r = res; i < count; i++, pirq++, r++) { -+ if (i) -+ irq = acpi_register_gsi(NULL, pirq->gsi, pirq->trigger, -+ ACPI_ACTIVE_HIGH); -+ r->start = r->end = irq; -+ r->flags = IORESOURCE_IRQ; -+ if (pirq->trigger == ACPI_EDGE_SENSITIVE) -+ r->flags |= IORESOURCE_IRQ_HIGHEDGE; -+ else -+ r->flags |= IORESOURCE_IRQ_HIGHLEVEL; ++ list_for_each_entry(root_bus, &pci_root_buses, node) { ++ pcibios_resource_survey_bus(root_bus); ++ pci_assign_unassigned_root_bus_resources(root_bus); + } -+ -+ err = platform_device_add_resources(pdev, res, count); -+ if (err) -+ goto err_free_res; -+ -+ err = platform_device_add(pdev); -+ if (err) -+ goto err_free_res; -+ + return 0; -+ -+err_free_res: -+ kfree(res); -+ -+err_free_device: -+ platform_device_put(pdev); -+ return err; +} -+arch_initcall(pmu_acpi_init); -+ -+#endif /* ACPI */ -+ - static struct pmu_hw_events *armpmu_get_cpu_events(void) - { - return this_cpu_ptr(&cpu_hw_events); -diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c -index 29d4869..c0427bc 100644 ---- a/arch/arm64/kernel/process.c -+++ b/arch/arm64/kernel/process.c -@@ -43,6 +43,7 @@ - #include <linux/hw_breakpoint.h> - #include <linux/personality.h> - #include <linux/notifier.h> -+#include <linux/efi.h> - - #include <asm/compat.h> - #include <asm/cacheflush.h> -@@ -182,6 +183,11 @@ void machine_restart(char *cmd) - arm_pm_restart(reboot_mode, cmd); - - /* -+ * If all else fails, try EFI -+ */ -+ efi_reboot(reboot_mode, cmd); -+ -+ /* - * Whoops - the architecture was unable to reboot. - */ - printk("Reboot failed -- System halted\n"); ++/* ++ * fs_initcall comes after subsys_initcall, so we know acpi scan ++ * has run. ++ */ ++fs_initcall(pcibios_assign_resources); diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c -index 5539547..15ba470 100644 +index 663da77..2d0deda 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -15,6 +15,7 @@ @@ -2386,15 +4362,15 @@ index 5539547..15ba470 100644 #include <linux/init.h> #include <linux/of.h> #include <linux/smp.h> -@@ -23,6 +24,7 @@ - #include <linux/delay.h> +@@ -24,6 +25,7 @@ + #include <linux/slab.h> #include <uapi/linux/psci.h> +#include <asm/acpi.h> #include <asm/compiler.h> #include <asm/cpu_ops.h> #include <asm/errno.h> -@@ -231,6 +233,33 @@ static void psci_sys_poweroff(void) +@@ -304,6 +306,33 @@ static void psci_sys_poweroff(void) invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); } @@ -2428,7 +4404,7 @@ index 5539547..15ba470 100644 /* * PSCI Function IDs for v0.2+ are well defined so use * standard values. -@@ -264,29 +293,7 @@ static int __init psci_0_2_init(struct device_node *np) +@@ -337,29 +366,7 @@ static int __init psci_0_2_init(struct device_node *np) } } @@ -2459,7 +4435,7 @@ index 5539547..15ba470 100644 out_put_node: of_node_put(np); -@@ -339,7 +346,7 @@ static const struct of_device_id psci_of_match[] __initconst = { +@@ -412,7 +419,7 @@ static const struct of_device_id psci_of_match[] __initconst = { {}, }; @@ -2468,7 +4444,7 @@ index 5539547..15ba470 100644 { struct device_node *np; const struct of_device_id *matched_np; -@@ -354,6 +361,29 @@ int __init psci_init(void) +@@ -427,6 +434,29 @@ int __init psci_init(void) return init_fn(np); } @@ -2499,7 +4475,7 @@ index 5539547..15ba470 100644 static int __init cpu_psci_cpu_init(struct device_node *dn, unsigned int cpu) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c -index edb146d..a793a20 100644 +index 2437196..914287d 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -43,6 +43,7 @@ @@ -2510,24 +4486,49 @@ index edb146d..a793a20 100644 #include <asm/fixmap.h> #include <asm/cpu.h> -@@ -59,6 +60,10 @@ +@@ -59,6 +60,7 @@ #include <asm/memblock.h> #include <asm/psci.h> #include <asm/efi.h> +#include <asm/acpi.h> -+ -+int acadia_kvm_acpi=0; -+EXPORT_SYMBOL(acadia_kvm_acpi); unsigned int processor_id; EXPORT_SYMBOL(processor_id); -@@ -385,22 +390,34 @@ void __init setup_arch(char **cmdline_p) +@@ -116,12 +118,16 @@ void __init early_print(const char *str, ...) - parse_early_param(); + void __init smp_setup_processor_id(void) + { ++ u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; ++ cpu_logical_map(0) = mpidr; ++ + /* + * clear __my_cpu_offset on boot CPU to avoid hang caused by + * using percpu variable early, for example, lockdep will + * access percpu variable inside lock_release + */ + set_my_cpu_offset(0); ++ pr_info("Booting Linux on physical CPU 0x%lx\n", (unsigned long)mpidr); + } -+ if (acpi_disabled) -+ disable_acpi(); + bool arch_match_cpu_phys_id(int cpu, u64 phys_id) +@@ -312,6 +318,7 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) + } + + machine_name = of_flat_dt_get_machine_name(); ++ dump_stack_set_arch_desc("%s (DT)", machine_name); + } + + /* +@@ -378,6 +385,8 @@ void __init setup_arch(char **cmdline_p) + + early_ioremap_init(); + ++ disable_acpi(); + + parse_early_param(); + + /* +@@ -389,19 +398,27 @@ void __init setup_arch(char **cmdline_p) efi_init(); arm64_memblock_init(); @@ -2542,9 +4543,6 @@ index edb146d..a793a20 100644 - unflatten_device_tree(); - - psci_init(); -- - cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; -- cpu_read_bootcpu_ops(); + if (acpi_disabled) { + unflatten_device_tree(); + psci_dt_init(); @@ -2556,33 +4554,15 @@ index edb146d..a793a20 100644 + psci_acpi_init(); + acpi_smp_init_cpus(); + } -+ + +- cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; +- cpu_read_bootcpu_ops(); #ifdef CONFIG_SMP - smp_init_cpus(); smp_build_mpidr_hash(); #endif -@@ -413,6 +430,19 @@ void __init setup_arch(char **cmdline_p) - #endif - } - -+static int __init parse_kvm_acpi(char *arg) -+{ -+ if (!arg) -+ return -EINVAL; -+ -+ if (strcmp(arg, "on") == 0) { -+ acadia_kvm_acpi = 1; -+ } -+ -+ return 0; -+} -+early_param("kvmacpi", parse_kvm_acpi); -+ - static int __init arm64_device_init(void) - { - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); -@@ -505,3 +535,25 @@ const struct seq_operations cpuinfo_op = { +@@ -506,3 +523,25 @@ const struct seq_operations cpuinfo_op = { .stop = c_stop, .show = c_show }; @@ -2609,7 +4589,7 @@ index edb146d..a793a20 100644 +} +early_initcall(arm64_console_setup); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c -index 4743397..4e390ac 100644 +index b06d1d9..2988829 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -321,7 +321,7 @@ void __init smp_prepare_boot_cpu(void) @@ -2737,63 +4717,6 @@ index 0000000..e1153ce + .cpu_prepare = smp_parking_protocol_cpu_prepare, + .cpu_boot = smp_parking_protocol_cpu_boot, +}; -diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c -index 0347d38..4f93c67 100644 ---- a/arch/arm64/kernel/smp_spin_table.c -+++ b/arch/arm64/kernel/smp_spin_table.c -@@ -20,6 +20,7 @@ - #include <linux/init.h> - #include <linux/of.h> - #include <linux/smp.h> -+#include <linux/types.h> - - #include <asm/cacheflush.h> - #include <asm/cpu_ops.h> -@@ -65,12 +66,21 @@ static int smp_spin_table_cpu_init(struct device_node *dn, unsigned int cpu) - - static int smp_spin_table_cpu_prepare(unsigned int cpu) - { -- void **release_addr; -+ __le64 __iomem *release_addr; - - if (!cpu_release_addr[cpu]) - return -ENODEV; - -- release_addr = __va(cpu_release_addr[cpu]); -+ /* -+ * The cpu-release-addr may or may not be inside the linear mapping. -+ * As ioremap_cache will either give us a new mapping or reuse the -+ * existing linear mapping, we can use it to cover both cases. In -+ * either case the memory will be MT_NORMAL. -+ */ -+ release_addr = ioremap_cache(cpu_release_addr[cpu], -+ sizeof(*release_addr)); -+ if (!release_addr) -+ return -ENOMEM; - - /* - * We write the release address as LE regardless of the native -@@ -79,15 +89,17 @@ static int smp_spin_table_cpu_prepare(unsigned int cpu) - * boot-loader's endianess before jumping. This is mandated by - * the boot protocol. - */ -- release_addr[0] = (void *) cpu_to_le64(__pa(secondary_holding_pen)); -- -- __flush_dcache_area(release_addr, sizeof(release_addr[0])); -+ writeq_relaxed(__pa(secondary_holding_pen), release_addr); -+ __flush_dcache_area((__force void *)release_addr, -+ sizeof(*release_addr)); - - /* - * Send an event to wake up the secondary CPU. - */ - sev(); - -+ iounmap(release_addr); -+ - return 0; - } - diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c index 1a7125c..42f9195 100644 --- a/arch/arm64/kernel/time.c @@ -2819,99 +4742,88 @@ index 1a7125c..42f9195 100644 arch_timer_rate = arch_timer_get_rate(); if (!arch_timer_rate) panic("Unable to initialise architected timer.\n"); -diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S -index c319116..fa7e67e 100644 ---- a/arch/arm64/kvm/hyp-init.S -+++ b/arch/arm64/kvm/hyp-init.S -@@ -63,17 +63,21 @@ __do_hyp_init: - mrs x4, tcr_el1 - ldr x5, =TCR_EL2_MASK - and x4, x4, x5 -- ldr x5, =TCR_EL2_FLAGS -- orr x4, x4, x5 -- msr tcr_el2, x4 -- -- ldr x4, =VTCR_EL2_FLAGS +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index edf8715..4596f46 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -32,6 +32,22 @@ jiffies = jiffies_64; + *(.hyp.text) \ + VMLINUX_SYMBOL(__hyp_text_end) = .; + ++/* ++ * The size of the PE/COFF section that covers the kernel image, which ++ * runs from stext to _edata, must be a round multiple of the PE/COFF ++ * FileAlignment, which we set to its minimum value of 0x200. 'stext' ++ * itself is 4 KB aligned, so padding out _edata to a 0x200 aligned ++ * boundary should be sufficient. ++ */ ++PECOFF_FILE_ALIGNMENT = 0x200; ++ ++#ifdef CONFIG_EFI ++#define PECOFF_EDATA_PADDING \ ++ .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); } ++#else ++#define PECOFF_EDATA_PADDING ++#endif ++ + SECTIONS + { /* - * Read the PARange bits from ID_AA64MMFR0_EL1 and set the PS bits in -- * VTCR_EL2. -+ * TCR_EL2 and both PS bits and T0SZ bits in VTCR_EL2. - */ - mrs x5, ID_AA64MMFR0_EL1 - bfi x4, x5, #16, #3 -+ msr tcr_el2, x4 -+ -+ ldr x4, =VTCR_EL2_FLAGS -+ bfi x4, x5, #16, #3 -+ and x5, x5, #0xf -+ adr x6, t0sz -+ add x6, x6, x5, lsl #2 -+ ldr w5, [x6] -+ orr x4, x4, x5 - msr vtcr_el2, x4 - - mrs x4, mair_el1 -@@ -113,6 +117,10 @@ target: /* We're now in the trampoline code, switch page tables */ - - /* Hello, World! */ - eret -+ -+t0sz: -+ .word VTCR_EL2_T0SZ(32), VTCR_EL2_T0SZ(36), VTCR_EL2_T0SZ(40) -+ .word VTCR_EL2_T0SZ(42), VTCR_EL2_T0SZ(44), VTCR_EL2_T0SZ(48) - ENDPROC(__kvm_hyp_init) - - .ltorg +@@ -103,6 +119,7 @@ SECTIONS + _data = .; + _sdata = .; + RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE) ++ PECOFF_EDATA_PADDING + _edata = .; + + BSS_SECTION(0, 0, 0) +diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S +index b72aa9f..fbe909f 100644 +--- a/arch/arm64/kvm/hyp.S ++++ b/arch/arm64/kvm/hyp.S +@@ -761,10 +761,10 @@ + .macro activate_traps + ldr x2, [x0, #VCPU_HCR_EL2] + msr hcr_el2, x2 +- ldr x2, =(CPTR_EL2_TTA) ++ mov x2, #CPTR_EL2_TTA + msr cptr_el2, x2 + +- ldr x2, =(1 << 15) // Trap CP15 Cr=15 ++ mov x2, #(1 << 15) // Trap CP15 Cr=15 + msr hstr_el2, x2 + + mrs x2, mdcr_el2 diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c -index 4164c5a..b864a24 100644 +index d920942..cf890e3 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c -@@ -23,10 +23,13 @@ +@@ -23,8 +23,14 @@ + #include <linux/genalloc.h> #include <linux/dma-mapping.h> #include <linux/dma-contiguous.h> - #include <linux/of.h> ++#include <linux/of.h> +#include <linux/of_address.h> - #include <linux/platform_device.h> ++#include <linux/platform_device.h> #include <linux/vmalloc.h> #include <linux/swiotlb.h> - #include <linux/amba/bus.h> ++#include <linux/amba/bus.h> +#include <linux/acpi.h> +#include <linux/pci.h> #include <asm/cacheflush.h> -@@ -319,6 +322,63 @@ static int dma_bus_notifier(struct notifier_block *nb, - if (of_property_read_bool(dev->of_node, "dma-coherent")) - set_dma_ops(dev, &coherent_swiotlb_dma_ops); +@@ -423,10 +429,116 @@ out: + return -ENOMEM; + } -+#ifdef CONFIG_ACPI -+ else if (ACPI_HANDLE(dev)) { -+ acpi_status status; -+ int coherent; -+ -+ /* -+ * Kernel defaults to noncoherent ops but ACPI 5.1 spec says arm64 -+ * defaults to coherent. Set coherent ops if _CCA not found or _CCA -+ * found and non-zero. -+ */ -+ status = acpi_check_coherency(ACPI_HANDLE(dev), &coherent); -+ if (ACPI_FAILURE(status) || coherent) -+ set_dma_ops(dev, &coherent_swiotlb_dma_ops); -+ } -+#endif -+ return NOTIFY_OK; -+} -+ -+static int dma_bus_notifier_pci(struct notifier_block *nb, -+ unsigned long event, void *_dev) ++#ifdef CONFIG_PCI ++static void arm64_of_set_dma_ops(void *_dev) +{ + struct device *dev = _dev; + -+ if (event != BUS_NOTIFY_ADD_DEVICE) -+ return NOTIFY_DONE; -+ + /* -+ * PCI devices won't have an of_node but the bridge will. ++ * PCI devices won't have an ACPI handle but the bridge will. + * Search up the device chain until we find an of_node + * to check. + */ @@ -2921,91 +4833,878 @@ index 4164c5a..b864a24 100644 + set_dma_ops(_dev, &coherent_swiotlb_dma_ops); + break; + } ++ dev = dev->parent; ++ } ++} ++#else ++static inline arm64_of_set_dma_ops(void *_dev) {} ++#endif ++ ++ +#ifdef CONFIG_ACPI ++static void arm64_acpi_set_dma_ops(void *_dev) ++{ ++ struct device *dev = _dev; ++ ++ /* ++ * Kernel defaults to noncoherent ops but ACPI 5.1 spec says arm64 ++ * defaults to coherent. For PCI devices, the _CCA is only a default ++ * setting. Individual devices on a PCIe bus may set transaction ++ * ordering and caching attributes individually. Such drivers will ++ * also be resonsible for using the correct DMA ops for the cache ++ * conherence used. ++ * ++ * PCI devices won't have a handle but the bridge will. ++ * Search up the device chain until we find an ACPI handle ++ * to check. ++ */ ++ while (dev) { + if (ACPI_HANDLE(dev)) { + acpi_status status; + int coherent; ++ struct dma_map_ops *ops; + -+ /* -+ * Kernel defaults to noncoherent ops but ACPI 5.1 spec says arm64 -+ * defaults to coherent. Set coherent ops if _CCA not found or _CCA -+ * found and non-zero. -+ */ -+ status = acpi_check_coherency(ACPI_HANDLE(dev), &coherent); -+ if (ACPI_FAILURE(status) || coherent) { -+ set_dma_ops(dev, &coherent_swiotlb_dma_ops); -+ break; -+ } ++ status = acpi_check_coherency(ACPI_HANDLE(dev), ++ &coherent); ++ if (ACPI_FAILURE(status) || coherent) ++ ops = &coherent_swiotlb_dma_ops; ++ else ++ ops = &noncoherent_swiotlb_dma_ops; ++ ++ set_dma_ops(_dev, ops); ++ break; + } -+#endif + dev = dev->parent; + } ++} ++#else ++static inline arm64_acpi_set_dma_ops(void *_dev) {} ++#endif + - return NOTIFY_OK; - } - -@@ -330,6 +390,10 @@ static struct notifier_block amba_bus_nb = { - .notifier_call = dma_bus_notifier, - }; - ++static int dma_bus_notifier(struct notifier_block *nb, ++ unsigned long event, void *_dev) ++{ ++ if (event != BUS_NOTIFY_ADD_DEVICE) ++ return NOTIFY_DONE; ++ ++ if (acpi_disabled) ++ arm64_of_set_dma_ops(_dev); ++ else ++ arm64_acpi_set_dma_ops(_dev); ++ ++ return NOTIFY_OK; ++} ++ ++#ifdef CONFIG_ACPI ++static struct notifier_block platform_bus_nb = { ++ .notifier_call = dma_bus_notifier, ++}; ++ ++static struct notifier_block amba_bus_nb = { ++ .notifier_call = dma_bus_notifier, ++}; ++#endif ++ ++#ifdef CONFIG_PCI +static struct notifier_block pci_bus_nb = { -+ .notifier_call = dma_bus_notifier_pci, ++ .notifier_call = dma_bus_notifier, +}; ++#endif + - extern int swiotlb_late_init_with_default_size(size_t default_size); - static int __init swiotlb_late_init(void) -@@ -341,6 +405,7 @@ static int __init swiotlb_late_init(void) - */ - bus_register_notifier(&platform_bus_type, &platform_bus_nb); - bus_register_notifier(&amba_bustype, &amba_bus_nb); -+ bus_register_notifier(&pci_bus_type, &pci_bus_nb); + { + size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); ++ /* ++ * These must be registered before of_platform_populate(). ++ */ ++#ifdef CONFIG_ACPI ++ bus_register_notifier(&platform_bus_type, &platform_bus_nb); ++ bus_register_notifier(&amba_bustype, &amba_bus_nb); ++#endif ++ ++#ifdef CONFIG_PCI ++ bus_register_notifier(&pci_bus_type, &pci_bus_nb); ++#endif ++ dma_ops = &noncoherent_swiotlb_dma_ops; + return swiotlb_late_init_with_default_size(swiotlb_size); diff --git a/arch/arm64/pci/Makefile b/arch/arm64/pci/Makefile new file mode 100644 -index 0000000..b8d5dbd +index 0000000..7038b51 --- /dev/null +++ b/arch/arm64/pci/Makefile -@@ -0,0 +1 @@ +@@ -0,0 +1,2 @@ +obj-y += pci.o ++obj-$(CONFIG_ACPI) += mmconfig.o +diff --git a/arch/arm64/pci/mmconfig.c b/arch/arm64/pci/mmconfig.c +new file mode 100644 +index 0000000..e83e0d5 +--- /dev/null ++++ b/arch/arm64/pci/mmconfig.c +@@ -0,0 +1,292 @@ ++/* ++ * mmconfig.c - Low-level direct PCI config space access via MMCONFIG ++ * ++ * Borrowed heavily from x86 ++ */ ++ ++#include <linux/pci.h> ++#include <linux/acpi.h> ++#include <linux/init.h> ++#include <linux/bitmap.h> ++#include <linux/dmi.h> ++#include <linux/slab.h> ++#include <linux/mutex.h> ++#include <linux/rculist.h> ++#include <linux/rcupdate.h> ++ ++#define PREFIX "PCI: " ++ ++/* Indicate if the mmcfg resources have been placed into the resource table. */ ++static bool pci_mmcfg_running_state; ++static bool pci_mmcfg_arch_init_failed; ++static DEFINE_MUTEX(pci_mmcfg_lock); ++ ++LIST_HEAD(pci_mmcfg_list); ++ ++struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus) ++{ ++ struct pci_mmcfg_region *cfg; ++ ++ list_for_each_entry_rcu(cfg, &pci_mmcfg_list, list) ++ if (cfg->segment == segment && ++ cfg->start_bus <= bus && bus <= cfg->end_bus) ++ return cfg; ++ ++ return NULL; ++} ++ ++static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg) ++{ ++ void __iomem *addr; ++ u64 start, size; ++ int num_buses; ++ ++ start = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus); ++ num_buses = cfg->end_bus - cfg->start_bus + 1; ++ size = PCI_MMCFG_BUS_OFFSET(num_buses); ++ addr = ioremap_nocache(start, size); ++ if (addr) ++ addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus); ++ return addr; ++} ++ ++void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg) ++{ ++ if (cfg && cfg->virt) { ++ iounmap(cfg->virt + PCI_MMCFG_BUS_OFFSET(cfg->start_bus)); ++ cfg->virt = NULL; ++ } ++} ++ ++void __init pci_mmcfg_arch_free(void) ++{ ++ struct pci_mmcfg_region *cfg; ++ ++ list_for_each_entry(cfg, &pci_mmcfg_list, list) ++ pci_mmcfg_arch_unmap(cfg); ++} ++ ++int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) ++{ ++ cfg->virt = mcfg_ioremap(cfg); ++ if (!cfg->virt) { ++ pr_err(PREFIX "can't map MMCONFIG at %pR\n", &cfg->res); ++ return -ENOMEM; ++ } ++ ++ return 0; ++} ++ ++static void __init pci_mmconfig_remove(struct pci_mmcfg_region *cfg) ++{ ++ if (cfg->res.parent) ++ release_resource(&cfg->res); ++ list_del(&cfg->list); ++ kfree(cfg); ++} ++ ++static void __init free_all_mmcfg(void) ++{ ++ struct pci_mmcfg_region *cfg, *tmp; ++ ++ pci_mmcfg_arch_free(); ++ list_for_each_entry_safe(cfg, tmp, &pci_mmcfg_list, list) ++ pci_mmconfig_remove(cfg); ++} ++ ++static void list_add_sorted(struct pci_mmcfg_region *new) ++{ ++ struct pci_mmcfg_region *cfg; ++ ++ /* keep list sorted by segment and starting bus number */ ++ list_for_each_entry_rcu(cfg, &pci_mmcfg_list, list) { ++ if (cfg->segment > new->segment || ++ (cfg->segment == new->segment && ++ cfg->start_bus >= new->start_bus)) { ++ list_add_tail_rcu(&new->list, &cfg->list); ++ return; ++ } ++ } ++ list_add_tail_rcu(&new->list, &pci_mmcfg_list); ++} ++ ++static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, ++ int end, u64 addr) ++{ ++ struct pci_mmcfg_region *new; ++ struct resource *res; ++ ++ if (addr == 0) ++ return NULL; ++ ++ new = kzalloc(sizeof(*new), GFP_KERNEL); ++ if (!new) ++ return NULL; ++ ++ new->address = addr; ++ new->segment = segment; ++ new->start_bus = start; ++ new->end_bus = end; ++ ++ res = &new->res; ++ res->start = addr + PCI_MMCFG_BUS_OFFSET(start); ++ res->end = addr + PCI_MMCFG_BUS_OFFSET(end + 1) - 1; ++ res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; ++ snprintf(new->name, PCI_MMCFG_RESOURCE_NAME_LEN, ++ "PCI MMCONFIG %04x [bus %02x-%02x]", segment, start, end); ++ res->name = new->name; ++ ++ return new; ++} ++ ++static struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start, ++ int end, u64 addr) ++{ ++ struct pci_mmcfg_region *new; ++ ++ new = pci_mmconfig_alloc(segment, start, end, addr); ++ if (new) { ++ mutex_lock(&pci_mmcfg_lock); ++ list_add_sorted(new); ++ mutex_unlock(&pci_mmcfg_lock); ++ ++ pr_info(PREFIX ++ "MMCONFIG for domain %04x [bus %02x-%02x] at %pR " ++ "(base %#lx)\n", ++ segment, start, end, &new->res, (unsigned long)addr); ++ } ++ ++ return new; ++} ++ ++extern struct acpi_mcfg_fixup __start_acpi_mcfg_fixups[]; ++extern struct acpi_mcfg_fixup __end_acpi_mcfg_fixups[]; ++ ++static int __init pci_parse_mcfg(struct acpi_table_header *header) ++{ ++ struct acpi_table_mcfg *mcfg; ++ struct acpi_mcfg_allocation *cfg_table, *cfg; ++ struct acpi_mcfg_fixup *fixup; ++ struct pci_mmcfg_region *new; ++ unsigned long i; ++ int entries; ++ ++ if (!header) ++ return -EINVAL; ++ ++ mcfg = (struct acpi_table_mcfg *)header; ++ ++ /* how many config structures do we have */ ++ free_all_mmcfg(); ++ entries = 0; ++ i = header->length - sizeof(struct acpi_table_mcfg); ++ while (i >= sizeof(struct acpi_mcfg_allocation)) { ++ entries++; ++ i -= sizeof(struct acpi_mcfg_allocation); ++ } ++ if (entries == 0) { ++ pr_err(PREFIX "MMCONFIG has no entries\n"); ++ return -ENODEV; ++ } ++ ++ fixup = __start_acpi_mcfg_fixups; ++ while (fixup < __end_acpi_mcfg_fixups) { ++ if (!strncmp(fixup->oem_id, header->oem_id, 6) && ++ !strncmp(fixup->oem_table_id, header->oem_table_id, 8)) ++ break; ++ ++fixup; ++ } ++ ++ cfg_table = (struct acpi_mcfg_allocation *) &mcfg[1]; ++ for (i = 0; i < entries; i++) { ++ cfg = &cfg_table[i]; ++ ++ new = pci_mmconfig_add(cfg->pci_segment, cfg->start_bus_number, ++ cfg->end_bus_number, cfg->address); ++ if (!new) { ++ pr_warn(PREFIX "no memory for MCFG entries\n"); ++ free_all_mmcfg(); ++ return -ENOMEM; ++ } ++ if (fixup < __end_acpi_mcfg_fixups) ++ new->fixup = fixup->hook; ++ } ++ ++ return 0; ++} ++ ++int __init pci_mmcfg_arch_init(void) ++{ ++ struct pci_mmcfg_region *cfg; ++ ++ list_for_each_entry(cfg, &pci_mmcfg_list, list) ++ if (pci_mmcfg_arch_map(cfg)) { ++ pci_mmcfg_arch_free(); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static void __init __pci_mmcfg_init(int early) ++{ ++ if (list_empty(&pci_mmcfg_list)) { ++ pr_info("No MCFG table found!\n"); ++ pci_mmcfg_arch_init_failed = true; ++ return; ++ } ++ ++ if (!pci_mmcfg_arch_init()) { ++ pr_info("pci_mmcfg_arch_init failed!\n"); ++ free_all_mmcfg(); ++ pci_mmcfg_arch_init_failed = true; ++ } ++} ++ ++void __init pci_mmcfg_early_init(void) ++{ ++ acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); ++ ++ __pci_mmcfg_init(1); ++} ++ ++static int __init pci_mmcfg_init(void) ++{ ++ pci_mmcfg_early_init(); ++ return 0; ++} ++arch_initcall(pci_mmcfg_init); ++ ++void __init pci_mmcfg_late_init(void) ++{ ++ /* MMCONFIG hasn't been enabled yet, try again */ ++ if (pci_mmcfg_arch_init_failed) { ++ acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); ++ __pci_mmcfg_init(0); ++ } ++} ++ ++static int __init pci_mmcfg_late_insert_resources(void) ++{ ++ struct pci_mmcfg_region *cfg; ++ ++ pci_mmcfg_running_state = true; ++ ++ /* ++ * Attempt to insert the mmcfg resources but not with the busy flag ++ * marked so it won't cause request errors when __request_region is ++ * called. ++ */ ++ list_for_each_entry(cfg, &pci_mmcfg_list, list) ++ if (!cfg->res.parent) ++ insert_resource(&iomem_resource, &cfg->res); ++ ++ return 0; ++} ++ ++/* ++ * Perform MMCONFIG resource insertion after PCI initialization to allow for ++ * misprogrammed MCFG tables that state larger sizes but actually conflict ++ * with other system resources. ++ */ ++late_initcall(pci_mmcfg_late_insert_resources); diff --git a/arch/arm64/pci/pci.c b/arch/arm64/pci/pci.c new file mode 100644 -index 0000000..b03b0eb +index 0000000..0166475 --- /dev/null +++ b/arch/arm64/pci/pci.c -@@ -0,0 +1,28 @@ +@@ -0,0 +1,461 @@ +#include <linux/acpi.h> ++#include <linux/of_address.h> +#include <linux/types.h> +#include <linux/kernel.h> +#include <linux/pci.h> + -+/** -+ * raw_pci_read - Platform-specific PCI config space access. -+ * -+ * Default empty implementation. Replace with an architecture-specific setup -+ * routine, if necessary. ++struct pci_root_info { ++ struct acpi_device *bridge; ++ char name[16]; ++ unsigned int res_num; ++ struct resource *res; ++ resource_size_t *res_offset; ++ struct pci_sysdata sd; ++ u16 segment; ++ u8 start_bus; ++ u8 end_bus; ++}; ++ ++static char __iomem *pci_dev_base(struct pci_mmcfg_region *cfg, ++ unsigned int bus, unsigned int devfn) ++{ ++ return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12)); ++} ++ ++static int __raw_pci_read(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 *value) ++{ ++ char __iomem *addr = pci_dev_base(cfg, bus, devfn) + (reg & ~3); ++ int shift = (reg & 3) * 8; ++ u32 v; ++ ++ v = readl(addr) >> shift; ++ switch (len) { ++ case 1: ++ *value = v & 0xff; ++ break; ++ case 2: ++ *value = v & 0xffff; ++ break; ++ case 4: ++ *value = v; ++ break; ++ } ++ return 0; ++} ++ ++static int __raw_pci_write(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 value) ++{ ++ char __iomem *addr = pci_dev_base(cfg, bus, devfn) + (reg & ~3); ++ int mask = 0, shift = (reg & 3) * 8; ++ u32 v; ++ ++ switch (len) { ++ case 1: ++ mask = 0xff << shift; ++ break; ++ case 2: ++ mask = 0xffff << shift; ++ break; ++ } ++ ++ if (mask) { ++ v = readl(addr) & ~mask; ++ writel(v | (value << shift), addr); ++ } else ++ writel(value, addr); ++ ++ return 0; ++} ++ ++/* ++ * raw_pci_read/write - Platform-specific PCI config space access. + */ -+int __weak raw_pci_read(unsigned int domain, unsigned int bus, -+ unsigned int devfn, int reg, int len, u32 *val) ++int raw_pci_read(unsigned int domain, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 *val) +{ -+ return -EINVAL; ++ struct pci_mmcfg_region *cfg; ++ int ret; ++ ++ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { ++err: *val = -1; ++ return -EINVAL; ++ } ++ ++ rcu_read_lock(); ++ cfg = pci_mmconfig_lookup(domain, bus); ++ if (!cfg || !cfg->virt) { ++ rcu_read_unlock(); ++ goto err; ++ } ++ ++ if (cfg->read) ++ ret = (*cfg->read)(cfg, bus, devfn, reg, len, val); ++ else ++ ret = __raw_pci_read(cfg, bus, devfn, reg, len, val); ++ ++ rcu_read_unlock(); ++ ++ return ret; +} + -+int __weak raw_pci_write(unsigned int domain, unsigned int bus, -+ unsigned int devfn, int reg, int len, u32 val) ++int raw_pci_write(unsigned int domain, unsigned int bus, ++ unsigned int devfn, int reg, int len, u32 val) +{ -+ return -EINVAL; ++ struct pci_mmcfg_region *cfg; ++ int ret; ++ ++ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) ++ return -EINVAL; ++ ++ rcu_read_lock(); ++ cfg = pci_mmconfig_lookup(domain, bus); ++ if (!cfg || !cfg->virt) { ++ rcu_read_unlock(); ++ return -EINVAL; ++ } ++ ++ if (cfg->write) ++ ret = (*cfg->write)(cfg, bus, devfn, reg, len, val); ++ else ++ ret = __raw_pci_write(cfg, bus, devfn, reg, len, val); ++ ++ rcu_read_unlock(); ++ ++ return ret; ++} ++ ++#ifdef CONFIG_ACPI ++static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, ++ int size, u32 *value) ++{ ++ return raw_pci_read(pci_domain_nr(bus), bus->number, ++ devfn, where, size, value); ++} ++ ++static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, ++ int size, u32 value) ++{ ++ return raw_pci_write(pci_domain_nr(bus), bus->number, ++ devfn, where, size, value); ++} ++ ++struct pci_ops pci_root_ops = { ++ .read = pci_read, ++ .write = pci_write, ++}; ++ ++static acpi_status resource_to_addr(struct acpi_resource *resource, ++ struct acpi_resource_address64 *addr) ++{ ++ acpi_status status; ++ ++ memset(addr, 0, sizeof(*addr)); ++ switch (resource->type) { ++ case ACPI_RESOURCE_TYPE_ADDRESS16: ++ case ACPI_RESOURCE_TYPE_ADDRESS32: ++ case ACPI_RESOURCE_TYPE_ADDRESS64: ++ status = acpi_resource_to_address64(resource, addr); ++ if (ACPI_SUCCESS(status) && ++ (addr->resource_type == ACPI_MEMORY_RANGE || ++ addr->resource_type == ACPI_IO_RANGE) && ++ addr->address_length > 0) { ++ return AE_OK; ++ } ++ break; ++ } ++ return AE_ERROR; ++} ++ ++static acpi_status count_resource(struct acpi_resource *acpi_res, void *data) ++{ ++ struct pci_root_info *info = data; ++ struct acpi_resource_address64 addr; ++ acpi_status status; ++ ++ status = resource_to_addr(acpi_res, &addr); ++ if (ACPI_SUCCESS(status)) ++ info->res_num++; ++ return AE_OK; ++} ++ ++static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data) ++{ ++ struct pci_root_info *info = data; ++ struct resource *res; ++ struct acpi_resource_address64 addr; ++ acpi_status status; ++ unsigned long flags; ++ u64 start, end; ++ ++ status = resource_to_addr(acpi_res, &addr); ++ if (!ACPI_SUCCESS(status)) ++ return AE_OK; ++ ++ if (addr.resource_type == ACPI_MEMORY_RANGE) { ++ flags = IORESOURCE_MEM; ++ if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) ++ flags |= IORESOURCE_PREFETCH; ++ } else if (addr.resource_type == ACPI_IO_RANGE) { ++ flags = IORESOURCE_IO; ++ } else ++ return AE_OK; ++ ++ start = addr.minimum + addr.translation_offset; ++ end = addr.maximum + addr.translation_offset; ++ ++ res = &info->res[info->res_num]; ++ res->name = info->name; ++ res->flags = flags; ++ res->start = start; ++ res->end = end; ++ ++ if (flags & IORESOURCE_IO) { ++ unsigned long port; ++ int err; ++ ++ err = pci_register_io_range(start, addr.address_length); ++ if (err) ++ return AE_OK; ++ ++ port = pci_address_to_pio(start); ++ if (port == (unsigned long)-1) { ++ res->start = -1; ++ res->end = -1; ++ return AE_OK; ++ } ++ ++ res->start = port; ++ res->end = res->start + addr.address_length - 1; ++ ++ if (pci_remap_iospace(res, start) < 0) ++ return AE_OK; ++ ++ info->res_offset[info->res_num] = 0; ++ } else ++ info->res_offset[info->res_num] = addr.translation_offset; ++ ++ info->res_num++; ++ ++ return AE_OK; ++} ++ ++static void coalesce_windows(struct pci_root_info *info, unsigned long type) ++{ ++ int i, j; ++ struct resource *res1, *res2; ++ ++ for (i = 0; i < info->res_num; i++) { ++ res1 = &info->res[i]; ++ if (!(res1->flags & type)) ++ continue; ++ ++ for (j = i + 1; j < info->res_num; j++) { ++ res2 = &info->res[j]; ++ if (!(res2->flags & type)) ++ continue; ++ ++ /* ++ * I don't like throwing away windows because then ++ * our resources no longer match the ACPI _CRS, but ++ * the kernel resource tree doesn't allow overlaps. ++ */ ++ if (resource_overlaps(res1, res2)) { ++ res2->start = min(res1->start, res2->start); ++ res2->end = max(res1->end, res2->end); ++ dev_info(&info->bridge->dev, ++ "host bridge window expanded to %pR; %pR ignored\n", ++ res2, res1); ++ res1->flags = 0; ++ } ++ } ++ } ++} ++ ++static void add_resources(struct pci_root_info *info, ++ struct list_head *resources) ++{ ++ int i; ++ struct resource *res, *root, *conflict; ++ ++ coalesce_windows(info, IORESOURCE_MEM); ++ coalesce_windows(info, IORESOURCE_IO); ++ ++ for (i = 0; i < info->res_num; i++) { ++ res = &info->res[i]; ++ ++ if (res->flags & IORESOURCE_MEM) ++ root = &iomem_resource; ++ else if (res->flags & IORESOURCE_IO) ++ root = &ioport_resource; ++ else ++ continue; ++ ++ conflict = insert_resource_conflict(root, res); ++ if (conflict) ++ dev_info(&info->bridge->dev, ++ "ignoring host bridge window %pR (conflicts with %s %pR)\n", ++ res, conflict->name, conflict); ++ else ++ pci_add_resource_offset(resources, res, ++ info->res_offset[i]); ++ } ++} ++ ++static void free_pci_root_info_res(struct pci_root_info *info) ++{ ++ kfree(info->res); ++ info->res = NULL; ++ kfree(info->res_offset); ++ info->res_offset = NULL; ++ info->res_num = 0; ++} ++ ++static void __release_pci_root_info(struct pci_root_info *info) ++{ ++ int i; ++ struct resource *res; ++ ++ for (i = 0; i < info->res_num; i++) { ++ res = &info->res[i]; ++ ++ if (!res->parent) ++ continue; ++ ++ if (!(res->flags & (IORESOURCE_MEM | IORESOURCE_IO))) ++ continue; ++ ++ release_resource(res); ++ } ++ ++ free_pci_root_info_res(info); ++ ++ kfree(info); ++} ++ ++static void release_pci_root_info(struct pci_host_bridge *bridge) ++{ ++ struct pci_root_info *info = bridge->release_data; ++ ++ __release_pci_root_info(info); ++} ++ ++static void probe_pci_root_info(struct pci_root_info *info, ++ struct acpi_device *device, ++ int busnum, int domain) ++{ ++ size_t size; ++ ++ sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum); ++ info->bridge = device; ++ ++ info->res_num = 0; ++ acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_resource, ++ info); ++ if (!info->res_num) ++ return; ++ ++ size = sizeof(*info->res) * info->res_num; ++ info->res = kzalloc_node(size, GFP_KERNEL, info->sd.node); ++ if (!info->res) { ++ info->res_num = 0; ++ return; ++ } ++ ++ size = sizeof(*info->res_offset) * info->res_num; ++ info->res_num = 0; ++ info->res_offset = kzalloc_node(size, GFP_KERNEL, info->sd.node); ++ if (!info->res_offset) { ++ kfree(info->res); ++ info->res = NULL; ++ return; ++ } ++ ++ acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, ++ info); +} + +/* Root bridge scanning */ +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) +{ -+ return NULL; ++ struct acpi_device *device = root->device; ++ struct pci_mmcfg_region *mcfg; ++ struct pci_root_info *info; ++ int domain = root->segment; ++ int busnum = root->secondary.start; ++ LIST_HEAD(resources); ++ struct pci_bus *bus; ++ struct pci_sysdata *sd; ++ int node; ++ ++ /* we need mmconfig */ ++ mcfg = pci_mmconfig_lookup(domain, busnum); ++ if (!mcfg) { ++ pr_err("pci_bus %04x:%02x has no MCFG table\n", ++ domain, busnum); ++ return NULL; ++ } ++ ++ /* temporary hack */ ++ if (mcfg->fixup) ++ (*mcfg->fixup)(root, mcfg); ++ ++ if (domain && !pci_domains_supported) { ++ pr_warn("PCI %04x:%02x: multiple domains not supported.\n", ++ domain, busnum); ++ return NULL; ++ } ++ ++ node = NUMA_NO_NODE; ++ ++ info = kzalloc_node(sizeof(*info), GFP_KERNEL, node); ++ if (!info) { ++ pr_warn("PCI %04x:%02x: ignored (out of memory)\n", ++ domain, busnum); ++ return NULL; ++ } ++ info->segment = domain; ++ info->start_bus = busnum; ++ info->end_bus = root->secondary.end; ++ ++ sd = &info->sd; ++ sd->domain = domain; ++ sd->node = node; ++ sd->companion = device; ++ ++ probe_pci_root_info(info, device, busnum, domain); ++ ++ /* insert busn res at first */ ++ pci_add_resource(&resources, &root->secondary); ++ ++ /* then _CRS resources */ ++ add_resources(info, &resources); ++ ++ bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd, &resources); ++ if (bus) { ++ pci_scan_child_bus(bus); ++ pci_set_host_bridge_release(to_pci_host_bridge(bus->bridge), ++ release_pci_root_info, info); ++ } else { ++ pci_free_resource_list(&resources); ++ __release_pci_root_info(info); ++ } ++ ++ /* After the PCI-E bus has been walked and all devices discovered, ++ * configure any settings of the fabric that might be necessary. ++ */ ++ if (bus) { ++ struct pci_bus *child; ++ ++ list_for_each_entry(child, &bus->children, node) ++ pcie_bus_configure_settings(child); ++ } ++ ++ if (bus && node != NUMA_NO_NODE) ++ dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node); ++ ++ return bus; +} ++ ++#endif /* CONFIG_ACPI */ diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig -index d0f3265..3343080 100644 +index b23fe37..555e226 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -5,8 +5,7 @@ @@ -3036,7 +5735,7 @@ index d0f3265..3343080 100644 help This driver creates entries in /sys/bus/pci/slots/ for all PCI diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile -index 505d4d7..252d0ff 100644 +index c3b2fcb..5a21476 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,11 @@ acpi-y += nvs.o @@ -3051,7 +5750,7 @@ index 505d4d7..252d0ff 100644 acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP) += proc.o -@@ -39,13 +43,14 @@ acpi-y += processor_core.o +@@ -39,7 +43,7 @@ acpi-y += processor_core.o acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o acpi-y += ec.o acpi-$(CONFIG_ACPI_DOCK) += dock.o @@ -3060,6 +5759,7 @@ index 505d4d7..252d0ff 100644 acpi-y += acpi_lpss.o acpi-y += acpi_platform.o acpi-y += acpi_pnp.o +@@ -47,6 +51,7 @@ acpi-y += int340x_thermal.o acpi-y += power.o acpi-y += event.o acpi-y += sysfs.o @@ -3067,21 +5767,6 @@ index 505d4d7..252d0ff 100644 acpi-$(CONFIG_X86) += acpi_cmos_rtc.o acpi-$(CONFIG_DEBUG_FS) += debugfs.o acpi-$(CONFIG_ACPI_NUMA) += numa.o -diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c -index 14cb6c0..5cd017c 100644 ---- a/drivers/acpi/acpica/utresrc.c -+++ b/drivers/acpi/acpica/utresrc.c -@@ -87,7 +87,9 @@ const char *acpi_gbl_io_decode[] = { - - const char *acpi_gbl_ll_decode[] = { - "ActiveHigh", -- "ActiveLow" -+ "ActiveLow", -+ "ActiveBoth", -+ "Reserved" - }; - - const char *acpi_gbl_max_decode[] = { diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 8b67bd0..c412fdb 100644 --- a/drivers/acpi/bus.c @@ -3097,7 +5782,7 @@ index 8b67bd0..c412fdb 100644 message = "platform specific model"; break; diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h -index 4c5cf77..926ca5c 100644 +index 447f6d6..c5ff8ba 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -26,8 +26,13 @@ @@ -3114,7 +5799,7 @@ index 4c5cf77..926ca5c 100644 void acpi_processor_init(void); void acpi_platform_init(void); void acpi_pnp_init(void); -@@ -181,4 +186,10 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev); +@@ -173,4 +178,10 @@ static inline void suspend_nvs_restore(void) {} bool acpi_osi_is_win8(void); #endif @@ -3126,10 +5811,10 @@ index 4c5cf77..926ca5c 100644 + #endif /* _ACPI_INTERNAL_H_ */ diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c -index 3abe9b2..c50757b 100644 +index 9964f70..5c480d5 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c -@@ -326,11 +326,11 @@ acpi_map_lookup_virt(void __iomem *virt, acpi_size size) +@@ -336,11 +336,11 @@ acpi_map_lookup_virt(void __iomem *virt, acpi_size size) return NULL; } @@ -3145,7 +5830,7 @@ index 3abe9b2..c50757b 100644 static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c -index e32321c..4007313 100644 +index ef58f46..5c84e0d 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -64,6 +64,38 @@ static int map_lsapic_id(struct acpi_subtable_header *entry, @@ -3208,10 +5893,10 @@ index e32321c..4007313 100644 exit: diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c new file mode 100644 -index 0000000..ff53eb8 +index 0000000..0d08373 --- /dev/null +++ b/drivers/acpi/property.c -@@ -0,0 +1,586 @@ +@@ -0,0 +1,551 @@ +/* + * ACPI device specific properties support. + * @@ -3295,6 +5980,7 @@ index 0000000..ff53eb8 + const union acpi_object *of_compatible; + struct acpi_hardware_id *hwid; + bool acpi_of = false; ++ int ret; + + /* + * Check if the special PRP0001 ACPI ID is present and in that @@ -3311,13 +5997,17 @@ index 0000000..ff53eb8 + if (!acpi_of) + return; + -+ if (acpi_dev_get_property_array(adev, "compatible", ACPI_TYPE_STRING, -+ &of_compatible)) { -+ acpi_handle_warn(adev->handle, -+ "PRP0001 requires compatible property\n"); -+ return; ++ ret = acpi_dev_get_property_array(adev, "compatible", ACPI_TYPE_STRING, ++ &of_compatible); ++ if (ret) { ++ ret = acpi_dev_get_property(adev, "compatible", ++ ACPI_TYPE_STRING, &of_compatible); ++ if (ret) { ++ acpi_handle_warn(adev->handle, ++ "PRP0001 requires compatible property\n"); ++ return; ++ } + } -+ + adev->data.of_compatible = of_compatible; +} + @@ -3482,25 +6172,21 @@ index 0000000..ff53eb8 + * acpi_dev_get_property_reference - returns handle to the referenced object + * @adev: ACPI device to get property + * @name: Name of the property -+ * @size_prop: Name of the "size" property in referenced object + * @index: Index of the reference to return + * @args: Location to store the returned reference with optional arguments + * + * Find property with @name, verifify that it is a package containing at least + * one object reference and if so, store the ACPI device object pointer to the -+ * target object in @args->adev. ++ * target object in @args->adev. If the reference includes arguments, store ++ * them in the @args->args[] array. + * -+ * If the reference includes arguments (@size_prop is not %NULL) follow the -+ * reference and check whether or not there is an integer property @size_prop -+ * under the target object and if so, whether or not its value matches the -+ * number of arguments that follow the reference. If there's more than one -+ * reference in the property value package, @index is used to select the one to -+ * return. ++ * If there's more than one reference in the property value package, @index is ++ * used to select the one to return. + * + * Return: %0 on success, negative error code on failure. + */ -+int acpi_dev_get_property_reference(struct acpi_device *adev, const char *name, -+ const char *size_prop, size_t index, ++int acpi_dev_get_property_reference(struct acpi_device *adev, ++ const char *name, size_t index, + struct acpi_reference_args *args) +{ + const union acpi_object *element, *end; @@ -3517,7 +6203,7 @@ index 0000000..ff53eb8 + * return that reference then. + */ + if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) { -+ if (size_prop || index) ++ if (index) + return -EINVAL; + + ret = acpi_bus_get_device(obj->reference.handle, &device); @@ -3557,42 +6243,16 @@ index 0000000..ff53eb8 + element++; + nargs = 0; + -+ if (size_prop) { -+ const union acpi_object *prop; ++ /* assume following integer elements are all args */ ++ for (i = 0; element + i < end; i++) { ++ int type = element[i].type; + -+ /* -+ * Find out how many arguments the refenced object -+ * expects by reading its size_prop property. -+ */ -+ ret = acpi_dev_get_property(device, size_prop, -+ ACPI_TYPE_INTEGER, &prop); -+ if (ret) -+ return ret; -+ -+ nargs = prop->integer.value; -+ if (nargs > MAX_ACPI_REFERENCE_ARGS -+ || element + nargs > end) ++ if (type == ACPI_TYPE_INTEGER) ++ nargs++; ++ else if (type == ACPI_TYPE_LOCAL_REFERENCE) ++ break; ++ else + return -EPROTO; -+ -+ /* -+ * Skip to the start of the arguments and verify -+ * that they all are in fact integers. -+ */ -+ for (i = 0; i < nargs; i++) -+ if (element[i].type != ACPI_TYPE_INTEGER) -+ return -EPROTO; -+ } else { -+ /* assume following integer elements are all args */ -+ for (i = 0; element + i < end; i++) { -+ int type = element[i].type; -+ -+ if (type == ACPI_TYPE_INTEGER) -+ nargs++; -+ else if (type == ACPI_TYPE_LOCAL_REFERENCE) -+ break; -+ else -+ return -EPROTO; -+ } + } + + if (idx++ == index) { @@ -3618,11 +6278,11 @@ index 0000000..ff53eb8 + (const union acpi_object **)valptr); +} + -+int acpi_dev_prop_read(struct acpi_device *adev, const char *propname, -+ enum dev_prop_type proptype, void *val) ++int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname, ++ enum dev_prop_type proptype, void *val) +{ + const union acpi_object *obj; -+ int ret = -EINVAL; ++ int ret; + + if (!val) + return -EINVAL; @@ -3658,6 +6318,8 @@ index 0000000..ff53eb8 + return ret; + + *(char **)val = obj->string.pointer; ++ } else { ++ ret = -EINVAL; + } + return ret; +} @@ -3738,23 +6400,30 @@ index 0000000..ff53eb8 + return 0; +} + -+int acpi_dev_prop_read_array(struct acpi_device *adev, const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval) ++int acpi_dev_prop_read(struct acpi_device *adev, const char *propname, ++ enum dev_prop_type proptype, void *val, size_t nval) +{ + const union acpi_object *obj; + const union acpi_object *items; + int ret; + ++ if (val && nval == 1) { ++ ret = acpi_dev_prop_read_single(adev, propname, proptype, val); ++ if (!ret) ++ return ret; ++ } ++ + ret = acpi_dev_get_property_array(adev, propname, ACPI_TYPE_ANY, &obj); + if (ret) + return ret; + + if (!val) + return obj->package.count; ++ else if (nval <= 0) ++ return -EINVAL; + + if (nval > obj->package.count) -+ nval = obj->package.count; ++ return -EOVERFLOW; + + items = obj->package.elements; + switch (proptype) { @@ -3779,49 +6448,17 @@ index 0000000..ff53eb8 + } + return ret; +} -+ -+int acpi_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data) -+{ -+ struct acpi_device *adev = ACPI_COMPANION(dev); -+ struct acpi_device *child; -+ int ret = 0; -+ -+ if (!adev) -+ return -EINVAL; -+ -+ list_for_each_entry(child, &adev->children, node) { -+ ret = fn(dev, child, data); -+ if (ret) -+ break; -+ } -+ return ret; -+} diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index ae44d86..4da55d8 100644 +index 0476e90..9cb5cca 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c -@@ -124,17 +124,43 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias, +@@ -124,17 +124,56 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias, if (list_empty(&acpi_dev->pnp.ids)) return 0; - len = snprintf(modalias, size, "acpi:"); - size -= len; -+ /* -+ * If the device has PRP0001 we expose DT compatible modalias -+ * instead. -+ */ -+ if (acpi_dev->data.of_compatible) { -+ const union acpi_object *of_compatible, *obj; -+ int i; -+ -+ len = snprintf(modalias, size, "of:Nprp0001Tacpi"); -+ -+ of_compatible = acpi_dev->data.of_compatible; -+ for (i = 0; i < of_compatible->package.count; i++) { -+ obj = &of_compatible->package.elements[i]; - +- - list_for_each_entry(id, &acpi_dev->pnp.ids, list) { - count = snprintf(&modalias[len], size, "%s:", id->id); - if (count < 0) @@ -3830,6 +6467,33 @@ index ae44d86..4da55d8 100644 - return -ENOMEM; - len += count; - size -= count; ++ /* ++ * If the device has PRP0001 we expose DT compatible modalias ++ * instead in form of of:NnameTCcompatible. ++ */ ++ if (acpi_dev->data.of_compatible) { ++ struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER }; ++ const union acpi_object *of_compatible, *obj; ++ int i, nval; ++ char *c; ++ ++ acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf); ++ /* DT strings are all in lower case */ ++ for (c = buf.pointer; *c != '\0'; c++) ++ *c = tolower(*c); ++ ++ len = snprintf(modalias, size, "of:N%sT", (char *)buf.pointer); ++ ACPI_FREE(buf.pointer); ++ ++ of_compatible = acpi_dev->data.of_compatible; ++ if (of_compatible->type == ACPI_TYPE_PACKAGE) { ++ nval = of_compatible->package.count; ++ obj = of_compatible->package.elements; ++ } else { /* Must be ACPI_TYPE_STRING. */ ++ nval = 1; ++ obj = of_compatible; ++ } ++ for (i = 0; i < nval; i++, obj++) { + count = snprintf(&modalias[len], size, "C%s", + obj->string.pointer); + if (count < 0) @@ -3856,33 +6520,36 @@ index ae44d86..4da55d8 100644 } modalias[len] = '\0'; -@@ -864,6 +890,51 @@ int acpi_match_device_ids(struct acpi_device *device, +@@ -902,6 +941,51 @@ int acpi_match_device_ids(struct acpi_device *device, } EXPORT_SYMBOL(acpi_match_device_ids); -+/* Performs match for special "PRP0001" shoehorn ACPI ID */ ++/* Performs match against special "PRP0001" shoehorn ACPI ID */ +static bool acpi_of_driver_match_device(struct device *dev, + const struct device_driver *drv) +{ -+ struct acpi_device *adev = ACPI_COMPANION(dev); -+ const union acpi_object *of_compatible; -+ int i; ++ const union acpi_object *of_compatible, *obj; ++ struct acpi_device *adev; ++ int i, nval; ++ ++ adev = ACPI_COMPANION(dev); ++ if (!adev) ++ return false; + -+ /* -+ * If the ACPI device does not have corresponding compatible -+ * property or the driver in question does not have DT matching -+ * table we consider the match succesful (matches the ACPI ID). -+ */ + of_compatible = adev->data.of_compatible; + if (!drv->of_match_table || !of_compatible) -+ return true; ++ return false; + ++ if (of_compatible->type == ACPI_TYPE_PACKAGE) { ++ nval = of_compatible->package.count; ++ obj = of_compatible->package.elements; ++ } else { /* Must be ACPI_TYPE_STRING. */ ++ nval = 1; ++ obj = of_compatible; ++ } + /* Now we can look for the driver DT compatible strings */ -+ for (i = 0; i < of_compatible->package.count; i++) { ++ for (i = 0; i < nval; i++, obj++) { + const struct of_device_id *id; -+ const union acpi_object *obj; -+ -+ obj = &of_compatible->package.elements[i]; + + for (id = drv->of_match_table; id->compatible[0]; id++) + if (!strcasecmp(obj->string.pointer, id->compatible)) @@ -3895,20 +6562,17 @@ index ae44d86..4da55d8 100644 +bool acpi_driver_match_device(struct device *dev, + const struct device_driver *drv) +{ -+ const struct acpi_device_id *id; ++ if (!drv->acpi_match_table) ++ return acpi_of_driver_match_device(dev, drv); + -+ id = acpi_match_device(drv->acpi_match_table, dev); -+ if (!id) -+ return false; -+ -+ return acpi_of_driver_match_device(dev, drv); ++ return !!acpi_match_device(drv->acpi_match_table, dev); +} +EXPORT_SYMBOL_GPL(acpi_driver_match_device); + static void acpi_free_power_resources_lists(struct acpi_device *device) { int i; -@@ -884,6 +955,7 @@ static void acpi_device_release(struct device *dev) +@@ -922,6 +1006,7 @@ static void acpi_device_release(struct device *dev) { struct acpi_device *acpi_dev = to_acpi_device(dev); @@ -3916,7 +6580,38 @@ index ae44d86..4da55d8 100644 acpi_free_pnp_ids(&acpi_dev->pnp); acpi_free_power_resources_lists(acpi_dev); kfree(acpi_dev); -@@ -1888,6 +1960,7 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, +@@ -1304,6 +1389,26 @@ int acpi_device_add(struct acpi_device *device, + return result; + } + ++struct acpi_device *acpi_get_next_child(struct device *dev, ++ struct acpi_device *child) ++{ ++ struct acpi_device *adev = ACPI_COMPANION(dev); ++ struct list_head *head, *next; ++ ++ if (!adev) ++ return NULL; ++ ++ head = &adev->children; ++ if (list_empty(head)) ++ return NULL; ++ ++ if (!child) ++ return list_first_entry(head, struct acpi_device, node); ++ ++ next = child->node.next; ++ return next == head ? NULL : list_entry(next, struct acpi_device, node); ++} ++ + /* -------------------------------------------------------------------------- + Driver Management + -------------------------------------------------------------------------- */ +@@ -1923,9 +2028,11 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, + device->device_type = type; + device->handle = handle; + device->parent = acpi_bus_get_parent(handle); ++ device->fwnode.type = FWNODE_ACPI; acpi_set_device_status(device, sta); acpi_device_get_busid(device); acpi_set_pnp_ids(handle, &device->pnp, type); @@ -4129,10 +6824,10 @@ index 6d5a6cd..47f36d4 100644 int __init diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c -index 07c8c5a..aec9656 100644 +index 371ac12..af325a7 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c -@@ -698,3 +698,29 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs) +@@ -723,3 +723,29 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs) return false; } EXPORT_SYMBOL(acpi_check_dsm); @@ -4163,7 +6858,7 @@ index 07c8c5a..aec9656 100644 +} +EXPORT_SYMBOL(acpi_check_coherency); diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig -index e1b9278..f2e6c9e 100644 +index cd4cccb..edb00c6 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -48,7 +48,7 @@ config ATA_VERBOSE_ERROR @@ -4176,7 +6871,7 @@ index e1b9278..f2e6c9e 100644 help This option adds support for ATA-related ACPI objects. diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c -index f61ddb9..3499bab 100644 +index 06f1d59..df2ea85 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -20,6 +20,9 @@ @@ -4189,7 +6884,7 @@ index f61ddb9..3499bab 100644 #include "ahci.h" static const struct ata_port_info ahci_port_info = { -@@ -87,6 +90,13 @@ static const struct of_device_id ahci_of_match[] = { +@@ -71,6 +74,13 @@ static const struct of_device_id ahci_of_match[] = { }; MODULE_DEVICE_TABLE(of, ahci_of_match); @@ -4203,7 +6898,7 @@ index f61ddb9..3499bab 100644 static struct platform_driver ahci_driver = { .probe = ahci_probe, .remove = ata_platform_remove_one, -@@ -94,6 +104,9 @@ static struct platform_driver ahci_driver = { +@@ -78,6 +88,9 @@ static struct platform_driver ahci_driver = { .name = "ahci", .owner = THIS_MODULE, .of_match_table = ahci_of_match, @@ -4214,7 +6909,7 @@ index f61ddb9..3499bab 100644 }, }; diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c -index f03aab1..b02ba9d 100644 +index 0f8538f..2d8103a 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -28,6 +28,7 @@ @@ -4250,7 +6945,7 @@ index f03aab1..b02ba9d 100644 /** * xgene_ahci_read_id - Read ID data from the specified device * @dev: device -@@ -495,11 +489,6 @@ static int xgene_ahci_probe(struct platform_device *pdev) +@@ -501,11 +495,6 @@ static int xgene_ahci_probe(struct platform_device *pdev) return -ENODEV; } @@ -4262,7 +6957,7 @@ index f03aab1..b02ba9d 100644 /* Due to errata, HW requires full toggle transition */ rc = ahci_platform_enable_clks(hpriv); if (rc) -@@ -512,7 +501,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) +@@ -518,7 +507,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) /* Configure the host controller */ xgene_ahci_hw_init(hpriv); @@ -4271,7 +6966,7 @@ index f03aab1..b02ba9d 100644 hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ; rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info); -@@ -527,6 +516,16 @@ disable_resources: +@@ -533,6 +522,16 @@ disable_resources: return rc; } @@ -4288,7 +6983,7 @@ index f03aab1..b02ba9d 100644 static const struct of_device_id xgene_ahci_of_match[] = { {.compatible = "apm,xgene-ahci"}, {}, -@@ -540,6 +539,7 @@ static struct platform_driver xgene_ahci_driver = { +@@ -546,6 +545,7 @@ static struct platform_driver xgene_ahci_driver = { .name = "xgene-ahci", .owner = THIS_MODULE, .of_match_table = xgene_ahci_of_match, @@ -4297,7 +6992,7 @@ index f03aab1..b02ba9d 100644 }; diff --git a/drivers/base/Makefile b/drivers/base/Makefile -index 4aab26e..0d801cf 100644 +index 6922cd6..53c3fe1 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -4,7 +4,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ @@ -4311,10 +7006,10 @@ index 4aab26e..0d801cf 100644 obj-y += power/ diff --git a/drivers/base/property.c b/drivers/base/property.c new file mode 100644 -index 0000000..7bf5708 +index 0000000..c458458 --- /dev/null +++ b/drivers/base/property.c -@@ -0,0 +1,235 @@ +@@ -0,0 +1,431 @@ +/* + * property.c - Unified device property interface. + * @@ -4333,210 +7028,403 @@ index 0000000..7bf5708 +#include <linux/of.h> + +/** -+ * device_get_property - return a raw property of a device -+ * @dev: Device get the property of ++ * device_property_present - check if a property of a device is present ++ * @dev: Device whose property is being checked + * @propname: Name of the property -+ * @valptr: The raw property value is stored here + * -+ * Function reads property @propname from the device firmware description and -+ * stores the raw value into @valptr if found. Otherwise returns a negative -+ * errno as specified below. ++ * Check if property @propname is present in the device firmware description. ++ */ ++bool device_property_present(struct device *dev, const char *propname) ++{ ++ if (IS_ENABLED(CONFIG_OF) && dev->of_node) ++ return of_property_read_bool(dev->of_node, propname); ++ ++ return !acpi_dev_prop_get(ACPI_COMPANION(dev), propname, NULL); ++} ++EXPORT_SYMBOL_GPL(device_property_present); ++ ++/** ++ * fwnode_property_present - check if a property of a firmware node is present ++ * @fwnode: Firmware node whose property to check ++ * @propname: Name of the property ++ */ ++bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) ++{ ++ if (is_of_node(fwnode)) ++ return of_property_read_bool(of_node(fwnode), propname); ++ else if (is_acpi_node(fwnode)) ++ return !acpi_dev_prop_get(acpi_node(fwnode), propname, NULL); ++ ++ return false; ++} ++EXPORT_SYMBOL_GPL(fwnode_property_present); ++ ++#define OF_DEV_PROP_READ_ARRAY(node, propname, type, val, nval) \ ++ (val) ? of_property_read_##type##_array((node), (propname), (val), (nval)) \ ++ : of_property_count_elems_of_size((node), (propname), sizeof(type)) ++ ++#define DEV_PROP_READ_ARRAY(_dev_, _propname_, _type_, _proptype_, _val_, _nval_) \ ++ IS_ENABLED(CONFIG_OF) && _dev_->of_node ? \ ++ (OF_DEV_PROP_READ_ARRAY(_dev_->of_node, _propname_, _type_, \ ++ _val_, _nval_)) : \ ++ acpi_dev_prop_read(ACPI_COMPANION(_dev_), _propname_, \ ++ _proptype_, _val_, _nval_) ++ ++/** ++ * device_property_read_u8_array - return a u8 array property of a device ++ * @dev: Device to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Function reads an array of u8 properties with @propname from the device ++ * firmware description and stores them to @val if found. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected. + */ -+int device_get_property(struct device *dev, const char *propname, void **valptr) ++int device_property_read_u8_array(struct device *dev, const char *propname, ++ u8 *val, size_t nval) +{ -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_get(dev->of_node, propname, valptr); ++ return DEV_PROP_READ_ARRAY(dev, propname, u8, DEV_PROP_U8, val, nval); ++} ++EXPORT_SYMBOL_GPL(device_property_read_u8_array); + -+ return acpi_dev_prop_get(ACPI_COMPANION(dev), propname, valptr); ++/** ++ * device_property_read_u16_array - return a u16 array property of a device ++ * @dev: Device to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Function reads an array of u16 properties with @propname from the device ++ * firmware description and stores them to @val if found. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected. ++ */ ++int device_property_read_u16_array(struct device *dev, const char *propname, ++ u16 *val, size_t nval) ++{ ++ return DEV_PROP_READ_ARRAY(dev, propname, u16, DEV_PROP_U16, val, nval); +} -+EXPORT_SYMBOL_GPL(device_get_property); ++EXPORT_SYMBOL_GPL(device_property_read_u16_array); + +/** -+ * device_get_child_property - return a raw property of a device's child -+ * @dev: Parent device -+ * @child: Child to get a property of ++ * device_property_read_u32_array - return a u32 array property of a device ++ * @dev: Device to get the property of + * @propname: Name of the property -+ * @valptr: The raw property value is stored here ++ * @val: The values are stored here ++ * @nval: Size of the @val array + * -+ * Function reads property @propname from the firmware description of @child and -+ * stores the raw value into @valptr if found. Otherwise returns a negative -+ * errno as specified below. ++ * Function reads an array of u32 properties with @propname from the device ++ * firmware description and stores them to @val if found. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected. + */ -+int device_get_child_property(struct device *dev, void *child, -+ const char *propname, void **valptr) ++int device_property_read_u32_array(struct device *dev, const char *propname, ++ u32 *val, size_t nval) +{ -+ if (!child) -+ return -EINVAL; ++ return DEV_PROP_READ_ARRAY(dev, propname, u32, DEV_PROP_U32, val, nval); ++} ++EXPORT_SYMBOL_GPL(device_property_read_u32_array); + -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_get(child, propname, valptr); -+ else if (ACPI_COMPANION(dev)) -+ return acpi_dev_prop_get(child, propname, valptr); ++/** ++ * device_property_read_u64_array - return a u64 array property of a device ++ * @dev: Device to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Function reads an array of u64 properties with @propname from the device ++ * firmware description and stores them to @val if found. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected. ++ */ ++int device_property_read_u64_array(struct device *dev, const char *propname, ++ u64 *val, size_t nval) ++{ ++ return DEV_PROP_READ_ARRAY(dev, propname, u64, DEV_PROP_U64, val, nval); ++} ++EXPORT_SYMBOL_GPL(device_property_read_u64_array); + -+ return -ENODATA; ++/** ++ * device_property_read_string_array - return a string array property of device ++ * @dev: Device to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Function reads an array of string properties with @propname from the device ++ * firmware description and stores them to @val if found. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO or %-EILSEQ if the property is not an array of strings, ++ * %-EOVERFLOW if the size of the property is not as expected. ++ */ ++int device_property_read_string_array(struct device *dev, const char *propname, ++ const char **val, size_t nval) ++{ ++ return IS_ENABLED(CONFIG_OF) && dev->of_node ? ++ of_property_read_string_array(dev->of_node, propname, val, nval) : ++ acpi_dev_prop_read(ACPI_COMPANION(dev), propname, ++ DEV_PROP_STRING, val, nval); +} -+EXPORT_SYMBOL_GPL(device_get_child_property); ++EXPORT_SYMBOL_GPL(device_property_read_string_array); + +/** -+ * device_read_property - read a typed property of a device ++ * device_property_read_string - return a string property of a device + * @dev: Device to get the property of + * @propname: Name of the property -+ * @proptype: Type of the property + * @val: The value is stored here + * + * Function reads property @propname from the device firmware description and -+ * stores the value into @val if found. The value is checked to be of type -+ * @proptype. ++ * stores the value into @val if found. The value is checked to be a string. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist, -+ * %-EPROTO if the property type does not match @proptype, -+ * %-EOVERFLOW if the property value is out of bounds of @proptype. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO or %-EILSEQ if the property type is not a string. + */ -+int device_read_property(struct device *dev, const char *propname, -+ enum dev_prop_type proptype, void *val) -+{ -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_read(dev->of_node, propname, proptype, val); ++int device_property_read_string(struct device *dev, const char *propname, ++ const char **val) ++{ ++ return IS_ENABLED(CONFIG_OF) && dev->of_node ? ++ of_property_read_string(dev->of_node, propname, val) : ++ acpi_dev_prop_read(ACPI_COMPANION(dev), propname, ++ DEV_PROP_STRING, val, 1); ++} ++EXPORT_SYMBOL_GPL(device_property_read_string); ++ ++#define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ ++({ \ ++ int _ret_; \ ++ if (is_of_node(_fwnode_)) \ ++ _ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \ ++ _type_, _val_, _nval_); \ ++ else if (is_acpi_node(_fwnode_)) \ ++ _ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \ ++ _proptype_, _val_, _nval_); \ ++ else \ ++ _ret_ = -ENXIO; \ ++ _ret_; \ ++}) + -+ return acpi_dev_prop_read(ACPI_COMPANION(dev), propname, proptype, val); ++/** ++ * fwnode_property_read_u8_array - return a u8 array property of firmware node ++ * @fwnode: Firmware node to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Read an array of u8 properties with @propname from @fwnode and stores them to ++ * @val if found. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected, ++ * %-ENXIO if no suitable firmware interface is present. ++ */ ++int fwnode_property_read_u8_array(struct fwnode_handle *fwnode, ++ const char *propname, u8 *val, size_t nval) ++{ ++ return FWNODE_PROP_READ_ARRAY(fwnode, propname, u8, DEV_PROP_U8, ++ val, nval); +} -+EXPORT_SYMBOL_GPL(device_read_property); ++EXPORT_SYMBOL_GPL(fwnode_property_read_u8_array); + +/** -+ * device_read_child_property - read a typed property of a device's child -+ * @dev: Parent device -+ * @child: Child to read a property of ++ * fwnode_property_read_u16_array - return a u16 array property of firmware node ++ * @fwnode: Firmware node to get the property of + * @propname: Name of the property -+ * @proptype: Type of the property -+ * @val: The value is stored here ++ * @val: The values are stored here ++ * @nval: Size of the @val array + * -+ * Function reads property @propname from the firmware description of @child and -+ * stores the value into @val if found. The value is checked to be of type -+ * @proptype. ++ * Read an array of u16 properties with @propname from @fwnode and store them to ++ * @val if found. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist, -+ * %-EPROTO if the property type does not match @proptype, -+ * %-EOVERFLOW if the property value is out of bounds of @proptype. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected, ++ * %-ENXIO if no suitable firmware interface is present. + */ -+int device_read_child_property(struct device *dev, void *child, -+ const char *propname, enum dev_prop_type proptype, -+ void *val) ++int fwnode_property_read_u16_array(struct fwnode_handle *fwnode, ++ const char *propname, u16 *val, size_t nval) +{ -+ if (!child) -+ return -EINVAL; -+ -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_read(child, propname, proptype, val); -+ else if (ACPI_COMPANION(dev)) -+ return acpi_dev_prop_read(child, propname, proptype, val); -+ -+ return -ENODATA; ++ return FWNODE_PROP_READ_ARRAY(fwnode, propname, u16, DEV_PROP_U16, ++ val, nval); +} -+EXPORT_SYMBOL_GPL(device_read_child_property); ++EXPORT_SYMBOL_GPL(fwnode_property_read_u16_array); + +/** -+ * device_read_property_array - read an array property of a device -+ * @dev: Device to get the property of ++ * fwnode_property_read_u32_array - return a u32 array property of firmware node ++ * @fwnode: Firmware node to get the property of + * @propname: Name of the property -+ * @proptype: Type of the property + * @val: The values are stored here + * @nval: Size of the @val array + * -+ * Function reads an array of properties with @propname from the device -+ * firmware description and stores them to @val if found. All the values -+ * in the array must be of type @proptype. ++ * Read an array of u32 properties with @propname from @fwnode store them to ++ * @val if found. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist, -+ * %-EPROTO if the property type does not match @proptype, -+ * %-EOVERFLOW if the property value is out of bounds of @proptype. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected, ++ * %-ENXIO if no suitable firmware interface is present. + */ -+int device_read_property_array(struct device *dev, const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval) ++int fwnode_property_read_u32_array(struct fwnode_handle *fwnode, ++ const char *propname, u32 *val, size_t nval) +{ -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_read_array(dev->of_node, propname, proptype, -+ val, nval); ++ return FWNODE_PROP_READ_ARRAY(fwnode, propname, u32, DEV_PROP_U32, ++ val, nval); ++} ++EXPORT_SYMBOL_GPL(fwnode_property_read_u32_array); + -+ return acpi_dev_prop_read_array(ACPI_COMPANION(dev), propname, proptype, -+ val, nval); ++/** ++ * fwnode_property_read_u64_array - return a u64 array property firmware node ++ * @fwnode: Firmware node to get the property of ++ * @propname: Name of the property ++ * @val: The values are stored here ++ * @nval: Size of the @val array ++ * ++ * Read an array of u64 properties with @propname from @fwnode and store them to ++ * @val if found. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of numbers, ++ * %-EOVERFLOW if the size of the property is not as expected, ++ * %-ENXIO if no suitable firmware interface is present. ++ */ ++int fwnode_property_read_u64_array(struct fwnode_handle *fwnode, ++ const char *propname, u64 *val, size_t nval) ++{ ++ return FWNODE_PROP_READ_ARRAY(fwnode, propname, u64, DEV_PROP_U64, ++ val, nval); +} -+EXPORT_SYMBOL_GPL(device_read_property_array); ++EXPORT_SYMBOL_GPL(fwnode_property_read_u64_array); + +/** -+ * device_read_child_property_array - read an array property of a device's child -+ * @dev: Parent device -+ * @child: Child to get the property of ++ * fwnode_property_read_string_array - return string array property of a node ++ * @fwnode: Firmware node to get the property of + * @propname: Name of the property -+ * @proptype: Type of the property + * @val: The values are stored here + * @nval: Size of the @val array + * -+ * Function reads an array of properties with @propname from the firmware -+ * description of @child and stores them to @val if found. All the values -+ * in the array must be of type @proptype. ++ * Read an string list property @propname from the given firmware node and store ++ * them to @val if found. + * + * Return: %0 if the property was found (success), + * %-EINVAL if given arguments are not valid, -+ * %-ENODATA if the property does not exist, -+ * %-EPROTO if the property type does not match @proptype, -+ * %-EOVERFLOW if the property value is out of bounds of @proptype. ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO if the property is not an array of strings, ++ * %-EOVERFLOW if the size of the property is not as expected, ++ * %-ENXIO if no suitable firmware interface is present. + */ -+int device_read_child_property_array(struct device *dev, void *child, -+ const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval) ++int fwnode_property_read_string_array(struct fwnode_handle *fwnode, ++ const char *propname, const char **val, ++ size_t nval) +{ -+ if (!child) -+ return -EINVAL; ++ if (is_of_node(fwnode)) ++ return of_property_read_string_array(of_node(fwnode), propname, ++ val, nval); ++ else if (is_acpi_node(fwnode)) ++ return acpi_dev_prop_read(acpi_node(fwnode), propname, ++ DEV_PROP_STRING, val, nval); + -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_dev_prop_read_array(child, propname, proptype, -+ val, nval); -+ else if (ACPI_COMPANION(dev)) -+ return acpi_dev_prop_read_array(child, propname, proptype, -+ val, nval); ++ return -ENXIO; ++} ++EXPORT_SYMBOL_GPL(fwnode_property_read_string_array); + -+ return -ENODATA; ++/** ++ * fwnode_property_read_string - return a string property of a firmware node ++ * @fwnode: Firmware node to get the property of ++ * @propname: Name of the property ++ * @val: The value is stored here ++ * ++ * Read property @propname from the given firmware node and store the value into ++ * @val if found. The value is checked to be a string. ++ * ++ * Return: %0 if the property was found (success), ++ * %-EINVAL if given arguments are not valid, ++ * %-ENODATA if the property does not have a value, ++ * %-EPROTO or %-EILSEQ if the property is not a string, ++ * %-ENXIO if no suitable firmware interface is present. ++ */ ++int fwnode_property_read_string(struct fwnode_handle *fwnode, ++ const char *propname, const char **val) ++{ ++ if (is_of_node(fwnode)) ++ return of_property_read_string(of_node(fwnode),propname, val); ++ else if (is_acpi_node(fwnode)) ++ return acpi_dev_prop_read(acpi_node(fwnode), propname, ++ DEV_PROP_STRING, val, 1); ++ ++ return -ENXIO; +} -+EXPORT_SYMBOL_GPL(device_read_child_property_array); ++EXPORT_SYMBOL_GPL(fwnode_property_read_string); + +/** -+ * device_for_each_child_node - execute function for each child node of device -+ * @dev: Device to run the function for -+ * @fn: Function to run -+ * @data: Additional data to pass to the function ++ * device_get_next_child_node - Return the next child node handle for a device ++ * @dev: Device to find the next child node for. ++ * @child: Handle to one of the device's child nodes or a null handle. + */ -+int device_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data) ++struct fwnode_handle *device_get_next_child_node(struct device *dev, ++ struct fwnode_handle *child) +{ -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) -+ return of_for_each_child_node(dev, fn, data); ++ if (IS_ENABLED(CONFIG_OF) && dev->of_node) { ++ struct device_node *node; ++ ++ node = of_get_next_available_child(dev->of_node, of_node(child)); ++ if (node) ++ return &node->fwnode; ++ } else if (IS_ENABLED(CONFIG_ACPI)) { ++ struct acpi_device *node; + -+ return acpi_for_each_child_node(dev, fn, data); ++ node = acpi_get_next_child(dev, acpi_node(child)); ++ if (node) ++ return acpi_fwnode_handle(node); ++ } ++ return NULL; +} -+EXPORT_SYMBOL_GPL(device_for_each_child_node); ++EXPORT_SYMBOL_GPL(device_get_next_child_node); + -+static int increment_count(struct device *dev, void *child, void *data) ++/** ++ * fwnode_handle_put - Drop reference to a device node ++ * @fwnode: Pointer to the device node to drop the reference to. ++ * ++ * This has to be used when terminating device_for_each_child_node() iteration ++ * with break or return to prevent stale device node references from being left ++ * behind. ++ */ ++void fwnode_handle_put(struct fwnode_handle *fwnode) +{ -+ *((unsigned int *)data) += 1; -+ return 0; ++ if (is_of_node(fwnode)) ++ of_node_put(of_node(fwnode)); +} ++EXPORT_SYMBOL_GPL(fwnode_handle_put); + +/** + * device_get_child_node_count - return the number of child nodes for device @@ -4544,14 +7432,17 @@ index 0000000..7bf5708 + */ +unsigned int device_get_child_node_count(struct device *dev) +{ ++ struct fwnode_handle *child; + unsigned int count = 0; + -+ device_for_each_child_node(dev, increment_count, &count); ++ device_for_each_child_node(dev, child) ++ count++; ++ + return count; +} +EXPORT_SYMBOL_GPL(device_get_child_node_count); diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c -index 5163ec1..1bec05b 100644 +index 43005d4..c9411e6 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -21,6 +21,7 @@ @@ -4572,7 +7463,7 @@ index 5163ec1..1bec05b 100644 static struct clock_event_device __percpu *arch_timer_evt; -@@ -338,8 +340,12 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np) +@@ -370,8 +372,12 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np) if (arch_timer_rate) return; @@ -4587,7 +7478,7 @@ index 5163ec1..1bec05b 100644 if (cntbase) arch_timer_rate = readl_relaxed(cntbase + CNTFRQ); else -@@ -635,20 +641,8 @@ static void __init arch_timer_common_init(void) +@@ -687,20 +693,8 @@ static void __init arch_timer_common_init(void) arch_timer_arch_init(); } @@ -4609,7 +7500,7 @@ index 5163ec1..1bec05b 100644 /* * If HYP mode is available, we know that the physical timer * has been configured to be accessible from PL1. Use it, so -@@ -667,13 +661,31 @@ static void __init arch_timer_init(struct device_node *np) +@@ -719,13 +713,31 @@ static void __init arch_timer_init(struct device_node *np) } } @@ -4645,7 +7536,7 @@ index 5163ec1..1bec05b 100644 static void __init arch_timer_mem_init(struct device_node *np) { -@@ -740,3 +752,71 @@ static void __init arch_timer_mem_init(struct device_node *np) +@@ -792,3 +804,71 @@ static void __init arch_timer_mem_init(struct device_node *np) } CLOCKSOURCE_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem", arch_timer_mem_init); @@ -4717,25 +7608,207 @@ index 5163ec1..1bec05b 100644 + acpi_table_parse(ACPI_SIG_GTDT, arch_timer_acpi_init); +} +#endif +diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c +index 17afc51..c5f7b4e 100644 +--- a/drivers/firmware/dmi_scan.c ++++ b/drivers/firmware/dmi_scan.c +@@ -93,6 +93,12 @@ static void dmi_table(u8 *buf, int len, int num, + const struct dmi_header *dm = (const struct dmi_header *)data; + + /* ++ * 7.45 End-of-Table (Type 127) [SMBIOS reference spec v3.0.0] ++ */ ++ if (dm->type == DMI_ENTRY_END_OF_TABLE) ++ break; ++ ++ /* + * We want to know the total length (formatted area and + * strings) before decoding to make sure we won't run off the + * table in dmi_decode or dmi_string +@@ -107,7 +113,7 @@ static void dmi_table(u8 *buf, int len, int num, + } + } + +-static u32 dmi_base; ++static phys_addr_t dmi_base; + static u16 dmi_len; + static u16 dmi_num; + +@@ -467,7 +473,7 @@ static int __init dmi_present(const u8 *buf) + + if (memcmp(buf, "_SM_", 4) == 0 && + buf[5] < 32 && dmi_checksum(buf, buf[5])) { +- smbios_ver = (buf[6] << 8) + buf[7]; ++ smbios_ver = get_unaligned_be16(buf + 6); + + /* Some BIOS report weird SMBIOS version, fix that up */ + switch (smbios_ver) { +@@ -489,10 +495,9 @@ static int __init dmi_present(const u8 *buf) + buf += 16; + + if (memcmp(buf, "_DMI_", 5) == 0 && dmi_checksum(buf, 15)) { +- dmi_num = (buf[13] << 8) | buf[12]; +- dmi_len = (buf[7] << 8) | buf[6]; +- dmi_base = (buf[11] << 24) | (buf[10] << 16) | +- (buf[9] << 8) | buf[8]; ++ dmi_num = get_unaligned_le16(buf + 12); ++ dmi_len = get_unaligned_le16(buf + 6); ++ dmi_base = get_unaligned_le32(buf + 8); + + if (dmi_walk_early(dmi_decode) == 0) { + if (smbios_ver) { +@@ -514,12 +519,72 @@ static int __init dmi_present(const u8 *buf) + return 1; + } + ++/* ++ * Check for the SMBIOS 3.0 64-bit entry point signature. Unlike the legacy ++ * 32-bit entry point, there is no embedded DMI header (_DMI_) in here. ++ */ ++static int __init dmi_smbios3_present(const u8 *buf) ++{ ++ if (memcmp(buf, "_SM3_", 5) == 0 && ++ buf[6] < 32 && dmi_checksum(buf, buf[6])) { ++ dmi_ver = get_unaligned_be16(buf + 7); ++ dmi_len = get_unaligned_le32(buf + 12); ++ dmi_base = get_unaligned_le64(buf + 16); ++ ++ /* ++ * The 64-bit SMBIOS 3.0 entry point no longer has a field ++ * containing the number of structures present in the table. ++ * Instead, it defines the table size as a maximum size, and ++ * relies on the end-of-table structure type (#127) to be used ++ * to signal the end of the table. ++ * So let's define dmi_num as an upper bound as well: each ++ * structure has a 4 byte header, so dmi_len / 4 is an upper ++ * bound for the number of structures in the table. ++ */ ++ dmi_num = dmi_len / 4; ++ ++ if (dmi_walk_early(dmi_decode) == 0) { ++ pr_info("SMBIOS %d.%d present.\n", ++ dmi_ver >> 8, dmi_ver & 0xFF); ++ dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string)); ++ pr_debug("DMI: %s\n", dmi_ids_string); ++ return 0; ++ } ++ } ++ return 1; ++} ++ + void __init dmi_scan_machine(void) + { + char __iomem *p, *q; + char buf[32]; + + if (efi_enabled(EFI_CONFIG_TABLES)) { ++ /* ++ * According to the DMTF SMBIOS reference spec v3.0.0, it is ++ * allowed to define both the 64-bit entry point (smbios3) and ++ * the 32-bit entry point (smbios), in which case they should ++ * either both point to the same SMBIOS structure table, or the ++ * table pointed to by the 64-bit entry point should contain a ++ * superset of the table contents pointed to by the 32-bit entry ++ * point (section 5.2) ++ * This implies that the 64-bit entry point should have ++ * precedence if it is defined and supported by the OS. If we ++ * have the 64-bit entry point, but fail to decode it, fall ++ * back to the legacy one (if available) ++ */ ++ if (efi.smbios3 != EFI_INVALID_TABLE_ADDR) { ++ p = dmi_early_remap(efi.smbios3, 32); ++ if (p == NULL) ++ goto error; ++ memcpy_fromio(buf, p, 32); ++ dmi_early_unmap(p, 32); ++ ++ if (!dmi_smbios3_present(buf)) { ++ dmi_available = 1; ++ goto out; ++ } ++ } + if (efi.smbios == EFI_INVALID_TABLE_ADDR) + goto error; + +@@ -552,7 +617,7 @@ void __init dmi_scan_machine(void) + memset(buf, 0, 16); + for (q = p; q < p + 0x10000; q += 16) { + memcpy_fromio(buf + 16, q, 16); +- if (!dmi_present(buf)) { ++ if (!dmi_smbios3_present(buf) || !dmi_present(buf)) { + dmi_available = 1; + dmi_early_unmap(p, 0x10000); + goto out; +diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c +index 8590099..9035c1b 100644 +--- a/drivers/firmware/efi/efi.c ++++ b/drivers/firmware/efi/efi.c +@@ -30,6 +30,7 @@ struct efi __read_mostly efi = { + .acpi = EFI_INVALID_TABLE_ADDR, + .acpi20 = EFI_INVALID_TABLE_ADDR, + .smbios = EFI_INVALID_TABLE_ADDR, ++ .smbios3 = EFI_INVALID_TABLE_ADDR, + .sal_systab = EFI_INVALID_TABLE_ADDR, + .boot_info = EFI_INVALID_TABLE_ADDR, + .hcdp = EFI_INVALID_TABLE_ADDR, +@@ -86,6 +87,8 @@ static ssize_t systab_show(struct kobject *kobj, + str += sprintf(str, "ACPI=0x%lx\n", efi.acpi); + if (efi.smbios != EFI_INVALID_TABLE_ADDR) + str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios); ++ if (efi.smbios3 != EFI_INVALID_TABLE_ADDR) ++ str += sprintf(str, "SMBIOS3=0x%lx\n", efi.smbios3); + if (efi.hcdp != EFI_INVALID_TABLE_ADDR) + str += sprintf(str, "HCDP=0x%lx\n", efi.hcdp); + if (efi.boot_info != EFI_INVALID_TABLE_ADDR) +@@ -260,6 +263,7 @@ static __initdata efi_config_table_type_t common_tables[] = { + {MPS_TABLE_GUID, "MPS", &efi.mps}, + {SAL_SYSTEM_TABLE_GUID, "SALsystab", &efi.sal_systab}, + {SMBIOS_TABLE_GUID, "SMBIOS", &efi.smbios}, ++ {SMBIOS3_TABLE_GUID, "SMBIOS 3.0", &efi.smbios3}, + {UGA_IO_PROTOCOL_GUID, "UGA", &efi.uga}, + {NULL_GUID, NULL, NULL}, + }; +diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c +index 75ee059..eb48a1a 100644 +--- a/drivers/firmware/efi/libstub/arm-stub.c ++++ b/drivers/firmware/efi/libstub/arm-stub.c +@@ -247,9 +247,18 @@ unsigned long __init efi_entry(void *handle, efi_system_table_t *sys_table, + goto fail_free_cmdline; + } + } +- if (!fdt_addr) ++ ++ if (fdt_addr) { ++ pr_efi(sys_table, "Using DTB from command line\n"); ++ } else { + /* Look for a device tree configuration table entry. */ + fdt_addr = (uintptr_t)get_fdt(sys_table); ++ if (fdt_addr) ++ pr_efi(sys_table, "Using DTB from configuration table\n"); ++ } ++ ++ if (!fdt_addr) ++ pr_efi(sys_table, "Generating empty DTB\n"); + + status = handle_cmdline_files(sys_table, image, cmdline_ptr, + "initrd=", dram_base + SZ_512M, diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c -index 954b9f6..a1f7e55 100644 +index 954b9f6..13dbd3d 100644 --- a/drivers/gpio/devres.c +++ b/drivers/gpio/devres.c -@@ -109,6 +109,40 @@ struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev, +@@ -109,6 +109,38 @@ struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev, EXPORT_SYMBOL(__devm_gpiod_get_index); /** -+ * devm_get_named_gpiod_from_child - managed dev_get_named_gpiod_from_child() ++ * devm_get_gpiod_from_child - get a GPIO descriptor from a device's child node + * @dev: GPIO consumer + * @child: firmware node (child of @dev) -+ * @propname: name of the firmware property -+ * @index: index of the GPIO in the property value in case of many + * + * GPIO descriptors returned from this function are automatically disposed on + * driver detach. + */ -+struct gpio_desc *devm_get_named_gpiod_from_child(struct device *dev, void *child, -+ const char *propname, int index) ++struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, ++ struct fwnode_handle *child) +{ + struct gpio_desc **dr; + struct gpio_desc *desc; @@ -4745,7 +7818,7 @@ index 954b9f6..a1f7e55 100644 + if (!dr) + return ERR_PTR(-ENOMEM); + -+ desc = dev_get_named_gpiod_from_child(dev, child, propname, index); ++ desc = fwnode_get_named_gpiod(child, "gpios"); + if (IS_ERR(desc)) { + devres_free(dr); + return desc; @@ -4756,7 +7829,7 @@ index 954b9f6..a1f7e55 100644 + + return desc; +} -+EXPORT_SYMBOL(devm_get_named_gpiod_from_child); ++EXPORT_SYMBOL(devm_get_gpiod_from_child); + +/** * devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional() @@ -5170,10 +8243,48 @@ index 41e91d7..99720c8 100644 } diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c -index 687476f..b14c045 100644 +index 05c6275..ba98bb5 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c -@@ -293,6 +293,7 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) +@@ -287,9 +287,45 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) + } + } + ++int acpi_dev_add_driver_gpios(struct acpi_device *adev, ++ const struct acpi_gpio_mapping *gpios) ++{ ++ if (adev && gpios) { ++ adev->driver_gpios = gpios; ++ return 0; ++ } ++ return -EINVAL; ++} ++EXPORT_SYMBOL_GPL(acpi_dev_add_driver_gpios); ++ ++static bool acpi_get_driver_gpio_data(struct acpi_device *adev, ++ const char *name, int index, ++ struct acpi_reference_args *args) ++{ ++ const struct acpi_gpio_mapping *gm; ++ ++ if (!adev->driver_gpios) ++ return false; ++ ++ for (gm = adev->driver_gpios; gm->name; gm++) ++ if (!strcmp(name, gm->name) && gm->data && index < gm->size) { ++ const struct acpi_gpio_params *par = gm->data + index; ++ ++ args->adev = adev; ++ args->args[0] = par->crs_entry_index; ++ args->args[1] = par->line_index; ++ args->args[2] = par->active_low; ++ args->nargs = 3; ++ return true; ++ } ++ ++ return false; ++} ++ struct acpi_gpio_lookup { struct acpi_gpio_info info; int index; @@ -5181,7 +8292,7 @@ index 687476f..b14c045 100644 struct gpio_desc *desc; int n; }; -@@ -306,13 +307,24 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data) +@@ -303,13 +339,24 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data) if (lookup->n++ == lookup->index && !lookup->desc) { const struct acpi_resource_gpio *agpio = &ares->data.gpio; @@ -5209,7 +8320,7 @@ index 687476f..b14c045 100644 } return 1; -@@ -320,40 +332,75 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data) +@@ -317,40 +364,79 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data) /** * acpi_get_gpiod_by_index() - get a GPIO descriptor from device resources @@ -5264,10 +8375,14 @@ index 687476f..b14c045 100644 + dev_dbg(&adev->dev, "GPIO: looking up %s\n", propname); + + memset(&args, 0, sizeof(args)); -+ ret = acpi_dev_get_property_reference(adev, propname, NULL, ++ ret = acpi_dev_get_property_reference(adev, propname, + index, &args); -+ if (ret) -+ return ERR_PTR(ret); ++ if (ret) { ++ bool found = acpi_get_driver_gpio_data(adev, propname, ++ index, &args); ++ if (!found) ++ return ERR_PTR(ret); ++ } + + /* + * The property was found and resolved so need to @@ -5295,7 +8410,7 @@ index 687476f..b14c045 100644 INIT_LIST_HEAD(&resource_list); ret = acpi_dev_get_resources(adev, &resource_list, acpi_find_gpio, &lookup); -@@ -362,8 +409,11 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, +@@ -359,8 +445,11 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, acpi_dev_free_resource_list(&resource_list); @@ -5309,10 +8424,10 @@ index 687476f..b14c045 100644 return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT); } diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c -index c68d037..344bc12 100644 +index e8e98ca..58659db 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c -@@ -1487,14 +1487,36 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, +@@ -1505,14 +1505,36 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id, unsigned int idx, enum gpio_lookup_flags *flags) { @@ -5336,7 +8451,7 @@ index c68d037..344bc12 100644 + suffixes[i]); + } + -+ desc = acpi_get_gpiod_by_index(adev, propname, 0, &info); ++ desc = acpi_get_gpiod_by_index(adev, propname, idx, &info); + if (!IS_ERR(desc) || (PTR_ERR(desc) == -EPROBE_DEFER)) + break; + } @@ -5353,19 +8468,16 @@ index c68d037..344bc12 100644 *flags |= GPIO_ACTIVE_LOW; return desc; -@@ -1695,6 +1717,62 @@ struct gpio_desc *__must_check __gpiod_get_index(struct device *dev, +@@ -1713,6 +1735,61 @@ struct gpio_desc *__must_check __gpiod_get_index(struct device *dev, EXPORT_SYMBOL_GPL(__gpiod_get_index); /** -+ * dev_get_named_gpiod_from_child - obtain a GPIO from firmware node -+ * @dev: parent device -+ * @child: firmware node (child of @dev) -+ * @propname: name of the firmware property -+ * @idx: index of the GPIO in the property value in case of many ++ * fwnode_get_named_gpiod - obtain a GPIO from firmware node ++ * @fwnode: handle of the firmware node ++ * @propname: name of the firmware property representing the GPIO + * + * This function can be used for drivers that get their configuration -+ * from firmware in such a way that some properties are described as child -+ * nodes for the parent device in DT or ACPI. ++ * from firmware. + * + * Function properly finds the corresponding GPIO using whatever is the + * underlying firmware interface and then makes sure that the GPIO @@ -5373,26 +8485,28 @@ index c68d037..344bc12 100644 + * + * In case of error an ERR_PTR() is returned. + */ -+struct gpio_desc *dev_get_named_gpiod_from_child(struct device *dev, void *child, -+ const char *propname, int index) ++struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, ++ const char *propname) +{ + struct gpio_desc *desc = ERR_PTR(-ENODEV); + bool active_low = false; + int ret; + -+ if (!child) ++ if (!fwnode) + return ERR_PTR(-EINVAL); + -+ if (IS_ENABLED(CONFIG_OF) && dev->of_node) { ++ if (is_of_node(fwnode)) { + enum of_gpio_flags flags; + -+ desc = of_get_named_gpiod_flags(child, propname, index, &flags); ++ desc = of_get_named_gpiod_flags(of_node(fwnode), propname, 0, ++ &flags); + if (!IS_ERR(desc)) + active_low = flags & OF_GPIO_ACTIVE_LOW; -+ } else if (ACPI_COMPANION(dev)) { ++ } else if (is_acpi_node(fwnode)) { + struct acpi_gpio_info info; + -+ desc = acpi_get_gpiod_by_index(child, propname, index, &info); ++ desc = acpi_get_gpiod_by_index(acpi_node(fwnode), propname, 0, ++ &info); + if (!IS_ERR(desc)) + active_low = info.active_low; + } @@ -5410,7 +8524,7 @@ index c68d037..344bc12 100644 + + return desc; +} -+EXPORT_SYMBOL_GPL(dev_get_named_gpiod_from_child); ++EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod); + +/** * gpiod_get_index_optional - obtain an optional GPIO from a multi-index GPIO @@ -5442,7 +8556,7 @@ index 9db2b6a..e3a5211 100644 return ERR_PTR(-ENOSYS); } diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c -index 432d363..3563850 100644 +index 432d363..c9c1c8c 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -23,10 +23,9 @@ @@ -5477,59 +8591,17 @@ index 432d363..3563850 100644 input_sync(input); bdata->count = 0; bdata->last_state = state; -@@ -102,21 +100,57 @@ static void gpio_keys_polled_close(struct input_polled_dev *dev) +@@ -102,21 +100,15 @@ static void gpio_keys_polled_close(struct input_polled_dev *dev) pdata->disable(bdev->dev); } -#ifdef CONFIG_OF -+static int gpio_keys_polled_get_button(struct device *dev, void *child, -+ void *data) -+{ -+ struct gpio_keys_platform_data *pdata = data; -+ struct gpio_keys_button *button; -+ struct gpio_desc *desc; -+ -+ desc = devm_get_named_gpiod_from_child(dev, child, "gpios", 0); -+ if (IS_ERR(desc)) { -+ int err = PTR_ERR(desc); -+ -+ if (err != -EPROBE_DEFER) -+ dev_err(dev, "Failed to get gpio flags, error: %d\n", -+ err); -+ return err; -+ } -+ -+ button = &pdata->buttons[pdata->nbuttons++]; -+ button->gpiod = desc; -+ -+ if (device_child_property_read_u32(dev, child, "linux,code", -+ &button->code)) { -+ dev_err(dev, "Button without keycode: %d\n", -+ pdata->nbuttons - 1); -+ return -EINVAL; -+ } -+ -+ device_child_property_read_string(dev, child, "label", &button->desc); -+ -+ if (device_child_property_read_u32(dev, child, "linux,input-type", -+ &button->type)) -+ button->type = EV_KEY; -+ -+ button->wakeup = !device_get_child_property(dev, child, -+ "gpio-key,wakeup", NULL); -+ -+ if (device_child_property_read_u32(dev, child, "debounce-interval", -+ &button->debounce_interval)) -+ button->debounce_interval = 5; -+ -+ return 0; -+} -+ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct device *dev) { - struct device_node *node, *pp; struct gpio_keys_platform_data *pdata; struct gpio_keys_button *button; ++ struct fwnode_handle *child; int error; int nbuttons; - int i; @@ -5543,7 +8615,7 @@ index 432d363..3563850 100644 if (nbuttons == 0) return NULL; -@@ -126,54 +160,14 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct +@@ -126,52 +118,44 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct return ERR_PTR(-ENOMEM); pdata->buttons = (struct gpio_keys_button *)(pdata + 1); @@ -5551,14 +8623,16 @@ index 432d363..3563850 100644 - pdata->rep = !!of_get_property(node, "autorepeat", NULL); - of_property_read_u32(node, "poll-interval", &pdata->poll_interval); -+ pdata->rep = !device_get_property(dev, "autorepeat", NULL); ++ pdata->rep = device_property_present(dev, "autorepeat"); + device_property_read_u32(dev, "poll-interval", &pdata->poll_interval); - i = 0; - for_each_child_of_node(node, pp) { - int gpio; - enum of_gpio_flags flags; -- ++ device_for_each_child_node(dev, child) { ++ struct gpio_desc *desc; + - if (!of_find_property(pp, "gpios", NULL)) { - pdata->nbuttons--; - dev_warn(dev, "Found button without gpios\n"); @@ -5568,43 +8642,53 @@ index 432d363..3563850 100644 - gpio = of_get_gpio_flags(pp, 0, &flags); - if (gpio < 0) { - error = gpio; -- if (error != -EPROBE_DEFER) -- dev_err(dev, -- "Failed to get gpio flags, error: %d\n", -- error); -- return ERR_PTR(error); -- } -- ++ desc = devm_get_gpiod_from_child(dev, child); ++ if (IS_ERR(desc)) { ++ error = PTR_ERR(desc); + if (error != -EPROBE_DEFER) + dev_err(dev, + "Failed to get gpio flags, error: %d\n", + error); ++ fwnode_handle_put(child); + return ERR_PTR(error); + } + - button = &pdata->buttons[i++]; - - button->gpio = gpio; - button->active_low = flags & OF_GPIO_ACTIVE_LOW; -- ++ button = &pdata->buttons[pdata->nbuttons++]; ++ button->gpiod = desc; + - if (of_property_read_u32(pp, "linux,code", &button->code)) { - dev_err(dev, "Button without keycode: 0x%x\n", - button->gpio); -- return ERR_PTR(-EINVAL); -- } -- ++ if (fwnode_property_read_u32(child, "linux,code", &button->code)) { ++ dev_err(dev, "Button without keycode: %d\n", ++ pdata->nbuttons - 1); ++ fwnode_handle_put(child); + return ERR_PTR(-EINVAL); + } + - button->desc = of_get_property(pp, "label", NULL); -- ++ fwnode_property_read_string(child, "label", &button->desc); + - if (of_property_read_u32(pp, "linux,input-type", &button->type)) -- button->type = EV_KEY; -- ++ if (fwnode_property_read_u32(child, "linux,input-type", ++ &button->type)) + button->type = EV_KEY; + - button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL); -- ++ button->wakeup = fwnode_property_present(child, "gpio-key,wakeup"); + - if (of_property_read_u32(pp, "debounce-interval", - &button->debounce_interval)) -- button->debounce_interval = 5; -- } -+ error = device_for_each_child_node(dev, gpio_keys_polled_get_button, -+ pdata); -+ if (error) -+ return ERR_PTR(error); - - if (pdata->nbuttons == 0) - return ERR_PTR(-EINVAL); -@@ -187,14 +181,11 @@ static const struct of_device_id gpio_keys_polled_of_match[] = { ++ if (fwnode_property_read_u32(child, "debounce-interval", ++ &button->debounce_interval)) + button->debounce_interval = 5; + } + +@@ -187,15 +171,6 @@ static const struct of_device_id gpio_keys_polled_of_match[] = { }; MODULE_DEVICE_TABLE(of, gpio_keys_polled_of_match); @@ -5616,15 +8700,11 @@ index 432d363..3563850 100644 - return NULL; -} -#endif -+static const struct acpi_device_id gpio_keys_polled_acpi_match[] = { -+ { "PRP0001" }, /* Device Tree shoehorned into ACPI */ -+ { }, -+}; -+MODULE_DEVICE_TABLE(acpi, gpio_keys_polled_acpi_match); - +- static int gpio_keys_polled_probe(struct platform_device *pdev) { -@@ -259,7 +250,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) + struct device *dev = &pdev->dev; +@@ -259,7 +234,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) for (i = 0; i < pdata->nbuttons; i++) { struct gpio_keys_button *button = &pdata->buttons[i]; struct gpio_keys_button_data *bdata = &bdev->data[i]; @@ -5632,7 +8712,7 @@ index 432d363..3563850 100644 unsigned int type = button->type ?: EV_KEY; if (button->wakeup) { -@@ -267,15 +257,31 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) +@@ -267,15 +241,31 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) return -EINVAL; } @@ -5671,21 +8751,46 @@ index 432d363..3563850 100644 bdata->last_state = -1; bdata->threshold = DIV_ROUND_UP(button->debounce_interval, pdata->poll_interval); -@@ -308,7 +314,8 @@ static struct platform_driver gpio_keys_polled_driver = { +@@ -308,7 +298,7 @@ static struct platform_driver gpio_keys_polled_driver = { .driver = { .name = DRV_NAME, .owner = THIS_MODULE, - .of_match_table = of_match_ptr(gpio_keys_polled_of_match), + .of_match_table = gpio_keys_polled_of_match, -+ .acpi_match_table = gpio_keys_polled_acpi_match, }, }; module_platform_driver(gpio_keys_polled_driver); +diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c +index 60558f7..3b92862 100644 +--- a/drivers/iommu/arm-smmu.c ++++ b/drivers/iommu/arm-smmu.c +@@ -444,7 +444,10 @@ static struct device_node *dev_get_dev_node(struct device *dev) + + while (!pci_is_root_bus(bus)) + bus = bus->parent; +- return bus->bridge->parent->of_node; ++ if (bus->bridge->parent) ++ return bus->bridge->parent->of_node; ++ else ++ return NULL; + } + + return dev->of_node; +@@ -560,6 +563,9 @@ static struct arm_smmu_device *find_smmu_for_device(struct device *dev) + struct arm_smmu_master *master = NULL; + struct device_node *dev_node = dev_get_dev_node(dev); + ++ if (!dev_node) ++ return NULL; ++ + spin_lock(&arm_smmu_devices_lock); + list_for_each_entry(smmu, &arm_smmu_devices, list) { + master = find_smmu_master(smmu, dev_node); diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c -index a0698b4..d2da911 100644 +index aa17ae8..d330dab 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c -@@ -490,9 +490,19 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) +@@ -506,9 +506,19 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) isb(); } @@ -5706,7 +8811,7 @@ index a0698b4..d2da911 100644 } diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c -index dda6dbc..5d9bdd3 100644 +index 38493ff..26e6773 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -33,12 +33,14 @@ @@ -5724,7 +8829,7 @@ index dda6dbc..5d9bdd3 100644 #include <asm/cputype.h> #include <asm/irq.h> -@@ -622,6 +624,13 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) +@@ -641,6 +643,13 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) raw_spin_unlock_irqrestore(&irq_controller_lock, flags); } @@ -5738,7 +8843,7 @@ index dda6dbc..5d9bdd3 100644 #endif #ifdef CONFIG_BL_SWITCHER -@@ -977,6 +986,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, +@@ -996,6 +1005,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, #ifdef CONFIG_SMP set_smp_cross_call(gic_raise_softirq); register_cpu_notifier(&gic_cpu_notifier); @@ -5748,7 +8853,7 @@ index dda6dbc..5d9bdd3 100644 #endif set_handle_irq(gic_handle_irq); } -@@ -1029,3 +1041,107 @@ IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); +@@ -1048,3 +1060,107 @@ IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); #endif @@ -5876,23 +8981,24 @@ index 0fe2f71..9106c6d 100644 + acpi_gic_init(); } diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c -index 57ff20f..681efd5 100644 +index b4518c8..b3c5d9d 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c -@@ -13,22 +13,20 @@ - #include <linux/kernel.h> - #include <linux/platform_device.h> +@@ -12,25 +12,23 @@ + */ + #include <linux/err.h> #include <linux/gpio.h> +#include <linux/gpio/consumer.h> + #include <linux/kernel.h> #include <linux/leds.h> + #include <linux/module.h> -#include <linux/of.h> --#include <linux/of_platform.h> -#include <linux/of_gpio.h> +-#include <linux/of_platform.h> + #include <linux/platform_device.h> ++#include <linux/property.h> #include <linux/slab.h> #include <linux/workqueue.h> - #include <linux/module.h> - #include <linux/err.h> -+#include <linux/property.h> struct gpio_led_data { struct led_classdev cdev; @@ -5903,22 +9009,20 @@ index 57ff20f..681efd5 100644 u8 can_sleep; - u8 active_low; u8 blinking; - int (*platform_gpio_blink_set)(unsigned gpio, int state, +- int (*platform_gpio_blink_set)(unsigned gpio, int state, ++ int (*platform_gpio_blink_set)(struct gpio_desc *desc, int state, unsigned long *delay_on, unsigned long *delay_off); -@@ -40,12 +38,16 @@ static void gpio_led_work(struct work_struct *work) + }; + +@@ -40,12 +38,11 @@ static void gpio_led_work(struct work_struct *work) container_of(work, struct gpio_led_data, work); if (led_dat->blinking) { - led_dat->platform_gpio_blink_set(led_dat->gpio, - led_dat->new_level, - NULL, NULL); -+ int gpio = desc_to_gpio(led_dat->gpiod); -+ int level = led_dat->new_level; -+ -+ if (gpiod_is_active_low(led_dat->gpiod)) -+ level = !level; -+ -+ led_dat->platform_gpio_blink_set(gpio, level, NULL, NULL); ++ led_dat->platform_gpio_blink_set(led_dat->gpiod, ++ led_dat->new_level, NULL, NULL); led_dat->blinking = 0; } else - gpio_set_value_cansleep(led_dat->gpio, led_dat->new_level); @@ -5926,7 +9030,7 @@ index 57ff20f..681efd5 100644 } static void gpio_led_set(struct led_classdev *led_cdev, -@@ -60,9 +62,6 @@ static void gpio_led_set(struct led_classdev *led_cdev, +@@ -60,9 +57,6 @@ static void gpio_led_set(struct led_classdev *led_cdev, else level = 1; @@ -5936,19 +9040,13 @@ index 57ff20f..681efd5 100644 /* Setting GPIOs with I2C/etc requires a task context, and we don't * seem to have a reliable way to know if we're already in one; so * let's just assume the worst. -@@ -72,11 +71,16 @@ static void gpio_led_set(struct led_classdev *led_cdev, +@@ -72,11 +66,11 @@ static void gpio_led_set(struct led_classdev *led_cdev, schedule_work(&led_dat->work); } else { if (led_dat->blinking) { - led_dat->platform_gpio_blink_set(led_dat->gpio, level, -- NULL, NULL); -+ int gpio = desc_to_gpio(led_dat->gpiod); -+ -+ if (gpiod_is_active_low(led_dat->gpiod)) -+ level = !level; -+ -+ led_dat->platform_gpio_blink_set(gpio, level, NULL, -+ NULL); ++ led_dat->platform_gpio_blink_set(led_dat->gpiod, level, + NULL, NULL); led_dat->blinking = 0; } else - gpio_set_value(led_dat->gpio, level); @@ -5956,25 +9054,39 @@ index 57ff20f..681efd5 100644 } } -@@ -85,9 +89,10 @@ static int gpio_blink_set(struct led_classdev *led_cdev, - { - struct gpio_led_data *led_dat = +@@ -87,34 +81,49 @@ static int gpio_blink_set(struct led_classdev *led_cdev, container_of(led_cdev, struct gpio_led_data, cdev); -+ int gpio = desc_to_gpio(led_dat->gpiod); led_dat->blinking = 1; - return led_dat->platform_gpio_blink_set(led_dat->gpio, GPIO_LED_BLINK, -+ return led_dat->platform_gpio_blink_set(gpio, GPIO_LED_BLINK, ++ return led_dat->platform_gpio_blink_set(led_dat->gpiod, GPIO_LED_BLINK, delay_on, delay_off); } -@@ -97,24 +102,33 @@ static int create_gpio_led(const struct gpio_led *template, + static int create_gpio_led(const struct gpio_led *template, + struct gpio_led_data *led_dat, struct device *parent, +- int (*blink_set)(unsigned, int, unsigned long *, unsigned long *)) ++ int (*blink_set)(struct gpio_desc *, int, unsigned long *, ++ unsigned long *)) { int ret, state; - led_dat->gpio = -1; -+ if (!template->gpiod) { ++ led_dat->gpiod = template->gpiod; ++ if (!led_dat->gpiod) { ++ /* ++ * This is the legacy code path for platform code that ++ * still uses GPIO numbers. Ultimately we would like to get ++ * rid of this block completely. ++ */ + unsigned long flags = 0; ++ ++ /* skip leds that aren't available */ ++ if (!gpio_is_valid(template->gpio)) { ++ dev_info(parent, "Skipping unavailable LED gpio %d (%s)\n", ++ template->gpio, template->name); ++ return 0; ++ } - /* skip leds that aren't available */ - if (!gpio_is_valid(template->gpio)) { @@ -5982,19 +9094,12 @@ index 57ff20f..681efd5 100644 - template->gpio, template->name); - return 0; - } -+ /* skip leds that aren't available */ -+ if (!gpio_is_valid(template->gpio)) { -+ dev_info(parent, "Skipping unavailable LED gpio %d (%s)\n", -+ template->gpio, template->name); -+ return 0; -+ } ++ if (template->active_low) ++ flags |= GPIOF_ACTIVE_LOW; - ret = devm_gpio_request(parent, template->gpio, template->name); - if (ret < 0) - return ret; -+ if (template->active_low) -+ flags |= GPIOF_ACTIVE_LOW; -+ + ret = devm_gpio_request_one(parent, template->gpio, flags, + template->name); + if (ret < 0) @@ -6010,12 +9115,11 @@ index 57ff20f..681efd5 100644 - led_dat->gpio = template->gpio; - led_dat->can_sleep = gpio_cansleep(template->gpio); - led_dat->active_low = template->active_low; -+ led_dat->gpiod = template->gpiod; -+ led_dat->can_sleep = gpiod_cansleep(template->gpiod); ++ led_dat->can_sleep = gpiod_cansleep(led_dat->gpiod); led_dat->blinking = 0; if (blink_set) { led_dat->platform_gpio_blink_set = blink_set; -@@ -122,30 +136,24 @@ static int create_gpio_led(const struct gpio_led *template, +@@ -122,30 +131,24 @@ static int create_gpio_led(const struct gpio_led *template, } led_dat->cdev.brightness_set = gpio_led_set; if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) @@ -6049,54 +9153,24 @@ index 57ff20f..681efd5 100644 led_classdev_unregister(&led->cdev); cancel_work_sync(&led->work); } -@@ -161,65 +169,59 @@ static inline int sizeof_gpio_leds_priv(int num_leds) +@@ -161,40 +164,37 @@ static inline int sizeof_gpio_leds_priv(int num_leds) (sizeof(struct gpio_led_data) * num_leds); } -/* Code to create from OpenFirmware platform devices */ -#ifdef CONFIG_OF_GPIO -static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev) -+static int gpio_leds_create_led(struct device *dev, void *child, void *data) -+{ -+ struct gpio_leds_priv *priv = data; -+ struct gpio_led led = {}; -+ const char *state = NULL; -+ -+ led.gpiod = devm_get_named_gpiod_from_child(dev, child, "gpios", 0); -+ if (IS_ERR(led.gpiod)) -+ return PTR_ERR(led.gpiod); -+ -+ device_child_property_read_string(dev, child, "label", &led.name); -+ device_child_property_read_string(dev, child, "linux,default-trigger", -+ &led.default_trigger); -+ -+ device_child_property_read_string(dev, child, "linux,default_state", -+ &state); -+ if (state) { -+ if (!strcmp(state, "keep")) -+ led.default_state = LEDS_GPIO_DEFSTATE_KEEP; -+ else if (!strcmp(state, "on")) -+ led.default_state = LEDS_GPIO_DEFSTATE_ON; -+ else -+ led.default_state = LEDS_GPIO_DEFSTATE_OFF; -+ } -+ -+ if (!device_get_child_property(dev, child, "retain-state-suspended", NULL)) -+ led.retain_state_suspended = 1; -+ -+ return create_gpio_led(&led, &priv->leds[priv->num_leds++], dev, NULL); -+} -+ +static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node, *child; ++ struct device *dev = &pdev->dev; ++ struct fwnode_handle *child; struct gpio_leds_priv *priv; -- int count, ret; -+ int ret, count; + int count, ret; - /* count LEDs in this device, so we know how much to allocate */ - count = of_get_available_child_count(np); -+ count = device_get_child_node_count(&pdev->dev); ++ count = device_get_child_node_count(dev); if (!count) return ERR_PTR(-ENODEV); @@ -6104,13 +9178,15 @@ index 57ff20f..681efd5 100644 - if (of_get_gpio(child, 0) == -EPROBE_DEFER) - return ERR_PTR(-EPROBE_DEFER); - - priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(count), - GFP_KERNEL); +- priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(count), +- GFP_KERNEL); ++ priv = devm_kzalloc(dev, sizeof_gpio_leds_priv(count), GFP_KERNEL); if (!priv) return ERR_PTR(-ENOMEM); - for_each_available_child_of_node(np, child) { -- struct gpio_led led = {}; ++ device_for_each_child_node(dev, child) { + struct gpio_led led = {}; - enum of_gpio_flags flags; - const char *state; - @@ -6121,40 +9197,41 @@ index 57ff20f..681efd5 100644 - of_get_property(child, "linux,default-trigger", NULL); - state = of_get_property(child, "default-state", NULL); - if (state) { -- if (!strcmp(state, "keep")) -- led.default_state = LEDS_GPIO_DEFSTATE_KEEP; -- else if (!strcmp(state, "on")) -- led.default_state = LEDS_GPIO_DEFSTATE_ON; -- else -- led.default_state = LEDS_GPIO_DEFSTATE_OFF; -- } -- ++ const char *state = NULL; ++ ++ led.gpiod = devm_get_gpiod_from_child(dev, child); ++ if (IS_ERR(led.gpiod)) { ++ fwnode_handle_put(child); ++ goto err; ++ } ++ ++ fwnode_property_read_string(child, "label", &led.name); ++ fwnode_property_read_string(child, "linux,default-trigger", ++ &led.default_trigger); ++ ++ if (!fwnode_property_read_string(child, "linux,default_state", ++ &state)) { + if (!strcmp(state, "keep")) + led.default_state = LEDS_GPIO_DEFSTATE_KEEP; + else if (!strcmp(state, "on")) +@@ -203,13 +203,13 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev) + led.default_state = LEDS_GPIO_DEFSTATE_OFF; + } + - if (of_get_property(child, "retain-state-suspended", NULL)) -- led.retain_state_suspended = 1; -- -- ret = create_gpio_led(&led, &priv->leds[priv->num_leds++], ++ if (fwnode_property_present(child, "retain-state-suspended")) + led.retain_state_suspended = 1; + + ret = create_gpio_led(&led, &priv->leds[priv->num_leds++], - &pdev->dev, NULL); -- if (ret < 0) { ++ dev, NULL); + if (ret < 0) { - of_node_put(child); -- goto err; -- } -+ ret = device_for_each_child_node(&pdev->dev, gpio_leds_create_led, priv); -+ if (ret) { -+ for (count = priv->num_leds - 2; count >= 0; count--) -+ delete_gpio_led(&priv->leds[count]); -+ return ERR_PTR(ret); ++ fwnode_handle_put(child); + goto err; + } } - - return priv; -- --err: -- for (count = priv->num_leds - 2; count >= 0; count--) -- delete_gpio_led(&priv->leds[count]); -- return ERR_PTR(-ENODEV); - } - - static const struct of_device_id of_gpio_leds_match[] = { -@@ -228,13 +230,13 @@ static const struct of_device_id of_gpio_leds_match[] = { +@@ -228,12 +228,6 @@ static const struct of_device_id of_gpio_leds_match[] = { }; MODULE_DEVICE_TABLE(of, of_gpio_leds_match); @@ -6165,16 +9242,9 @@ index 57ff20f..681efd5 100644 -} -#endif /* CONFIG_OF_GPIO */ -+static const struct acpi_device_id acpi_gpio_leds_match[] = { -+ { "PRP0001" }, /* Device Tree shoehorned into ACPI */ -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(acpi, acpi_gpio_leds_match); - static int gpio_led_probe(struct platform_device *pdev) { -@@ -263,7 +265,7 @@ static int gpio_led_probe(struct platform_device *pdev) +@@ -261,7 +255,7 @@ static int gpio_led_probe(struct platform_device *pdev) } } } else { @@ -6183,18 +9253,17 @@ index 57ff20f..681efd5 100644 if (IS_ERR(priv)) return PTR_ERR(priv); } -@@ -290,7 +292,8 @@ static struct platform_driver gpio_led_driver = { +@@ -288,7 +282,7 @@ static struct platform_driver gpio_led_driver = { .driver = { .name = "leds-gpio", .owner = THIS_MODULE, - .of_match_table = of_match_ptr(of_gpio_leds_match), + .of_match_table = of_gpio_leds_match, -+ .acpi_match_table = acpi_gpio_leds_match, }, }; diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c -index 634f729..1a760cd 100644 +index 634f729..0a1af93 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -18,7 +18,7 @@ @@ -6255,7 +9324,7 @@ index 634f729..1a760cd 100644 return -ENODEV; } - if (of_find_property(np, "read-only", NULL)) -+ if (!device_get_property(dev, "read-only", NULL)) ++ if (device_property_present(dev, "read-only")) chip->flags |= EE_READONLY; } return 0; @@ -6284,25 +9353,6 @@ index 634f729..1a760cd 100644 } else chip = *(struct spi_eeprom *)spi->dev.platform_data; -@@ -467,11 +459,18 @@ static const struct of_device_id at25_of_match[] = { - }; - MODULE_DEVICE_TABLE(of, at25_of_match); - -+static const struct acpi_device_id at25_acpi_match[] = { -+ { "PRP0001" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(acpi, at25_acpi_match); -+ - static struct spi_driver at25_driver = { - .driver = { - .name = "at25", - .owner = THIS_MODULE, - .of_match_table = at25_of_match, -+ .acpi_match_table = at25_acpi_match, - }, - .probe = at25_probe, - .remove = at25_remove, diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig index 8319c99..6feb6ef3 100644 --- a/drivers/net/ethernet/amd/Kconfig @@ -6317,10 +9367,10 @@ index 8319c99..6feb6ef3 100644 select AMD_XGBE_PHY select BITREVERSE diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c -index ea27383..fd61489 100644 +index 9da3a03..a34cad2 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c -@@ -131,7 +131,7 @@ static unsigned int xgbe_usec_to_riwt(struct xgbe_prv_data *pdata, +@@ -130,7 +130,7 @@ static unsigned int xgbe_usec_to_riwt(struct xgbe_prv_data *pdata, DBGPR("-->xgbe_usec_to_riwt\n"); @@ -6329,7 +9379,7 @@ index ea27383..fd61489 100644 /* * Convert the input usec value to the watchdog timer value. Each -@@ -154,7 +154,7 @@ static unsigned int xgbe_riwt_to_usec(struct xgbe_prv_data *pdata, +@@ -153,7 +153,7 @@ static unsigned int xgbe_riwt_to_usec(struct xgbe_prv_data *pdata, DBGPR("-->xgbe_riwt_to_usec\n"); @@ -6338,7 +9388,7 @@ index ea27383..fd61489 100644 /* * Convert the input watchdog timer value to the usec value. Each -@@ -696,6 +696,18 @@ static int xgbe_read_mmd_regs(struct xgbe_prv_data *pdata, int prtad, +@@ -695,6 +695,18 @@ static int xgbe_read_mmd_regs(struct xgbe_prv_data *pdata, int prtad, else mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff); @@ -6358,10 +9408,10 @@ index ea27383..fd61489 100644 * management interface uses indirect addressing to access the MMD * register sets. This requires accessing of the PCS register in two diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -index b26d758..ca7895c 100644 +index 2349ea9..a04b18b 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -@@ -426,6 +426,9 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata) +@@ -425,6 +425,9 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata) hw_feat->rx_ch_cnt++; hw_feat->tx_ch_cnt++; @@ -6372,7 +9422,7 @@ index b26d758..ca7895c 100644 } diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c -index bdf9cfa..7ab57fd 100644 +index f5a8fa0..338c0ed 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c @@ -124,6 +124,7 @@ @@ -6383,7 +9433,7 @@ index bdf9cfa..7ab57fd 100644 #include "xgbe.h" #include "xgbe-common.h" -@@ -216,6 +217,210 @@ static void xgbe_init_all_fptrs(struct xgbe_prv_data *pdata) +@@ -215,6 +216,205 @@ static void xgbe_init_all_fptrs(struct xgbe_prv_data *pdata) xgbe_init_function_ptrs_desc(&pdata->desc_if); } @@ -6470,12 +9520,7 @@ index bdf9cfa..7ab57fd 100644 + if (!is_valid_ether_addr(pdata->mac_addr)) { + dev_err(dev, "invalid %s acpi property\n", + XGBE_ACPI_MAC_ADDR); -+#if 0 + return -EINVAL; -+#else -+ dev_err(dev, "invalid MAC address, using random address\n"); -+ eth_random_addr(pdata->mac_addr); -+#endif + } + + /* Retrieve the PHY mode - it must be "xgmii" */ @@ -6594,7 +9639,7 @@ index bdf9cfa..7ab57fd 100644 static int xgbe_probe(struct platform_device *pdev) { struct xgbe_prv_data *pdata; -@@ -223,8 +428,6 @@ static int xgbe_probe(struct platform_device *pdev) +@@ -222,8 +422,6 @@ static int xgbe_probe(struct platform_device *pdev) struct xgbe_desc_if *desc_if; struct net_device *netdev; struct device *dev = &pdev->dev; @@ -6603,7 +9648,7 @@ index bdf9cfa..7ab57fd 100644 int ret; DBGPR("--> xgbe_probe\n"); -@@ -240,6 +443,7 @@ static int xgbe_probe(struct platform_device *pdev) +@@ -239,6 +437,7 @@ static int xgbe_probe(struct platform_device *pdev) pdata = netdev_priv(netdev); pdata->netdev = netdev; pdata->pdev = pdev; @@ -6611,7 +9656,7 @@ index bdf9cfa..7ab57fd 100644 pdata->dev = dev; platform_set_drvdata(pdev, netdev); -@@ -265,40 +469,13 @@ static int xgbe_probe(struct platform_device *pdev) +@@ -264,40 +463,13 @@ static int xgbe_probe(struct platform_device *pdev) goto err_io; } @@ -6658,7 +9703,7 @@ index bdf9cfa..7ab57fd 100644 /* Set the DMA mask */ if (!dev->dma_mask) -@@ -309,23 +486,16 @@ static int xgbe_probe(struct platform_device *pdev) +@@ -308,23 +480,16 @@ static int xgbe_probe(struct platform_device *pdev) goto err_io; } @@ -6685,7 +9730,7 @@ index bdf9cfa..7ab57fd 100644 /* Set all the function pointers */ xgbe_init_all_fptrs(pdata); -@@ -338,23 +508,6 @@ static int xgbe_probe(struct platform_device *pdev) +@@ -337,23 +502,6 @@ static int xgbe_probe(struct platform_device *pdev) /* Populate the hardware features */ xgbe_get_all_hw_features(pdata); @@ -6709,7 +9754,7 @@ index bdf9cfa..7ab57fd 100644 /* Set default configuration data */ xgbe_default_config(pdata); -@@ -532,10 +685,22 @@ static int xgbe_resume(struct device *dev) +@@ -531,10 +679,22 @@ static int xgbe_resume(struct device *dev) } #endif /* CONFIG_PM */ @@ -6732,7 +9777,7 @@ index bdf9cfa..7ab57fd 100644 MODULE_DEVICE_TABLE(of, xgbe_of_match); static SIMPLE_DEV_PM_OPS(xgbe_pm_ops, xgbe_suspend, xgbe_resume); -@@ -543,7 +708,12 @@ static SIMPLE_DEV_PM_OPS(xgbe_pm_ops, xgbe_suspend, xgbe_resume); +@@ -542,7 +702,12 @@ static SIMPLE_DEV_PM_OPS(xgbe_pm_ops, xgbe_suspend, xgbe_resume); static struct platform_driver xgbe_driver = { .driver = { .name = "amd-xgbe", @@ -6746,7 +9791,7 @@ index bdf9cfa..7ab57fd 100644 }, .probe = xgbe_probe, diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c -index 6d2221e..095e70a 100644 +index 363b210..5d2c89b 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -119,6 +119,7 @@ @@ -6757,7 +9802,7 @@ index 6d2221e..095e70a 100644 #include "xgbe.h" #include "xgbe-common.h" -@@ -206,25 +207,16 @@ void xgbe_dump_phy_registers(struct xgbe_prv_data *pdata) +@@ -205,25 +206,16 @@ void xgbe_dump_phy_registers(struct xgbe_prv_data *pdata) int xgbe_mdio_register(struct xgbe_prv_data *pdata) { @@ -6784,7 +9829,7 @@ index 6d2221e..095e70a 100644 } /* Register on the MDIO bus (don't probe any PHYs) */ -@@ -253,12 +245,9 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata) +@@ -252,12 +244,9 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata) request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT, MDIO_ID_ARGS(phydev->c45_ids.device_ids[MDIO_MMD_PCS])); @@ -6797,7 +9842,7 @@ index 6d2221e..095e70a 100644 goto err_phy_device; } -@@ -284,8 +273,6 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata) +@@ -283,8 +272,6 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata) pdata->phydev = phydev; @@ -6806,7 +9851,7 @@ index 6d2221e..095e70a 100644 DBGPHY_REGS(pdata); DBGPR("<--xgbe_mdio_register\n"); -@@ -301,9 +288,6 @@ err_mdiobus_register: +@@ -300,9 +287,6 @@ err_mdiobus_register: err_mdiobus_alloc: mdiobus_free(mii); @@ -6817,10 +9862,10 @@ index 6d2221e..095e70a 100644 } diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c -index 37e64cf..2d1e84b 100644 +index a1bf9d1c..fa67203 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c -@@ -240,7 +240,7 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) +@@ -239,7 +239,7 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) snprintf(info->name, sizeof(info->name), "%s", netdev_name(pdata->netdev)); info->owner = THIS_MODULE; @@ -6829,7 +9874,7 @@ index 37e64cf..2d1e84b 100644 info->adjfreq = xgbe_adjfreq; info->adjtime = xgbe_adjtime; info->gettime = xgbe_gettime; -@@ -261,7 +261,7 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) +@@ -260,7 +260,7 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) */ dividend = 50000000; dividend <<= 32; @@ -6839,10 +9884,10 @@ index 37e64cf..2d1e84b 100644 /* Setup the timecounter */ cc->read = xgbe_cc_read; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h -index e9fe6e6..78deed9 100644 +index 789957d..59498eb 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h -@@ -173,6 +173,12 @@ +@@ -172,6 +172,12 @@ #define XGBE_DMA_CLOCK "dma_clk" #define XGBE_PTP_CLOCK "ptp_clk" @@ -6855,7 +9900,7 @@ index e9fe6e6..78deed9 100644 /* Timestamp support - values based on 50MHz PTP clock * 50MHz => 20 nsec */ -@@ -187,8 +193,11 @@ +@@ -186,8 +192,11 @@ #define XGBE_FIFO_SIZE_B(x) (x) #define XGBE_FIFO_SIZE_KB(x) (x * 1024) @@ -6867,7 +9912,7 @@ index e9fe6e6..78deed9 100644 /* Helper macro for descriptor handling * Always use XGBE_GET_DESC_DATA to access the descriptor data * since the index is free-running and needs to be and-ed -@@ -571,6 +580,7 @@ struct xgbe_hw_features { +@@ -569,6 +578,7 @@ struct xgbe_hw_features { struct xgbe_prv_data { struct net_device *netdev; struct platform_device *pdev; @@ -6875,7 +9920,7 @@ index e9fe6e6..78deed9 100644 struct device *dev; /* XGMAC/XPCS related mmio registers */ -@@ -651,6 +661,7 @@ struct xgbe_prv_data { +@@ -649,6 +659,7 @@ struct xgbe_prv_data { unsigned int phy_rx_pause; /* Netdev related settings */ @@ -6883,7 +9928,7 @@ index e9fe6e6..78deed9 100644 netdev_features_t netdev_features; struct napi_struct napi; struct xgbe_mmc_stats mmc_stats; -@@ -660,7 +671,9 @@ struct xgbe_prv_data { +@@ -658,7 +669,9 @@ struct xgbe_prv_data { /* Device clocks */ struct clk *sysclk; @@ -6894,25 +9939,10 @@ index e9fe6e6..78deed9 100644 /* Timestamp support */ spinlock_t tstamp_lock; diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c -index 812d8d6..0fb2971 100644 +index 7ba83ff..29aad5e 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c -@@ -580,9 +580,11 @@ void xgene_enet_reset(struct xgene_enet_pdata *pdata) - { - u32 val; - -- clk_prepare_enable(pdata->clk); -- clk_disable_unprepare(pdata->clk); -- clk_prepare_enable(pdata->clk); -+ if (pdata->clk) { -+ clk_prepare_enable(pdata->clk); -+ clk_disable_unprepare(pdata->clk); -+ clk_prepare_enable(pdata->clk); -+ } - xgene_enet_ecc_init(pdata); - xgene_enet_config_ring_if_assoc(pdata); - -@@ -648,15 +650,20 @@ static int xgene_enet_phy_connect(struct net_device *ndev) +@@ -663,15 +663,20 @@ static int xgene_enet_phy_connect(struct net_device *ndev) struct phy_device *phy_dev; struct device *dev = &pdata->pdev->dev; @@ -6940,7 +9970,7 @@ index 812d8d6..0fb2971 100644 netdev_err(ndev, "Could not connect to PHY\n"); return -ENODEV; } -@@ -666,11 +673,52 @@ static int xgene_enet_phy_connect(struct net_device *ndev) +@@ -681,11 +686,52 @@ static int xgene_enet_phy_connect(struct net_device *ndev) ~SUPPORTED_100baseT_Half & ~SUPPORTED_1000baseT_Half; phy_dev->advertising = phy_dev->supported; @@ -6994,7 +10024,7 @@ index 812d8d6..0fb2971 100644 int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) { struct net_device *ndev = pdata->ndev; -@@ -687,7 +735,7 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) +@@ -702,7 +748,7 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) } } @@ -7003,7 +10033,7 @@ index 812d8d6..0fb2971 100644 netdev_dbg(ndev, "No mdio node in the dts\n"); return -ENXIO; } -@@ -705,7 +753,10 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) +@@ -720,7 +766,10 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) mdio_bus->priv = pdata; mdio_bus->parent = &ndev->dev; @@ -7016,10 +10046,10 @@ index 812d8d6..0fb2971 100644 netdev_err(ndev, "Failed to register MDIO bus\n"); mdiobus_free(mdio_bus); diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -index e4222af..06f8252 100644 +index 1236696..f66598a 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -739,6 +739,42 @@ static const struct net_device_ops xgene_ndev_ops = { +@@ -746,6 +746,42 @@ static const struct net_device_ops xgene_ndev_ops = { .ndo_set_mac_address = xgene_enet_set_mac_address, }; @@ -7062,7 +10092,7 @@ index e4222af..06f8252 100644 static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) { struct platform_device *pdev; -@@ -754,6 +790,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) +@@ -761,6 +797,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) ndev = pdata->ndev; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "enet_csr"); @@ -7071,7 +10101,7 @@ index e4222af..06f8252 100644 if (!res) { dev_err(dev, "Resource enet_csr not defined\n"); return -ENODEV; -@@ -765,6 +803,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) +@@ -772,6 +810,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) } res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_csr"); @@ -7080,7 +10110,7 @@ index e4222af..06f8252 100644 if (!res) { dev_err(dev, "Resource ring_csr not defined\n"); return -ENODEV; -@@ -776,6 +816,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) +@@ -783,6 +823,8 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) } res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_cmd"); @@ -7089,16 +10119,7 @@ index e4222af..06f8252 100644 if (!res) { dev_err(dev, "Resource ring_cmd not defined\n"); return -ENODEV; -@@ -783,7 +825,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) - pdata->ring_cmd_addr = devm_ioremap_resource(dev, res); - if (IS_ERR(pdata->ring_cmd_addr)) { - dev_err(dev, "Unable to retrieve ENET Ring command region\n"); -- return PTR_ERR(pdata->ring_cmd_addr); -+ return PTR_ERR(pdata->ring_cmd_addr); - } - - ret = platform_get_irq(pdev, 0); -@@ -797,22 +839,25 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) +@@ -804,11 +846,13 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) mac = of_get_mac_address(dev->of_node); if (mac) memcpy(ndev->dev_addr, mac, ndev->addr_len); @@ -7111,8 +10132,9 @@ index e4222af..06f8252 100644 + if (pdata->phy_mode < 0) + pdata->phy_mode = acpi_get_phy_mode(dev); if (pdata->phy_mode < 0) { - dev_err(dev, "Incorrect phy-connection-type in DTS\n"); - return -EINVAL; + dev_err(dev, "Unable to get phy-connection-type\n"); + return pdata->phy_mode; +@@ -821,11 +865,12 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) } pdata->clk = devm_clk_get(&pdev->dev, NULL); @@ -7129,25 +10151,16 @@ index e4222af..06f8252 100644 } base_addr = pdata->base_addr; -@@ -824,7 +869,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) - pdata->mcx_mac_csr_addr = base_addr + BLOCK_ETH_MAC_CSR_OFFSET; - pdata->rx_buff_cnt = NUM_PKT_BUF; - -- return ret; -+ return 0; - } - - static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) -@@ -855,7 +900,7 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) - dst_ring_num = xgene_enet_dst_ring_num(pdata->rx_ring); - xgene_enet_cle_bypass(pdata, dst_ring_num, buf_pool->id); +@@ -875,7 +920,7 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) + pdata->port_ops->cle_bypass(pdata, dst_ring_num, buf_pool->id); + pdata->mac_ops->init(pdata); - return ret; + return 0; } - static int xgene_enet_probe(struct platform_device *pdev) -@@ -895,7 +940,7 @@ static int xgene_enet_probe(struct platform_device *pdev) + static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata) +@@ -936,7 +981,7 @@ static int xgene_enet_probe(struct platform_device *pdev) goto err; } @@ -7156,7 +10169,7 @@ index e4222af..06f8252 100644 if (ret) { netdev_err(ndev, "No usable DMA configuration\n"); goto err; -@@ -936,6 +981,14 @@ static int xgene_enet_remove(struct platform_device *pdev) +@@ -984,6 +1029,14 @@ static int xgene_enet_remove(struct platform_device *pdev) return 0; } @@ -7171,7 +10184,7 @@ index e4222af..06f8252 100644 static struct of_device_id xgene_enet_match[] = { {.compatible = "apm,xgene-enet",}, {}, -@@ -947,6 +1000,7 @@ static struct platform_driver xgene_enet_driver = { +@@ -995,6 +1048,7 @@ static struct platform_driver xgene_enet_driver = { .driver = { .name = "xgene-enet", .of_match_table = xgene_enet_match, @@ -7180,7 +10193,7 @@ index e4222af..06f8252 100644 .probe = xgene_enet_probe, .remove = xgene_enet_remove, diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h -index 0815866..60375cc 100644 +index f9958fa..0e06cad 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h @@ -31,6 +31,7 @@ @@ -7192,18 +10205,18 @@ index 0815866..60375cc 100644 #define XGENE_DRV_VERSION "v1.0" diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c -index bcaa41a..ebad872 100644 +index 6cc3cf6..91c36a2 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c -@@ -81,6 +81,7 @@ static const char version[] = - #include <linux/workqueue.h> +@@ -82,6 +82,7 @@ static const char version[] = #include <linux/of.h> #include <linux/of_device.h> + #include <linux/of_gpio.h> +#include <linux/acpi.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> -@@ -2408,6 +2409,14 @@ static struct dev_pm_ops smc_drv_pm_ops = { +@@ -2467,6 +2468,14 @@ static struct dev_pm_ops smc_drv_pm_ops = { .resume = smc_drv_resume, }; @@ -7218,7 +10231,7 @@ index bcaa41a..ebad872 100644 static struct platform_driver smc_driver = { .probe = smc_drv_probe, .remove = smc_drv_remove, -@@ -2416,6 +2425,7 @@ static struct platform_driver smc_driver = { +@@ -2475,6 +2484,7 @@ static struct platform_driver smc_driver = { .owner = THIS_MODULE, .pm = &smc_drv_pm_ops, .of_match_table = of_match_ptr(smc91x_match), @@ -7227,7 +10240,7 @@ index bcaa41a..ebad872 100644 }; diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig -index 65de0ca..360f9a2 100644 +index 75472cf7..bacafe2 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -26,7 +26,7 @@ config AMD_PHY @@ -7240,15 +10253,15 @@ index 65de0ca..360f9a2 100644 Currently supports the AMD 10GbE PHY diff --git a/drivers/net/phy/amd-xgbe-phy.c b/drivers/net/phy/amd-xgbe-phy.c -index f3230ee..d852c6e 100644 +index c456559..d852c6e 100644 --- a/drivers/net/phy/amd-xgbe-phy.c +++ b/drivers/net/phy/amd-xgbe-phy.c -@@ -74,16 +74,19 @@ +@@ -74,15 +74,19 @@ #include <linux/of_platform.h> #include <linux/of_device.h> #include <linux/uaccess.h> +#include <linux/acpi.h> - ++ MODULE_AUTHOR("Tom Lendacky <thomas.lendacky@amd.com>"); MODULE_LICENSE("Dual BSD/GPL"); @@ -7265,10 +10278,39 @@ index f3230ee..d852c6e 100644 #define XGBE_PHY_SPEEDSET_PROPERTY "amd,speed-set" #define XGBE_AN_INT_CMPLT 0x01 -@@ -118,77 +121,6 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver"); +@@ -99,11 +103,9 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver"); + #ifndef MDIO_PMA_10GBR_PMD_CTRL + #define MDIO_PMA_10GBR_PMD_CTRL 0x0096 + #endif +- + #ifndef MDIO_PMA_10GBR_FEC_CTRL + #define MDIO_PMA_10GBR_FEC_CTRL 0x00ab + #endif +- + #ifndef MDIO_AN_XNP + #define MDIO_AN_XNP 0x0016 + #endif +@@ -111,93 +113,14 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver"); + #ifndef MDIO_AN_INTMASK + #define MDIO_AN_INTMASK 0x8001 + #endif +- + #ifndef MDIO_AN_INT + #define MDIO_AN_INT 0x8002 + #endif + +-#ifndef MDIO_AN_KR_CTRL +-#define MDIO_AN_KR_CTRL 0x8003 +-#endif +- + #ifndef MDIO_CTRL1_SPEED1G #define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100) #endif +-#ifndef MDIO_KR_CTRL_PDETECT +-#define MDIO_KR_CTRL_PDETECT 0x01 +-#endif +- -/* SerDes integration register offsets */ -#define SIR0_KR_RT_1 0x002c -#define SIR0_STATUS 0x0040 @@ -7312,7 +10354,6 @@ index f3230ee..d852c6e 100644 -#define SPEED_1000_TXAMP 0xf -#define SPEED_1000_WORD 0x1 - -- -/* SerDes RxTx register offsets */ -#define RXTX_REG20 0x0050 -#define RXTX_REG114 0x01c8 @@ -7343,7 +10384,7 @@ index f3230ee..d852c6e 100644 #define GET_BITS(_var, _index, _width) \ (((_var) >> (_index)) & ((0x1 << (_width)) - 1)) -@@ -198,71 +130,12 @@ do { \ +@@ -207,70 +130,12 @@ do { \ (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ } while (0) @@ -7391,10 +10432,14 @@ index f3230ee..d852c6e 100644 - GET_BITS(XSIR1_IOREAD((_priv), _reg), \ - _reg##_##_field##_INDEX, \ - _reg##_##_field##_WIDTH) -- ++#define XCMU_IOREAD(_priv, _reg) \ ++ ioread16((_priv)->cmu_regs + _reg) + -#define XSIR1_IOWRITE(_priv, _reg, _val) \ - iowrite16((_val), (_priv)->sir1_regs + _reg) -- ++#define XCMU_IOWRITE(_priv, _reg, _val) \ ++ iowrite16((_val), (_priv)->cmu_regs + _reg) + -#define XSIR1_IOWRITE_BITS(_priv, _reg, _field, _val) \ -do { \ - u16 reg_val = XSIR1_IOREAD((_priv), _reg); \ @@ -7403,12 +10448,7 @@ index f3230ee..d852c6e 100644 - _reg##_##_field##_WIDTH, (_val)); \ - XSIR1_IOWRITE((_priv), _reg, reg_val); \ -} while (0) -+#define XCMU_IOREAD(_priv, _reg) \ -+ ioread16((_priv)->cmu_regs + _reg) - -+#define XCMU_IOWRITE(_priv, _reg, _val) \ -+ iowrite16((_val), (_priv)->cmu_regs + _reg) - +- -/* Macros for reading or writing SerDes RxTx registers - * The ioread macros will get bit fields or full values using the - * register definitions formed using the input names @@ -7419,7 +10459,7 @@ index f3230ee..d852c6e 100644 #define XRXTX_IOREAD(_priv, _reg) \ ioread16((_priv)->rxtx_regs + _reg) -@@ -283,6 +156,77 @@ do { \ +@@ -291,6 +156,78 @@ do { \ XRXTX_IOWRITE((_priv), _reg, reg_val); \ } while (0) @@ -7494,10 +10534,11 @@ index f3230ee..d852c6e 100644 + + +DEFINE_SPINLOCK(cmu_lock); - ++ enum amd_xgbe_phy_an { AMD_XGBE_AN_READY = 0, -@@ -309,30 +253,31 @@ enum amd_xgbe_phy_mode { + AMD_XGBE_AN_START, +@@ -316,29 +253,31 @@ enum amd_xgbe_phy_mode { }; enum amd_xgbe_phy_speedset { @@ -7530,12 +10571,20 @@ index f3230ee..d852c6e 100644 /* Maintain link status for re-starting auto-negotiation */ unsigned int link; - enum amd_xgbe_phy_mode mode; - unsigned int speed_set; ++ enum amd_xgbe_phy_mode mode; /* Auto-negotiation state machine support */ struct mutex an_mutex; -@@ -394,33 +339,51 @@ static int amd_xgbe_phy_pcs_power_cycle(struct phy_device *phydev) +@@ -348,7 +287,6 @@ struct amd_xgbe_phy_priv { + enum amd_xgbe_phy_rx kx_state; + struct work_struct an_work; + struct workqueue_struct *an_workqueue; +- unsigned int parallel_detect; + }; + + static int amd_xgbe_an_enable_kr_training(struct phy_device *phydev) +@@ -401,33 +339,51 @@ static int amd_xgbe_phy_pcs_power_cycle(struct phy_device *phydev) static void amd_xgbe_phy_serdes_start_ratechange(struct phy_device *phydev) { struct amd_xgbe_phy_priv *priv = phydev->priv; @@ -7598,7 +10647,7 @@ index f3230ee..d852c6e 100644 } static int amd_xgbe_phy_xgmii_mode(struct phy_device *phydev) -@@ -428,8 +391,8 @@ static int amd_xgbe_phy_xgmii_mode(struct phy_device *phydev) +@@ -435,8 +391,8 @@ static int amd_xgbe_phy_xgmii_mode(struct phy_device *phydev) struct amd_xgbe_phy_priv *priv = phydev->priv; int ret; @@ -7609,7 +10658,7 @@ index f3230ee..d852c6e 100644 if (ret < 0) return ret; -@@ -455,19 +418,30 @@ static int amd_xgbe_phy_xgmii_mode(struct phy_device *phydev) +@@ -462,19 +418,32 @@ static int amd_xgbe_phy_xgmii_mode(struct phy_device *phydev) return ret; /* Set SerDes to 10G speed */ @@ -7624,14 +10673,14 @@ index f3230ee..d852c6e 100644 - XSIR1_IOWRITE_BITS(priv, SIR1_SPEED, PI_SPD_SEL, SPEED_10000_CDR); + XRXTX_IOWRITE_BITS(priv, RXTX_REG3, TX_DATA_RATE, RXTX_FULL_RATE); + XRXTX_IOWRITE_BITS(priv, RXTX_REG3, TX_WORD_MODE, RXTX_66BIT_WORD); -+ + +- XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, RXTX_10000_BLWC); +- XRXTX_IOWRITE_BITS(priv, RXTX_REG114, PQ_REG, RXTX_10000_PQ); + XRXTX_IOWRITE_BITS(priv, RXTX_REG5, TXAMP_CNTL, RXTX_10G_TX_AMP); + + XRXTX_IOWRITE_BITS(priv, RXTX_REG6, RX_DATA_RATE, RXTX_FULL_RATE); + XRXTX_IOWRITE_BITS(priv, RXTX_REG6, RX_WORD_MODE, RXTX_66BIT_WORD); - -- XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, RXTX_10000_BLWC); -- XRXTX_IOWRITE_BITS(priv, RXTX_REG114, PQ_REG, RXTX_10000_PQ); ++ + XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, 0); + + XRXTX_IOWRITE_BITS(priv, RXTX_REG53, RX_PLLSELECT, RXTX_10G_PLL); @@ -7644,10 +10693,12 @@ index f3230ee..d852c6e 100644 + spin_unlock(&cmu_lock); + - priv->mode = AMD_XGBE_MODE_KR; - ++ priv->mode = AMD_XGBE_MODE_KR; ++ return 0; -@@ -505,19 +479,30 @@ static int amd_xgbe_phy_gmii_2500_mode(struct phy_device *phydev) + } + +@@ -510,19 +479,32 @@ static int amd_xgbe_phy_gmii_2500_mode(struct phy_device *phydev) return ret; /* Set SerDes to 2.5G speed */ @@ -7682,10 +10733,12 @@ index f3230ee..d852c6e 100644 + spin_unlock(&cmu_lock); + - priv->mode = AMD_XGBE_MODE_KX; - ++ priv->mode = AMD_XGBE_MODE_KX; ++ return 0; -@@ -555,19 +540,30 @@ static int amd_xgbe_phy_gmii_mode(struct phy_device *phydev) + } + +@@ -558,47 +540,33 @@ static int amd_xgbe_phy_gmii_mode(struct phy_device *phydev) return ret; /* Set SerDes to 1G speed */ @@ -7700,30 +10753,102 @@ index f3230ee..d852c6e 100644 - XSIR1_IOWRITE_BITS(priv, SIR1_SPEED, PI_SPD_SEL, SPEED_1000_CDR); + XRXTX_IOWRITE_BITS(priv, RXTX_REG3, TX_DATA_RATE, RXTX_FIFTH_RATE); + XRXTX_IOWRITE_BITS(priv, RXTX_REG3, TX_WORD_MODE, RXTX_10BIT_WORD); -+ + +- XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, RXTX_1000_BLWC); +- XRXTX_IOWRITE_BITS(priv, RXTX_REG114, PQ_REG, RXTX_1000_PQ); + XRXTX_IOWRITE_BITS(priv, RXTX_REG5, TXAMP_CNTL, RXTX_1G_TX_AMP); -+ + +- amd_xgbe_phy_serdes_complete_ratechange(phydev); + XRXTX_IOWRITE_BITS(priv, RXTX_REG6, RX_DATA_RATE, RXTX_FIFTH_RATE); + XRXTX_IOWRITE_BITS(priv, RXTX_REG6, RX_WORD_MODE, RXTX_10BIT_WORD); -- XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, RXTX_1000_BLWC); -- XRXTX_IOWRITE_BITS(priv, RXTX_REG114, PQ_REG, RXTX_1000_PQ); +- return 0; +-} + XRXTX_IOWRITE_BITS(priv, RXTX_REG20, BLWC_ENA, 1); -+ + +-static int amd_xgbe_phy_cur_mode(struct phy_device *phydev, +- enum amd_xgbe_phy_mode *mode) +-{ +- int ret; +- +- ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL2); +- if (ret < 0) +- return ret; + XRXTX_IOWRITE_BITS(priv, RXTX_REG53, RX_PLLSELECT, RXTX_1G_PLL); + XRXTX_IOWRITE_BITS(priv, RXTX_REG53, TX_PLLSELECT, RXTX_1G_PLL); + XRXTX_IOWRITE_BITS(priv, RXTX_REG53, PI_SPD_SEL_CDR, RXTX_1G_CDR); -+ + +- if ((ret & MDIO_PCS_CTRL2_TYPE) == MDIO_PCS_CTRL2_10GBR) +- *mode = AMD_XGBE_MODE_KR; +- else +- *mode = AMD_XGBE_MODE_KX; + XRXTX_IOWRITE_BITS(priv, RXTX_REG114, PQ_REG, RXTX_1G_PQ); - amd_xgbe_phy_serdes_complete_ratechange(phydev); +- return 0; +-} ++ amd_xgbe_phy_serdes_complete_ratechange(phydev); +-static bool amd_xgbe_phy_in_kr_mode(struct phy_device *phydev) +-{ +- enum amd_xgbe_phy_mode mode; + spin_unlock(&cmu_lock); -+ - priv->mode = AMD_XGBE_MODE_KX; - return 0; -@@ -639,13 +635,9 @@ static enum amd_xgbe_phy_an amd_xgbe_an_tx_training(struct phy_device *phydev, +- if (amd_xgbe_phy_cur_mode(phydev, &mode)) +- return false; ++ priv->mode = AMD_XGBE_MODE_KX; + +- return (mode == AMD_XGBE_MODE_KR); ++ return 0; + } + + static int amd_xgbe_phy_switch_mode(struct phy_device *phydev) +@@ -607,7 +575,7 @@ static int amd_xgbe_phy_switch_mode(struct phy_device *phydev) + int ret; + + /* If we are in KR switch to KX, and vice-versa */ +- if (amd_xgbe_phy_in_kr_mode(phydev)) { ++ if (priv->mode == AMD_XGBE_MODE_KR) { + if (priv->speed_set == AMD_XGBE_PHY_SPEEDSET_1000_10000) + ret = amd_xgbe_phy_gmii_mode(phydev); + else +@@ -619,20 +587,15 @@ static int amd_xgbe_phy_switch_mode(struct phy_device *phydev) + return ret; + } + +-static int amd_xgbe_phy_set_mode(struct phy_device *phydev, +- enum amd_xgbe_phy_mode mode) ++static enum amd_xgbe_phy_an amd_xgbe_an_switch_mode(struct phy_device *phydev) + { +- enum amd_xgbe_phy_mode cur_mode; + int ret; + +- ret = amd_xgbe_phy_cur_mode(phydev, &cur_mode); +- if (ret) +- return ret; +- +- if (mode != cur_mode) +- ret = amd_xgbe_phy_switch_mode(phydev); ++ ret = amd_xgbe_phy_switch_mode(phydev); ++ if (ret < 0) ++ return AMD_XGBE_AN_ERROR; + +- return ret; ++ return AMD_XGBE_AN_START; + } + + static enum amd_xgbe_phy_an amd_xgbe_an_tx_training(struct phy_device *phydev, +@@ -643,8 +606,8 @@ static enum amd_xgbe_phy_an amd_xgbe_an_tx_training(struct phy_device *phydev, + + *state = AMD_XGBE_RX_COMPLETE; + +- /* If we're not in KR mode then we're done */ +- if (!amd_xgbe_phy_in_kr_mode(phydev)) ++ /* If we're in KX mode then we're done */ ++ if (priv->mode == AMD_XGBE_MODE_KX) + return AMD_XGBE_AN_EVENT; + + /* Enable/Disable FEC */ +@@ -672,13 +635,9 @@ static enum amd_xgbe_phy_an amd_xgbe_an_tx_training(struct phy_device *phydev, if (ret < 0) return AMD_XGBE_AN_ERROR; @@ -7737,7 +10862,209 @@ index f3230ee..d852c6e 100644 return AMD_XGBE_AN_EVENT; } -@@ -1248,29 +1240,188 @@ unlock: +@@ -702,6 +661,7 @@ static enum amd_xgbe_phy_an amd_xgbe_an_tx_xnp(struct phy_device *phydev, + static enum amd_xgbe_phy_an amd_xgbe_an_rx_bpa(struct phy_device *phydev, + enum amd_xgbe_phy_rx *state) + { ++ struct amd_xgbe_phy_priv *priv = phydev->priv; + unsigned int link_support; + int ret, ad_reg, lp_reg; + +@@ -711,9 +671,9 @@ static enum amd_xgbe_phy_an amd_xgbe_an_rx_bpa(struct phy_device *phydev, + return AMD_XGBE_AN_ERROR; + + /* Check for a supported mode, otherwise restart in a different one */ +- link_support = amd_xgbe_phy_in_kr_mode(phydev) ? 0x80 : 0x20; ++ link_support = (priv->mode == AMD_XGBE_MODE_KR) ? 0x80 : 0x20; + if (!(ret & link_support)) +- return AMD_XGBE_AN_INCOMPAT_LINK; ++ return amd_xgbe_an_switch_mode(phydev); + + /* Check Extended Next Page support */ + ad_reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE); +@@ -754,7 +714,7 @@ static enum amd_xgbe_phy_an amd_xgbe_an_start(struct phy_device *phydev) + int ret; + + /* Be sure we aren't looping trying to negotiate */ +- if (amd_xgbe_phy_in_kr_mode(phydev)) { ++ if (priv->mode == AMD_XGBE_MODE_KR) { + if (priv->kr_state != AMD_XGBE_RX_READY) + return AMD_XGBE_AN_NO_LINK; + priv->kr_state = AMD_XGBE_RX_BPA; +@@ -817,13 +777,6 @@ static enum amd_xgbe_phy_an amd_xgbe_an_start(struct phy_device *phydev) + /* Enable and start auto-negotiation */ + phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_INT, 0); + +- ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_KR_CTRL); +- if (ret < 0) +- return AMD_XGBE_AN_ERROR; +- +- ret |= MDIO_KR_CTRL_PDETECT; +- phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_KR_CTRL, ret); +- + ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1); + if (ret < 0) + return AMD_XGBE_AN_ERROR; +@@ -864,8 +817,8 @@ static enum amd_xgbe_phy_an amd_xgbe_an_page_received(struct phy_device *phydev) + enum amd_xgbe_phy_rx *state; + int ret; + +- state = amd_xgbe_phy_in_kr_mode(phydev) ? &priv->kr_state +- : &priv->kx_state; ++ state = (priv->mode == AMD_XGBE_MODE_KR) ? &priv->kr_state ++ : &priv->kx_state; + + switch (*state) { + case AMD_XGBE_RX_BPA: +@@ -885,13 +838,7 @@ static enum amd_xgbe_phy_an amd_xgbe_an_page_received(struct phy_device *phydev) + + static enum amd_xgbe_phy_an amd_xgbe_an_incompat_link(struct phy_device *phydev) + { +- int ret; +- +- ret = amd_xgbe_phy_switch_mode(phydev); +- if (ret) +- return AMD_XGBE_AN_ERROR; +- +- return AMD_XGBE_AN_START; ++ return amd_xgbe_an_switch_mode(phydev); + } + + static void amd_xgbe_an_state_machine(struct work_struct *work) +@@ -904,10 +851,6 @@ static void amd_xgbe_an_state_machine(struct work_struct *work) + int sleep; + unsigned int an_supported = 0; + +- /* Start in KX mode */ +- if (amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KX)) +- priv->an_state = AMD_XGBE_AN_ERROR; +- + while (1) { + mutex_lock(&priv->an_mutex); + +@@ -915,9 +858,8 @@ static void amd_xgbe_an_state_machine(struct work_struct *work) + + switch (priv->an_state) { + case AMD_XGBE_AN_START: +- an_supported = 0; +- priv->parallel_detect = 0; + priv->an_state = amd_xgbe_an_start(phydev); ++ an_supported = 0; + break; + + case AMD_XGBE_AN_EVENT: +@@ -934,7 +876,6 @@ static void amd_xgbe_an_state_machine(struct work_struct *work) + break; + + case AMD_XGBE_AN_COMPLETE: +- priv->parallel_detect = an_supported ? 0 : 1; + netdev_info(phydev->attached_dev, "%s successful\n", + an_supported ? "Auto negotiation" + : "Parallel detection"); +@@ -1069,6 +1010,7 @@ static int amd_xgbe_phy_config_aneg(struct phy_device *phydev) + { + struct amd_xgbe_phy_priv *priv = phydev->priv; + u32 mmd_mask = phydev->c45_ids.devices_in_package; ++ int ret; + + if (phydev->autoneg != AUTONEG_ENABLE) + return amd_xgbe_phy_setup_forced(phydev); +@@ -1077,6 +1019,11 @@ static int amd_xgbe_phy_config_aneg(struct phy_device *phydev) + if (!(mmd_mask & MDIO_DEVS_AN)) + return -EINVAL; + ++ /* Get the current speed mode */ ++ ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL2); ++ if (ret < 0) ++ return ret; ++ + /* Start/Restart the auto-negotiation state machine */ + mutex_lock(&priv->an_mutex); + priv->an_result = AMD_XGBE_AN_READY; +@@ -1166,14 +1113,18 @@ static int amd_xgbe_phy_read_status(struct phy_device *phydev) + { + struct amd_xgbe_phy_priv *priv = phydev->priv; + u32 mmd_mask = phydev->c45_ids.devices_in_package; +- int ret, ad_ret, lp_ret; ++ int ret, mode, ad_ret, lp_ret; + + ret = amd_xgbe_phy_update_link(phydev); + if (ret) + return ret; + +- if ((phydev->autoneg == AUTONEG_ENABLE) && +- !priv->parallel_detect) { ++ mode = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL2); ++ if (mode < 0) ++ return mode; ++ mode &= MDIO_PCS_CTRL2_TYPE; ++ ++ if (phydev->autoneg == AUTONEG_ENABLE) { + if (!(mmd_mask & MDIO_DEVS_AN)) + return -EINVAL; + +@@ -1204,39 +1155,40 @@ static int amd_xgbe_phy_read_status(struct phy_device *phydev) + ad_ret &= lp_ret; + if (ad_ret & 0x80) { + phydev->speed = SPEED_10000; +- ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KR); +- if (ret) +- return ret; ++ if (mode != MDIO_PCS_CTRL2_10GBR) { ++ ret = amd_xgbe_phy_xgmii_mode(phydev); ++ if (ret < 0) ++ return ret; ++ } + } else { +- switch (priv->speed_set) { +- case AMD_XGBE_PHY_SPEEDSET_1000_10000: +- phydev->speed = SPEED_1000; +- break; ++ int (*mode_fcn)(struct phy_device *); + +- case AMD_XGBE_PHY_SPEEDSET_2500_10000: ++ if (priv->speed_set == ++ AMD_XGBE_PHY_SPEEDSET_1000_10000) { ++ phydev->speed = SPEED_1000; ++ mode_fcn = amd_xgbe_phy_gmii_mode; ++ } else { + phydev->speed = SPEED_2500; +- break; ++ mode_fcn = amd_xgbe_phy_gmii_2500_mode; + } + +- ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KX); +- if (ret) +- return ret; ++ if (mode == MDIO_PCS_CTRL2_10GBR) { ++ ret = mode_fcn(phydev); ++ if (ret < 0) ++ return ret; ++ } + } + + phydev->duplex = DUPLEX_FULL; + } else { +- if (amd_xgbe_phy_in_kr_mode(phydev)) { ++ if (mode == MDIO_PCS_CTRL2_10GBR) { + phydev->speed = SPEED_10000; + } else { +- switch (priv->speed_set) { +- case AMD_XGBE_PHY_SPEEDSET_1000_10000: ++ if (priv->speed_set == ++ AMD_XGBE_PHY_SPEEDSET_1000_10000) + phydev->speed = SPEED_1000; +- break; +- +- case AMD_XGBE_PHY_SPEEDSET_2500_10000: ++ else + phydev->speed = SPEED_2500; +- break; +- } + } + phydev->duplex = DUPLEX_FULL; + phydev->pause = 0; +@@ -1288,29 +1240,188 @@ unlock: return ret; } @@ -7938,7 +11265,7 @@ index f3230ee..d852c6e 100644 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) { -@@ -1278,60 +1429,33 @@ static int amd_xgbe_phy_probe(struct phy_device *phydev) +@@ -1318,86 +1429,54 @@ static int amd_xgbe_phy_probe(struct phy_device *phydev) goto err_name; } @@ -7969,7 +11296,7 @@ index f3230ee..d852c6e 100644 - ret = PTR_ERR(priv->sir0_regs); - goto err_rxtx; - } - +- - priv->sir1_res = platform_get_resource(pdev, IORESOURCE_MEM, 2); - priv->sir1_regs = devm_ioremap_resource(dev, priv->sir1_res); - if (IS_ERR(priv->sir1_regs)) { @@ -7977,7 +11304,7 @@ index f3230ee..d852c6e 100644 - ret = PTR_ERR(priv->sir1_regs); - goto err_sir0; - } -- + - /* Get the device speed set property */ - speed_set = 0; - property = of_get_property(dev->of_node, XGBE_PHY_SPEEDSET_PROPERTY, @@ -8004,14 +11331,16 @@ index f3230ee..d852c6e 100644 priv->link = 1; - ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL2); - if (ret < 0) -- goto err_sir1; ++ ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL2); ++ if (ret < 0) + goto err_resources; - if ((ret & MDIO_PCS_CTRL2_TYPE) == MDIO_PCS_CTRL2_10GBR) - priv->mode = AMD_XGBE_MODE_KR; - else -@@ -1342,30 +1466,17 @@ static int amd_xgbe_phy_probe(struct phy_device *phydev) ++ if ((ret & MDIO_PCS_CTRL2_TYPE) == MDIO_PCS_CTRL2_10GBR) ++ priv->mode = AMD_XGBE_MODE_KR; ++ else ++ priv->mode = AMD_XGBE_MODE_KX; ++ + mutex_init(&priv->an_mutex); + INIT_WORK(&priv->an_work, amd_xgbe_an_state_machine); priv->an_workqueue = create_singlethread_workqueue(wq_name); if (!priv->an_workqueue) { ret = -ENOMEM; @@ -8045,7 +11374,7 @@ index f3230ee..d852c6e 100644 err_priv: devm_kfree(dev, priv); -@@ -1373,9 +1484,6 @@ err_priv: +@@ -1405,9 +1484,6 @@ err_priv: err_name: kfree(wq_name); @@ -8055,7 +11384,7 @@ index f3230ee..d852c6e 100644 return ret; } -@@ -1392,18 +1500,7 @@ static void amd_xgbe_phy_remove(struct phy_device *phydev) +@@ -1424,18 +1500,7 @@ static void amd_xgbe_phy_remove(struct phy_device *phydev) flush_workqueue(priv->an_workqueue); destroy_workqueue(priv->an_workqueue); @@ -8075,196 +11404,11 @@ index f3230ee..d852c6e 100644 devm_kfree(dev, priv); } -diff --git a/drivers/of/address.c b/drivers/of/address.c -index e371825..afdb782 100644 ---- a/drivers/of/address.c -+++ b/drivers/of/address.c -@@ -5,6 +5,8 @@ - #include <linux/module.h> - #include <linux/of_address.h> - #include <linux/pci_regs.h> -+#include <linux/sizes.h> -+#include <linux/slab.h> - #include <linux/string.h> - - /* Max address size we deal with */ -@@ -293,6 +295,51 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser, - } - EXPORT_SYMBOL_GPL(of_pci_range_parser_one); - -+/* -+ * of_pci_range_to_resource - Create a resource from an of_pci_range -+ * @range: the PCI range that describes the resource -+ * @np: device node where the range belongs to -+ * @res: pointer to a valid resource that will be updated to -+ * reflect the values contained in the range. -+ * -+ * Returns EINVAL if the range cannot be converted to resource. -+ * -+ * Note that if the range is an IO range, the resource will be converted -+ * using pci_address_to_pio() which can fail if it is called too early or -+ * if the range cannot be matched to any host bridge IO space (our case here). -+ * To guard against that we try to register the IO range first. -+ * If that fails we know that pci_address_to_pio() will do too. -+ */ -+int of_pci_range_to_resource(struct of_pci_range *range, -+ struct device_node *np, struct resource *res) -+{ -+ int err; -+ res->flags = range->flags; -+ res->parent = res->child = res->sibling = NULL; -+ res->name = np->full_name; -+ -+ if (res->flags & IORESOURCE_IO) { -+ unsigned long port; -+ err = pci_register_io_range(range->cpu_addr, range->size); -+ if (err) -+ goto invalid_range; -+ port = pci_address_to_pio(range->cpu_addr); -+ if (port == (unsigned long)-1) { -+ err = -EINVAL; -+ goto invalid_range; -+ } -+ res->start = port; -+ } else { -+ res->start = range->cpu_addr; -+ } -+ res->end = res->start + range->size - 1; -+ return 0; -+ -+invalid_range: -+ res->start = (resource_size_t)OF_BAD_ADDR; -+ res->end = (resource_size_t)OF_BAD_ADDR; -+ return err; -+} - #endif /* CONFIG_PCI */ - - /* -@@ -601,12 +648,119 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, - } - EXPORT_SYMBOL(of_get_address); - -+#ifdef PCI_IOBASE -+struct io_range { -+ struct list_head list; -+ phys_addr_t start; -+ resource_size_t size; -+}; -+ -+static LIST_HEAD(io_range_list); -+static DEFINE_SPINLOCK(io_range_lock); -+#endif -+ -+/* -+ * Record the PCI IO range (expressed as CPU physical address + size). -+ * Return a negative value if an error has occured, zero otherwise -+ */ -+int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size) -+{ -+ int err = 0; -+ -+#ifdef PCI_IOBASE -+ struct io_range *range; -+ resource_size_t allocated_size = 0; -+ -+ /* check if the range hasn't been previously recorded */ -+ spin_lock(&io_range_lock); -+ list_for_each_entry(range, &io_range_list, list) { -+ if (addr >= range->start && addr + size <= range->start + size) { -+ /* range already registered, bail out */ -+ goto end_register; -+ } -+ allocated_size += range->size; -+ } -+ -+ /* range not registed yet, check for available space */ -+ if (allocated_size + size - 1 > IO_SPACE_LIMIT) { -+ /* if it's too big check if 64K space can be reserved */ -+ if (allocated_size + SZ_64K - 1 > IO_SPACE_LIMIT) { -+ err = -E2BIG; -+ goto end_register; -+ } -+ -+ size = SZ_64K; -+ pr_warn("Requested IO range too big, new size set to 64K\n"); -+ } -+ -+ /* add the range to the list */ -+ range = kzalloc(sizeof(*range), GFP_KERNEL); -+ if (!range) { -+ err = -ENOMEM; -+ goto end_register; -+ } -+ -+ range->start = addr; -+ range->size = size; -+ -+ list_add_tail(&range->list, &io_range_list); -+ -+end_register: -+ spin_unlock(&io_range_lock); -+#endif -+ -+ return err; -+} -+ -+phys_addr_t pci_pio_to_address(unsigned long pio) -+{ -+ phys_addr_t address = (phys_addr_t)OF_BAD_ADDR; -+ -+#ifdef PCI_IOBASE -+ struct io_range *range; -+ resource_size_t allocated_size = 0; -+ -+ if (pio > IO_SPACE_LIMIT) -+ return address; -+ -+ spin_lock(&io_range_lock); -+ list_for_each_entry(range, &io_range_list, list) { -+ if (pio >= allocated_size && pio < allocated_size + range->size) { -+ address = range->start + pio - allocated_size; -+ break; -+ } -+ allocated_size += range->size; -+ } -+ spin_unlock(&io_range_lock); -+#endif -+ -+ return address; -+} -+ - unsigned long __weak pci_address_to_pio(phys_addr_t address) - { -+#ifdef PCI_IOBASE -+ struct io_range *res; -+ resource_size_t offset = 0; -+ unsigned long addr = -1; -+ -+ spin_lock(&io_range_lock); -+ list_for_each_entry(res, &io_range_list, list) { -+ if (address >= res->start && address < res->start + res->size) { -+ addr = res->start - address + offset; -+ break; -+ } -+ offset += res->size; -+ } -+ spin_unlock(&io_range_lock); -+ -+ return addr; -+#else - if (address > IO_SPACE_LIMIT) - return (unsigned long)-1; - - return (unsigned long) address; -+#endif - } - - static int __of_address_to_resource(struct device_node *dev, diff --git a/drivers/of/base.c b/drivers/of/base.c -index 293ed4b..270837b 100644 +index 3823edf..4c2ccde 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c -@@ -1247,6 +1247,39 @@ int of_property_read_u64(const struct device_node *np, const char *propname, +@@ -1250,6 +1250,39 @@ int of_property_read_u64(const struct device_node *np, const char *propname, EXPORT_SYMBOL_GPL(of_property_read_u64); /** @@ -8304,623 +11448,129 @@ index 293ed4b..270837b 100644 * of_property_read_string - Find and read a string from a property * @np: device node from which the property value is to be read. * @propname: name of the property to be searched. -@@ -2183,3 +2259,113 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node) - return of_get_next_parent(np); - } - EXPORT_SYMBOL(of_graph_get_remote_port); -+ -+int of_dev_prop_get(struct device_node *dn, const char *propname, void **valptr) -+{ -+ struct property *pp = of_find_property(dn, propname, NULL); -+ -+ if (!pp) -+ return -ENODATA; -+ -+ if (valptr) -+ *valptr = pp->value; -+ return 0; -+} -+ -+int of_dev_prop_read(struct device_node *dn, const char *propname, -+ enum dev_prop_type proptype, void *val) -+{ -+ void *value; -+ int ret = of_dev_prop_get(dn, propname, &value); -+ -+ if (ret) -+ return ret; -+ -+ if (proptype >= DEV_PROP_U8 && proptype <= DEV_PROP_U64) { -+ switch (proptype) { -+ case DEV_PROP_U8: { -+ *(u8 *)val = *(u8 *)value; -+ break; -+ } -+ case DEV_PROP_U16: -+ *(u16 *)val = *(u16 *)value; -+ break; -+ case DEV_PROP_U32: -+ *(u32 *)val = *(u32 *)value; -+ break; -+ default: -+ *(u64 *)val = *(u64 *)value; -+ break; -+ } -+ } else if (proptype == DEV_PROP_STRING) { -+ *(char **)val = value; -+ } -+ return ret; -+ -+} -+ -+int of_dev_prop_read_array(struct device_node *dn, const char *propname, -+ enum dev_prop_type proptype, void *val, size_t nval) -+{ -+ int ret, elem_size; -+ -+ if (!val) { -+ switch (proptype) { -+ case DEV_PROP_U8: -+ elem_size = sizeof(u8); -+ break; -+ case DEV_PROP_U16: -+ elem_size = sizeof(u16); -+ break; -+ case DEV_PROP_U32: -+ elem_size = sizeof(u32); -+ break; -+ case DEV_PROP_U64: -+ elem_size = sizeof(u64); -+ break; -+ case DEV_PROP_STRING: -+ return of_property_count_strings(dn, propname); -+ default: -+ return -EINVAL; -+ } -+ return of_property_count_elems_of_size(dn, propname, elem_size); -+ } -+ -+ switch (proptype) { -+ case DEV_PROP_U8: -+ ret = of_property_read_u8_array(dn, propname, (u8 *)val, nval); -+ break; -+ case DEV_PROP_U16: -+ ret = of_property_read_u16_array(dn, propname, (u16 *)val, nval); -+ break; -+ case DEV_PROP_U32: -+ ret = of_property_read_u32_array(dn, propname, (u32 *)val, nval); -+ break; -+ case DEV_PROP_U64: -+ ret = of_property_read_u64_array(dn, propname, (u64 *)val, nval); -+ break; -+ case DEV_PROP_STRING: -+ ret = of_property_read_string_array(dn, propname, -+ (char **)val, nval); -+ break; -+ default: -+ ret = -EINVAL; -+ break; -+ } -+ return ret; -+} -+ -+int of_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data) -+{ -+ struct device_node *child; -+ int ret = 0; -+ -+ for_each_child_of_node(dev->of_node, child) { -+ ret = fn(dev, child, data); -+ if (ret) -+ break; -+ } -+ return ret; -+} -diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c -index 8481996..8882b46 100644 ---- a/drivers/of/of_pci.c -+++ b/drivers/of/of_pci.c -@@ -1,7 +1,9 @@ - #include <linux/kernel.h> - #include <linux/export.h> - #include <linux/of.h> -+#include <linux/of_address.h> - #include <linux/of_pci.h> -+#include <linux/slab.h> - - static inline int __of_pci_pci_compare(struct device_node *node, - unsigned int data) -@@ -89,6 +91,146 @@ int of_pci_parse_bus_range(struct device_node *node, struct resource *res) - } - EXPORT_SYMBOL_GPL(of_pci_parse_bus_range); +diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c +index 2988fe1..9029d59c 100644 +--- a/drivers/pci/host/pci-xgene.c ++++ b/drivers/pci/host/pci-xgene.c +@@ -29,6 +29,7 @@ + #include <linux/pci.h> + #include <linux/platform_device.h> + #include <linux/slab.h> ++#include <linux/acpi.h> -+/** -+ * This function will try to obtain the host bridge domain number by -+ * finding a property called "linux,pci-domain" of the given device node. -+ * -+ * @node: device tree node with the domain information -+ * -+ * Returns the associated domain number from DT in the range [0-0xffff], or -+ * a negative value if the required property is not found. -+ */ -+int of_get_pci_domain_nr(struct device_node *node) -+{ -+ const __be32 *value; -+ int len; -+ u16 domain; -+ -+ value = of_get_property(node, "linux,pci-domain", &len); -+ if (!value || len < sizeof(*value)) -+ return -EINVAL; -+ -+ domain = (u16)be32_to_cpup(value); -+ -+ return domain; -+} -+EXPORT_SYMBOL_GPL(of_get_pci_domain_nr); -+ -+#if defined(CONFIG_OF_ADDRESS) -+/** -+ * of_pci_get_host_bridge_resources - Parse PCI host bridge resources from DT -+ * @dev: device node of the host bridge having the range property -+ * @busno: bus number associated with the bridge root bus -+ * @bus_max: maximum number of buses for this bridge -+ * @resources: list where the range of resources will be added after DT parsing -+ * @io_base: pointer to a variable that will contain on return the physical -+ * address for the start of the I/O range. Can be NULL if the caller doesn't -+ * expect IO ranges to be present in the device tree. -+ * -+ * It is the caller's job to free the @resources list. -+ * -+ * This function will parse the "ranges" property of a PCI host bridge device -+ * node and setup the resource mapping based on its content. It is expected -+ * that the property conforms with the Power ePAPR document. -+ * -+ * It returns zero if the range parsing has been successful or a standard error -+ * value if it failed. -+ */ -+int of_pci_get_host_bridge_resources(struct device_node *dev, -+ unsigned char busno, unsigned char bus_max, -+ struct list_head *resources, resource_size_t *io_base) -+{ -+ struct resource *res; -+ struct resource *bus_range; -+ struct of_pci_range range; -+ struct of_pci_range_parser parser; -+ char range_type[4]; -+ int err; -+ -+ if (io_base) -+ *io_base = (resource_size_t)OF_BAD_ADDR; -+ -+ bus_range = kzalloc(sizeof(*bus_range), GFP_KERNEL); -+ if (!bus_range) -+ return -ENOMEM; -+ -+ pr_info("PCI host bridge %s ranges:\n", dev->full_name); -+ -+ err = of_pci_parse_bus_range(dev, bus_range); -+ if (err) { -+ bus_range->start = busno; -+ bus_range->end = bus_max; -+ bus_range->flags = IORESOURCE_BUS; -+ pr_info(" No bus range found for %s, using %pR\n", -+ dev->full_name, bus_range); -+ } else { -+ if (bus_range->end > bus_range->start + bus_max) -+ bus_range->end = bus_range->start + bus_max; -+ } -+ pci_add_resource(resources, bus_range); -+ -+ /* Check for ranges property */ -+ err = of_pci_range_parser_init(&parser, dev); -+ if (err) -+ goto parse_failed; -+ -+ pr_debug("Parsing ranges property...\n"); -+ for_each_of_pci_range(&parser, &range) { -+ /* Read next ranges element */ -+ if ((range.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_IO) -+ snprintf(range_type, 4, " IO"); -+ else if ((range.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_MEM) -+ snprintf(range_type, 4, "MEM"); -+ else -+ snprintf(range_type, 4, "err"); -+ pr_info(" %s %#010llx..%#010llx -> %#010llx\n", range_type, -+ range.cpu_addr, range.cpu_addr + range.size - 1, -+ range.pci_addr); -+ -+ /* -+ * If we failed translation or got a zero-sized region -+ * then skip this range + #define PCIECORE_CTLANDSTATUS 0x50 + #define PIM1_1L 0x80 +@@ -235,6 +236,13 @@ static int xgene_pcie_read_config(struct pci_bus *bus, unsigned int devfn, + break; + case 2: + xgene_pcie_cfg_in16(addr, offset, val); ++ /* FIXME. ++ * Something wrong with Configuration Request Retry Status ++ * on this hw. Pretend it isn't supported until the problem ++ * gets sorted out properly. + */ -+ if (range.cpu_addr == OF_BAD_ADDR || range.size == 0) -+ continue; -+ -+ res = kzalloc(sizeof(struct resource), GFP_KERNEL); -+ if (!res) { -+ err = -ENOMEM; -+ goto parse_failed; -+ } -+ -+ err = of_pci_range_to_resource(&range, dev, res); -+ if (err) -+ goto conversion_failed; -+ -+ if (resource_type(res) == IORESOURCE_IO) { -+ if (!io_base) { -+ pr_err("I/O range found for %s. Please provide an io_base pointer to save CPU base address\n", -+ dev->full_name); -+ err = -EINVAL; -+ goto conversion_failed; -+ } -+ if (*io_base != (resource_size_t)OF_BAD_ADDR) -+ pr_warn("More than one I/O resource converted for %s. CPU base address for old range lost!\n", -+ dev->full_name); -+ *io_base = range.cpu_addr; -+ } -+ -+ pci_add_resource_offset(resources, res, res->start - range.pci_addr); -+ } -+ -+ return 0; -+ -+conversion_failed: -+ kfree(res); -+parse_failed: -+ pci_free_resource_list(resources); -+ return err; -+} -+EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources); -+#endif /* CONFIG_OF_ADDRESS */ -+ - #ifdef CONFIG_PCI_MSI - - static LIST_HEAD(of_pci_msi_chip_list); -diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig -index 90f5cca..382fd3d 100644 ---- a/drivers/pci/host/Kconfig -+++ b/drivers/pci/host/Kconfig -@@ -63,4 +63,14 @@ config PCIE_SPEAR13XX - help - Say Y here if you want PCIe support on SPEAr13XX SoCs. - -+config PCI_XGENE -+ bool "X-Gene PCIe controller" -+ depends on ARCH_XGENE -+ depends on OF -+ select PCIEPORTBUS -+ help -+ Say Y here if you want internal PCI support on APM X-Gene SoC. -+ There are 5 internal PCIe ports available. Each port is GEN3 capable -+ and have varied lanes from x1 to x8. -+ - endmenu -diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile -index d0e88f1..845611f 100644 ---- a/drivers/pci/host/Makefile -+++ b/drivers/pci/host/Makefile -@@ -8,3 +8,4 @@ obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o - obj-$(CONFIG_PCI_RCAR_GEN2_PCIE) += pcie-rcar.o - obj-$(CONFIG_PCI_HOST_GENERIC) += pci-host-generic.o - obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o -+obj-$(CONFIG_PCI_XGENE) += pci-xgene.o -diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c -index 0fb0fdb..946935d 100644 ---- a/drivers/pci/host/pci-tegra.c -+++ b/drivers/pci/host/pci-tegra.c -@@ -626,13 +626,14 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable); - static int tegra_pcie_setup(int nr, struct pci_sys_data *sys) - { - struct tegra_pcie *pcie = sys_to_pcie(sys); -+ phys_addr_t io_start = pci_pio_to_address(pcie->io.start); - - pci_add_resource_offset(&sys->resources, &pcie->mem, sys->mem_offset); - pci_add_resource_offset(&sys->resources, &pcie->prefetch, - sys->mem_offset); - pci_add_resource(&sys->resources, &pcie->busn); - -- pci_ioremap_io(nr * SZ_64K, pcie->io.start); -+ pci_ioremap_io(nr * SZ_64K, io_start); - - return 1; ++ if (pci_is_root_bus(bus) && offset == (0x40 + PCI_EXP_RTCAP)) ++ *val &= ~PCI_EXP_RTCAP_CRSVIS; + break; + default: + xgene_pcie_cfg_in32(addr, offset, val); +@@ -600,6 +608,165 @@ static int xgene_pcie_setup(struct xgene_pcie_port *port, + return 0; } -@@ -737,6 +738,7 @@ static irqreturn_t tegra_pcie_isr(int irq, void *arg) - static void tegra_pcie_setup_translations(struct tegra_pcie *pcie) - { - u32 fpci_bar, size, axi_address; -+ phys_addr_t io_start = pci_pio_to_address(pcie->io.start); - - /* Bar 0: type 1 extended configuration space */ - fpci_bar = 0xfe100000; -@@ -749,7 +751,7 @@ static void tegra_pcie_setup_translations(struct tegra_pcie *pcie) - /* Bar 1: downstream IO bar */ - fpci_bar = 0xfdfc0000; - size = resource_size(&pcie->io); -- axi_address = pcie->io.start; -+ axi_address = io_start; - afi_writel(pcie, axi_address, AFI_AXI_BAR1_START); - afi_writel(pcie, size >> 12, AFI_AXI_BAR1_SZ); - afi_writel(pcie, fpci_bar, AFI_FPCI_BAR1); -@@ -1520,7 +1522,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie) - } - - for_each_of_pci_range(&parser, &range) { -- of_pci_range_to_resource(&range, np, &res); -+ err = of_pci_range_to_resource(&range, np, &res); -+ if (err < 0) -+ return err; - switch (res.flags & IORESOURCE_TYPE_BITS) { - case IORESOURCE_IO: -diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c -new file mode 100644 -index 0000000..41c76b8 ---- /dev/null -+++ b/drivers/pci/host/pci-xgene.c -@@ -0,0 +1,659 @@ -+/** -+ * APM X-Gene PCIe Driver -+ * -+ * Copyright (c) 2014 Applied Micro Circuits Corporation. -+ * -+ * Author: Tanmay Inamdar <tinamdar@apm.com>. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or (at your -+ * option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ */ -+#include <linux/clk-private.h> -+#include <linux/delay.h> -+#include <linux/io.h> -+#include <linux/jiffies.h> -+#include <linux/memblock.h> -+#include <linux/module.h> -+#include <linux/of.h> -+#include <linux/of_address.h> -+#include <linux/of_irq.h> -+#include <linux/of_pci.h> -+#include <linux/pci.h> -+#include <linux/platform_device.h> -+#include <linux/slab.h> -+ -+#define PCIECORE_CTLANDSTATUS 0x50 -+#define PIM1_1L 0x80 -+#define IBAR2 0x98 -+#define IR2MSK 0x9c -+#define PIM2_1L 0xa0 -+#define IBAR3L 0xb4 -+#define IR3MSKL 0xbc -+#define PIM3_1L 0xc4 -+#define OMR1BARL 0x100 -+#define OMR2BARL 0x118 -+#define OMR3BARL 0x130 -+#define CFGBARL 0x154 -+#define CFGBARH 0x158 -+#define CFGCTL 0x15c -+#define RTDID 0x160 -+#define BRIDGE_CFG_0 0x2000 -+#define BRIDGE_CFG_4 0x2010 -+#define BRIDGE_STATUS_0 0x2600 -+ -+#define LINK_UP_MASK 0x00000100 -+#define AXI_EP_CFG_ACCESS 0x10000 -+#define EN_COHERENCY 0xF0000000 -+#define EN_REG 0x00000001 -+#define OB_LO_IO 0x00000002 -+#define XGENE_PCIE_VENDORID 0x10E8 -+#define XGENE_PCIE_DEVICEID 0xE004 -+#define SZ_1T (SZ_1G*1024ULL) -+#define PIPE_PHY_RATE_RD(src) ((0xc000 & (u32)(src)) >> 0xe) -+ -+struct xgene_pcie_port { -+ struct device_node *node; -+ struct device *dev; -+ struct clk *clk; -+ void __iomem *csr_base; -+ void __iomem *cfg_base; -+ unsigned long cfg_addr; -+ bool link_up; ++#ifdef CONFIG_ACPI ++struct xgene_mcfg_info { ++ void __iomem *csr_base; +}; + -+static inline u32 pcie_bar_low_val(u32 addr, u32 flags) -+{ -+ return (addr & PCI_BASE_ADDRESS_MEM_MASK) | flags; -+} -+ -+/* PCIE Configuration Out/In */ -+static inline void xgene_pcie_cfg_out32(void __iomem *addr, int offset, u32 val) -+{ -+ writel(val, addr + offset); -+} -+ -+static inline void xgene_pcie_cfg_out16(void __iomem *addr, int offset, u16 val) -+{ -+ u32 val32 = readl(addr + (offset & ~0x3)); -+ -+ switch (offset & 0x3) { -+ case 2: -+ val32 &= ~0xFFFF0000; -+ val32 |= (u32)val << 16; -+ break; -+ case 0: -+ default: -+ val32 &= ~0xFFFF; -+ val32 |= val; -+ break; -+ } -+ writel(val32, addr + (offset & ~0x3)); -+} -+ -+static inline void xgene_pcie_cfg_out8(void __iomem *addr, int offset, u8 val) -+{ -+ u32 val32 = readl(addr + (offset & ~0x3)); -+ -+ switch (offset & 0x3) { -+ case 0: -+ val32 &= ~0xFF; -+ val32 |= val; -+ break; -+ case 1: -+ val32 &= ~0xFF00; -+ val32 |= (u32)val << 8; -+ break; -+ case 2: -+ val32 &= ~0xFF0000; -+ val32 |= (u32)val << 16; -+ break; -+ case 3: -+ default: -+ val32 &= ~0xFF000000; -+ val32 |= (u32)val << 24; -+ break; -+ } -+ writel(val32, addr + (offset & ~0x3)); -+} -+ -+static inline void xgene_pcie_cfg_in32(void __iomem *addr, int offset, u32 *val) -+{ -+ *val = readl(addr + offset); -+} -+ -+static inline void xgene_pcie_cfg_in16(void __iomem *addr, int offset, u32 *val) -+{ -+ *val = readl(addr + (offset & ~0x3)); -+ -+ switch (offset & 0x3) { -+ case 2: -+ *val >>= 16; -+ break; -+ } -+ -+ *val &= 0xFFFF; -+} -+ -+static inline void xgene_pcie_cfg_in8(void __iomem *addr, int offset, u32 *val) -+{ -+ *val = readl(addr + (offset & ~0x3)); -+ -+ switch (offset & 0x3) { -+ case 3: -+ *val = *val >> 24; -+ break; -+ case 2: -+ *val = *val >> 16; -+ break; -+ case 1: -+ *val = *val >> 8; -+ break; -+ } -+ *val &= 0xFF; -+} -+ +/* + * When the address bit [17:16] is 2'b01, the Configuration access will be + * treated as Type 1 and it will be forwarded to external PCIe device. + */ -+static void __iomem *xgene_pcie_get_cfg_base(struct pci_bus *bus) ++static void __iomem *__get_cfg_base(struct pci_mmcfg_region *cfg, ++ unsigned int bus) +{ -+ struct xgene_pcie_port *port = bus->sysdata; -+ -+ if (bus->number >= (bus->primary + 1)) -+ return port->cfg_base + AXI_EP_CFG_ACCESS; ++ if (bus > cfg->start_bus) ++ return cfg->virt + AXI_EP_CFG_ACCESS; + -+ return port->cfg_base; ++ return cfg->virt; +} + +/* + * For Configuration request, RTDID register is used as Bus Number, + * Device Number and Function number of the header fields. + */ -+static void xgene_pcie_set_rtdid_reg(struct pci_bus *bus, uint devfn) ++static void __set_rtdid_reg(struct pci_mmcfg_region *cfg, ++ unsigned int bus, unsigned int devfn) +{ -+ struct xgene_pcie_port *port = bus->sysdata; ++ struct xgene_mcfg_info *info = cfg->data; + unsigned int b, d, f; + u32 rtdid_val = 0; + -+ b = bus->number; ++ b = bus; + d = PCI_SLOT(devfn); + f = PCI_FUNC(devfn); + -+ if (!pci_is_root_bus(bus)) ++ if (bus != cfg->start_bus) + rtdid_val = (b << 8) | (d << 3) | f; + -+ writel(rtdid_val, port->csr_base + RTDID); ++ writel(rtdid_val, info->csr_base + RTDID); + /* read the register back to ensure flush */ -+ readl(port->csr_base + RTDID); ++ readl(info->csr_base + RTDID); +} + -+/* -+ * X-Gene PCIe port uses BAR0-BAR1 of RC's configuration space as -+ * the translation between PCI bus to native BUS. Entire DDR region -+ * is mapped on to PCIe space using these registers, so that it is -+ * accessible for EP devices for DMA. The BAR0/1 of bridge should be -+ * hidden during enumeration to avoid the sizing and resource allocation -+ * by PCIe core. -+ */ -+static bool xgene_pcie_hide_rc_bars(struct pci_bus *bus, int offset) ++static int xgene_raw_pci_read(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int offset, int len, u32 *val) +{ -+ if (pci_is_root_bus(bus) && ((offset == PCI_BASE_ADDRESS_0) || -+ (offset == PCI_BASE_ADDRESS_1))) -+ return true; -+ -+ return false; -+} -+ -+static int xgene_pcie_read_config(struct pci_bus *bus, unsigned int devfn, -+ int offset, int len, u32 *val) -+{ -+ struct xgene_pcie_port *port = bus->sysdata; + void __iomem *addr; + -+ if ((pci_is_root_bus(bus) && devfn != 0) || !port->link_up) -+ return PCIBIOS_DEVICE_NOT_FOUND; ++ if (bus == cfg->start_bus) { ++ if (devfn != 0) { ++ *val = 0xffffffff; ++ return PCIBIOS_DEVICE_NOT_FOUND; ++ } + -+ if (xgene_pcie_hide_rc_bars(bus, offset)) { -+ *val = 0; -+ return PCIBIOS_SUCCESSFUL; ++ /* see xgene_pcie_hide_rc_bars() above */ ++ if (offset == PCI_BASE_ADDRESS_0 || ++ offset == PCI_BASE_ADDRESS_1) { ++ *val = 0; ++ return PCIBIOS_SUCCESSFUL; ++ } + } + -+ xgene_pcie_set_rtdid_reg(bus, devfn); -+ addr = xgene_pcie_get_cfg_base(bus); ++ __set_rtdid_reg(cfg, bus, devfn); ++ addr = __get_cfg_base(cfg, bus); + switch (len) { + case 1: + xgene_pcie_cfg_in8(addr, offset, val); + break; + case 2: + xgene_pcie_cfg_in16(addr, offset, val); ++ /* FIXME. ++ * Something wrong with Configuration Request Retry Status ++ * on this hw. Pretend it isn't supported until the problem ++ * gets sorted out properly. ++ */ ++ if (bus == cfg->start_bus && offset == (0x40 + PCI_EXP_RTCAP)) ++ *val &= ~PCI_EXP_RTCAP_CRSVIS; + break; + default: + xgene_pcie_cfg_in32(addr, offset, val); + break; + } -+ + return PCIBIOS_SUCCESSFUL; +} + -+static int xgene_pcie_write_config(struct pci_bus *bus, unsigned int devfn, -+ int offset, int len, u32 val) ++static int xgene_raw_pci_write(struct pci_mmcfg_region *cfg, unsigned int bus, ++ unsigned int devfn, int offset, int len, u32 val) +{ -+ struct xgene_pcie_port *port = bus->sysdata; + void __iomem *addr; + -+ if ((pci_is_root_bus(bus) && devfn != 0) || !port->link_up) ++ if (bus == cfg->start_bus && devfn != 0) + return PCIBIOS_DEVICE_NOT_FOUND; + -+ if (xgene_pcie_hide_rc_bars(bus, offset)) -+ return PCIBIOS_SUCCESSFUL; -+ -+ xgene_pcie_set_rtdid_reg(bus, devfn); -+ addr = xgene_pcie_get_cfg_base(bus); ++ __set_rtdid_reg(cfg, bus, devfn); ++ addr = __get_cfg_base(cfg, bus); + switch (len) { + case 1: + xgene_pcie_cfg_out8(addr, offset, (u8)val); @@ -8932,565 +11582,64 @@ index 0000000..41c76b8 + xgene_pcie_cfg_out32(addr, offset, val); + break; + } -+ + return PCIBIOS_SUCCESSFUL; +} + -+static struct pci_ops xgene_pcie_ops = { -+ .read = xgene_pcie_read_config, -+ .write = xgene_pcie_write_config -+}; -+ -+static u64 xgene_pcie_set_ib_mask(void __iomem *csr_base, u32 addr, -+ u32 flags, u64 size) ++static acpi_status find_csr_base(struct acpi_resource *acpi_res, void *data) +{ -+ u64 mask = (~(size - 1) & PCI_BASE_ADDRESS_MEM_MASK) | flags; -+ u32 val32 = 0; -+ u32 val; -+ -+ val32 = readl(csr_base + addr); -+ val = (val32 & 0x0000ffff) | (lower_32_bits(mask) << 16); -+ writel(val, csr_base + addr); -+ -+ val32 = readl(csr_base + addr + 0x04); -+ val = (val32 & 0xffff0000) | (lower_32_bits(mask) >> 16); -+ writel(val, csr_base + addr + 0x04); ++ struct pci_mmcfg_region *cfg = data; ++ struct xgene_mcfg_info *info = cfg->data; ++ struct acpi_resource_fixed_memory32 *fixed32; + -+ val32 = readl(csr_base + addr + 0x04); -+ val = (val32 & 0x0000ffff) | (upper_32_bits(mask) << 16); -+ writel(val, csr_base + addr + 0x04); -+ -+ val32 = readl(csr_base + addr + 0x08); -+ val = (val32 & 0xffff0000) | (upper_32_bits(mask) >> 16); -+ writel(val, csr_base + addr + 0x08); -+ -+ return mask; -+} -+ -+static void xgene_pcie_linkup(struct xgene_pcie_port *port, -+ u32 *lanes, u32 *speed) -+{ -+ void __iomem *csr_base = port->csr_base; -+ u32 val32; -+ -+ port->link_up = false; -+ val32 = readl(csr_base + PCIECORE_CTLANDSTATUS); -+ if (val32 & LINK_UP_MASK) { -+ port->link_up = true; -+ *speed = PIPE_PHY_RATE_RD(val32); -+ val32 = readl(csr_base + BRIDGE_STATUS_0); -+ *lanes = val32 >> 26; ++ if (acpi_res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) { ++ fixed32 = &acpi_res->data.fixed_memory32; ++ info->csr_base = ioremap(fixed32->address, ++ fixed32->address_length); ++ return AE_CTRL_TERMINATE; + } ++ return AE_OK; +} + -+static int xgene_pcie_init_port(struct xgene_pcie_port *port) ++static int xgene_mcfg_fixup(struct acpi_pci_root *root, ++ struct pci_mmcfg_region *cfg) +{ -+ int rc; -+ -+ port->clk = clk_get(port->dev, NULL); -+ if (IS_ERR(port->clk)) { -+ dev_err(port->dev, "clock not available\n"); -+ return -ENODEV; -+ } -+ -+ rc = clk_prepare_enable(port->clk); -+ if (rc) { -+ dev_err(port->dev, "clock enable failed\n"); -+ return rc; -+ } -+ -+ return 0; -+} ++ struct acpi_device *device = root->device; ++ struct xgene_mcfg_info *info; + -+static int xgene_pcie_map_reg(struct xgene_pcie_port *port, -+ struct platform_device *pdev) -+{ -+ struct resource *res; -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "csr"); -+ port->csr_base = devm_ioremap_resource(port->dev, res); -+ if (IS_ERR(port->csr_base)) -+ return PTR_ERR(port->csr_base); -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); -+ port->cfg_base = devm_ioremap_resource(port->dev, res); -+ if (IS_ERR(port->cfg_base)) -+ return PTR_ERR(port->cfg_base); -+ port->cfg_addr = res->start; -+ -+ return 0; -+} -+ -+static void xgene_pcie_setup_ob_reg(struct xgene_pcie_port *port, -+ struct resource *res, u32 offset, -+ u64 cpu_addr, u64 pci_addr) -+{ -+ void __iomem *base = port->csr_base + offset; -+ resource_size_t size = resource_size(res); -+ u64 restype = resource_type(res); -+ u64 mask = 0; -+ u32 min_size; -+ u32 flag = EN_REG; -+ -+ if (restype == IORESOURCE_MEM) { -+ min_size = SZ_128M; -+ } else { -+ min_size = 128; -+ flag |= OB_LO_IO; -+ } -+ -+ if (size >= min_size) -+ mask = ~(size - 1) | flag; -+ else -+ dev_warn(port->dev, "res size 0x%llx less than minimum 0x%x\n", -+ (u64)size, min_size); -+ -+ writel(lower_32_bits(cpu_addr), base); -+ writel(upper_32_bits(cpu_addr), base + 0x04); -+ writel(lower_32_bits(mask), base + 0x08); -+ writel(upper_32_bits(mask), base + 0x0c); -+ writel(lower_32_bits(pci_addr), base + 0x10); -+ writel(upper_32_bits(pci_addr), base + 0x14); -+} -+ -+static void xgene_pcie_setup_cfg_reg(void __iomem *csr_base, u64 addr) -+{ -+ writel(lower_32_bits(addr), csr_base + CFGBARL); -+ writel(upper_32_bits(addr), csr_base + CFGBARH); -+ writel(EN_REG, csr_base + CFGCTL); -+} -+ -+static int xgene_pcie_map_ranges(struct xgene_pcie_port *port, -+ struct list_head *res, -+ resource_size_t io_base) -+{ -+ struct pci_host_bridge_window *window; -+ struct device *dev = port->dev; -+ int ret; -+ -+ list_for_each_entry(window, res, list) { -+ struct resource *res = window->res; -+ u64 restype = resource_type(res); -+ -+ dev_dbg(port->dev, "%pR\n", res); -+ -+ switch (restype) { -+ case IORESOURCE_IO: -+ xgene_pcie_setup_ob_reg(port, res, OMR3BARL, io_base, -+ res->start - window->offset); -+ ret = pci_remap_iospace(res, io_base); -+ if (ret < 0) -+ return ret; -+ break; -+ case IORESOURCE_MEM: -+ xgene_pcie_setup_ob_reg(port, res, OMR1BARL, res->start, -+ res->start - window->offset); -+ break; -+ case IORESOURCE_BUS: -+ break; -+ default: -+ dev_err(dev, "invalid io resource - %pR\n", res); -+ return -EINVAL; -+ } -+ } -+ xgene_pcie_setup_cfg_reg(port->csr_base, port->cfg_addr); -+ -+ return 0; -+} -+ -+static void xgene_pcie_setup_pims(void *addr, u64 pim, u64 size) -+{ -+ writel(lower_32_bits(pim), addr); -+ writel(upper_32_bits(pim) | EN_COHERENCY, addr + 0x04); -+ writel(lower_32_bits(size), addr + 0x10); -+ writel(upper_32_bits(size), addr + 0x14); -+} -+ -+/* -+ * X-Gene PCIe support maximum 3 inbound memory regions -+ * This function helps to select a region based on size of region -+ */ -+static int xgene_pcie_select_ib_reg(u8 *ib_reg_mask, u64 size) -+{ -+ if ((size > 4) && (size < SZ_16M) && !(*ib_reg_mask & (1 << 1))) { -+ *ib_reg_mask |= (1 << 1); -+ return 1; -+ } -+ -+ if ((size > SZ_1K) && (size < SZ_1T) && !(*ib_reg_mask & (1 << 0))) { -+ *ib_reg_mask |= (1 << 0); -+ return 0; -+ } -+ -+ if ((size > SZ_1M) && (size < SZ_1T) && !(*ib_reg_mask & (1 << 2))) { -+ *ib_reg_mask |= (1 << 2); -+ return 2; -+ } -+ -+ return -EINVAL; -+} ++ info = kzalloc(sizeof(*info), GFP_KERNEL); ++ if (info == NULL) ++ return -ENOMEM; + -+static void xgene_pcie_setup_ib_reg(struct xgene_pcie_port *port, -+ struct of_pci_range *range, u8 *ib_reg_mask) -+{ -+ void __iomem *csr_base = port->csr_base; -+ void __iomem *cfg_base = port->cfg_base; -+ void *bar_addr; -+ void *pim_addr; -+ u64 cpu_addr = range->cpu_addr; -+ u64 pci_addr = range->pci_addr; -+ u64 size = range->size; -+ u64 mask = ~(size - 1) | EN_REG; -+ u32 flags = PCI_BASE_ADDRESS_MEM_TYPE_64; -+ u32 bar_low; -+ int region; -+ -+ region = xgene_pcie_select_ib_reg(ib_reg_mask, range->size); -+ if (region < 0) { -+ dev_warn(port->dev, "invalid pcie dma-range config\n"); -+ return; -+ } ++ cfg->data = info; + -+ if (range->flags & IORESOURCE_PREFETCH) -+ flags |= PCI_BASE_ADDRESS_MEM_PREFETCH; ++ acpi_walk_resources(device->handle, METHOD_NAME__CRS, ++ find_csr_base, cfg); + -+ bar_low = pcie_bar_low_val((u32)cpu_addr, flags); -+ switch (region) { -+ case 0: -+ xgene_pcie_set_ib_mask(csr_base, BRIDGE_CFG_4, flags, size); -+ bar_addr = cfg_base + PCI_BASE_ADDRESS_0; -+ writel(bar_low, bar_addr); -+ writel(upper_32_bits(cpu_addr), bar_addr + 0x4); -+ pim_addr = csr_base + PIM1_1L; -+ break; -+ case 1: -+ bar_addr = csr_base + IBAR2; -+ writel(bar_low, bar_addr); -+ writel(lower_32_bits(mask), csr_base + IR2MSK); -+ pim_addr = csr_base + PIM2_1L; -+ break; -+ case 2: -+ bar_addr = csr_base + IBAR3L; -+ writel(bar_low, bar_addr); -+ writel(upper_32_bits(cpu_addr), bar_addr + 0x4); -+ writel(lower_32_bits(mask), csr_base + IR3MSKL); -+ writel(upper_32_bits(mask), csr_base + IR3MSKL + 0x4); -+ pim_addr = csr_base + PIM3_1L; -+ break; ++ if (!info->csr_base) { ++ kfree(info); ++ cfg->data = NULL; ++ return -ENODEV; + } + -+ xgene_pcie_setup_pims(pim_addr, pci_addr, ~(size - 1)); -+} -+ -+static int pci_dma_range_parser_init(struct of_pci_range_parser *parser, -+ struct device_node *node) -+{ -+ const int na = 3, ns = 2; -+ int rlen; ++ cfg->read = xgene_raw_pci_read; ++ cfg->write = xgene_raw_pci_write; + -+ parser->node = node; -+ parser->pna = of_n_addr_cells(node); -+ parser->np = parser->pna + na + ns; ++ /* actual last bus reachable through this mmconfig */ ++ cfg->end_bus = root->secondary.end; + -+ parser->range = of_get_property(node, "dma-ranges", &rlen); -+ if (!parser->range) -+ return -ENOENT; -+ parser->end = parser->range + rlen / sizeof(__be32); ++ /* firmware should have done this */ ++ xgene_raw_pci_write(cfg, cfg->start_bus, 0, PCI_PRIMARY_BUS, 4, ++ cfg->start_bus | ((cfg->start_bus + 1) << 8) | ++ (cfg->end_bus << 16)); + + return 0; +} ++DECLARE_ACPI_MCFG_FIXUP("APM ", "XGENE ", xgene_mcfg_fixup); ++#endif /* CONFIG_ACPI */ + -+static int xgene_pcie_parse_map_dma_ranges(struct xgene_pcie_port *port) -+{ -+ struct device_node *np = port->node; -+ struct of_pci_range range; -+ struct of_pci_range_parser parser; -+ struct device *dev = port->dev; -+ u8 ib_reg_mask = 0; -+ -+ if (pci_dma_range_parser_init(&parser, np)) { -+ dev_err(dev, "missing dma-ranges property\n"); -+ return -EINVAL; -+ } -+ -+ /* Get the dma-ranges from DT */ -+ for_each_of_pci_range(&parser, &range) { -+ u64 end = range.cpu_addr + range.size - 1; -+ -+ dev_dbg(port->dev, "0x%08x 0x%016llx..0x%016llx -> 0x%016llx\n", -+ range.flags, range.cpu_addr, end, range.pci_addr); -+ xgene_pcie_setup_ib_reg(port, &range, &ib_reg_mask); -+ } -+ return 0; -+} -+ -+/* clear bar configuration which was done by firmware */ -+static void xgene_pcie_clear_config(struct xgene_pcie_port *port) -+{ -+ int i; -+ -+ for (i = PIM1_1L; i <= CFGCTL; i += 4) -+ writel(0x0, port->csr_base + i); -+} -+ -+static int xgene_pcie_setup(struct xgene_pcie_port *port, -+ struct list_head *res, -+ resource_size_t io_base) -+{ -+ u32 val, lanes = 0, speed = 0; -+ int ret; -+ -+ xgene_pcie_clear_config(port); -+ -+ /* setup the vendor and device IDs correctly */ -+ val = (XGENE_PCIE_DEVICEID << 16) | XGENE_PCIE_VENDORID; -+ writel(val, port->csr_base + BRIDGE_CFG_0); -+ -+ ret = xgene_pcie_map_ranges(port, res, io_base); -+ if (ret) -+ return ret; -+ -+ ret = xgene_pcie_parse_map_dma_ranges(port); -+ if (ret) -+ return ret; -+ -+ xgene_pcie_linkup(port, &lanes, &speed); -+ if (!port->link_up) -+ dev_info(port->dev, "(rc) link down\n"); -+ else -+ dev_info(port->dev, "(rc) x%d gen-%d link up\n", -+ lanes, speed + 1); -+ return 0; -+} -+ -+static int xgene_pcie_probe_bridge(struct platform_device *pdev) -+{ -+ struct device_node *dn = pdev->dev.of_node; -+ struct xgene_pcie_port *port; -+ resource_size_t iobase = 0; -+ struct pci_bus *bus; -+ int ret; -+ LIST_HEAD(res); -+ -+ port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL); -+ if (!port) -+ return -ENOMEM; -+ port->node = of_node_get(pdev->dev.of_node); -+ port->dev = &pdev->dev; -+ -+ ret = xgene_pcie_map_reg(port, pdev); -+ if (ret) -+ return ret; -+ -+ ret = xgene_pcie_init_port(port); -+ if (ret) -+ return ret; -+ -+ ret = of_pci_get_host_bridge_resources(dn, 0, 0xff, &res, &iobase); -+ if (ret) -+ return ret; -+ -+ ret = xgene_pcie_setup(port, &res, iobase); -+ if (ret) -+ return ret; -+ -+ bus = pci_scan_root_bus(&pdev->dev, 0, &xgene_pcie_ops, port, &res); -+ if (!bus) -+ return -ENOMEM; -+ -+ platform_set_drvdata(pdev, port); -+ return 0; -+} -+ -+static const struct of_device_id xgene_pcie_match_table[] = { -+ {.compatible = "apm,xgene-pcie",}, -+ {}, -+}; -+ -+static struct platform_driver xgene_pcie_driver = { -+ .driver = { -+ .name = "xgene-pcie", -+ .owner = THIS_MODULE, -+ .of_match_table = of_match_ptr(xgene_pcie_match_table), -+ }, -+ .probe = xgene_pcie_probe_bridge, -+}; -+module_platform_driver(xgene_pcie_driver); -+ -+MODULE_AUTHOR("Tanmay Inamdar <tinamdar@apm.com>"); -+MODULE_DESCRIPTION("APM X-Gene PCIe driver"); -+MODULE_LICENSE("GPL v2"); -diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c -index 4884ee5..61158e0 100644 ---- a/drivers/pci/host/pcie-rcar.c -+++ b/drivers/pci/host/pcie-rcar.c -@@ -323,6 +323,7 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie) - - /* Setup PCIe address space mappings for each resource */ - resource_size_t size; -+ resource_size_t res_start; - u32 mask; - - rcar_pci_write_reg(pcie, 0x00000000, PCIEPTCTLR(win)); -@@ -335,8 +336,13 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie) - mask = (roundup_pow_of_two(size) / SZ_128) - 1; - rcar_pci_write_reg(pcie, mask << 7, PCIEPAMR(win)); - -- rcar_pci_write_reg(pcie, upper_32_bits(res->start), PCIEPARH(win)); -- rcar_pci_write_reg(pcie, lower_32_bits(res->start), PCIEPARL(win)); -+ if (res->flags & IORESOURCE_IO) -+ res_start = pci_pio_to_address(res->start); -+ else -+ res_start = res->start; -+ -+ rcar_pci_write_reg(pcie, upper_32_bits(res_start), PCIEPARH(win)); -+ rcar_pci_write_reg(pcie, lower_32_bits(res_start), PCIEPARL(win)); - - /* First resource is for IO */ - mask = PAR_ENABLE; -@@ -363,9 +369,10 @@ static int rcar_pcie_setup(int nr, struct pci_sys_data *sys) - - rcar_pcie_setup_window(i, pcie); - -- if (res->flags & IORESOURCE_IO) -- pci_ioremap_io(nr * SZ_64K, res->start); -- else -+ if (res->flags & IORESOURCE_IO) { -+ phys_addr_t io_start = pci_pio_to_address(res->start); -+ pci_ioremap_io(nr * SZ_64K, io_start); -+ } else - pci_add_resource(&sys->resources, res); - } - pci_add_resource(&sys->resources, &pcie->busn); -@@ -935,8 +942,10 @@ static int rcar_pcie_probe(struct platform_device *pdev) - } - - for_each_of_pci_range(&parser, &range) { -- of_pci_range_to_resource(&range, pdev->dev.of_node, -+ err = of_pci_range_to_resource(&range, pdev->dev.of_node, - &pcie->res[win++]); -+ if (err < 0) -+ return err; - - if (win > RCAR_PCI_MAX_RESOURCES) - break; -diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c -index 2c9ac70..6e994fc 100644 ---- a/drivers/pci/pci.c -+++ b/drivers/pci/pci.c -@@ -2704,6 +2704,37 @@ int pci_request_regions_exclusive(struct pci_dev *pdev, const char *res_name) - } - EXPORT_SYMBOL(pci_request_regions_exclusive); - -+/** -+ * pci_remap_iospace - Remap the memory mapped I/O space -+ * @res: Resource describing the I/O space -+ * @phys_addr: physical address of range to be mapped -+ * -+ * Remap the memory mapped I/O space described by the @res -+ * and the CPU physical address @phys_addr into virtual address space. -+ * Only architectures that have memory mapped IO functions defined -+ * (and the PCI_IOBASE value defined) should call this function. -+ */ -+int __weak pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) -+{ -+#if defined(PCI_IOBASE) && defined(CONFIG_MMU) -+ unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start; -+ -+ if (!(res->flags & IORESOURCE_IO)) -+ return -EINVAL; -+ -+ if (res->end > IO_SPACE_LIMIT) -+ return -EINVAL; -+ -+ return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, -+ pgprot_device(PAGE_KERNEL)); -+#else -+ /* this architecture does not have memory mapped I/O space, -+ so this function should never be called */ -+ WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); -+ return -ENODEV; -+#endif -+} -+ - static void __pci_set_master(struct pci_dev *dev, bool enable) - { - u16 old_cmd, cmd; -@@ -4406,6 +4437,15 @@ static void pci_no_domains(void) - #endif - } - -+#ifdef CONFIG_PCI_DOMAINS -+static atomic_t __domain_nr = ATOMIC_INIT(-1); -+ -+int pci_get_new_domain_nr(void) -+{ -+ return atomic_inc_return(&__domain_nr); -+} -+#endif -+ - /** - * pci_ext_cfg_avail - can we access extended PCI config space? - * -diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c -index 4170113..ff44f5a 100644 ---- a/drivers/pci/probe.c -+++ b/drivers/pci/probe.c -@@ -485,7 +485,7 @@ void pci_read_bridge_bases(struct pci_bus *child) - } - } - --static struct pci_bus *pci_alloc_bus(void) -+static struct pci_bus *pci_alloc_bus(struct pci_bus *parent) + static int xgene_pcie_probe_bridge(struct platform_device *pdev) { - struct pci_bus *b; - -@@ -500,6 +500,10 @@ static struct pci_bus *pci_alloc_bus(void) - INIT_LIST_HEAD(&b->resources); - b->max_bus_speed = PCI_SPEED_UNKNOWN; - b->cur_bus_speed = PCI_SPEED_UNKNOWN; -+#ifdef CONFIG_PCI_DOMAINS_GENERIC -+ if (parent) -+ b->domain_nr = parent->domain_nr; -+#endif - return b; - } - -@@ -671,7 +675,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, - /* - * Allocate a new bus, and inherit stuff from the parent.. - */ -- child = pci_alloc_bus(); -+ child = pci_alloc_bus(parent); - if (!child) - return NULL; - -@@ -1751,13 +1755,14 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, - char bus_addr[64]; - char *fmt; - -- b = pci_alloc_bus(); -+ b = pci_alloc_bus(NULL); - if (!b) - return NULL; - - b->sysdata = sysdata; - b->ops = ops; - b->number = b->busn_res.start = bus; -+ pci_bus_assign_domain_nr(b, parent); - b2 = pci_find_bus(pci_domain_nr(b), bus); - if (b2) { - /* If we already got to this bus through a different bridge, ignore it */ -@@ -1936,6 +1941,9 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, - if (!found) - pci_bus_update_busn_res_end(b, max); - -+ if (!pci_has_flag(PCI_PROBE_ONLY)) -+ pci_assign_unassigned_bus_resources(b); -+ - pci_bus_add_devices(b); - return b; - } + struct device_node *dn = pdev->dev.of_node; diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 782e822..d952462 100644 --- a/drivers/pnp/resource.c @@ -9539,10 +11688,10 @@ index 58ad1c0..c3211c0 100644 obj-y += ipwireless/ diff --git a/drivers/tty/sbsauart.c b/drivers/tty/sbsauart.c new file mode 100644 -index 0000000..402f168 +index 0000000..0f44624 --- /dev/null +++ b/drivers/tty/sbsauart.c -@@ -0,0 +1,355 @@ +@@ -0,0 +1,358 @@ +/* + * SBSA (Server Base System Architecture) Compatible UART driver + * @@ -9852,6 +12001,9 @@ index 0000000..402f168 + qtty->console.device = sbsa_tty_console_device; + qtty->console.setup = sbsa_tty_console_setup; + qtty->console.flags = CON_PRINTBUFFER; ++ /* if no console= on cmdline, make this the console device */ ++ if (!console_set_on_cmdline) ++ qtty->console.flags |= CON_CONSDEV; + qtty->console.index = pdev->id; + register_console(&qtty->console); + @@ -9899,10 +12051,10 @@ index 0000000..402f168 + +MODULE_LICENSE("GPL v2"); diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c -index 57d9df8..e075437 100644 +index beea6ca..7038a2d 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c -@@ -313,10 +313,18 @@ static int dw8250_probe_of(struct uart_port *p, +@@ -310,10 +310,18 @@ static int dw8250_probe_of(struct uart_port *p, static int dw8250_probe_acpi(struct uart_8250_port *up, struct dw8250_data *data) { @@ -9921,7 +12073,7 @@ index 57d9df8..e075437 100644 p->iotype = UPIO_MEM32; p->serial_in = dw8250_serial_in32; p->serial_out = dw8250_serial_out32; -@@ -541,6 +549,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = { +@@ -536,6 +544,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = { { "INT3435", 0 }, { "80860F0A", 0 }, { "8086228A", 0 }, @@ -9930,7 +12082,7 @@ index 57d9df8..e075437 100644 }; MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match); diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c -index c600ccf..10c4775 100644 +index ef9a165..9f1939c 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -100,8 +100,7 @@ @@ -9943,7 +12095,7 @@ index c600ccf..10c4775 100644 /* The alignment to use between consumer and producer parts of vring. * Currently hardcoded to the page size. */ -@@ -637,6 +636,14 @@ static struct of_device_id virtio_mmio_match[] = { +@@ -634,6 +633,14 @@ static struct of_device_id virtio_mmio_match[] = { }; MODULE_DEVICE_TABLE(of, virtio_mmio_match); @@ -9958,7 +12110,7 @@ index c600ccf..10c4775 100644 static struct platform_driver virtio_mmio_driver = { .probe = virtio_mmio_probe, .remove = virtio_mmio_remove, -@@ -644,6 +651,7 @@ static struct platform_driver virtio_mmio_driver = { +@@ -641,6 +648,7 @@ static struct platform_driver virtio_mmio_driver = { .name = "virtio-mmio", .owner = THIS_MODULE, .of_match_table = virtio_mmio_match, @@ -9966,26 +12118,31 @@ index c600ccf..10c4775 100644 }, }; -diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h -index c728113..f97804b 100644 ---- a/include/acpi/acnames.h -+++ b/include/acpi/acnames.h -@@ -59,6 +59,10 @@ - #define METHOD_NAME__PRS "_PRS" - #define METHOD_NAME__PRT "_PRT" - #define METHOD_NAME__PRW "_PRW" -+#define METHOD_NAME__PS0 "_PS0" -+#define METHOD_NAME__PS1 "_PS1" -+#define METHOD_NAME__PS2 "_PS2" -+#define METHOD_NAME__PS3 "_PS3" - #define METHOD_NAME__REG "_REG" - #define METHOD_NAME__SB_ "_SB_" - #define METHOD_NAME__SEG "_SEG" +diff --git a/drivers/xen/efi.c b/drivers/xen/efi.c +index 1f850c9..f745db2 100644 +--- a/drivers/xen/efi.c ++++ b/drivers/xen/efi.c +@@ -294,6 +294,7 @@ static const struct efi efi_xen __initconst = { + .acpi = EFI_INVALID_TABLE_ADDR, + .acpi20 = EFI_INVALID_TABLE_ADDR, + .smbios = EFI_INVALID_TABLE_ADDR, ++ .smbios3 = EFI_INVALID_TABLE_ADDR, + .sal_systab = EFI_INVALID_TABLE_ADDR, + .boot_info = EFI_INVALID_TABLE_ADDR, + .hcdp = EFI_INVALID_TABLE_ADDR, diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index 57ee052..a1ef42f 100644 +index f34a083..04d02fc 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h -@@ -68,6 +68,8 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs); +@@ -27,6 +27,7 @@ + #define __ACPI_BUS_H__ + + #include <linux/device.h> ++#include <linux/property.h> + + /* TBD: Make dynamic */ + #define ACPI_MAX_HANDLES 10 +@@ -68,6 +69,8 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs); union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, int rev, int func, union acpi_object *argv4); @@ -9994,7 +12151,7 @@ index 57ee052..a1ef42f 100644 static inline union acpi_object * acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func, union acpi_object *argv4, acpi_object_type type) -@@ -337,6 +339,13 @@ struct acpi_device_physical_node { +@@ -337,10 +340,20 @@ struct acpi_device_physical_node { bool put_online:1; }; @@ -10005,10 +12162,17 @@ index 57ee052..a1ef42f 100644 + const union acpi_object *of_compatible; +}; + ++struct acpi_gpio_mapping; ++ /* Device */ struct acpi_device { int device_type; -@@ -353,6 +362,7 @@ struct acpi_device { + acpi_handle handle; /* no handle for fixed hardware */ ++ struct fwnode_handle fwnode; + struct acpi_device *parent; + struct list_head children; + struct list_head node; +@@ -353,9 +366,11 @@ struct acpi_device { struct acpi_device_wakeup wakeup; struct acpi_device_perf performance; struct acpi_device_dir dir; @@ -10016,6 +12180,32 @@ index 57ee052..a1ef42f 100644 struct acpi_scan_handler *handler; struct acpi_hotplug_context *hp; struct acpi_driver *driver; ++ const struct acpi_gpio_mapping *driver_gpios; + void *driver_data; + struct device dev; + unsigned int physical_node_count; +@@ -364,6 +379,21 @@ struct acpi_device { + void (*remove)(struct acpi_device *); + }; + ++static inline bool is_acpi_node(struct fwnode_handle *fwnode) ++{ ++ return fwnode && fwnode->type == FWNODE_ACPI; ++} ++ ++static inline struct acpi_device *acpi_node(struct fwnode_handle *fwnode) ++{ ++ return fwnode ? container_of(fwnode, struct acpi_device, fwnode) : NULL; ++} ++ ++static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev) ++{ ++ return &adev->fwnode; ++} ++ + static inline void *acpi_driver_data(struct acpi_device *d) + { + return d->driver_data; diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h index 444671e..9d573db 100644 --- a/include/acpi/acpi_io.h @@ -10038,118 +12228,29 @@ index 444671e..9d573db 100644 return ioremap_cache(phys, size); } -diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h -index b7c89d4..dc9d037 100644 ---- a/include/acpi/acpixf.h -+++ b/include/acpi/acpixf.h -@@ -46,7 +46,7 @@ - - /* Current ACPICA subsystem version in YYYYMMDD format */ - --#define ACPI_CA_VERSION 0x20140724 -+#define ACPI_CA_VERSION 0x20140828 - - #include <acpi/acconfig.h> - #include <acpi/actypes.h> -diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h -index 7626bfe..29e7937 100644 ---- a/include/acpi/actbl1.h -+++ b/include/acpi/actbl1.h -@@ -952,7 +952,8 @@ enum acpi_srat_type { - ACPI_SRAT_TYPE_CPU_AFFINITY = 0, - ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, - ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, -- ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ -+ ACPI_SRAT_TYPE_GICC_AFFINITY = 3, -+ ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */ - }; - - /* -@@ -968,7 +969,7 @@ struct acpi_srat_cpu_affinity { - u32 flags; - u8 local_sapic_eid; - u8 proximity_domain_hi[3]; -- u32 reserved; /* Reserved, must be zero */ -+ u32 clock_domain; - }; - - /* Flags */ -@@ -1010,6 +1011,20 @@ struct acpi_srat_x2apic_cpu_affinity { - - #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ - -+/* 3: GICC Affinity (ACPI 5.1) */ -+ -+struct acpi_srat_gicc_affinity { -+ struct acpi_subtable_header header; -+ u32 proximity_domain; -+ u32 acpi_processor_uid; -+ u32 flags; -+ u32 clock_domain; -+}; -+ -+/* Flags for struct acpi_srat_gicc_affinity */ -+ -+#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ -+ - /* Reset to default packing */ - - #pragma pack() -diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h -index 787bcc8..5480cb2 100644 ---- a/include/acpi/actbl3.h -+++ b/include/acpi/actbl3.h -@@ -310,10 +310,15 @@ struct acpi_gtdt_timer_entry { - u32 common_flags; - }; - -+/* Flag Definitions: timer_flags and virtual_timer_flags above */ -+ -+#define ACPI_GTDT_GT_IRQ_MODE (1) -+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1) -+ - /* Flag Definitions: common_flags above */ - --#define ACPI_GTDT_GT_IS_SECURE_TIMER (1) --#define ACPI_GTDT_GT_ALWAYS_ON (1<<1) -+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1) -+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1) - - /* 1: SBSA Generic Watchdog Structure */ - -diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h -index 975e1cc..b8fdc57 100644 ---- a/include/asm-generic/io.h -+++ b/include/asm-generic/io.h -@@ -331,7 +331,7 @@ static inline void iounmap(void __iomem *addr) - #ifndef CONFIG_GENERIC_IOMAP - static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) - { -- return (void __iomem *) port; -+ return PCI_IOBASE + (port & IO_SPACE_LIMIT); - } - - static inline void ioport_unmap(void __iomem *p) -diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h -index 53b2acc..977e545 100644 ---- a/include/asm-generic/pgtable.h -+++ b/include/asm-generic/pgtable.h -@@ -249,6 +249,10 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) - #define pgprot_writecombine pgprot_noncached - #endif - -+#ifndef pgprot_device -+#define pgprot_device pgprot_noncached -+#endif -+ - /* - * When walking page tables, get the address of the next boundary, - * or the end address of the range if that comes earlier. Although no +diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h +index aa70cbd..1261fef 100644 +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -275,6 +275,13 @@ + VMLINUX_SYMBOL(__end_pci_fixups_suspend_late) = .; \ + } \ + \ ++ /* ACPI quirks */ \ ++ .acpi_fixup : AT(ADDR(.acpi_fixup) - LOAD_OFFSET) { \ ++ VMLINUX_SYMBOL(__start_acpi_mcfg_fixups) = .; \ ++ *(.acpi_fixup_mcfg) \ ++ VMLINUX_SYMBOL(__end_acpi_mcfg_fixups) = .; \ ++ } \ ++ \ + /* Built-in firmware blobs */ \ + .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start_builtin_fw) = .; \ diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h -index 35b0c12..d98e96b 100644 +index 206dcc3..660dbfc 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h -@@ -237,17 +237,19 @@ bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, +@@ -289,17 +289,19 @@ bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, #define irqchip_in_kernel(k) (!!((k)->arch.vgic.in_kernel)) #define vgic_initialized(k) ((k)->arch.vgic.ready) @@ -10179,7 +12280,7 @@ index 35b0c12..d98e96b 100644 return -ENODEV; } diff --git a/include/linux/acpi.h b/include/linux/acpi.h -index 807cbc4..ecb9e25 100644 +index 407a12f..de81de3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -28,6 +28,7 @@ @@ -10224,10 +12325,64 @@ index 807cbc4..ecb9e25 100644 int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); int acpi_device_modalias(struct device *, char *, int); -@@ -660,4 +662,85 @@ do { \ +@@ -443,6 +445,23 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *); + #define ACPI_COMPANION_SET(dev, adev) do { } while (0) + #define ACPI_HANDLE(dev) (NULL) + ++struct fwnode_handle; ++ ++static inline bool is_acpi_node(struct fwnode_handle *fwnode) ++{ ++ return false; ++} ++ ++static inline struct acpi_device *acpi_node(struct fwnode_handle *fwnode) ++{ ++ return NULL; ++} ++ ++static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev) ++{ ++ return NULL; ++} ++ + static inline const char *acpi_dev_name(struct acpi_device *adev) + { + return NULL; +@@ -659,4 +678,114 @@ do { \ #endif #endif ++struct acpi_gpio_params { ++ unsigned int crs_entry_index; ++ unsigned int line_index; ++ bool active_low; ++}; ++ ++struct acpi_gpio_mapping { ++ const char *name; ++ const struct acpi_gpio_params *data; ++ unsigned int size; ++}; ++ ++#if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB) ++int acpi_dev_add_driver_gpios(struct acpi_device *adev, ++ const struct acpi_gpio_mapping *gpios); ++ ++static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) ++{ ++ if (adev) ++ adev->driver_gpios = NULL; ++} ++#else ++static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev, ++ const struct acpi_gpio_mapping *gpios) ++{ ++ return -ENXIO; ++} ++static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {} ++#endif ++ +/* Device properties */ + +#define MAX_ACPI_REFERENCE_ARGS 8 @@ -10243,20 +12398,19 @@ index 807cbc4..ecb9e25 100644 +int acpi_dev_get_property_array(struct acpi_device *adev, const char *name, + acpi_object_type type, + const union acpi_object **obj); -+int acpi_dev_get_property_reference(struct acpi_device *adev, const char *name, -+ const char *cells_name, size_t index, ++int acpi_dev_get_property_reference(struct acpi_device *adev, ++ const char *name, size_t index, + struct acpi_reference_args *args); + +int acpi_dev_prop_get(struct acpi_device *adev, const char *propname, + void **valptr); ++int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname, ++ enum dev_prop_type proptype, void *val); +int acpi_dev_prop_read(struct acpi_device *adev, const char *propname, -+ enum dev_prop_type proptype, void *val); -+int acpi_dev_prop_read_array(struct acpi_device *adev, const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval); -+int acpi_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data); ++ enum dev_prop_type proptype, void *val, size_t nval); ++ ++struct acpi_device *acpi_get_next_child(struct device *dev, ++ struct acpi_device *child); +#else +static inline int acpi_dev_get_property(struct acpi_device *adev, + const char *name, acpi_object_type type, @@ -10285,33 +12439,33 @@ index 807cbc4..ecb9e25 100644 + return -ENXIO; +} + -+static inline int acpi_dev_prop_read(struct acpi_device *adev, -+ const char *propname, -+ enum dev_prop_type proptype, void *val) ++static inline int acpi_dev_prop_read_single(struct acpi_device *adev, ++ const char *propname, ++ enum dev_prop_type proptype, ++ void *val) +{ + return -ENXIO; +} + -+static inline int acpi_dev_prop_read_array(struct acpi_device *adev, -+ const char *propname, -+ enum dev_prop_type proptype, -+ void *val, size_t nval) ++static inline int acpi_dev_prop_read(struct acpi_device *adev, ++ const char *propname, ++ enum dev_prop_type proptype, ++ void *val, size_t nval) +{ + return -ENXIO; +} + -+static inline int acpi_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data) ++static inline struct acpi_device *acpi_get_next_child(struct device *dev, ++ struct acpi_device *child) +{ -+ return -ENXIO; ++ return NULL; +} + +#endif + #endif /*_LINUX_ACPI_H*/ diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h -index 653f0e2..5839f98 100644 +index abcafaa..4f5caa1 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -346,4 +346,10 @@ extern void clocksource_of_init(void); @@ -10325,19 +12479,45 @@ index 653f0e2..5839f98 100644 +#endif + #endif /* _LINUX_CLOCKSOURCE_H */ +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 0949f9c..0238d61 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -547,6 +547,9 @@ void efi_native_runtime_setup(void); + #define SMBIOS_TABLE_GUID \ + EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) + ++#define SMBIOS3_TABLE_GUID \ ++ EFI_GUID( 0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 ) ++ + #define SAL_SYSTEM_TABLE_GUID \ + EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) + +@@ -810,7 +813,8 @@ extern struct efi { + unsigned long mps; /* MPS table */ + unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ + unsigned long acpi20; /* ACPI table (ACPI 2.0) */ +- unsigned long smbios; /* SM BIOS table */ ++ unsigned long smbios; /* SMBIOS table (32 bit entry point) */ ++ unsigned long smbios3; /* SMBIOS table (64 bit entry point) */ + unsigned long sal_systab; /* SAL system table */ + unsigned long boot_info; /* boot info table */ + unsigned long hcdp; /* HCDP table */ diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h -index 12f146f..033d2fd 100644 +index 12f146f..00b1b70 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h -@@ -94,6 +94,11 @@ int gpiod_to_irq(const struct gpio_desc *desc); +@@ -94,6 +94,13 @@ int gpiod_to_irq(const struct gpio_desc *desc); struct gpio_desc *gpio_to_desc(unsigned gpio); int desc_to_gpio(const struct gpio_desc *desc); +/* Child properties interface */ -+struct gpio_desc *dev_get_named_gpiod_from_child(struct device *dev, void *child, -+ const char *propname, int index); -+struct gpio_desc *devm_get_named_gpiod_from_child(struct device *dev, void *child, -+ const char *propname, int index); ++struct fwnode_handle; ++ ++struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, ++ const char *propname); ++struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, ++ struct fwnode_handle *child); #else /* CONFIG_GPIOLIB */ static inline struct gpio_desc *__must_check __gpiod_get(struct device *dev, @@ -10407,32 +12587,53 @@ index 0000000..ad5b577 + +#endif /* ARM_GIC_ACPI_H_ */ diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h -index 45e2d8c..2b0f246 100644 +index 13eed92..dc9cb5f 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h -@@ -39,6 +39,8 @@ - #define GIC_DIST_SGI_PENDING_CLEAR 0xf10 - #define GIC_DIST_SGI_PENDING_SET 0xf20 +@@ -55,6 +55,8 @@ + (GICD_INT_DEF_PRI << 8) |\ + GICD_INT_DEF_PRI) +#define GIC_DIST_SOFTINT_NSATT 0x8000 + #define GICH_HCR 0x0 #define GICH_VTR 0x4 #define GICH_VMCR 0x8 +diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h +index a6059bd..e4d8f70 100644 +--- a/include/linux/kvm_host.h ++++ b/include/linux/kvm_host.h +@@ -43,6 +43,7 @@ + * include/linux/kvm_h. + */ + #define KVM_MEMSLOT_INVALID (1UL << 16) ++#define KVM_MEMSLOT_INCOHERENT (1UL << 17) + + /* Two fragments for cross MMIO pages. */ + #define KVM_MAX_MMIO_FRAGMENTS 2 diff --git a/include/linux/leds.h b/include/linux/leds.h -index e436864..879a113 100644 +index a57611d..361101f 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h -@@ -246,6 +246,7 @@ struct led_platform_data { - struct gpio_led { - const char *name; - const char *default_trigger; -+ struct gpio_desc *gpiod; - unsigned gpio; - unsigned active_low : 1; +@@ -261,6 +261,7 @@ struct gpio_led { unsigned retain_state_suspended : 1; + unsigned default_state : 2; + /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ ++ struct gpio_desc *gpiod; + }; + #define LEDS_GPIO_DEFSTATE_OFF 0 + #define LEDS_GPIO_DEFSTATE_ON 1 +@@ -273,7 +274,7 @@ struct gpio_led_platform_data { + #define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */ + #define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */ + #define GPIO_LED_BLINK 2 /* Please, blink */ +- int (*gpio_blink_set)(unsigned gpio, int state, ++ int (*gpio_blink_set)(struct gpio_desc *desc, int state, + unsigned long *delay_on, + unsigned long *delay_off); + }; diff --git a/include/linux/of.h b/include/linux/of.h -index 6c4363b..a9ee42d 100644 +index 29f0adc..cf79be1 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -23,6 +23,7 @@ @@ -10443,149 +12644,86 @@ index 6c4363b..a9ee42d 100644 #include <asm/byteorder.h> #include <asm/errno.h> -@@ -355,6 +356,15 @@ const char *of_prop_next_string(struct property *prop, const char *cur); - - bool of_console_check(struct device_node *dn, char *name, int index); - -+int of_dev_prop_get(struct device_node *dn, const char *propname, void **valptr); -+int of_dev_prop_read(struct device_node *dn, const char *propname, -+ enum dev_prop_type proptype, void *val); -+int of_dev_prop_read_array(struct device_node *dn, const char *propname, -+ enum dev_prop_type proptype, void *val, size_t nval); -+int of_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data); -+ - #else /* CONFIG_OF */ - - static inline const char* of_node_full_name(const struct device_node *np) -@@ -582,6 +592,33 @@ static inline const char *of_prop_next_string(struct property *prop, - return NULL; +@@ -49,6 +50,7 @@ struct device_node { + const char *type; + phandle phandle; + const char *full_name; ++ struct fwnode_handle fwnode; + + struct property *properties; + struct property *deadprops; /* removed properties */ +@@ -79,6 +81,7 @@ extern struct kobj_type of_node_ktype; + static inline void of_node_init(struct device_node *node) + { + kobject_init(&node->kobj, &of_node_ktype); ++ node->fwnode.type = FWNODE_OF; } -+static inline int of_dev_prop_get(struct device_node *dn, const char *propname, -+ void **valptr) + /* true when node is initialized */ +@@ -114,6 +117,16 @@ extern struct device_node *of_aliases; + extern struct device_node *of_stdout; + extern raw_spinlock_t devtree_lock; + ++static inline bool is_of_node(struct fwnode_handle *fwnode) +{ -+ return -ENXIO; ++ return fwnode && fwnode->type == FWNODE_OF; +} + -+static inline int of_dev_prop_read(struct device_node *dn, const char *propname, -+ enum dev_prop_type proptype, void *val) ++static inline struct device_node *of_node(struct fwnode_handle *fwnode) +{ -+ return -ENXIO; ++ return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; +} + -+static inline int of_dev_prop_read_array(struct device_node *dn, -+ const char *propname, -+ enum dev_prop_type proptype, -+ void *val, size_t nval) + static inline bool of_have_populated_dt(void) + { + return of_allnodes != NULL; +@@ -263,6 +276,10 @@ extern int of_property_read_u32_array(const struct device_node *np, + size_t sz); + extern int of_property_read_u64(const struct device_node *np, + const char *propname, u64 *out_value); ++extern int of_property_read_u64_array(const struct device_node *np, ++ const char *propname, ++ u64 *out_values, ++ size_t sz); + + extern int of_property_read_string(struct device_node *np, + const char *propname, +@@ -355,6 +372,16 @@ bool of_console_check(struct device_node *dn, char *name, int index); + + #else /* CONFIG_OF */ + ++static inline bool is_of_node(struct fwnode_handle *fwnode) +{ -+ return -ENXIO; ++ return false; +} + -+static inline int of_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data) ++static inline struct device_node *of_node(struct fwnode_handle *fwnode) +{ -+ return -ENXIO; ++ return NULL; +} + - #define of_match_ptr(_ptr) NULL - #define of_match_node(_matches, _node) NULL - #endif /* CONFIG_OF */ -diff --git a/include/linux/of_address.h b/include/linux/of_address.h -index fb7b722..7ebb877 100644 ---- a/include/linux/of_address.h -+++ b/include/linux/of_address.h -@@ -23,17 +23,6 @@ struct of_pci_range { - #define for_each_of_pci_range(parser, range) \ - for (; of_pci_range_parser_one(parser, range);) - --static inline void of_pci_range_to_resource(struct of_pci_range *range, -- struct device_node *np, -- struct resource *res) --{ -- res->flags = range->flags; -- res->start = range->cpu_addr; -- res->end = range->cpu_addr + range->size - 1; -- res->parent = res->child = res->sibling = NULL; -- res->name = np->full_name; --} -- - /* Translate a DMA address from device space to CPU space */ - extern u64 of_translate_dma_address(struct device_node *dev, - const __be32 *in_addr); -@@ -55,7 +44,9 @@ extern void __iomem *of_iomap(struct device_node *device, int index); - extern const __be32 *of_get_address(struct device_node *dev, int index, - u64 *size, unsigned int *flags); - -+extern int pci_register_io_range(phys_addr_t addr, resource_size_t size); - extern unsigned long pci_address_to_pio(phys_addr_t addr); -+extern phys_addr_t pci_pio_to_address(unsigned long pio); - - extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, - struct device_node *node); -@@ -138,6 +129,9 @@ extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, - u64 *size, unsigned int *flags); - extern int of_pci_address_to_resource(struct device_node *dev, int bar, - struct resource *r); -+extern int of_pci_range_to_resource(struct of_pci_range *range, -+ struct device_node *np, -+ struct resource *res); - #else /* CONFIG_OF_ADDRESS && CONFIG_PCI */ - static inline int of_pci_address_to_resource(struct device_node *dev, int bar, - struct resource *r) -@@ -153,4 +147,3 @@ static inline const __be32 *of_get_pci_address(struct device_node *dev, - #endif /* CONFIG_OF_ADDRESS && CONFIG_PCI */ - - #endif /* __OF_ADDRESS_H */ -- -diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h -index dde3a4a..1fd207e 100644 ---- a/include/linux/of_pci.h -+++ b/include/linux/of_pci.h -@@ -15,6 +15,7 @@ struct device_node *of_pci_find_child_device(struct device_node *parent, - int of_pci_get_devfn(struct device_node *np); - int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); - int of_pci_parse_bus_range(struct device_node *node, struct resource *res); -+int of_get_pci_domain_nr(struct device_node *node); - #else - static inline int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq) - { -@@ -43,6 +44,18 @@ of_pci_parse_bus_range(struct device_node *node, struct resource *res) + static inline const char* of_node_full_name(const struct device_node *np) { - return -EINVAL; + return "<no-node>"; +@@ -477,6 +504,13 @@ static inline int of_property_read_u32_array(const struct device_node *np, + return -ENOSYS; } -+ -+static inline int -+of_get_pci_domain_nr(struct device_node *node) + ++static inline int of_property_read_u64_array(const struct device_node *np, ++ const char *propname, ++ u64 *out_values, size_t sz) +{ -+ return -1; ++ return -ENOSYS; +} -+#endif + -+#if defined(CONFIG_OF_ADDRESS) -+int of_pci_get_host_bridge_resources(struct device_node *dev, -+ unsigned char busno, unsigned char bus_max, -+ struct list_head *resources, resource_size_t *io_base); - #endif - - #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) + static inline int of_property_read_string(struct device_node *np, + const char *propname, + const char **out_string) diff --git a/include/linux/pci.h b/include/linux/pci.h -index 96453f9..6d540b9 100644 +index 4c8ac5f..ea663d8 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -457,6 +457,9 @@ struct pci_bus { - unsigned char primary; /* number of primary bridge */ - unsigned char max_bus_speed; /* enum pci_bus_speed */ - unsigned char cur_bus_speed; /* enum pci_bus_speed */ -+#ifdef CONFIG_PCI_DOMAINS_GENERIC -+ int domain_nr; -+#endif - - char name[48]; - -@@ -559,15 +562,6 @@ struct pci_ops { +@@ -563,15 +563,6 @@ struct pci_ops { int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); }; @@ -10601,48 +12739,7 @@ index 96453f9..6d540b9 100644 struct pci_bus_region { dma_addr_t start; dma_addr_t end; -@@ -1103,6 +1097,9 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, - resource_size_t), - void *alignf_data); - -+ -+int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr); -+ - static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) - { - struct pci_bus_region region; -@@ -1288,17 +1285,47 @@ void pci_cfg_access_unlock(struct pci_dev *dev); - */ - #ifdef CONFIG_PCI_DOMAINS - extern int pci_domains_supported; -+int pci_get_new_domain_nr(void); - #else - enum { pci_domains_supported = 0 }; - static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } - static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } -+static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } - #endif /* CONFIG_PCI_DOMAINS */ - -+/* -+ * Generic implementation for PCI domain support. If your -+ * architecture does not need custom management of PCI -+ * domains then this implementation will be used -+ */ -+#ifdef CONFIG_PCI_DOMAINS_GENERIC -+static inline int pci_domain_nr(struct pci_bus *bus) -+{ -+ return bus->domain_nr; -+} -+void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent); -+#else -+static inline void pci_bus_assign_domain_nr(struct pci_bus *bus, -+ struct device *parent) -+{ -+} -+#endif -+ - /* some architectures require additional setup to direct VGA traffic */ - typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, +@@ -1326,6 +1317,16 @@ typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, unsigned int command_bits, u32 flags); void pci_register_set_vga_state(arch_set_vga_state_t func); @@ -10659,7 +12756,7 @@ index 96453f9..6d540b9 100644 #else /* CONFIG_PCI is not enabled */ /* -@@ -1400,8 +1427,26 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, +@@ -1427,6 +1428,23 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn) { return NULL; } @@ -10682,11 +12779,8 @@ index 96453f9..6d540b9 100644 + static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } -+static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } - - #define dev_is_pci(d) (false) - #define dev_is_pf(d) (false) -@@ -1613,7 +1658,6 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, + static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } +@@ -1636,7 +1654,6 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); int pcibios_add_device(struct pci_dev *dev); void pcibios_release_device(struct pci_dev *dev); @@ -10696,10 +12790,10 @@ index 96453f9..6d540b9 100644 extern struct dev_pm_ops pcibios_pm_ops; diff --git a/include/linux/property.h b/include/linux/property.h new file mode 100644 -index 0000000..1a42878 +index 0000000..a6a3d98 --- /dev/null +++ b/include/linux/property.h -@@ -0,0 +1,207 @@ +@@ -0,0 +1,143 @@ +/* + * property.h - Unified device property interface. + * @@ -10715,7 +12809,9 @@ index 0000000..1a42878 +#ifndef _LINUX_PROPERTY_H_ +#define _LINUX_PROPERTY_H_ + -+#include <linux/device.h> ++#include <linux/types.h> ++ ++struct device; + +enum dev_prop_type { + DEV_PROP_U8, @@ -10726,202 +12822,180 @@ index 0000000..1a42878 + DEV_PROP_MAX, +}; + -+int device_get_property(struct device *dev, const char *propname, -+ void **valptr); -+int device_read_property(struct device *dev, const char *propname, -+ enum dev_prop_type proptype, void *val); -+int device_read_property_array(struct device *dev, const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval); -+int device_get_child_property(struct device *dev, void *child, -+ const char *propname, void **valptr); -+int device_read_child_property(struct device *dev, void *child, -+ const char *propname, -+ enum dev_prop_type proptype, void *val); -+int device_read_child_property_array(struct device *dev, void *child, -+ const char *propname, -+ enum dev_prop_type proptype, void *val, -+ size_t nval); -+int device_for_each_child_node(struct device *dev, -+ int (*fn)(struct device *dev, void *child, void *data), -+ void *data); -+unsigned int device_get_child_node_count(struct device *dev); -+ -+static inline int device_property_read_u8(struct device *dev, -+ const char *propname, u8 *out_value) -+{ -+ return device_read_property(dev, propname, DEV_PROP_U8, out_value); -+} -+ -+static inline int device_property_read_u16(struct device *dev, -+ const char *propname, u16 *out_value) -+{ -+ return device_read_property(dev, propname, DEV_PROP_U16, out_value); -+} -+ -+static inline int device_property_read_u32(struct device *dev, -+ const char *propname, u32 *out_value) -+{ -+ return device_read_property(dev, propname, DEV_PROP_U32, out_value); -+} -+ -+static inline int device_property_read_u64(struct device *dev, -+ const char *propname, u64 *out_value) -+{ -+ return device_read_property(dev, propname, DEV_PROP_U64, out_value); -+} ++bool device_property_present(struct device *dev, const char *propname); ++int device_property_read_u8_array(struct device *dev, const char *propname, ++ u8 *val, size_t nval); ++int device_property_read_u16_array(struct device *dev, const char *propname, ++ u16 *val, size_t nval); ++int device_property_read_u32_array(struct device *dev, const char *propname, ++ u32 *val, size_t nval); ++int device_property_read_u64_array(struct device *dev, const char *propname, ++ u64 *val, size_t nval); ++int device_property_read_string_array(struct device *dev, const char *propname, ++ const char **val, size_t nval); ++int device_property_read_string(struct device *dev, const char *propname, ++ const char **val); ++ ++enum fwnode_type { ++ FWNODE_INVALID = 0, ++ FWNODE_OF, ++ FWNODE_ACPI, ++}; + -+static inline int device_property_read_u8_array(struct device *dev, -+ const char *propname, -+ u8 *val, size_t nval) -+{ -+ return device_read_property_array(dev, propname, DEV_PROP_U8, val, -+ nval); -+} ++struct fwnode_handle { ++ enum fwnode_type type; ++}; + -+static inline int device_property_read_u16_array(struct device *dev, -+ const char *propname, -+ u16 *val, size_t nval) -+{ -+ return device_read_property_array(dev, propname, DEV_PROP_U16, val, -+ nval); -+} ++bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname); ++int fwnode_property_read_u8_array(struct fwnode_handle *fwnode, ++ const char *propname, u8 *val, ++ size_t nval); ++int fwnode_property_read_u16_array(struct fwnode_handle *fwnode, ++ const char *propname, u16 *val, ++ size_t nval); ++int fwnode_property_read_u32_array(struct fwnode_handle *fwnode, ++ const char *propname, u32 *val, ++ size_t nval); ++int fwnode_property_read_u64_array(struct fwnode_handle *fwnode, ++ const char *propname, u64 *val, ++ size_t nval); ++int fwnode_property_read_string_array(struct fwnode_handle *fwnode, ++ const char *propname, const char **val, ++ size_t nval); ++int fwnode_property_read_string(struct fwnode_handle *fwnode, ++ const char *propname, const char **val); ++ ++struct fwnode_handle *device_get_next_child_node(struct device *dev, ++ struct fwnode_handle *child); ++ ++#define device_for_each_child_node(dev, child) \ ++ for (child = device_get_next_child_node(dev, NULL); child; \ ++ child = device_get_next_child_node(dev, child)) ++ ++void fwnode_handle_put(struct fwnode_handle *fwnode); + -+static inline int device_property_read_u32_array(struct device *dev, -+ const char *propname, -+ u32 *val, size_t nval) -+{ -+ return device_read_property_array(dev, propname, DEV_PROP_U32, val, -+ nval); -+} ++unsigned int device_get_child_node_count(struct device *dev); + -+static inline int device_property_read_u64_array(struct device *dev, -+ const char *propname, -+ u64 *val, size_t nval) ++static inline bool device_property_read_bool(struct device *dev, ++ const char *propname) +{ -+ return device_read_property_array(dev, propname, DEV_PROP_U64, val, -+ nval); ++ return device_property_present(dev, propname); +} + -+static inline int device_property_read_string(struct device *dev, -+ const char *propname, -+ const char **out_string) ++static inline int device_property_read_u8(struct device *dev, ++ const char *propname, u8 *val) +{ -+ return device_read_property(dev, propname, DEV_PROP_STRING, out_string); ++ return device_property_read_u8_array(dev, propname, val, 1); +} + -+static inline int device_property_read_string_array(struct device *dev, -+ const char *propname, -+ const char **out_strings, -+ size_t nstrings) ++static inline int device_property_read_u16(struct device *dev, ++ const char *propname, u16 *val) +{ -+ return device_read_property_array(dev, propname, DEV_PROP_STRING, -+ out_strings, nstrings); ++ return device_property_read_u16_array(dev, propname, val, 1); +} + -+static inline int device_child_property_read_u8(struct device *dev, void *child, -+ const char *propname, -+ u8 *out_value) ++static inline int device_property_read_u32(struct device *dev, ++ const char *propname, u32 *val) +{ -+ return device_read_child_property(dev, child, propname, DEV_PROP_U8, -+ out_value); ++ return device_property_read_u32_array(dev, propname, val, 1); +} + -+static inline int device_child_property_read_u16(struct device *dev, void *child, -+ const char *propname, -+ u16 *out_value) ++static inline int device_property_read_u64(struct device *dev, ++ const char *propname, u64 *val) +{ -+ return device_read_child_property(dev, child, propname, DEV_PROP_U16, -+ out_value); ++ return device_property_read_u64_array(dev, propname, val, 1); +} + -+static inline int device_child_property_read_u32(struct device *dev, void *child, -+ const char *propname, -+ u32 *out_value) ++static inline bool fwnode_property_read_bool(struct fwnode_handle *fwnode, ++ const char *propname) +{ -+ return device_read_child_property(dev, child, propname, DEV_PROP_U32, -+ out_value); ++ return fwnode_property_present(fwnode, propname); +} + -+static inline int device_child_property_read_u64(struct device *dev, void *child, -+ const char *propname, -+ u64 *out_value) ++static inline int fwnode_property_read_u8(struct fwnode_handle *fwnode, ++ const char *propname, u8 *val) +{ -+ return device_read_child_property(dev, child, propname, DEV_PROP_U64, -+ out_value); ++ return fwnode_property_read_u8_array(fwnode, propname, val, 1); +} + -+static inline int device_child_property_read_u8_array(struct device *dev, -+ void *child, -+ const char *propname, -+ u8 *val, size_t nval) ++static inline int fwnode_property_read_u16(struct fwnode_handle *fwnode, ++ const char *propname, u16 *val) +{ -+ return device_read_child_property_array(dev, child, propname, -+ DEV_PROP_U8, val, nval); ++ return fwnode_property_read_u16_array(fwnode, propname, val, 1); +} + -+static inline int device_child_property_read_u16_array(struct device *dev, -+ void *child, -+ const char *propname, -+ u16 *val, size_t nval) ++static inline int fwnode_property_read_u32(struct fwnode_handle *fwnode, ++ const char *propname, u32 *val) +{ -+ return device_read_child_property_array(dev, child, propname, -+ DEV_PROP_U16, val, nval); ++ return fwnode_property_read_u32_array(fwnode, propname, val, 1); +} + -+static inline int device_child_property_read_u32_array(struct device *dev, -+ void *child, -+ const char *propname, -+ u32 *val, size_t nval) ++static inline int fwnode_property_read_u64(struct fwnode_handle *fwnode, ++ const char *propname, u64 *val) +{ -+ return device_read_child_property_array(dev, child, propname, -+ DEV_PROP_U32, val, nval); ++ return fwnode_property_read_u64_array(fwnode, propname, val, 1); +} + -+static inline int device_child_property_read_u64_array(struct device *dev, -+ void *child, -+ const char *propname, -+ u64 *val, size_t nval) -+{ -+ return device_read_child_property_array(dev, child, propname, -+ DEV_PROP_U64, val, nval); -+} ++#endif /* _LINUX_PROPERTY_H_ */ +diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c +index 0f62326..2a47179 100644 +--- a/net/rfkill/rfkill-gpio.c ++++ b/net/rfkill/rfkill-gpio.c +@@ -63,6 +63,15 @@ static const struct rfkill_ops rfkill_gpio_ops = { + .set_block = rfkill_gpio_set_power, + }; + ++static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; ++static const struct acpi_gpio_params shutdown_gpios = { 1, 0, false }; + -+static inline int device_child_property_read_string(struct device *dev, -+ void *child, -+ const char *propname, -+ const char **out_string) -+{ -+ return device_read_child_property(dev, child, propname, DEV_PROP_STRING, -+ out_string); -+} ++static const struct acpi_gpio_mapping acpi_rfkill_default_gpios[] = { ++ { "reset-gpios", &reset_gpios, 1 }, ++ { "shutdown-gpios", &shutdown_gpios, 1 }, ++ { }, ++}; + -+static inline int device_child_property_read_string_array(struct device *dev, -+ void *child, -+ const char *propname, -+ const char **out_strings, -+ size_t nstrings) -+{ -+ return device_read_child_property_array(dev, child, propname, -+ DEV_PROP_STRING, -+ out_strings, nstrings); -+} -+#endif /* _LINUX_PROPERTY_H_ */ -diff --git a/tools/perf/arch/arm64/include/perf_regs.h b/tools/perf/arch/arm64/include/perf_regs.h -index e9441b9..1d3f39c 100644 ---- a/tools/perf/arch/arm64/include/perf_regs.h -+++ b/tools/perf/arch/arm64/include/perf_regs.h -@@ -6,6 +6,8 @@ - #include <asm/perf_regs.h> + static int rfkill_gpio_acpi_probe(struct device *dev, + struct rfkill_gpio_data *rfkill) + { +@@ -75,7 +84,8 @@ static int rfkill_gpio_acpi_probe(struct device *dev, + rfkill->name = dev_name(dev); + rfkill->type = (unsigned)id->driver_data; + +- return 0; ++ return acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), ++ acpi_rfkill_default_gpios); + } - #define PERF_REGS_MASK ((1ULL << PERF_REG_ARM64_MAX) - 1) -+#define PERF_REGS_MAX PERF_REG_ARM64_MAX + static int rfkill_gpio_probe(struct platform_device *pdev) +@@ -102,7 +112,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) + + rfkill->clk = devm_clk_get(&pdev->dev, NULL); + +- gpio = devm_gpiod_get_index(&pdev->dev, "reset", 0); ++ gpio = devm_gpiod_get(&pdev->dev, "reset"); + if (!IS_ERR(gpio)) { + ret = gpiod_direction_output(gpio, 0); + if (ret) +@@ -110,7 +120,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) + rfkill->reset_gpio = gpio; + } + +- gpio = devm_gpiod_get_index(&pdev->dev, "shutdown", 1); ++ gpio = devm_gpiod_get(&pdev->dev, "shutdown"); + if (!IS_ERR(gpio)) { + ret = gpiod_direction_output(gpio, 0); + if (ret) +@@ -150,6 +160,8 @@ static int rfkill_gpio_remove(struct platform_device *pdev) + rfkill_unregister(rfkill->rfkill_dev); + rfkill_destroy(rfkill->rfkill_dev); + ++ acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev)); + - #define PERF_REG_IP PERF_REG_ARM64_PC - #define PERF_REG_SP PERF_REG_ARM64_SP + return 0; + } diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c -index 22fa819..9cd5dbd 100644 +index 22fa819..642dad4 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -21,9 +21,11 @@ @@ -10936,7 +13010,7 @@ index 22fa819..9cd5dbd 100644 #include <kvm/arm_vgic.h> #include <kvm/arm_arch_timer.h> -@@ -244,60 +246,92 @@ static const struct of_device_id arch_timer_of_match[] = { +@@ -244,60 +246,91 @@ static const struct of_device_id arch_timer_of_match[] = { {}, }; @@ -10979,7 +13053,6 @@ index 22fa819..9cd5dbd 100644 +} - host_vtimer_irq = ppi; -+extern int acadia_kvm_acpi; +extern int arch_timer_ppi[]; - err = __register_cpu_notifier(&kvm_timer_cpu_nb); @@ -11020,7 +13093,7 @@ index 22fa819..9cd5dbd 100644 - goto out; + /* if DT parsing fails, try ACPI next */ -+ if (err && !acpi_disabled && acadia_kvm_acpi ) ++ if (err && !acpi_disabled) + err = kvm_timer_ppi_parse_acpi(&ppi); + + if (err) { @@ -11067,7 +13140,7 @@ index 22fa819..9cd5dbd 100644 void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c -index 416baed..53bdd33 100644 +index 2935405..510049c 100644 --- a/virt/kvm/arm/vgic-v2.c +++ b/virt/kvm/arm/vgic-v2.c @@ -19,6 +19,7 @@ @@ -11086,7 +13159,7 @@ index 416baed..53bdd33 100644 #include <asm/kvm_emulate.h> #include <asm/kvm_arm.h> #include <asm/kvm_mmu.h> -@@ -177,7 +179,7 @@ static const struct vgic_ops vgic_v2_ops = { +@@ -159,7 +161,7 @@ static const struct vgic_ops vgic_v2_ops = { static struct vgic_params vgic_v2_params; /** @@ -11095,7 +13168,7 @@ index 416baed..53bdd33 100644 * @node: pointer to the DT node * @ops: address of a pointer to the GICv2 operations * @params: address of a pointer to HW-specific parameters -@@ -186,7 +188,7 @@ static struct vgic_params vgic_v2_params; +@@ -168,7 +170,7 @@ static struct vgic_params vgic_v2_params; * in *ops and the HW parameters in *params. Returns an error code * otherwise. */ @@ -11104,7 +13177,30 @@ index 416baed..53bdd33 100644 const struct vgic_ops **ops, const struct vgic_params **params) { -@@ -263,3 +265,72 @@ out: +@@ -222,11 +224,22 @@ int vgic_v2_probe(struct device_node *vgic_node, + } + + if (!PAGE_ALIGNED(resource_size(&vcpu_res))) { ++#if 0 + kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n", + (unsigned long long)resource_size(&vcpu_res), + PAGE_SIZE); + ret = -ENXIO; + goto out_unmap; ++#else ++ /* ++ * The check fails for arm64 with 64K pagesize and certain firmware. ++ * Ignore for now until firmware takes care of the problem. ++ */ ++ kvm_info("GICV size 0x%llx not a multiple of page size 0x%lx\n", ++ (unsigned long long)resource_size(&vcpu_res), ++ PAGE_SIZE); ++ kvm_info("Update DT to assign GICV a multiple of kernel page size \n"); ++#endif + } + + vgic->vcpu_base = vcpu_res.start; +@@ -245,3 +258,72 @@ out: of_node_put(vgic_node); return ret; } @@ -11204,7 +13300,7 @@ index 1c2c8ee..8b56920 100644 int ret = 0; u32 gicv_idx; diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c -index 73eba79..ca98a3b 100644 +index aacdb59..d972d63 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -25,9 +25,11 @@ @@ -11219,7 +13315,7 @@ index 73eba79..ca98a3b 100644 #include <asm/kvm_emulate.h> #include <asm/kvm_arm.h> #include <asm/kvm_mmu.h> -@@ -1549,31 +1551,39 @@ static struct notifier_block vgic_cpu_nb = { +@@ -2427,8 +2429,8 @@ static struct notifier_block vgic_cpu_nb = { }; static const struct of_device_id vgic_ids[] = { @@ -11230,13 +13326,9 @@ index 73eba79..ca98a3b 100644 {}, }; -+extern int acadia_kvm_acpi; -+ - int kvm_vgic_hyp_init(void) - { - const struct of_device_id *matched_id; - int (*vgic_probe)(struct device_node *,const struct vgic_ops **, - const struct vgic_params **); +@@ -2438,20 +2440,26 @@ int kvm_vgic_hyp_init(void) + const int (*vgic_probe)(struct device_node *,const struct vgic_ops **, + const struct vgic_params **); struct device_node *vgic_node; - int ret; + int ret = -ENODEV; @@ -11247,13 +13339,13 @@ index 73eba79..ca98a3b 100644 - kvm_err("error: no compatible GIC node found\n"); - return -ENODEV; + /* probe VGIC */ -+ if (vgic_node = of_find_matching_node_and_match(NULL, -+ vgic_ids, &matched_id)) { ++ if ((vgic_node = of_find_matching_node_and_match(NULL, ++ vgic_ids, &matched_id))) { + /* probe VGIC in DT */ + vgic_probe = matched_id->data; + ret = vgic_probe(vgic_node, &vgic_ops, &vgic); + } -+ else if (!acpi_disabled && acadia_kvm_acpi) { ++ else if (!acpi_disabled) { + /* probe VGIC in ACPI */ + ret = vgic_v2_acpi_probe(&vgic_ops, &vgic); } diff --git a/kernel.spec b/kernel.spec index 50103ff1..2fe383c7 100644 --- a/kernel.spec +++ b/kernel.spec @@ -42,19 +42,19 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 300 +%global baserelease 200 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching # on top of -- for example, 3.1-rc7-git1 starts with a 3.0 base, # which yields a base_sublevel of 0. -%define base_sublevel 17 +%define base_sublevel 18 ## If this is a released kernel ## %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 8 +%define stable_update 2 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -572,11 +572,8 @@ Patch14010: lis3-improve-handling-of-null-rate.patch Patch15000: watchdog-Disable-watchdog-on-virtual-machines.patch # PPC -Patch18000: ppc64-fixtools.patch + # ARM64 -Patch20000: arm64-force-serial-to-be-active-consdev.patch -Patch20001: arm64-vgic-error-to-info.patch -Patch20002: arm64-fix-xgene_enet_process_ring.patch # ARMv7 Patch21020: ARM-tegra-usb-no-reset.patch @@ -603,21 +600,9 @@ Patch21247: ath9k-rx-dma-stop-check.patch Patch22000: weird-root-dentry-name-debug.patch -#rhbz 1025603 -Patch25063: disable-libdw-unwind-on-non-x86.patch - -Patch26000: perf-install-trace-event-plugins.patch - # Patch series from Hans for various backlight and platform driver fixes Patch26002: samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch -#rhbz 1134969 -Patch26016: HID-wacom-Add-support-for-the-Cintiq-Companion.patch - -#rhbz 1110011 -Patch26019: psmouse-Add-psmouse_matches_pnp_id-helper-function.patch -Patch26020: psmouse-Add-support-for-detecting-FocalTech-PS-2-tou.patch - #rhbz 1089731 Patch26058: asus-nb-wmi-Add-wapf4-quirk-for-the-X550VB.patch @@ -635,13 +620,11 @@ Patch26096: cfg80211-don-t-WARN-about-two-consecutive-Country-IE.patch #rhbz 1173806 Patch26101: powerpc-powernv-force-all-CPUs-to-be-bootable.patch -#CVE-2014-8559 rhbz 1159313 1173814 -Patch26098: move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch -Patch26099: deal-with-deadlock-in-d_walk.patch - #rhbz 1175261 Patch26103: blk-mq-Fix-uninitialized-kobject-at-CPU-hotplugging.patch +Patch26107: uapi-linux-target_core_user.h-fix-headers_install.sh.patch + #rhbz 1163927 Patch26121: Set-UID-in-sess_auth_rawntlmssp_authenticate-too.patch @@ -1242,7 +1225,6 @@ ApplyOptionalPatch upstream-reverts.patch -R ApplyPatch lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch # PPC -ApplyPatch ppc64-fixtools.patch # ARM64 @@ -1381,21 +1363,9 @@ ApplyPatch criu-no-expert.patch #rhbz 892811 ApplyPatch ath9k-rx-dma-stop-check.patch -#rhbz 1025603 -ApplyPatch disable-libdw-unwind-on-non-x86.patch - -ApplyPatch perf-install-trace-event-plugins.patch - # Patch series from Hans for various backlight and platform driver fixes ApplyPatch samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch -#rhbz 1134969 -ApplyPatch HID-wacom-Add-support-for-the-Cintiq-Companion.patch - -#rhbz 1110011 -ApplyPatch psmouse-Add-psmouse_matches_pnp_id-helper-function.patch -ApplyPatch psmouse-Add-support-for-detecting-FocalTech-PS-2-tou.patch - #rhbz 1089731 ApplyPatch asus-nb-wmi-Add-wapf4-quirk-for-the-X550VB.patch @@ -1413,13 +1383,11 @@ ApplyPatch cfg80211-don-t-WARN-about-two-consecutive-Country-IE.patch #rhbz 1173806 ApplyPatch powerpc-powernv-force-all-CPUs-to-be-bootable.patch -#CVE-2014-8559 rhbz 1159313 1173814 -ApplyPatch move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch -ApplyPatch deal-with-deadlock-in-d_walk.patch - #rhbz 1175261 ApplyPatch blk-mq-Fix-uninitialized-kobject-at-CPU-hotplugging.patch +ApplyPatch uapi-linux-target_core_user.h-fix-headers_install.sh.patch + #rhbz 1163927 ApplyPatch Set-UID-in-sess_auth_rawntlmssp_authenticate-too.patch @@ -1452,11 +1420,7 @@ ApplyPatch kernel-arm64.patch %ifnarch aarch64 # this is stupid, but i want to notice before secondary koji does. ApplyPatch kernel-arm64.patch -R %else -# arm64-force-serial-to-be-active-consdev.patch: not for upstream # solved with SPCR in future -ApplyPatch arm64-force-serial-to-be-active-consdev.patch -ApplyPatch arm64-vgic-error-to-info.patch -ApplyPatch arm64-fix-xgene_enet_process_ring.patch %endif %endif @@ -2321,6 +2285,9 @@ fi # ||----w | # || || %changelog +* Tue Jan 13 2015 Justin M. Forbes <jforbes@fedoraproject.org> - 3.18.2-200 +- Linux v3.18.2 + * Mon Jan 12 2015 Josh Boyer <jwboyer@fedoraproject.org> - CVE-2014-9585 ASLR brute-force possible for vdso (rhbz 1181054 1181056) - Backlight fixes for Samsung and Dell machines (rhbz 1094948 1115713 1163574) diff --git a/move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch b/move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch deleted file mode 100644 index 62f7a686..00000000 --- a/move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch +++ /dev/null @@ -1,736 +0,0 @@ -From: Al Viro <viro@zeniv.linux.org.uk> -Date: Sun, 26 Oct 2014 19:19:16 -0400 -Subject: [PATCH] move d_rcu from overlapping d_child to overlapping d_alias - -Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> ---- - arch/powerpc/platforms/cell/spufs/inode.c | 2 +- - drivers/staging/lustre/lustre/llite/dcache.c | 2 +- - drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- - drivers/staging/lustre/lustre/llite/namei.c | 8 ++-- - fs/affs/amigaffs.c | 2 +- - fs/autofs4/expire.c | 12 +++--- - fs/autofs4/root.c | 2 +- - fs/ceph/dir.c | 8 ++-- - fs/ceph/inode.c | 2 +- - fs/cifs/inode.c | 2 +- - fs/coda/cache.c | 2 +- - fs/dcache.c | 52 ++++++++++++------------- - fs/debugfs/inode.c | 2 +- - fs/exportfs/expfs.c | 2 +- - fs/libfs.c | 12 +++--- - fs/ncpfs/dir.c | 2 +- - fs/ncpfs/ncplib_kernel.h | 4 +- - fs/nfs/getroot.c | 2 +- - fs/notify/fsnotify.c | 4 +- - fs/ocfs2/dcache.c | 2 +- - include/linux/dcache.h | 8 ++-- - kernel/trace/trace.c | 4 +- - kernel/trace/trace_events.c | 2 +- - security/selinux/selinuxfs.c | 6 +-- - 24 files changed, 73 insertions(+), 73 deletions(-) - -diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c -index 87ba7cf99cd7..65d633f20d37 100644 ---- a/arch/powerpc/platforms/cell/spufs/inode.c -+++ b/arch/powerpc/platforms/cell/spufs/inode.c -@@ -164,7 +164,7 @@ static void spufs_prune_dir(struct dentry *dir) - struct dentry *dentry, *tmp; - - mutex_lock(&dir->d_inode->i_mutex); -- list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { -+ list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { - spin_lock(&dentry->d_lock); - if (!(d_unhashed(dentry)) && dentry->d_inode) { - dget_dlock(dentry); -diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c -index 49ae207ad425..e2add5fde0fe 100644 ---- a/drivers/staging/lustre/lustre/llite/dcache.c -+++ b/drivers/staging/lustre/lustre/llite/dcache.c -@@ -258,7 +258,7 @@ void ll_invalidate_aliases(struct inode *inode) - inode->i_ino, inode->i_generation, inode); - - ll_lock_dcache(inode); -- ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) { -+ ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) { - CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p " - "inode %p flags %d\n", dentry->d_name.len, - dentry->d_name.name, dentry, dentry->d_parent, -diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c -index 0c59e26c0805..36e62524a37b 100644 ---- a/drivers/staging/lustre/lustre/llite/llite_lib.c -+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c -@@ -704,7 +704,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur) - return; - - list_for_each(tmp, &dentry->d_subdirs) { -- struct dentry *d = list_entry(tmp, struct dentry, d_u.d_child); -+ struct dentry *d = list_entry(tmp, struct dentry, d_child); - lustre_dump_dentry(d, recur - 1); - } - } -diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c -index 0dc7173bbd41..9de0d51e33a2 100644 ---- a/drivers/staging/lustre/lustre/llite/namei.c -+++ b/drivers/staging/lustre/lustre/llite/namei.c -@@ -167,14 +167,14 @@ static void ll_invalidate_negative_children(struct inode *dir) - struct ll_d_hlist_node *p; - - ll_lock_dcache(dir); -- ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_alias) { -+ ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) { - spin_lock(&dentry->d_lock); - if (!list_empty(&dentry->d_subdirs)) { - struct dentry *child; - - list_for_each_entry_safe(child, tmp_subdir, - &dentry->d_subdirs, -- d_u.d_child) { -+ d_child) { - if (child->d_inode == NULL) - d_lustre_invalidate(child, 1); - } -@@ -362,7 +362,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) - discon_alias = invalid_alias = NULL; - - ll_lock_dcache(inode); -- ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_alias) { -+ ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_u.d_alias) { - LASSERT(alias != dentry); - - spin_lock(&alias->d_lock); -@@ -943,7 +943,7 @@ static void ll_get_child_fid(struct inode * dir, struct qstr *name, - { - struct dentry *parent, *child; - -- parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias); -+ parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_u.d_alias); - child = d_lookup(parent, name); - if (child) { - if (child->d_inode) -diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c -index 406b29836b19..a674c114fd8e 100644 ---- a/fs/affs/amigaffs.c -+++ b/fs/affs/amigaffs.c -@@ -127,7 +127,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino) - { - struct dentry *dentry; - spin_lock(&inode->i_lock); -- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { - if (entry_ino == (u32)(long)dentry->d_fsdata) { - dentry->d_fsdata = (void *)inode->i_ino; - break; -diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c -index a7be57e39be7..11c6cddff1b9 100644 ---- a/fs/autofs4/expire.c -+++ b/fs/autofs4/expire.c -@@ -91,7 +91,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev, - spin_lock(&root->d_lock); - - if (prev) -- next = prev->d_u.d_child.next; -+ next = prev->d_child.next; - else { - prev = dget_dlock(root); - next = prev->d_subdirs.next; -@@ -105,13 +105,13 @@ cont: - return NULL; - } - -- q = list_entry(next, struct dentry, d_u.d_child); -+ q = list_entry(next, struct dentry, d_child); - - spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED); - /* Already gone or negative dentry (under construction) - try next */ - if (!d_count(q) || !simple_positive(q)) { - spin_unlock(&q->d_lock); -- next = q->d_u.d_child.next; -+ next = q->d_child.next; - goto cont; - } - dget_dlock(q); -@@ -161,13 +161,13 @@ again: - goto relock; - } - spin_unlock(&p->d_lock); -- next = p->d_u.d_child.next; -+ next = p->d_child.next; - p = parent; - if (next != &parent->d_subdirs) - break; - } - } -- ret = list_entry(next, struct dentry, d_u.d_child); -+ ret = list_entry(next, struct dentry, d_child); - - spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED); - /* Negative dentry - try next */ -@@ -460,7 +460,7 @@ found: - spin_lock(&sbi->lookup_lock); - spin_lock(&expired->d_parent->d_lock); - spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED); -- list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child); -+ list_move(&expired->d_parent->d_subdirs, &expired->d_child); - spin_unlock(&expired->d_lock); - spin_unlock(&expired->d_parent->d_lock); - spin_unlock(&sbi->lookup_lock); -diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c -index cdb25ebccc4c..38a9e0fa5177 100644 ---- a/fs/autofs4/root.c -+++ b/fs/autofs4/root.c -@@ -659,7 +659,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry) - /* only consider parents below dentrys in the root */ - if (IS_ROOT(parent->d_parent)) - return; -- d_child = &dentry->d_u.d_child; -+ d_child = &dentry->d_child; - /* Set parent managed if it's becoming empty */ - if (d_child->next == &parent->d_subdirs && - d_child->prev == &parent->d_subdirs) -diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c -index c29d6ae68874..51ea03313df9 100644 ---- a/fs/ceph/dir.c -+++ b/fs/ceph/dir.c -@@ -111,7 +111,7 @@ static int fpos_cmp(loff_t l, loff_t r) - /* - * When possible, we try to satisfy a readdir by peeking at the - * dcache. We make this work by carefully ordering dentries on -- * d_u.d_child when we initially get results back from the MDS, and -+ * d_child when we initially get results back from the MDS, and - * falling back to a "normal" sync readdir if any dentries in the dir - * are dropped. - * -@@ -147,11 +147,11 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx, - p = parent->d_subdirs.prev; - dout(" initial p %p/%p\n", p->prev, p->next); - } else { -- p = last->d_u.d_child.prev; -+ p = last->d_child.prev; - } - - more: -- dentry = list_entry(p, struct dentry, d_u.d_child); -+ dentry = list_entry(p, struct dentry, d_child); - di = ceph_dentry(dentry); - while (1) { - dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next, -@@ -174,7 +174,7 @@ more: - !dentry->d_inode ? " null" : ""); - spin_unlock(&dentry->d_lock); - p = p->prev; -- dentry = list_entry(p, struct dentry, d_u.d_child); -+ dentry = list_entry(p, struct dentry, d_child); - di = ceph_dentry(dentry); - } - -diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c -index 04c89c266cec..c3e103ff18bd 100644 ---- a/fs/ceph/inode.c -+++ b/fs/ceph/inode.c -@@ -1399,7 +1399,7 @@ retry_lookup: - /* reorder parent's d_subdirs */ - spin_lock(&parent->d_lock); - spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); -- list_move(&dn->d_u.d_child, &parent->d_subdirs); -+ list_move(&dn->d_child, &parent->d_subdirs); - spin_unlock(&dn->d_lock); - spin_unlock(&parent->d_lock); - } -diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c -index 7899a40465b3..6d1dd0942937 100644 ---- a/fs/cifs/inode.c -+++ b/fs/cifs/inode.c -@@ -887,7 +887,7 @@ inode_has_hashed_dentries(struct inode *inode) - struct dentry *dentry; - - spin_lock(&inode->i_lock); -- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { - if (!d_unhashed(dentry) || IS_ROOT(dentry)) { - spin_unlock(&inode->i_lock); - return true; -diff --git a/fs/coda/cache.c b/fs/coda/cache.c -index 278f8fdeb9ef..46ee6f238985 100644 ---- a/fs/coda/cache.c -+++ b/fs/coda/cache.c -@@ -92,7 +92,7 @@ static void coda_flag_children(struct dentry *parent, int flag) - struct dentry *de; - - spin_lock(&parent->d_lock); -- list_for_each_entry(de, &parent->d_subdirs, d_u.d_child) { -+ list_for_each_entry(de, &parent->d_subdirs, d_child) { - /* don't know what to do with negative dentries */ - if (de->d_inode ) - coda_flag_inode(de->d_inode, flag); -diff --git a/fs/dcache.c b/fs/dcache.c -index 34b40be8af11..8d7c2b34cb3f 100644 ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -44,7 +44,7 @@ - /* - * Usage: - * dcache->d_inode->i_lock protects: -- * - i_dentry, d_alias, d_inode of aliases -+ * - i_dentry, d_u.d_alias, d_inode of aliases - * dcache_hash_bucket lock protects: - * - the dcache hash table - * s_anon bl list spinlock protects: -@@ -59,7 +59,7 @@ - * - d_unhashed() - * - d_parent and d_subdirs - * - childrens' d_child and d_parent -- * - d_alias, d_inode -+ * - d_u.d_alias, d_inode - * - * Ordering: - * dentry->d_inode->i_lock -@@ -239,7 +239,6 @@ static void __d_free(struct rcu_head *head) - { - struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); - -- WARN_ON(!hlist_unhashed(&dentry->d_alias)); - if (dname_external(dentry)) - kfree(dentry->d_name.name); - kmem_cache_free(dentry_cache, dentry); -@@ -247,6 +246,7 @@ static void __d_free(struct rcu_head *head) - - static void dentry_free(struct dentry *dentry) - { -+ WARN_ON(!hlist_unhashed(&dentry->d_u.d_alias)); - /* if dentry was never visible to RCU, immediate free is OK */ - if (!(dentry->d_flags & DCACHE_RCUACCESS)) - __d_free(&dentry->d_u.d_rcu); -@@ -280,7 +280,7 @@ static void dentry_iput(struct dentry * dentry) - struct inode *inode = dentry->d_inode; - if (inode) { - dentry->d_inode = NULL; -- hlist_del_init(&dentry->d_alias); -+ hlist_del_init(&dentry->d_u.d_alias); - spin_unlock(&dentry->d_lock); - spin_unlock(&inode->i_lock); - if (!inode->i_nlink) -@@ -305,7 +305,7 @@ static void dentry_unlink_inode(struct dentry * dentry) - struct inode *inode = dentry->d_inode; - __d_clear_type(dentry); - dentry->d_inode = NULL; -- hlist_del_init(&dentry->d_alias); -+ hlist_del_init(&dentry->d_u.d_alias); - dentry_rcuwalk_barrier(dentry); - spin_unlock(&dentry->d_lock); - spin_unlock(&inode->i_lock); -@@ -465,7 +465,7 @@ static void __dentry_kill(struct dentry *dentry) - } - /* if it was on the hash then remove it */ - __d_drop(dentry); -- list_del(&dentry->d_u.d_child); -+ list_del(&dentry->d_child); - /* - * Inform d_walk() that we are no longer attached to the - * dentry tree -@@ -746,7 +746,7 @@ static struct dentry *__d_find_alias(struct inode *inode) - - again: - discon_alias = NULL; -- hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { - spin_lock(&alias->d_lock); - if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { - if (IS_ROOT(alias) && -@@ -796,7 +796,7 @@ void d_prune_aliases(struct inode *inode) - struct dentry *dentry; - restart: - spin_lock(&inode->i_lock); -- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { - spin_lock(&dentry->d_lock); - if (!dentry->d_lockref.count) { - /* -@@ -1081,7 +1081,7 @@ repeat: - resume: - while (next != &this_parent->d_subdirs) { - struct list_head *tmp = next; -- struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); -+ struct dentry *dentry = list_entry(tmp, struct dentry, d_child); - next = tmp->next; - - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); -@@ -1133,7 +1133,7 @@ resume: - goto rename_retry; - } - rcu_read_unlock(); -- next = child->d_u.d_child.next; -+ next = child->d_child.next; - goto resume; - } - if (need_seqretry(&rename_lock, seq)) { -@@ -1468,8 +1468,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) - INIT_HLIST_BL_NODE(&dentry->d_hash); - INIT_LIST_HEAD(&dentry->d_lru); - INIT_LIST_HEAD(&dentry->d_subdirs); -- INIT_HLIST_NODE(&dentry->d_alias); -- INIT_LIST_HEAD(&dentry->d_u.d_child); -+ INIT_HLIST_NODE(&dentry->d_u.d_alias); -+ INIT_LIST_HEAD(&dentry->d_child); - d_set_d_op(dentry, dentry->d_sb->s_d_op); - - this_cpu_inc(nr_dentry); -@@ -1499,7 +1499,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) - */ - __dget_dlock(parent); - dentry->d_parent = parent; -- list_add(&dentry->d_u.d_child, &parent->d_subdirs); -+ list_add(&dentry->d_child, &parent->d_subdirs); - spin_unlock(&parent->d_lock); - - return dentry; -@@ -1592,7 +1592,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) - spin_lock(&dentry->d_lock); - __d_set_type(dentry, add_flags); - if (inode) -- hlist_add_head(&dentry->d_alias, &inode->i_dentry); -+ hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); - dentry->d_inode = inode; - dentry_rcuwalk_barrier(dentry); - spin_unlock(&dentry->d_lock); -@@ -1616,7 +1616,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) - - void d_instantiate(struct dentry *entry, struct inode * inode) - { -- BUG_ON(!hlist_unhashed(&entry->d_alias)); -+ BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); - if (inode) - spin_lock(&inode->i_lock); - __d_instantiate(entry, inode); -@@ -1655,7 +1655,7 @@ static struct dentry *__d_instantiate_unique(struct dentry *entry, - return NULL; - } - -- hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { - /* - * Don't need alias->d_lock here, because aliases with - * d_parent == entry->d_parent are not subject to name or -@@ -1681,7 +1681,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode) - { - struct dentry *result; - -- BUG_ON(!hlist_unhashed(&entry->d_alias)); -+ BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); - - if (inode) - spin_lock(&inode->i_lock); -@@ -1712,7 +1712,7 @@ EXPORT_SYMBOL(d_instantiate_unique); - */ - int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode) - { -- BUG_ON(!hlist_unhashed(&entry->d_alias)); -+ BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); - - spin_lock(&inode->i_lock); - if (S_ISDIR(inode->i_mode) && !hlist_empty(&inode->i_dentry)) { -@@ -1751,7 +1751,7 @@ static struct dentry * __d_find_any_alias(struct inode *inode) - - if (hlist_empty(&inode->i_dentry)) - return NULL; -- alias = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); -+ alias = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias); - __dget(alias); - return alias; - } -@@ -1813,7 +1813,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected) - spin_lock(&tmp->d_lock); - tmp->d_inode = inode; - tmp->d_flags |= add_flags; -- hlist_add_head(&tmp->d_alias, &inode->i_dentry); -+ hlist_add_head(&tmp->d_u.d_alias, &inode->i_dentry); - hlist_bl_lock(&tmp->d_sb->s_anon); - hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon); - hlist_bl_unlock(&tmp->d_sb->s_anon); -@@ -2248,7 +2248,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent) - struct dentry *child; - - spin_lock(&dparent->d_lock); -- list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) { -+ list_for_each_entry(child, &dparent->d_subdirs, d_child) { - if (dentry == child) { - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); - __dget_dlock(dentry); -@@ -2525,13 +2525,13 @@ static void __d_move(struct dentry *dentry, struct dentry *target, - /* splicing a tree */ - dentry->d_parent = target->d_parent; - target->d_parent = target; -- list_del_init(&target->d_u.d_child); -- list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); -+ list_del_init(&target->d_child); -+ list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); - } else { - /* swapping two dentries */ - swap(dentry->d_parent, target->d_parent); -- list_move(&target->d_u.d_child, &target->d_parent->d_subdirs); -- list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); -+ list_move(&target->d_child, &target->d_parent->d_subdirs); -+ list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); - if (exchange) - fsnotify_d_move(target); - fsnotify_d_move(dentry); -@@ -3322,7 +3322,7 @@ void d_tmpfile(struct dentry *dentry, struct inode *inode) - { - inode_dec_link_count(inode); - BUG_ON(dentry->d_name.name != dentry->d_iname || -- !hlist_unhashed(&dentry->d_alias) || -+ !hlist_unhashed(&dentry->d_u.d_alias) || - !d_unlinked(dentry)); - spin_lock(&dentry->d_parent->d_lock); - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); -diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c -index 1e3b99d3db0d..05f2960ed7c3 100644 ---- a/fs/debugfs/inode.c -+++ b/fs/debugfs/inode.c -@@ -553,7 +553,7 @@ void debugfs_remove_recursive(struct dentry *dentry) - * use the d_u.d_child as the rcu head and corrupt this list. - */ - spin_lock(&parent->d_lock); -- list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) { -+ list_for_each_entry(child, &parent->d_subdirs, d_child) { - if (!debugfs_positive(child)) - continue; - -diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c -index b01fbfb51f43..a3aa6baad1a1 100644 ---- a/fs/exportfs/expfs.c -+++ b/fs/exportfs/expfs.c -@@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result, - - inode = result->d_inode; - spin_lock(&inode->i_lock); -- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { - dget(dentry); - spin_unlock(&inode->i_lock); - if (toput) -diff --git a/fs/libfs.c b/fs/libfs.c -index 88e3e00e2eca..e801b983b46b 100644 ---- a/fs/libfs.c -+++ b/fs/libfs.c -@@ -114,18 +114,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) - - spin_lock(&dentry->d_lock); - /* d_lock not required for cursor */ -- list_del(&cursor->d_u.d_child); -+ list_del(&cursor->d_child); - p = dentry->d_subdirs.next; - while (n && p != &dentry->d_subdirs) { - struct dentry *next; -- next = list_entry(p, struct dentry, d_u.d_child); -+ next = list_entry(p, struct dentry, d_child); - spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); - if (simple_positive(next)) - n--; - spin_unlock(&next->d_lock); - p = p->next; - } -- list_add_tail(&cursor->d_u.d_child, p); -+ list_add_tail(&cursor->d_child, p); - spin_unlock(&dentry->d_lock); - } - } -@@ -150,7 +150,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx) - { - struct dentry *dentry = file->f_path.dentry; - struct dentry *cursor = file->private_data; -- struct list_head *p, *q = &cursor->d_u.d_child; -+ struct list_head *p, *q = &cursor->d_child; - - if (!dir_emit_dots(file, ctx)) - return 0; -@@ -159,7 +159,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx) - list_move(q, &dentry->d_subdirs); - - for (p = q->next; p != &dentry->d_subdirs; p = p->next) { -- struct dentry *next = list_entry(p, struct dentry, d_u.d_child); -+ struct dentry *next = list_entry(p, struct dentry, d_child); - spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); - if (!simple_positive(next)) { - spin_unlock(&next->d_lock); -@@ -287,7 +287,7 @@ int simple_empty(struct dentry *dentry) - int ret = 0; - - spin_lock(&dentry->d_lock); -- list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) { -+ list_for_each_entry(child, &dentry->d_subdirs, d_child) { - spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED); - if (simple_positive(child)) { - spin_unlock(&child->d_lock); -diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c -index 08b8ea8c353e..3a8ed0fb07be 100644 ---- a/fs/ncpfs/dir.c -+++ b/fs/ncpfs/dir.c -@@ -406,7 +406,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos) - spin_lock(&parent->d_lock); - next = parent->d_subdirs.next; - while (next != &parent->d_subdirs) { -- dent = list_entry(next, struct dentry, d_u.d_child); -+ dent = list_entry(next, struct dentry, d_child); - if ((unsigned long)dent->d_fsdata == fpos) { - if (dent->d_inode) - dget(dent); -diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h -index 32c06587351a..6d5e7c56c79d 100644 ---- a/fs/ncpfs/ncplib_kernel.h -+++ b/fs/ncpfs/ncplib_kernel.h -@@ -194,7 +194,7 @@ ncp_renew_dentries(struct dentry *parent) - spin_lock(&parent->d_lock); - next = parent->d_subdirs.next; - while (next != &parent->d_subdirs) { -- dentry = list_entry(next, struct dentry, d_u.d_child); -+ dentry = list_entry(next, struct dentry, d_child); - - if (dentry->d_fsdata == NULL) - ncp_age_dentry(server, dentry); -@@ -216,7 +216,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent) - spin_lock(&parent->d_lock); - next = parent->d_subdirs.next; - while (next != &parent->d_subdirs) { -- dentry = list_entry(next, struct dentry, d_u.d_child); -+ dentry = list_entry(next, struct dentry, d_child); - dentry->d_fsdata = NULL; - ncp_age_dentry(server, dentry); - next = next->next; -diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c -index 880618a8b048..ebc6a0add5ae 100644 ---- a/fs/nfs/getroot.c -+++ b/fs/nfs/getroot.c -@@ -58,7 +58,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i - */ - spin_lock(&sb->s_root->d_inode->i_lock); - spin_lock(&sb->s_root->d_lock); -- hlist_del_init(&sb->s_root->d_alias); -+ hlist_del_init(&sb->s_root->d_u.d_alias); - spin_unlock(&sb->s_root->d_lock); - spin_unlock(&sb->s_root->d_inode->i_lock); - } -diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c -index 9d3e9c50066a..700129940c6e 100644 ---- a/fs/notify/fsnotify.c -+++ b/fs/notify/fsnotify.c -@@ -63,14 +63,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) - spin_lock(&inode->i_lock); - /* run all of the dentries associated with this inode. Since this is a - * directory, there damn well better only be one item on this list */ -- hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { - struct dentry *child; - - /* run all of the children of the original inode and fix their - * d_flags to indicate parental interest (their parent is the - * original inode) */ - spin_lock(&alias->d_lock); -- list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) { -+ list_for_each_entry(child, &alias->d_subdirs, d_child) { - if (!child->d_inode) - continue; - -diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c -index e2e05a106beb..92edcfc23c1c 100644 ---- a/fs/ocfs2/dcache.c -+++ b/fs/ocfs2/dcache.c -@@ -172,7 +172,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode, - struct dentry *dentry; - - spin_lock(&inode->i_lock); -- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { -+ hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { - spin_lock(&dentry->d_lock); - if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { - trace_ocfs2_find_local_alias(dentry->d_name.len, -diff --git a/include/linux/dcache.h b/include/linux/dcache.h -index 75a227cc7ce2..82b5d1c2b856 100644 ---- a/include/linux/dcache.h -+++ b/include/linux/dcache.h -@@ -125,15 +125,15 @@ struct dentry { - void *d_fsdata; /* fs-specific data */ - - struct list_head d_lru; /* LRU list */ -+ struct list_head d_child; /* child of parent list */ -+ struct list_head d_subdirs; /* our children */ - /* -- * d_child and d_rcu can share memory -+ * d_alias and d_rcu can share memory - */ - union { -- struct list_head d_child; /* child of parent list */ -+ struct hlist_node d_alias; /* inode alias list */ - struct rcu_head d_rcu; - } d_u; -- struct list_head d_subdirs; /* our children */ -- struct hlist_node d_alias; /* inode alias list */ - }; - - /* -diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 15209335888d..09acba6e908a 100644 ---- a/kernel/trace/trace.c -+++ b/kernel/trace/trace.c -@@ -6411,7 +6411,7 @@ static int instance_mkdir (struct inode *inode, struct dentry *dentry, umode_t m - int ret; - - /* Paranoid: Make sure the parent is the "instances" directory */ -- parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); -+ parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias); - if (WARN_ON_ONCE(parent != trace_instance_dir)) - return -ENOENT; - -@@ -6438,7 +6438,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry) - int ret; - - /* Paranoid: Make sure the parent is the "instances" directory */ -- parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); -+ parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias); - if (WARN_ON_ONCE(parent != trace_instance_dir)) - return -ENOENT; - -diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index ef06ce7e9cf8..85f9d33b4ad8 100644 ---- a/kernel/trace/trace_events.c -+++ b/kernel/trace/trace_events.c -@@ -461,7 +461,7 @@ static void remove_event_file_dir(struct ftrace_event_file *file) - - if (dir) { - spin_lock(&dir->d_lock); /* probably unneeded */ -- list_for_each_entry(child, &dir->d_subdirs, d_u.d_child) { -+ list_for_each_entry(child, &dir->d_subdirs, d_child) { - if (child->d_inode) /* probably unneeded */ - child->d_inode->i_private = NULL; - } -diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c -index c71737f6d1cc..33db1ad4fd10 100644 ---- a/security/selinux/selinuxfs.c -+++ b/security/selinux/selinuxfs.c -@@ -1200,7 +1200,7 @@ static void sel_remove_entries(struct dentry *de) - spin_lock(&de->d_lock); - node = de->d_subdirs.next; - while (node != &de->d_subdirs) { -- struct dentry *d = list_entry(node, struct dentry, d_u.d_child); -+ struct dentry *d = list_entry(node, struct dentry, d_child); - - spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); - list_del_init(node); -@@ -1674,12 +1674,12 @@ static void sel_remove_classes(void) - - list_for_each(class_node, &class_dir->d_subdirs) { - struct dentry *class_subdir = list_entry(class_node, -- struct dentry, d_u.d_child); -+ struct dentry, d_child); - struct list_head *class_subdir_node; - - list_for_each(class_subdir_node, &class_subdir->d_subdirs) { - struct dentry *d = list_entry(class_subdir_node, -- struct dentry, d_u.d_child); -+ struct dentry, d_child); - - if (d->d_inode) - if (d->d_inode->i_mode & S_IFDIR) --- -2.1.0 - diff --git a/perf-install-trace-event-plugins.patch b/perf-install-trace-event-plugins.patch deleted file mode 100644 index d33fd155..00000000 --- a/perf-install-trace-event-plugins.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Kyle McMartin <kmcmarti@redhat.com> -Date: Mon, 2 Jun 2014 15:11:01 -0400 -Subject: [PATCH] perf: install trace-event plugins - -perf hardcodes $libdir to be lib for all but x86_64, so kludge around it -until upstream gets their act together. ---- - tools/perf/config/Makefile | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile -index 86c21a24da46..bf0fe97bd358 100644 ---- a/tools/perf/config/Makefile -+++ b/tools/perf/config/Makefile -@@ -642,8 +642,12 @@ endif - ifeq ($(IS_X86_64),1) - lib = lib64 - else -+ifdef MULTILIBDIR -+lib = $(MULTILIBDIR) -+else - lib = lib - endif -+endif - libdir = $(prefix)/$(lib) - - # Shell quote (do not use $(call) to accommodate ancient setups); --- -2.1.0 - diff --git a/ppc64-fixtools.patch b/ppc64-fixtools.patch deleted file mode 100644 index 89e0b633..00000000 --- a/ppc64-fixtools.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Peter Robinson <pbrobinson@gmail.com> -Date: Mon, 6 Oct 2014 15:15:15 +0100 -Subject: [PATCH] ppc64-fixtools - -Build tools on ppc64le (rhbz 1138884), Some minor ppc64 cleanups ---- - tools/perf/arch/powerpc/util/skip-callchain-idx.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c -index a7c23a4b3778..d73ef8bb08c7 100644 ---- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c -+++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c -@@ -15,6 +15,7 @@ - - #include "util/thread.h" - #include "util/callchain.h" -+#include "util/debug.h" - - /* - * When saving the callchain on Power, the kernel conservatively saves --- -2.1.0 - diff --git a/psmouse-Add-psmouse_matches_pnp_id-helper-function.patch b/psmouse-Add-psmouse_matches_pnp_id-helper-function.patch deleted file mode 100644 index 68dbffbd..00000000 --- a/psmouse-Add-psmouse_matches_pnp_id-helper-function.patch +++ /dev/null @@ -1,99 +0,0 @@ -From: Hans de Goede <hdegoede@redhat.com> -Date: Fri, 27 Jun 2014 18:46:42 +0200 -Subject: [PATCH] psmouse: Add psmouse_matches_pnp_id helper function - -The matches_pnp_id function from the synaptics driver is useful for other -drivers too. Make it a generic psmouse helper function. - -Bugzilla: 1110011 -Upstream-status: sent for 3.17/3.18 - -Signed-off-by: Hans de Goede <hdegoede@redhat.com> ---- - drivers/input/mouse/psmouse-base.c | 14 ++++++++++++++ - drivers/input/mouse/psmouse.h | 1 + - drivers/input/mouse/synaptics.c | 17 +++-------------- - 3 files changed, 18 insertions(+), 14 deletions(-) - -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index b4e1f014ddc2..02e68c3008a3 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -462,6 +462,20 @@ static int psmouse_poll(struct psmouse *psmouse) - PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)); - } - -+/* -+ * psmouse_matches_pnp_id - check if psmouse matches one of the passed in ids. -+ */ -+bool psmouse_matches_pnp_id(struct psmouse *psmouse, const char * const ids[]) -+{ -+ int i; -+ -+ if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) -+ for (i = 0; ids[i]; i++) -+ if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i])) -+ return true; -+ -+ return false; -+} - - /* - * Genius NetMouse magic init. -diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h -index 2f0b39d59a9b..f4cf664c7db3 100644 ---- a/drivers/input/mouse/psmouse.h -+++ b/drivers/input/mouse/psmouse.h -@@ -108,6 +108,7 @@ void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution); - psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse); - int psmouse_activate(struct psmouse *psmouse); - int psmouse_deactivate(struct psmouse *psmouse); -+bool psmouse_matches_pnp_id(struct psmouse *psmouse, const char * const ids[]); - - struct psmouse_attribute { - struct device_attribute dattr; -diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c -index 3ebfb0386300..f9472920d986 100644 ---- a/drivers/input/mouse/synaptics.c -+++ b/drivers/input/mouse/synaptics.c -@@ -190,18 +190,6 @@ static const char * const topbuttonpad_pnp_ids[] = { - NULL - }; - --static bool matches_pnp_id(struct psmouse *psmouse, const char * const ids[]) --{ -- int i; -- -- if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) -- for (i = 0; ids[i]; i++) -- if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i])) -- return true; -- -- return false; --} -- - /***************************************************************************** - * Synaptics communications functions - ****************************************************************************/ -@@ -367,7 +355,8 @@ static int synaptics_resolution(struct psmouse *psmouse) - } - - for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) { -- if (matches_pnp_id(psmouse, min_max_pnpid_table[i].pnp_ids)) { -+ if (psmouse_matches_pnp_id(psmouse, -+ min_max_pnpid_table[i].pnp_ids)) { - priv->x_min = min_max_pnpid_table[i].x_min; - priv->x_max = min_max_pnpid_table[i].x_max; - priv->y_min = min_max_pnpid_table[i].y_min; -@@ -1499,7 +1488,7 @@ static void set_input_params(struct psmouse *psmouse, - - if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { - __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); -- if (matches_pnp_id(psmouse, topbuttonpad_pnp_ids)) -+ if (psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids)) - __set_bit(INPUT_PROP_TOPBUTTONPAD, dev->propbit); - /* Clickpads report only left button */ - __clear_bit(BTN_RIGHT, dev->keybit); --- -2.1.0 - diff --git a/psmouse-Add-support-for-detecting-FocalTech-PS-2-tou.patch b/psmouse-Add-support-for-detecting-FocalTech-PS-2-tou.patch deleted file mode 100644 index 3cd8911e..00000000 --- a/psmouse-Add-support-for-detecting-FocalTech-PS-2-tou.patch +++ /dev/null @@ -1,157 +0,0 @@ -From: Hans de Goede <hdegoede@redhat.com> -Date: Fri, 27 Jun 2014 18:50:33 +0200 -Subject: [PATCH] psmouse: Add support for detecting FocalTech PS/2 touchpads - -The Asus X450 and X550 laptops use a PS/2 touchpad from a new manufacturer -called FocalTech: - -https://bugzilla.kernel.org/show_bug.cgi?id=77391 -https://bugzilla.redhat.com/show_bug.cgi?id=1110011 - -The protocol for these devices is not known at this time, but even without -knowing the protocol they need some special handling. They get upset by some -of our other PS/2 device probing, and once upset generate random mouse events -making things unusable even with an external mouse. - -This patch adds detection of these devices based on their pnp ids, and when -they are detected, treats them as a bare ps/2 mouse. Doing things this way -they at least work in their ps/2 mouse emulation mode. - -Signed-off-by: Hans de Goede <hdegoede@redhat.com> ---- - drivers/input/mouse/Makefile | 2 +- - drivers/input/mouse/focaltech.c | 44 ++++++++++++++++++++++++++++++++++++++ - drivers/input/mouse/focaltech.h | 21 ++++++++++++++++++ - drivers/input/mouse/psmouse-base.c | 10 +++++++++ - 4 files changed, 76 insertions(+), 1 deletion(-) - create mode 100644 drivers/input/mouse/focaltech.c - create mode 100644 drivers/input/mouse/focaltech.h - -diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile -index c25efdb3f288..dda507f8b3a2 100644 ---- a/drivers/input/mouse/Makefile -+++ b/drivers/input/mouse/Makefile -@@ -23,7 +23,7 @@ obj-$(CONFIG_MOUSE_SYNAPTICS_I2C) += synaptics_i2c.o - obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o - obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o - --psmouse-objs := psmouse-base.o synaptics.o -+psmouse-objs := psmouse-base.o synaptics.o focaltech.o - - psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o - psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -new file mode 100644 -index 000000000000..d83a23554d63 ---- /dev/null -+++ b/drivers/input/mouse/focaltech.c -@@ -0,0 +1,44 @@ -+/* -+ * Focaltech TouchPad PS/2 mouse driver -+ * -+ * Copyright (c) 2014 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * Red Hat authors: -+ * -+ * Hans de Goede <hdegoede@redhat.com> -+ */ -+ -+/* -+ * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with -+ * detection only, to avoid further detection attempts confusing the touchpad -+ * this way it at least works in PS/2 mouse compatibility mode. -+ */ -+ -+#include <linux/device.h> -+#include <linux/libps2.h> -+#include "psmouse.h" -+ -+static const char * const focaltech_pnp_ids[] = { -+ "FLT0101", -+ "FLT0102", -+ "FLT0103", -+ NULL -+}; -+ -+int focaltech_detect(struct psmouse *psmouse, bool set_properties) -+{ -+ if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids)) -+ return -ENODEV; -+ -+ if (set_properties) { -+ psmouse->vendor = "FocalTech"; -+ psmouse->name = "FocalTech Touchpad in mouse emulation mode"; -+ } -+ -+ return 0; -+} -diff --git a/drivers/input/mouse/focaltech.h b/drivers/input/mouse/focaltech.h -new file mode 100644 -index 000000000000..0d0fc49451fe ---- /dev/null -+++ b/drivers/input/mouse/focaltech.h -@@ -0,0 +1,21 @@ -+/* -+ * Focaltech TouchPad PS/2 mouse driver -+ * -+ * Copyright (c) 2014 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * Red Hat authors: -+ * -+ * Hans de Goede <hdegoede@redhat.com> -+ */ -+ -+#ifndef _FOCALTECH_H -+#define _FOCALTECH_H -+ -+int focaltech_detect(struct psmouse *psmouse, bool set_properties); -+ -+#endif -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index 02e68c3008a3..2c8c8e2172a2 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -35,6 +35,7 @@ - #include "elantech.h" - #include "sentelic.h" - #include "cypress_ps2.h" -+#include "focaltech.h" - - #define DRIVER_DESC "PS/2 mouse driver" - -@@ -722,6 +723,13 @@ static int psmouse_extensions(struct psmouse *psmouse, - { - bool synaptics_hardware = false; - -+/* Always check for focaltech, this is safe as it uses pnp-id matching */ -+ if (psmouse_do_detect(focaltech_detect, psmouse, set_properties) == 0) { -+ /* Not supported yet, use bare protocol */ -+ psmouse_max_proto = max_proto = PSMOUSE_PS2; -+ goto reset_to_defaults; -+ } -+ - /* - * We always check for lifebook because it does not disturb mouse - * (it only checks DMI information). -@@ -873,6 +881,8 @@ static int psmouse_extensions(struct psmouse *psmouse, - } - } - -+reset_to_defaults: -+ - /* - * Reset to defaults in case the device got confused by extended - * protocol probes. Note that we follow up with full reset because --- -2.1.0 - @@ -1,3 +1,3 @@ -fb30d0f29214d75cddd2faa94f73d5cf linux-3.17.tar.xz -159e969cbc27201d8e2fa0f609dc722f perf-man-3.17.tar.gz -4ea1c0e18b18406bcd248bf06b95aec3 patch-3.17.8.xz +9e854df51ca3fef8bfe566dbd7b89241 linux-3.18.tar.xz +813ccb96f0b379d656e57442c2587ca3 perf-man-3.18.tar.gz +82864000fde42252dd5e80cceb971479 patch-3.18.1.xz diff --git a/uapi-linux-target_core_user.h-fix-headers_install.sh.patch b/uapi-linux-target_core_user.h-fix-headers_install.sh.patch new file mode 100644 index 00000000..516d10f8 --- /dev/null +++ b/uapi-linux-target_core_user.h-fix-headers_install.sh.patch @@ -0,0 +1,36 @@ +From: Kyle McMartin <kyle@redhat.com> +Date: Thu, 18 Dec 2014 12:57:14 -0500 +Subject: [PATCH] uapi/linux/target_core_user.h: fix headers_install.sh badness + +scripts/headers_install.sh will transform __packed to +__attribute__((packed)), so the #ifndef is not necessary. +(and, in fact, it's problematic, because we'll end up with the header + containing: +#ifndef __attribute__((packed)) +#define __attribu... +and so forth.) + +Cc: stable@vger.kernel.org # 3.18 +Signed-off-by: Kyle McMartin <kyle@redhat.com> +--- + include/uapi/linux/target_core_user.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/include/uapi/linux/target_core_user.h b/include/uapi/linux/target_core_user.h +index 7dcfbe6771b1..b483d1909d3e 100644 +--- a/include/uapi/linux/target_core_user.h ++++ b/include/uapi/linux/target_core_user.h +@@ -6,10 +6,6 @@ + #include <linux/types.h> + #include <linux/uio.h> + +-#ifndef __packed +-#define __packed __attribute__((packed)) +-#endif +- + #define TCMU_VERSION "1.0" + + /* +-- +2.1.0 + |