]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/esd/wuh405/wuh405.c
Merge branch 'next' of ../next
[karo-tx-uboot.git] / board / esd / wuh405 / wuh405.c
index 3a94fd86b27c296cfd1d1665492b516453c367cf..e330fff16c9aebab58a0df9c1d4d596aa69dbf83 100644 (file)
@@ -82,18 +82,14 @@ int board_early_init_f (void)
 
 int misc_init_r (void)
 {
-       volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
-       volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
-       volatile unsigned char *duart2_mcr = (unsigned char *)((ulong)DUART2_BA + 4);
-       volatile unsigned char *duart3_mcr = (unsigned char *)((ulong)DUART3_BA + 4);
        unsigned char *dst;
        ulong len = sizeof(fpgadata);
        int status;
        int index;
        int i;
 
-       dst = malloc(CFG_FPGA_MAX_SIZE);
-       if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
+       dst = malloc(CONFIG_SYS_FPGA_MAX_SIZE);
+       if (gunzip (dst, CONFIG_SYS_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
                printf ("GUNZIP ERROR - must RESET board to recover\n");
                do_reset (NULL, 0, 0, NULL);
        }
@@ -155,18 +151,20 @@ int misc_init_r (void)
        /*
         * Reset external DUARTs
         */
-       out32(GPIO0_OR, in32(GPIO0_OR) | CFG_DUART_RST); /* set reset to high */
+       out_be32((void *)GPIO0_OR,
+                in_be32((void *)GPIO0_OR) | CONFIG_SYS_DUART_RST);
        udelay(10); /* wait 10us */
-       out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
+       out_be32((void *)GPIO0_OR,
+                in_be32((void *)GPIO0_OR) & ~CONFIG_SYS_DUART_RST);
        udelay(1000); /* wait 1ms */
 
        /*
         * Enable interrupts in exar duart mcr[3]
         */
-       *duart0_mcr = 0x08;
-       *duart1_mcr = 0x08;
-       *duart2_mcr = 0x08;
-       *duart3_mcr = 0x08;
+       out_8((void *)(DUART0_BA + 4), 0x08);
+       out_8((void *)(DUART1_BA + 4), 0x08);
+       out_8((void *)(DUART2_BA + 4), 0x08);
+       out_8((void *)(DUART3_BA + 4), 0x08);
 
        return (0);
 }