]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/esd/du405/du405.c
ppc4xx: Big cleanup of PPC4xx defines
[karo-tx-uboot.git] / board / esd / du405 / du405.c
index 7db2a609789a80dd016455bcfb0693c1108831bc..28a50c7b0e77286ece1810eda7e40d3b51c0ebce 100644 (file)
 #include "du405.h"
 #include <asm/processor.h>
 #include <ppc4xx.h>
-#include <405gp_i2c.h>
+#include <4xx_i2c.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*cmd_boot.c*/
 
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -55,8 +57,6 @@ const unsigned char fpgadata[] = {
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int index, len, i;
        int status;
 
@@ -135,7 +135,7 @@ int board_early_init_f (void)
        /*
         * EBC Configuration Register: set ready timeout to 100 us
         */
-       mtebc (epcr, 0xb8400000);
+       mtebc (EBC0_CFG, 0xb8400000);
 
        return 0;
 }
@@ -143,13 +143,13 @@ int board_early_init_f (void)
 
 int misc_init_r (void)
 {
-       unsigned long cntrl0Reg;
+       unsigned long CPC0_CR0Reg;
 
        /*
         * Setup UART1 handshaking: use CTS instead of DSR
         */
-       cntrl0Reg = mfdcr(cntrl0);
-       mtdcr(cntrl0, cntrl0Reg | 0x00001000);
+       CPC0_CR0Reg = mfdcr(CPC0_CR0);
+       mtdcr(CPC0_CR0, CPC0_CR0Reg | 0x00001000);
 
        return (0);
 }
@@ -162,7 +162,7 @@ int checkboard (void)
 {
        int index;
        int len;
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof (str));
 
        puts ("Board: ");
@@ -188,28 +188,19 @@ int checkboard (void)
        /*
         * Reset external DUART via FPGA
         */
-       *(volatile unsigned char *) FPGA_MODE_REG = 0xff;       /* reset high active */
-       *(volatile unsigned char *) FPGA_MODE_REG = 0x00;       /* low again */
-
-       /*
-        * Disable sleep mode in LXT971
-        */
-       lxt971_no_sleep();
+       out_8((void *)FPGA_MODE_REG, 0xff); /* reset high active */
+       out_8((void *)FPGA_MODE_REG, 0x00); /* low again */
 
        return 0;
 }
 
-
-long int initdram (int board_type)
-{
-       return (16 * 1024 * 1024);
-}
-
-
-int testdram (void)
+void reset_phy(void)
 {
-       /* TODO: XXX XXX XXX */
-       printf ("test: 16 MB - ok\n");
+#if defined(CONFIG_LXT971_NO_SLEEP)
 
-       return (0);
+       /*
+        * Disable sleep mode in LXT971
+        */
+       lxt971_no_sleep();
+#endif
 }