Commit 9a2850e5 authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu
Browse files

zynqmp: pm: Add IOCTL to set boot health status



Since the MMIO read/write APIs are removed from Linux user space,
Linux cannot directly write to the Global General Storage Register 4
any more to set healthy boot status.

Create an IOCTL to allow Linux to set boot health status.

Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Acked-by: default avatarWill Wong <willw@xilinx.com>
parent 7c0b17e3
......@@ -505,6 +505,20 @@ static enum pm_ret_status pm_ioctl_ulpi_reset(void)
return ret;
}
/**
* pm_ioctl_set_boot_health_status() - Ioctl for setting healthy boot status
*
* This function sets healthy bit value to indicate boot health status
* to firmware.
*
* @return Returns status, either success or error+reason
*/
static enum pm_ret_status pm_ioctl_set_boot_health_status(unsigned int value)
{
return pm_mmio_write(PM_BOOT_HEALTH_STATUS_REG,
PM_BOOT_HEALTH_STATUS_MASK, value);
}
/**
* pm_api_ioctl() - PM IOCTL API for device control and configs
* @node_id Node ID of the device
......@@ -577,6 +591,9 @@ enum pm_ret_status pm_api_ioctl(enum pm_node_id nid,
case IOCTL_ULPI_RESET:
ret = pm_ioctl_ulpi_reset();
break;
case IOCTL_SET_BOOT_HEALTH_STATUS:
ret = pm_ioctl_set_boot_health_status(arg1);
break;
default:
ret = PM_RET_ERROR_NOTSUPPORTED;
break;
......
......@@ -34,6 +34,8 @@ enum {
IOCTL_READ_PGGS,
/* IOCTL for ULPI reset */
IOCTL_ULPI_RESET,
/* Set healthy bit value */
IOCTL_SET_BOOT_HEALTH_STATUS,
};
//RPU operation mode
......
......@@ -335,4 +335,8 @@
#define PGGS_BASEADDR (0xFFD80050U)
#define PGGS_NUM_REGS U(4)
/* Warm restart boot health status register and mask */
#define PM_BOOT_HEALTH_STATUS_REG (GGS_BASEADDR + U(0x10))
#define PM_BOOT_HEALTH_STATUS_MASK U(0x01)
#endif /* __ZYNQMP_DEF_H__ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment