Merge branch 'master' of rsync://rsync.denx.de/git/u-boot
[platform/kernel/u-boot.git] / common / cmd_immap.c
index f1b0535..fa79b45 100644 (file)
 #include <asm/iopin_8260.h>
 #endif
 
+#if defined(CONFIG_8xx) || defined(CONFIG_8260)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 static void
 unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -383,6 +387,7 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        if (rcode == 0) {
                iopin.port = port;
                iopin.pin = pin;
+               iopin.flag = 0;
                switch (cmd) {
                case DIR:
                        if (value)
@@ -449,10 +454,8 @@ static void prbrg (int n, uint val)
        uint div16 = (val & CPM_BRG_DIV16) != 0;
 
 #if defined(CONFIG_8xx)
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = gd->cpu_clk;
 #elif defined(CONFIG_8260)
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = gd->brg_clk;
 #endif