Commit 5bd029bc authored by Jolly Shah's avatar Jolly Shah
Browse files

xilinx: pm_service: Rename macros to use generic macro names



ZynqMP pm_service ipi file uses platform specific macros names.
pm_service ipi functions can be used by other Xilinx platforms
also. Make rename macros to use generic names so that it can be
used by common file.

pm_service ipi functions will be moved to common file in next patch.
Signed-off-by: default avatarTejas Patel <tejas.patel@xilinx.com>
Reviewed-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: default avatarJolly Shah <jollys@xilinx.com>
parent 28e4d370
...@@ -21,8 +21,11 @@ ...@@ -21,8 +21,11 @@
#define IPI_BUFFER_APU_BASE (IPI_BUFFER_BASEADDR + 0x400U) #define IPI_BUFFER_APU_BASE (IPI_BUFFER_BASEADDR + 0x400U)
#define IPI_BUFFER_PMU_BASE (IPI_BUFFER_BASEADDR + 0xE00U) #define IPI_BUFFER_PMU_BASE (IPI_BUFFER_BASEADDR + 0xE00U)
#define IPI_BUFFER_TARGET_APU_OFFSET 0x80U #define IPI_BUFFER_LOCAL_BASE IPI_BUFFER_APU_BASE
#define IPI_BUFFER_TARGET_PMU_OFFSET 0x1C0U #define IPI_BUFFER_REMOTE_BASE IPI_BUFFER_PMU_BASE
#define IPI_BUFFER_TARGET_LOCAL_OFFSET 0x80U
#define IPI_BUFFER_TARGET_REMOTE_OFFSET 0x1C0U
#define IPI_BUFFER_MAX_WORDS 8 #define IPI_BUFFER_MAX_WORDS 8
...@@ -41,7 +44,8 @@ const struct pm_ipi apu_ipi = { ...@@ -41,7 +44,8 @@ const struct pm_ipi apu_ipi = {
}; };
/** /**
* pm_ipi_init() - Initialize IPI peripheral for communication with PMU * pm_ipi_init() - Initialize IPI peripheral for communication with
* remote processor
* *
* @proc Pointer to the processor who is initiating request * @proc Pointer to the processor who is initiating request
* @return On success, the initialization function must return 0. * @return On success, the initialization function must return 0.
...@@ -59,7 +63,7 @@ int pm_ipi_init(const struct pm_proc *proc) ...@@ -59,7 +63,7 @@ int pm_ipi_init(const struct pm_proc *proc)
} }
/** /**
* pm_ipi_send_common() - Sends IPI request to the PMU * pm_ipi_send_common() - Sends IPI request to the remote processor
* @proc Pointer to the processor who is initiating request * @proc Pointer to the processor who is initiating request
* @payload API id and call arguments to be written in IPI buffer * @payload API id and call arguments to be written in IPI buffer
* *
...@@ -74,7 +78,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc, ...@@ -74,7 +78,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
{ {
unsigned int offset = 0; unsigned int offset = 0;
uintptr_t buffer_base = proc->ipi->buffer_base + uintptr_t buffer_base = proc->ipi->buffer_base +
IPI_BUFFER_TARGET_PMU_OFFSET + IPI_BUFFER_TARGET_REMOTE_OFFSET +
IPI_BUFFER_REQ_OFFSET; IPI_BUFFER_REQ_OFFSET;
/* Write payload into IPI buffer */ /* Write payload into IPI buffer */
...@@ -83,7 +87,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc, ...@@ -83,7 +87,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
offset += PAYLOAD_ARG_SIZE; offset += PAYLOAD_ARG_SIZE;
} }
/* Generate IPI to PMU */ /* Generate IPI to remote processor */
ipi_mb_notify(proc->ipi->local_ipi_id, proc->ipi->remote_ipi_id, ipi_mb_notify(proc->ipi->local_ipi_id, proc->ipi->remote_ipi_id,
is_blocking); is_blocking);
...@@ -91,8 +95,8 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc, ...@@ -91,8 +95,8 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
} }
/** /**
* pm_ipi_send_non_blocking() - Sends IPI request to the PMU without blocking * pm_ipi_send_non_blocking() - Sends IPI request to the remote processor
* notification * without blocking notification
* @proc Pointer to the processor who is initiating request * @proc Pointer to the processor who is initiating request
* @payload API id and call arguments to be written in IPI buffer * @payload API id and call arguments to be written in IPI buffer
* *
...@@ -115,7 +119,7 @@ enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc, ...@@ -115,7 +119,7 @@ enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
} }
/** /**
* pm_ipi_send() - Sends IPI request to the PMU * pm_ipi_send() - Sends IPI request to the remote processor
* @proc Pointer to the processor who is initiating request * @proc Pointer to the processor who is initiating request
* @payload API id and call arguments to be written in IPI buffer * @payload API id and call arguments to be written in IPI buffer
* *
...@@ -139,7 +143,8 @@ enum pm_ret_status pm_ipi_send(const struct pm_proc *proc, ...@@ -139,7 +143,8 @@ enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
/** /**
* pm_ipi_buff_read() - Reads IPI response after PMU has handled interrupt * pm_ipi_buff_read() - Reads IPI response after remote processor has handled
* interrupt
* @proc Pointer to the processor who is waiting and reading response * @proc Pointer to the processor who is waiting and reading response
* @value Used to return value from IPI buffer element (optional) * @value Used to return value from IPI buffer element (optional)
* @count Number of values to return in @value * @count Number of values to return in @value
...@@ -151,7 +156,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -151,7 +156,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
{ {
size_t i; size_t i;
uintptr_t buffer_base = proc->ipi->buffer_base + uintptr_t buffer_base = proc->ipi->buffer_base +
IPI_BUFFER_TARGET_PMU_OFFSET + IPI_BUFFER_TARGET_REMOTE_OFFSET +
IPI_BUFFER_RESP_OFFSET; IPI_BUFFER_RESP_OFFSET;
/* /*
...@@ -170,7 +175,8 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -170,7 +175,8 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
} }
/** /**
* pm_ipi_buff_read_callb() - Reads IPI response after PMU has handled interrupt * pm_ipi_buff_read_callb() - Reads IPI response after remote processor has
* handled interrupt
* @value Used to return value from IPI buffer element (optional) * @value Used to return value from IPI buffer element (optional)
* @count Number of values to return in @value * @count Number of values to return in @value
* *
...@@ -179,8 +185,8 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -179,8 +185,8 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
void pm_ipi_buff_read_callb(unsigned int *value, size_t count) void pm_ipi_buff_read_callb(unsigned int *value, size_t count)
{ {
size_t i; size_t i;
uintptr_t buffer_base = IPI_BUFFER_PMU_BASE + uintptr_t buffer_base = IPI_BUFFER_REMOTE_BASE +
IPI_BUFFER_TARGET_APU_OFFSET + IPI_BUFFER_TARGET_LOCAL_OFFSET +
IPI_BUFFER_REQ_OFFSET; IPI_BUFFER_REQ_OFFSET;
if (count > IPI_BUFFER_MAX_WORDS) if (count > IPI_BUFFER_MAX_WORDS)
...@@ -193,7 +199,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count) ...@@ -193,7 +199,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count)
} }
/** /**
* pm_ipi_send_sync() - Sends IPI request to the PMU * pm_ipi_send_sync() - Sends IPI request to the remote processor
* @proc Pointer to the processor who is initiating request * @proc Pointer to the processor who is initiating request
* @payload API id and call arguments to be written in IPI buffer * @payload API id and call arguments to be written in IPI buffer
* @value Used to return value from IPI buffer element (optional) * @value Used to return value from IPI buffer element (optional)
......
Markdown is supported
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