[U-Boot] [PATCH 25/51] gdsys: Introduce GDSYS_LEGACY_DRIVERS
Mario Six
mario.six at gdsys.cc
Fri Jul 14 12:55:11 UTC 2017
Future gdsys boards will switch from the legacy drivers in board/gdsys/common
to DM-based drivers.
Define a Kconfig option that disables the legacy drivers.
Signed-off-by: Mario Six <mario.six at gdsys.cc>
---
board/gdsys/common/adv7611.c | 4 ++++
board/gdsys/common/ch7301.c | 4 ++++
board/gdsys/common/dp501.c | 4 ++++
board/gdsys/common/fanctrl.c | 4 ++++
board/gdsys/common/fpga.c | 4 ++++
board/gdsys/common/ihs_mdio.c | 4 ++++
board/gdsys/common/ioep-fpga.c | 4 ++++
board/gdsys/common/mclink.c | 4 ++++
board/gdsys/common/osd.c | 4 ++++
board/gdsys/mpc8308/Kconfig | 8 ++++++++
board/gdsys/mpc8308/mpc8308.c | 2 ++
board/gdsys/p1022/Kconfig | 6 ++++++
include/gdsys_fpga.h | 2 ++
13 files changed, 54 insertions(+)
diff --git a/board/gdsys/common/adv7611.c b/board/gdsys/common/adv7611.c
index b728274cce..4ed9b09cd2 100644
--- a/board/gdsys/common/adv7611.c
+++ b/board/gdsys/common/adv7611.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <i2c.h>
@@ -175,3 +177,5 @@ out:
return res;
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/ch7301.c b/board/gdsys/common/ch7301.c
index c054e55cf7..b38b485b13 100644
--- a/board/gdsys/common/ch7301.c
+++ b/board/gdsys/common/ch7301.c
@@ -7,6 +7,8 @@
/* Chrontel CH7301C DVI Transmitter */
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <asm/io.h>
#include <errno.h>
@@ -62,3 +64,5 @@ int ch7301_probe(unsigned screen, bool power)
return 0;
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/dp501.c b/board/gdsys/common/dp501.c
index 54e7f63f69..232ea13e68 100644
--- a/board/gdsys/common/dp501.c
+++ b/board/gdsys/common/dp501.c
@@ -7,6 +7,8 @@
/* Parade Technologies Inc. DP501 DisplayPort DVI/HDMI Transmitter */
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <asm/io.h>
#include <errno.h>
@@ -156,3 +158,5 @@ int dp501_probe(unsigned screen, bool power)
return 0;
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/fanctrl.c b/board/gdsys/common/fanctrl.c
index 44569bb1ab..20bb187cdd 100644
--- a/board/gdsys/common/fanctrl.c
+++ b/board/gdsys/common/fanctrl.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <i2c.h>
@@ -30,3 +32,5 @@ void init_fan_controller(u8 addr)
val = i2c_reg_read(addr, FAN_CONFIG) | 0x04;
i2c_reg_write(addr, FAN_CONFIG, val);
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/fpga.c b/board/gdsys/common/fpga.c
index e10c105feb..cfb6a9d583 100644
--- a/board/gdsys/common/fpga.c
+++ b/board/gdsys/common/fpga.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <gdsys_fpga.h>
@@ -23,3 +25,5 @@ int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
return 0;
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/ihs_mdio.c b/board/gdsys/common/ihs_mdio.c
index 262ead5516..d67ec7d38a 100644
--- a/board/gdsys/common/ihs_mdio.c
+++ b/board/gdsys/common/ihs_mdio.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <gdsys_fpga.h>
@@ -86,3 +88,5 @@ int ihs_mdio_init(struct ihs_mdio_info *info)
return mdio_register(bus);
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/ioep-fpga.c b/board/gdsys/common/ioep-fpga.c
index f72a01e5b2..a666b93445 100644
--- a/board/gdsys/common/ioep-fpga.c
+++ b/board/gdsys/common/ioep-fpga.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <gdsys_fpga.h>
@@ -235,3 +237,5 @@ void ioep_fpga_print_info(unsigned int fpga)
printf(", %d video channel(s)\n", feature_video_channels);
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/mclink.c b/board/gdsys/common/mclink.c
index 9f230c9a97..6b1faf4696 100644
--- a/board/gdsys/common/mclink.c
+++ b/board/gdsys/common/mclink.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <asm/io.h>
#include <errno.h>
@@ -135,3 +137,5 @@ int mclink_receive(u8 slave, u16 addr, u16 *data)
return 0;
}
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index add9574369..60e7f460a7 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
#include <common.h>
#include <i2c.h>
#include <malloc.h>
@@ -498,3 +500,5 @@ U_BOOT_CMD(
"size_x(max. " __stringify(MAX_X_CHARS)
") size_y(max. " __stringify(MAX_Y_CHARS) ")\n"
);
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
\ No newline at end of file
diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
index c0247214a9..e913e94b3a 100644
--- a/board/gdsys/mpc8308/Kconfig
+++ b/board/gdsys/mpc8308/Kconfig
@@ -1,3 +1,5 @@
+config GDSYS_LEGACY_DRIVERS
+ bool
config SYS_FPGA0_BASE
hex
@@ -32,6 +34,9 @@ config SYS_VENDOR
config SYS_CONFIG_NAME
default "hrcon"
+config GDSYS_LEGACY_DRIVERS
+ default y
+
endif
if TARGET_STRIDER
@@ -45,6 +50,9 @@ config SYS_VENDOR
config SYS_CONFIG_NAME
default "strider"
+config GDSYS_LEGACY_DRIVERS
+ default y
+
endif
config CMD_IOLOOP
diff --git a/board/gdsys/mpc8308/mpc8308.c b/board/gdsys/mpc8308/mpc8308.c
index 8d6a49f86a..3b57494493 100644
--- a/board/gdsys/mpc8308/mpc8308.c
+++ b/board/gdsys/mpc8308/mpc8308.c
@@ -25,6 +25,7 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
/* as gpio output status cannot be read back, we have to buffer it locally */
u32 gpio0_out;
@@ -117,3 +118,4 @@ int board_early_init_r(void)
return 0;
}
+#endif
diff --git a/board/gdsys/p1022/Kconfig b/board/gdsys/p1022/Kconfig
index 8514d086b9..8fef636136 100644
--- a/board/gdsys/p1022/Kconfig
+++ b/board/gdsys/p1022/Kconfig
@@ -1,3 +1,6 @@
+config GDSYS_LEGACY_DRIVERS
+ bool
+
if TARGET_CONTROLCENTERD
config SYS_BOARD
@@ -9,4 +12,7 @@ config SYS_VENDOR
config SYS_CONFIG_NAME
default "controlcenterd"
+config GDSYS_LEGACY_DRIVERS
+ default y
+
endif
diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h
index 34d6eeb253..19a6e6ca3f 100644
--- a/include/gdsys_fpga.h
+++ b/include/gdsys_fpga.h
@@ -8,6 +8,7 @@
#ifndef __GDSYS_FPGA_H
#define __GDSYS_FPGA_H
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
int init_func_fpga(void);
enum {
@@ -34,6 +35,7 @@ extern struct ihs_fpga *fpga_ptr[];
&fpga_ptr[ix]->fld, \
offsetof(struct ihs_fpga, fld), \
val)
+#endif
struct ihs_gpio {
u16 read;
--
2.11.0
More information about the U-Boot
mailing list