mx1fs2.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (C) 2004 Sascha Hauer, Pengutronix
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. *
  19. */
  20. #include <common.h>
  21. #include <asm/arch/imx-regs.h>
  22. #define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg)
  23. extern void imx_gpio_mode(int gpio_mode);
  24. static void logo_init(void)
  25. {
  26. imx_gpio_mode(PD15_PF_LD0);
  27. imx_gpio_mode(PD16_PF_LD1);
  28. imx_gpio_mode(PD17_PF_LD2);
  29. imx_gpio_mode(PD18_PF_LD3);
  30. imx_gpio_mode(PD19_PF_LD4);
  31. imx_gpio_mode(PD20_PF_LD5);
  32. imx_gpio_mode(PD21_PF_LD6);
  33. imx_gpio_mode(PD22_PF_LD7);
  34. imx_gpio_mode(PD23_PF_LD8);
  35. imx_gpio_mode(PD24_PF_LD9);
  36. imx_gpio_mode(PD25_PF_LD10);
  37. imx_gpio_mode(PD26_PF_LD11);
  38. imx_gpio_mode(PD27_PF_LD12);
  39. imx_gpio_mode(PD28_PF_LD13);
  40. imx_gpio_mode(PD29_PF_LD14);
  41. imx_gpio_mode(PD30_PF_LD15);
  42. imx_gpio_mode(PD14_PF_FLM_VSYNC);
  43. imx_gpio_mode(PD13_PF_LP_HSYNC);
  44. imx_gpio_mode(PD6_PF_LSCLK);
  45. imx_gpio_mode(GPIO_PORTD | GPIO_OUT | GPIO_GPIO);
  46. imx_gpio_mode(PD11_PF_CONTRAST);
  47. imx_gpio_mode(PD10_PF_SPL_SPR);
  48. LCDC_RMCR = 0x00000000;
  49. LCDC_PCR = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_PCD(5);
  50. LCDC_HCR = HCR_H_WIDTH(2);
  51. LCDC_VCR = VCR_V_WIDTH(2);
  52. LCDC_PWMR = 0x00000380; /* contrast to 0x80 middle (is best !!!) */
  53. LCDC_SSA = 0x10040000; /* image in flash */
  54. LCDC_SIZE = SIZE_XMAX(320) | SIZE_YMAX(240); /* screen size */
  55. LCDC_VPW = 0x000000A0; /* Virtual Page Width Register */
  56. LCDC_POS = 0x00000000; /* panning offset 0 (0 pixel offset) */
  57. /* disable Cursor */
  58. LCDC_CPOS = 0x00000000;
  59. /* fixed burst length */
  60. LCDC_DMACR = DMACR_BURST | DMACR_HM(8) | DMACR_TM(2);
  61. /* enable LCD */
  62. DR(3) |= 0x00001000;
  63. LCDC_RMCR = RMCR_LCDC_EN;
  64. }
  65. int
  66. board_init(void)
  67. {
  68. DECLARE_GLOBAL_DATA_PTR;
  69. gd->bd->bi_arch_number = MACH_TYPE_MX1FS2;
  70. gd->bd->bi_boot_params = 0x08000100;
  71. serial_init();
  72. logo_init();
  73. return 0;
  74. }
  75. int
  76. dram_init(void)
  77. {
  78. DECLARE_GLOBAL_DATA_PTR;
  79. #if ( CONFIG_NR_DRAM_BANKS > 0 )
  80. gd->bd->bi_dram[0].start = MX1FS2_SDRAM_1;
  81. gd->bd->bi_dram[0].size = MX1FS2_SDRAM_1_SIZE;
  82. #endif
  83. return 0;
  84. }
  85. /**
  86. * show_boot_progress: - indicate state of the boot process
  87. *
  88. * @param status: Status number - see README for details.
  89. *
  90. */
  91. void
  92. show_boot_progress(int status)
  93. {
  94. /* We use this as a hook to disable serial ports just before booting
  95. * This way we suppress the "uncompressing linux..." message
  96. */
  97. #ifdef CONFIG_SILENT_CONSOLE
  98. if( status == 8) {
  99. if( getenv("silent") != NULL ) {
  100. *(volatile unsigned long *)0x206080 &= ~1;
  101. *(volatile unsigned long *)0x207080 &= ~1;
  102. }
  103. }
  104. #endif
  105. return;
  106. }