Commit a33668bd authored by Madhukar Pappireddy's avatar Madhukar Pappireddy Committed by TrustedFirmware Code Review
Browse files

Merge "plat: xilinx: Fix non-MISRA compliant code" into integration

parents e8a96e3e e43258fa
...@@ -34,8 +34,9 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type) ...@@ -34,8 +34,9 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
{ {
assert(sec_state_is_valid(type)); assert(sec_state_is_valid(type));
if (type == NON_SECURE) if (type == NON_SECURE) {
return &bl33_image_ep_info; return &bl33_image_ep_info;
}
return &bl32_image_ep_info; return &bl32_image_ep_info;
} }
...@@ -68,8 +69,9 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -68,8 +69,9 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
VERSAL_UART_CLOCK, VERSAL_UART_CLOCK,
VERSAL_UART_BAUDRATE, VERSAL_UART_BAUDRATE,
&versal_runtime_console); &versal_runtime_console);
if (rc == 0) if (rc == 0) {
panic(); panic();
}
console_set_scope(&versal_runtime_console, CONSOLE_FLAG_BOOT | console_set_scope(&versal_runtime_console, CONSOLE_FLAG_BOOT |
CONSOLE_FLAG_RUNTIME); CONSOLE_FLAG_RUNTIME);
......
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
int plat_core_pos_by_mpidr(u_register_t mpidr) int plat_core_pos_by_mpidr(u_register_t mpidr)
{ {
if (mpidr & MPIDR_CLUSTER_MASK) if (mpidr & MPIDR_CLUSTER_MASK) {
return -1; return -1;
}
if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
return -1; return -1;
}
return versal_calc_core_pos(mpidr); return versal_calc_core_pos(mpidr);
} }
...@@ -32,8 +32,9 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type) ...@@ -32,8 +32,9 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
{ {
assert(sec_state_is_valid(type)); assert(sec_state_is_valid(type));
if (type == NON_SECURE) if (type == NON_SECURE) {
return &bl33_image_ep_info; return &bl33_image_ep_info;
}
return &bl32_image_ep_info; return &bl32_image_ep_info;
} }
...@@ -99,10 +100,11 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -99,10 +100,11 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
enum fsbl_handoff ret = fsbl_atf_handover(&bl32_image_ep_info, enum fsbl_handoff ret = fsbl_atf_handover(&bl32_image_ep_info,
&bl33_image_ep_info, &bl33_image_ep_info,
atf_handoff_addr); atf_handoff_addr);
if (ret == FSBL_HANDOFF_NO_STRUCT) if (ret == FSBL_HANDOFF_NO_STRUCT) {
bl31_set_default_config(); bl31_set_default_config();
else if (ret != FSBL_HANDOFF_SUCCESS) } else if (ret != FSBL_HANDOFF_SUCCESS) {
panic(); panic();
}
} }
if (bl32_image_ep_info.pc) { if (bl32_image_ep_info.pc) {
VERBOSE("BL31: Secure code at 0x%lx\n", bl32_image_ep_info.pc); VERBOSE("BL31: Secure code at 0x%lx\n", bl32_image_ep_info.pc);
...@@ -137,12 +139,14 @@ static interrupt_type_handler_t type_el3_interrupt_table[MAX_INTR_EL3]; ...@@ -137,12 +139,14 @@ static interrupt_type_handler_t type_el3_interrupt_table[MAX_INTR_EL3];
int request_intr_type_el3(uint32_t id, interrupt_type_handler_t handler) int request_intr_type_el3(uint32_t id, interrupt_type_handler_t handler)
{ {
/* Validate 'handler' and 'id' parameters */ /* Validate 'handler' and 'id' parameters */
if (!handler || id >= MAX_INTR_EL3) if (!handler || id >= MAX_INTR_EL3) {
return -EINVAL; return -EINVAL;
}
/* Check if a handler has already been registered */ /* Check if a handler has already been registered */
if (type_el3_interrupt_table[id]) if (type_el3_interrupt_table[id]) {
return -EALREADY; return -EALREADY;
}
type_el3_interrupt_table[id] = handler; type_el3_interrupt_table[id] = handler;
...@@ -157,8 +161,9 @@ static uint64_t rdo_el3_interrupt_handler(uint32_t id, uint32_t flags, ...@@ -157,8 +161,9 @@ static uint64_t rdo_el3_interrupt_handler(uint32_t id, uint32_t flags,
intr_id = plat_ic_get_pending_interrupt_id(); intr_id = plat_ic_get_pending_interrupt_id();
handler = type_el3_interrupt_table[intr_id]; handler = type_el3_interrupt_table[intr_id];
if (handler != NULL) if (handler != NULL) {
handler(intr_id, flags, handle, cookie); handler(intr_id, flags, handle, cookie);
}
return 0; return 0;
} }
...@@ -181,8 +186,9 @@ void bl31_plat_runtime_setup(void) ...@@ -181,8 +186,9 @@ void bl31_plat_runtime_setup(void)
set_interrupt_rm_flag(flags, NON_SECURE); set_interrupt_rm_flag(flags, NON_SECURE);
rc = register_interrupt_type_handler(INTR_TYPE_EL3, rc = register_interrupt_type_handler(INTR_TYPE_EL3,
rdo_el3_interrupt_handler, flags); rdo_el3_interrupt_handler, flags);
if (rc) if (rc) {
panic(); panic();
}
#endif #endif
} }
......
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
int plat_core_pos_by_mpidr(u_register_t mpidr) int plat_core_pos_by_mpidr(u_register_t mpidr)
{ {
if (mpidr & MPIDR_CLUSTER_MASK) if (mpidr & MPIDR_CLUSTER_MASK) {
return -1; return -1;
}
if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
return -1; return -1;
}
return zynqmp_calc_core_pos(mpidr); return zynqmp_calc_core_pos(mpidr);
} }
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