]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
2 * Copyright 2007 Freescale Semiconductor, Inc.
3 * York Sun <yorksun@freescale.com>
5 * FSL DIU Framebuffer driver
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #ifdef CONFIG_FSL_DIU_FB
32 #include "../common/pixis.h"
33 #include "../common/fsl_diu_fb.h"
36 extern unsigned int FSL_Logo_BMP
[];
39 void mpc8610hpcd_diu_init(void)
43 unsigned int pixel_format
;
44 unsigned char tmp_val
;
46 tmp_val
= in8(PIXIS_BASE
+ PIXIS_BRDCFG0
);
47 monitor_port
= getenv ("monitor");
49 if (!strncmp(monitor_port
, "0", 1)) { /* 0 - DVI */
51 pixel_format
= 0x88882317;
53 out8(PIXIS_BASE
+ PIXIS_BRDCFG0
, tmp_val
| 0x08);
55 } else if (!strncmp(monitor_port
, "1", 1)) { /* 1 - Single link LVDS */
57 pixel_format
= 0x88883316;
59 out8(PIXIS_BASE
+ PIXIS_BRDCFG0
, (tmp_val
& 0xf7) | 0x10);
61 } else if (!strncmp(monitor_port
, "2", 1)) { /* 2 - Double link LVDS */
63 pixel_format
= 0x88883316;
65 out8(PIXIS_BASE
+ PIXIS_BRDCFG0
, tmp_val
& 0xe7);
69 pixel_format
= 0x88882317;
71 out8(PIXIS_BASE
+ PIXIS_BRDCFG0
, tmp_val
| 0x08);
74 fsl_diu_init(xres
, pixel_format
, gamma_fix
,
75 (unsigned char *)FSL_Logo_BMP
);
78 int mpc8610diu_init_show_bmp(cmd_tbl_t
*cmdtp
,
79 int flag
, int argc
, char *argv
[])
84 printf ("Usage:\n%s\n", cmdtp
->usage
);
88 if (!strncmp(argv
[1],"init",4)) {
89 mpc8610hpcd_diu_init();
91 addr
= simple_strtoul(argv
[1], NULL
, 16);
92 fsl_diu_clear_screen();
93 fsl_diu_display_bmp((unsigned char *)addr
, 0, 0, 0);
100 diufb
, CFG_MAXARGS
, 1, mpc8610diu_init_show_bmp
,
101 "diufb init | addr - Init or Display BMP file\n",
102 "init\n - initialize DIU\n"
103 "addr\n - display bmp at address 'addr'\n"
105 #endif /* CONFIG_FSL_DIU_FB */