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)
41 lines
657 B
C
41 lines
657 B
C
/*
|
|
* Copyright 2014, Michael Ellerman, IBM Corp.
|
|
* Licensed under GPLv2.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "ebb.h"
|
|
|
|
|
|
/*
|
|
* Test basic access to the EBB regs, they should be user accessible with no
|
|
* kernel interaction required.
|
|
*/
|
|
int reg_access(void)
|
|
{
|
|
uint64_t val, expected;
|
|
|
|
SKIP_IF(!ebb_is_supported());
|
|
|
|
expected = 0x8000000100000000ull;
|
|
mtspr(SPRN_BESCR, expected);
|
|
val = mfspr(SPRN_BESCR);
|
|
|
|
FAIL_IF(val != expected);
|
|
|
|
expected = 0x0000000001000000ull;
|
|
mtspr(SPRN_EBBHR, expected);
|
|
val = mfspr(SPRN_EBBHR);
|
|
|
|
FAIL_IF(val != expected);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
return test_harness(reg_access, "reg_access");
|
|
}
|