0002-arm-imx-imx8m-soc-replace-ifdef-by-IS_ENABLED.patch 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. From 4c82eeab9840983693791117aa75f7bd7fbc805b Mon Sep 17 00:00:00 2001
  2. From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  3. Date: Thu, 15 May 2025 17:09:52 +0200
  4. Subject: [PATCH] arm: imx: imx8m: soc: replace ifdef by IS_ENABLED()
  5. Standardize on using the IS_ENABLED macro.
  6. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  7. Reviewed-by: Peng Fan <peng.fan@nxp.com>
  8. Upstream: https://source.denx.de/u-boot/u-boot/-/commit/4c82eeab9840983693791117aa75f7bd7fbc805b
  9. ---
  10. arch/arm/mach-imx/imx8m/soc.c | 40 +++++++++++++++++------------------
  11. 1 file changed, 20 insertions(+), 20 deletions(-)
  12. diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
  13. index 806adcf145fa..3cdb71a25284 100644
  14. --- a/arch/arm/mach-imx/imx8m/soc.c
  15. +++ b/arch/arm/mach-imx/imx8m/soc.c
  16. @@ -38,7 +38,7 @@
  17. DECLARE_GLOBAL_DATA_PTR;
  18. -#if defined(CONFIG_IMX_HAB)
  19. +#if IS_ENABLED(CONFIG_IMX_HAB)
  20. struct imx_fuse const imx_sec_config_fuse = {
  21. .bank = 1,
  22. .word = 3,
  23. @@ -52,7 +52,7 @@ struct imx_fuse const imx_field_return_fuse = {
  24. int timer_init(void)
  25. {
  26. -#ifdef CONFIG_XPL_BUILD
  27. +#if IS_ENABLED(CONFIG_XPL_BUILD)
  28. struct sctr_regs *sctr = (struct sctr_regs *)SYSCNT_CTRL_BASE_ADDR;
  29. unsigned long freq = readl(&sctr->cntfid0);
  30. @@ -110,7 +110,7 @@ void set_wdog_reset(struct wdog_regs *wdog)
  31. setbits_le16(&wdog->wcr, WDOG_WDT_MASK | WDOG_WDZST_MASK);
  32. }
  33. -#ifdef CONFIG_ARMV8_PSCI
  34. +#if IS_ENABLED(CONFIG_ARMV8_PSCI)
  35. #define PTE_MAP_NS PTE_BLOCK_NS
  36. #else
  37. #define PTE_MAP_NS 0
  38. @@ -700,11 +700,11 @@ int arch_cpu_init(void)
  39. return 0;
  40. }
  41. -#if defined(CONFIG_IMX8MN) || defined(CONFIG_IMX8MP)
  42. +#if IS_ENABLED(CONFIG_IMX8MN) || IS_ENABLED(CONFIG_IMX8MP)
  43. struct rom_api *g_rom_api = (struct rom_api *)0x980;
  44. #endif
  45. -#if defined(CONFIG_IMX8M)
  46. +#if IS_ENABLED(CONFIG_IMX8M)
  47. #include <spl.h>
  48. int imx8m_detect_secondary_image_boot(void)
  49. {
  50. @@ -790,8 +790,8 @@ int boot_mode_getprisec(void)
  51. }
  52. #endif
  53. -#if defined(CONFIG_IMX8MN) || defined(CONFIG_IMX8MP)
  54. -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
  55. +#if IS_ENABLED(CONFIG_IMX8MN) || IS_ENABLED(CONFIG_IMX8MP)
  56. +#if IS_ENABLED(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION)
  57. #define IMG_CNTN_SET1_OFFSET GENMASK(22, 19)
  58. unsigned long arch_spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
  59. unsigned long raw_sect)
  60. @@ -834,7 +834,7 @@ bool is_usb_boot(void)
  61. return get_boot_device() == USB_BOOT;
  62. }
  63. -#ifdef CONFIG_OF_SYSTEM_SETUP
  64. +#if IS_ENABLED(CONFIG_OF_SYSTEM_SETUP)
  65. bool check_fdt_new_path(void *blob)
  66. {
  67. const char *soc_path = "/soc@0";
  68. @@ -880,7 +880,7 @@ add_status:
  69. return 0;
  70. }
  71. -#ifdef CONFIG_IMX8MQ
  72. +#if IS_ENABLED(CONFIG_IMX8MQ)
  73. bool check_dcss_fused(void)
  74. {
  75. struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
  76. @@ -1026,7 +1026,7 @@ int disable_vpu_nodes(void *blob)
  77. return -EPERM;
  78. }
  79. -#ifdef CONFIG_IMX8MN_LOW_DRIVE_MODE
  80. +#if IS_ENABLED(CONFIG_IMX8MN_LOW_DRIVE_MODE)
  81. static int low_drive_gpu_freq(void *blob)
  82. {
  83. static const char *nodes_path_8mn[] = {
  84. @@ -1311,7 +1311,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
  85. "/cpus/cpu@3",
  86. };
  87. -#ifdef CONFIG_IMX8MQ
  88. +#if IS_ENABLED(CONFIG_IMX8MQ)
  89. int i = 0;
  90. int rc;
  91. int nodeoff;
  92. @@ -1387,7 +1387,7 @@ usb_modify_speed:
  93. if (is_imx8md())
  94. disable_cpu_nodes(blob, nodes_path, 2, 4);
  95. -#elif defined(CONFIG_IMX8MM)
  96. +#elif IS_ENABLED(CONFIG_IMX8MM)
  97. if (is_imx8mml() || is_imx8mmdl() || is_imx8mmsl())
  98. disable_vpu_nodes(blob);
  99. @@ -1396,10 +1396,10 @@ usb_modify_speed:
  100. else if (is_imx8mms() || is_imx8mmsl())
  101. disable_cpu_nodes(blob, nodes_path, 3, 4);
  102. -#elif defined(CONFIG_IMX8MN)
  103. +#elif IS_ENABLED(CONFIG_IMX8MN)
  104. if (is_imx8mnl() || is_imx8mndl() || is_imx8mnsl())
  105. disable_gpu_nodes(blob);
  106. -#ifdef CONFIG_IMX8MN_LOW_DRIVE_MODE
  107. +#if IS_ENABLED(CONFIG_IMX8MN_LOW_DRIVE_MODE)
  108. else {
  109. int ldm_gpu = low_drive_gpu_freq(blob);
  110. @@ -1415,7 +1415,7 @@ usb_modify_speed:
  111. else if (is_imx8mns() || is_imx8mnsl() || is_imx8mnus())
  112. disable_cpu_nodes(blob, nodes_path, 3, 4);
  113. -#elif defined(CONFIG_IMX8MP)
  114. +#elif IS_ENABLED(CONFIG_IMX8MP)
  115. if (is_imx8mpul()) {
  116. /* Disable GPU */
  117. disable_gpu_nodes(blob);
  118. @@ -1471,7 +1471,7 @@ void reset_cpu(void)
  119. }
  120. #endif
  121. -#if defined(CONFIG_ARCH_MISC_INIT)
  122. +#if IS_ENABLED(CONFIG_ARCH_MISC_INIT)
  123. int arch_misc_init(void)
  124. {
  125. if (IS_ENABLED(CONFIG_FSL_CAAM)) {
  126. @@ -1487,8 +1487,8 @@ int arch_misc_init(void)
  127. }
  128. #endif
  129. -#if defined(CONFIG_XPL_BUILD)
  130. -#if defined(CONFIG_IMX8MQ) || defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MN)
  131. +#if IS_ENABLED(CONFIG_XPL_BUILD)
  132. +#if IS_ENABLED(CONFIG_IMX8MQ) || IS_ENABLED(CONFIG_IMX8MM) || IS_ENABLED(CONFIG_IMX8MN)
  133. bool serror_need_skip = true;
  134. void do_error(struct pt_regs *pt_regs)
  135. @@ -1523,7 +1523,7 @@ void do_error(struct pt_regs *pt_regs)
  136. #endif
  137. #endif
  138. -#if defined(CONFIG_IMX8MN) || defined(CONFIG_IMX8MP)
  139. +#if IS_ENABLED(CONFIG_IMX8MN) || IS_ENABLED(CONFIG_IMX8MP)
  140. enum env_location arch_env_get_location(enum env_operation op, int prio)
  141. {
  142. enum boot_device dev = get_boot_device();
  143. @@ -1571,7 +1571,7 @@ enum env_location arch_env_get_location(enum env_operation op, int prio)
  144. #endif
  145. -#ifdef CONFIG_IMX_BOOTAUX
  146. +#if IS_ENABLED(CONFIG_IMX_BOOTAUX)
  147. const struct rproc_att hostmap[] = {
  148. /* aux core , host core, size */
  149. { 0x00000000, 0x007e0000, 0x00020000 },
  150. --
  151. 2.43.0