apusys_power.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /*
  2. * Copyright (c) 2023-2024, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <errno.h>
  7. #include <inttypes.h>
  8. /* TF-A system header */
  9. #include <common/debug.h>
  10. #include <drivers/delay_timer.h>
  11. #include <lib/mmio.h>
  12. #include <lib/spinlock.h>
  13. #include <lib/utils_def.h>
  14. #include <lib/xlat_tables/xlat_tables_v2.h>
  15. /* Vendor header */
  16. #include "apusys.h"
  17. #include "apusys_power.h"
  18. #include "apusys_rv.h"
  19. #include "apusys_rv_pwr_ctrl.h"
  20. #include <mtk_mmap_pool.h>
  21. static spinlock_t apu_lock;
  22. static bool apusys_top_on;
  23. static int apu_poll(uintptr_t reg, uint32_t mask, uint32_t value, uint32_t timeout_us)
  24. {
  25. uint32_t reg_val, count;
  26. count = timeout_us / APU_POLL_STEP_US;
  27. if (count == 0) {
  28. count = 1;
  29. }
  30. do {
  31. reg_val = mmio_read_32(reg);
  32. if ((reg_val & mask) == value) {
  33. return 0;
  34. }
  35. udelay(APU_POLL_STEP_US);
  36. } while (--count);
  37. ERROR(MODULE_TAG "Timeout polling APU register %#" PRIxPTR "\n", reg);
  38. ERROR(MODULE_TAG "Read value 0x%x, expected 0x%x\n", reg_val,
  39. (value == 0U) ? (reg_val & ~mask) : (reg_val | mask));
  40. return -1;
  41. }
  42. static void apu_backup_restore(enum APU_BACKUP_RESTORE_CTRL ctrl)
  43. {
  44. int i;
  45. static struct apu_restore_data apu_restore_data[] = {
  46. { UP_NORMAL_DOMAIN_NS, 0 },
  47. { UP_PRI_DOMAIN_NS, 0 },
  48. { UP_IOMMU_CTRL, 0 },
  49. { UP_CORE0_VABASE0, 0 },
  50. { UP_CORE0_MVABASE0, 0 },
  51. { UP_CORE0_VABASE1, 0 },
  52. { UP_CORE0_MVABASE1, 0 },
  53. { UP_CORE0_VABASE2, 0 },
  54. { UP_CORE0_MVABASE2, 0 },
  55. { UP_CORE0_VABASE3, 0 },
  56. { UP_CORE0_MVABASE3, 0 },
  57. { MD32_SYS_CTRL, 0 },
  58. { MD32_CLK_CTRL, 0 },
  59. { UP_WAKE_HOST_MASK0, 0 }
  60. };
  61. switch (ctrl) {
  62. case APU_CTRL_BACKUP:
  63. for (i = 0; i < ARRAY_SIZE(apu_restore_data); i++) {
  64. apu_restore_data[i].data = mmio_read_32(apu_restore_data[i].reg);
  65. }
  66. break;
  67. case APU_CTRL_RESTORE:
  68. for (i = 0; i < ARRAY_SIZE(apu_restore_data); i++) {
  69. mmio_write_32(apu_restore_data[i].reg, apu_restore_data[i].data);
  70. }
  71. break;
  72. default:
  73. ERROR(MODULE_TAG "%s invalid op: %d\n", __func__, ctrl);
  74. break;
  75. }
  76. }
  77. static void apu_xpu2apusys_d4_slv_en(enum APU_D4_SLV_CTRL en)
  78. {
  79. switch (en) {
  80. case D4_SLV_OFF:
  81. mmio_setbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI21_CTRL_0,
  82. INFRA_FMEM_BUS_u_SI21_CTRL_EN);
  83. mmio_setbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI22_CTRL_0,
  84. INFRA_FMEM_BUS_u_SI22_CTRL_EN);
  85. mmio_setbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI11_CTRL_0,
  86. INFRA_FMEM_BUS_u_SI11_CTRL_EN);
  87. mmio_setbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_M6M7_BUS_u_SI24_CTRL_0,
  88. INFRA_FMEM_M6M7_BUS_u_SI24_CTRL_EN);
  89. break;
  90. case D4_SLV_ON:
  91. mmio_clrbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI21_CTRL_0,
  92. INFRA_FMEM_BUS_u_SI21_CTRL_EN);
  93. mmio_clrbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI22_CTRL_0,
  94. INFRA_FMEM_BUS_u_SI22_CTRL_EN);
  95. mmio_clrbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_BUS_u_SI11_CTRL_0,
  96. INFRA_FMEM_BUS_u_SI11_CTRL_EN);
  97. mmio_clrbits_32(BCRM_FMEM_PDN_BASE + INFRA_FMEM_M6M7_BUS_u_SI24_CTRL_0,
  98. INFRA_FMEM_M6M7_BUS_u_SI24_CTRL_EN);
  99. break;
  100. default:
  101. ERROR(MODULE_TAG "%s invalid op: %d\n", __func__, en);
  102. break;
  103. }
  104. }
  105. static void apu_pwr_flow_remote_sync(uint32_t cfg)
  106. {
  107. mmio_write_32(APU_MBOX0_BASE + PWR_FLOW_SYNC_REG, (cfg & 0x1));
  108. }
  109. static int apusys_kernel_apusys_pwr_top_on(void)
  110. {
  111. int ret;
  112. spin_lock(&apu_lock);
  113. if (apusys_top_on == true) {
  114. INFO(MODULE_TAG "%s: APUSYS already powered on!\n", __func__);
  115. spin_unlock(&apu_lock);
  116. return 0;
  117. }
  118. apu_pwr_flow_remote_sync(1);
  119. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_SEL_1, AFC_ENA);
  120. mmio_write_32(APU_RPC_BASE + APU_RPC_TOP_CON, REG_WAKEUP_SET);
  121. ret = apu_poll(APU_RPC_BASE + APU_RPC_INTF_PWR_RDY,
  122. PWR_RDY, PWR_RDY, APU_TOP_ON_POLLING_TIMEOUT_US);
  123. if (ret != 0) {
  124. ERROR(MODULE_TAG "%s polling RPC RDY timeout, ret %d\n", __func__, ret);
  125. spin_unlock(&apu_lock);
  126. return ret;
  127. }
  128. ret = apu_poll(APU_RPC_BASE + APU_RPC_STATUS,
  129. RPC_STATUS_RDY, RPC_STATUS_RDY, APU_TOP_ON_POLLING_TIMEOUT_US);
  130. if (ret != 0) {
  131. ERROR(MODULE_TAG "%s polling ARE FSM timeout, ret %d\n", __func__, ret);
  132. spin_unlock(&apu_lock);
  133. return ret;
  134. }
  135. mmio_write_32(APU_VCORE_BASE + APUSYS_VCORE_CG_CLR, CG_CLR);
  136. mmio_write_32(APU_RCX_BASE + APU_RCX_CG_CLR, CG_CLR);
  137. apu_xpu2apusys_d4_slv_en(D4_SLV_OFF);
  138. apu_backup_restore(APU_CTRL_RESTORE);
  139. apusys_top_on = true;
  140. spin_unlock(&apu_lock);
  141. return ret;
  142. }
  143. static void apu_sleep_rpc_rcx(void)
  144. {
  145. mmio_write_32(APU_RPC_BASE + APU_RPC_TOP_CON, REG_WAKEUP_CLR);
  146. dsb();
  147. udelay(10);
  148. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_SEL, (RPC_CTRL | RSV10));
  149. dsb();
  150. udelay(10);
  151. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_CON, CLR_IRQ);
  152. dsb();
  153. udelay(10);
  154. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_CON, SLEEP_REQ);
  155. dsb();
  156. udelay(100);
  157. }
  158. static int apusys_kernel_apusys_pwr_top_off(void)
  159. {
  160. int ret;
  161. spin_lock(&apu_lock);
  162. if (apusys_top_on == false) {
  163. INFO(MODULE_TAG "%s: APUSYS already powered off!\n", __func__);
  164. spin_unlock(&apu_lock);
  165. return 0;
  166. }
  167. apu_backup_restore(APU_CTRL_BACKUP);
  168. apu_xpu2apusys_d4_slv_en(D4_SLV_ON);
  169. if (mmio_read_32(APU_MBOX0_BASE + PWR_FLOW_SYNC_REG) == 0) {
  170. apu_pwr_flow_remote_sync(1);
  171. } else {
  172. apu_sleep_rpc_rcx();
  173. }
  174. ret = apu_poll(APU_RPC_BASE + APU_RPC_INTF_PWR_RDY,
  175. PWR_RDY, PWR_OFF, APU_TOP_OFF_POLLING_TIMEOUT_US);
  176. if (ret != 0) {
  177. ERROR(MODULE_TAG "%s timeout to wait RPC sleep (val:%d), ret %d\n",
  178. __func__, APU_TOP_OFF_POLLING_TIMEOUT_US, ret);
  179. spin_unlock(&apu_lock);
  180. return ret;
  181. }
  182. apusys_top_on = false;
  183. spin_unlock(&apu_lock);
  184. return ret;
  185. }
  186. int apusys_rv_pwr_ctrl(enum APU_PWR_OP op)
  187. {
  188. if (op != APU_PWR_OFF && op != APU_PWR_ON) {
  189. ERROR(MODULE_TAG "%s unknown request_ops = %d\n", __func__, op);
  190. return -EINVAL;
  191. }
  192. if (op == APU_PWR_ON)
  193. return apusys_kernel_apusys_pwr_top_on();
  194. return apusys_kernel_apusys_pwr_top_off();
  195. }
  196. static void get_pll_pcw(const uint32_t clk_rate, uint32_t *r1, uint32_t *r2)
  197. {
  198. unsigned int fvco = clk_rate;
  199. unsigned int pcw_val;
  200. unsigned int postdiv_val = 1;
  201. unsigned int postdiv_reg = 0;
  202. while (fvco <= OUT_CLK_FREQ_MIN) {
  203. postdiv_val = postdiv_val << 1;
  204. postdiv_reg = postdiv_reg + 1;
  205. fvco = fvco << 1;
  206. }
  207. pcw_val = (fvco * (1 << DDS_SHIFT)) / BASIC_CLK_FREQ;
  208. if (postdiv_reg == 0) {
  209. pcw_val = pcw_val * 2;
  210. postdiv_val = postdiv_val << 1;
  211. postdiv_reg = postdiv_reg + 1;
  212. }
  213. *r1 = postdiv_reg;
  214. *r2 = pcw_val;
  215. }
  216. static void apu_pll_init(void)
  217. {
  218. const uint32_t pll_hfctl_cfg[PLL_NUM] = {
  219. PLL4HPLL_FHCTL0_CFG,
  220. PLL4HPLL_FHCTL1_CFG,
  221. PLL4HPLL_FHCTL2_CFG,
  222. PLL4HPLL_FHCTL3_CFG
  223. };
  224. const uint32_t pll_con1[PLL_NUM] = {
  225. PLL4H_PLL1_CON1,
  226. PLL4H_PLL2_CON1,
  227. PLL4H_PLL3_CON1,
  228. PLL4H_PLL4_CON1
  229. };
  230. const uint32_t pll_fhctl_dds[PLL_NUM] = {
  231. PLL4HPLL_FHCTL0_DDS,
  232. PLL4HPLL_FHCTL1_DDS,
  233. PLL4HPLL_FHCTL2_DDS,
  234. PLL4HPLL_FHCTL3_DDS
  235. };
  236. const uint32_t pll_freq_out[PLL_NUM] = {
  237. APUPLL0_DEFAULT_FREQ,
  238. APUPLL1_DEFAULT_FREQ,
  239. APUPLL2_DEFAULT_FREQ,
  240. APUPLL3_DEFAULT_FREQ
  241. };
  242. uint32_t pcw_val, posdiv_val;
  243. int pll_idx;
  244. mmio_setbits_32(APU_PLL_BASE + PLL4HPLL_FHCTL_RST_CON, PLL4H_PLL_HP_SWRSTB);
  245. mmio_setbits_32(APU_PLL_BASE + PLL4HPLL_FHCTL_HP_EN, PLL4H_PLL_HP_EN);
  246. mmio_setbits_32(APU_PLL_BASE + PLL4HPLL_FHCTL_CLK_CON, PLL4H_PLL_HP_CLKEN);
  247. for (pll_idx = 0; pll_idx < PLL_NUM; pll_idx++) {
  248. mmio_setbits_32(APU_PLL_BASE + pll_hfctl_cfg[pll_idx], (FHCTL0_EN | SFSTR0_EN));
  249. posdiv_val = 0;
  250. pcw_val = 0;
  251. get_pll_pcw(pll_freq_out[pll_idx], &posdiv_val, &pcw_val);
  252. mmio_clrsetbits_32(APU_PLL_BASE + pll_con1[pll_idx],
  253. (RG_PLL_POSDIV_MASK << RG_PLL_POSDIV_SFT),
  254. (posdiv_val << RG_PLL_POSDIV_SFT));
  255. mmio_write_32(APU_PLL_BASE + pll_fhctl_dds[pll_idx],
  256. (FHCTL_PLL_TGL_ORG | pcw_val));
  257. }
  258. }
  259. static void apu_acc_init(void)
  260. {
  261. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_CLR0, CGEN_SOC);
  262. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_SET0, HW_CTRL_EN);
  263. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_CLR1, CGEN_SOC);
  264. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_SET1, HW_CTRL_EN);
  265. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_CLR2, CGEN_SOC);
  266. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_SET2, HW_CTRL_EN);
  267. mmio_write_32(APU_ACC_BASE + APU_ACC_AUTO_CTRL_SET2, CLK_REQ_SW_EN);
  268. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_CLR3, CGEN_SOC);
  269. mmio_write_32(APU_ACC_BASE + APU_ACC_CONFG_SET3, HW_CTRL_EN);
  270. mmio_write_32(APU_ACC_BASE + APU_ACC_AUTO_CTRL_SET3, CLK_REQ_SW_EN);
  271. mmio_write_32(APU_ACC_BASE + APU_ACC_CLK_INV_EN_SET, CLK_INV_EN);
  272. }
  273. static void apu_buck_off_cfg(void)
  274. {
  275. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_PROT_REQ_SET);
  276. dsb();
  277. udelay(10);
  278. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_ELS_EN_SET);
  279. dsb();
  280. udelay(10);
  281. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_AO_RST_B_CLR);
  282. dsb();
  283. udelay(10);
  284. }
  285. static void apu_pcu_init(void)
  286. {
  287. uint32_t vapu_en_offset = BUCK_VAPU_PMIC_REG_EN_ADDR;
  288. uint32_t vapu_sram_en_offset = BUCK_VAPU_SRAM_PMIC_REG_EN_ADDR;
  289. mmio_write_32(APU_PCU_BASE + APU_PCU_CTRL_SET, AUTO_BUCK_EN);
  290. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_STEP_SEL, BUCK_ON_OFF_CMD_EN);
  291. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_DAT0_L,
  292. ((vapu_sram_en_offset << BUCK_OFFSET_SFT) + BUCK_ON_CMD));
  293. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_DAT0_H, CMD_OP);
  294. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_DAT1_L,
  295. ((vapu_en_offset << BUCK_OFFSET_SFT) + BUCK_ON_CMD));
  296. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_DAT1_H, CMD_OP);
  297. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_OFF_DAT0_L,
  298. ((vapu_en_offset << BUCK_OFFSET_SFT) + BUCK_OFF_CMD));
  299. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_OFF_DAT0_H, CMD_OP);
  300. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_OFF_DAT1_L,
  301. ((vapu_sram_en_offset << BUCK_OFFSET_SFT) + BUCK_OFF_CMD));
  302. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_OFF_DAT1_H, CMD_OP);
  303. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_SLE0, APU_PCU_BUCK_ON_SETTLE_TIME);
  304. mmio_write_32(APU_PCU_BASE + APU_PCU_BUCK_ON_SLE1, APU_PCU_BUCK_ON_SETTLE_TIME);
  305. }
  306. static void apu_rpclite_init(void)
  307. {
  308. const uint32_t sleep_type_offset[] = {
  309. APU_RPC_SW_TYPE2,
  310. APU_RPC_SW_TYPE3,
  311. APU_RPC_SW_TYPE4,
  312. APU_RPC_SW_TYPE5,
  313. APU_RPC_SW_TYPE6,
  314. APU_RPC_SW_TYPE7,
  315. APU_RPC_SW_TYPE8,
  316. APU_RPC_SW_TYPE9
  317. };
  318. int ofs_arr_size = ARRAY_SIZE(sleep_type_offset);
  319. int ofs_idx;
  320. for (ofs_idx = 0 ; ofs_idx < ofs_arr_size ; ofs_idx++) {
  321. mmio_clrbits_32(APU_ACX0_RPC_LITE_BASE + sleep_type_offset[ofs_idx],
  322. SW_TYPE);
  323. }
  324. mmio_setbits_32(APU_ACX0_RPC_LITE_BASE + APU_RPC_TOP_SEL, RPC_CTRL);
  325. }
  326. static void apu_rpc_init(void)
  327. {
  328. mmio_clrbits_32(APU_RPC_BASE + APU_RPC_SW_TYPE0, SW_TYPE);
  329. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_SEL, RPC_TOP_CTRL);
  330. mmio_setbits_32(APU_RPC_BASE + APU_RPC_TOP_SEL_1, RPC_TOP_CTRL1);
  331. }
  332. static int apu_are_init(void)
  333. {
  334. int ret;
  335. int are_id = 0;
  336. const uint32_t are_base[APU_ARE_NUM] = { APU_ARE0_BASE, APU_ARE1_BASE, APU_ARE2_BASE };
  337. const uint32_t are_entry2_cfg_l[APU_ARE_NUM] = {
  338. ARE0_ENTRY2_CFG_L,
  339. ARE1_ENTRY2_CFG_L,
  340. ARE2_ENTRY2_CFG_L
  341. };
  342. mmio_setbits_32(APU_AO_CTL_BASE + CSR_DUMMY_0_ADDR, VCORE_ARE_REQ);
  343. ret = apu_poll(APU_ARE2_BASE + APU_ARE_GLO_FSM, ARE_GLO_FSM_IDLE, ARE_GLO_FSM_IDLE,
  344. APU_ARE_POLLING_TIMEOUT_US);
  345. if (ret != 0) {
  346. ERROR(MODULE_TAG "[%s][%d] ARE init timeout\n",
  347. __func__, __LINE__);
  348. return ret;
  349. }
  350. for (are_id = APU_ARE0; are_id < APU_ARE_NUM; are_id++) {
  351. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY0_SRAM_H, ARE_ENTRY0_SRAM_H_INIT);
  352. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY0_SRAM_L, ARE_ENTRY0_SRAM_L_INIT);
  353. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY1_SRAM_H, ARE_ENTRY1_SRAM_H_INIT);
  354. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY1_SRAM_L, ARE_ENTRY1_SRAM_L_INIT);
  355. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY2_SRAM_H, ARE_ENTRY_CFG_H);
  356. mmio_write_32(are_base[are_id] + APU_ARE_ENTRY2_SRAM_L, are_entry2_cfg_l[are_id]);
  357. mmio_read_32(are_base[are_id] + APU_ARE_ENTRY2_SRAM_H);
  358. mmio_read_32(are_base[are_id] + APU_ARE_ENTRY2_SRAM_L);
  359. mmio_write_32(are_base[are_id] + APU_ARE_INI_CTRL, ARE_CONFG_INI);
  360. }
  361. return ret;
  362. }
  363. static void apu_aoc_init(void)
  364. {
  365. mmio_clrbits_32(SPM_BASE + APUSYS_BUCK_ISOLATION, IPU_EXT_BUCK_ISO);
  366. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_ELS_EN_CLR);
  367. dsb();
  368. udelay(10);
  369. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_AO_RST_B_SET);
  370. dsb();
  371. udelay(10);
  372. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, BUCK_PROT_REQ_CLR);
  373. dsb();
  374. udelay(10);
  375. mmio_write_32(APU_RPC_BASE + APU_RPC_HW_CON, SRAM_AOC_ISO_CLR);
  376. dsb();
  377. udelay(10);
  378. }
  379. static int init_hw_setting(void)
  380. {
  381. int ret;
  382. apu_aoc_init();
  383. apu_pcu_init();
  384. apu_rpc_init();
  385. apu_rpclite_init();
  386. ret = apu_are_init();
  387. if (ret != 0) {
  388. return ret;
  389. }
  390. apu_pll_init();
  391. apu_acc_init();
  392. apu_buck_off_cfg();
  393. return ret;
  394. }
  395. int apusys_power_init(void)
  396. {
  397. int ret;
  398. ret = init_hw_setting();
  399. if (ret != 0) {
  400. ERROR(MODULE_TAG "%s initial fail\n", __func__);
  401. } else {
  402. INFO(MODULE_TAG "%s initial done\n", __func__);
  403. }
  404. return ret;
  405. }
  406. int apusys_infra_dcm_setup(void)
  407. {
  408. WARN(MODULE_TAG "%s not support\n", __func__);
  409. return -EOPNOTSUPP;
  410. }