1 // SPDX-License-Identifier: GPL-2.0+
4 #include <firmware/imx/sci/sci.h>
5 #include <asm/mach-imx/sys_proto.h>
7 #include <linux/arm-smccc.h>
9 int sc_pm_setup_uart(sc_rsrc_t uart_rsrc
, sc_pm_clock_rate_t clk_rate
)
11 sc_pm_clock_rate_t rate
= clk_rate
;
15 ret
= sc_pm_set_resource_power_mode(-1, uart_rsrc
, SC_PM_PW_MODE_ON
);
19 /* Set UARTn clock root to 'rate' MHz */
20 ret
= sc_pm_set_clock_rate(-1, uart_rsrc
, SC_PM_CLK_PER
, &rate
);
24 /* Enable UARTn clock root */
25 ret
= sc_pm_clock_enable(-1, uart_rsrc
, SC_PM_CLK_PER
, true, false);
34 struct arm_smccc_res res
;
35 u32 seco_build
= 0, seco_commit
= 0;
36 u32 sc_build
= 0, sc_commit
= 0;
39 /* Get SCFW build and commit id */
40 sc_misc_build_info(-1, &sc_build
, &sc_commit
);
42 printf("SCFW does not support build info\n");
43 sc_commit
= 0; /* Display 0 if build info not supported */
46 /* Get SECO FW build and commit id */
47 sc_seco_build_info(-1, &seco_build
, &seco_commit
);
49 debug("SECO FW does not support build info\n");
50 /* Display 0 when the build info is not supported */
54 /* Get ARM Trusted Firmware commit id */
55 arm_smccc_smc(IMX_SIP_BUILDINFO
, IMX_SIP_BUILDINFO_GET_COMMITHASH
,
56 0, 0, 0, 0, 0, 0, &res
);
58 if (atf_commit
== 0xffffffff) {
59 debug("ATF does not support build info\n");
60 atf_commit
= 0x30; /* Display 0 */
63 printf("Build: SCFW %08x, SECO-FW %08x, ATF %s\n",
64 sc_commit
, seco_commit
, (char *)&atf_commit
);