mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-24 11:45:27 +01:00
Merge branch 'master' of https://github.com/CloverHackyColor/CloverBootloader
This commit is contained in:
commit
31187f6e10
@ -77,13 +77,13 @@ mkdir -p ${IMGROOT}/usr/bin
|
||||
echo "[MKDIR] ${IMGROOT}/usr/local/bin"
|
||||
mkdir -p "${IMGROOT}"/usr/local/bin
|
||||
cp -p "${SYMROOT}"/utils/* "${IMGROOT}"/usr/local/bin
|
||||
echo "[MKDIR] ${IMGROOT}/Library/Application Support/Clover"
|
||||
mkdir -p "${IMGROOT}/Library/Application Support/Clover"
|
||||
cp -p "${SRCROOT}"/CloverUpdater/CloverUpdaterUtility "${IMGROOT}/Library/Application Support/Clover/"
|
||||
cp -pr "${SRCROOT}"/CloverUpdater/build/CloverUpdater.app "${IMGROOT}/Library/Application Support/Clover/"
|
||||
echo "[MKDIR] ${IMGROOT}/Library/PreferencePanes"
|
||||
mkdir -p "${IMGROOT}/Library/PreferencePanes"
|
||||
cp -pr "${SRCROOT}"/CloverPrefpane/Build/Clover.prefPane "${IMGROOT}/Library/PreferencePanes/"
|
||||
#echo "[MKDIR] ${IMGROOT}/Library/Application Support/Clover"
|
||||
#mkdir -p "${IMGROOT}/Library/Application Support/Clover"
|
||||
#cp -p "${SRCROOT}"/CloverUpdater/CloverUpdaterUtility "${IMGROOT}/Library/Application Support/Clover/"
|
||||
#cp -pr "${SRCROOT}"/CloverUpdater/build/CloverUpdater.app "${IMGROOT}/Library/Application Support/Clover/"
|
||||
#echo "[MKDIR] ${IMGROOT}/Library/PreferencePanes"
|
||||
#mkdir -p "${IMGROOT}/Library/PreferencePanes"
|
||||
#cp -pr "${SRCROOT}"/CloverPrefpane/Build/Clover.prefPane "${IMGROOT}/Library/PreferencePanes/"
|
||||
echo "[CP] cdboot"
|
||||
cp -f ${SYMROOT}/i386/cdboot ${CDBOOT}
|
||||
echo "[CP] $THEME"
|
||||
|
@ -6,8 +6,8 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Clover r5142\n"
|
||||
"POT-Creation-Date: 2021-11-02 19:01+0300\n"
|
||||
"Project-Id-Version: Clover r5145\n"
|
||||
"POT-Creation-Date: 2022-03-16 19:08+0300\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -512,7 +512,7 @@ __attribute__((noinline, section(".printf_lite")))
|
||||
#endif
|
||||
static void print_ulonglong(UINT_BIGGEST_TYPE v, unsigned int base, PrintfParams* printfParams, int printfSign)
|
||||
{
|
||||
int n = 0;
|
||||
// int n = 0;
|
||||
unsigned INT_BIGGEST_TYPE d = 1;
|
||||
#if PRINTF_LITE_FIELDWIDTH_SUPPORT == 1
|
||||
int nbDigits = 1 + printfSign;
|
||||
@ -550,7 +550,7 @@ static void print_ulonglong(UINT_BIGGEST_TYPE v, unsigned int base, PrintfParams
|
||||
#else
|
||||
print_char_macro( (char)(dgt + '0'), printfParams);
|
||||
#endif
|
||||
n += 1;
|
||||
// n += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ UINT8* mProperties = NULL;
|
||||
CHAR8* gDeviceProperties = NULL;
|
||||
|
||||
UINT32 cPropSize = 0;
|
||||
UINT8* cProperties = NULL;
|
||||
UINT8* cProperties = NULL; //this is properties as string
|
||||
CHAR8* BootOSName = NULL;
|
||||
|
||||
UINT16 KeyboardVendor = 0x05ac; //Apple inc.
|
||||
|
@ -967,6 +967,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
MsgLog("Properties with Label=%ls ignored because getDevicePath() return NULL\n", Prop.DevicePathAsString.wc_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
device = devprop_add_device_pci(device_inject_string, NULL, DevicePath);
|
||||
DBG("add device: %ls\n", Prop.DevicePathAsString.wc_str());
|
||||
for ( size_t jdx = 0 ; jdx < Prop.propertiesArray.size() ; ++jdx ) {
|
||||
@ -1799,6 +1800,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
// StringDirty = false;
|
||||
//-------
|
||||
mPropSize = (UINT32)hex2bin(newDeviceProperties, mProperties, EFI_PAGES_TO_SIZE(nbPages)); // cast should be safe as hex2bin return <= MAXUINT32
|
||||
// gDeviceProperties is not used
|
||||
gDeviceProperties = newDeviceProperties.forgetDataWithoutFreeing(); // do this AFTER hex2bin
|
||||
// DBG("Final size of mProperties=%d\n", mPropSize);
|
||||
//---------
|
||||
|
@ -142,6 +142,12 @@ const card_config_t card_configs[] = {
|
||||
{"Elqui", 5},
|
||||
{"Caroni", 5},
|
||||
{"Florin", 6},
|
||||
{"Python", 3},
|
||||
{"Adder", 3},
|
||||
{"Henbury",3},
|
||||
{"Belknap",3},
|
||||
{"Carswell",3},
|
||||
|
||||
{"Radeon",4},
|
||||
};
|
||||
|
||||
@ -320,18 +326,18 @@ const radeon_card_info_t radeon_cards[] = {
|
||||
{ 0x67CA, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull },
|
||||
{ 0x67CC, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull },
|
||||
{ 0x67CF, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull },
|
||||
{ 0x67DF, CHIP_FAMILY_ELLESMERE, "AMD Radeon RX 480/570/580", kBaladi },
|
||||
{ 0x67DF, CHIP_FAMILY_ELLESMERE, "AMD Radeon RX 480/570/580", kOrinoco },
|
||||
|
||||
// Polaris 11
|
||||
{ 0x67E0, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 460", kAcre },
|
||||
{ 0x67E1, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67E3, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67E3, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro WX4100", kNull },
|
||||
{ 0x67E7, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67E8, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67E9, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67EB, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull },
|
||||
{ 0x67EF, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro 555", kAcre }, //fb=Caroni in 10.13.6
|
||||
{ 0x67FF, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 560", kNull },
|
||||
{ 0x67EF, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro 555", kAcre }, //fb=Caroni in 10.13.6
|
||||
{ 0x67FF, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 560", kNull },
|
||||
|
||||
// PITCAIRN
|
||||
{ 0x6800, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD 7970M", kBuri }, // Mobile
|
||||
@ -504,6 +510,8 @@ const radeon_card_info_t radeon_cards[] = {
|
||||
{ 0x7300, CHIP_FAMILY_FIJI, "AMD Radeon R9 Fury", kNull },
|
||||
// Navi10
|
||||
{ 0x731F, CHIP_FAMILY_NAVI10, "AMD Radeon RX5700", kNull },
|
||||
// Navi15
|
||||
{ 0x7340, CHIP_FAMILY_NAVI10, "AMD Radeon RX5500", kNull },
|
||||
// Navi21
|
||||
{ 0x73BF, CHIP_FAMILY_NAVI20, "AMD Radeon RX6800XT", kNull },
|
||||
/*
|
||||
@ -1287,7 +1295,7 @@ AtiDevProp ati_devprop_list[] = {
|
||||
|
||||
// {FLAGTRUE, false, "ATY,MCLK", get_mclk_val, NULVAL },
|
||||
// {FLAGTRUE, false, "ATY,SCLK", get_sclk_val, NULVAL },
|
||||
{FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) },
|
||||
//{FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) },
|
||||
|
||||
{FLAGTRUE, false, "ATY,PlatformInfo", get_platforminfo_val, NULVAL },
|
||||
{FLAGOLD, false, "compatible", get_name_pci_val, NULVAL },
|
||||
@ -1312,7 +1320,7 @@ XBool get_bootdisplay_val(value_t *val, INTN index, XBool Sier)
|
||||
v = 1;
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
val->data = (__typeof__(val->data))AllocateZeroPool(4);
|
||||
*(val->data) = (UINT8)v;
|
||||
return true;
|
||||
}
|
||||
@ -1334,7 +1342,7 @@ XBool get_dual_link_val(value_t *val, INTN index, XBool Sier)
|
||||
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
val->data = (__typeof__(val->data))AllocateZeroPool(4);
|
||||
*(val->data) = (UINT8)v;
|
||||
return true;
|
||||
}
|
||||
@ -1415,6 +1423,8 @@ XBool get_name_pci_val(value_t *val, INTN index, XBool Sier)
|
||||
return true;
|
||||
}
|
||||
|
||||
const char AMDRadeon[] = "AMD Radeon %s";
|
||||
|
||||
XBool get_model_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
CHAR8 *ModelName = (__typeof__(ModelName))AllocateZeroPool(35);
|
||||
@ -1428,25 +1438,25 @@ XBool get_model_val(value_t *val, INTN index, XBool Sier)
|
||||
} else {
|
||||
switch (card->pci_dev->revision) {
|
||||
case 0xC4:
|
||||
snprintf(ModelName, 35, "AMD Radeon %s", "Pro 550");
|
||||
snprintf(ModelName, 35, AMDRadeon, "Pro 550");
|
||||
break;
|
||||
case 0xC7:
|
||||
snprintf(ModelName, 35, "AMD Radeon %s", "RX 480");
|
||||
snprintf(ModelName, 35, AMDRadeon, "RX 480");
|
||||
break;
|
||||
case 0xC5:
|
||||
case 0xCF:
|
||||
case 0xD7:
|
||||
case 0xE0:
|
||||
snprintf(ModelName, 35, "AMD Radeon %s", "RX 470");
|
||||
snprintf(ModelName, 35, AMDRadeon, "RX 470");
|
||||
break;
|
||||
case 0xC2:
|
||||
case 0xC6:
|
||||
case 0xEF:
|
||||
snprintf(ModelName, 35, "AMD Radeon %s", "RX 570");
|
||||
snprintf(ModelName, 35, AMDRadeon, "RX 570");
|
||||
break;
|
||||
|
||||
default:
|
||||
snprintf(ModelName, 35, "AMD Radeon %s", "RX 580");
|
||||
snprintf(ModelName, 35, AMDRadeon, "RX 580");
|
||||
break;
|
||||
}
|
||||
val->size = (UINT32)AsciiStrLen(ModelName);
|
||||
@ -1529,7 +1539,7 @@ XBool get_binimage_owr(value_t *val, INTN index, XBool Sier)
|
||||
}
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
val->data = (__typeof__(val->data))AllocateZeroPool(4);
|
||||
*(val->data) = 1;
|
||||
return true;
|
||||
}
|
||||
@ -1944,7 +1954,7 @@ XBool radeon_card_posted(void)
|
||||
{
|
||||
UINTN reg;
|
||||
// ati_chip_family_t chip_family = card->info->chip_family;
|
||||
#if 1
|
||||
#if 0
|
||||
//dump radeon registers after BIOS POST
|
||||
reg = (UINTN)REG32(card->mmio, RADEON_BIOS_0_SCRATCH);
|
||||
// DBG("BIOS_0_SCRATCH=0x%08llX, ", reg);
|
||||
@ -2233,7 +2243,6 @@ XBool setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DBG("ATI %s %s %dMB (%s) [%04hX:%04hX] (subsys [%04hX:%04hX]):: %s\n",
|
||||
chip_family_name[card->info->chip_family], card->info->model_name,
|
||||
(UINT32)RShiftU64(card->vram_size, 20), card->cfg_name,
|
||||
|
@ -220,8 +220,14 @@ typedef enum {
|
||||
kElqui,
|
||||
kCaroni,
|
||||
kFlorin,
|
||||
kPython,
|
||||
kAdder,
|
||||
kHenbury,
|
||||
kBelknap,
|
||||
kCarswell,
|
||||
kRadeon, // this is absent FB if not set
|
||||
kCfgEnd
|
||||
|
||||
} config_name_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1,321 +0,0 @@
|
||||
/*
|
||||
* ati.h
|
||||
*
|
||||
* Created by Slice on 19.02.12.
|
||||
*
|
||||
* the code ported from Chameleon project as well as from RadeonFB by Joblo and RadeonHD by dong
|
||||
* big thank to Islam M. Ahmed Zaid for the updating the collection
|
||||
*/
|
||||
|
||||
#include "../include/Pci.h"
|
||||
#include "device_inject.h"
|
||||
class LOADER_ENTRY;
|
||||
|
||||
#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e
|
||||
#define DATVAL(x) {kPtr, sizeof(x), (UINT8 *)x}
|
||||
#define STRVAL(x) {kStr, sizeof(x)-1, (UINT8 *)x}
|
||||
#define BYTVAL(x) {kCst, 1, (UINT8 *)(UINTN)x}
|
||||
#define WRDVAL(x) {kCst, 2, (UINT8 *)(UINTN)x}
|
||||
#define DWRVAL(x) {kCst, 4, (UINT8 *)(UINTN)x}
|
||||
// QWRVAL would work only in 64 bit
|
||||
//#define QWRVAL(x) {kCst, 8, (UINT8 *)(UINTN)x}
|
||||
#define NULVAL {kNul, 0, (UINT8 *)NULL}
|
||||
|
||||
|
||||
/*Typedefs ENUMS*/
|
||||
typedef enum {
|
||||
kNul,
|
||||
kStr,
|
||||
kPtr,
|
||||
kCst
|
||||
} type_t;
|
||||
|
||||
typedef enum {
|
||||
CHIP_FAMILY_UNKNOW,
|
||||
/* Old */
|
||||
CHIP_FAMILY_R420,
|
||||
CHIP_FAMILY_R423,
|
||||
CHIP_FAMILY_RV410,
|
||||
CHIP_FAMILY_RV515,
|
||||
CHIP_FAMILY_R520,
|
||||
CHIP_FAMILY_RV530,
|
||||
CHIP_FAMILY_RV560,
|
||||
CHIP_FAMILY_RV570,
|
||||
CHIP_FAMILY_R580,
|
||||
/* IGP */
|
||||
CHIP_FAMILY_RS600,
|
||||
CHIP_FAMILY_RS690,
|
||||
CHIP_FAMILY_RS740,
|
||||
CHIP_FAMILY_RS780,
|
||||
CHIP_FAMILY_RS880,
|
||||
/* R600 */
|
||||
CHIP_FAMILY_R600,
|
||||
CHIP_FAMILY_RV610,
|
||||
CHIP_FAMILY_RV620,
|
||||
CHIP_FAMILY_RV630,
|
||||
CHIP_FAMILY_RV635,
|
||||
CHIP_FAMILY_RV670,
|
||||
/* R700 */
|
||||
CHIP_FAMILY_RV710,
|
||||
CHIP_FAMILY_RV730,
|
||||
CHIP_FAMILY_RV740,
|
||||
CHIP_FAMILY_RV770,
|
||||
CHIP_FAMILY_RV772,
|
||||
CHIP_FAMILY_RV790,
|
||||
/* Evergreen */
|
||||
CHIP_FAMILY_CEDAR,
|
||||
CHIP_FAMILY_CYPRESS,
|
||||
CHIP_FAMILY_HEMLOCK,
|
||||
CHIP_FAMILY_JUNIPER,
|
||||
CHIP_FAMILY_REDWOOD,
|
||||
/* Northern Islands */
|
||||
CHIP_FAMILY_BARTS,
|
||||
CHIP_FAMILY_CAICOS,
|
||||
CHIP_FAMILY_CAYMAN,
|
||||
CHIP_FAMILY_TURKS,
|
||||
/* Southern Islands */
|
||||
CHIP_FAMILY_PALM,
|
||||
CHIP_FAMILY_SUMO,
|
||||
CHIP_FAMILY_SUMO2,
|
||||
CHIP_FAMILY_ARUBA,
|
||||
CHIP_FAMILY_TAHITI,
|
||||
CHIP_FAMILY_PITCAIRN,
|
||||
CHIP_FAMILY_VERDE,
|
||||
CHIP_FAMILY_OLAND,
|
||||
/* Sea Islands */
|
||||
CHIP_FAMILY_HAINAN,
|
||||
CHIP_FAMILY_BONAIRE,
|
||||
CHIP_FAMILY_KAVERI,
|
||||
CHIP_FAMILY_KABINI,
|
||||
CHIP_FAMILY_HAWAII,
|
||||
CHIP_FAMILY_MULLINS,
|
||||
/* Volcanic Islands */
|
||||
CHIP_FAMILY_TOPAZ,
|
||||
CHIP_FAMILY_AMETHYST,
|
||||
CHIP_FAMILY_TONGA,
|
||||
CHIP_FAMILY_FIJI,
|
||||
CHIP_FAMILY_CARRIZO,
|
||||
CHIP_FAMILY_TOBAGO,
|
||||
CHIP_FAMILY_ELLESMERE, /* Polaris 10 */
|
||||
CHIP_FAMILY_BAFFIN, /* Polaris 11 */
|
||||
CHIP_FAMILY_GREENLAND, /* Polaris 12 */
|
||||
CHIP_FAMILY_VEGA10, /* Vega 10 */
|
||||
CHIP_FAMILY_VEGA20, /* Vega 20 */
|
||||
CHIP_FAMILY_NAVI10,
|
||||
CHIP_FAMILY_LAST
|
||||
} ati_chip_family_t;
|
||||
|
||||
typedef struct {
|
||||
const CHAR8 *name;
|
||||
UINT8 ports;
|
||||
} card_config_t;
|
||||
|
||||
typedef enum {
|
||||
kNull,
|
||||
/* OLDController */
|
||||
kWormy,
|
||||
kAlopias,
|
||||
kCaretta,
|
||||
kKakapo,
|
||||
kKipunji,
|
||||
kPeregrine,
|
||||
kRaven,
|
||||
kSphyrna,
|
||||
/* AMD2400Controller */
|
||||
kIago,
|
||||
/* AMD2600Controller */
|
||||
kHypoprion,
|
||||
kLamna,
|
||||
/* AMD3800Controller */
|
||||
kMegalodon,
|
||||
kTriakis,
|
||||
/* AMD4600Controller */
|
||||
kFlicker,
|
||||
kGliff,
|
||||
kShrike,
|
||||
/* AMD4800Controller */
|
||||
kCardinal,
|
||||
kMotmot,
|
||||
kQuail,
|
||||
/* AMD5000Controller */
|
||||
kDouc,
|
||||
kLangur,
|
||||
kUakari,
|
||||
kZonalis,
|
||||
kAlouatta,
|
||||
kHoolock,
|
||||
kVervet,
|
||||
kBaboon,
|
||||
kEulemur,
|
||||
kGalago,
|
||||
kColobus,
|
||||
kMangabey,
|
||||
kNomascus,
|
||||
kOrangutan,
|
||||
/* AMD6000Controller */
|
||||
kPithecia,
|
||||
kBulrushes,
|
||||
kCattail,
|
||||
kHydrilla,
|
||||
kDuckweed,
|
||||
kFanwort,
|
||||
kElodea,
|
||||
kKudzu,
|
||||
kGibba,
|
||||
kLotus,
|
||||
kIpomoea,
|
||||
kMuskgrass,
|
||||
kJuncus,
|
||||
kOsmunda,
|
||||
kPondweed,
|
||||
kSpikerush,
|
||||
kTypha,
|
||||
/* AMD7000Controller */
|
||||
kRamen,
|
||||
kTako,
|
||||
kNamako,
|
||||
kAji,
|
||||
kBuri,
|
||||
kChutoro,
|
||||
kDashimaki,
|
||||
kEbi,
|
||||
kGari,
|
||||
kFutomaki,
|
||||
kHamachi,
|
||||
kOPM,
|
||||
kIkura,
|
||||
kIkuraS,
|
||||
kJunsai,
|
||||
kKani,
|
||||
kKaniS,
|
||||
kDashimakiS,
|
||||
kMaguro,
|
||||
kMaguroS,
|
||||
/* AMD8000Controller */
|
||||
kExmoor,
|
||||
kBaladi,
|
||||
/* AMD9000Controller */
|
||||
kMalteseS,
|
||||
kLagotto,
|
||||
kGreyhoundS,
|
||||
kMaltese,
|
||||
kBasset,
|
||||
kGreyhound,
|
||||
kLabrador,
|
||||
/* AMD9300Controller */
|
||||
kFleuveSWIP,
|
||||
/* AMD9500Controller */
|
||||
kAcre,
|
||||
kDayman,
|
||||
kGuariba,
|
||||
kHuallaga,
|
||||
kOrinoco,
|
||||
/* AMD9510Controller*/
|
||||
kBerbice,
|
||||
/* AMD9515Controller */
|
||||
kMazaruni,
|
||||
kLongavi,
|
||||
/* AMD9520Controller */
|
||||
kElqui,
|
||||
kCaroni,
|
||||
kFlorin,
|
||||
kRadeon, // this is absent FB if not set
|
||||
kCfgEnd
|
||||
} config_name_t;
|
||||
|
||||
typedef struct {
|
||||
UINT16 device_id;
|
||||
// UINT32 subsys_id;
|
||||
ati_chip_family_t chip_family;
|
||||
const CHAR8 *model_name;
|
||||
config_name_t cfg_name;
|
||||
} radeon_card_info_t;
|
||||
|
||||
typedef struct {
|
||||
DevPropDevice *device;
|
||||
radeon_card_info_t *info;
|
||||
pci_dt_t *pci_dev;
|
||||
UINT8 *fb;
|
||||
UINT8 *mmio;
|
||||
UINT8 *io;
|
||||
UINT8 *rom;
|
||||
UINT32 rom_size;
|
||||
UINT64 vram_size;
|
||||
const CHAR8 *cfg_name;
|
||||
UINT8 ports;
|
||||
UINT32 flags;
|
||||
BOOLEAN posted;
|
||||
} card_t;
|
||||
|
||||
// Chip flags
|
||||
/* enum radeon_chip_flags {
|
||||
RADEON_FAMILY_MASK = 0x0000ffffUL,
|
||||
RADEON_FLAGS_MASK = 0xffff0000UL,
|
||||
RADEON_IS_MOBILITY = 0x00010000UL,
|
||||
RADEON_IS_IGP = 0x00020000UL,
|
||||
RADEON_SINGLE_CRTC = 0x00040000UL,
|
||||
RADEON_IS_AGP = 0x00080000UL,
|
||||
RADEON_HAS_HIERZ = 0x00100000UL,
|
||||
RADEON_IS_PCIE = 0x00200000UL,
|
||||
RADEON_NEW_MEMMAP = 0x00400000UL,
|
||||
RADEON_IS_PCI = 0x00800000UL,
|
||||
RADEON_IS_IGPGART = 0x01000000UL,
|
||||
};*/
|
||||
#define MKFLAG(n) (1 << n)
|
||||
#define FLAGTRUE MKFLAG(0)
|
||||
#define EVERGREEN MKFLAG(1)
|
||||
#define FLAGMOBILE MKFLAG(2)
|
||||
#define FLAGOLD MKFLAG(3)
|
||||
#define FLAGNOTFAKE MKFLAG(4)
|
||||
#define FLAGDYNAMIC MKFLAG(5)
|
||||
|
||||
typedef struct {
|
||||
type_t type;
|
||||
UINT32 size;
|
||||
UINT8 *data;
|
||||
} value_t;
|
||||
|
||||
typedef struct {
|
||||
UINT32 flags;
|
||||
BOOLEAN all_ports;
|
||||
CONST CHAR8 *name;
|
||||
BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier);
|
||||
value_t default_val;
|
||||
} AtiDevProp;
|
||||
|
||||
BOOLEAN get_bootdisplay_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vrammemory_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_edid_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_display_type(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_name_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_nameparent_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vrammemsize_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_binimage_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_binimage_owr(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_deviceid_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_mclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_sclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_refclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_platforminfo_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vramtotalsize_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_dual_link_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_name_pci_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
|
||||
// Constants. Can be defined even if DONT_DEFINE_GLOBALS
|
||||
extern const radeon_card_info_t radeon_cards[];
|
||||
extern const card_config_t card_configs[];
|
||||
|
||||
#ifndef DONT_DEFINE_GLOBALS
|
||||
extern AtiDevProp ati_devprop_list[];
|
||||
extern const CHAR8 *chip_family_name[];
|
||||
#endif
|
||||
|
||||
BOOLEAN
|
||||
setup_ati_devprop (
|
||||
LOADER_ENTRY *Entry,
|
||||
pci_dt_t *ati_dev
|
||||
);
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Cleaned and merged by iNDi
|
||||
*/
|
||||
// UEFI adaptation by usr-sse2, then slice, dmazar
|
||||
// UEFI adaptation by usr-sse2, then slice, dmazar, jief
|
||||
|
||||
|
||||
|
||||
@ -114,10 +114,25 @@ UINT32 pci_config_read32(pci_dt_t *PciDt, UINT8 reg)
|
||||
return res;
|
||||
}
|
||||
|
||||
UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath)
|
||||
bool SameDevice(DevPropDevice* D1, DevPropDevice* D2)
|
||||
{
|
||||
return 0;
|
||||
// DBG("paths 1=%u 2=%u\n", D1->num_pci_devpaths, D2->num_pci_devpaths);
|
||||
if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false;
|
||||
for (UINT32 x=0; x < D1->num_pci_devpaths; x++) {
|
||||
// DBG(" funcs 1=%u 2=%u\n", D1->pci_dev_path[x].function, D2->pci_dev_path[x].function);
|
||||
if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false;
|
||||
// DBG(" devs 1=%u 2=%u\n", D1->pci_dev_path[x].device, D2->pci_dev_path[x].device);
|
||||
if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false;
|
||||
}
|
||||
DBG("found same device\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath)
|
||||
//{
|
||||
// return 0;
|
||||
//}
|
||||
//Size = GetDevicePathSize (DevicePath);
|
||||
|
||||
//dmazar: replaced by devprop_add_device_pci
|
||||
@ -132,8 +147,11 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//просмотреть StringBuf->entries[] в поисках такого же девайса
|
||||
//SameDevice(DevPropDevice* D1, DevPropDevice* D2)
|
||||
|
||||
if (!DevicePath && (PciDt != 0)) {
|
||||
DevicePath = DevicePathFromHandle(PciDt->DeviceHandle);
|
||||
DevicePath = DevicePathFromHandle(PciDt->DeviceHandle);
|
||||
}
|
||||
// DBG("devprop_add_device_pci %ls ", DevicePathToStr(DevicePath));
|
||||
if (!DevicePath)
|
||||
@ -171,10 +189,9 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
|
||||
DevicePath = NextDevicePathNode(DevicePath);
|
||||
if (DevicePath->Type == HARDWARE_DEVICE_PATH && DevicePath->SubType == HW_PCI_DP) {
|
||||
CopyMem(&device->pci_dev_path[NumPaths], DevicePath, sizeof(struct PCIDevPath));
|
||||
// DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device);
|
||||
// DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device);
|
||||
} else {
|
||||
// not PCI path - break the loop
|
||||
// DBG("not PCI ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -195,7 +212,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
|
||||
|
||||
device->string = StringBuf;
|
||||
device->data = NULL;
|
||||
StringBuf->length += device->length;
|
||||
|
||||
|
||||
if(!StringBuf->entries) {
|
||||
StringBuf->entries = (DevPropDevice**)AllocateZeroPool(MAX_NUM_DEVICES * sizeof(device));
|
||||
@ -205,6 +222,16 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
|
||||
}
|
||||
}
|
||||
|
||||
DevPropDevice* D1;
|
||||
for (int i=0; i<StringBuf->numentries; i++) {
|
||||
D1 = StringBuf->entries[i];
|
||||
if (SameDevice(D1, device)) {
|
||||
FreePool(device);
|
||||
return D1;
|
||||
}
|
||||
}
|
||||
|
||||
StringBuf->length += device->length;
|
||||
StringBuf->entries[StringBuf->numentries++] = device;
|
||||
|
||||
return device;
|
||||
@ -283,16 +310,16 @@ XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer
|
||||
XBuffer<char> devprop_generate_string(DevPropString *StringBuf)
|
||||
{
|
||||
UINTN len = StringBuf->length * 2;
|
||||
INT32 i = 0;
|
||||
UINT32 x = 0;
|
||||
|
||||
XBuffer<char> buffer;
|
||||
buffer.dataSized(len+1);
|
||||
|
||||
// DBG("devprop_generate_string\n");
|
||||
// DbgHeader("Devprop Generate String");
|
||||
|
||||
buffer.S8Catf("%08X%08X%04hX%04hX", SwapBytes32(StringBuf->length), StringBuf->WHAT2, SwapBytes16(StringBuf->numentries), StringBuf->WHAT3);
|
||||
while(i < StringBuf->numentries) {
|
||||
for (int i = 0; i < StringBuf->numentries; i++) {
|
||||
UINT8 *dataptr = StringBuf->entries[i]->data;
|
||||
if (!dataptr) continue;
|
||||
buffer.S8Catf("%08X%04hX%04hX", SwapBytes32(StringBuf->entries[i]->length),
|
||||
SwapBytes16(StringBuf->entries[i]->numentries), StringBuf->entries[i]->WHAT2); //FIXME: wrong buffer sizes!
|
||||
|
||||
@ -302,8 +329,8 @@ XBuffer<char> devprop_generate_string(DevPropString *StringBuf)
|
||||
SwapBytes32(StringBuf->entries[i]->acpi_dev_path._HID),
|
||||
SwapBytes32(StringBuf->entries[i]->acpi_dev_path._UID));
|
||||
|
||||
for(x = 0; x < StringBuf->entries[i]->num_pci_devpaths; x++) {
|
||||
buffer.S8Catf("%02hhX%02hhX%04hX%02hhX%02hhX", StringBuf->entries[i]->pci_dev_path[x].type,
|
||||
for(int x = 0; x < StringBuf->entries[i]->num_pci_devpaths; x++) {
|
||||
buffer.S8Catf("%02hhX%02hhX%04hX%02hhX%02hhX", StringBuf->entries[i]->pci_dev_path[x].type,
|
||||
StringBuf->entries[i]->pci_dev_path[x].subtype,
|
||||
SwapBytes16(StringBuf->entries[i]->pci_dev_path[x].length),
|
||||
StringBuf->entries[i]->pci_dev_path[x].function,
|
||||
@ -314,11 +341,12 @@ XBuffer<char> devprop_generate_string(DevPropString *StringBuf)
|
||||
StringBuf->entries[i]->path_end.subtype,
|
||||
SwapBytes16(StringBuf->entries[i]->path_end.length));
|
||||
|
||||
for(x = 0; x < (StringBuf->entries[i]->length) - (24 + (6 * StringBuf->entries[i]->num_pci_devpaths)); x++) {
|
||||
for(UINT32 x = 0; x < (StringBuf->entries[i]->length) - (24 + (6 * StringBuf->entries[i]->num_pci_devpaths)); x++) {
|
||||
buffer.S8Catf("%02hhX", *dataptr++);
|
||||
}
|
||||
i++;
|
||||
|
||||
}
|
||||
// DBG("string=%s\n", buffer.data());
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,6 @@ struct DevPropDevice {
|
||||
struct DevPropString *string;
|
||||
// ------------------------
|
||||
};
|
||||
|
||||
typedef struct DevPropDevice DevPropDevice;
|
||||
|
||||
struct DevPropString {
|
||||
@ -112,10 +111,10 @@ struct DevPropString {
|
||||
typedef struct DevPropString DevPropString;
|
||||
|
||||
#ifndef DONT_DEFINE_GLOBALS
|
||||
extern UINT32 devices_number;
|
||||
extern DevPropString *device_inject_string;
|
||||
extern UINT8 *device_inject_stringdata;
|
||||
extern UINT32 device_inject_stringlength;
|
||||
extern UINT32 devices_number;
|
||||
extern DevPropString *device_inject_string;
|
||||
extern UINT8 *device_inject_stringdata;
|
||||
extern UINT32 device_inject_stringlength;
|
||||
#endif
|
||||
|
||||
DevPropString *devprop_create_string(void);
|
||||
@ -129,6 +128,6 @@ void devprop_free_string(DevPropString *string);
|
||||
XBool set_eth_props(pci_dt_t *eth_dev);
|
||||
XBool set_usb_props(pci_dt_t *usb_dev);
|
||||
|
||||
UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath);
|
||||
//UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath);
|
||||
|
||||
#endif /* !__LIBSAIO_DEVICE_INJECT_H */
|
||||
|
@ -527,28 +527,28 @@ EFI_STATUS LoadPlist(const XStringW& ConfName, C* plist)
|
||||
XBool parsingOk = plist->parse((const CHAR8*)ConfigPtr, Size, ""_XS8, &xmlLiteParser);
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 0 ) {
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 1 ) {
|
||||
DebugLog(2, "There are problems in plist '%ls'\n", configPlistPath.wc_str());
|
||||
DebugLog(1, "There are problems in plist '%ls'\n", configPlistPath.wc_str());
|
||||
}else{
|
||||
DebugLog(2, "There is a problem in plist '%ls'\n", configPlistPath.wc_str());
|
||||
DebugLog(1, "There is a problem in plist '%ls'\n", configPlistPath.wc_str());
|
||||
}
|
||||
for ( size_t idx = 0 ; idx < xmlLiteParser.getXmlParserMessageArray().size() ; idx++ ) {
|
||||
const XmlParserMessage& xmlMsg = xmlLiteParser.getXmlParserMessageArray()[idx];
|
||||
if ( xmlMsg.type != XmlParserMessageType::info ) {
|
||||
DebugLog(2, "%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
DebugLog(1, "%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
}
|
||||
}
|
||||
DebugLog(2, "Use CloverConfigPlistValidator");
|
||||
DebugLog(1, "Use CloverConfigPlistValidator");
|
||||
if ( plist->getSMBIOS().dgetModel() < MaxMacModel ) {
|
||||
if ( xmlLiteParser.productNameNeeded ) DebugLog(2, " (with --productname=%s)", MachineModelName[plist->getSMBIOS().dgetModel()].c_str());
|
||||
if ( xmlLiteParser.productNameNeeded ) DebugLog(1, " (with --productname=%s)", MachineModelName[plist->getSMBIOS().dgetModel()].c_str());
|
||||
}else{
|
||||
// This is NOT supposed to happen, since CLover set a default mac model
|
||||
// If a default mac model is not set, a crash would probably happen earlier, but who knows
|
||||
if ( xmlLiteParser.productNameNeeded ) DebugLog(2, "(with --productname=?)");
|
||||
if ( xmlLiteParser.productNameNeeded ) DebugLog(1, "(with --productname=?)");
|
||||
}
|
||||
DebugLog(2, " or look in the log\n");
|
||||
DebugLog(1, " or look in the log\n");
|
||||
}
|
||||
if ( !parsingOk ) {
|
||||
DebugLog(2, "Parsing error while parsing '%ls'.\n", configPlistPath.wc_str());
|
||||
DebugLog(1, "Parsing error while parsing '%ls'.\n", configPlistPath.wc_str());
|
||||
Status = EFI_LOAD_ERROR;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ int XStringAbstract__startWith(const S* src, const O* other, bool ignoreCase)
|
||||
template<typename S, typename O>
|
||||
int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignoreCase)
|
||||
{
|
||||
size_t nb = 0;
|
||||
// size_t nb = 0;
|
||||
const S* src2 = src;
|
||||
const O* other2 = other;
|
||||
|
||||
@ -75,7 +75,7 @@ int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignor
|
||||
if ( src_char32 != other_char32 ) return false;
|
||||
src2 = get_char32_from_string(src2, &src_char32);
|
||||
other2 = get_char32_from_string(other2, &other_char32);
|
||||
nb += 1;
|
||||
// nb += 1;
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
@ -3037,7 +3037,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
//Now we have to reinit handles
|
||||
Status = ReinitRefitLib();
|
||||
if (EFI_ERROR(Status)){
|
||||
DebugLog(2, " %s", efiStrError(Status));
|
||||
// DebugLog(2, " %s", efiStrError(Status));
|
||||
PauseForKey("Error reinit refit."_XS8);
|
||||
#ifdef ENABLE_SECURE_BOOT
|
||||
UninstallSecureBoot();
|
||||
|
Loading…
Reference in New Issue
Block a user