mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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:
parent
671be9f539
commit
d89a97ef94
13 changed files with 64 additions and 90 deletions
|
@ -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 @@ void set_mux_conf_regs(void)
|
|||
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 set_mux_conf_regs(void)
|
|||
|
||||
void sdram_init(void)
|
||||
{
|
||||
spl_siemens_board_init();
|
||||
board_init_ddr();
|
||||
spl_draco_board_init();
|
||||
draco_init_ddr();
|
||||
|
||||
return;
|
||||
}
|
39
board/siemens/common/board_am335x.h
Normal file
39
board/siemens/common/board_am335x.h
Normal 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_ */
|
|
@ -14,6 +14,7 @@ obj-y := mux.o
|
|||
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
|
||||
|
|
|
@ -159,7 +159,7 @@ static int draco_read_nand_geometry(void)
|
|||
/*
|
||||
* 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 @@ static int read_eeprom(void)
|
|||
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 @@ struct ctrl_ioregs draco_ddr3_ioregs = {
|
|||
&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 @@ U_BOOT_CMD(
|
|||
);
|
||||
#endif /* #if defined(CONFIG_DRIVER_TI_CPSW) */
|
||||
#endif /* #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) */
|
||||
|
||||
#include "../common/board.c"
|
||||
|
|
|
@ -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 draco_baseboard_id {
|
|||
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_ */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,6 +14,7 @@ obj-y := mux.o
|
|||
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
|
||||
|
|
|
@ -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 @@ int voltage_update(unsigned int module, unsigned char vddx_op_vol_sel)
|
|||
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 @@ void spl_siemens_board_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
int read_eeprom(void)
|
||||
int draco_read_eeprom(void)
|
||||
{
|
||||
/* nothing ToDo here for this board */
|
||||
|
||||
|
@ -275,5 +275,3 @@ int board_late_init(void)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "../common/board.c"
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -14,6 +14,7 @@ obj-y := mux.o
|
|||
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
|
||||
|
|
|
@ -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 @@ err:
|
|||
#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 @@ int board_late_init(void)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "../common/board.c"
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue