1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
12 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
15 #include <asm/global_data.h>
17 #include <faraday/ftsmc020.h>
22 DECLARE_GLOBAL_DATA_PTR;
24 extern phys_addr_t prior_stage_fdt_address;
26 * Miscellaneous platform dependent initializations
31 gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
38 return fdtdec_setup_mem_size_base();
41 int dram_init_banksize(void)
43 return fdtdec_setup_memory_banksize();
46 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
47 int board_eth_init(struct bd_info *bd)
49 return ftmac100_initialize(bd);
53 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
58 void *board_fdt_blob_setup(void)
60 return (void *)CONFIG_SYS_FDT_BASE;
66 const char *compat = "andestech,atfsmc020";
67 void *blob = (void *)gd->fdt_blob;
69 struct ftsmc020_bank *regs;
71 node = fdt_node_offset_by_compatible(blob, -1, compat);
73 return -FDT_ERR_NOTFOUND;
75 addr = fdtdec_get_addr_size_auto_noparent(blob, node,
76 "reg", 0, NULL, false);
78 if (addr == FDT_ADDR_T_NONE)
81 regs = (struct ftsmc020_bank *)addr;
82 regs->cr &= ~FTSMC020_BANK_WPROT;
87 static void v5l2_init(void)
91 uclass_get_device(UCLASS_CACHE, 0, &dev);
94 #ifdef CONFIG_BOARD_EARLY_INIT_F
95 int board_early_init_f(void)
105 void board_boot_order(u32 *spl_boot_list)
108 u32 boot_devices[] = {
109 #ifdef CONFIG_SPL_RAM_SUPPORT
112 #ifdef CONFIG_SPL_MMC_SUPPORT
117 for (i = 0; i < ARRAY_SIZE(boot_devices); i++)
118 spl_boot_list[i] = boot_devices[i];
122 #ifdef CONFIG_SPL_LOAD_FIT
123 int board_fit_config_name_match(const char *name)
125 /* boot using first FIT config */