]> git.sur5r.net Git - u-boot/blobdiff - board/tqc/tqm5200/tqm5200.c
i2c: Drop use of CONFIG_I2C_HARD
[u-boot] / board / tqc / tqm5200 / tqm5200.c
index d5a8a979d5ea015432a3919ffe5a95cbdc350fea..c48ab11fc41922c19d481756295793ef6c52056f 100644 (file)
@@ -8,15 +8,17 @@
  * (C) Copyright 2004-2006
  * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
  *
- * SPDX-License-Identifier:    GPL-2.0+ 
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <console.h>
 #include <mpc5xxx.h>
 #include <pci.h>
 #include <asm/processor.h>
 #include <libfdt.h>
 #include <netdev.h>
+#include <video.h>
 
 #ifdef CONFIG_VIDEO_SM501
 #include <sm501.h>
@@ -126,12 +128,12 @@ static void sdram_start (int hi_addr)
 #endif
 
 /*
- * ATTENTION: Although partially referenced initdram does NOT make real use
+ * ATTENTION: Although partially referenced dram_init does NOT make real use
  *           use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
  *           is something else than 0x00000000.
  */
 
-phys_size_t initdram (int board_type)
+int dram_init(void)
 {
        ulong dramsize = 0;
        ulong dramsize2 = 0;
@@ -250,19 +252,16 @@ phys_size_t initdram (int board_type)
        }
 
 #if defined(CONFIG_TQM5200_B)
-       return dramsize + dramsize2;
+       gd->ram_size = dramsize + dramsize2;
 #else
-       return dramsize;
+       gd->ram_size = dramsize;
 #endif /* CONFIG_TQM5200_B */
+
+       return 0;
 }
 
 int checkboard (void)
 {
-#if defined(CONFIG_AEVFIFO)
-       puts ("Board: AEVFIFO\n");
-       return 0;
-#endif
-
 #if defined(CONFIG_TQM5200S)
 # define MODULE_NAME   "TQM5200S"
 #else
@@ -271,8 +270,6 @@ int checkboard (void)
 
 #if defined(CONFIG_STK52XX)
 # define CARRIER_NAME  "STK52xx"
-#elif defined(CONFIG_TB5200)
-# define CARRIER_NAME  "TB5200"
 #elif defined(CONFIG_CAM5200)
 # define CARRIER_NAME  "CAM5200"
 #elif defined(CONFIG_FO300)
@@ -489,20 +486,14 @@ int board_early_init_f (void)
 
 static int tfp410_read_reg(int reg, uchar *buf)
 {
-       if (i2c_read(CONFIG_SYS_TFP410_ADDR, reg, 1, buf, 1) != 0) {
-               puts ("Error reading the chip.\n");
-               return 1;
-       }
-       return 0;
+       puts("Error reading the chip.\n");
+       return -ENOSYS;
 }
 
 static int tfp410_write_reg(int reg, uchar buf)
 {
-       if (i2c_write(CONFIG_SYS_TFP410_ADDR, reg, 1, &buf, 1) != 0) {
-               puts ("Error writing the chip.\n");
-               return 1;
-       }
-       return 0;
+       puts("Error writing the chip.\n");
+       return -ENOSYS;
 }
 
 typedef struct _tfp410_config {
@@ -528,12 +519,9 @@ static int charon_last_stage_init(void)
 {
        volatile struct mpc5xxx_lpb *lpb =
                (struct mpc5xxx_lpb *) MPC5XXX_LPB;
-       int     oldbus = i2c_get_bus_num();
        uchar   buf;
        int     i = 0;
 
-       i2c_set_bus_num(CONFIG_SYS_TFP410_BUS);
-
        /* check version */
        if (tfp410_read_reg(TFP410_REG_DEV_ID_H, &buf) != 0)
                return -1;
@@ -554,7 +542,6 @@ static int charon_last_stage_init(void)
                i++;
        }
        printf("TFP410 initialized.\n");
-       i2c_set_bus_num(oldbus);
 
        /* set deadcycle for cs3 to 0 */
        setbits_be32(&lpb->cs_deadcycle, 0xffffcfff);
@@ -762,7 +749,7 @@ void video_get_info_str (int line_number, char *info)
        if (line_number == 1) {
        strcpy (info, " Board: TQM5200 (TQ-Components GmbH)");
 #if defined (CONFIG_CHARON) || defined (CONFIG_FO300) || \
-       defined(CONFIG_STK52XX) || defined(CONFIG_TB5200)
+       defined(CONFIG_STK52XX)
        } else if (line_number == 2) {
 #if defined (CONFIG_CHARON)
                strcpy (info, "        on a CHARON carrier board");
@@ -770,9 +757,6 @@ void video_get_info_str (int line_number, char *info)
 #if defined (CONFIG_STK52XX)
                strcpy (info, "        on a STK52xx carrier board");
 #endif
-#if defined (CONFIG_TB5200)
-               strcpy (info, "        on a TB5200 carrier board");
-#endif
 #if defined (CONFIG_FO300)
                strcpy (info, "        on a FO300 carrier board");
 #endif
@@ -863,12 +847,14 @@ int board_get_height (void)
 #endif /* CONFIG_VIDEO_SM501 */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #if defined(CONFIG_VIDEO)
        fdt_add_edid(blob, "smi,sm501", edid_buf);
 #endif
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */