rename CFG_ macros to CONFIG_SYS
[platform/kernel/u-boot.git] / board / esd / hub405 / hub405.c
index 0c6771f..8785e6c 100644 (file)
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern void lxt971_no_sleep(void);
 
-
 int board_revision(void)
 {
        unsigned long osrl_reg;
@@ -101,17 +101,8 @@ int board_early_init_f (void)
        return 0;
 }
 
-
-int misc_init_f (void)
-{
-       return 0;  /* dummy implementation */
-}
-
-
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        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);
@@ -134,33 +125,27 @@ int misc_init_r (void)
         * Set RS232/RS422 control (RS232 = high on GPIO)
         */
        val = in32(GPIO0_OR);
-       val &= ~(CFG_UART2_RS232 | CFG_UART3_RS232 | CFG_UART4_RS232 | CFG_UART5_RS232);
+       val &= ~(CONFIG_SYS_UART2_RS232 | CONFIG_SYS_UART3_RS232 | CONFIG_SYS_UART4_RS232 | CONFIG_SYS_UART5_RS232);
 
        str = getenv("phys0");
        if (!str || (str && (str[0] == '0')))
-               val |= CFG_UART2_RS232;
+               val |= CONFIG_SYS_UART2_RS232;
 
        str = getenv("phys1");
        if (!str || (str && (str[0] == '0')))
-               val |= CFG_UART3_RS232;
+               val |= CONFIG_SYS_UART3_RS232;
 
        str = getenv("phys2");
        if (!str || (str && (str[0] == '0')))
-               val |= CFG_UART4_RS232;
+               val |= CONFIG_SYS_UART4_RS232;
 
        str = getenv("phys3");
        if (!str || (str && (str[0] == '0')))
-               val |= CFG_UART5_RS232;
+               val |= CONFIG_SYS_UART5_RS232;
 
        out32(GPIO0_OR, val);
 
        /*
-        * Set NAND-FLASH GPIO signals to default
-        */
-       out32(GPIO0_OR, in32(GPIO0_OR) & ~(CFG_NAND_CLE | CFG_NAND_ALE));
-       out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND_CE);
-
-       /*
         * check board type and setup AP power
         */
        str = getenv("bd_type"); /* this is only set on non prototype hardware */
@@ -189,9 +174,9 @@ int misc_init_r (void)
        /*
         * Reset external DUARTs
         */
-       out32(GPIO0_OR, in32(GPIO0_OR) | CFG_DUART_RST); /* set reset to high */
+       out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_DUART_RST); /* set reset to high */
        udelay(10); /* wait 10us */
-       out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
+       out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_DUART_RST); /* set reset to low */
        udelay(1000); /* wait 1ms */
 
        /*
@@ -208,8 +193,6 @@ int misc_init_r (void)
  */
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
@@ -237,42 +220,3 @@ int checkboard (void)
 
        return 0;
 }
-
-
-long int initdram (int board_type)
-{
-       unsigned long val;
-
-       mtdcr(memcfga, mem_mb0cf);
-       val = mfdcr(memcfgd);
-
-#if 0
-       printf("\nmb0cf=%x\n", val); /* test-only */
-       printf("strap=%x\n", mfdcr(strap)); /* test-only */
-#endif
-
-       return (4*1024*1024 << ((val & 0x000e0000) >> 17));
-}
-
-
-int testdram (void)
-{
-       /* TODO: XXX XXX XXX */
-       printf ("test: 16 MB - ok\n");
-
-       return (0);
-}
-
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
-#include <linux/mtd/nand_legacy.h>
-extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
-
-void nand_init(void)
-{
-       nand_probe(CFG_NAND_BASE);
-       if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
-               print_size(nand_dev_desc[0].totlen, "\n");
-       }
-}
-#endif