a320evb.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * (C) Copyright 2009 Faraday Technology
  3. * Po-Yu Chuang <ratbert@faraday-tech.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #include <common.h>
  20. #include <netdev.h>
  21. #include <asm/io.h>
  22. #include <asm/arch/ftsmc020.h>
  23. DECLARE_GLOBAL_DATA_PTR;
  24. /*
  25. * Miscellaneous platform dependent initialisations
  26. */
  27. int board_init(void)
  28. {
  29. gd->bd->bi_arch_number = MACH_TYPE_FARADAY;
  30. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  31. ftsmc020_init(); /* initialize Flash */
  32. return 0;
  33. }
  34. int dram_init(void)
  35. {
  36. unsigned long sdram_base = PHYS_SDRAM_1;
  37. unsigned long expected_size = PHYS_SDRAM_1_SIZE;
  38. unsigned long actual_size;
  39. actual_size = get_ram_size((void *)sdram_base, expected_size);
  40. gd->bd->bi_dram[0].start = sdram_base;
  41. gd->bd->bi_dram[0].size = actual_size;
  42. if (expected_size != actual_size)
  43. printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
  44. actual_size >> 20, expected_size >> 20);
  45. return 0;
  46. }
  47. int board_eth_init(bd_t *bd)
  48. {
  49. return ftmac100_initialize(bd);
  50. }
  51. ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
  52. {
  53. if (banknum == 0) { /* non-CFI boot flash */
  54. info->portwidth = FLASH_CFI_8BIT;
  55. info->chipwidth = FLASH_CFI_BY8;
  56. info->interface = FLASH_CFI_X8;
  57. return 1;
  58. } else
  59. return 0;
  60. }