mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 02:25:21 +07:00
52d2d44eee
-----BEGIN PGP SIGNATURE----- iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl0Gj1MeHHRvcnZhbGRz QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGctkH/0At3+SQPY2JJSy8 i6+TDeytFx9OggeGLPHChRfehkAlvMb/kd34QHnuEvDqUuCAMU6HZQJFKoK9mvFI sDJVayPGDSqpm+iv8qLpMBPShiCXYVnGZeVfOdv36jUswL0k6wHV1pz4avFkDeZa 1F4pmI6O2XRkNTYQawbUaFkAngWUCBG9ECLnHJnuIY6ohShBvjI4+E2JUaht+8gO M2h2b9ieddWmjxV3LTKgsK1v+347RljxdZTWnJ62SCDSEVZvsgSA9W2wnebVhBkJ drSmrFLxNiM+W45mkbUFmQixRSmjv++oRR096fxAnodBxMw0TDxE1RiMQWE6rVvG N6MC6xA= =+B0P -----END PGP SIGNATURE----- Merge v5.2-rc5 into drm-next Maarten needs -rc4 backmerged so he can pull in the fbcon notifier removal topic branch into drm-misc-next. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/**************************************************************************
|
|
* Copyright (c) 2011, Intel Corporation.
|
|
* All Rights Reserved.
|
|
*
|
|
**************************************************************************/
|
|
|
|
#include "psb_drv.h"
|
|
|
|
void gma_get_core_freq(struct drm_device *dev)
|
|
{
|
|
uint32_t clock;
|
|
struct pci_dev *pci_root =
|
|
pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
|
|
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;
|
|
}
|
|
}
|