Make some more SandyBridge specifics into Platform Control Hub (PCH) specifics.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42868 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2011-10-16 19:36:02 +00:00
parent 3aaf71a600
commit 9e2e0d8dac
4 changed files with 21 additions and 16 deletions
@@ -119,6 +119,11 @@ struct DeviceType {
{
return (type & INTEL_TYPE_MODEL_MASK) == model;
}
bool HasPlatformControlHub() const
{
return InGroup(INTEL_TYPE_SNB);
}
};
// info about PLL on graphics card
@@ -209,9 +209,9 @@ intel_init_accelerant(int device)
// assume it is the valid panel size..
// Later we query for proper EDID info if it exists, or figure something
// else out. (Default modes, etc.)
bool isSNB = gInfo->shared_info->device_type.InGroup(INTEL_TYPE_SNB);
if ((isSNB && (lvds & PCH_LVDS_DETECTED) != 0)
|| (!isSNB && (lvds & DISPLAY_PIPE_ENABLED) != 0)) {
bool hasPCH = gInfo->shared_info->device_type.HasPlatformControlHub();
if ((hasPCH && (lvds & PCH_LVDS_DETECTED) != 0)
|| (!hasPCH && (lvds & DISPLAY_PIPE_ENABLED) != 0)) {
save_lvds_mode();
gInfo->head_mode |= HEAD_MODE_LVDS_PANEL;
}
@@ -95,14 +95,14 @@ enable_display_pipe(bool enable)
static void
enable_lvds_panel(bool enable)
{
bool isSNB = gInfo->shared_info->device_type.InGroup(INTEL_TYPE_SNB);
if (isSNB) {
// TODO: fix for SNB
bool hasPCH = gInfo->shared_info->device_type.HasPlatformControlHub();
if (hasPCH) {
// TODO: fix for PCH
return;
}
int controlRegister = isSNB ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL;
int statusRegister = isSNB ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS;
int controlRegister = hasPCH ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL;
int statusRegister = hasPCH ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS;
uint32 control = read32(controlRegister);
uint32 panelStatus;
@@ -110,7 +110,7 @@ enable_lvds_panel(bool enable)
if (enable) {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) == 0) {
write32(controlRegister, control | PANEL_CONTROL_POWER_TARGET_ON
| (isSNB ? PANEL_REGISTER_UNLOCK : 0));
| (hasPCH ? PANEL_REGISTER_UNLOCK : 0));
}
do {
@@ -119,7 +119,7 @@ enable_lvds_panel(bool enable)
} else {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) != 0) {
write32(controlRegister, (control & ~PANEL_CONTROL_POWER_TARGET_ON)
| (isSNB ? PANEL_REGISTER_UNLOCK : 0));
| (hasPCH ? PANEL_REGISTER_UNLOCK : 0));
}
do {
@@ -83,8 +83,8 @@ intel_interrupt_handler(void* data)
int32 handled = B_HANDLED_INTERRUPT;
// TODO: verify that these aren't actually the same
bool isSNB = info.device_type.InGroup(INTEL_TYPE_SNB);
uint16 mask = isSNB ? PCH_INTERRUPT_VBLANK_PIPEA : INTERRUPT_VBLANK_PIPEA;
bool hasPCH = info.device_type.HasPlatformControlHub();
uint16 mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEA : INTERRUPT_VBLANK_PIPEA;
if ((identity & mask) != 0) {
handled = release_vblank_sem(info);
@@ -93,7 +93,7 @@ intel_interrupt_handler(void* data)
DISPLAY_PIPE_VBLANK_STATUS | DISPLAY_PIPE_VBLANK_ENABLED);
}
mask = isSNB ? PCH_INTERRUPT_VBLANK_PIPEB : INTERRUPT_VBLANK_PIPEB;
mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEB : INTERRUPT_VBLANK_PIPEB;
if ((identity & mask) != 0) {
handled = release_vblank_sem(info);
@@ -145,8 +145,8 @@ init_interrupt_handler(intel_info &info)
write16(info, INTEL_INTERRUPT_IDENTITY, ~0);
// enable interrupts - we only want VBLANK interrupts
bool isSNB = info.device_type.InGroup(INTEL_TYPE_SNB);
uint16 enable = isSNB
bool hasPCH = info.device_type.HasPlatformControlHub();
uint16 enable = hasPCH
? (PCH_INTERRUPT_VBLANK_PIPEA | PCH_INTERRUPT_VBLANK_PIPEB)
: (INTERRUPT_VBLANK_PIPEA | INTERRUPT_VBLANK_PIPEB);
@@ -248,7 +248,7 @@ intel_extreme_init(intel_info &info)
blocks[REGISTER_BLOCK(REGS_FLAT)] = 0;
// setup the register blocks for the different architectures
if (info.device_type.InGroup(INTEL_TYPE_SNB)) {
if (info.device_type.HasPlatformControlHub()) {
// PCH based platforms (IronLake and up)
blocks[REGISTER_BLOCK(REGS_INTERRUPT)]
= PCH_DE_INTERRUPT_REGISTER_BASE;