1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
7 #include <asm/mach-types.h>
9 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
14 DECLARE_GLOBAL_DATA_PTR;
17 * Miscellaneous platform dependent initializations
22 gd->bd->bi_arch_number = MACH_TYPE_AE350;
23 gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
30 unsigned long sdram_base = PHYS_SDRAM_0;
31 unsigned long expected_size = PHYS_SDRAM_0_SIZE + PHYS_SDRAM_1_SIZE;
32 unsigned long actual_size;
34 actual_size = get_ram_size((void *)sdram_base, expected_size);
35 gd->ram_size = actual_size;
37 if (expected_size != actual_size) {
38 printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
39 actual_size >> 20, expected_size >> 20);
45 int dram_init_banksize(void)
47 gd->bd->bi_dram[0].start = PHYS_SDRAM_0;
48 gd->bd->bi_dram[0].size = PHYS_SDRAM_0_SIZE;
49 gd->bd->bi_dram[1].start = PHYS_SDRAM_1;
50 gd->bd->bi_dram[1].size = PHYS_SDRAM_1_SIZE;
55 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
56 int board_eth_init(bd_t *bd)
58 return ftmac100_initialize(bd);
62 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
67 void *board_fdt_blob_setup(void)
69 void **ptr = (void *)CONFIG_SYS_SDRAM_BASE;
70 if (fdt_magic(*ptr) == FDT_MAGIC)
73 return (void *)CONFIG_SYS_FDT_BASE;