/* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. * Copyright 2009 Jerome Glisse. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Dave Airlie * Alex Deucher * Jerome Glisse */ #include <linux/acpi.h> #include <linux/pci.h> #include <linux/slab.h> #include <drm/drm_device.h> #include "atom.h" #include "radeon.h" #include "radeon_reg.h" /* * BIOS. */ /* If you boot an IGP board with a discrete card as the primary, * the IGP rom is not accessible via the rom bar as the IGP rom is * part of the system bios. On boot, the system bios puts a * copy of the igp rom at the start of vram if a discrete card is * present. */ static bool igp_read_bios_from_vram(struct radeon_device *rdev) { … } static bool radeon_read_bios(struct radeon_device *rdev) { … } static bool radeon_read_platform_bios(struct radeon_device *rdev) { … } #ifdef CONFIG_ACPI /* ATRM is used to get the BIOS on the discrete cards in * dual-gpu systems. */ /* retrieve the ROM in 4k blocks */ #define ATRM_BIOS_PAGE … /** * radeon_atrm_call - fetch a chunk of the vbios * * @atrm_handle: acpi ATRM handle * @bios: vbios image pointer * @offset: offset of vbios image data to fetch * @len: length of vbios image data to fetch * * Executes ATRM to fetch a chunk of the discrete * vbios image on PX systems (all asics). * Returns the length of the buffer fetched. */ static int radeon_atrm_call(acpi_handle atrm_handle, uint8_t *bios, int offset, int len) { … } static bool radeon_atrm_get_bios(struct radeon_device *rdev) { … } #else static inline bool radeon_atrm_get_bios(struct radeon_device *rdev) { return false; } #endif static bool ni_read_disabled_bios(struct radeon_device *rdev) { … } static bool r700_read_disabled_bios(struct radeon_device *rdev) { … } static bool r600_read_disabled_bios(struct radeon_device *rdev) { … } static bool avivo_read_disabled_bios(struct radeon_device *rdev) { … } static bool legacy_read_disabled_bios(struct radeon_device *rdev) { … } static bool radeon_read_disabled_bios(struct radeon_device *rdev) { … } #ifdef CONFIG_ACPI static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) { … } #else static inline bool radeon_acpi_vfct_bios(struct radeon_device *rdev) { return false; } #endif bool radeon_get_bios(struct radeon_device *rdev) { … }