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)
16 #include <faraday/ftsmc020.h>
21 DECLARE_GLOBAL_DATA_PTR;
23 extern phys_addr_t prior_stage_fdt_address;
25 * Miscellaneous platform dependent initializations
30 gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
37 return fdtdec_setup_mem_size_base();
40 int dram_init_banksize(void)
42 return fdtdec_setup_memory_banksize();
45 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
46 int board_eth_init(bd_t *bd)
48 return ftmac100_initialize(bd);
52 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
57 void *board_fdt_blob_setup(void)
59 return (void *)CONFIG_SYS_FDT_BASE;
65 const char *compat = "andestech,atfsmc020";
66 void *blob = (void *)gd->fdt_blob;
68 struct ftsmc020_bank *regs;
70 node = fdt_node_offset_by_compatible(blob, -1, compat);
72 return -FDT_ERR_NOTFOUND;
74 addr = fdtdec_get_addr(blob, node, "reg");
76 if (addr == FDT_ADDR_T_NONE)
79 regs = (struct ftsmc020_bank *)addr;
80 regs->cr &= ~FTSMC020_BANK_WPROT;
85 static void v5l2_init(void)
89 uclass_get_device(UCLASS_CACHE, 0, &dev);
92 #ifdef CONFIG_BOARD_EARLY_INIT_F
93 int board_early_init_f(void)
103 void board_boot_order(u32 *spl_boot_list)
106 u32 boot_devices[] = {
107 #ifdef CONFIG_SPL_RAM_SUPPORT
110 #ifdef CONFIG_SPL_MMC_SUPPORT
115 for (i = 0; i < ARRAY_SIZE(boot_devices); i++)
116 spl_boot_list[i] = boot_devices[i];
120 #ifdef CONFIG_SPL_LOAD_FIT
121 int board_fit_config_name_match(const char *name)
123 /* boot using first FIT config */