blob: 90a33c249921e4b2be82f179afdb1d804bbbe285 [file] [log] [blame]
wdenk7ac16102004-08-01 22:48:16 +00001/*
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
21#include <common.h>
wdenk7ac16102004-08-01 22:48:16 +000022#include <asm/arch/imx-regs.h>
23
Wolfgang Denk6405a152006-03-31 18:32:53 +020024DECLARE_GLOBAL_DATA_PTR;
25
wdenk7ac16102004-08-01 22:48:16 +000026#define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg)
27
28extern void imx_gpio_mode(int gpio_mode);
29
30static void logo_init(void)
31{
32 imx_gpio_mode(PD15_PF_LD0);
33 imx_gpio_mode(PD16_PF_LD1);
34 imx_gpio_mode(PD17_PF_LD2);
35 imx_gpio_mode(PD18_PF_LD3);
36 imx_gpio_mode(PD19_PF_LD4);
37 imx_gpio_mode(PD20_PF_LD5);
38 imx_gpio_mode(PD21_PF_LD6);
39 imx_gpio_mode(PD22_PF_LD7);
40 imx_gpio_mode(PD23_PF_LD8);
41 imx_gpio_mode(PD24_PF_LD9);
42 imx_gpio_mode(PD25_PF_LD10);
43 imx_gpio_mode(PD26_PF_LD11);
44 imx_gpio_mode(PD27_PF_LD12);
45 imx_gpio_mode(PD28_PF_LD13);
46 imx_gpio_mode(PD29_PF_LD14);
47 imx_gpio_mode(PD30_PF_LD15);
48 imx_gpio_mode(PD14_PF_FLM_VSYNC);
49 imx_gpio_mode(PD13_PF_LP_HSYNC);
50 imx_gpio_mode(PD6_PF_LSCLK);
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +010051 imx_gpio_mode(GPIO_PORTD | GPIO_OUT | GPIO_DR);
wdenk7ac16102004-08-01 22:48:16 +000052 imx_gpio_mode(PD11_PF_CONTRAST);
53 imx_gpio_mode(PD10_PF_SPL_SPR);
54
55 LCDC_RMCR = 0x00000000;
56 LCDC_PCR = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_PCD(5);
57 LCDC_HCR = HCR_H_WIDTH(2);
58 LCDC_VCR = VCR_V_WIDTH(2);
59
60 LCDC_PWMR = 0x00000380; /* contrast to 0x80 middle (is best !!!) */
61 LCDC_SSA = 0x10040000; /* image in flash */
62
63 LCDC_SIZE = SIZE_XMAX(320) | SIZE_YMAX(240); /* screen size */
64
65 LCDC_VPW = 0x000000A0; /* Virtual Page Width Register */
66 LCDC_POS = 0x00000000; /* panning offset 0 (0 pixel offset) */
67
68 /* disable Cursor */
69 LCDC_CPOS = 0x00000000;
70
71 /* fixed burst length */
72 LCDC_DMACR = DMACR_BURST | DMACR_HM(8) | DMACR_TM(2);
73
74 /* enable LCD */
75 DR(3) |= 0x00001000;
76 LCDC_RMCR = RMCR_LCDC_EN;
77
78}
79
80int
81board_init(void)
82{
wdenk767fbd42004-10-10 18:41:04 +000083 gd->bd->bi_arch_number = MACH_TYPE_MX1FS2;
wdenk7ac16102004-08-01 22:48:16 +000084 gd->bd->bi_boot_params = 0x08000100;
85serial_init();
86 logo_init();
87 return 0;
88}
89
90int
91dram_init(void)
92{
wdenk7ac16102004-08-01 22:48:16 +000093#if ( CONFIG_NR_DRAM_BANKS > 0 )
94 gd->bd->bi_dram[0].start = MX1FS2_SDRAM_1;
95 gd->bd->bi_dram[0].size = MX1FS2_SDRAM_1_SIZE;
96#endif
97 return 0;
98}
99
100/**
101 * show_boot_progress: - indicate state of the boot process
102 *
103 * @param status: Status number - see README for details.
104 *
105 */
106
107void
108show_boot_progress(int status)
109{
110 /* We use this as a hook to disable serial ports just before booting
111 * This way we suppress the "uncompressing linux..." message
112 */
113#ifdef CONFIG_SILENT_CONSOLE
114 if( status == 8) {
115 if( getenv("silent") != NULL ) {
116 *(volatile unsigned long *)0x206080 &= ~1;
117 *(volatile unsigned long *)0x207080 &= ~1;
118 }
119 }
120#endif
121 return;
122}