-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/gma500: Unify _get_core_freq for cdv and psb
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
- Loading branch information
Patrik Jakobsson
committed
Mar 17, 2014
1 parent
778e26d
commit f35257a
Showing
5 changed files
with
82 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/************************************************************************** | ||
* Copyright (c) 2011, Intel Corporation. | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
**************************************************************************/ | ||
|
||
#include <drm/drmP.h> | ||
#include "psb_drv.h" | ||
|
||
void gma_get_core_freq(struct drm_device *dev) | ||
{ | ||
uint32_t clock; | ||
struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0); | ||
struct drm_psb_private *dev_priv = dev->dev_private; | ||
|
||
/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/ | ||
/*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/ | ||
|
||
pci_write_config_dword(pci_root, 0xD0, 0xD0050300); | ||
pci_read_config_dword(pci_root, 0xD4, &clock); | ||
pci_dev_put(pci_root); | ||
|
||
switch (clock & 0x07) { | ||
case 0: | ||
dev_priv->core_freq = 100; | ||
break; | ||
case 1: | ||
dev_priv->core_freq = 133; | ||
break; | ||
case 2: | ||
dev_priv->core_freq = 150; | ||
break; | ||
case 3: | ||
dev_priv->core_freq = 178; | ||
break; | ||
case 4: | ||
dev_priv->core_freq = 200; | ||
break; | ||
case 5: | ||
case 6: | ||
case 7: | ||
dev_priv->core_freq = 266; | ||
break; | ||
default: | ||
dev_priv->core_freq = 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/************************************************************************** | ||
* Copyright (c) 2011, Intel Corporation. | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
**************************************************************************/ | ||
|
||
#ifndef _GMA_DEVICE_H | ||
#define _GMA_DEVICE_H | ||
|
||
extern void gma_get_core_freq(struct drm_device *dev); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters