forked from u-boot/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSCC: Add board support for Serval SoC family.
Add board support and configuration for Jaguar2 SoC family. The detection of the board type is based on the phy ids. Signed-off-by: Horatiu Vultur <[email protected]> Reviewed-by: Daniel Schwierzeck <[email protected]>
- Loading branch information
1 parent
6621288
commit a834cb8
Showing
6 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
|
||
config SYS_VENDOR | ||
default "mscc" | ||
|
||
if SOC_SERVAL | ||
|
||
config SYS_BOARD | ||
default "serval" | ||
|
||
config SYS_CONFIG_NAME | ||
default "serval" | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
|
||
obj-$(CONFIG_SOC_SERVAL) := serval.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
/* | ||
* Copyright (c) 2018 Microsemi Corporation | ||
*/ | ||
|
||
#include <common.h> | ||
#include <asm/io.h> | ||
#include <led.h> | ||
|
||
enum { | ||
BOARD_TYPE_PCB106 = 0xAABBCD00, | ||
BOARD_TYPE_PCB105, | ||
}; | ||
|
||
int board_early_init_r(void) | ||
{ | ||
/* Prepare SPI controller to be used in master mode */ | ||
writel(0, BASE_CFG + ICPU_SW_MODE); | ||
|
||
/* Address of boot parameters */ | ||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE; | ||
|
||
/* LED setup */ | ||
if (IS_ENABLED(CONFIG_LED)) | ||
led_default_state(); | ||
|
||
return 0; | ||
} | ||
|
||
static void do_board_detect(void) | ||
{ | ||
u16 gpio_in_reg; | ||
|
||
/* Set MDIO and MDC */ | ||
mscc_gpio_set_alternate(9, 2); | ||
mscc_gpio_set_alternate(10, 2); | ||
|
||
/* Set GPIO page */ | ||
mscc_phy_wr(1, 16, 31, 0x10); | ||
if (!mscc_phy_rd(1, 16, 15, &gpio_in_reg)) { | ||
if (gpio_in_reg & 0x200) | ||
gd->board_type = BOARD_TYPE_PCB106; | ||
else | ||
gd->board_type = BOARD_TYPE_PCB105; | ||
mscc_phy_wr(1, 16, 15, 0); | ||
} else { | ||
gd->board_type = BOARD_TYPE_PCB105; | ||
} | ||
} | ||
|
||
#if defined(CONFIG_MULTI_DTB_FIT) | ||
int board_fit_config_name_match(const char *name) | ||
{ | ||
if (gd->board_type == BOARD_TYPE_PCB106 && | ||
strcmp(name, "serval_pcb106") == 0) | ||
return 0; | ||
|
||
if (gd->board_type == BOARD_TYPE_PCB105 && | ||
strcmp(name, "serval_pcb105") == 0) | ||
return 0; | ||
|
||
return -1; | ||
} | ||
#endif | ||
|
||
#if defined(CONFIG_DTB_RESELECT) | ||
int embedded_dtb_select(void) | ||
{ | ||
do_board_detect(); | ||
fdtdec_setup(); | ||
|
||
return 0; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
CONFIG_MIPS=y | ||
CONFIG_SYS_TEXT_BASE=0x40000000 | ||
CONFIG_SYS_MALLOC_F_LEN=0x2000 | ||
CONFIG_ARCH_MSCC=y | ||
CONFIG_SOC_SERVAL=y | ||
CONFIG_DDRTYPE_H5TQ1G63BFA=y | ||
CONFIG_SYS_LITTLE_ENDIAN=y | ||
CONFIG_FIT=y | ||
CONFIG_BOOTDELAY=3 | ||
CONFIG_USE_BOOTARGS=y | ||
CONFIG_BOOTARGS="console=ttyS0,115200" | ||
CONFIG_LOGLEVEL=7 | ||
CONFIG_DISPLAY_CPUINFO=y | ||
CONFIG_SYS_PROMPT="serval # " | ||
# CONFIG_CMD_BDI is not set | ||
# CONFIG_CMD_CONSOLE is not set | ||
# CONFIG_CMD_ELF is not set | ||
# CONFIG_CMD_EXPORTENV is not set | ||
# CONFIG_CMD_IMPORTENV is not set | ||
# CONFIG_CMD_CRC32 is not set | ||
CONFIG_CMD_MD5SUM=y | ||
CONFIG_CMD_MEMINFO=y | ||
CONFIG_CMD_MEMTEST=y | ||
# CONFIG_CMD_FLASH is not set | ||
CONFIG_CMD_GPIO=y | ||
CONFIG_CMD_SF=y | ||
CONFIG_CMD_SPI=y | ||
# CONFIG_CMD_NFS is not set | ||
CONFIG_CMD_MTDPARTS=y | ||
CONFIG_MTDIDS_DEFAULT="nor0=spi_flash" | ||
CONFIG_MTDPARTS_DEFAULT="mtdparts=spi_flash:1m(UBoot),256k(Env),256k(Env.bk)" | ||
# CONFIG_ISO_PARTITION is not set | ||
CONFIG_DEFAULT_DEVICE_TREE="serval_pcb106" | ||
CONFIG_OF_LIST="serval_pcb106 serval_pcb105" | ||
CONFIG_DTB_RESELECT=y | ||
CONFIG_MULTI_DTB_FIT=y | ||
CONFIG_ENV_IS_IN_SPI_FLASH=y | ||
CONFIG_NET_RANDOM_ETHADDR=y | ||
CONFIG_CLK=y | ||
CONFIG_DM_GPIO=y | ||
CONFIG_MSCC_SGPIO=y | ||
CONFIG_LED=y | ||
CONFIG_LED_GPIO=y | ||
CONFIG_DM_SPI_FLASH=y | ||
CONFIG_SPI_FLASH=y | ||
CONFIG_SPI_FLASH_BAR=y | ||
CONFIG_SPI_FLASH_GIGADEVICE=y | ||
CONFIG_SPI_FLASH_MACRONIX=y | ||
CONFIG_SPI_FLASH_SPANSION=y | ||
CONFIG_SPI_FLASH_STMICRO=y | ||
CONFIG_SPI_FLASH_WINBOND=y | ||
CONFIG_SPI_FLASH_MTD=y | ||
CONFIG_DM_ETH=y | ||
CONFIG_PINCTRL=y | ||
CONFIG_PINCONF=y | ||
CONFIG_DM_SERIAL=y | ||
CONFIG_SYS_NS16550=y | ||
CONFIG_SPI=y | ||
CONFIG_DM_SPI=y | ||
CONFIG_MSCC_BB_SPI=y | ||
CONFIG_LZMA=y | ||
CONFIG_XZ=y |