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/include/drivers/arm/pl011.h b/include/drivers/arm/pl011.h
index 3e19ee8..42dd838 100644
--- a/include/drivers/arm/pl011.h
+++ b/include/drivers/arm/pl011.h
@@ -81,6 +81,10 @@
 /* Functions */
 
 int console_pl011_putc(int);
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+int console_pl011_putc_fuzzer(int);
+static int tftf_console_state;
+#endif
 
 #endif /* __ASSEMBLER__ */
 
diff --git a/include/drivers/console.h b/include/drivers/console.h
index 4c22a99..98826fa 100644
--- a/include/drivers/console.h
+++ b/include/drivers/console.h
@@ -16,6 +16,11 @@
 
 #include <stdint.h>
 
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+#define CONSOLE_FLAG_PLAT_UART		0
+#define CONSOLE_FLAG_SMC_FUZZER		1
+#endif
+
 /*
  * Function to initialize the console without a C Runtime to print debug
  * information. It saves the console base to the data section. Returns 1 on
@@ -24,12 +29,33 @@
 int console_init(uintptr_t base_addr,
 		unsigned int uart_clk, unsigned int baud_rate);
 
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+/*
+ * Function to initialize the console without a C Runtime to print debug
+ * information. It saves the console base to the data section. Returns 1 on
+ * success, 0 on error.
+ */
+int console_init_fuzzer(uintptr_t base_addr,
+                unsigned int uart_clk, unsigned int baud_rate);
+void tftf_switch_console_state(int state);
+int tftf_get_console_state(void);
+#endif
+
 /*
  * Function to output a character over the console. It returns the character
  * printed on success or an error code.
  */
 int console_putc(int c);
 
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+/*
+ * Function to output a character over the console. It returns the character
+ * printed on success or an error code.
+ */
+int console_putc_fuzzer(int c);
+#endif
+
+
 /*
  * Function to get a character from the console.  It returns the character
  * grabbed on success or an error code on error. This function is blocking, it