wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001-2002 |
| 3 | * Wolfgang Denk, DENX Software Engineering -- wd@denx.de |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | /************************************************************************/ |
| 25 | /* ** HEADER FILES */ |
| 26 | /************************************************************************/ |
| 27 | |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 28 | /* #define DEBUG */ |
| 29 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 30 | #include <config.h> |
| 31 | #include <common.h> |
wdenk | 0811ded | 2004-06-25 23:35:58 +0000 | [diff] [blame] | 32 | #include <command.h> |
wdenk | 541a76d | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 33 | #include <watchdog.h> |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 34 | #include <version.h> |
| 35 | #include <stdarg.h> |
| 36 | #include <lcdvideo.h> |
| 37 | #include <linux/types.h> |
Jean-Christophe PLAGNIOL-VILLARD | 2a7a031 | 2009-05-16 12:14:54 +0200 | [diff] [blame] | 38 | #include <stdio_dev.h> |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 39 | #if defined(CONFIG_POST) |
| 40 | #include <post.h> |
| 41 | #endif |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 42 | #include <lcd.h> |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 43 | |
| 44 | #ifdef CONFIG_LCD |
| 45 | |
| 46 | /************************************************************************/ |
| 47 | /* ** CONFIG STUFF -- should be moved to board config file */ |
| 48 | /************************************************************************/ |
wdenk | 2b9d186 | 2005-07-04 00:03:16 +0000 | [diff] [blame] | 49 | #ifndef CONFIG_LCD_INFO |
| 50 | #define CONFIG_LCD_INFO /* Display Logo, (C) and system info */ |
| 51 | #endif |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 52 | |
wdenk | 92bbe3f | 2003-04-20 14:04:18 +0000 | [diff] [blame] | 53 | #if defined(CONFIG_V37) || defined(CONFIG_EDT32F10) |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 54 | #undef CONFIG_LCD_LOGO |
wdenk | 2b9d186 | 2005-07-04 00:03:16 +0000 | [diff] [blame] | 55 | #undef CONFIG_LCD_INFO |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 56 | #endif |
| 57 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 58 | /*----------------------------------------------------------------------*/ |
| 59 | #ifdef CONFIG_KYOCERA_KCS057QV1AJ |
| 60 | /* |
| 61 | * Kyocera KCS057QV1AJ-G23. Passive, color, single scan. |
| 62 | */ |
| 63 | #define LCD_BPP LCD_COLOR4 |
| 64 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 65 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 66 | 640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 67 | LCD_BPP, 1, 0, 1, 0, 5, 0, 0, 0 |
| 68 | /* wbl, vpw, lcdac, wbf */ |
| 69 | }; |
| 70 | #endif /* CONFIG_KYOCERA_KCS057QV1AJ */ |
| 71 | /*----------------------------------------------------------------------*/ |
| 72 | |
| 73 | /*----------------------------------------------------------------------*/ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 74 | #ifdef CONFIG_HITACHI_SP19X001_Z1A |
| 75 | /* |
| 76 | * Hitachi SP19X001-. Active, color, single scan. |
| 77 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 78 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 79 | 640, 480, 154, 116, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 80 | LCD_COLOR8, 1, 0, 1, 0, 0, 0, 0, 0 |
| 81 | /* wbl, vpw, lcdac, wbf */ |
| 82 | }; |
| 83 | #endif /* CONFIG_HITACHI_SP19X001_Z1A */ |
| 84 | /*----------------------------------------------------------------------*/ |
| 85 | |
| 86 | /*----------------------------------------------------------------------*/ |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 87 | #ifdef CONFIG_NEC_NL6448AC33 |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 88 | /* |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 89 | * NEC NL6448AC33-18. Active, color, single scan. |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 90 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 91 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 92 | 640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 93 | 3, 0, 0, 1, 1, 144, 2, 0, 33 |
| 94 | /* wbl, vpw, lcdac, wbf */ |
| 95 | }; |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 96 | #endif /* CONFIG_NEC_NL6448AC33 */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 97 | /*----------------------------------------------------------------------*/ |
| 98 | |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 99 | #ifdef CONFIG_NEC_NL6448BC20 |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 100 | /* |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 101 | * NEC NL6448BC20-08. 6.5", 640x480. Active, color, single scan. |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 102 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 103 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 104 | 640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 105 | 3, 0, 0, 1, 1, 144, 2, 0, 33 |
| 106 | /* wbl, vpw, lcdac, wbf */ |
| 107 | }; |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 108 | #endif /* CONFIG_NEC_NL6448BC20 */ |
| 109 | /*----------------------------------------------------------------------*/ |
| 110 | |
| 111 | #ifdef CONFIG_NEC_NL6448BC33_54 |
| 112 | /* |
| 113 | * NEC NL6448BC33-54. 10.4", 640x480. Active, color, single scan. |
| 114 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 115 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 116 | 640, 480, 212, 158, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | c0d54ae | 2003-11-25 16:55:19 +0000 | [diff] [blame] | 117 | 3, 0, 0, 1, 1, 144, 2, 0, 33 |
| 118 | /* wbl, vpw, lcdac, wbf */ |
| 119 | }; |
| 120 | #endif /* CONFIG_NEC_NL6448BC33_54 */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 121 | /*----------------------------------------------------------------------*/ |
| 122 | |
| 123 | #ifdef CONFIG_SHARP_LQ104V7DS01 |
| 124 | /* |
| 125 | * SHARP LQ104V7DS01. 6.5", 640x480. Active, color, single scan. |
| 126 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 127 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 128 | 640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_LOW, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 129 | 3, 0, 0, 1, 1, 25, 1, 0, 33 |
| 130 | /* wbl, vpw, lcdac, wbf */ |
| 131 | }; |
| 132 | #endif /* CONFIG_SHARP_LQ104V7DS01 */ |
| 133 | /*----------------------------------------------------------------------*/ |
| 134 | |
| 135 | #ifdef CONFIG_SHARP_16x9 |
| 136 | /* |
| 137 | * Sharp 320x240. Active, color, single scan. It isn't 16x9, and I am |
| 138 | * not sure what it is....... |
| 139 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 140 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 141 | 320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 142 | 3, 0, 0, 1, 1, 15, 4, 0, 3 |
| 143 | }; |
| 144 | #endif /* CONFIG_SHARP_16x9 */ |
| 145 | /*----------------------------------------------------------------------*/ |
| 146 | |
| 147 | #ifdef CONFIG_SHARP_LQ057Q3DC02 |
| 148 | /* |
| 149 | * Sharp LQ057Q3DC02 display. Active, color, single scan. |
| 150 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 151 | #undef LCD_DF |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 152 | #define LCD_DF 12 |
| 153 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 154 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 155 | 320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 156 | 3, 0, 0, 1, 1, 15, 4, 0, 3 |
| 157 | /* wbl, vpw, lcdac, wbf */ |
| 158 | }; |
wdenk | 2b9d186 | 2005-07-04 00:03:16 +0000 | [diff] [blame] | 159 | #define CONFIG_LCD_INFO_BELOW_LOGO |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 160 | #endif /* CONFIG_SHARP_LQ057Q3DC02 */ |
| 161 | /*----------------------------------------------------------------------*/ |
| 162 | |
| 163 | #ifdef CONFIG_SHARP_LQ64D341 |
| 164 | /* |
| 165 | * Sharp LQ64D341 display, 640x480. Active, color, single scan. |
| 166 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 167 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 168 | 640, 480, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 169 | 3, 0, 0, 1, 1, 128, 16, 0, 32 |
| 170 | /* wbl, vpw, lcdac, wbf */ |
| 171 | }; |
| 172 | #endif /* CONFIG_SHARP_LQ64D341 */ |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 173 | |
dzu | fae2d81 | 2003-09-25 22:30:12 +0000 | [diff] [blame] | 174 | #ifdef CONFIG_SHARP_LQ065T9DR51U |
| 175 | /* |
| 176 | * Sharp LQ065T9DR51U display, 400x240. Active, color, single scan. |
| 177 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 178 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 179 | 400, 240, 143, 79, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, |
dzu | fae2d81 | 2003-09-25 22:30:12 +0000 | [diff] [blame] | 180 | 3, 0, 0, 1, 1, 248, 4, 0, 35 |
| 181 | /* wbl, vpw, lcdac, wbf */ |
| 182 | }; |
wdenk | 2b9d186 | 2005-07-04 00:03:16 +0000 | [diff] [blame] | 183 | #define CONFIG_LCD_INFO_BELOW_LOGO |
dzu | fae2d81 | 2003-09-25 22:30:12 +0000 | [diff] [blame] | 184 | #endif /* CONFIG_SHARP_LQ065T9DR51U */ |
| 185 | |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 186 | #ifdef CONFIG_SHARP_LQ084V1DG21 |
| 187 | /* |
| 188 | * Sharp LQ084V1DG21 display, 640x480. Active, color, single scan. |
| 189 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 190 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 191 | 640, 480, 171, 129, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_LOW, |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 192 | 3, 0, 0, 1, 1, 160, 3, 0, 48 |
| 193 | /* wbl, vpw, lcdac, wbf */ |
| 194 | }; |
| 195 | #endif /* CONFIG_SHARP_LQ084V1DG21 */ |
| 196 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 197 | /*----------------------------------------------------------------------*/ |
| 198 | |
| 199 | #ifdef CONFIG_HLD1045 |
| 200 | /* |
| 201 | * HLD1045 display, 640x480. Active, color, single scan. |
| 202 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 203 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 204 | 640, 480, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 205 | 3, 0, 0, 1, 1, 160, 3, 0, 48 |
| 206 | /* wbl, vpw, lcdac, wbf */ |
| 207 | }; |
| 208 | #endif /* CONFIG_HLD1045 */ |
| 209 | /*----------------------------------------------------------------------*/ |
| 210 | |
| 211 | #ifdef CONFIG_PRIMEVIEW_V16C6448AC |
| 212 | /* |
| 213 | * Prime View V16C6448AC |
| 214 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 215 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 216 | 640, 480, 130, 98, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 217 | 3, 0, 0, 1, 1, 144, 2, 0, 35 |
| 218 | /* wbl, vpw, lcdac, wbf */ |
| 219 | }; |
| 220 | #endif /* CONFIG_PRIMEVIEW_V16C6448AC */ |
| 221 | |
| 222 | /*----------------------------------------------------------------------*/ |
| 223 | |
| 224 | #ifdef CONFIG_OPTREX_BW |
| 225 | /* |
| 226 | * Optrex CBL50840-2 NF-FW 99 22 M5 |
| 227 | * or |
| 228 | * Hitachi LMG6912RPFC-00T |
| 229 | * or |
| 230 | * Hitachi SP14Q002 |
| 231 | * |
| 232 | * 320x240. Black & white. |
| 233 | */ |
| 234 | #define OPTREX_BPP 0 /* 0 - monochrome, 1 bpp */ |
| 235 | /* 1 - 4 grey levels, 2 bpp */ |
| 236 | /* 2 - 16 grey levels, 4 bpp */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 237 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 238 | 320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 239 | OPTREX_BPP, 0, 0, 0, 0, 0, 0, 0, 0, 4 |
| 240 | }; |
| 241 | #endif /* CONFIG_OPTREX_BW */ |
| 242 | |
| 243 | /*-----------------------------------------------------------------*/ |
| 244 | #ifdef CONFIG_EDT32F10 |
| 245 | /* |
| 246 | * Emerging Display Technologies 320x240. Passive, monochrome, single scan. |
| 247 | */ |
| 248 | #define LCD_BPP LCD_MONOCHROME |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 249 | #define LCD_DF 10 |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 250 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 251 | vidinfo_t panel_info = { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 252 | 320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 253 | LCD_BPP, 0, 0, 0, 0, 33, 0, 0, 0 |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 254 | }; |
| 255 | #endif |
| 256 | /*----------------------------------------------------------------------*/ |
| 257 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 258 | void lcd_ctrl_init (void *lcdbase); |
| 259 | void lcd_enable (void); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 260 | #if LCD_BPP == LCD_COLOR8 |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 261 | void lcd_setcolreg (ushort regno, |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 262 | ushort red, ushort green, ushort blue); |
| 263 | #endif |
| 264 | #if LCD_BPP == LCD_MONOCHROME |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 265 | void lcd_initcolregs (void); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 266 | #endif |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 267 | |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 268 | #if defined(CONFIG_RBC823) |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 269 | void lcd_disable (void); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 270 | #endif |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 271 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 272 | /************************************************************************/ |
| 273 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 274 | /************************************************************************/ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 275 | /* ----------------- chipset specific functions ----------------------- */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 276 | /************************************************************************/ |
| 277 | |
| 278 | /* |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 279 | * Calculate fb size for VIDEOLFB_ATAG. |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 280 | */ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 281 | ulong calc_fbsize (void) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 282 | { |
| 283 | ulong size; |
| 284 | int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8; |
| 285 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 286 | size = line_length * panel_info.vl_row; |
| 287 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 288 | return size; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 289 | } |
| 290 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 291 | void lcd_ctrl_init (void *lcdbase) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 292 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 293 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 294 | volatile lcd823_t *lcdp = &immr->im_lcd; |
| 295 | |
| 296 | uint lccrtmp; |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 297 | uint lchcr_hpc_tmp; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 298 | |
| 299 | /* Initialize the LCD control register according to the LCD |
| 300 | * parameters defined. We do everything here but enable |
| 301 | * the controller. |
| 302 | */ |
| 303 | |
wdenk | ec43274 | 2004-06-09 21:04:48 +0000 | [diff] [blame] | 304 | #ifdef CONFIG_RPXLITE |
| 305 | /* This is special for RPXlite_DW Software Development Platform **[Sam]** */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 306 | panel_info.vl_dp = CONFIG_SYS_LOW; |
wdenk | ec43274 | 2004-06-09 21:04:48 +0000 | [diff] [blame] | 307 | #endif |
| 308 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 309 | lccrtmp = LCDBIT (LCCR_BNUM_BIT, |
| 310 | (((panel_info.vl_row * panel_info.vl_col) * (1 << LCD_BPP)) / 128)); |
| 311 | |
| 312 | lccrtmp |= LCDBIT (LCCR_CLKP_BIT, panel_info.vl_clkp) | |
| 313 | LCDBIT (LCCR_OEP_BIT, panel_info.vl_oep) | |
| 314 | LCDBIT (LCCR_HSP_BIT, panel_info.vl_hsp) | |
| 315 | LCDBIT (LCCR_VSP_BIT, panel_info.vl_vsp) | |
| 316 | LCDBIT (LCCR_DP_BIT, panel_info.vl_dp) | |
| 317 | LCDBIT (LCCR_BPIX_BIT, panel_info.vl_bpix) | |
| 318 | LCDBIT (LCCR_LBW_BIT, panel_info.vl_lbw) | |
| 319 | LCDBIT (LCCR_SPLT_BIT, panel_info.vl_splt) | |
| 320 | LCDBIT (LCCR_CLOR_BIT, panel_info.vl_clor) | |
| 321 | LCDBIT (LCCR_TFT_BIT, panel_info.vl_tft); |
| 322 | |
| 323 | #if 0 |
| 324 | lccrtmp |= ((SIU_LEVEL5 / 2) << 12); |
| 325 | lccrtmp |= LCCR_EIEN; |
| 326 | #endif |
| 327 | |
| 328 | lcdp->lcd_lccr = lccrtmp; |
| 329 | lcdp->lcd_lcsr = 0xFF; /* Clear pending interrupts */ |
| 330 | |
| 331 | /* Initialize LCD controller bus priorities. |
| 332 | */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 333 | #ifdef CONFIG_RBC823 |
| 334 | immr->im_siu_conf.sc_sdcr = (immr->im_siu_conf.sc_sdcr & ~0x0f) | 1; /* RAID = 01, LAID = 00 */ |
| 335 | #else |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 336 | immr->im_siu_conf.sc_sdcr &= ~0x0f; /* RAID = LAID = 0 */ |
| 337 | |
| 338 | /* set SHFT/CLOCK division factor 4 |
| 339 | * This needs to be set based upon display type and processor |
| 340 | * speed. The TFT displays run about 20 to 30 MHz. |
| 341 | * I was running 64 MHz processor speed. |
| 342 | * The value for this divider must be chosen so the result is |
| 343 | * an integer of the processor speed (i.e., divide by 3 with |
| 344 | * 64 MHz would be bad). |
| 345 | */ |
| 346 | immr->im_clkrst.car_sccr &= ~0x1F; |
| 347 | immr->im_clkrst.car_sccr |= LCD_DF; /* was 8 */ |
| 348 | |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 349 | #endif /* CONFIG_RBC823 */ |
| 350 | |
| 351 | #if defined(CONFIG_RBC823) |
| 352 | /* Enable LCD on port D. |
| 353 | */ |
| 354 | immr->im_ioport.iop_pddat &= 0x0300; |
| 355 | immr->im_ioport.iop_pdpar |= 0x1CFF; |
| 356 | immr->im_ioport.iop_pddir |= 0x1CFF; |
| 357 | |
| 358 | /* Configure LCD_ON, VEE_ON, CCFL_ON on port B. |
| 359 | */ |
| 360 | immr->im_cpm.cp_pbdat &= ~0x00005001; |
| 361 | immr->im_cpm.cp_pbpar &= ~0x00005001; |
| 362 | immr->im_cpm.cp_pbdir |= 0x00005001; |
| 363 | #elif !defined(CONFIG_EDT32F10) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 364 | /* Enable LCD on port D. |
| 365 | */ |
| 366 | immr->im_ioport.iop_pdpar |= 0x1FFF; |
| 367 | immr->im_ioport.iop_pddir |= 0x1FFF; |
| 368 | |
| 369 | /* Enable LCD_A/B/C on port B. |
| 370 | */ |
| 371 | immr->im_cpm.cp_pbpar |= 0x00005001; |
| 372 | immr->im_cpm.cp_pbdir |= 0x00005001; |
| 373 | #else |
| 374 | /* Enable LCD on port D. |
| 375 | */ |
| 376 | immr->im_ioport.iop_pdpar |= 0x1DFF; |
| 377 | immr->im_ioport.iop_pdpar &= ~0x0200; |
| 378 | immr->im_ioport.iop_pddir |= 0x1FFF; |
| 379 | immr->im_ioport.iop_pddat |= 0x0200; |
| 380 | #endif |
| 381 | |
| 382 | /* Load the physical address of the linear frame buffer |
| 383 | * into the LCD controller. |
| 384 | * BIG NOTE: This has to be modified to load A and B depending |
| 385 | * upon the split mode of the LCD. |
| 386 | */ |
Jeroen Hofstee | 881c4ec | 2013-01-22 10:44:12 +0000 | [diff] [blame^] | 387 | lcdp->lcd_lcfaa = (ulong)lcdbase; |
| 388 | lcdp->lcd_lcfba = (ulong)lcdbase; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 389 | |
| 390 | /* MORE HACKS...This must be updated according to 823 manual |
| 391 | * for different panels. |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 392 | * Udi Finkelstein - done - see below: |
| 393 | * Note: You better not try unsupported combinations such as |
| 394 | * 4-bit wide passive dual scan LCD at 4/8 Bit color. |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 395 | */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 396 | lchcr_hpc_tmp = |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 397 | (panel_info.vl_col * |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 398 | (panel_info.vl_tft ? 8 : |
| 399 | (((2 - panel_info.vl_lbw) << /* 4 bit=2, 8-bit = 1 */ |
| 400 | /* use << to mult by: single scan = 1, dual scan = 2 */ |
| 401 | panel_info.vl_splt) * |
| 402 | (panel_info.vl_bpix | 1)))) >> 3; /* 2/4 BPP = 1, 8/16 BPP = 3 */ |
| 403 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 404 | lcdp->lcd_lchcr = LCHCR_BO | |
| 405 | LCDBIT (LCHCR_AT_BIT, 4) | |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 406 | LCDBIT (LCHCR_HPC_BIT, lchcr_hpc_tmp) | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 407 | panel_info.vl_wbl; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 408 | |
| 409 | lcdp->lcd_lcvcr = LCDBIT (LCVCR_VPW_BIT, panel_info.vl_vpw) | |
| 410 | LCDBIT (LCVCR_LCD_AC_BIT, panel_info.vl_lcdac) | |
| 411 | LCDBIT (LCVCR_VPC_BIT, panel_info.vl_row) | |
| 412 | panel_info.vl_wbf; |
| 413 | |
| 414 | } |
| 415 | |
| 416 | /*----------------------------------------------------------------------*/ |
| 417 | |
| 418 | #ifdef NOT_USED_SO_FAR |
| 419 | static void |
| 420 | lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue) |
| 421 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 422 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 423 | volatile cpm8xx_t *cp = &(immr->im_cpm); |
| 424 | unsigned short colreg, *cmap_ptr; |
| 425 | |
| 426 | cmap_ptr = (unsigned short *)&cp->lcd_cmap[regno * 2]; |
| 427 | |
| 428 | colreg = *cmap_ptr; |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 429 | #ifdef CONFIG_SYS_INVERT_COLORS |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 430 | colreg ^= 0x0FFF; |
| 431 | #endif |
| 432 | |
| 433 | *red = (colreg >> 8) & 0x0F; |
| 434 | *green = (colreg >> 4) & 0x0F; |
| 435 | *blue = colreg & 0x0F; |
| 436 | } |
| 437 | #endif /* NOT_USED_SO_FAR */ |
| 438 | |
| 439 | /*----------------------------------------------------------------------*/ |
| 440 | |
| 441 | #if LCD_BPP == LCD_COLOR8 |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 442 | void |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 443 | lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue) |
| 444 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 445 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 446 | volatile cpm8xx_t *cp = &(immr->im_cpm); |
| 447 | unsigned short colreg, *cmap_ptr; |
| 448 | |
| 449 | cmap_ptr = (unsigned short *)&cp->lcd_cmap[regno * 2]; |
| 450 | |
| 451 | colreg = ((red & 0x0F) << 8) | |
| 452 | ((green & 0x0F) << 4) | |
| 453 | (blue & 0x0F) ; |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 454 | #ifdef CONFIG_SYS_INVERT_COLORS |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 455 | colreg ^= 0x0FFF; |
| 456 | #endif |
| 457 | *cmap_ptr = colreg; |
| 458 | |
| 459 | debug ("setcolreg: reg %2d @ %p: R=%02X G=%02X B=%02X => %02X%02X\n", |
| 460 | regno, &(cp->lcd_cmap[regno * 2]), |
| 461 | red, green, blue, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 462 | cp->lcd_cmap[ regno * 2 ], cp->lcd_cmap[(regno * 2) + 1]); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 463 | } |
| 464 | #endif /* LCD_COLOR8 */ |
| 465 | |
| 466 | /*----------------------------------------------------------------------*/ |
| 467 | |
| 468 | #if LCD_BPP == LCD_MONOCHROME |
| 469 | static |
| 470 | void lcd_initcolregs (void) |
| 471 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 472 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 473 | volatile cpm8xx_t *cp = &(immr->im_cpm); |
| 474 | ushort regno; |
| 475 | |
| 476 | for (regno = 0; regno < 16; regno++) { |
| 477 | cp->lcd_cmap[regno * 2] = 0; |
| 478 | cp->lcd_cmap[(regno * 2) + 1] = regno & 0x0f; |
| 479 | } |
| 480 | } |
| 481 | #endif |
| 482 | |
| 483 | /*----------------------------------------------------------------------*/ |
| 484 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 485 | void lcd_enable (void) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 486 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 487 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 488 | volatile lcd823_t *lcdp = &immr->im_lcd; |
| 489 | |
| 490 | /* Enable the LCD panel */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 491 | #ifndef CONFIG_RBC823 |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 492 | immr->im_siu_conf.sc_sdcr |= (1 << (31 - 25)); /* LAM = 1 */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 493 | #endif |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 494 | lcdp->lcd_lccr |= LCCR_PON; |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 495 | |
| 496 | #ifdef CONFIG_V37 |
| 497 | /* Turn on display backlight */ |
| 498 | immr->im_cpm.cp_pbpar |= 0x00008000; |
| 499 | immr->im_cpm.cp_pbdir |= 0x00008000; |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 500 | #elif defined(CONFIG_RBC823) |
| 501 | /* Turn on display backlight */ |
| 502 | immr->im_cpm.cp_pbdat |= 0x00004000; |
wdenk | 2dad91b | 2003-01-13 23:54:46 +0000 | [diff] [blame] | 503 | #endif |
| 504 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 505 | #if defined(CONFIG_LWMON) |
| 506 | { uchar c = pic_read (0x60); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 507 | #if defined(CONFIG_LCD) && defined(CONFIG_LWMON) && (CONFIG_POST & CONFIG_SYS_POST_SYSMON) |
wdenk | 18bd81e | 2004-03-17 01:13:07 +0000 | [diff] [blame] | 508 | /* Enable LCD later in sysmon test, only if temperature is OK */ |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 509 | #else |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 510 | c |= 0x07; /* Power on CCFL, Enable CCFL, Chip Enable LCD */ |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 511 | #endif |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 512 | pic_write (0x60, c); |
| 513 | } |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 514 | #endif /* CONFIG_LWMON */ |
| 515 | |
| 516 | #if defined(CONFIG_R360MPI) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 517 | { |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 518 | extern void r360_i2c_lcd_write (uchar data0, uchar data1); |
wdenk | 1901121 | 2003-07-16 16:40:22 +0000 | [diff] [blame] | 519 | unsigned long bgi, ctr; |
| 520 | char *p; |
| 521 | |
| 522 | if ((p = getenv("lcdbgi")) != NULL) { |
| 523 | bgi = simple_strtoul (p, 0, 10) & 0xFFF; |
| 524 | } else { |
| 525 | bgi = 0xFFF; |
| 526 | } |
| 527 | |
| 528 | if ((p = getenv("lcdctr")) != NULL) { |
| 529 | ctr = simple_strtoul (p, 0, 10) & 0xFFF; |
| 530 | } else { |
| 531 | ctr=0x7FF; |
| 532 | } |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 533 | |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 534 | r360_i2c_lcd_write(0x10, 0x01); |
| 535 | r360_i2c_lcd_write(0x20, 0x01); |
wdenk | 1901121 | 2003-07-16 16:40:22 +0000 | [diff] [blame] | 536 | r360_i2c_lcd_write(0x30 | ((bgi>>8) & 0xF), bgi & 0xFF); |
| 537 | r360_i2c_lcd_write(0x40 | ((ctr>>8) & 0xF), ctr & 0xFF); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 538 | } |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 539 | #endif /* CONFIG_R360MPI */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 540 | #ifdef CONFIG_RBC823 |
| 541 | udelay(200000); /* wait 200ms */ |
| 542 | /* Turn VEE_ON first */ |
| 543 | immr->im_cpm.cp_pbdat |= 0x00000001; |
| 544 | udelay(200000); /* wait 200ms */ |
| 545 | /* Now turn on LCD_ON */ |
| 546 | immr->im_cpm.cp_pbdat |= 0x00001000; |
| 547 | #endif |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 548 | #ifdef CONFIG_RRVISION |
| 549 | debug ("PC4->Output(1): enable LVDS\n"); |
| 550 | debug ("PC5->Output(0): disable PAL clock\n"); |
| 551 | immr->im_ioport.iop_pddir |= 0x1000; |
| 552 | immr->im_ioport.iop_pcpar &= ~(0x0C00); |
| 553 | immr->im_ioport.iop_pcdir |= 0x0C00 ; |
| 554 | immr->im_ioport.iop_pcdat |= 0x0800 ; |
| 555 | immr->im_ioport.iop_pcdat &= ~(0x0400); |
| 556 | debug ("PDPAR=0x%04X PDDIR=0x%04X PDDAT=0x%04X\n", |
| 557 | immr->im_ioport.iop_pdpar, |
| 558 | immr->im_ioport.iop_pddir, |
| 559 | immr->im_ioport.iop_pddat); |
| 560 | debug ("PCPAR=0x%04X PCDIR=0x%04X PCDAT=0x%04X\n", |
| 561 | immr->im_ioport.iop_pcpar, |
| 562 | immr->im_ioport.iop_pcdir, |
| 563 | immr->im_ioport.iop_pcdat); |
| 564 | #endif |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 565 | } |
wdenk | 92bbe3f | 2003-04-20 14:04:18 +0000 | [diff] [blame] | 566 | |
| 567 | /*----------------------------------------------------------------------*/ |
| 568 | |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 569 | #if defined (CONFIG_RBC823) |
| 570 | void lcd_disable (void) |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 571 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 572 | volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 573 | volatile lcd823_t *lcdp = &immr->im_lcd; |
| 574 | |
| 575 | #if defined(CONFIG_LWMON) |
| 576 | { uchar c = pic_read (0x60); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 577 | c &= ~0x07; /* Power off CCFL, Disable CCFL, Chip Disable LCD */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 578 | pic_write (0x60, c); |
| 579 | } |
| 580 | #elif defined(CONFIG_R360MPI) |
| 581 | { |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 582 | extern void r360_i2c_lcd_write (uchar data0, uchar data1); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 583 | |
wdenk | 3f9ab98 | 2003-04-12 23:38:12 +0000 | [diff] [blame] | 584 | r360_i2c_lcd_write(0x10, 0x00); |
| 585 | r360_i2c_lcd_write(0x20, 0x00); |
| 586 | r360_i2c_lcd_write(0x30, 0x00); |
| 587 | r360_i2c_lcd_write(0x40, 0x00); |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 588 | } |
| 589 | #endif /* CONFIG_LWMON */ |
| 590 | /* Disable the LCD panel */ |
| 591 | lcdp->lcd_lccr &= ~LCCR_PON; |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 592 | #ifdef CONFIG_RBC823 |
| 593 | /* Turn off display backlight, VEE and LCD_ON */ |
| 594 | immr->im_cpm.cp_pbdat &= ~0x00005001; |
| 595 | #else |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 596 | immr->im_siu_conf.sc_sdcr &= ~(1 << (31 - 25)); /* LAM = 0 */ |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 597 | #endif /* CONFIG_RBC823 */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 598 | } |
wdenk | 4e112c1 | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 599 | #endif /* NOT_USED_SO_FAR || CONFIG_RBC823 */ |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 600 | |
wdenk | 92bbe3f | 2003-04-20 14:04:18 +0000 | [diff] [blame] | 601 | |
wdenk | 5b1d713 | 2002-11-03 00:07:02 +0000 | [diff] [blame] | 602 | /************************************************************************/ |
| 603 | |
| 604 | #endif /* CONFIG_LCD */ |