Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'imx-fixes-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 5.14:

- A couple of fixes on MMDC driver to add missing iounmap() and
clk_disable_unprepare(), and a follow-up fix.
- Fix missing-prototypes warning in SRC driver.
- Revert commit 7d981405d0fd ("soc: imx8m: change to use platform
driver"), which breaks i.MX8M system that has CAAM driver enabled.
- One fix on imx53-m53menlo pinctrl configuration.
- Increase the PHY reset duration for imx6qdl-sr-som to fix intermittent
issues where the PHY would be unresponsive every once in a while.
- Add missing flag for in-band signalling between PHY and MAC on
kontron-sl28-var2 board to fix network support.
- Limit the SDIO Clock on Colibri iMX6ULL to 25MHz for fixing wireless
noise issue.
- Fix sysclk node name for LS1028A so that U-Boot is able to update the
"clock-frequency" property.

* tag 'imx-fixes-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
ARM: dts: imx: Swap M53Menlo pinctrl_power_button/pinctrl_power_out pins
ARM: imx: fix missing 3rd argument in macro imx_mmdc_perf_init
ARM: dts: colibri-imx6ull: limit SDIO clock to 25MHz
arm64: dts: ls1028: sl28: fix networking for variant 2
Revert "soc: imx8m: change to use platform driver"
ARM: dts: imx6qdl-sr-som: Increase the PHY reset duration to 10ms
ARM: imx: common: Move prototype outside the SMP block
ARM: imx: add missing clk_disable_unprepare()
ARM: imx: add missing iounmap()
arm64: dts: ls1028a: fix node name for the sysclk

Link: https://lore.kernel.org/r/20210726023221.GF5901@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+40 -80
+2 -2
arch/arm/boot/dts/imx53-m53menlo.dts
··· 388 388 389 389 pinctrl_power_button: powerbutgrp { 390 390 fsl,pins = < 391 - MX53_PAD_SD2_DATA2__GPIO1_13 0x1e4 391 + MX53_PAD_SD2_DATA0__GPIO1_15 0x1e4 392 392 >; 393 393 }; 394 394 395 395 pinctrl_power_out: poweroutgrp { 396 396 fsl,pins = < 397 - MX53_PAD_SD2_DATA0__GPIO1_15 0x1e4 397 + MX53_PAD_SD2_DATA2__GPIO1_13 0x1e4 398 398 >; 399 399 }; 400 400
+7 -1
arch/arm/boot/dts/imx6qdl-sr-som.dtsi
··· 54 54 pinctrl-names = "default"; 55 55 pinctrl-0 = <&pinctrl_microsom_enet_ar8035>; 56 56 phy-mode = "rgmii-id"; 57 - phy-reset-duration = <2>; 57 + 58 + /* 59 + * The PHY seems to require a long-enough reset duration to avoid 60 + * some rare issues where the PHY gets stuck in an inconsistent and 61 + * non-functional state at boot-up. 10ms proved to be fine . 62 + */ 63 + phy-reset-duration = <10>; 58 64 phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>; 59 65 status = "okay"; 60 66
+1
arch/arm/boot/dts/imx6ull-colibri-wifi.dtsi
··· 43 43 assigned-clock-rates = <0>, <198000000>; 44 44 cap-power-off-card; 45 45 keep-power-in-suspend; 46 + max-frequency = <25000000>; 46 47 mmc-pwrseq = <&wifi_pwrseq>; 47 48 no-1-8-v; 48 49 non-removable;
+1 -1
arch/arm/mach-imx/common.h
··· 68 68 void v7_secondary_startup(void); 69 69 void imx_scu_map_io(void); 70 70 void imx_smp_prepare(void); 71 - void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn); 72 71 #else 73 72 static inline void imx_scu_map_io(void) {} 74 73 static inline void imx_smp_prepare(void) {} ··· 80 81 void imx_gpc_restore_all(void); 81 82 void imx_gpc_hwirq_mask(unsigned int hwirq); 82 83 void imx_gpc_hwirq_unmask(unsigned int hwirq); 84 + void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn); 83 85 void imx_anatop_init(void); 84 86 void imx_anatop_pre_suspend(void); 85 87 void imx_anatop_post_resume(void);
+14 -3
arch/arm/mach-imx/mmdc.c
··· 103 103 struct perf_event *mmdc_events[MMDC_NUM_COUNTERS]; 104 104 struct hlist_node node; 105 105 struct fsl_mmdc_devtype_data *devtype_data; 106 + struct clk *mmdc_ipg_clk; 106 107 }; 107 108 108 109 /* ··· 463 462 464 463 cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); 465 464 perf_pmu_unregister(&pmu_mmdc->pmu); 465 + iounmap(pmu_mmdc->mmdc_base); 466 + clk_disable_unprepare(pmu_mmdc->mmdc_ipg_clk); 466 467 kfree(pmu_mmdc); 467 468 return 0; 468 469 } 469 470 470 - static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base) 471 + static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base, 472 + struct clk *mmdc_ipg_clk) 471 473 { 472 474 struct mmdc_pmu *pmu_mmdc; 473 475 char *name; ··· 498 494 } 499 495 500 496 mmdc_num = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev); 497 + pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk; 501 498 if (mmdc_num == 0) 502 499 name = "mmdc"; 503 500 else ··· 534 529 535 530 #else 536 531 #define imx_mmdc_remove NULL 537 - #define imx_mmdc_perf_init(pdev, mmdc_base) 0 532 + #define imx_mmdc_perf_init(pdev, mmdc_base, mmdc_ipg_clk) 0 538 533 #endif 539 534 540 535 static int imx_mmdc_probe(struct platform_device *pdev) ··· 572 567 val &= ~(1 << BP_MMDC_MAPSR_PSD); 573 568 writel_relaxed(val, reg); 574 569 575 - return imx_mmdc_perf_init(pdev, mmdc_base); 570 + err = imx_mmdc_perf_init(pdev, mmdc_base, mmdc_ipg_clk); 571 + if (err) { 572 + iounmap(mmdc_base); 573 + clk_disable_unprepare(mmdc_ipg_clk); 574 + } 575 + 576 + return err; 576 577 } 577 578 578 579 int imx_mmdc_get_ddr_type(void)
+2
arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var2.dts
··· 54 54 55 55 &mscc_felix_port0 { 56 56 label = "swp0"; 57 + managed = "in-band-status"; 57 58 phy-handle = <&phy0>; 58 59 phy-mode = "sgmii"; 59 60 status = "okay"; ··· 62 61 63 62 &mscc_felix_port1 { 64 63 label = "swp1"; 64 + managed = "in-band-status"; 65 65 phy-handle = <&phy1>; 66 66 phy-mode = "sgmii"; 67 67 status = "okay";
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
··· 66 66 }; 67 67 }; 68 68 69 - sysclk: clock-sysclk { 69 + sysclk: sysclk { 70 70 compatible = "fixed-clock"; 71 71 #clock-cells = <0>; 72 72 clock-frequency = <100000000>;
+12 -72
drivers/soc/imx/soc-imx8m.c
··· 5 5 6 6 #include <linux/init.h> 7 7 #include <linux/io.h> 8 - #include <linux/module.h> 9 - #include <linux/nvmem-consumer.h> 10 8 #include <linux/of_address.h> 11 9 #include <linux/slab.h> 12 10 #include <linux/sys_soc.h> ··· 29 31 30 32 struct imx8_soc_data { 31 33 char *name; 32 - u32 (*soc_revision)(struct device *dev); 34 + u32 (*soc_revision)(void); 33 35 }; 34 36 35 37 static u64 soc_uid; ··· 50 52 static inline u32 imx8mq_soc_revision_from_atf(void) { return 0; }; 51 53 #endif 52 54 53 - static u32 __init imx8mq_soc_revision(struct device *dev) 55 + static u32 __init imx8mq_soc_revision(void) 54 56 { 55 57 struct device_node *np; 56 58 void __iomem *ocotp_base; ··· 75 77 rev = REV_B1; 76 78 } 77 79 78 - if (dev) { 79 - int ret; 80 - 81 - ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid); 82 - if (ret) { 83 - iounmap(ocotp_base); 84 - of_node_put(np); 85 - return ret; 86 - } 87 - } else { 88 - soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH); 89 - soc_uid <<= 32; 90 - soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); 91 - } 80 + soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH); 81 + soc_uid <<= 32; 82 + soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); 92 83 93 84 iounmap(ocotp_base); 94 85 of_node_put(np); ··· 107 120 of_node_put(np); 108 121 } 109 122 110 - static u32 __init imx8mm_soc_revision(struct device *dev) 123 + static u32 __init imx8mm_soc_revision(void) 111 124 { 112 125 struct device_node *np; 113 126 void __iomem *anatop_base; ··· 125 138 iounmap(anatop_base); 126 139 of_node_put(np); 127 140 128 - if (dev) { 129 - int ret; 130 - 131 - ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid); 132 - if (ret) 133 - return ret; 134 - } else { 135 - imx8mm_soc_uid(); 136 - } 141 + imx8mm_soc_uid(); 137 142 138 143 return rev; 139 144 } ··· 150 171 .soc_revision = imx8mm_soc_revision, 151 172 }; 152 173 153 - static __maybe_unused const struct of_device_id imx8_machine_match[] = { 174 + static __maybe_unused const struct of_device_id imx8_soc_match[] = { 154 175 { .compatible = "fsl,imx8mq", .data = &imx8mq_soc_data, }, 155 176 { .compatible = "fsl,imx8mm", .data = &imx8mm_soc_data, }, 156 177 { .compatible = "fsl,imx8mn", .data = &imx8mn_soc_data, }, 157 178 { .compatible = "fsl,imx8mp", .data = &imx8mp_soc_data, }, 158 - { } 159 - }; 160 - 161 - static __maybe_unused const struct of_device_id imx8_soc_match[] = { 162 - { .compatible = "fsl,imx8mq-soc", .data = &imx8mq_soc_data, }, 163 - { .compatible = "fsl,imx8mm-soc", .data = &imx8mm_soc_data, }, 164 - { .compatible = "fsl,imx8mn-soc", .data = &imx8mn_soc_data, }, 165 - { .compatible = "fsl,imx8mp-soc", .data = &imx8mp_soc_data, }, 166 179 { } 167 180 }; 168 181 ··· 163 192 kasprintf(GFP_KERNEL, "%d.%d", (soc_rev >> 4) & 0xf, soc_rev & 0xf) : \ 164 193 "unknown" 165 194 166 - static int imx8_soc_info(struct platform_device *pdev) 195 + static int __init imx8_soc_init(void) 167 196 { 168 197 struct soc_device_attribute *soc_dev_attr; 169 198 struct soc_device *soc_dev; ··· 182 211 if (ret) 183 212 goto free_soc; 184 213 185 - if (pdev) 186 - id = of_match_node(imx8_soc_match, pdev->dev.of_node); 187 - else 188 - id = of_match_node(imx8_machine_match, of_root); 214 + id = of_match_node(imx8_soc_match, of_root); 189 215 if (!id) { 190 216 ret = -ENODEV; 191 217 goto free_soc; ··· 191 223 data = id->data; 192 224 if (data) { 193 225 soc_dev_attr->soc_id = data->name; 194 - if (data->soc_revision) { 195 - if (pdev) { 196 - soc_rev = data->soc_revision(&pdev->dev); 197 - ret = soc_rev; 198 - if (ret < 0) 199 - goto free_soc; 200 - } else { 201 - soc_rev = data->soc_revision(NULL); 202 - } 203 - } 226 + if (data->soc_revision) 227 + soc_rev = data->soc_revision(); 204 228 } 205 229 206 230 soc_dev_attr->revision = imx8_revision(soc_rev); ··· 230 270 kfree(soc_dev_attr); 231 271 return ret; 232 272 } 233 - 234 - /* Retain device_initcall is for backward compatibility with DTS. */ 235 - static int __init imx8_soc_init(void) 236 - { 237 - if (of_find_matching_node_and_match(NULL, imx8_soc_match, NULL)) 238 - return 0; 239 - 240 - return imx8_soc_info(NULL); 241 - } 242 273 device_initcall(imx8_soc_init); 243 - 244 - static struct platform_driver imx8_soc_info_driver = { 245 - .probe = imx8_soc_info, 246 - .driver = { 247 - .name = "imx8_soc_info", 248 - .of_match_table = imx8_soc_match, 249 - }, 250 - }; 251 - 252 - module_platform_driver(imx8_soc_info_driver); 253 - MODULE_LICENSE("GPL v2");