Lines Matching +full:rom +full:-
1 // SPDX-License-Identifier: GPL-2.0
8 * Copyright (C) 2003-2004 Linux Networx
10 * Copyright (C) 2003-2006 Ronald G. Minnich <rminnich@gmail.com>
11 * Copyright (C) 2004-2005 Li-Ta Lo <ollie@lanl.gov>
12 * Copyright (C) 2005-2006 Tyan
14 * Copyright (C) 2005-2009 coresystems GmbH
19 * Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
20 * David Mosberger-Tang
22 * Copyright 1997 -- 1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
45 if (gd->arch.prev_sleep_state == ACPI_S3) { in board_should_run_oprom()
77 vendev = pplat->vendor << 16 | pplat->device; in pci_rom_probe()
89 return -ENOENT; in pci_rom_probe()
92 /* Enable expansion ROM address decoding. */ in pci_rom_probe()
96 debug("Option ROM address %x\n", rom_address); in pci_rom_probe()
99 debug("PCI expansion ROM, signature %#04x, INIT size %#04x, data ptr %#04x\n", in pci_rom_probe()
100 le16_to_cpu(rom_header->signature), in pci_rom_probe()
101 rom_header->size * 512, le16_to_cpu(rom_header->data)); in pci_rom_probe()
103 if (le16_to_cpu(rom_header->signature) != PCI_ROM_HDR) { in pci_rom_probe()
104 printf("Incorrect expansion ROM header signature %04x\n", in pci_rom_probe()
105 le16_to_cpu(rom_header->signature)); in pci_rom_probe()
107 /* Disable expansion ROM address decoding */ in pci_rom_probe()
110 return -EINVAL; in pci_rom_probe()
113 rom_data = (((void *)rom_header) + le16_to_cpu(rom_header->data)); in pci_rom_probe()
114 rom_vendor = le16_to_cpu(rom_data->vendor); in pci_rom_probe()
115 rom_device = le16_to_cpu(rom_data->device); in pci_rom_probe()
117 debug("PCI ROM image, vendor ID %04x, device ID %04x,\n", in pci_rom_probe()
121 if ((pplat->vendor != rom_vendor || pplat->device != rom_device) && in pci_rom_probe()
128 rom_class = (le16_to_cpu(rom_data->class_hi) << 8) | rom_data->class_lo; in pci_rom_probe()
129 debug("PCI ROM image, Class Code %06x, Code Type %02x\n", in pci_rom_probe()
130 rom_class, rom_data->type); in pci_rom_probe()
132 if (pplat->class != rom_class) { in pci_rom_probe()
133 debug("Class Code mismatch ROM %06x, dev %06x\n", in pci_rom_probe()
134 rom_class, pplat->class); in pci_rom_probe()
142 * pci_rom_load() - Load a ROM image and return a pointer to it
144 * @rom_header: Pointer to ROM image
148 * @return 0 if OK, -ve on error. Note that @allocedp is set up regardless of
167 le16_to_cpu(rom_header->data)); in pci_rom_load()
169 image_size = le16_to_cpu(rom_data->ilen) * 512; in pci_rom_load()
170 } while ((rom_data->type != 0) && (rom_data->indicator == 0)); in pci_rom_load()
172 if (rom_data->type != 0) in pci_rom_load()
173 return -EACCES; in pci_rom_load()
175 rom_size = rom_header->size * 512; in pci_rom_load()
182 return -ENOMEM; in pci_rom_load()
188 debug("Copying VGA ROM Image from %p to %p, 0x%x bytes\n", in pci_rom_load()
192 printf("VGA ROM copy failed\n"); in pci_rom_load()
193 return -EFAULT; in pci_rom_load()
209 if (!vesa->x_resolution || !vesa->y_resolution) in setup_video()
212 screen_info->orig_video_isVGA = VIDEO_TYPE_VLFB; in setup_video()
214 screen_info->lfb_width = vesa->x_resolution; in setup_video()
215 screen_info->lfb_height = vesa->y_resolution; in setup_video()
216 screen_info->lfb_depth = vesa->bits_per_pixel; in setup_video()
217 screen_info->lfb_linelength = vesa->bytes_per_scanline; in setup_video()
218 screen_info->lfb_base = vesa->phys_base_ptr; in setup_video()
219 screen_info->lfb_size = in setup_video()
220 ALIGN(screen_info->lfb_linelength * screen_info->lfb_height, in setup_video()
222 screen_info->lfb_size >>= 16; in setup_video()
223 screen_info->red_size = vesa->red_mask_size; in setup_video()
224 screen_info->red_pos = vesa->red_mask_pos; in setup_video()
225 screen_info->green_size = vesa->green_mask_size; in setup_video()
226 screen_info->green_pos = vesa->green_mask_pos; in setup_video()
227 screen_info->blue_size = vesa->blue_mask_size; in setup_video()
228 screen_info->blue_pos = vesa->blue_mask_pos; in setup_video()
229 screen_info->rsvd_size = vesa->reserved_mask_size; in setup_video()
230 screen_info->rsvd_pos = vesa->reserved_mask_pos; in setup_video()
237 struct pci_rom_header *rom = NULL, *ram = NULL; in dm_pci_run_vga_bios() local
238 int vesa_mode = -1; in dm_pci_run_vga_bios()
243 if (((pplat->class >> 8) ^ PCI_CLASS_DISPLAY_VGA) & 0xff00) { in dm_pci_run_vga_bios()
244 debug("%s: Class %#x, should be %#x\n", __func__, pplat->class, in dm_pci_run_vga_bios()
246 return -ENODEV; in dm_pci_run_vga_bios()
250 return log_msg_ret("Should not load OPROM", -ENXIO); in dm_pci_run_vga_bios()
252 ret = pci_rom_probe(dev, &rom); in dm_pci_run_vga_bios()
256 ret = pci_rom_load(rom, &ram, &alloced); in dm_pci_run_vga_bios()
261 ret = -ENXIO; in dm_pci_run_vga_bios()
277 ret = -ENOSYS; in dm_pci_run_vga_bios()
287 printf("BIOS emulation not available - see CONFIG_BIOSEMU\n"); in dm_pci_run_vga_bios()
288 ret = -ENOSYS; in dm_pci_run_vga_bios()
330 if (!vesa->x_resolution) in vbe_setup_video_priv()
331 return log_msg_ret("No x resolution", -ENXIO); in vbe_setup_video_priv()
332 uc_priv->xsize = vesa->x_resolution; in vbe_setup_video_priv()
333 uc_priv->ysize = vesa->y_resolution; in vbe_setup_video_priv()
334 uc_priv->line_length = vesa->bytes_per_scanline; in vbe_setup_video_priv()
335 switch (vesa->bits_per_pixel) { in vbe_setup_video_priv()
338 uc_priv->bpix = VIDEO_BPP32; in vbe_setup_video_priv()
341 uc_priv->bpix = VIDEO_BPP16; in vbe_setup_video_priv()
344 return -EPROTONOSUPPORT; in vbe_setup_video_priv()
346 plat->base = vesa->phys_base_ptr; in vbe_setup_video_priv()
347 plat->size = vesa->bytes_per_scanline * vesa->y_resolution; in vbe_setup_video_priv()
361 return -EPERM; in vbe_setup_video()
378 printf("Video: %dx%dx%d\n", uc_priv->xsize, uc_priv->ysize, in vbe_setup_video()