mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-30 21:20:15 +01:00
nouveau: try to fix big endian.
This commit is contained in:
parent
20928a2f2b
commit
9b294bbe0e
2 changed files with 12 additions and 3 deletions
|
|
@ -57,6 +57,7 @@
|
|||
# define NV50_FIFO_REGS_DMAGET(i) (NV50_FIFO_REGS(i)+0x44)
|
||||
|
||||
#define NV03_PMC_BOOT_0 0x00000000
|
||||
#define NV03_PMC_BOOT_1 0x00000004
|
||||
#define NV03_PMC_INTR_0 0x00000100
|
||||
# define NV_PMC_INTR_0_PFIFO_PENDING (1<< 8)
|
||||
# define NV_PMC_INTR_0_PGRAPH_PENDING (1<<12)
|
||||
|
|
|
|||
|
|
@ -283,6 +283,10 @@ nouveau_card_init(struct drm_device *dev)
|
|||
ret = nouveau_init_card_mappings(dev);
|
||||
if (ret) return ret;
|
||||
|
||||
/* Put the card in BE mode if it's not */
|
||||
if (NV_READ(NV03_PMC_BOOT_1))
|
||||
NV_WRITE(NV03_PMC_BOOT_1,0x01000001);
|
||||
|
||||
/* Determine exact chipset we're running on */
|
||||
if (dev_priv->card_type < NV_10)
|
||||
dev_priv->chipset = dev_priv->card_type;
|
||||
|
|
@ -404,7 +408,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
|
|||
{
|
||||
struct drm_nouveau_private *dev_priv;
|
||||
void __iomem *regs;
|
||||
uint32_t reg0;
|
||||
uint32_t reg0,reg1;
|
||||
uint8_t architecture = 0;
|
||||
|
||||
dev_priv = drm_calloc(1, sizeof(*dev_priv), DRM_MEM_DRIVER);
|
||||
|
|
@ -422,7 +426,11 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
|
|||
DRM_ERROR("Could not ioremap to determine register\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
reg0 = readl(regs);
|
||||
|
||||
reg0 = readl(regs+NV03_PMC_BOOT_0);
|
||||
reg1 = readl(regs+NV03_PMC_BOOT_1);
|
||||
if (reg1)
|
||||
reg0=___swab32(reg0);
|
||||
|
||||
/* We're dealing with >=NV10 */
|
||||
if ((reg0 & 0x0f000000) > 0 ) {
|
||||
|
|
@ -457,7 +465,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
|
|||
dev_priv->card_type = NV_UNKNOWN;
|
||||
}
|
||||
|
||||
DRM_INFO("Detected an NV%d generation card\n", dev_priv->card_type);
|
||||
DRM_INFO("Detected an NV%d generation card (0x%08x)\n", dev_priv->card_type,reg0);
|
||||
|
||||
if (dev_priv->card_type == NV_UNKNOWN) {
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue