Displaying 2 results from an estimated 2 matches for "pmc_boot_1".
2020 Oct 13
3
[PATCH] drm/nouveau/device: fix changing endianess code to work on older GPUs
...ne bool
nvkm_device_endianness(struct nvkm_device *device)
{
- u32 boot1 = nvkm_rd32(device, 0x000004) & 0x01000001;
#ifdef __BIG_ENDIAN
- if (!boot1)
- return false;
+ const bool big_endian = true;
#else
- if (boot1)
- return false;
+ const bool big_endian = false;
#endif
+
+ /* Read NV_PMC_BOOT_1, and assume non-functional endian switch if it
+ * doesn't contain the expected values.
+ */
+ u32 pmc_boot_1 = nvkm_rd32(device, 0x000004);
+ if (pmc_boot_1 && pmc_boot_1 != 0x01000001)
+ return !big_endian; /* Assume GPU is LE in this case. */
+
+ /* 0 means LE and 0x01000001 means...
2020 Oct 13
0
[PATCH] drm/nouveau/device: fix changing endianess code to work on older GPUs
...0x01000001;
> #ifdef __BIG_ENDIAN
> - if (!boot1)
> - return false;
> + const bool big_endian = true;
> #else
> - if (boot1)
> - return false;
> + const bool big_endian = false;
> #endif
> +
> + /* Read NV_PMC_BOOT_1, and assume non-functional endian switch if it
> + * doesn't contain the expected values.
> + */
> + u32 pmc_boot_1 = nvkm_rd32(device, 0x000004);
> + if (pmc_boot_1 && pmc_boot_1 != 0x01000001)
Are you sure there are no other bits in there, esp on...