blob: 9055b73ada273ba71d6f6c8b6b4a3073ac960f7e [file] [log] [blame]
Horatiu Vultur8609f2b2019-01-17 15:33:28 +01001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Microsemi Corporation
4 */
5
Tom Rinidec7ea02024-05-20 13:35:03 -06006#include <config.h>
Simon Glass2dc9c342020-05-10 11:40:01 -06007#include <image.h>
Simon Glassa7b51302019-11-14 12:57:46 -07008#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Horatiu Vultur8609f2b2019-01-17 15:33:28 +010010#include <asm/io.h>
11#include <led.h>
12
Simon Glass51a8b702020-07-19 10:15:51 -060013DECLARE_GLOBAL_DATA_PTR;
14
Horatiu Vultur8609f2b2019-01-17 15:33:28 +010015enum {
16 BOARD_TYPE_PCB116 = 0xAABBCE00,
17};
18
19int board_early_init_r(void)
20{
21 /* Prepare SPI controller to be used in master mode */
22 writel(0, BASE_CFG + ICPU_SW_MODE);
23
24 /* Address of boot parameters */
Tom Rinibb4dd962022-11-16 13:10:37 -050025 gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE;
Horatiu Vultur8609f2b2019-01-17 15:33:28 +010026
Horatiu Vultur8609f2b2019-01-17 15:33:28 +010027 return 0;
28}
29
30static void do_board_detect(void)
31{
32 gd->board_type = BOARD_TYPE_PCB116; /* ServalT */
33}
34
35#if defined(CONFIG_MULTI_DTB_FIT)
36int board_fit_config_name_match(const char *name)
37{
38 if (gd->board_type == BOARD_TYPE_PCB116 &&
39 strcmp(name, "servalt_pcb116") == 0)
40 return 0;
41 return -1;
42}
43#endif
44
45#if defined(CONFIG_DTB_RESELECT)
46int embedded_dtb_select(void)
47{
48 do_board_detect();
49 fdtdec_setup();
50
51 return 0;
52}
53#endif