]> git.sur5r.net Git - u-boot/blobdiff - post/board/lwmon/sysmon.c
common: miiphyutil: no need to check name of mii_dev
[u-boot] / post / board / lwmon / sysmon.c
index f61d598244ccb025f1bbe2f7a86812cc97872d3f..f521b27dc20ba7be1e404d17309077788c5b3081 100644 (file)
@@ -2,30 +2,12 @@
  * (C) Copyright 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <post.h>
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /*
  * SYSMON test
  *
@@ -50,7 +32,7 @@
 #include <watchdog.h>
 #include <i2c.h>
 
-#if CONFIG_POST & CFG_POST_SYSMON
+#if CONFIG_POST & CONFIG_SYS_POST_SYSMON
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -58,8 +40,6 @@ static int sysmon_temp_invalid = 0;
 
 /* #define DEBUG */
 
-#define        RELOC(x) if (x != NULL) x = (void *) ((ulong) (x) + gd->reloc_off)
-
 typedef struct sysmon_s sysmon_t;
 typedef struct sysmon_table_s sysmon_table_t;
 
@@ -78,11 +58,11 @@ struct sysmon_s
 };
 
 static sysmon_t sysmon_lm87 =
-       {CFG_I2C_SYSMON_ADDR, sysmon_lm87_init, sysmon_i2c_read};
+       {CONFIG_SYS_I2C_SYSMON_ADDR, sysmon_lm87_init, sysmon_i2c_read};
 static sysmon_t sysmon_lm87_sgn =
-       {CFG_I2C_SYSMON_ADDR, sysmon_lm87_init, sysmon_i2c_read_sgn};
+       {CONFIG_SYS_I2C_SYSMON_ADDR, sysmon_lm87_init, sysmon_i2c_read_sgn};
 static sysmon_t sysmon_pic =
-       {CFG_I2C_PICIO_ADDR, sysmon_pic_init, sysmon_i2c_read};
+       {CONFIG_SYS_I2C_PICIO_ADDR, sysmon_pic_init, sysmon_i2c_read};
 
 static sysmon_t * sysmon_list[] =
 {
@@ -137,7 +117,7 @@ static sysmon_table_t sysmon_table[] =
     {"+ 5 V standby", "V", &sysmon_pic, NULL, NULL,
      100, 1000, 0, 6040, 0xFF, 0xC8, 0xDE, 0, 0xC8, 0xDE, 0, 0x7C},
 };
-static int sysmon_table_size = sizeof(sysmon_table) / sizeof(sysmon_table[0]);
+static int sysmon_table_size = ARRAY_SIZE(sysmon_table);
 
 static int conversion_done = 0;
 
@@ -161,20 +141,7 @@ int sysmon_init_f (void)
 
 void sysmon_reloc (void)
 {
-       sysmon_t ** l;
-       sysmon_table_t * t;
-
-       for (l = sysmon_list; *l; l++) {
-               RELOC(*l);
-               RELOC((*l)->init);
-               RELOC((*l)->read);
-       }
-
-       for (t = sysmon_table; t < sysmon_table + sysmon_table_size; t ++) {
-               RELOC(t->exec_before);
-               RELOC(t->exec_after);
-               RELOC(t->sysmon);
-       }
+       /* Do nothing for now, sysmon_reloc() is required by the sysmon post */
 }
 
 static char *sysmon_unit_value (sysmon_table_t *s, uint val)
@@ -327,5 +294,4 @@ int sysmon_post_test (int flags)
        return res;
 }
 
-#endif /* CONFIG_POST & CFG_POST_SYSMON */
-#endif /* CONFIG_POST */
+#endif /* CONFIG_POST & CONFIG_SYS_POST_SYSMON */