Apps: generic: Zynq7: add cleanup API
authorWendy Liang <jliang@xilinx.com>
Thu, 28 Jul 2016 22:35:01 +0000 (15:35 -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/zynq7/helper.c

index f016fb4390cc462f2964cf2bb9e72f1eb23a8ed7..537446dea1c17d44fad495bb13dbeb87a76065cb 100755 (executable)
@@ -30,6 +30,7 @@
  */
 #include <string.h>
 #include "baremetal.h"
+#include "metal/sys.h"
 
 #ifndef BAREMETAL_MASTER
 #define BAREMETAL_MASTER 0
@@ -279,3 +280,12 @@ void init_system()
        /* Initialize GIC */
        zynq7_gic_initialize();
 }
+
+void cleanup_system()
+{
+       metal_finish();
+       Xil_DCacheInvalidate();
+       Xil_ICacheInvalidate();
+       Xil_DCacheDisable();
+       Xil_ICacheDisable();
+}