1 /**************************************************************************
2 * Copyright (c) 2011, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 **************************************************************************/
19 void gma_get_core_freq(struct drm_device
*dev
)
22 struct pci_dev
*pci_root
= pci_get_bus_and_slot(0, 0);
23 struct drm_psb_private
*dev_priv
= dev
->dev_private
;
25 /*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
26 /*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/
28 pci_write_config_dword(pci_root
, 0xD0, 0xD0050300);
29 pci_read_config_dword(pci_root
, 0xD4, &clock
);
30 pci_dev_put(pci_root
);
32 switch (clock
& 0x07) {
34 dev_priv
->core_freq
= 100;
37 dev_priv
->core_freq
= 133;
40 dev_priv
->core_freq
= 150;
43 dev_priv
->core_freq
= 178;
46 dev_priv
->core_freq
= 200;
51 dev_priv
->core_freq
= 266;
54 dev_priv
->core_freq
= 0;