imx27lite.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2007 Sascha Hauer, Pengutronix
  3. * Copyright (C) 2008,2009 Eric Jarrige <jorasse@users.sourceforge.net>
  4. * Copyright (C) 2009 Ilya Yanok <yanok@emcraft.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. *
  21. */
  22. #include <common.h>
  23. #include <asm/io.h>
  24. #include <asm/arch/imx-regs.h>
  25. #include <asm/gpio.h>
  26. DECLARE_GLOBAL_DATA_PTR;
  27. int board_init(void)
  28. {
  29. #if defined(CONFIG_SYS_NAND_LARGEPAGE)
  30. struct system_control_regs *sc_regs =
  31. (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
  32. #endif
  33. gd->bd->bi_arch_number = MACH_TYPE_IMX27LITE;
  34. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  35. #ifdef CONFIG_MXC_UART
  36. mx27_uart1_init_pins();
  37. #endif
  38. #ifdef CONFIG_FEC_MXC
  39. mx27_fec_init_pins();
  40. imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
  41. gpio_set_value(GPIO_PORTC | 31, 1);
  42. #endif
  43. #ifdef CONFIG_MXC_MMC
  44. #if defined(CONFIG_MAGNESIUM)
  45. mx27_sd1_init_pins();
  46. #else
  47. mx27_sd2_init_pins();
  48. #endif
  49. #endif
  50. #if defined(CONFIG_SYS_NAND_LARGEPAGE)
  51. /*
  52. * set in FMCR NF_FMS Bit(5) to 1
  53. * (NAND Flash with 2 Kbyte page size)
  54. */
  55. writel(readl(&sc_regs->fmcr) | (1 << 5), &sc_regs->fmcr);
  56. #endif
  57. return 0;
  58. }
  59. int dram_init(void)
  60. {
  61. /* dram_init must store complete ramsize in gd->ram_size */
  62. gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
  63. PHYS_SDRAM_1_SIZE);
  64. return 0;
  65. }
  66. void dram_init_banksize(void)
  67. {
  68. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  69. gd->bd->bi_dram[0].size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
  70. PHYS_SDRAM_1_SIZE);
  71. #if CONFIG_NR_DRAM_BANKS > 1
  72. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  73. gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2,
  74. PHYS_SDRAM_2_SIZE);
  75. #endif
  76. }
  77. int checkboard(void)
  78. {
  79. puts("Board: ");
  80. puts(CONFIG_BOARDNAME);
  81. return 0;
  82. }