board: gateworks: venice: use common GSC driver
Use the common GSC driver.
This allows us to do some additional cleanup:
- rename gsc{.c,.h} to eeprom{.c.h} for clarity
- collapse eeprom_get_dev
- remove unnecessary header files and alphabatize includes
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
index 425c690..b1828f4 100644
--- a/board/gateworks/venice/venice.c
+++ b/board/gateworks/venice/venice.c
@@ -3,21 +3,12 @@
* Copyright 2021 Gateworks Corporation
*/
-#include <common.h>
#include <init.h>
#include <led.h>
-#include <linux/delay.h>
#include <miiphy.h>
-#include <netdev.h>
-
-#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
-#include <asm/io.h>
-#include <asm/unaligned.h>
-#include "gsc.h"
-
-DECLARE_GLOBAL_DATA_PTR;
+#include "eeprom.h"
int board_phys_sdram_size(phys_size_t *size)
{
@@ -37,7 +28,7 @@
char buf[32];
do {
- dtb = gsc_get_dtb_name(i++, buf, sizeof(buf));
+ dtb = eeprom_get_dtb_name(i++, buf, sizeof(buf));
if (!strcmp(dtb, name)) {
if (!init++)
printf("DTB : %s\n", name);
@@ -100,13 +91,11 @@
int board_init(void)
{
- gsc_init(1);
+ eeprom_init(1);
if (IS_ENABLED(CONFIG_FEC_MXC))
setup_fec();
- gsc_hwmon();
-
return 0;
}
@@ -122,13 +111,13 @@
/* Set board serial/model */
if (!env_get("serial#"))
- env_set_ulong("serial#", gsc_get_serial());
- env_set("model", gsc_get_model());
+ env_set_ulong("serial#", eeprom_get_serial());
+ env_set("model", eeprom_get_model());
/* Set fdt_file vars */
i = 0;
do {
- str = gsc_get_dtb_name(i, fdt, sizeof(fdt));
+ str = eeprom_get_dtb_name(i, fdt, sizeof(fdt));
if (str) {
sprintf(env, "fdt_file%d", i + 1);
strcat(fdt, ".dtb");
@@ -146,7 +135,7 @@
sprintf(env, "ethaddr");
str = env_get(env);
if (!str) {
- ret = gsc_getmac(i, enetaddr);
+ ret = eeprom_getmac(i, enetaddr);
if (!ret)
eth_env_set_enetaddr(env, enetaddr);
}
@@ -166,7 +155,7 @@
int off;
/* set board model dt prop */
- fdt_setprop_string(blob, 0, "board", gsc_get_model());
+ fdt_setprop_string(blob, 0, "board", eeprom_get_model());
/* update temp thresholds */
off = fdt_path_offset(blob, "/thermal-zones/cpu-thermal/trips");