siemens: board: clean up products folders vs common
The common folder was initialially created for the common parts of the
products based on draco-am355x board family. These are the product lines
'pxm2', 'rut' and the base line named 'draco'!
Adding the new capricorn-imx8 board family, common was enhanced without
cleanup.
- rename 'common/board.c' to 'common/board_am335x.c'
- add 'common/board_am335x.h' for export to the product lines
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
diff --git a/board/siemens/common/board.c b/board/siemens/common/board_am335x.c
similarity index 97%
rename from board/siemens/common/board.c
rename to board/siemens/common/board_am335x.c
index e5a42d7..c55ca98 100644
--- a/board/siemens/common/board.c
+++ b/board/siemens/common/board_am335x.c
@@ -33,6 +33,7 @@
#include <cpsw.h>
#include <watchdog.h>
#include <asm/mach-types.h>
+#include "board_am335x.h"
#include "eeprom.h"
#include "factoryset.h"
@@ -56,7 +57,7 @@
gd->have_console = 1;
siemens_ee_setup();
- if (read_eeprom() < 0)
+ if (draco_read_eeprom() < 0)
puts("Could not get board ID.\n");
enable_board_pin_mux();
@@ -64,8 +65,8 @@
void sdram_init(void)
{
- spl_siemens_board_init();
- board_init_ddr();
+ spl_draco_board_init();
+ draco_init_ddr();
return;
}
diff --git a/board/siemens/common/board_am335x.h b/board/siemens/common/board_am335x.h
new file mode 100644
index 0000000..3a20352
--- /dev/null
+++ b/board/siemens/common/board_am335x.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Board definitions for draco products
+ *
+ * (C) Copyright 2013 Siemens Schweiz AG
+ * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * Based on:
+ * TI AM335x boards information header
+ * u-boot:/board/ti/am335x/board.h
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ */
+
+#ifndef _BOARD_AM335X_H_
+#define _BOARD_AM335X_H_
+
+#include "eeprom.h"
+
+/* Common functions with product specific implementation */
+void spl_draco_board_init(void);
+void draco_init_ddr(void);
+int draco_read_eeprom(void);
+
+#ifdef CONFIG_SPL_BUILD
+/* Mux for init: uart?, i2c0 to read the main EEPROM */
+void enable_uart0_pin_mux(void);
+void enable_uart1_pin_mux(void);
+void enable_uart2_pin_mux(void);
+void enable_uart3_pin_mux(void);
+void enable_uart4_pin_mux(void);
+void enable_uart5_pin_mux(void);
+void enable_i2c0_pin_mux(void);
+
+/* Main mux function to enable other pinmux required on the board */
+void enable_board_pin_mux(void);
+#endif /* CONFIG_SPL_BUILD */
+
+#endif /* _BOARD_AM335X_H_ */
diff --git a/board/siemens/draco/Makefile b/board/siemens/draco/Makefile
index 1d0cb82..aae5364 100644
--- a/board/siemens/draco/Makefile
+++ b/board/siemens/draco/Makefile
@@ -14,6 +14,7 @@
endif
obj-y += board.o
+obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o
diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c
index d108d3e..2412a04 100644
--- a/board/siemens/draco/board.c
+++ b/board/siemens/draco/board.c
@@ -159,7 +159,7 @@
/*
* Read header information from EEPROM into global structure.
*/
-static int read_eeprom(void)
+int draco_read_eeprom(void)
{
/* Read Siemens eeprom data (DDR3) */
if (siemens_ee_read_data(SIEMENS_EE_ADDR_DDR3, (uchar *)&settings.ddr3,
@@ -195,7 +195,7 @@
return draco_read_nand_geometry();
}
-static void board_init_ddr(void)
+void draco_init_ddr(void)
{
struct emif_regs draco_ddr3_emif_reg_data = {
.zq_config = 0x50074BE4,
@@ -242,7 +242,7 @@
&draco_ddr3_cmd_ctrl_data, &draco_ddr3_emif_reg_data, 0);
}
-static void spl_siemens_board_init(void)
+void spl_draco_board_init(void)
{
return;
}
@@ -357,5 +357,3 @@
);
#endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */
#endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */
-
-#include "../common/board.c"
diff --git a/board/siemens/draco/board.h b/board/siemens/draco/board.h
index f027427..935f340 100644
--- a/board/siemens/draco/board.h
+++ b/board/siemens/draco/board.h
@@ -1,19 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
- * board.h
+ * Board definitions for draco products
*
* (C) Copyright 2013 Siemens Schweiz AG
* (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
*
- * Based on:
- * TI AM335x boards information header
- * u-boot:/board/ti/am335x/board.h
- *
- * Copyright (C) 2011, Texas Instruments, Incorporated - https://www.ti.com/
+ * TI am335x specifics moved to ../common/board_am335x.h
*/
-#ifndef _BOARD_H_
-#define _BOARD_H_
+#ifndef _BOARD_DRACO_H_
+#define _BOARD_DRACO_H_
#define PARGS(x) #x , /* Parameter Name */ \
settings.ddr3.x, /* EEPROM Value */ \
@@ -58,21 +54,4 @@
struct chip_data chip;
};
-/*
- * We have three pin mux functions that must exist. We must be able to enable
- * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
- * main pinmux function that can be overridden to enable all other pinmux that
- * is required on the board.
- */
-void enable_uart0_pin_mux(void);
-void enable_uart1_pin_mux(void);
-void enable_uart2_pin_mux(void);
-void enable_uart3_pin_mux(void);
-void enable_uart4_pin_mux(void);
-void enable_uart5_pin_mux(void);
-void enable_i2c0_pin_mux(void);
-void enable_board_pin_mux(void);
-
-/* Forwared declaration, defined in common board.c */
-void set_env_gpios(unsigned char state);
-#endif
+#endif /* _BOARD_DRACO_H_ */
diff --git a/board/siemens/pxm2/MAINTAINERS b/board/siemens/pxm2/MAINTAINERS
index dc02fe8..4902544 100644
--- a/board/siemens/pxm2/MAINTAINERS
+++ b/board/siemens/pxm2/MAINTAINERS
@@ -1,5 +1,5 @@
PXM2 BOARD
-M: Samuel Egli <samuel.egli@siemens.com>
+M: Enrico Leto <enrico.leto@siemens.com>
S: Maintained
F: board/siemens/pxm2/
F: include/configs/pxm2.h
diff --git a/board/siemens/pxm2/Makefile b/board/siemens/pxm2/Makefile
index 1d0cb82..aae5364 100644
--- a/board/siemens/pxm2/Makefile
+++ b/board/siemens/pxm2/Makefile
@@ -14,6 +14,7 @@
endif
obj-y += board.o
+obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o
diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c
index 16b0d3d..bff6d20 100644
--- a/board/siemens/pxm2/board.c
+++ b/board/siemens/pxm2/board.c
@@ -35,7 +35,7 @@
#include <miiphy.h>
#include <cpsw.h>
#include <watchdog.h>
-#include "board.h"
+#include "../common/board_am335x.h"
#include "../common/eeprom.h"
#include "../common/factoryset.h"
#include "pmic.h"
@@ -43,7 +43,7 @@
#include <bmp_layout.h>
#ifdef CONFIG_SPL_BUILD
-static void board_init_ddr(void)
+void draco_init_ddr(void)
{
struct emif_regs pxm2_ddr3_emif_reg_data = {
.sdram_config = 0x41805332,
@@ -135,7 +135,7 @@
const struct dpll_params dpll_mpu_pxm2 = {
720, OSC-1, 1, -1, -1, -1, -1};
-void spl_siemens_board_init(void)
+void spl_draco_board_init(void)
{
uchar buf[4];
/*
@@ -162,7 +162,7 @@
}
}
-int read_eeprom(void)
+int draco_read_eeprom(void)
{
/* nothing ToDo here for this board */
@@ -275,5 +275,3 @@
return 0;
}
#endif
-
-#include "../common/board.c"
diff --git a/board/siemens/pxm2/board.h b/board/siemens/pxm2/board.h
deleted file mode 100644
index 9067e4d..0000000
--- a/board/siemens/pxm2/board.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * board.h
- *
- * (C) Copyright 2013 Siemens Schweiz AG
- * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * Based on:
- * TI AM335x boards information header
- * u-boot:/board/ti/am335x/board.h
- *
- * Copyright (C) 2011, Texas Instruments, Incorporated - https://www.ti.com/
- */
-
-#ifndef _BOARD_H_
-#define _BOARD_H_
-
-void enable_uart0_pin_mux(void);
-void enable_i2c0_pin_mux(void);
-void enable_board_pin_mux(void);
-#endif
diff --git a/board/siemens/rut/MAINTAINERS b/board/siemens/rut/MAINTAINERS
index 1e92710..4d8e256 100644
--- a/board/siemens/rut/MAINTAINERS
+++ b/board/siemens/rut/MAINTAINERS
@@ -1,5 +1,5 @@
RUT BOARD
-M: Samuel Egli <samuel.egli@siemens.com>
+M: Enrico Leto <enrico.leto@siemens.com>
S: Maintained
F: board/siemens/rut/
F: include/configs/rut.h
diff --git a/board/siemens/rut/Makefile b/board/siemens/rut/Makefile
index 1d0cb82..aae5364 100644
--- a/board/siemens/rut/Makefile
+++ b/board/siemens/rut/Makefile
@@ -14,6 +14,7 @@
endif
obj-y += board.o
+obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o
diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c
index d9e84db..1e0e131 100644
--- a/board/siemens/rut/board.c
+++ b/board/siemens/rut/board.c
@@ -35,7 +35,7 @@
#include <video.h>
#include <watchdog.h>
#include <linux/delay.h>
-#include "board.h"
+#include "../common/board_am335x.h"
#include "../common/eeprom.h"
#include "../common/factoryset.h"
@@ -43,12 +43,12 @@
/*
* Read header information from EEPROM into global structure.
*/
-static int read_eeprom(void)
+int draco_read_eeprom(void)
{
return 0;
}
-static void board_init_ddr(void)
+void draco_init_ddr(void)
{
struct emif_regs rut_ddr3_emif_reg_data = {
.sdram_config = 0x61C04AB2,
@@ -125,7 +125,7 @@
#define REQUEST_AND_PULSE_RESET(N) \
request_and_pulse_reset(N, #N);
-static void spl_siemens_board_init(void)
+void spl_draco_board_init(void)
{
REQUEST_AND_PULSE_RESET(ETH_PHY_RESET_GPIO);
REQUEST_AND_PULSE_RESET(MAXTOUCH_RESET_GPIO);
@@ -245,5 +245,3 @@
return 0;
}
#endif
-
-#include "../common/board.c"
diff --git a/board/siemens/rut/board.h b/board/siemens/rut/board.h
deleted file mode 100644
index 9067e4d..0000000
--- a/board/siemens/rut/board.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * board.h
- *
- * (C) Copyright 2013 Siemens Schweiz AG
- * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * Based on:
- * TI AM335x boards information header
- * u-boot:/board/ti/am335x/board.h
- *
- * Copyright (C) 2011, Texas Instruments, Incorporated - https://www.ti.com/
- */
-
-#ifndef _BOARD_H_
-#define _BOARD_H_
-
-void enable_uart0_pin_mux(void);
-void enable_i2c0_pin_mux(void);
-void enable_board_pin_mux(void);
-#endif