1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
8 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
12 #include <faraday/ftsmc020.h>
17 DECLARE_GLOBAL_DATA_PTR;
19 extern phys_addr_t prior_stage_fdt_address;
21 * Miscellaneous platform dependent initializations
26 gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
33 return fdtdec_setup_mem_size_base();
36 int dram_init_banksize(void)
38 return fdtdec_setup_memory_banksize();
41 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
42 int board_eth_init(bd_t *bd)
44 return ftmac100_initialize(bd);
48 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
53 void *board_fdt_blob_setup(void)
55 return (void *)CONFIG_SYS_FDT_BASE;
61 const char *compat = "andestech,atfsmc020";
62 void *blob = (void *)gd->fdt_blob;
64 struct ftsmc020_bank *regs;
66 node = fdt_node_offset_by_compatible(blob, -1, compat);
68 return -FDT_ERR_NOTFOUND;
70 addr = fdtdec_get_addr(blob, node, "reg");
72 if (addr == FDT_ADDR_T_NONE)
75 regs = (struct ftsmc020_bank *)addr;
76 regs->cr &= ~FTSMC020_BANK_WPROT;
81 static void v5l2_init(void)
85 uclass_get_device(UCLASS_CACHE, 0, &dev);
88 #ifdef CONFIG_BOARD_EARLY_INIT_F
89 int board_early_init_f(void)
99 void board_boot_order(u32 *spl_boot_list)
102 u32 boot_devices[] = {
103 #ifdef CONFIG_SPL_RAM_SUPPORT
106 #ifdef CONFIG_SPL_MMC_SUPPORT
111 for (i = 0; i < ARRAY_SIZE(boot_devices); i++)
112 spl_boot_list[i] = boot_devices[i];
116 #ifdef CONFIG_SPL_LOAD_FIT
117 int board_fit_config_name_match(const char *name)
119 /* boot using first FIT config */