From cebb502627eeae143de67a7d531bbd8a7cf53f52 Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Mon, 19 Dec 2022 14:15:27 +0800 Subject: [PATCH] Move asserts --- test/test_a64_de2.c | 34 ++++++++++++++++++++++++++++++++++ test/test_a64_de3.c | 11 +++++++++++ test/test_a64_de4.c | 28 ++++++++++++++++++++++++++++ test/test_a64_de5.c | 14 ++++++++++++++ test/test_a64_tcon0.c | 2 +- 5 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 test/test_a64_de2.c create mode 100644 test/test_a64_de3.c create mode 100644 test/test_a64_de4.c create mode 100644 test/test_a64_de5.c diff --git a/test/test_a64_de2.c b/test/test_a64_de2.c new file mode 100644 index 0000000..d364f19 --- /dev/null +++ b/test/test_a64_de2.c @@ -0,0 +1,34 @@ +// Test Code for Allwinner A64 Display Engine +// Add `#include "../../pinephone-nuttx/test/test_a64_de2.c"` to the end of a64_de_init(), before `return OK` in this file: +// https://github.com/apache/nuttx/blob/master/arch/arm64/src/a64/a64_de.c + +{ + DEBUGASSERT(SRAM_CTRL_REG1 == 0x1C00004); + + DEBUGASSERT(pll == 0x81001701); + DEBUGASSERT(PLL_DE_CTRL_REG == 0x1C20048); + + DEBUGASSERT(clk == 0x81000000); + DEBUGASSERT(DE_CLK_REG == 0x1C20104); + + DEBUGASSERT(BUS_SOFT_RST_REG1 == 0x1C202C4); + DEBUGASSERT(BUS_CLK_GATING_REG1 == 0x1C20064); + + DEBUGASSERT(SCLK_GATE == 0x1000000); + DEBUGASSERT(AHB_RESET == 0x1000008); + DEBUGASSERT(HCLK_GATE == 0x1000004); + DEBUGASSERT(DE2TCON_MUX == 0x1000010); + + DEBUGASSERT(VS_CTRL_REG == 0x1120000); + DEBUGASSERT(UNDOC_1130000 == 0x1130000); + DEBUGASSERT(UIS_CTRL_REG1 == 0x1140000); + DEBUGASSERT(UIS_CTRL_REG2 == 0x1150000); + DEBUGASSERT(GCTRL_REG_FCE == 0x11A0000); + DEBUGASSERT(GCTRL_REG_BWS == 0x11A2000); + DEBUGASSERT(LTI_CTL == 0x11A4000); + DEBUGASSERT(LP_CTRL_REG == 0x11A6000); + DEBUGASSERT(ASE_CTL_REG == 0x11A8000); + DEBUGASSERT(FCC_CTL_REG == 0x11AA000); + DEBUGASSERT(GNECTL_REG == 0x11B0000); + DEBUGASSERT(GLB_CTL == 0x1100000); +} diff --git a/test/test_a64_de3.c b/test/test_a64_de3.c new file mode 100644 index 0000000..e569366 --- /dev/null +++ b/test/test_a64_de3.c @@ -0,0 +1,11 @@ +// Test Code for Allwinner A64 Display Engine +// Add `#include "../../pinephone-nuttx/test/test_a64_de3.c"` to the end of a64_de_blender_init(), before `return OK` in this file: +// https://github.com/apache/nuttx/blob/master/arch/arm64/src/a64/a64_de.c + +{ + DEBUGASSERT(color == 0xFF000000); + DEBUGASSERT(BLD_BK_COLOR == 0x1101088); + + DEBUGASSERT(premultiply == 0); + DEBUGASSERT(BLD_PREMUL_CTL == 0x1101084); +} diff --git a/test/test_a64_de4.c b/test/test_a64_de4.c new file mode 100644 index 0000000..a5e2313 --- /dev/null +++ b/test/test_a64_de4.c @@ -0,0 +1,28 @@ +// Test Code for Allwinner A64 Display Engine +// Add `#include "../../pinephone-nuttx/test/test_a64_de4.c"` to the end of a64_de_ui_channel_init(), before `return OK` in this file: +// https://github.com/apache/nuttx/blob/master/arch/arm64/src/a64/a64_de.c + +{ + DEBUGASSERT(OVL_UI_ATTR_CTL(channel) == 0x1103000 || OVL_UI_ATTR_CTL(channel) == 0x1104000 || OVL_UI_ATTR_CTL(channel) == 0x1105000); + DEBUGASSERT(UIS_CTRL_REG(channel) == 0x1140000 || UIS_CTRL_REG(channel) == 0x1150000 || UIS_CTRL_REG(channel) == 0x1160000); + DEBUGASSERT(attr == 0xFF000405 || attr == 0xFF000005 || attr == 0x7F000005); + + DEBUGASSERT(OVL_UI_TOP_LADD(channel) == 0x1103010 || OVL_UI_TOP_LADD(channel) == 0x1104010 || OVL_UI_TOP_LADD(channel) == 0x1105010); + DEBUGASSERT(OVL_UI_PITCH(channel) == 0x110300C || OVL_UI_PITCH(channel) == 0x110400C || OVL_UI_PITCH(channel) == 0x110500C); + DEBUGASSERT(OVL_UI_MBSIZE(channel) == 0x1103004 || OVL_UI_MBSIZE(channel) == 0x1104004 || OVL_UI_MBSIZE(channel) == 0x1105004); + DEBUGASSERT(OVL_UI_SIZE(channel) == 0x1103088 || OVL_UI_SIZE(channel) == 0x1104088 || OVL_UI_SIZE(channel) == 0x1105088); + DEBUGASSERT(OVL_UI_COOR(channel) == 0x1103008 || OVL_UI_COOR(channel) == 0x1104008 || OVL_UI_COOR(channel) == 0x1105008); + + DEBUGASSERT(BLD_SIZE == 0x110108C); + DEBUGASSERT(GLB_SIZE == 0x110000C); + + DEBUGASSERT(BLD_CH_ISIZE(pipe) == 0x1101008 || BLD_CH_ISIZE(pipe) == 0x1101018 || BLD_CH_ISIZE(pipe) == 0x1101028); + DEBUGASSERT(BLD_FILL_COLOR(pipe) == 0x1101004 || BLD_FILL_COLOR(pipe) == 0x1101014 || BLD_FILL_COLOR(pipe) == 0x1101024); + DEBUGASSERT(color == 0xFF000000); + + DEBUGASSERT(BLD_CH_OFFSET(pipe) == 0x110100C || BLD_CH_OFFSET(pipe) == 0x110101C || BLD_CH_OFFSET(pipe) == 0x110102C); + DEBUGASSERT(offset == 0 || offset == 0x340034); + + DEBUGASSERT(BLD_CTL(pipe) == 0x1101090 || BLD_CTL(pipe) == 0x1101094 || BLD_CTL(pipe) == 0x1101098); + DEBUGASSERT(UIS_CTRL_REG(channel) == 0x1140000 || UIS_CTRL_REG(channel) == 0x1150000 || UIS_CTRL_REG(channel) == 0x1160000); +} diff --git a/test/test_a64_de5.c b/test/test_a64_de5.c new file mode 100644 index 0000000..5089287 --- /dev/null +++ b/test/test_a64_de5.c @@ -0,0 +1,14 @@ +// Test Code for Allwinner A64 Display Engine +// Add `#include "../../pinephone-nuttx/test/test_a64_de5.c"` to the end of a64_de_enable(), before `return OK` in this file: +// https://github.com/apache/nuttx/blob/master/arch/arm64/src/a64/a64_de.c + +{ + DEBUGASSERT(route == 0x321 || route == 1); + DEBUGASSERT(BLD_CH_RTCTL == 0x1101080); + + DEBUGASSERT(fill == 0x701 || fill == 0x101); + DEBUGASSERT(BLD_FILL_COLOR_CTL == 0x1101000); + + DEBUGASSERT(DOUBLE_BUFFER_RDY == 1); + DEBUGASSERT(GLB_DBUFFER == 0x1100008); +} diff --git a/test/test_a64_tcon0.c b/test/test_a64_tcon0.c index d5262b8..66ea1f1 100644 --- a/test/test_a64_tcon0.c +++ b/test/test_a64_tcon0.c @@ -1,4 +1,4 @@ -// Test Code for Allwinner A64 MIPI DSI +// Test Code for Allwinner A64 TCON0 // Add `#include "../../pinephone-nuttx/test/test_a64_tcon0.c"` to the end of a64_tcon0_init(), before `return OK` in this file: // https://github.com/apache/nuttx/blob/master/arch/arm64/src/a64/a64_tcon0.c