1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Andes Technology Corporation
10 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
14 #include <faraday/ftsmc020.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 extern phys_addr_t prior_stage_fdt_address;
23 * Miscellaneous platform dependent initializations
28 gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
35 return fdtdec_setup_mem_size_base();
38 int dram_init_banksize(void)
40 return fdtdec_setup_memory_banksize();
43 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
44 int board_eth_init(bd_t *bd)
46 return ftmac100_initialize(bd);
50 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
55 void *board_fdt_blob_setup(void)
57 return (void *)CONFIG_SYS_FDT_BASE;
63 const char *compat = "andestech,atfsmc020";
64 void *blob = (void *)gd->fdt_blob;
66 struct ftsmc020_bank *regs;
68 node = fdt_node_offset_by_compatible(blob, -1, compat);
70 return -FDT_ERR_NOTFOUND;
72 addr = fdtdec_get_addr(blob, node, "reg");
74 if (addr == FDT_ADDR_T_NONE)
77 regs = (struct ftsmc020_bank *)addr;
78 regs->cr &= ~FTSMC020_BANK_WPROT;
83 static void v5l2_init(void)
87 uclass_get_device(UCLASS_CACHE, 0, &dev);
90 #ifdef CONFIG_BOARD_EARLY_INIT_F
91 int board_early_init_f(void)
101 void board_boot_order(u32 *spl_boot_list)
104 u32 boot_devices[] = {
105 #ifdef CONFIG_SPL_RAM_SUPPORT
108 #ifdef CONFIG_SPL_MMC_SUPPORT
113 for (i = 0; i < ARRAY_SIZE(boot_devices); i++)
114 spl_boot_list[i] = boot_devices[i];
118 #ifdef CONFIG_SPL_LOAD_FIT
119 int board_fit_config_name_match(const char *name)
121 /* boot using first FIT config */