lcd.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  1. /*
  2. * Common LCD routines for supported CPUs
  3. *
  4. * (C) Copyright 2001-2002
  5. * Wolfgang Denk, DENX Software Engineering -- wd@denx.de
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. /************************************************************************/
  10. /* ** HEADER FILES */
  11. /************************************************************************/
  12. /* #define DEBUG */
  13. #include <config.h>
  14. #include <common.h>
  15. #include <command.h>
  16. #include <stdarg.h>
  17. #include <search.h>
  18. #include <env_callback.h>
  19. #include <linux/types.h>
  20. #include <stdio_dev.h>
  21. #if defined(CONFIG_POST)
  22. #include <post.h>
  23. #endif
  24. #include <lcd.h>
  25. #include <watchdog.h>
  26. #include <asm/unaligned.h>
  27. #include <splash.h>
  28. #include <asm/io.h>
  29. #include <asm/unaligned.h>
  30. #if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
  31. defined(CONFIG_CPU_MONAHANS)
  32. #define CONFIG_CPU_PXA
  33. #include <asm/byteorder.h>
  34. #endif
  35. #if defined(CONFIG_MPC823)
  36. #include <lcdvideo.h>
  37. #endif
  38. #if defined(CONFIG_ATMEL_LCD)
  39. #include <atmel_lcdc.h>
  40. #endif
  41. #if defined(CONFIG_LCD_DT_SIMPLEFB)
  42. #include <libfdt.h>
  43. #endif
  44. /************************************************************************/
  45. /* ** FONT DATA */
  46. /************************************************************************/
  47. #include <video_font.h> /* Get font data, width and height */
  48. /************************************************************************/
  49. /* ** LOGO DATA */
  50. /************************************************************************/
  51. #ifdef CONFIG_LCD_LOGO
  52. # include <bmp_logo.h> /* Get logo data, width and height */
  53. # include <bmp_logo_data.h>
  54. # if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
  55. # error Default Color Map overlaps with Logo Color Map
  56. # endif
  57. #endif
  58. #ifdef CONFIG_SANDBOX
  59. #include <asm/sdl.h>
  60. #endif
  61. #ifndef CONFIG_LCD_ALIGNMENT
  62. #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
  63. #endif
  64. /* By default we scroll by a single line */
  65. #ifndef CONFIG_CONSOLE_SCROLL_LINES
  66. #define CONFIG_CONSOLE_SCROLL_LINES 1
  67. #endif
  68. /************************************************************************/
  69. /* ** CONSOLE DEFINITIONS & FUNCTIONS */
  70. /************************************************************************/
  71. #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
  72. # define CONSOLE_ROWS ((panel_info.vl_row-BMP_LOGO_HEIGHT) \
  73. / VIDEO_FONT_HEIGHT)
  74. #else
  75. # define CONSOLE_ROWS (panel_info.vl_row / VIDEO_FONT_HEIGHT)
  76. #endif
  77. #define CONSOLE_COLS (panel_info.vl_col / VIDEO_FONT_WIDTH)
  78. #define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * lcd_line_length)
  79. #define CONSOLE_ROW_FIRST lcd_console_address
  80. #define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
  81. #define CONSOLE_ROW_LAST (lcd_console_address + CONSOLE_SIZE \
  82. - CONSOLE_ROW_SIZE)
  83. #define CONSOLE_SIZE (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
  84. #define CONSOLE_SCROLL_SIZE (CONSOLE_SIZE - CONSOLE_ROW_SIZE)
  85. #if LCD_BPP == LCD_MONOCHROME
  86. # define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \
  87. (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7)
  88. #elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
  89. (LCD_BPP == LCD_COLOR32)
  90. # define COLOR_MASK(c) (c)
  91. #else
  92. # error Unsupported LCD BPP.
  93. #endif
  94. DECLARE_GLOBAL_DATA_PTR;
  95. static void lcd_drawchars(ushort x, ushort y, uchar *str, int count);
  96. static inline void lcd_putc_xy(ushort x, ushort y, uchar c);
  97. static int lcd_init(void *lcdbase);
  98. static void *lcd_logo(void);
  99. static void lcd_setfgcolor(int color);
  100. static void lcd_setbgcolor(int color);
  101. static int lcd_color_fg;
  102. static int lcd_color_bg;
  103. int lcd_line_length;
  104. char lcd_is_enabled = 0;
  105. static short console_col;
  106. static short console_row;
  107. static void *lcd_console_address;
  108. static void *lcd_base; /* Start of framebuffer memory */
  109. static char lcd_flush_dcache; /* 1 to flush dcache after each lcd update */
  110. /************************************************************************/
  111. /* Flush LCD activity to the caches */
  112. void lcd_sync(void)
  113. {
  114. /*
  115. * flush_dcache_range() is declared in common.h but it seems that some
  116. * architectures do not actually implement it. Is there a way to find
  117. * out whether it exists? For now, ARM is safe.
  118. */
  119. #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_DCACHE_OFF)
  120. int line_length;
  121. if (lcd_flush_dcache)
  122. flush_dcache_range((u32)lcd_base,
  123. (u32)(lcd_base + lcd_get_size(&line_length)));
  124. #elif defined(CONFIG_SANDBOX) && defined(CONFIG_VIDEO_SANDBOX_SDL)
  125. static ulong last_sync;
  126. if (get_timer(last_sync) > 10) {
  127. sandbox_sdl_sync(lcd_base);
  128. last_sync = get_timer(0);
  129. }
  130. #endif
  131. }
  132. void lcd_set_flush_dcache(int flush)
  133. {
  134. lcd_flush_dcache = (flush != 0);
  135. }
  136. /*----------------------------------------------------------------------*/
  137. static void console_scrollup(void)
  138. {
  139. const int rows = CONFIG_CONSOLE_SCROLL_LINES;
  140. /* Copy up rows ignoring those that will be overwritten */
  141. memcpy(CONSOLE_ROW_FIRST,
  142. lcd_console_address + CONSOLE_ROW_SIZE * rows,
  143. CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
  144. /* Clear the last rows */
  145. #if (LCD_BPP != LCD_COLOR32)
  146. memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
  147. COLOR_MASK(lcd_color_bg),
  148. CONSOLE_ROW_SIZE * rows);
  149. #else
  150. u32 *ppix = lcd_console_address +
  151. CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
  152. u32 i;
  153. for (i = 0;
  154. i < (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
  155. i++) {
  156. *ppix++ = COLOR_MASK(lcd_color_bg);
  157. }
  158. #endif
  159. lcd_sync();
  160. console_row -= rows;
  161. }
  162. /*----------------------------------------------------------------------*/
  163. static inline void console_back(void)
  164. {
  165. if (--console_col < 0) {
  166. console_col = CONSOLE_COLS-1 ;
  167. if (--console_row < 0)
  168. console_row = 0;
  169. }
  170. lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
  171. console_row * VIDEO_FONT_HEIGHT, ' ');
  172. }
  173. /*----------------------------------------------------------------------*/
  174. static inline void console_newline(void)
  175. {
  176. console_col = 0;
  177. /* Check if we need to scroll the terminal */
  178. if (++console_row >= CONSOLE_ROWS)
  179. console_scrollup();
  180. else
  181. lcd_sync();
  182. }
  183. /*----------------------------------------------------------------------*/
  184. static void lcd_stub_putc(struct stdio_dev *dev, const char c)
  185. {
  186. lcd_putc(c);
  187. }
  188. void lcd_putc(const char c)
  189. {
  190. if (!lcd_is_enabled) {
  191. serial_putc(c);
  192. return;
  193. }
  194. switch (c) {
  195. case '\r':
  196. console_col = 0;
  197. return;
  198. case '\n':
  199. console_newline();
  200. return;
  201. case '\t': /* Tab (8 chars alignment) */
  202. console_col += 8;
  203. console_col &= ~7;
  204. if (console_col >= CONSOLE_COLS)
  205. console_newline();
  206. return;
  207. case '\b':
  208. console_back();
  209. return;
  210. default:
  211. lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
  212. console_row * VIDEO_FONT_HEIGHT, c);
  213. if (++console_col >= CONSOLE_COLS)
  214. console_newline();
  215. }
  216. }
  217. /*----------------------------------------------------------------------*/
  218. static void lcd_stub_puts(struct stdio_dev *dev, const char *s)
  219. {
  220. lcd_puts(s);
  221. }
  222. void lcd_puts(const char *s)
  223. {
  224. if (!lcd_is_enabled) {
  225. serial_puts(s);
  226. return;
  227. }
  228. while (*s)
  229. lcd_putc(*s++);
  230. lcd_sync();
  231. }
  232. /*----------------------------------------------------------------------*/
  233. void lcd_printf(const char *fmt, ...)
  234. {
  235. va_list args;
  236. char buf[CONFIG_SYS_PBSIZE];
  237. va_start(args, fmt);
  238. vsprintf(buf, fmt, args);
  239. va_end(args);
  240. lcd_puts(buf);
  241. }
  242. /************************************************************************/
  243. /* ** Low-Level Graphics Routines */
  244. /************************************************************************/
  245. static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
  246. {
  247. uchar *dest;
  248. ushort row;
  249. #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
  250. y += BMP_LOGO_HEIGHT;
  251. #endif
  252. #if LCD_BPP == LCD_MONOCHROME
  253. ushort off = x * (1 << LCD_BPP) % 8;
  254. #endif
  255. dest = (uchar *)(lcd_base + y * lcd_line_length + x * NBITS(LCD_BPP)/8);
  256. for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
  257. uchar *s = str;
  258. int i;
  259. #if LCD_BPP == LCD_COLOR16
  260. ushort *d = (ushort *)dest;
  261. #elif LCD_BPP == LCD_COLOR32
  262. u32 *d = (u32 *)dest;
  263. #else
  264. uchar *d = dest;
  265. #endif
  266. #if LCD_BPP == LCD_MONOCHROME
  267. uchar rest = *d & -(1 << (8 - off));
  268. uchar sym;
  269. #endif
  270. for (i = 0; i < count; ++i) {
  271. uchar c, bits;
  272. c = *s++;
  273. bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
  274. #if LCD_BPP == LCD_MONOCHROME
  275. sym = (COLOR_MASK(lcd_color_fg) & bits) |
  276. (COLOR_MASK(lcd_color_bg) & ~bits);
  277. *d++ = rest | (sym >> off);
  278. rest = sym << (8-off);
  279. #elif LCD_BPP == LCD_COLOR8
  280. for (c = 0; c < 8; ++c) {
  281. *d++ = (bits & 0x80) ?
  282. lcd_color_fg : lcd_color_bg;
  283. bits <<= 1;
  284. }
  285. #elif LCD_BPP == LCD_COLOR16
  286. for (c = 0; c < 8; ++c) {
  287. *d++ = (bits & 0x80) ?
  288. lcd_color_fg : lcd_color_bg;
  289. bits <<= 1;
  290. }
  291. #elif LCD_BPP == LCD_COLOR32
  292. for (c = 0; c < 8; ++c) {
  293. *d++ = (bits & 0x80) ?
  294. lcd_color_fg : lcd_color_bg;
  295. bits <<= 1;
  296. }
  297. #endif
  298. }
  299. #if LCD_BPP == LCD_MONOCHROME
  300. *d = rest | (*d & ((1 << (8 - off)) - 1));
  301. #endif
  302. }
  303. }
  304. static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
  305. {
  306. lcd_drawchars(x, y, &c, 1);
  307. }
  308. /************************************************************************/
  309. /** Small utility to check that you got the colours right */
  310. /************************************************************************/
  311. #ifdef LCD_TEST_PATTERN
  312. #define N_BLK_VERT 2
  313. #define N_BLK_HOR 3
  314. static int test_colors[N_BLK_HOR * N_BLK_VERT] = {
  315. CONSOLE_COLOR_RED, CONSOLE_COLOR_GREEN, CONSOLE_COLOR_YELLOW,
  316. CONSOLE_COLOR_BLUE, CONSOLE_COLOR_MAGENTA, CONSOLE_COLOR_CYAN,
  317. };
  318. static void test_pattern(void)
  319. {
  320. ushort v_max = panel_info.vl_row;
  321. ushort h_max = panel_info.vl_col;
  322. ushort v_step = (v_max + N_BLK_VERT - 1) / N_BLK_VERT;
  323. ushort h_step = (h_max + N_BLK_HOR - 1) / N_BLK_HOR;
  324. ushort v, h;
  325. uchar *pix = (uchar *)lcd_base;
  326. printf("[LCD] Test Pattern: %d x %d [%d x %d]\n",
  327. h_max, v_max, h_step, v_step);
  328. /* WARNING: Code silently assumes 8bit/pixel */
  329. for (v = 0; v < v_max; ++v) {
  330. uchar iy = v / v_step;
  331. for (h = 0; h < h_max; ++h) {
  332. uchar ix = N_BLK_HOR * iy + h / h_step;
  333. *pix++ = test_colors[ix];
  334. }
  335. }
  336. }
  337. #endif /* LCD_TEST_PATTERN */
  338. /************************************************************************/
  339. /* ** GENERIC Initialization Routines */
  340. /************************************************************************/
  341. /*
  342. * With most lcd drivers the line length is set up
  343. * by calculating it from panel_info parameters. Some
  344. * drivers need to calculate the line length differently,
  345. * so make the function weak to allow overriding it.
  346. */
  347. __weak int lcd_get_size(int *line_length)
  348. {
  349. *line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
  350. return *line_length * panel_info.vl_row;
  351. }
  352. int drv_lcd_init(void)
  353. {
  354. struct stdio_dev lcddev;
  355. int rc;
  356. lcd_base = map_sysmem(gd->fb_base, 0);
  357. lcd_init(lcd_base); /* LCD initialization */
  358. /* Device initialization */
  359. memset(&lcddev, 0, sizeof(lcddev));
  360. strcpy(lcddev.name, "lcd");
  361. lcddev.ext = 0; /* No extensions */
  362. lcddev.flags = DEV_FLAGS_OUTPUT; /* Output only */
  363. lcddev.putc = lcd_stub_putc; /* 'putc' function */
  364. lcddev.puts = lcd_stub_puts; /* 'puts' function */
  365. rc = stdio_register(&lcddev);
  366. return (rc == 0) ? 1 : rc;
  367. }
  368. /*----------------------------------------------------------------------*/
  369. void lcd_clear(void)
  370. {
  371. #if LCD_BPP == LCD_MONOCHROME
  372. /* Setting the palette */
  373. lcd_initcolregs();
  374. #elif LCD_BPP == LCD_COLOR8
  375. /* Setting the palette */
  376. lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
  377. lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0);
  378. lcd_setcolreg(CONSOLE_COLOR_GREEN, 0, 0xFF, 0);
  379. lcd_setcolreg(CONSOLE_COLOR_YELLOW, 0xFF, 0xFF, 0);
  380. lcd_setcolreg(CONSOLE_COLOR_BLUE, 0, 0, 0xFF);
  381. lcd_setcolreg(CONSOLE_COLOR_MAGENTA, 0xFF, 0, 0xFF);
  382. lcd_setcolreg(CONSOLE_COLOR_CYAN, 0, 0xFF, 0xFF);
  383. lcd_setcolreg(CONSOLE_COLOR_GREY, 0xAA, 0xAA, 0xAA);
  384. lcd_setcolreg(CONSOLE_COLOR_WHITE, 0xFF, 0xFF, 0xFF);
  385. #endif
  386. #ifndef CONFIG_SYS_WHITE_ON_BLACK
  387. lcd_setfgcolor(CONSOLE_COLOR_BLACK);
  388. lcd_setbgcolor(CONSOLE_COLOR_WHITE);
  389. #else
  390. lcd_setfgcolor(CONSOLE_COLOR_WHITE);
  391. lcd_setbgcolor(CONSOLE_COLOR_BLACK);
  392. #endif /* CONFIG_SYS_WHITE_ON_BLACK */
  393. #ifdef LCD_TEST_PATTERN
  394. test_pattern();
  395. #else
  396. /* set framebuffer to background color */
  397. #if (LCD_BPP != LCD_COLOR32)
  398. memset((char *)lcd_base,
  399. COLOR_MASK(lcd_color_bg),
  400. lcd_line_length * panel_info.vl_row);
  401. #else
  402. u32 *ppix = lcd_base;
  403. u32 i;
  404. for (i = 0;
  405. i < (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
  406. i++) {
  407. *ppix++ = COLOR_MASK(lcd_color_bg);
  408. }
  409. #endif
  410. #endif
  411. /* Paint the logo and retrieve LCD base address */
  412. debug("[LCD] Drawing the logo...\n");
  413. lcd_console_address = lcd_logo();
  414. console_col = 0;
  415. console_row = 0;
  416. lcd_sync();
  417. }
  418. static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
  419. char *const argv[])
  420. {
  421. lcd_clear();
  422. return 0;
  423. }
  424. U_BOOT_CMD(
  425. cls, 1, 1, do_lcd_clear,
  426. "clear screen",
  427. ""
  428. );
  429. /*----------------------------------------------------------------------*/
  430. static int lcd_init(void *lcdbase)
  431. {
  432. /* Initialize the lcd controller */
  433. debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase);
  434. lcd_ctrl_init(lcdbase);
  435. /*
  436. * lcd_ctrl_init() of some drivers (i.e. bcm2835 on rpi_b) ignores
  437. * the 'lcdbase' argument and uses custom lcd base address
  438. * by setting up gd->fb_base. Check for this condition and fixup
  439. * 'lcd_base' address.
  440. */
  441. if (map_to_sysmem(lcdbase) != gd->fb_base)
  442. lcd_base = map_sysmem(gd->fb_base, 0);
  443. debug("[LCD] Using LCD frambuffer at %p\n", lcd_base);
  444. lcd_get_size(&lcd_line_length);
  445. lcd_is_enabled = 1;
  446. lcd_clear();
  447. lcd_enable();
  448. /* Initialize the console */
  449. console_col = 0;
  450. #ifdef CONFIG_LCD_INFO_BELOW_LOGO
  451. console_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT;
  452. #else
  453. console_row = 1; /* leave 1 blank line below logo */
  454. #endif
  455. return 0;
  456. }
  457. /************************************************************************/
  458. /* ** ROM capable initialization part - needed to reserve FB memory */
  459. /************************************************************************/
  460. /*
  461. * This is called early in the system initialization to grab memory
  462. * for the LCD controller.
  463. * Returns new address for monitor, after reserving LCD buffer memory
  464. *
  465. * Note that this is running from ROM, so no write access to global data.
  466. */
  467. ulong lcd_setmem(ulong addr)
  468. {
  469. ulong size;
  470. int line_length;
  471. debug("LCD panel info: %d x %d, %d bit/pix\n", panel_info.vl_col,
  472. panel_info.vl_row, NBITS(panel_info.vl_bpix));
  473. size = lcd_get_size(&line_length);
  474. /* Round up to nearest full page, or MMU section if defined */
  475. size = ALIGN(size, CONFIG_LCD_ALIGNMENT);
  476. addr = ALIGN(addr - CONFIG_LCD_ALIGNMENT + 1, CONFIG_LCD_ALIGNMENT);
  477. /* Allocate pages for the frame buffer. */
  478. addr -= size;
  479. debug("Reserving %ldk for LCD Framebuffer at: %08lx\n",
  480. size >> 10, addr);
  481. return addr;
  482. }
  483. /*----------------------------------------------------------------------*/
  484. static void lcd_setfgcolor(int color)
  485. {
  486. lcd_color_fg = color;
  487. }
  488. /*----------------------------------------------------------------------*/
  489. static void lcd_setbgcolor(int color)
  490. {
  491. lcd_color_bg = color;
  492. }
  493. /************************************************************************/
  494. /* ** Chipset depending Bitmap / Logo stuff... */
  495. /************************************************************************/
  496. static inline ushort *configuration_get_cmap(void)
  497. {
  498. #if defined CONFIG_CPU_PXA
  499. struct pxafb_info *fbi = &panel_info.pxa;
  500. return (ushort *)fbi->palette;
  501. #elif defined(CONFIG_MPC823)
  502. immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
  503. cpm8xx_t *cp = &(immr->im_cpm);
  504. return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
  505. #elif defined(CONFIG_ATMEL_LCD)
  506. return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
  507. #elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB)
  508. return panel_info.cmap;
  509. #elif defined(CONFIG_LCD_LOGO)
  510. return bmp_logo_palette;
  511. #else
  512. return NULL;
  513. #endif
  514. }
  515. #ifdef CONFIG_LCD_LOGO
  516. void bitmap_plot(int x, int y)
  517. {
  518. #ifdef CONFIG_ATMEL_LCD
  519. uint *cmap = (uint *)bmp_logo_palette;
  520. #else
  521. ushort *cmap = (ushort *)bmp_logo_palette;
  522. #endif
  523. ushort i, j;
  524. uchar *bmap;
  525. uchar *fb;
  526. ushort *fb16;
  527. #if defined(CONFIG_MPC823)
  528. immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
  529. cpm8xx_t *cp = &(immr->im_cpm);
  530. #endif
  531. unsigned bpix = NBITS(panel_info.vl_bpix);
  532. debug("Logo: width %d height %d colors %d cmap %d\n",
  533. BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
  534. ARRAY_SIZE(bmp_logo_palette));
  535. bmap = &bmp_logo_bitmap[0];
  536. fb = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8);
  537. if (bpix < 12) {
  538. /* Leave room for default color map
  539. * default case: generic system with no cmap (most likely 16bpp)
  540. * cmap was set to the source palette, so no change is done.
  541. * This avoids even more ifdefs in the next stanza
  542. */
  543. #if defined(CONFIG_MPC823)
  544. cmap = (ushort *) &(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]);
  545. #elif defined(CONFIG_ATMEL_LCD)
  546. cmap = (uint *)configuration_get_cmap();
  547. #else
  548. cmap = configuration_get_cmap();
  549. #endif
  550. WATCHDOG_RESET();
  551. /* Set color map */
  552. for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) {
  553. ushort colreg = bmp_logo_palette[i];
  554. #ifdef CONFIG_ATMEL_LCD
  555. uint lut_entry;
  556. #ifdef CONFIG_ATMEL_LCD_BGR555
  557. lut_entry = ((colreg & 0x000F) << 11) |
  558. ((colreg & 0x00F0) << 2) |
  559. ((colreg & 0x0F00) >> 7);
  560. #else /* CONFIG_ATMEL_LCD_RGB565 */
  561. lut_entry = ((colreg & 0x000F) << 1) |
  562. ((colreg & 0x00F0) << 3) |
  563. ((colreg & 0x0F00) << 4);
  564. #endif
  565. *(cmap + BMP_LOGO_OFFSET) = lut_entry;
  566. cmap++;
  567. #else /* !CONFIG_ATMEL_LCD */
  568. #ifdef CONFIG_SYS_INVERT_COLORS
  569. *cmap++ = 0xffff - colreg;
  570. #else
  571. *cmap++ = colreg;
  572. #endif
  573. #endif /* CONFIG_ATMEL_LCD */
  574. }
  575. WATCHDOG_RESET();
  576. for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
  577. memcpy(fb, bmap, BMP_LOGO_WIDTH);
  578. bmap += BMP_LOGO_WIDTH;
  579. fb += panel_info.vl_col;
  580. }
  581. }
  582. else { /* true color mode */
  583. u16 col16;
  584. fb16 = (ushort *)fb;
  585. for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
  586. for (j = 0; j < BMP_LOGO_WIDTH; j++) {
  587. col16 = bmp_logo_palette[(bmap[j]-16)];
  588. fb16[j] =
  589. ((col16 & 0x000F) << 1) |
  590. ((col16 & 0x00F0) << 3) |
  591. ((col16 & 0x0F00) << 4);
  592. }
  593. bmap += BMP_LOGO_WIDTH;
  594. fb16 += panel_info.vl_col;
  595. }
  596. }
  597. WATCHDOG_RESET();
  598. lcd_sync();
  599. }
  600. #else
  601. static inline void bitmap_plot(int x, int y) {}
  602. #endif /* CONFIG_LCD_LOGO */
  603. /*----------------------------------------------------------------------*/
  604. #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
  605. /*
  606. * Display the BMP file located at address bmp_image.
  607. * Only uncompressed.
  608. */
  609. #ifdef CONFIG_SPLASH_SCREEN_ALIGN
  610. #define BMP_ALIGN_CENTER 0x7FFF
  611. static void splash_align_axis(int *axis, unsigned long panel_size,
  612. unsigned long picture_size)
  613. {
  614. unsigned long panel_picture_delta = panel_size - picture_size;
  615. unsigned long axis_alignment;
  616. if (*axis == BMP_ALIGN_CENTER)
  617. axis_alignment = panel_picture_delta / 2;
  618. else if (*axis < 0)
  619. axis_alignment = panel_picture_delta + *axis + 1;
  620. else
  621. return;
  622. *axis = max(0, axis_alignment);
  623. }
  624. #endif
  625. #ifdef CONFIG_LCD_BMP_RLE8
  626. #define BMP_RLE8_ESCAPE 0
  627. #define BMP_RLE8_EOL 0
  628. #define BMP_RLE8_EOBMP 1
  629. #define BMP_RLE8_DELTA 2
  630. static void draw_unencoded_bitmap(ushort **fbp, uchar *bmap, ushort *cmap,
  631. int cnt)
  632. {
  633. while (cnt > 0) {
  634. *(*fbp)++ = cmap[*bmap++];
  635. cnt--;
  636. }
  637. }
  638. static void draw_encoded_bitmap(ushort **fbp, ushort c, int cnt)
  639. {
  640. ushort *fb = *fbp;
  641. int cnt_8copy = cnt >> 3;
  642. cnt -= cnt_8copy << 3;
  643. while (cnt_8copy > 0) {
  644. *fb++ = c;
  645. *fb++ = c;
  646. *fb++ = c;
  647. *fb++ = c;
  648. *fb++ = c;
  649. *fb++ = c;
  650. *fb++ = c;
  651. *fb++ = c;
  652. cnt_8copy--;
  653. }
  654. while (cnt > 0) {
  655. *fb++ = c;
  656. cnt--;
  657. }
  658. *fbp = fb;
  659. }
  660. /*
  661. * Do not call this function directly, must be called from lcd_display_bitmap.
  662. */
  663. static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
  664. int x_off, int y_off)
  665. {
  666. uchar *bmap;
  667. ulong width, height;
  668. ulong cnt, runlen;
  669. int x, y;
  670. int decode = 1;
  671. width = get_unaligned_le32(&bmp->header.width);
  672. height = get_unaligned_le32(&bmp->header.height);
  673. bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset);
  674. x = 0;
  675. y = height - 1;
  676. while (decode) {
  677. if (bmap[0] == BMP_RLE8_ESCAPE) {
  678. switch (bmap[1]) {
  679. case BMP_RLE8_EOL:
  680. /* end of line */
  681. bmap += 2;
  682. x = 0;
  683. y--;
  684. /* 16bpix, 2-byte per pixel, width should *2 */
  685. fb -= (width * 2 + lcd_line_length);
  686. break;
  687. case BMP_RLE8_EOBMP:
  688. /* end of bitmap */
  689. decode = 0;
  690. break;
  691. case BMP_RLE8_DELTA:
  692. /* delta run */
  693. x += bmap[2];
  694. y -= bmap[3];
  695. /* 16bpix, 2-byte per pixel, x should *2 */
  696. fb = (uchar *) (lcd_base + (y + y_off - 1)
  697. * lcd_line_length + (x + x_off) * 2);
  698. bmap += 4;
  699. break;
  700. default:
  701. /* unencoded run */
  702. runlen = bmap[1];
  703. bmap += 2;
  704. if (y < height) {
  705. if (x < width) {
  706. if (x + runlen > width)
  707. cnt = width - x;
  708. else
  709. cnt = runlen;
  710. draw_unencoded_bitmap(
  711. (ushort **)&fb,
  712. bmap, cmap, cnt);
  713. }
  714. x += runlen;
  715. }
  716. bmap += runlen;
  717. if (runlen & 1)
  718. bmap++;
  719. }
  720. } else {
  721. /* encoded run */
  722. if (y < height) {
  723. runlen = bmap[0];
  724. if (x < width) {
  725. /* aggregate the same code */
  726. while (bmap[0] == 0xff &&
  727. bmap[2] != BMP_RLE8_ESCAPE &&
  728. bmap[1] == bmap[3]) {
  729. runlen += bmap[2];
  730. bmap += 2;
  731. }
  732. if (x + runlen > width)
  733. cnt = width - x;
  734. else
  735. cnt = runlen;
  736. draw_encoded_bitmap((ushort **)&fb,
  737. cmap[bmap[1]], cnt);
  738. }
  739. x += runlen;
  740. }
  741. bmap += 2;
  742. }
  743. }
  744. }
  745. #endif
  746. #if defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
  747. #define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
  748. #else
  749. #define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
  750. #endif
  751. #if defined(CONFIG_BMP_16BPP)
  752. #if defined(CONFIG_ATMEL_LCD_BGR555)
  753. static inline void fb_put_word(uchar **fb, uchar **from)
  754. {
  755. *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
  756. *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
  757. *from += 2;
  758. }
  759. #else
  760. static inline void fb_put_word(uchar **fb, uchar **from)
  761. {
  762. *(*fb)++ = *(*from)++;
  763. *(*fb)++ = *(*from)++;
  764. }
  765. #endif
  766. #endif /* CONFIG_BMP_16BPP */
  767. int lcd_display_bitmap(ulong bmp_image, int x, int y)
  768. {
  769. #if !defined(CONFIG_MCC200)
  770. ushort *cmap = NULL;
  771. #endif
  772. ushort *cmap_base = NULL;
  773. ushort i, j;
  774. uchar *fb;
  775. bmp_image_t *bmp = (bmp_image_t *)map_sysmem(bmp_image, 0);
  776. uchar *bmap;
  777. ushort padded_width;
  778. unsigned long width, height, byte_width;
  779. unsigned long pwidth = panel_info.vl_col;
  780. unsigned colors, bpix, bmp_bpix;
  781. if (!bmp || !(bmp->header.signature[0] == 'B' &&
  782. bmp->header.signature[1] == 'M')) {
  783. printf("Error: no valid bmp image at %lx\n", bmp_image);
  784. return 1;
  785. }
  786. width = get_unaligned_le32(&bmp->header.width);
  787. height = get_unaligned_le32(&bmp->header.height);
  788. bmp_bpix = get_unaligned_le16(&bmp->header.bit_count);
  789. colors = 1 << bmp_bpix;
  790. bpix = NBITS(panel_info.vl_bpix);
  791. if (bpix != 1 && bpix != 8 && bpix != 16 && bpix != 32) {
  792. printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
  793. bpix, bmp_bpix);
  794. return 1;
  795. }
  796. /*
  797. * We support displaying 8bpp BMPs on 16bpp LCDs
  798. * and displaying 24bpp BMPs on 32bpp LCDs
  799. * */
  800. if (bpix != bmp_bpix &&
  801. !(bmp_bpix == 8 && bpix == 16) &&
  802. !(bmp_bpix == 24 && bpix == 32)) {
  803. printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
  804. bpix, get_unaligned_le16(&bmp->header.bit_count));
  805. return 1;
  806. }
  807. debug("Display-bmp: %d x %d with %d colors\n",
  808. (int)width, (int)height, (int)colors);
  809. #if !defined(CONFIG_MCC200)
  810. /* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
  811. if (bmp_bpix == 8) {
  812. cmap = configuration_get_cmap();
  813. cmap_base = cmap;
  814. /* Set color map */
  815. for (i = 0; i < colors; ++i) {
  816. bmp_color_table_entry_t cte = bmp->color_table[i];
  817. #if !defined(CONFIG_ATMEL_LCD)
  818. ushort colreg =
  819. ( ((cte.red) << 8) & 0xf800) |
  820. ( ((cte.green) << 3) & 0x07e0) |
  821. ( ((cte.blue) >> 3) & 0x001f) ;
  822. #ifdef CONFIG_SYS_INVERT_COLORS
  823. *cmap = 0xffff - colreg;
  824. #else
  825. *cmap = colreg;
  826. #endif
  827. #if defined(CONFIG_MPC823)
  828. cmap--;
  829. #else
  830. cmap++;
  831. #endif
  832. #else /* CONFIG_ATMEL_LCD */
  833. lcd_setcolreg(i, cte.red, cte.green, cte.blue);
  834. #endif
  835. }
  836. }
  837. #endif
  838. /*
  839. * BMP format for Monochrome assumes that the state of a
  840. * pixel is described on a per Bit basis, not per Byte.
  841. * So, in case of Monochrome BMP we should align widths
  842. * on a byte boundary and convert them from Bit to Byte
  843. * units.
  844. * Probably, PXA250 and MPC823 process 1bpp BMP images in
  845. * their own ways, so make the converting to be MCC200
  846. * specific.
  847. */
  848. #if defined(CONFIG_MCC200)
  849. if (bpix == 1) {
  850. width = ((width + 7) & ~7) >> 3;
  851. x = ((x + 7) & ~7) >> 3;
  852. pwidth= ((pwidth + 7) & ~7) >> 3;
  853. }
  854. #endif
  855. padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
  856. #ifdef CONFIG_SPLASH_SCREEN_ALIGN
  857. splash_align_axis(&x, pwidth, width);
  858. splash_align_axis(&y, panel_info.vl_row, height);
  859. #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
  860. if ((x + width) > pwidth)
  861. width = pwidth - x;
  862. if ((y + height) > panel_info.vl_row)
  863. height = panel_info.vl_row - y;
  864. bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset);
  865. fb = (uchar *)(lcd_base +
  866. (y + height - 1) * lcd_line_length + x * bpix / 8);
  867. switch (bmp_bpix) {
  868. case 1: /* pass through */
  869. case 8:
  870. #ifdef CONFIG_LCD_BMP_RLE8
  871. u32 compression = get_unaligned_le32(&bmp->header.compression);
  872. if (compression == BMP_BI_RLE8) {
  873. if (bpix != 16) {
  874. /* TODO implement render code for bpix != 16 */
  875. printf("Error: only support 16 bpix");
  876. return 1;
  877. }
  878. lcd_display_rle8_bitmap(bmp, cmap_base, fb, x, y);
  879. break;
  880. }
  881. #endif
  882. if (bpix != 16)
  883. byte_width = width;
  884. else
  885. byte_width = width * 2;
  886. for (i = 0; i < height; ++i) {
  887. WATCHDOG_RESET();
  888. for (j = 0; j < width; j++) {
  889. if (bpix != 16) {
  890. FB_PUT_BYTE(fb, bmap);
  891. } else {
  892. *(uint16_t *)fb = cmap_base[*(bmap++)];
  893. fb += sizeof(uint16_t) / sizeof(*fb);
  894. }
  895. }
  896. bmap += (padded_width - width);
  897. fb -= byte_width + lcd_line_length;
  898. }
  899. break;
  900. #if defined(CONFIG_BMP_16BPP)
  901. case 16:
  902. for (i = 0; i < height; ++i) {
  903. WATCHDOG_RESET();
  904. for (j = 0; j < width; j++)
  905. fb_put_word(&fb, &bmap);
  906. bmap += (padded_width - width) * 2;
  907. fb -= width * 2 + lcd_line_length;
  908. }
  909. break;
  910. #endif /* CONFIG_BMP_16BPP */
  911. #if defined(CONFIG_BMP_24BMP)
  912. case 24:
  913. for (i = 0; i < height; ++i) {
  914. for (j = 0; j < width; j++) {
  915. *(fb++) = *(bmap++);
  916. *(fb++) = *(bmap++);
  917. *(fb++) = *(bmap++);
  918. *(fb++) = 0;
  919. }
  920. fb -= lcd_line_length + width * (bpix / 8);
  921. }
  922. break;
  923. #endif /* CONFIG_BMP_24BMP */
  924. #if defined(CONFIG_BMP_32BPP)
  925. case 32:
  926. for (i = 0; i < height; ++i) {
  927. for (j = 0; j < width; j++) {
  928. *(fb++) = *(bmap++);
  929. *(fb++) = *(bmap++);
  930. *(fb++) = *(bmap++);
  931. *(fb++) = *(bmap++);
  932. }
  933. fb -= lcd_line_length + width * (bpix / 8);
  934. }
  935. break;
  936. #endif /* CONFIG_BMP_32BPP */
  937. default:
  938. break;
  939. };
  940. lcd_sync();
  941. return 0;
  942. }
  943. #endif
  944. static void *lcd_logo(void)
  945. {
  946. #ifdef CONFIG_SPLASH_SCREEN
  947. char *s;
  948. ulong addr;
  949. static int do_splash = 1;
  950. if (do_splash && (s = getenv("splashimage")) != NULL) {
  951. int x = 0, y = 0;
  952. do_splash = 0;
  953. if (splash_screen_prepare())
  954. return (void *)lcd_base;
  955. addr = simple_strtoul (s, NULL, 16);
  956. splash_get_pos(&x, &y);
  957. if (bmp_display(addr, x, y) == 0)
  958. return (void *)lcd_base;
  959. }
  960. #endif /* CONFIG_SPLASH_SCREEN */
  961. bitmap_plot(0, 0);
  962. #ifdef CONFIG_LCD_INFO
  963. console_col = LCD_INFO_X / VIDEO_FONT_WIDTH;
  964. console_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT;
  965. lcd_show_board_info();
  966. #endif /* CONFIG_LCD_INFO */
  967. #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
  968. return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
  969. #else
  970. return (void *)lcd_base;
  971. #endif /* CONFIG_LCD_LOGO && !defined(CONFIG_LCD_INFO_BELOW_LOGO) */
  972. }
  973. #ifdef CONFIG_SPLASHIMAGE_GUARD
  974. static int on_splashimage(const char *name, const char *value, enum env_op op,
  975. int flags)
  976. {
  977. ulong addr;
  978. int aligned;
  979. if (op == env_op_delete)
  980. return 0;
  981. addr = simple_strtoul(value, NULL, 16);
  982. /* See README.displaying-bmps */
  983. aligned = (addr % 4 == 2);
  984. if (!aligned) {
  985. printf("Invalid splashimage value. Value must be 16 bit aligned, but not 32 bit aligned\n");
  986. return -1;
  987. }
  988. return 0;
  989. }
  990. U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
  991. #endif
  992. void lcd_position_cursor(unsigned col, unsigned row)
  993. {
  994. console_col = min(col, CONSOLE_COLS - 1);
  995. console_row = min(row, CONSOLE_ROWS - 1);
  996. }
  997. int lcd_get_pixel_width(void)
  998. {
  999. return panel_info.vl_col;
  1000. }
  1001. int lcd_get_pixel_height(void)
  1002. {
  1003. return panel_info.vl_row;
  1004. }
  1005. int lcd_get_screen_rows(void)
  1006. {
  1007. return CONSOLE_ROWS;
  1008. }
  1009. int lcd_get_screen_columns(void)
  1010. {
  1011. return CONSOLE_COLS;
  1012. }
  1013. #if defined(CONFIG_LCD_DT_SIMPLEFB)
  1014. static int lcd_dt_simplefb_configure_node(void *blob, int off)
  1015. {
  1016. u32 stride;
  1017. fdt32_t cells[2];
  1018. int ret;
  1019. static const char format[] =
  1020. #if LCD_BPP == LCD_COLOR16
  1021. "r5g6b5";
  1022. #else
  1023. "";
  1024. #endif
  1025. if (!format[0])
  1026. return -1;
  1027. stride = panel_info.vl_col * 2;
  1028. cells[0] = cpu_to_fdt32(gd->fb_base);
  1029. cells[1] = cpu_to_fdt32(stride * panel_info.vl_row);
  1030. ret = fdt_setprop(blob, off, "reg", cells, sizeof(cells[0]) * 2);
  1031. if (ret < 0)
  1032. return -1;
  1033. cells[0] = cpu_to_fdt32(panel_info.vl_col);
  1034. ret = fdt_setprop(blob, off, "width", cells, sizeof(cells[0]));
  1035. if (ret < 0)
  1036. return -1;
  1037. cells[0] = cpu_to_fdt32(panel_info.vl_row);
  1038. ret = fdt_setprop(blob, off, "height", cells, sizeof(cells[0]));
  1039. if (ret < 0)
  1040. return -1;
  1041. cells[0] = cpu_to_fdt32(stride);
  1042. ret = fdt_setprop(blob, off, "stride", cells, sizeof(cells[0]));
  1043. if (ret < 0)
  1044. return -1;
  1045. ret = fdt_setprop(blob, off, "format", format, strlen(format) + 1);
  1046. if (ret < 0)
  1047. return -1;
  1048. ret = fdt_delprop(blob, off, "status");
  1049. if (ret < 0)
  1050. return -1;
  1051. return 0;
  1052. }
  1053. int lcd_dt_simplefb_add_node(void *blob)
  1054. {
  1055. static const char compat[] = "simple-framebuffer";
  1056. static const char disabled[] = "disabled";
  1057. int off, ret;
  1058. off = fdt_add_subnode(blob, 0, "framebuffer");
  1059. if (off < 0)
  1060. return -1;
  1061. ret = fdt_setprop(blob, off, "status", disabled, sizeof(disabled));
  1062. if (ret < 0)
  1063. return -1;
  1064. ret = fdt_setprop(blob, off, "compatible", compat, sizeof(compat));
  1065. if (ret < 0)
  1066. return -1;
  1067. return lcd_dt_simplefb_configure_node(blob, off);
  1068. }
  1069. int lcd_dt_simplefb_enable_existing_node(void *blob)
  1070. {
  1071. int off;
  1072. off = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
  1073. if (off < 0)
  1074. return -1;
  1075. return lcd_dt_simplefb_configure_node(blob, off);
  1076. }
  1077. #endif