Apps: generic: ZynqMP R5: add cleanup API
authorWendy Liang <jliang@xilinx.com>
Thu, 28 Jul 2016 22:16:33 +0000 (15:16 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:45 +0000 (22:01 -0700)
Add system/platform dependent API to do the system cleanup.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
apps/system/generic/machine/zynqmp_r5/helper.c

index ce0a0525057f2737fb925a794d8e309d42f8ce4b..e2c8a966a9cf951fb3984a878f2418c1d8012b4b 100644 (file)
@@ -33,6 +33,8 @@
 #include "xparameters.h"
 #include "xil_exception.h"
 #include "xscugic.h"
+#include "xil_cache.h"
+#include "metal/sys.h"
 
 #define INTC_DEVICE_ID         XPAR_SCUGIC_0_DEVICE_ID
 
@@ -94,3 +96,12 @@ void init_system()
 {
        zynqmp_r5_gic_initialize();
 }
+
+void cleanup_system()
+{
+       metal_finish();
+       Xil_DCacheDisable();
+       Xil_ICacheDisable();
+       Xil_DCacheInvalidate();
+       Xil_ICacheInvalidate();
+}