test(fuzzing): adding variable coverage
Adding the capability to produce coverage of the arguments of the
SMC calls as generated by the fuzzer. The output from the FVP will
be routed to UART3 where a python flow will read the data to create
tables of each SMC call with its fields shown and values given. The
option is enabled by adding SMC_FUZZ_VARIABLE_COVERAGE=1 to the
corresponding TFTF config.
Change-Id: I2d4d310976aa2c0447efbd8ec0676bb9f8699828
Signed-off-by: Mark Dykes <mark.dykes@arm.com>
diff --git a/plat/arm/common/arm_setup.c b/plat/arm/common/arm_setup.c
index e345fd8..732597a 100644
--- a/plat/arm/common/arm_setup.c
+++ b/plat/arm/common/arm_setup.c
@@ -49,5 +49,10 @@
void tftf_early_platform_setup(void)
{
console_init(PLAT_ARM_UART_BASE, PLAT_ARM_UART_CLK_IN_HZ,
- PL011_BAUDRATE);
+ PL011_BAUDRATE);
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+ console_init_fuzzer(PLAT_ARM_SMC_FUZZER_UART_BASE, PLAT_ARM_SMC_FUZZER_UART_CLK_IN_HZ,
+ PL011_BAUDRATE);
+ tftf_console_state = 0;
+#endif
}
diff --git a/plat/arm/fvp/fvp_def.h b/plat/arm/fvp/fvp_def.h
index 4b5bd59..222fadd 100644
--- a/plat/arm/fvp/fvp_def.h
+++ b/plat/arm/fvp/fvp_def.h
@@ -86,4 +86,7 @@
#define PLAT_ARM_UART_BASE PL011_UART0_BASE
#define PLAT_ARM_UART_CLK_IN_HZ PL011_UART0_CLK_IN_HZ
+#define PLAT_ARM_SMC_FUZZER_UART_BASE PL011_UART3_BASE
+#define PLAT_ARM_SMC_FUZZER_UART_CLK_IN_HZ PL011_UART3_CLK_IN_HZ
+
#endif /* __FVP_DEF_H__ */