|
28 | 28 | /* Max HashMap Order for PM API feature check (1<<7 = 128) */
|
29 | 29 | #define PM_API_FEATURE_CHECK_MAX_ORDER 7
|
30 | 30 |
|
| 31 | +/* CRL registers and bitfields */ |
| 32 | +#define CRL_APB_BASE 0xFF5E0000U |
| 33 | +/* BOOT_PIN_CTRL- Used to control the mode pins after boot */ |
| 34 | +#define CRL_APB_BOOT_PIN_CTRL (CRL_APB_BASE + (0x250U)) |
| 35 | +/* BOOT_PIN_CTRL_MASK- out_val[11:8], out_en[3:0] */ |
| 36 | +#define CRL_APB_BOOTPIN_CTRL_MASK 0xF0FU |
| 37 | + |
31 | 38 | static bool feature_check_enabled;
|
32 | 39 | static DEFINE_HASHTABLE(pm_api_features_map, PM_API_FEATURE_CHECK_MAX_ORDER);
|
33 | 40 |
|
@@ -925,6 +932,45 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
|
925 | 932 | }
|
926 | 933 | EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_config);
|
927 | 934 |
|
| 935 | +/** |
| 936 | + * zynqmp_pm_bootmode_read() - PM Config API for read bootpin status |
| 937 | + * @ps_mode: Returned output value of ps_mode |
| 938 | + * |
| 939 | + * This API function is to be used for notify the power management controller |
| 940 | + * to read bootpin status. |
| 941 | + * |
| 942 | + * Return: status, either success or error+reason |
| 943 | + */ |
| 944 | +unsigned int zynqmp_pm_bootmode_read(u32 *ps_mode) |
| 945 | +{ |
| 946 | + unsigned int ret; |
| 947 | + u32 ret_payload[PAYLOAD_ARG_CNT]; |
| 948 | + |
| 949 | + ret = zynqmp_pm_invoke_fn(PM_MMIO_READ, CRL_APB_BOOT_PIN_CTRL, 0, |
| 950 | + 0, 0, ret_payload); |
| 951 | + |
| 952 | + *ps_mode = ret_payload[1]; |
| 953 | + |
| 954 | + return ret; |
| 955 | +} |
| 956 | +EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_read); |
| 957 | + |
| 958 | +/** |
| 959 | + * zynqmp_pm_bootmode_write() - PM Config API for Configure bootpin |
| 960 | + * @ps_mode: Value to be written to the bootpin ctrl register |
| 961 | + * |
| 962 | + * This API function is to be used for notify the power management controller |
| 963 | + * to configure bootpin. |
| 964 | + * |
| 965 | + * Return: Returns status, either success or error+reason |
| 966 | + */ |
| 967 | +int zynqmp_pm_bootmode_write(u32 ps_mode) |
| 968 | +{ |
| 969 | + return zynqmp_pm_invoke_fn(PM_MMIO_WRITE, CRL_APB_BOOT_PIN_CTRL, |
| 970 | + CRL_APB_BOOTPIN_CTRL_MASK, ps_mode, 0, NULL); |
| 971 | +} |
| 972 | +EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_write); |
| 973 | + |
928 | 974 | /**
|
929 | 975 | * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller
|
930 | 976 | * master has initialized its own power management
|
|
0 commit comments