blob: c42635b705ba99bd285cee21526c012cdb32c993 [file] [log] [blame]
Po-Yu Chuang5614a4d2009-11-11 17:27:30 +08001/*
2 * (C) Copyright 2009 Faraday Technology
3 * Po-Yu Chuang <ratbert@faraday-tech.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Po-Yu Chuang5614a4d2009-11-11 17:27:30 +08006 */
7
8#include <common.h>
9#include <netdev.h>
10#include <asm/io.h>
11
Macpaul Lind204d622011-04-15 21:37:11 +000012#include <faraday/ftsmc020.h>
Po-Yu Chuang5614a4d2009-11-11 17:27:30 +080013
14DECLARE_GLOBAL_DATA_PTR;
15
16/*
17 * Miscellaneous platform dependent initialisations
18 */
19
20int board_init(void)
21{
Po-Yu Chuang5614a4d2009-11-11 17:27:30 +080022 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
23
24 ftsmc020_init(); /* initialize Flash */
25 return 0;
26}
27
28int 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
Po-Yu Chuangc78522a2010-12-19 23:07:23 +000036 gd->ram_size = actual_size;
Po-Yu Chuang5614a4d2009-11-11 17:27:30 +080037
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
45int board_eth_init(bd_t *bd)
46{
47 return ftmac100_initialize(bd);
48}
49
50ulong 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}