Lines Matching +full:display +full:- +full:height +full:- +full:chars
1 // SPDX-License-Identifier: GPL-2.0-or-later
38 /* Is boot-info compatible ? */
40 ((bi)->compatible_version <= BOOT_INFO_VERSION)
41 #define BOOT_INFO_IS_V2_COMPATIBLE(bi) ((bi)->version >= 2)
42 #define BOOT_INFO_IS_V4_COMPATIBLE(bi) ((bi)->version >= 4)
56 btext_drawtext(p, q - p); in bootx_printf()
95 u32 *ppp = &np->properties; in bootx_early_getprop()
101 if (strcmp((char *)((unsigned long)pp->name + base), in bootx_early_getprop()
103 return (void *)((unsigned long)pp->value + base); in bootx_early_getprop()
105 ppp = &pp->next; in bootx_early_getprop()
125 return s - os; in bootx_dt_find_string()
165 if (bootx_info->kernelParamsOffset) { in bootx_add_chosen_props()
167 bootx_info->kernelParamsOffset; in bootx_add_chosen_props()
170 if (bootx_info->ramDisk) { in bootx_add_chosen_props()
171 val = ((unsigned long)bootx_info) + bootx_info->ramDisk; in bootx_add_chosen_props()
172 bootx_dt_add_prop("linux,initrd-start", &val, 4, mem_end); in bootx_add_chosen_props()
173 val += bootx_info->ramDiskSize; in bootx_add_chosen_props()
174 bootx_dt_add_prop("linux,initrd-end", &val, 4, mem_end); in bootx_add_chosen_props()
177 bootx_dt_add_prop("linux,stdout-path", bootx_disp_path, in bootx_add_chosen_props()
189 bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); in bootx_add_display_props()
192 bootx_dt_add_prop("linux,bootx-noscreen", NULL, 0, mem_end); in bootx_add_display_props()
194 tmp = bi->dispDeviceDepth; in bootx_add_display_props()
195 bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); in bootx_add_display_props()
196 tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; in bootx_add_display_props()
197 bootx_dt_add_prop("linux,bootx-width", &tmp, 4, mem_end); in bootx_add_display_props()
198 tmp = bi->dispDeviceRect[3] - bi->dispDeviceRect[1]; in bootx_add_display_props()
199 bootx_dt_add_prop("linux,bootx-height", &tmp, 4, mem_end); in bootx_add_display_props()
200 tmp = bi->dispDeviceRowBytes; in bootx_add_display_props()
201 bootx_dt_add_prop("linux,bootx-linebytes", &tmp, 4, mem_end); in bootx_add_display_props()
202 tmp = (u32)bi->dispDeviceBase; in bootx_add_display_props()
204 tmp = (u32)bi->logicalDisplayBase; in bootx_add_display_props()
205 tmp += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; in bootx_add_display_props()
206 tmp += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); in bootx_add_display_props()
207 bootx_dt_add_prop("linux,bootx-addr", &tmp, 4, mem_end); in bootx_add_display_props()
222 u32 *cpp, *ppp = &np->properties; in bootx_scan_dt_build_strings()
227 namep = np->full_name ? (char *)(base + np->full_name) : NULL; in bootx_scan_dt_build_strings()
237 bootx_dt_add_string("linux,stdout-path", mem_end); in bootx_scan_dt_build_strings()
238 bootx_dt_add_string("linux,initrd-start", mem_end); in bootx_scan_dt_build_strings()
239 bootx_dt_add_string("linux,initrd-end", mem_end); in bootx_scan_dt_build_strings()
243 if (node == bootx_info->dispDeviceRegEntryOffset) { in bootx_scan_dt_build_strings()
244 DBG(" detected display ! adding properties names !\n"); in bootx_scan_dt_build_strings()
245 bootx_dt_add_string("linux,boot-display", mem_end); in bootx_scan_dt_build_strings()
255 namep = pp->name ? (char *)(base + pp->name) : NULL; in bootx_scan_dt_build_strings()
263 ppp = &pp->next; in bootx_scan_dt_build_strings()
267 cpp = &np->child; in bootx_scan_dt_build_strings()
271 cpp = &np->sibling; in bootx_scan_dt_build_strings()
280 u32 *cpp, *ppp = &np->properties; in bootx_scan_dt_build_struct()
287 namep = np->full_name ? (char *)(base + np->full_name) : NULL; in bootx_scan_dt_build_struct()
294 /* Fixup an Apple bug where they have bogus \0 chars in the in bootx_scan_dt_build_struct()
314 namep = pp->name ? (char *)(base + pp->name) : NULL; in bootx_scan_dt_build_struct()
324 pp->value ? (void *)(base + pp->value): NULL, in bootx_scan_dt_build_struct()
325 pp->length, mem_end); in bootx_scan_dt_build_struct()
327 ppp = &pp->next; in bootx_scan_dt_build_struct()
332 if (bootx_info->dispDeviceRegEntryOffset == 0) in bootx_scan_dt_build_struct()
335 else if (node == bootx_info->dispDeviceRegEntryOffset) in bootx_scan_dt_build_struct()
339 cpp = &np->child; in bootx_scan_dt_build_struct()
343 cpp = &np->sibling; in bootx_scan_dt_build_struct()
365 hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - mem_start; in bootx_flatten_dt()
369 base = ((unsigned long)bi) + bi->deviceTreeOffset; in bootx_flatten_dt()
379 bootx_dt_add_string("linux,bootx-noscreen", &mem_end); in bootx_flatten_dt()
380 bootx_dt_add_string("linux,bootx-depth", &mem_end); in bootx_flatten_dt()
381 bootx_dt_add_string("linux,bootx-width", &mem_end); in bootx_flatten_dt()
382 bootx_dt_add_string("linux,bootx-height", &mem_end); in bootx_flatten_dt()
383 bootx_dt_add_string("linux,bootx-linebytes", &mem_end); in bootx_flatten_dt()
384 bootx_dt_add_string("linux,bootx-addr", &mem_end); in bootx_flatten_dt()
386 hdr->off_dt_strings = bootx_dt_strbase - mem_start; in bootx_flatten_dt()
387 hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; in bootx_flatten_dt()
392 hdr->off_dt_struct = mem_end - mem_start; in bootx_flatten_dt()
397 hdr->boot_cpuid_phys = 0; in bootx_flatten_dt()
398 hdr->magic = OF_DT_HEADER; in bootx_flatten_dt()
399 hdr->totalsize = mem_end - mem_start; in bootx_flatten_dt()
400 hdr->version = OF_DT_VERSION; in bootx_flatten_dt()
402 hdr->last_comp_version = 0x10; in bootx_flatten_dt()
412 if (bootx_info->ramDisk) { in bootx_flatten_dt()
413 rsvmap[2] = ((unsigned long)bootx_info) + bootx_info->ramDisk; in bootx_flatten_dt()
414 rsvmap[3] = rsvmap[2] + bootx_info->ramDiskSize; in bootx_flatten_dt()
434 bootx_printf("\nframe buffer at : 0x%x", bi->dispDeviceBase); in btext_welcome()
435 bootx_printf(" (phys), 0x%x", bi->logicalDisplayBase); in btext_welcome()
454 bootx_printf("bi->deviceTreeOffset : 0x%x\n", in btext_welcome()
455 bi->deviceTreeOffset); in btext_welcome()
456 bootx_printf("bi->deviceTreeSize : 0x%x\n", in btext_welcome()
457 bi->deviceTreeSize); in btext_welcome()
484 bi->logicalDisplayBase = bi->dispDeviceBase; in bootx_init()
486 /* Fixup depth 16 -> 15 as that's what MacOS calls 16bpp */ in bootx_init()
487 if (bi->dispDeviceDepth == 16) in bootx_init()
488 bi->dispDeviceDepth = 15; in bootx_init()
492 ptr = (unsigned long)bi->logicalDisplayBase; in bootx_init()
493 ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; in bootx_init()
494 ptr += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); in bootx_init()
495 btext_setup_display(bi->dispDeviceRect[2] - bi->dispDeviceRect[0], in bootx_init()
496 bi->dispDeviceRect[3] - bi->dispDeviceRect[1], in bootx_init()
497 bi->dispDeviceDepth, bi->dispDeviceRowBytes, in bootx_init()
498 (unsigned long)bi->logicalDisplayBase); in bootx_init()
504 * Test if boot-info is compatible. Done only in config in bootx_init()
506 * with an incompatible version, except display a message in bootx_init()
509 * I'll try to keep enough of boot-info compatible in the in bootx_init()
510 * future to always allow display of this message; in bootx_init()
513 bootx_printf(" !!! WARNING - Incompatible version" in bootx_init()
518 if (bi->architecture != BOOT_ARCH_PCI) { in bootx_init()
519 bootx_printf(" !!! WARNING - Unsupported machine" in bootx_init()
532 if (bi->version < 4) { in bootx_init()
536 model = (char *) bootx_early_getprop(r4 + bi->deviceTreeOffset, in bootx_init()
549 if (bi->version < 5) { in bootx_init()
550 space = bi->deviceTreeOffset + bi->deviceTreeSize; in bootx_init()
551 if (bi->ramDisk >= space) in bootx_init()
552 space = bi->ramDisk + bi->ramDiskSize; in bootx_init()
554 space = bi->totalParamsSize; in bootx_init()
561 if (bi->version < 4) { in bootx_init()
568 * are in the hash table - the aim is to try to avoid in bootx_init()
576 /* Ok, now we need to generate a flattened device-tree to pass in bootx_init()
592 reloc_got2(-offset); in bootx_init()