Merge tag 'u-boot-imx-20200121' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / arch / arm / mach-zynq / ps7_spl_init.c
index 069827880d102fc66620e0cbe83ff23c85a38005..4c38724d4d7cf9a26344de73cfa3e6e908f60412 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
  * (c) Copyright 2016 Topic Embedded Products.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm/io.h>
@@ -58,7 +57,7 @@ static void perf_start_clock(void)
 }
 
 /* Compute mask for given delay in miliseconds*/
-static int get_number_of_cycles_for_delay(unsigned int delay)
+static unsigned long get_number_of_cycles_for_delay(unsigned long delay)
 {
        return (APU_FREQ / (2 * 1000)) * delay;
 }
@@ -92,7 +91,7 @@ int __weak ps7_config(unsigned long *ps7_config_init)
        unsigned long mask;
        unsigned int numargs;
        int i;
-       int delay;
+       unsigned long delay;
 
        for (;;) {
                opcode = ptr[0];
@@ -108,6 +107,12 @@ int __weak ps7_config(unsigned long *ps7_config_init)
                        iowrite((ioread(addr) & ~mask) | (val & mask), addr);
                        break;
 
+               case OPCODE_WRITE:
+                       numargs = 2;
+                       val = ptr[1];
+                       iowrite(val, addr);
+                       break;
+
                case OPCODE_MASKPOLL:
                        numargs = 2;
                        mask = ptr[1];