Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
39 lines
804 B
C
39 lines
804 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __NVBIOS_BMP_H__
|
|
#define __NVBIOS_BMP_H__
|
|
static inline u16
|
|
bmp_version(struct nvkm_bios *bios)
|
|
{
|
|
if (bios->bmp_offset) {
|
|
return nvbios_rd08(bios, bios->bmp_offset + 5) << 8 |
|
|
nvbios_rd08(bios, bios->bmp_offset + 6);
|
|
}
|
|
|
|
return 0x0000;
|
|
}
|
|
|
|
static inline u16
|
|
bmp_mem_init_table(struct nvkm_bios *bios)
|
|
{
|
|
if (bmp_version(bios) >= 0x0300)
|
|
return nvbios_rd16(bios, bios->bmp_offset + 24);
|
|
return 0x0000;
|
|
}
|
|
|
|
static inline u16
|
|
bmp_sdr_seq_table(struct nvkm_bios *bios)
|
|
{
|
|
if (bmp_version(bios) >= 0x0300)
|
|
return nvbios_rd16(bios, bios->bmp_offset + 26);
|
|
return 0x0000;
|
|
}
|
|
|
|
static inline u16
|
|
bmp_ddr_seq_table(struct nvkm_bios *bios)
|
|
{
|
|
if (bmp_version(bios) >= 0x0300)
|
|
return nvbios_rd16(bios, bios->bmp_offset + 28);
|
|
return 0x0000;
|
|
}
|
|
#endif
|