imx27lite.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/imx-regs.h>
  11. #include <asm/gpio.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. int board_init(void)
  14. {
  15. #if defined(CONFIG_SYS_NAND_LARGEPAGE)
  16. struct system_control_regs *sc_regs =
  17. (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
  18. #endif
  19. gd->bd->bi_arch_number = MACH_TYPE_IMX27LITE;
  20. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  21. #ifdef CONFIG_MXC_UART
  22. mx27_uart1_init_pins();
  23. #endif
  24. #ifdef CONFIG_FEC_MXC
  25. mx27_fec_init_pins();
  26. imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
  27. gpio_set_value(GPIO_PORTC | 31, 1);
  28. #endif
  29. #ifdef CONFIG_MXC_MMC
  30. #if defined(CONFIG_MAGNESIUM)
  31. mx27_sd1_init_pins();
  32. #else
  33. mx27_sd2_init_pins();
  34. #endif
  35. #endif
  36. #if defined(CONFIG_SYS_NAND_LARGEPAGE)
  37. /*
  38. * set in FMCR NF_FMS Bit(5) to 1
  39. * (NAND Flash with 2 Kbyte page size)
  40. */
  41. writel(readl(&sc_regs->fmcr) | (1 << 5), &sc_regs->fmcr);
  42. #endif
  43. return 0;
  44. }
  45. int dram_init(void)
  46. {
  47. /* dram_init must store complete ramsize in gd->ram_size */
  48. gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
  49. PHYS_SDRAM_1_SIZE);
  50. return 0;
  51. }
  52. void dram_init_banksize(void)
  53. {
  54. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  55. gd->bd->bi_dram[0].size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
  56. PHYS_SDRAM_1_SIZE);
  57. #if CONFIG_NR_DRAM_BANKS > 1
  58. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  59. gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2,
  60. PHYS_SDRAM_2_SIZE);
  61. #endif
  62. }
  63. int checkboard(void)
  64. {
  65. puts("Board: ");
  66. puts(CONFIG_BOARDNAME);
  67. return 0;
  68. }