projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Consolidate bool type
[platform/kernel/u-boot.git]
/
drivers
/
bios_emulator
/
atibios.c
diff --git
a/drivers/bios_emulator/atibios.c
b/drivers/bios_emulator/atibios.c
index
5779f99
..
3b2ed6e
100644
(file)
--- a/
drivers/bios_emulator/atibios.c
+++ b/
drivers/bios_emulator/atibios.c
@@
-3,7
+3,7
@@
* Video BOOT Graphics Card POST Module
*
* ========================================================================
* Video BOOT Graphics Card POST Module
*
* ========================================================================
-* Copyright (C) 2007 Freescale Semiconductor, Inc.
All rights reserved.
+* Copyright (C) 2007 Freescale Semiconductor, Inc.
* Jason Jin <Jason.jin@freescale.com>
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
* Jason Jin <Jason.jin@freescale.com>
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
@@
-46,19
+46,12
@@
* BIOS in u-boot.
****************************************************************************/
#include <common.h>
* BIOS in u-boot.
****************************************************************************/
#include <common.h>
-
-#ifdef CONFIG_BIOSEMU
-
#include "biosemui.h"
#include <malloc.h>
/* Length of the BIOS image */
#define MAX_BIOSLEN (128 * 1024L)
#include "biosemui.h"
#include <malloc.h>
/* Length of the BIOS image */
#define MAX_BIOSLEN (128 * 1024L)
-/* Define some useful types and macros */
-#define true 1
-#define false 0
-
/* Place to save PCI BAR's that we change and later restore */
static u32 saveROMBaseAddress;
static u32 saveBaseAddress10;
/* Place to save PCI BAR's that we change and later restore */
static u32 saveROMBaseAddress;
static u32 saveBaseAddress10;
@@
-176,7
+169,7
@@
Maps a pointer to the BIOS image on the graphics card on the PCI bus.
****************************************************************************/
void *PCI_mapBIOSImage(pci_dev_t pcidev)
{
****************************************************************************/
void *PCI_mapBIOSImage(pci_dev_t pcidev)
{
- u32 BIOSImage
Phy
s;
+ u32 BIOSImage
Bu
s;
int BIOSImageBAR;
u8 *BIOSImage;
int BIOSImageBAR;
u8 *BIOSImage;
@@
-198,16
+191,18
@@
void *PCI_mapBIOSImage(pci_dev_t pcidev)
specific programming for different cards to solve this problem.
*/
specific programming for different cards to solve this problem.
*/
- if ((BIOSImagePhys = PCI_findBIOSAddr(pcidev, &BIOSImageBAR)) == 0) {
+ BIOSImageBus = PCI_findBIOSAddr(pcidev, &BIOSImageBAR);
+ if (BIOSImageBus == 0) {
printf("Find bios addr error\n");
return NULL;
}
printf("Find bios addr error\n");
return NULL;
}
- BIOSImage = (u8 *) BIOSImagePhys;
+ BIOSImage = pci_bus_to_virt(pcidev, BIOSImageBus,
+ PCI_REGION_MEM, 0, MAP_NOCACHE);
/*Change the PCI BAR registers to map it onto the bus.*/
pci_write_config_dword(pcidev, BIOSImageBAR, 0);
/*Change the PCI BAR registers to map it onto the bus.*/
pci_write_config_dword(pcidev, BIOSImageBAR, 0);
- pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, BIOSImage
Phy
s | 0x1);
+ pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, BIOSImage
Bu
s | 0x1);
udelay(1);
udelay(1);
@@
-243,7
+238,7
@@
pcidev - PCI device info for the video card on the bus to boot
VGAInfo - BIOS emulator VGA info structure
RETURNS:
VGAInfo - BIOS emulator VGA info structure
RETURNS:
-
T
rue if successfully initialised, false if not.
+
t
rue if successfully initialised, false if not.
REMARKS:
Loads and POST's the display controllers BIOS, directly from the BIOS
REMARKS:
Loads and POST's the display controllers BIOS, directly from the BIOS
@@
-296,7
+291,7
@@
static int PCI_postController(pci_dev_t pcidev, BE_VGAInfo * VGAInfo)
PARAMETERS:
pcidev - PCI device info for the video card on the bus to boot
pVGAInfo - Place to return VGA info structure is requested
PARAMETERS:
pcidev - PCI device info for the video card on the bus to boot
pVGAInfo - Place to return VGA info structure is requested
-cleanUp -
T
rue to clean up on exit, false to leave emulator active
+cleanUp -
t
rue to clean up on exit, false to leave emulator active
REMARKS:
Boots the PCI/AGP video card on the bus using the Video ROM BIOS image
REMARKS:
Boots the PCI/AGP video card on the bus using the Video ROM BIOS image
@@
-318,7
+313,8
@@
int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo ** pVGAInfo, int cleanUp)
BE_init(0, 65536, VGAInfo, 0);
/*Post all the display controller BIOS'es*/
BE_init(0, 65536, VGAInfo, 0);
/*Post all the display controller BIOS'es*/
- PCI_postController(pcidev, VGAInfo);
+ if (!PCI_postController(pcidev, VGAInfo))
+ return false;
/*Cleanup and exit the emulator if requested. If the BIOS emulator
is needed after booting the card, we will not call BE_exit and
/*Cleanup and exit the emulator if requested. If the BIOS emulator
is needed after booting the card, we will not call BE_exit and
@@
-336,5
+332,3
@@
int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo ** pVGAInfo, int cleanUp)
*pVGAInfo = VGAInfo;
return true;
}
*pVGAInfo = VGAInfo;
return true;
}
-
-#endif