]>
Commit | Line | Data |
---|---|---|
43a5f0df PYC |
1 | /* |
2 | * (C) Copyright 2009 Faraday Technology | |
3 | * Po-Yu Chuang <ratbert@faraday-tech.com> | |
4 | * | |
1a459660 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
43a5f0df PYC |
6 | */ |
7 | ||
8 | #include <common.h> | |
9 | #include <netdev.h> | |
10 | #include <asm/io.h> | |
11 | ||
00d10eb0 | 12 | #include <faraday/ftsmc020.h> |
43a5f0df PYC |
13 | |
14 | DECLARE_GLOBAL_DATA_PTR; | |
15 | ||
16 | /* | |
17 | * Miscellaneous platform dependent initialisations | |
18 | */ | |
19 | ||
20 | int board_init(void) | |
21 | { | |
43a5f0df PYC |
22 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; |
23 | ||
24 | ftsmc020_init(); /* initialize Flash */ | |
25 | return 0; | |
26 | } | |
27 | ||
28 | int dram_init(void) | |
29 | { | |
30 | unsigned long sdram_base = PHYS_SDRAM_1; | |
31 | unsigned long expected_size = PHYS_SDRAM_1_SIZE; | |
32 | unsigned long actual_size; | |
33 | ||
34 | actual_size = get_ram_size((void *)sdram_base, expected_size); | |
35 | ||
5eb522a6 | 36 | gd->ram_size = actual_size; |
43a5f0df PYC |
37 | |
38 | if (expected_size != actual_size) | |
39 | printf("Warning: Only %lu of %lu MiB SDRAM is working\n", | |
40 | actual_size >> 20, expected_size >> 20); | |
41 | ||
42 | return 0; | |
43 | } | |
44 | ||
45 | int board_eth_init(bd_t *bd) | |
46 | { | |
47 | return ftmac100_initialize(bd); | |
48 | } | |
49 | ||
50 | ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) | |
51 | { | |
52 | if (banknum == 0) { /* non-CFI boot flash */ | |
53 | info->portwidth = FLASH_CFI_8BIT; | |
54 | info->chipwidth = FLASH_CFI_BY8; | |
55 | info->interface = FLASH_CFI_X8; | |
56 | return 1; | |
57 | } else | |
58 | return 0; | |
59 | } |