Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pal/baremetal/base/include/pal_common_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "pal_status.h"
#include "platform_override_fvp.h"

typedef uintptr_t addr_t;
Expand Down Expand Up @@ -63,6 +64,7 @@ void *pal_aligned_alloc( uint32_t alignment, uint32_t size );

void pal_uart_print(int log, const char *fmt, ...);
void *mem_alloc(size_t alignment, size_t size);
void pal_warn_not_implemented(const char *api_name);
#define print(verbose, string, ...) if(verbose >= g_print_level) \
pal_uart_print(verbose, string, ##__VA_ARGS__)

Expand Down Expand Up @@ -178,7 +180,6 @@ void *mem_alloc(size_t alignment, size_t size);
#define INVALIDATE 0x3

#define HEAP_INITIALISED 0xDC
#define NOT_IMPLEMENTED 0x4B1D

#define MEM_SIZE_64K 0x10000

Expand Down
19 changes: 18 additions & 1 deletion pal/baremetal/base/src/pal_misc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -233,6 +233,23 @@ pal_print_raw(uint64_t addr, char *string, uint64_t data)
}
}

/**
@brief Emit a warning indicating the given PAL API is not implemented.
@param api_name Name of the unimplemented API (typically __func__).
**/
void
pal_warn_not_implemented(const char *api_name)
{
if (api_name == NULL)
return;

print(ACS_PRINT_WARN,
"\n %s is not implemented."
"\n Please implement the PAL function in test suite or"
"\n conduct an offline review for this rule.",
api_name);
}

/**
@brief Free the memory allocated by UEFI Framework APIs
@param Buffer the base address of the memory range to be freed
Expand Down
1 change: 1 addition & 0 deletions pal/baremetal/pal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ target_include_directories(${PAL_LIB} PRIVATE
${ROOT_DIR}/
${ROOT_DIR}/apps/baremetal/
${ROOT_DIR}/pal/baremetal/
${ROOT_DIR}/pal/include/
${ROOT_DIR}/pal/baremetal/base/include/
${ROOT_DIR}/pal/baremetal/base/src/AArch64/
${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/
Expand Down
26 changes: 15 additions & 11 deletions pal/baremetal/target/RDN2/src/pal_bsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ pal_gic_free_irq (

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint64_t
Expand All @@ -667,7 +667,8 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova)
(void) Pa;
(void) dram_buf_iova;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -677,15 +678,16 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr)
{
(void) port;
(void) dma_addr;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -726,7 +728,6 @@ pal_pcie_p2p_support(void)
// in the PCIe platform configuration

return 0;

}

/**
Expand Down Expand Up @@ -758,7 +759,7 @@ pal_pcie_device_driver_present(uint32_t seg, uint32_t bus, uint32_t dev, uint32_

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint32_t
Expand All @@ -771,7 +772,8 @@ pal_get_msi_vectors(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn,
(void) MVector;
(void) Fn;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -1161,7 +1163,7 @@ pal_mem_free_cacheable(uint32_t Bdf, uint32_t Size, void *Va, void *Pa)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint64_t
Expand All @@ -1173,7 +1175,8 @@ pal_dma_mem_alloc(void **buffer, uint32_t length, void *dev, uint32_t flag, addr
(void) dma_addr;
*buffer = (void *)pal_aligned_alloc(MEM_ALIGN_4K, length);

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -1228,7 +1231,7 @@ pal_dma_scsi_get_dma_addr(void *port, void *dma_addr, unsigned int *dma_len)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
int
Expand All @@ -1242,5 +1245,6 @@ pal_dma_mem_get_attrs(void *buf, uint32_t *attr, uint32_t *sh)
(void) attr;
(void) sh;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}
2 changes: 1 addition & 1 deletion pal/baremetal/target/RDN2/src/pal_exerciser.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ pal_exerciser_get_ras_status(uint32_t ras_node, uint32_t bdf, uint32_t rp_bdf)
with reads
@param bdf - BDF of the device
@return status - 0 if implemented, else
- NOT_IMPLEMENTED
- PAL_STATUS_NOT_IMPLEMENTED
**/
uint32_t
pal_exerciser_set_bar_response(uint32_t bdf)
Expand Down
32 changes: 19 additions & 13 deletions pal/baremetal/target/RDN2/src/pal_sbsa.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/** @file
* Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -38,27 +38,28 @@ extern WD_INFO_TABLE platform_wd_cfg;

@param etr_path full path of ETR device

@return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure
@return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure
**/
uint32_t
pal_smmu_is_etr_behind_catu(char *etr_path)
{
(void) etr_path;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
@brief Check for the _DSM method to obtain the STE value

@param None

@return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS
@return 0 - Failure, PAL_STATUS_NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS
**/
uint32_t pal_pcie_dsm_ste_tags(void)
{

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -76,7 +77,8 @@ pal_pmu_check_monitor_count_value(uint64_t interface_acpiid, uint32_t count_valu
(void) count_value;
(void) eventid;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -97,7 +99,8 @@ pal_generate_traffic(uint64_t interface_acpiid, uint32_t pmu_node_index,
(void) mon_index;
(void) eventid;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -114,7 +117,8 @@ pal_pmu_get_multi_traffic_support_interface(uint64_t *interface_acpiid,
(void) interface_acpiid;
(void) num_traffic_type_support;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -137,7 +141,7 @@ pal_ras_check_plat_poison_support()
@param in_param - Error Input Parameters.
@param *out_param - Parameters returned from platform to be used in the test.

@return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure
@return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure
**/
uint32_t
pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
Expand All @@ -147,7 +151,8 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
(void) in_param;
(void) out_param;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -156,14 +161,15 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
@param in_param - Error Input Parameters.
@param *out_param - Parameters returned from platform to be used in the test.

@return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure
@return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure
**/
uint32_t
pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param)
{
(void) in_param;
(void) out_param;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

26 changes: 15 additions & 11 deletions pal/baremetal/target/RDV3/src/pal_bsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ pal_gic_free_irq (

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
*/
uint64_t
Expand All @@ -696,7 +696,8 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova)
(void) Pa;
(void) dram_buf_iova;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand All @@ -706,15 +707,16 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr)
{
(void) port;
(void) dma_addr;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -755,7 +757,6 @@ pal_pcie_p2p_support(void)
// in the PCIe platform configuration

return 0;

}

/**
Expand Down Expand Up @@ -787,7 +788,7 @@ pal_pcie_device_driver_present(uint32_t seg, uint32_t bus, uint32_t dev, uint32_

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint32_t
Expand All @@ -800,7 +801,8 @@ pal_get_msi_vectors(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn,
(void) MVector;
(void) Fn;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -1193,7 +1195,7 @@ pal_mem_free_cacheable(uint32_t Bdf, uint32_t Size, void *Va, void *Pa)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
uint64_t
Expand All @@ -1205,7 +1207,8 @@ pal_dma_mem_alloc(void **buffer, uint32_t length, void *dev, uint32_t flag, addr
(void) dma_addr;
*buffer = (void *)pal_aligned_alloc(MEM_ALIGN_4K, length);

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}

/**
Expand Down Expand Up @@ -1261,7 +1264,7 @@ pal_dma_scsi_get_dma_addr(void *port, void *dma_addr, unsigned int *dma_len)

@return
- 0 : Success
- NOT_IMPLEMENTED : Feature not implemented
- PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented
- non-zero : Failure (implementation-specific error code)
**/
int
Expand All @@ -1275,5 +1278,6 @@ pal_dma_mem_get_attrs(void *buf, uint32_t *attr, uint32_t *sh)
(void) attr;
(void) sh;

return NOT_IMPLEMENTED;
pal_warn_not_implemented(__func__);
return PAL_STATUS_NOT_IMPLEMENTED;
}
2 changes: 1 addition & 1 deletion pal/baremetal/target/RDV3/src/pal_exerciser.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ pal_exerciser_get_ras_status(uint32_t ras_node, uint32_t bdf, uint32_t rp_bdf)
with reads
@param bdf - BDF of the device
@return status - 0 if implemented, else
- NOT_IMPLEMENTED
- PAL_STATUS_NOT_IMPLEMENTED
**/
uint32_t
pal_exerciser_set_bar_response(uint32_t bdf)
Expand Down
Loading