]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/uc100/uc100.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / board / uc100 / uc100.c
index 6fc68e5cc3c4f3d8715ccbeadb354ae2e493be3f..38c7be6bad6d1b56a605c22ef50c1057531ea296 100644 (file)
@@ -30,6 +30,8 @@
 #include <i2c.h>
 #include <miiphy.h>
 
+int fec8xx_miiphy_write(char *devname, unsigned char  addr,
+               unsigned char  reg, unsigned short value);
 
 /*********************************************************************/
 /* UPMA Pre Initilization Table by WV (Miron MT48LC16M16A2-7E B)     */
@@ -136,7 +138,7 @@ int board_switch(void)
 {
        volatile pcmconf8xx_t   *pcmp;
 
-       pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+       pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia));
 
        return ((pcmp->pcmc_pipr >> 24) & 0xf);
 }
@@ -147,7 +149,7 @@ int board_switch(void)
  */
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
@@ -167,9 +169,9 @@ int checkboard (void)
 /*
  * Initialize SDRAM
  */
-long int initdram (int board_type)
+phys_size_t initdram (int board_type)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
        volatile memctl8xx_t *memctl = &immap->im_memctl;
 
        /*---------------------------------------------------------------------*/
@@ -185,8 +187,8 @@ long int initdram (int board_type)
        /*---------------------------------------------------------------------*/
        memctl->memc_mptpr = 0x0200; /* Divide by 32 WV */
 
-       memctl->memc_mamr = CFG_MAMR_VAL & 0xFF7FFFFF; /* Bit 8 := "0" Kein Refresh WV */
-       memctl->memc_mbmr = CFG_MBMR_VAL;
+       memctl->memc_mamr = CONFIG_SYS_MAMR_VAL & 0xFF7FFFFF; /* Bit 8 := "0" Kein Refresh WV */
+       memctl->memc_mbmr = CONFIG_SYS_MBMR_VAL;
 
        /*---------------------------------------------------------------------*/
        /* Initialize the Memory Controller registers, MPTPR, Chip Select 1    */
@@ -196,8 +198,8 @@ long int initdram (int board_type)
        /*       clock rate (16.67MHz) to allow proper operation for all ADS   */
        /*       clock frequencies.                                            */
        /*---------------------------------------------------------------------*/
-       memctl->memc_or1 = CFG_OR1_PRELIM;
-       memctl->memc_br1 = CFG_BR1_PRELIM;
+       memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM;
+       memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM;
 
        /*-------------------------------------------------------------------*/
        /* Wait at least 200 usec for DRAM to stabilize, this magic number   */
@@ -207,8 +209,8 @@ long int initdram (int board_type)
 
        memctl->memc_mamr = (memctl->memc_mamr | 0x04) & ~0x08;
 
-       memctl->memc_br1 = CFG_BR1_PRELIM;
-       memctl->memc_or1 = CFG_OR1_PRELIM;
+       memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM;
+       memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM;
 
        /*---------------------------------------------------------------------*/
        /* run MRS command in location 5-8 of UPMB.                            */
@@ -234,7 +236,7 @@ long int initdram (int board_type)
        /*---------------------------------------------------------------------*/
        /* rerstore MBMR value (4-beat refresh burst.)                         */
        /*---------------------------------------------------------------------*/
-       memctl->memc_mamr = CFG_MAMR_VAL | 0x00800000; /* Bit 8 := "1" Refresh Enable WV */
+       memctl->memc_mamr = CONFIG_SYS_MAMR_VAL | 0x00800000; /* Bit 8 := "1" Refresh Enable WV */
 
        udelay(200);
 
@@ -249,17 +251,20 @@ int misc_init_r (void)
        /*
         * Make sure that RTC has clock output enabled (triggers watchdog!)
         */
-       val = i2c_reg_read (CFG_I2C_RTC_ADDR, 0x0D);
+       val = i2c_reg_read (CONFIG_SYS_I2C_RTC_ADDR, 0x0D);
        val |= 0x80;
-       i2c_reg_write (CFG_I2C_RTC_ADDR, 0x0D, val);
+       i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, 0x0D, val);
 
        /*
         * Configure PHY to setup LED's correctly and use 100MBit, FD
         */
        mii_init();
 
-       miiphy_write(0, PHY_BMCR, 0x2100);    /* disable auto-negotiation, 100mbit, full-duplex */
-       miiphy_write(0, PHY_FCSCR, 0x4122);   /* set LED's to Link, Transmit, Receive           */
+       /* disable auto-negotiation, 100mbit, full-duplex */
+       fec8xx_miiphy_write(NULL, 0, PHY_BMCR, 0x2100);
+
+       /* set LED's to Link, Transmit, Receive           */
+       fec8xx_miiphy_write(NULL,  0, PHY_FCSCR, 0x4122);
 
        return 0;
 }