* Map AtomBIOS specified by PCI rom into virtual memory
* Point AtomBIOS to PCI rom mapped in memory * Things no longer crash, but we get an Invalid BIOS Magic error in the logs. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42543 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -71,8 +71,10 @@ struct radeon_shared_info {
|
|||||||
area_id mode_list_area; // area containing display mode list
|
area_id mode_list_area; // area containing display mode list
|
||||||
uint32 mode_count;
|
uint32 mode_count;
|
||||||
|
|
||||||
uint32 rom_base; // AtomBIOS base location
|
uint32 rom_phys; // rom base location
|
||||||
uint32 rom_size; // AtomBIOS size
|
area_id rom_area; // area of mapped rom
|
||||||
|
uint32 rom_size; // rom size
|
||||||
|
uint8* rom; // virtual memory mapped PCI ROM
|
||||||
|
|
||||||
display_mode current_mode;
|
display_mode current_mode;
|
||||||
uint32 bytes_per_row;
|
uint32 bytes_per_row;
|
||||||
|
|||||||
@@ -1048,8 +1048,8 @@ atom_index_iio(atom_context *ctx, int base)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
atom_context
|
atom_context*
|
||||||
*atom_parse(card_info *card, void *bios)
|
atom_parse(card_info *card, void *bios)
|
||||||
{
|
{
|
||||||
int base;
|
int base;
|
||||||
atom_context *ctx = (atom_context*)malloc(sizeof(atom_context));
|
atom_context *ctx = (atom_context*)malloc(sizeof(atom_context));
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ bios_init()
|
|||||||
atom_card_info->pll_write = _write32;
|
atom_card_info->pll_write = _write32;
|
||||||
|
|
||||||
// Point AtomBIOS parser to card bios and malloc gAtomBIOS
|
// Point AtomBIOS parser to card bios and malloc gAtomBIOS
|
||||||
gAtomBIOS = atom_parse(atom_card_info, (void*)gInfo->shared_info->rom_base);
|
gAtomBIOS = atom_parse(atom_card_info, gInfo->shared_info->rom);
|
||||||
|
|
||||||
if (gAtomBIOS == NULL) {
|
if (gAtomBIOS == NULL) {
|
||||||
TRACE("%s: couldn't parse system AtomBIOS\n", __func__);
|
TRACE("%s: couldn't parse system AtomBIOS\n", __func__);
|
||||||
|
|||||||
@@ -84,6 +84,19 @@ radeon_hd_init(radeon_info &info)
|
|||||||
return info.framebuffer_area;
|
return info.framebuffer_area;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *** AtomBIOS mapping
|
||||||
|
AreaKeeper romMapper;
|
||||||
|
info.rom_area = romMapper.Map("radeon hd AtomBIOS",
|
||||||
|
(void *)info.pci->u.h0.rom_base,
|
||||||
|
info.pci->u.h0.rom_size,
|
||||||
|
B_ANY_KERNEL_ADDRESS, B_READ_AREA | B_WRITE_AREA,
|
||||||
|
(void **)&info.shared_info->rom);
|
||||||
|
if (frambufferMapper.InitCheck() < B_OK) {
|
||||||
|
dprintf(DEVICE_NAME ": card(%ld): could not map AtomBIOS!\n",
|
||||||
|
info.id);
|
||||||
|
return info.rom_area;
|
||||||
|
}
|
||||||
|
|
||||||
// Turn on write combining for the area
|
// Turn on write combining for the area
|
||||||
vm_set_area_memory_type(info.framebuffer_area,
|
vm_set_area_memory_type(info.framebuffer_area,
|
||||||
info.pci->u.h0.base_registers[RHD_FB_BAR], B_MTR_WC);
|
info.pci->u.h0.base_registers[RHD_FB_BAR], B_MTR_WC);
|
||||||
@@ -91,6 +104,7 @@ radeon_hd_init(radeon_info &info)
|
|||||||
sharedCreator.Detach();
|
sharedCreator.Detach();
|
||||||
mmioMapper.Detach();
|
mmioMapper.Detach();
|
||||||
frambufferMapper.Detach();
|
frambufferMapper.Detach();
|
||||||
|
romMapper.Detach();
|
||||||
|
|
||||||
// Pass common information to accelerant
|
// Pass common information to accelerant
|
||||||
info.shared_info->device_id = info.device_id;
|
info.shared_info->device_id = info.device_id;
|
||||||
@@ -101,9 +115,9 @@ radeon_hd_init(radeon_info &info)
|
|||||||
= info.pci->u.h0.base_registers[RHD_FB_BAR];
|
= info.pci->u.h0.base_registers[RHD_FB_BAR];
|
||||||
info.shared_info->frame_buffer_int
|
info.shared_info->frame_buffer_int
|
||||||
= read32(info.registers + R6XX_CONFIG_FB_BASE);
|
= read32(info.registers + R6XX_CONFIG_FB_BASE);
|
||||||
|
info.shared_info->rom_area = info.rom_area;
|
||||||
info.shared_info->rom_base = info.pci->u.h0.rom_base;
|
info.shared_info->rom_phys = info.pci->u.h0.rom_base;
|
||||||
// Grab ROM base from PCI (AtomBIOS location for card)
|
info.shared_info->rom_size = info.pci->u.h0.rom_size;
|
||||||
|
|
||||||
strcpy(info.shared_info->device_identifier, info.device_identifier);
|
strcpy(info.shared_info->device_identifier, info.device_identifier);
|
||||||
|
|
||||||
@@ -167,5 +181,6 @@ radeon_hd_uninit(radeon_info &info)
|
|||||||
delete_area(info.shared_area);
|
delete_area(info.shared_area);
|
||||||
delete_area(info.registers_area);
|
delete_area(info.registers_area);
|
||||||
delete_area(info.framebuffer_area);
|
delete_area(info.framebuffer_area);
|
||||||
|
delete_area(info.rom_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ struct radeon_info {
|
|||||||
uint8* registers;
|
uint8* registers;
|
||||||
area_id registers_area;
|
area_id registers_area;
|
||||||
area_id framebuffer_area;
|
area_id framebuffer_area;
|
||||||
|
area_id rom_area;
|
||||||
|
|
||||||
struct radeon_shared_info* shared_info;
|
struct radeon_shared_info* shared_info;
|
||||||
area_id shared_area;
|
area_id shared_area;
|
||||||
|
|||||||
Reference in New Issue
Block a user