Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Olof Johansson:
"We've been accruing these for a couple of weeks, so the batch is a bit
bigger than usual.

Largest delta is due to a led-bl driver that is added -- there was a
miscommunication before the merge window and the driver didn't make it
in. Due to this, the platforms needing it regressed. At this point, it
seemed easier to add the new driver than unwind the changes.

Besides that, there are a handful of various fixes:

- AMD tee memory leak fix

- A handful of fixlets for i.MX SCU communication

- A few maintainers woke up and realized DEBUG_FS had been missing
for a while, so a few updates of that.

... and the usual collection of smaller fixes to various platforms"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (37 commits)
ARM: socfpga_defconfig: Add back DEBUG_FS
arm64: dts: socfpga: agilex: Fix gmac compatible
ARM: bcm2835_defconfig: Explicitly restore CONFIG_DEBUG_FS
arm64: dts: meson: fix gxm-khadas-vim2 wifi
arm64: dts: meson-sm1-sei610: add missing interrupt-names
ARM: meson: Drop unneeded select of COMMON_CLK
ARM: dts: bcm2711: Add pcie0 alias
ARM: dts: bcm283x: Add missing properties to the PWR LED
tee: amdtee: fix memory leak in amdtee_open_session()
ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
arm: dts: dra76x: Fix mmc3 max-frequency
ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes
bus: ti-sysc: Fix 1-wire reset quirk
ARM: dts: r8a7779: Remove deprecated "renesas, rcar-sata" compatible value
soc: imx-scu: Align imx sc msg structs to 4
firmware: imx: Align imx_sc_msg_req_cpu_start to 4
firmware: imx: scu-pd: Align imx sc msg structs to 4
firmware: imx: misc: Align imx sc msg structs to 4
firmware: imx: scu: Ensure sequential TX
ARM: dts: imx7-colibri: Fix frequency for sd/mmc
...

+5 -1
Documentation/devicetree/bindings/reset/intel,rcu-gw.yaml
··· 23 23 description: Global reset register offset and bit offset. 24 24 allOf: 25 25 - $ref: /schemas/types.yaml#/definitions/uint32-array 26 - - maxItems: 2 26 + items: 27 + - description: Register offset 28 + - description: Register bit offset 29 + minimum: 0 30 + maximum: 31 27 31 28 32 "#reset-cells": 29 33 minimum: 2
+1 -1
MAINTAINERS
··· 14226 14226 F: include/linux/reset.h 14227 14227 F: include/linux/reset/ 14228 14228 F: include/linux/reset-controller.h 14229 - K: \b(?:devm_|of_)?reset_control(?:ler_[a-z]+|_[a-z_]+)?\b 14229 + K: \b(?:devm_|of_)?reset_control(?:ler_[a-z]+|_[a-z_]+)?\b 14230 14230 14231 14231 RESTARTABLE SEQUENCES SUPPORT 14232 14232 M: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+2 -2
arch/arm/boot/dts/am437x-idk-evm.dts
··· 526 526 * Supply voltage supervisor on board will not allow opp50 so 527 527 * disable it and set opp100 as suspend OPP. 528 528 */ 529 - opp50@300000000 { 529 + opp50-300000000 { 530 530 status = "disabled"; 531 531 }; 532 532 533 - opp100@600000000 { 533 + opp100-600000000 { 534 534 opp-suspend; 535 535 }; 536 536 };
+3
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
··· 21 21 22 22 aliases { 23 23 ethernet0 = &genet; 24 + pcie0 = &pcie0; 24 25 }; 25 26 26 27 leds { ··· 32 31 pwr { 33 32 label = "PWR"; 34 33 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; 34 + default-state = "keep"; 35 + linux,default-trigger = "default-on"; 35 36 }; 36 37 }; 37 38
+2
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
··· 26 26 pwr { 27 27 label = "PWR"; 28 28 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; 29 + default-state = "keep"; 30 + linux,default-trigger = "default-on"; 29 31 }; 30 32 }; 31 33 };
+2
arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
··· 27 27 pwr { 28 28 label = "PWR"; 29 29 gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; 30 + default-state = "keep"; 31 + linux,default-trigger = "default-on"; 30 32 }; 31 33 }; 32 34
+2 -2
arch/arm/boot/dts/dra7-evm.dts
··· 61 61 regulator-max-microvolt = <1800000>; 62 62 }; 63 63 64 - evm_3v3: fixedregulator-evm3v3 { 64 + vsys_3v3: fixedregulator-vsys3v3 { 65 65 /* Output of Cntlr A of TPS43351-Q1 on dra7-evm */ 66 66 compatible = "regulator-fixed"; 67 - regulator-name = "evm_3v3"; 67 + regulator-name = "vsys_3v3"; 68 68 regulator-min-microvolt = <3300000>; 69 69 regulator-max-microvolt = <3300000>; 70 70 vin-supply = <&evm_12v0>;
+4
arch/arm/boot/dts/dra7-l4.dtsi
··· 3474 3474 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER13_CLKCTRL 24>; 3475 3475 clock-names = "fck"; 3476 3476 interrupts = <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>; 3477 + ti,timer-pwm; 3477 3478 }; 3478 3479 }; 3479 3480 ··· 3502 3501 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER14_CLKCTRL 24>; 3503 3502 clock-names = "fck"; 3504 3503 interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>; 3504 + ti,timer-pwm; 3505 3505 }; 3506 3506 }; 3507 3507 ··· 3530 3528 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER15_CLKCTRL 24>; 3531 3529 clock-names = "fck"; 3532 3530 interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>; 3531 + ti,timer-pwm; 3533 3532 }; 3534 3533 }; 3535 3534 ··· 3558 3555 clocks = <&l4per3_clkctrl DRA7_L4PER3_TIMER16_CLKCTRL 24>; 3559 3556 clock-names = "fck"; 3560 3557 interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>; 3558 + ti,timer-pwm; 3561 3559 }; 3562 3560 }; 3563 3561
+2
arch/arm/boot/dts/dra7.dtsi
··· 184 184 device_type = "pci"; 185 185 ranges = <0x81000000 0 0 0x03000 0 0x00010000 186 186 0x82000000 0 0x20013000 0x13000 0 0xffed000>; 187 + dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; 187 188 bus-range = <0x00 0xff>; 188 189 #interrupt-cells = <1>; 189 190 num-lanes = <1>; ··· 239 238 device_type = "pci"; 240 239 ranges = <0x81000000 0 0 0x03000 0 0x00010000 241 240 0x82000000 0 0x30013000 0x13000 0 0xffed000>; 241 + dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; 242 242 bus-range = <0x00 0xff>; 243 243 #interrupt-cells = <1>; 244 244 num-lanes = <1>;
+5
arch/arm/boot/dts/dra76x.dtsi
··· 128 128 &usb4_tm { 129 129 status = "disabled"; 130 130 }; 131 + 132 + &mmc3 { 133 + /* dra76x is not affected by i887 */ 134 + max-frequency = <96000000>; 135 + };
+2 -10
arch/arm/boot/dts/dra7xx-clocks.dtsi
··· 796 796 clock-div = <1>; 797 797 }; 798 798 799 - ipu1_gfclk_mux: ipu1_gfclk_mux@520 { 800 - #clock-cells = <0>; 801 - compatible = "ti,mux-clock"; 802 - clocks = <&dpll_abe_m2x2_ck>, <&dpll_core_h22x2_ck>; 803 - ti,bit-shift = <24>; 804 - reg = <0x0520>; 805 - assigned-clocks = <&ipu1_gfclk_mux>; 806 - assigned-clock-parents = <&dpll_core_h22x2_ck>; 807 - }; 808 - 809 799 dummy_ck: dummy_ck { 810 800 #clock-cells = <0>; 811 801 compatible = "fixed-clock"; ··· 1554 1564 compatible = "ti,clkctrl"; 1555 1565 reg = <0x20 0x4>; 1556 1566 #clock-cells = <2>; 1567 + assigned-clocks = <&ipu1_clkctrl DRA7_IPU1_MMU_IPU1_CLKCTRL 24>; 1568 + assigned-clock-parents = <&dpll_core_h22x2_ck>; 1557 1569 }; 1558 1570 1559 1571 ipu_clkctrl: ipu-clkctrl@50 {
+2 -2
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
··· 275 275 276 276 /* SRAM on Colibri nEXT_CS0 */ 277 277 sram@0,0 { 278 - compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram"; 278 + compatible = "cypress,cy7c1019dv33-10zsxi", "mtd-ram"; 279 279 reg = <0 0 0x00010000>; 280 280 #address-cells = <1>; 281 281 #size-cells = <1>; ··· 286 286 287 287 /* SRAM on Colibri nEXT_CS1 */ 288 288 sram@1,0 { 289 - compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram"; 289 + compatible = "cypress,cy7c1019dv33-10zsxi", "mtd-ram"; 290 290 reg = <1 0 0x00010000>; 291 291 #address-cells = <1>; 292 292 #size-cells = <1>;
-1
arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi
··· 192 192 pinctrl-0 = <&pinctrl_usdhc4>; 193 193 bus-width = <8>; 194 194 non-removable; 195 - vmmc-supply = <&vdd_emmc_1p8>; 196 195 status = "disabled"; 197 196 }; 198 197
-1
arch/arm/boot/dts/imx7-colibri.dtsi
··· 336 336 assigned-clock-rates = <400000000>; 337 337 bus-width = <8>; 338 338 fsl,tuning-step = <2>; 339 - max-frequency = <100000000>; 340 339 vmmc-supply = <&reg_module_3v3>; 341 340 vqmmc-supply = <&reg_DCDC3>; 342 341 non-removable;
+3 -3
arch/arm/boot/dts/imx7d.dtsi
··· 44 44 opp-hz = /bits/ 64 <792000000>; 45 45 opp-microvolt = <1000000>; 46 46 clock-latency-ns = <150000>; 47 - opp-supported-hw = <0xd>, <0xf>; 47 + opp-supported-hw = <0xd>, <0x7>; 48 48 opp-suspend; 49 49 }; 50 50 ··· 52 52 opp-hz = /bits/ 64 <996000000>; 53 53 opp-microvolt = <1100000>; 54 54 clock-latency-ns = <150000>; 55 - opp-supported-hw = <0xc>, <0xf>; 55 + opp-supported-hw = <0xc>, <0x7>; 56 56 opp-suspend; 57 57 }; 58 58 ··· 60 60 opp-hz = /bits/ 64 <1200000000>; 61 61 opp-microvolt = <1225000>; 62 62 clock-latency-ns = <150000>; 63 - opp-supported-hw = <0x8>, <0xf>; 63 + opp-supported-hw = <0x8>, <0x3>; 64 64 opp-suspend; 65 65 }; 66 66 };
+2 -2
arch/arm/boot/dts/ls1021a.dtsi
··· 747 747 }; 748 748 749 749 mdio0: mdio@2d24000 { 750 - compatible = "fsl,etsec2-mdio"; 750 + compatible = "gianfar"; 751 751 device_type = "mdio"; 752 752 #address-cells = <1>; 753 753 #size-cells = <0>; ··· 756 756 }; 757 757 758 758 mdio1: mdio@2d64000 { 759 - compatible = "fsl,etsec2-mdio"; 759 + compatible = "gianfar"; 760 760 device_type = "mdio"; 761 761 #address-cells = <1>; 762 762 #size-cells = <0>;
+11 -2
arch/arm/boot/dts/motorola-mapphone-common.dtsi
··· 182 182 pwm-names = "enable", "direction"; 183 183 direction-duty-cycle-ns = <10000000>; 184 184 }; 185 + 186 + backlight: backlight { 187 + compatible = "led-backlight"; 188 + 189 + leds = <&backlight_led>; 190 + brightness-levels = <31 63 95 127 159 191 223 255>; 191 + default-brightness-level = <6>; 192 + }; 185 193 }; 186 194 187 195 &dss { ··· 212 204 label = "lcd0"; 213 205 vddi-supply = <&lcd_regulator>; 214 206 reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */ 207 + 208 + backlight = <&backlight>; 215 209 216 210 width-mm = <50>; 217 211 height-mm = <89>; ··· 403 393 ramp-up-us = <1024>; 404 394 ramp-down-us = <8193>; 405 395 406 - led@0 { 396 + backlight_led: led@0 { 407 397 reg = <0>; 408 398 led-sources = <2>; 409 399 ti,led-mode = <0>; 410 400 label = ":backlight"; 411 - linux,default-trigger = "backlight"; 412 401 }; 413 402 414 403 led@1 {
+1 -1
arch/arm/boot/dts/r8a7779.dtsi
··· 377 377 }; 378 378 379 379 sata: sata@fc600000 { 380 - compatible = "renesas,sata-r8a7779", "renesas,rcar-sata"; 380 + compatible = "renesas,sata-r8a7779"; 381 381 reg = <0xfc600000 0x200000>; 382 382 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; 383 383 clocks = <&mstp1_clks R8A7779_CLK_SATA>;
+1
arch/arm/configs/bcm2835_defconfig
··· 178 178 CONFIG_STACK_TRACER=y 179 179 CONFIG_FUNCTION_PROFILER=y 180 180 CONFIG_TEST_KSTRTOX=y 181 + CONFIG_DEBUG_FS=y 181 182 CONFIG_KGDB=y 182 183 CONFIG_KGDB_KDB=y 183 184 CONFIG_STRICT_DEVMEM=y
+1
arch/arm/configs/omap2plus_defconfig
··· 375 375 CONFIG_BACKLIGHT_PWM=m 376 376 CONFIG_BACKLIGHT_PANDORA=m 377 377 CONFIG_BACKLIGHT_GPIO=m 378 + CONFIG_BACKLIGHT_LED=m 378 379 CONFIG_FRAMEBUFFER_CONSOLE=y 379 380 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y 380 381 CONFIG_LOGO=y
+1
arch/arm/configs/socfpga_defconfig
··· 157 157 CONFIG_PRINTK_TIME=y 158 158 CONFIG_DEBUG_INFO=y 159 159 CONFIG_MAGIC_SYSRQ=y 160 + CONFIG_DEBUG_FS=y 160 161 CONFIG_DETECT_HUNG_TASK=y 161 162 # CONFIG_SCHED_DEBUG is not set 162 163 CONFIG_FUNCTION_TRACER=y
+2
arch/arm/mach-imx/Makefile
··· 91 91 obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o 92 92 obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o 93 93 endif 94 + AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a 95 + obj-$(CONFIG_SOC_IMX6) += resume-imx6.o 94 96 obj-$(CONFIG_SOC_IMX6) += pm-imx6.o 95 97 96 98 obj-$(CONFIG_SOC_IMX1) += mach-imx1.o
+2 -2
arch/arm/mach-imx/common.h
··· 109 109 int imx_cpu_kill(unsigned int cpu); 110 110 111 111 #ifdef CONFIG_SUSPEND 112 - void v7_cpu_resume(void); 113 112 void imx53_suspend(void __iomem *ocram_vbase); 114 113 extern const u32 imx53_suspend_sz; 115 114 void imx6_suspend(void __iomem *ocram_vbase); 116 115 #else 117 - static inline void v7_cpu_resume(void) {} 118 116 static inline void imx53_suspend(void __iomem *ocram_vbase) {} 119 117 static const u32 imx53_suspend_sz; 120 118 static inline void imx6_suspend(void __iomem *ocram_vbase) {} 121 119 #endif 120 + 121 + void v7_cpu_resume(void); 122 122 123 123 void imx6_pm_ccm_init(const char *ccm_compat); 124 124 void imx6q_pm_init(void);
+24
arch/arm/mach-imx/resume-imx6.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* 3 + * Copyright 2014 Freescale Semiconductor, Inc. 4 + */ 5 + 6 + #include <linux/linkage.h> 7 + #include <asm/assembler.h> 8 + #include <asm/asm-offsets.h> 9 + #include <asm/hardware/cache-l2x0.h> 10 + #include "hardware.h" 11 + 12 + /* 13 + * The following code must assume it is running from physical address 14 + * where absolute virtual addresses to the data section have to be 15 + * turned into relative ones. 16 + */ 17 + 18 + ENTRY(v7_cpu_resume) 19 + bl v7_invalidate_l1 20 + #ifdef CONFIG_CACHE_L2X0 21 + bl l2c310_early_resume 22 + #endif 23 + b cpu_resume 24 + ENDPROC(v7_cpu_resume)
-14
arch/arm/mach-imx/suspend-imx6.S
··· 327 327 328 328 ret lr 329 329 ENDPROC(imx6_suspend) 330 - 331 - /* 332 - * The following code must assume it is running from physical address 333 - * where absolute virtual addresses to the data section have to be 334 - * turned into relative ones. 335 - */ 336 - 337 - ENTRY(v7_cpu_resume) 338 - bl v7_invalidate_l1 339 - #ifdef CONFIG_CACHE_L2X0 340 - bl l2c310_early_resume 341 - #endif 342 - b cpu_resume 343 - ENDPROC(v7_cpu_resume)
-1
arch/arm/mach-meson/Kconfig
··· 9 9 select CACHE_L2X0 10 10 select PINCTRL 11 11 select PINCTRL_MESON 12 - select COMMON_CLK 13 12 select HAVE_ARM_SCU if SMP 14 13 select HAVE_ARM_TWD if SMP 15 14
+1 -1
arch/arm/mach-omap2/Makefile
··· 16 16 clock-common = clock.o 17 17 secure-common = omap-smc.o omap-secure.o 18 18 19 - obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common) 19 + obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) 20 20 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) 21 21 obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common) 22 22 obj-$(CONFIG_SOC_AM33XX) += $(hwmod-common) $(secure-common)
-2
arch/arm/mach-omap2/io.c
··· 431 431 omap_hwmod_init_postsetup(); 432 432 omap_clk_soc_init = omap2420_dt_clk_init; 433 433 rate_table = omap2420_rate_table; 434 - omap_secure_init(); 435 434 } 436 435 437 436 void __init omap2420_init_late(void) ··· 455 456 omap_hwmod_init_postsetup(); 456 457 omap_clk_soc_init = omap2430_dt_clk_init; 457 458 rate_table = omap2430_rate_table; 458 - omap_secure_init(); 459 459 } 460 460 461 461 void __init omap2430_init_late(void)
+1 -1
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
··· 327 327 #size-cells = <0>; 328 328 329 329 bus-width = <4>; 330 - max-frequency = <50000000>; 330 + max-frequency = <60000000>; 331 331 332 332 non-removable; 333 333 disable-wp;
+1
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
··· 593 593 compatible = "brcm,bcm43438-bt"; 594 594 interrupt-parent = <&gpio_intc>; 595 595 interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; 596 + interrupt-names = "host-wakeup"; 596 597 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 597 598 max-speed = <2000000>; 598 599 clocks = <&wifi32k>;
-5
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
··· 52 52 compatible = "ethernet-phy-ieee802.3-c22"; 53 53 reg = <0>; 54 54 }; 55 - 56 - ethphy1: ethernet-phy@1 { 57 - compatible = "ethernet-phy-ieee802.3-c22"; 58 - reg = <1>; 59 - }; 60 55 }; 61 56 }; 62 57
+3 -3
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
··· 102 102 }; 103 103 104 104 gmac0: ethernet@ff800000 { 105 - compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac"; 105 + compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac"; 106 106 reg = <0xff800000 0x2000>; 107 107 interrupts = <0 90 4>; 108 108 interrupt-names = "macirq"; ··· 118 118 }; 119 119 120 120 gmac1: ethernet@ff802000 { 121 - compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac"; 121 + compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac"; 122 122 reg = <0xff802000 0x2000>; 123 123 interrupts = <0 91 4>; 124 124 interrupt-names = "macirq"; ··· 134 134 }; 135 135 136 136 gmac2: ethernet@ff804000 { 137 - compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac"; 137 + compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac"; 138 138 reg = <0xff804000 0x2000>; 139 139 interrupts = <0 92 4>; 140 140 interrupt-names = "macirq";
+1 -1
arch/arm64/configs/defconfig
··· 773 773 CONFIG_ARCH_R8A774B1=y 774 774 CONFIG_ARCH_R8A774C0=y 775 775 CONFIG_ARCH_R8A7795=y 776 - CONFIG_ARCH_R8A7796=y 776 + CONFIG_ARCH_R8A77960=y 777 777 CONFIG_ARCH_R8A77961=y 778 778 CONFIG_ARCH_R8A77965=y 779 779 CONFIG_ARCH_R8A77970=y
+2 -2
drivers/bus/ti-sysc.c
··· 1400 1400 } 1401 1401 1402 1402 /* 1-wire needs module's internal clocks enabled for reset */ 1403 - static void sysc_clk_enable_quirk_hdq1w(struct sysc *ddata) 1403 + static void sysc_pre_reset_quirk_hdq1w(struct sysc *ddata) 1404 1404 { 1405 1405 int offset = 0x0c; /* HDQ_CTRL_STATUS */ 1406 1406 u16 val; ··· 1488 1488 return; 1489 1489 1490 1490 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) { 1491 - ddata->clk_enable_quirk = sysc_clk_enable_quirk_hdq1w; 1491 + ddata->clk_disable_quirk = sysc_pre_reset_quirk_hdq1w; 1492 1492 1493 1493 return; 1494 1494 }
+27
drivers/firmware/imx/imx-scu.c
··· 29 29 struct mbox_client cl; 30 30 struct mbox_chan *ch; 31 31 int idx; 32 + struct completion tx_done; 32 33 }; 33 34 34 35 struct imx_sc_ipc { ··· 101 100 } 102 101 EXPORT_SYMBOL(imx_scu_get_handle); 103 102 103 + /* Callback called when the word of a message is ack-ed, eg read by SCU */ 104 + static void imx_scu_tx_done(struct mbox_client *cl, void *mssg, int r) 105 + { 106 + struct imx_sc_chan *sc_chan = container_of(cl, struct imx_sc_chan, cl); 107 + 108 + complete(&sc_chan->tx_done); 109 + } 110 + 104 111 static void imx_scu_rx_callback(struct mbox_client *c, void *msg) 105 112 { 106 113 struct imx_sc_chan *sc_chan = container_of(c, struct imx_sc_chan, cl); ··· 158 149 159 150 for (i = 0; i < hdr->size; i++) { 160 151 sc_chan = &sc_ipc->chans[i % 4]; 152 + 153 + /* 154 + * SCU requires that all messages words are written 155 + * sequentially but linux MU driver implements multiple 156 + * independent channels for each register so ordering between 157 + * different channels must be ensured by SCU API interface. 158 + * 159 + * Wait for tx_done before every send to ensure that no 160 + * queueing happens at the mailbox channel level. 161 + */ 162 + wait_for_completion(&sc_chan->tx_done); 163 + reinit_completion(&sc_chan->tx_done); 164 + 161 165 ret = mbox_send_message(sc_chan->ch, &data[i]); 162 166 if (ret < 0) 163 167 return ret; ··· 268 246 cl->tx_block = false; 269 247 cl->knows_txdone = true; 270 248 cl->rx_callback = imx_scu_rx_callback; 249 + 250 + /* Initial tx_done completion as "done" */ 251 + cl->tx_done = imx_scu_tx_done; 252 + init_completion(&sc_chan->tx_done); 253 + complete(&sc_chan->tx_done); 271 254 272 255 sc_chan->sc_ipc = sc_ipc; 273 256 sc_chan->idx = i % 4;
+4 -4
drivers/firmware/imx/misc.c
··· 16 16 u32 ctrl; 17 17 u32 val; 18 18 u16 resource; 19 - } __packed; 19 + } __packed __aligned(4); 20 20 21 21 struct imx_sc_msg_req_cpu_start { 22 22 struct imx_sc_rpc_msg hdr; ··· 24 24 u32 address_lo; 25 25 u16 resource; 26 26 u8 enable; 27 - } __packed; 27 + } __packed __aligned(4); 28 28 29 29 struct imx_sc_msg_req_misc_get_ctrl { 30 30 struct imx_sc_rpc_msg hdr; 31 31 u32 ctrl; 32 32 u16 resource; 33 - } __packed; 33 + } __packed __aligned(4); 34 34 35 35 struct imx_sc_msg_resp_misc_get_ctrl { 36 36 struct imx_sc_rpc_msg hdr; 37 37 u32 val; 38 - } __packed; 38 + } __packed __aligned(4); 39 39 40 40 /* 41 41 * This function sets a miscellaneous control value.
+1 -1
drivers/firmware/imx/scu-pd.c
··· 61 61 struct imx_sc_rpc_msg hdr; 62 62 u16 resource; 63 63 u8 mode; 64 - } __packed; 64 + } __packed __aligned(4); 65 65 66 66 #define IMX_SCU_PD_NAME_SIZE 20 67 67 struct imx_sc_pm_domain {
+2 -1
drivers/reset/Kconfig
··· 51 51 52 52 config RESET_BRCMSTB_RESCAL 53 53 bool "Broadcom STB RESCAL reset controller" 54 + depends on HAS_IOMEM 54 55 default ARCH_BRCMSTB || COMPILE_TEST 55 56 help 56 57 This enables the RESCAL reset controller for SATA, PCIe0, or PCIe1 on ··· 74 73 75 74 config RESET_INTEL_GW 76 75 bool "Intel Reset Controller Driver" 77 - depends on OF 76 + depends on OF && HAS_IOMEM 78 77 select REGMAP_MMIO 79 78 help 80 79 This enables the reset controller driver for Intel Gateway SoCs.
+1 -1
drivers/soc/imx/soc-imx-scu.c
··· 25 25 u32 id; 26 26 } resp; 27 27 } data; 28 - } __packed; 28 + } __packed __aligned(4); 29 29 30 30 struct imx_sc_msg_misc_get_soc_uid { 31 31 struct imx_sc_rpc_msg hdr;
+24 -24
drivers/tee/amdtee/core.c
··· 212 212 return rc; 213 213 } 214 214 215 + static void destroy_session(struct kref *ref) 216 + { 217 + struct amdtee_session *sess = container_of(ref, struct amdtee_session, 218 + refcount); 219 + 220 + /* Unload the TA from TEE */ 221 + handle_unload_ta(sess->ta_handle); 222 + mutex_lock(&session_list_mutex); 223 + list_del(&sess->list_node); 224 + mutex_unlock(&session_list_mutex); 225 + kfree(sess); 226 + } 227 + 215 228 int amdtee_open_session(struct tee_context *ctx, 216 229 struct tee_ioctl_open_session_arg *arg, 217 230 struct tee_param *param) ··· 249 236 250 237 /* Load the TA binary into TEE environment */ 251 238 handle_load_ta(ta, ta_size, arg); 252 - if (arg->ret == TEEC_SUCCESS) { 253 - mutex_lock(&session_list_mutex); 254 - sess = alloc_session(ctxdata, arg->session); 255 - mutex_unlock(&session_list_mutex); 256 - } 257 - 258 239 if (arg->ret != TEEC_SUCCESS) 259 240 goto out; 241 + 242 + mutex_lock(&session_list_mutex); 243 + sess = alloc_session(ctxdata, arg->session); 244 + mutex_unlock(&session_list_mutex); 260 245 261 246 if (!sess) { 262 247 rc = -ENOMEM; ··· 270 259 271 260 if (i >= TEE_NUM_SESSIONS) { 272 261 pr_err("reached maximum session count %d\n", TEE_NUM_SESSIONS); 262 + kref_put(&sess->refcount, destroy_session); 273 263 rc = -ENOMEM; 274 264 goto out; 275 265 } 276 266 277 267 /* Open session with loaded TA */ 278 268 handle_open_session(arg, &session_info, param); 279 - 280 - if (arg->ret == TEEC_SUCCESS) { 281 - sess->session_info[i] = session_info; 282 - set_session_id(sess->ta_handle, i, &arg->session); 283 - } else { 269 + if (arg->ret != TEEC_SUCCESS) { 284 270 pr_err("open_session failed %d\n", arg->ret); 285 271 spin_lock(&sess->lock); 286 272 clear_bit(i, sess->sess_mask); 287 273 spin_unlock(&sess->lock); 274 + kref_put(&sess->refcount, destroy_session); 275 + goto out; 288 276 } 277 + 278 + sess->session_info[i] = session_info; 279 + set_session_id(sess->ta_handle, i, &arg->session); 289 280 out: 290 281 free_pages((u64)ta, get_order(ta_size)); 291 282 return rc; 292 - } 293 - 294 - static void destroy_session(struct kref *ref) 295 - { 296 - struct amdtee_session *sess = container_of(ref, struct amdtee_session, 297 - refcount); 298 - 299 - /* Unload the TA from TEE */ 300 - handle_unload_ta(sess->ta_handle); 301 - mutex_lock(&session_list_mutex); 302 - list_del(&sess->list_node); 303 - mutex_unlock(&session_list_mutex); 304 - kfree(sess); 305 283 } 306 284 307 285 int amdtee_close_session(struct tee_context *ctx, u32 session)
+7
drivers/video/backlight/Kconfig
··· 456 456 help 457 457 Support for backlight control on RAVE SP device. 458 458 459 + config BACKLIGHT_LED 460 + tristate "Generic LED based Backlight Driver" 461 + depends on LEDS_CLASS && OF 462 + help 463 + If you have a LCD backlight adjustable by LED class driver, say Y 464 + to enable this driver. 465 + 459 466 endif # BACKLIGHT_CLASS_DEVICE 460 467 461 468 endmenu
+1
drivers/video/backlight/Makefile
··· 57 57 obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o 58 58 obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o 59 59 obj-$(CONFIG_BACKLIGHT_RAVE_SP) += rave-sp-backlight.o 60 + obj-$(CONFIG_BACKLIGHT_LED) += led_bl.o
+260
drivers/video/backlight/led_bl.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com/ 4 + * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> 5 + * 6 + * Based on pwm_bl.c 7 + */ 8 + 9 + #include <linux/backlight.h> 10 + #include <linux/leds.h> 11 + #include <linux/module.h> 12 + #include <linux/platform_device.h> 13 + 14 + struct led_bl_data { 15 + struct device *dev; 16 + struct backlight_device *bl_dev; 17 + struct led_classdev **leds; 18 + bool enabled; 19 + int nb_leds; 20 + unsigned int *levels; 21 + unsigned int default_brightness; 22 + unsigned int max_brightness; 23 + }; 24 + 25 + static void led_bl_set_brightness(struct led_bl_data *priv, int level) 26 + { 27 + int i; 28 + int bkl_brightness; 29 + 30 + if (priv->levels) 31 + bkl_brightness = priv->levels[level]; 32 + else 33 + bkl_brightness = level; 34 + 35 + for (i = 0; i < priv->nb_leds; i++) 36 + led_set_brightness(priv->leds[i], bkl_brightness); 37 + 38 + priv->enabled = true; 39 + } 40 + 41 + static void led_bl_power_off(struct led_bl_data *priv) 42 + { 43 + int i; 44 + 45 + if (!priv->enabled) 46 + return; 47 + 48 + for (i = 0; i < priv->nb_leds; i++) 49 + led_set_brightness(priv->leds[i], LED_OFF); 50 + 51 + priv->enabled = false; 52 + } 53 + 54 + static int led_bl_update_status(struct backlight_device *bl) 55 + { 56 + struct led_bl_data *priv = bl_get_data(bl); 57 + int brightness = bl->props.brightness; 58 + 59 + if (bl->props.power != FB_BLANK_UNBLANK || 60 + bl->props.fb_blank != FB_BLANK_UNBLANK || 61 + bl->props.state & BL_CORE_FBBLANK) 62 + brightness = 0; 63 + 64 + if (brightness > 0) 65 + led_bl_set_brightness(priv, brightness); 66 + else 67 + led_bl_power_off(priv); 68 + 69 + return 0; 70 + } 71 + 72 + static const struct backlight_ops led_bl_ops = { 73 + .update_status = led_bl_update_status, 74 + }; 75 + 76 + static int led_bl_get_leds(struct device *dev, 77 + struct led_bl_data *priv) 78 + { 79 + int i, nb_leds, ret; 80 + struct device_node *node = dev->of_node; 81 + struct led_classdev **leds; 82 + unsigned int max_brightness; 83 + unsigned int default_brightness; 84 + 85 + ret = of_count_phandle_with_args(node, "leds", NULL); 86 + if (ret < 0) { 87 + dev_err(dev, "Unable to get led count\n"); 88 + return -EINVAL; 89 + } 90 + 91 + nb_leds = ret; 92 + if (nb_leds < 1) { 93 + dev_err(dev, "At least one LED must be specified!\n"); 94 + return -EINVAL; 95 + } 96 + 97 + leds = devm_kzalloc(dev, sizeof(struct led_classdev *) * nb_leds, 98 + GFP_KERNEL); 99 + if (!leds) 100 + return -ENOMEM; 101 + 102 + for (i = 0; i < nb_leds; i++) { 103 + leds[i] = devm_of_led_get(dev, i); 104 + if (IS_ERR(leds[i])) 105 + return PTR_ERR(leds[i]); 106 + } 107 + 108 + /* check that the LEDs all have the same brightness range */ 109 + max_brightness = leds[0]->max_brightness; 110 + for (i = 1; i < nb_leds; i++) { 111 + if (max_brightness != leds[i]->max_brightness) { 112 + dev_err(dev, "LEDs must have identical ranges\n"); 113 + return -EINVAL; 114 + } 115 + } 116 + 117 + /* get the default brightness from the first LED from the list */ 118 + default_brightness = leds[0]->brightness; 119 + 120 + priv->nb_leds = nb_leds; 121 + priv->leds = leds; 122 + priv->max_brightness = max_brightness; 123 + priv->default_brightness = default_brightness; 124 + 125 + return 0; 126 + } 127 + 128 + static int led_bl_parse_levels(struct device *dev, 129 + struct led_bl_data *priv) 130 + { 131 + struct device_node *node = dev->of_node; 132 + int num_levels; 133 + u32 value; 134 + int ret; 135 + 136 + if (!node) 137 + return -ENODEV; 138 + 139 + num_levels = of_property_count_u32_elems(node, "brightness-levels"); 140 + if (num_levels > 1) { 141 + int i; 142 + unsigned int db; 143 + u32 *levels = NULL; 144 + 145 + levels = devm_kzalloc(dev, sizeof(u32) * num_levels, 146 + GFP_KERNEL); 147 + if (!levels) 148 + return -ENOMEM; 149 + 150 + ret = of_property_read_u32_array(node, "brightness-levels", 151 + levels, 152 + num_levels); 153 + if (ret < 0) 154 + return ret; 155 + 156 + /* 157 + * Try to map actual LED brightness to backlight brightness 158 + * level 159 + */ 160 + db = priv->default_brightness; 161 + for (i = 0 ; i < num_levels; i++) { 162 + if ((i && db > levels[i-1]) && db <= levels[i]) 163 + break; 164 + } 165 + priv->default_brightness = i; 166 + priv->max_brightness = num_levels - 1; 167 + priv->levels = levels; 168 + } else if (num_levels >= 0) 169 + dev_warn(dev, "Not enough levels defined\n"); 170 + 171 + ret = of_property_read_u32(node, "default-brightness-level", &value); 172 + if (!ret && value <= priv->max_brightness) 173 + priv->default_brightness = value; 174 + else if (!ret && value > priv->max_brightness) 175 + dev_warn(dev, "Invalid default brightness. Ignoring it\n"); 176 + 177 + return 0; 178 + } 179 + 180 + static int led_bl_probe(struct platform_device *pdev) 181 + { 182 + struct backlight_properties props; 183 + struct led_bl_data *priv; 184 + int ret, i; 185 + 186 + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 187 + if (!priv) 188 + return -ENOMEM; 189 + 190 + platform_set_drvdata(pdev, priv); 191 + 192 + priv->dev = &pdev->dev; 193 + 194 + ret = led_bl_get_leds(&pdev->dev, priv); 195 + if (ret) 196 + return ret; 197 + 198 + ret = led_bl_parse_levels(&pdev->dev, priv); 199 + if (ret < 0) { 200 + dev_err(&pdev->dev, "Failed to parse DT data\n"); 201 + return ret; 202 + } 203 + 204 + memset(&props, 0, sizeof(struct backlight_properties)); 205 + props.type = BACKLIGHT_RAW; 206 + props.max_brightness = priv->max_brightness; 207 + props.brightness = priv->default_brightness; 208 + props.power = (priv->default_brightness > 0) ? FB_BLANK_POWERDOWN : 209 + FB_BLANK_UNBLANK; 210 + priv->bl_dev = backlight_device_register(dev_name(&pdev->dev), 211 + &pdev->dev, priv, &led_bl_ops, &props); 212 + if (IS_ERR(priv->bl_dev)) { 213 + dev_err(&pdev->dev, "Failed to register backlight\n"); 214 + return PTR_ERR(priv->bl_dev); 215 + } 216 + 217 + for (i = 0; i < priv->nb_leds; i++) 218 + led_sysfs_disable(priv->leds[i]); 219 + 220 + backlight_update_status(priv->bl_dev); 221 + 222 + return 0; 223 + } 224 + 225 + static int led_bl_remove(struct platform_device *pdev) 226 + { 227 + struct led_bl_data *priv = platform_get_drvdata(pdev); 228 + struct backlight_device *bl = priv->bl_dev; 229 + int i; 230 + 231 + backlight_device_unregister(bl); 232 + 233 + led_bl_power_off(priv); 234 + for (i = 0; i < priv->nb_leds; i++) 235 + led_sysfs_enable(priv->leds[i]); 236 + 237 + return 0; 238 + } 239 + 240 + static const struct of_device_id led_bl_of_match[] = { 241 + { .compatible = "led-backlight" }, 242 + { } 243 + }; 244 + 245 + MODULE_DEVICE_TABLE(of, led_bl_of_match); 246 + 247 + static struct platform_driver led_bl_driver = { 248 + .driver = { 249 + .name = "led-backlight", 250 + .of_match_table = of_match_ptr(led_bl_of_match), 251 + }, 252 + .probe = led_bl_probe, 253 + .remove = led_bl_remove, 254 + }; 255 + 256 + module_platform_driver(led_bl_driver); 257 + 258 + MODULE_DESCRIPTION("LED based Backlight Driver"); 259 + MODULE_LICENSE("GPL"); 260 + MODULE_ALIAS("platform:led-backlight");