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>
This commit is contained in:
Enrico Leto 2024-01-24 15:43:53 +01:00 committed by Tom Rini
parent 671be9f539
commit d89a97ef94
13 changed files with 64 additions and 90 deletions

View File

@ -33,6 +33,7 @@
#include <cpsw.h> #include <cpsw.h>
#include <watchdog.h> #include <watchdog.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include "board_am335x.h"
#include "eeprom.h" #include "eeprom.h"
#include "factoryset.h" #include "factoryset.h"
@ -56,7 +57,7 @@ void set_mux_conf_regs(void)
gd->have_console = 1; gd->have_console = 1;
siemens_ee_setup(); siemens_ee_setup();
if (read_eeprom() < 0) if (draco_read_eeprom() < 0)
puts("Could not get board ID.\n"); puts("Could not get board ID.\n");
enable_board_pin_mux(); enable_board_pin_mux();
@ -64,8 +65,8 @@ void set_mux_conf_regs(void)
void sdram_init(void) void sdram_init(void)
{ {
spl_siemens_board_init(); spl_draco_board_init();
board_init_ddr(); draco_init_ddr();
return; return;
} }

View File

@ -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_ */

View File

@ -14,6 +14,7 @@ obj-y := mux.o
endif endif
obj-y += board.o obj-y += board.o
obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o obj-y += ../common/factoryset.o

View File

@ -159,7 +159,7 @@ static int draco_read_nand_geometry(void)
/* /*
* Read header information from EEPROM into global structure. * Read header information from EEPROM into global structure.
*/ */
static int read_eeprom(void) int draco_read_eeprom(void)
{ {
/* Read Siemens eeprom data (DDR3) */ /* Read Siemens eeprom data (DDR3) */
if (siemens_ee_read_data(SIEMENS_EE_ADDR_DDR3, (uchar *)&settings.ddr3, if (siemens_ee_read_data(SIEMENS_EE_ADDR_DDR3, (uchar *)&settings.ddr3,
@ -195,7 +195,7 @@ static int read_eeprom(void)
return draco_read_nand_geometry(); return draco_read_nand_geometry();
} }
static void board_init_ddr(void) void draco_init_ddr(void)
{ {
struct emif_regs draco_ddr3_emif_reg_data = { struct emif_regs draco_ddr3_emif_reg_data = {
.zq_config = 0x50074BE4, .zq_config = 0x50074BE4,
@ -242,7 +242,7 @@ struct ctrl_ioregs draco_ddr3_ioregs = {
&draco_ddr3_cmd_ctrl_data, &draco_ddr3_emif_reg_data, 0); &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; return;
} }
@ -357,5 +357,3 @@ U_BOOT_CMD(
); );
#endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */ #endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */
#endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */ #endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */
#include "../common/board.c"

View File

@ -1,19 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0+ */ /* SPDX-License-Identifier: GPL-2.0+ */
/* /*
* board.h * Board definitions for draco products
* *
* (C) Copyright 2013 Siemens Schweiz AG * (C) Copyright 2013 Siemens Schweiz AG
* (C) Heiko Schocher, DENX Software Engineering, hs@denx.de. * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
* *
* Based on: * TI am335x specifics moved to ../common/board_am335x.h
* 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_ #ifndef _BOARD_DRACO_H_
#define _BOARD_H_ #define _BOARD_DRACO_H_
#define PARGS(x) #x , /* Parameter Name */ \ #define PARGS(x) #x , /* Parameter Name */ \
settings.ddr3.x, /* EEPROM Value */ \ settings.ddr3.x, /* EEPROM Value */ \
@ -58,21 +54,4 @@ struct draco_baseboard_id {
struct chip_data chip; struct chip_data chip;
}; };
/* #endif /* _BOARD_DRACO_H_ */
* 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

View File

@ -1,5 +1,5 @@
PXM2 BOARD PXM2 BOARD
M: Samuel Egli <samuel.egli@siemens.com> M: Enrico Leto <enrico.leto@siemens.com>
S: Maintained S: Maintained
F: board/siemens/pxm2/ F: board/siemens/pxm2/
F: include/configs/pxm2.h F: include/configs/pxm2.h

View File

@ -14,6 +14,7 @@ obj-y := mux.o
endif endif
obj-y += board.o obj-y += board.o
obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o obj-y += ../common/factoryset.o

View File

@ -35,7 +35,7 @@
#include <miiphy.h> #include <miiphy.h>
#include <cpsw.h> #include <cpsw.h>
#include <watchdog.h> #include <watchdog.h>
#include "board.h" #include "../common/board_am335x.h"
#include "../common/eeprom.h" #include "../common/eeprom.h"
#include "../common/factoryset.h" #include "../common/factoryset.h"
#include "pmic.h" #include "pmic.h"
@ -43,7 +43,7 @@
#include <bmp_layout.h> #include <bmp_layout.h>
#ifdef CONFIG_SPL_BUILD #ifdef CONFIG_SPL_BUILD
static void board_init_ddr(void) void draco_init_ddr(void)
{ {
struct emif_regs pxm2_ddr3_emif_reg_data = { struct emif_regs pxm2_ddr3_emif_reg_data = {
.sdram_config = 0x41805332, .sdram_config = 0x41805332,
@ -135,7 +135,7 @@ int voltage_update(unsigned int module, unsigned char vddx_op_vol_sel)
const struct dpll_params dpll_mpu_pxm2 = { const struct dpll_params dpll_mpu_pxm2 = {
720, OSC-1, 1, -1, -1, -1, -1}; 720, OSC-1, 1, -1, -1, -1, -1};
void spl_siemens_board_init(void) void spl_draco_board_init(void)
{ {
uchar buf[4]; uchar buf[4];
/* /*
@ -162,7 +162,7 @@ void spl_siemens_board_init(void)
} }
} }
int read_eeprom(void) int draco_read_eeprom(void)
{ {
/* nothing ToDo here for this board */ /* nothing ToDo here for this board */
@ -275,5 +275,3 @@ int board_late_init(void)
return 0; return 0;
} }
#endif #endif
#include "../common/board.c"

View File

@ -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

View File

@ -1,5 +1,5 @@
RUT BOARD RUT BOARD
M: Samuel Egli <samuel.egli@siemens.com> M: Enrico Leto <enrico.leto@siemens.com>
S: Maintained S: Maintained
F: board/siemens/rut/ F: board/siemens/rut/
F: include/configs/rut.h F: include/configs/rut.h

View File

@ -14,6 +14,7 @@ obj-y := mux.o
endif endif
obj-y += board.o obj-y += board.o
obj-y += ../common/board_am335x.o
obj-y += ../common/eeprom.o obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o obj-y += ../common/factoryset.o

View File

@ -35,7 +35,7 @@
#include <video.h> #include <video.h>
#include <watchdog.h> #include <watchdog.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "board.h" #include "../common/board_am335x.h"
#include "../common/eeprom.h" #include "../common/eeprom.h"
#include "../common/factoryset.h" #include "../common/factoryset.h"
@ -43,12 +43,12 @@
/* /*
* Read header information from EEPROM into global structure. * Read header information from EEPROM into global structure.
*/ */
static int read_eeprom(void) int draco_read_eeprom(void)
{ {
return 0; return 0;
} }
static void board_init_ddr(void) void draco_init_ddr(void)
{ {
struct emif_regs rut_ddr3_emif_reg_data = { struct emif_regs rut_ddr3_emif_reg_data = {
.sdram_config = 0x61C04AB2, .sdram_config = 0x61C04AB2,
@ -125,7 +125,7 @@ err:
#define REQUEST_AND_PULSE_RESET(N) \ #define REQUEST_AND_PULSE_RESET(N) \
request_and_pulse_reset(N, #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(ETH_PHY_RESET_GPIO);
REQUEST_AND_PULSE_RESET(MAXTOUCH_RESET_GPIO); REQUEST_AND_PULSE_RESET(MAXTOUCH_RESET_GPIO);
@ -245,5 +245,3 @@ int board_late_init(void)
return 0; return 0;
} }
#endif #endif
#include "../common/board.c"

View File

@ -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