Commit d7758354 authored by Venkatesh Yadav Abbarapu's avatar Venkatesh Yadav Abbarapu Committed by Manish Pandey
Browse files

plat: xilinx: common: Rename the IPI CRC checksum macro



Rename the macro ZYNQMP_IPI_CRC_CHECK to IPI_CRC_CHECK and
move the related defines to the common include.
Signed-off-by: default avatarVenkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I6d30b081ac607572a0b23e10ca8031bc90489e58
parent 89a05821
...@@ -15,6 +15,18 @@ ...@@ -15,6 +15,18 @@
#include <stdint.h> #include <stdint.h>
#include <plat_pm_common.h> #include <plat_pm_common.h>
#if IPI_CRC_CHECK
#define PAYLOAD_ARG_CNT 8U
#define IPI_W0_TO_W6_SIZE 28U
#define PAYLOAD_CRC_POS 7U
#define CRC_INIT_VALUE 0x4F4EU
#define CRC_ORDER 16U
#define CRC_POLYNOM 0x8005U
#else
#define PAYLOAD_ARG_CNT 6U
#endif
#define PAYLOAD_ARG_SIZE 4U /* size in bytes */
/** /**
* pm_ipi - struct for capturing IPI-channel specific info * pm_ipi - struct for capturing IPI-channel specific info
* @local_ipi_id Local IPI agent ID * @local_ipi_id Local IPI agent ID
......
...@@ -26,7 +26,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count); ...@@ -26,7 +26,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count);
void pm_ipi_irq_enable(const struct pm_proc *proc); void pm_ipi_irq_enable(const struct pm_proc *proc);
void pm_ipi_irq_clear(const struct pm_proc *proc); void pm_ipi_irq_clear(const struct pm_proc *proc);
uint32_t pm_ipi_irq_status(const struct pm_proc *proc); uint32_t pm_ipi_irq_status(const struct pm_proc *proc);
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
uint32_t calculate_crc(uint32_t payload[PAYLOAD_ARG_CNT], uint32_t buffersize); uint32_t calculate_crc(uint32_t payload[PAYLOAD_ARG_CNT], uint32_t buffersize);
#endif #endif
......
...@@ -60,7 +60,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc, ...@@ -60,7 +60,7 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
uintptr_t buffer_base = proc->ipi->buffer_base + uintptr_t buffer_base = proc->ipi->buffer_base +
IPI_BUFFER_TARGET_REMOTE_OFFSET + IPI_BUFFER_TARGET_REMOTE_OFFSET +
IPI_BUFFER_REQ_OFFSET; IPI_BUFFER_REQ_OFFSET;
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
payload[PAYLOAD_CRC_POS] = calculate_crc(payload, IPI_W0_TO_W6_SIZE); payload[PAYLOAD_CRC_POS] = calculate_crc(payload, IPI_W0_TO_W6_SIZE);
#endif #endif
...@@ -141,7 +141,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -141,7 +141,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
unsigned int *value, size_t count) unsigned int *value, size_t count)
{ {
size_t i; size_t i;
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
size_t j; size_t j;
unsigned int response_payload[PAYLOAD_ARG_CNT]; unsigned int response_payload[PAYLOAD_ARG_CNT];
#endif #endif
...@@ -160,7 +160,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -160,7 +160,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
*value = mmio_read_32(buffer_base + (i * PAYLOAD_ARG_SIZE)); *value = mmio_read_32(buffer_base + (i * PAYLOAD_ARG_SIZE));
value++; value++;
} }
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
for (j = 0; j < PAYLOAD_ARG_CNT; j++) for (j = 0; j < PAYLOAD_ARG_CNT; j++)
response_payload[j] = mmio_read_32(buffer_base + response_payload[j] = mmio_read_32(buffer_base +
(j * PAYLOAD_ARG_SIZE)); (j * PAYLOAD_ARG_SIZE));
...@@ -185,7 +185,7 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc, ...@@ -185,7 +185,7 @@ 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;
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
size_t j; size_t j;
unsigned int response_payload[PAYLOAD_ARG_CNT]; unsigned int response_payload[PAYLOAD_ARG_CNT];
#endif #endif
...@@ -200,7 +200,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count) ...@@ -200,7 +200,7 @@ void pm_ipi_buff_read_callb(unsigned int *value, size_t count)
*value = mmio_read_32(buffer_base + (i * PAYLOAD_ARG_SIZE)); *value = mmio_read_32(buffer_base + (i * PAYLOAD_ARG_SIZE));
value++; value++;
} }
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
for (j = 0; j < PAYLOAD_ARG_CNT; j++) for (j = 0; j < PAYLOAD_ARG_CNT; j++)
response_payload[j] = mmio_read_32(buffer_base + response_payload[j] = mmio_read_32(buffer_base +
(j * PAYLOAD_ARG_SIZE)); (j * PAYLOAD_ARG_SIZE));
...@@ -266,7 +266,7 @@ uint32_t pm_ipi_irq_status(const struct pm_proc *proc) ...@@ -266,7 +266,7 @@ uint32_t pm_ipi_irq_status(const struct pm_proc *proc)
return 0; return 0;
} }
#if ZYNQMP_IPI_CRC_CHECK #if IPI_CRC_CHECK
uint32_t calculate_crc(uint32_t *payload, uint32_t bufsize) uint32_t calculate_crc(uint32_t *payload, uint32_t bufsize)
{ {
uint32_t crcinit = CRC_INIT_VALUE; uint32_t crcinit = CRC_INIT_VALUE;
......
...@@ -16,17 +16,6 @@ ...@@ -16,17 +16,6 @@
#include <common/debug.h> #include <common/debug.h>
#include "pm_defs.h" #include "pm_defs.h"
#if ZYNQMP_IPI_CRC_CHECK
#define PAYLOAD_ARG_CNT 8U
#define IPI_W0_TO_W6_SIZE 28U
#define PAYLOAD_CRC_POS 7U
#define CRC_INIT_VALUE 0x4F4EU
#define CRC_ORDER 16U
#define CRC_POLYNOM 0x8005U
#else
#define PAYLOAD_ARG_CNT 6U
#endif
#define PAYLOAD_ARG_SIZE 4U /* size in bytes */
#define ZYNQMP_TZ_VERSION_MAJOR 1 #define ZYNQMP_TZ_VERSION_MAJOR 1
#define ZYNQMP_TZ_VERSION_MINOR 0 #define ZYNQMP_TZ_VERSION_MINOR 0
......
...@@ -9,7 +9,7 @@ PSCI_EXTENDED_STATE_ID := 1 ...@@ -9,7 +9,7 @@ PSCI_EXTENDED_STATE_ID := 1
A53_DISABLE_NON_TEMPORAL_HINT := 0 A53_DISABLE_NON_TEMPORAL_HINT := 0
SEPARATE_CODE_AND_RODATA := 1 SEPARATE_CODE_AND_RODATA := 1
ZYNQMP_WDT_RESTART := 0 ZYNQMP_WDT_RESTART := 0
ZYNQMP_IPI_CRC_CHECK := 0 IPI_CRC_CHECK := 0
override RESET_TO_BL31 := 1 override RESET_TO_BL31 := 1
override GICV2_G0_FOR_EL3 := 1 override GICV2_G0_FOR_EL3 := 1
override WARMBOOT_ENABLE_DCACHE_EARLY := 1 override WARMBOOT_ENABLE_DCACHE_EARLY := 1
...@@ -47,7 +47,11 @@ $(eval $(call add_define,ZYNQMP_WDT_RESTART)) ...@@ -47,7 +47,11 @@ $(eval $(call add_define,ZYNQMP_WDT_RESTART))
endif endif
ifdef ZYNQMP_IPI_CRC_CHECK ifdef ZYNQMP_IPI_CRC_CHECK
$(eval $(call add_define,ZYNQMP_IPI_CRC_CHECK)) $(warning "ZYNQMP_IPI_CRC_CHECK macro is deprecated...instead please use IPI_CRC_CHECK.")
endif
ifdef IPI_CRC_CHECK
$(eval $(call add_define,IPI_CRC_CHECK))
endif endif
PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ PLAT_INCLUDES := -Iinclude/plat/arm/common/ \
......
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