1 // SPDX-License-Identifier: GPL-2.0-only
2 /**************************************************************************
3 * Copyright (c) 2011, Intel Corporation.
6 **************************************************************************/
10 void gma_get_core_freq(struct drm_device
*dev
)
13 struct pci_dev
*pci_root
=
14 pci_get_domain_bus_and_slot(pci_domain_nr(dev
->pdev
->bus
),
16 struct drm_psb_private
*dev_priv
= dev
->dev_private
;
18 /*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
19 /*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/
21 pci_write_config_dword(pci_root
, 0xD0, 0xD0050300);
22 pci_read_config_dword(pci_root
, 0xD4, &clock
);
23 pci_dev_put(pci_root
);
25 switch (clock
& 0x07) {
27 dev_priv
->core_freq
= 100;
30 dev_priv
->core_freq
= 133;
33 dev_priv
->core_freq
= 150;
36 dev_priv
->core_freq
= 178;
39 dev_priv
->core_freq
= 200;
44 dev_priv
->core_freq
= 266;
47 dev_priv
->core_freq
= 0;