1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
9 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
13 #include <faraday/ftsmc020.h>
18 DECLARE_GLOBAL_DATA_PTR
;
20 extern phys_addr_t prior_stage_fdt_address
;
22 * Miscellaneous platform dependent initializations
27 gd
->bd
->bi_boot_params
= PHYS_SDRAM_0
+ 0x400;
34 return fdtdec_setup_mem_size_base();
37 int dram_init_banksize(void)
39 return fdtdec_setup_memory_banksize();
42 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
43 int board_eth_init(bd_t
*bd
)
45 return ftmac100_initialize(bd
);
49 ulong
board_flash_get_legacy(ulong base
, int banknum
, flash_info_t
*info
)
54 void *board_fdt_blob_setup(void)
56 return (void *)CONFIG_SYS_FDT_BASE
;
62 const char *compat
= "andestech,atfsmc020";
63 void *blob
= (void *)gd
->fdt_blob
;
65 struct ftsmc020_bank
*regs
;
67 node
= fdt_node_offset_by_compatible(blob
, -1, compat
);
69 return -FDT_ERR_NOTFOUND
;
71 addr
= fdtdec_get_addr(blob
, node
, "reg");
73 if (addr
== FDT_ADDR_T_NONE
)
76 regs
= (struct ftsmc020_bank
*)addr
;
77 regs
->cr
&= ~FTSMC020_BANK_WPROT
;
82 static void v5l2_init(void)
86 uclass_get_device(UCLASS_CACHE
, 0, &dev
);
89 #ifdef CONFIG_BOARD_EARLY_INIT_F
90 int board_early_init_f(void)
100 void board_boot_order(u32
*spl_boot_list
)
103 u32 boot_devices
[] = {
104 #ifdef CONFIG_SPL_RAM_SUPPORT
107 #ifdef CONFIG_SPL_MMC_SUPPORT
112 for (i
= 0; i
< ARRAY_SIZE(boot_devices
); i
++)
113 spl_boot_list
[i
] = boot_devices
[i
];
117 #ifdef CONFIG_SPL_LOAD_FIT
118 int board_fit_config_name_match(const char *name
)
120 /* boot using first FIT config */