123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500 |
- // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
- /*
- * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
- */
- #include <common.h>
- #include <console.h>
- #include <init.h>
- #include <log.h>
- #include <rand.h>
- #include <watchdog.h>
- #include <asm/io.h>
- #include <linux/log2.h>
- #include "stm32mp1_tests.h"
- #define ADDR_INVALID 0xFFFFFFFF
- #define PATTERN_DEFAULT "-"
- DECLARE_GLOBAL_DATA_PTR;
- static int get_bufsize(char *string, int argc, char *argv[], int arg_nb,
- size_t *bufsize, size_t default_size, size_t min_size)
- {
- unsigned long value;
- if (argc > arg_nb) {
- if (strict_strtoul(argv[arg_nb], 0, &value) < 0) {
- sprintf(string, "invalid %d parameter %s",
- arg_nb, argv[arg_nb]);
- return -1;
- }
- if (value > STM32_DDR_SIZE || value < min_size) {
- sprintf(string, "invalid size %s (min=%d)",
- argv[arg_nb], min_size);
- return -1;
- }
- if (value & (min_size - 1)) {
- sprintf(string, "unaligned size %s (min=%d)",
- argv[arg_nb], min_size);
- return -1;
- }
- *bufsize = value;
- } else {
- if (default_size != STM32_DDR_SIZE)
- *bufsize = default_size;
- else
- *bufsize = get_ram_size((long *)STM32_DDR_BASE,
- STM32_DDR_SIZE);
- }
- return 0;
- }
- static int get_nb_loop(char *string, int argc, char *argv[], int arg_nb,
- u32 *nb_loop, u32 default_nb_loop)
- {
- unsigned long value;
- if (argc > arg_nb) {
- if (strict_strtoul(argv[arg_nb], 0, &value) < 0) {
- sprintf(string, "invalid %d parameter %s",
- arg_nb, argv[arg_nb]);
- return -1;
- }
- if (value == 0)
- printf("WARNING: infinite loop requested\n");
- *nb_loop = value;
- } else {
- *nb_loop = default_nb_loop;
- }
- return 0;
- }
- static int get_addr(char *string, int argc, char *argv[], int arg_nb,
- u32 *addr)
- {
- unsigned long value;
- if (argc > arg_nb) {
- if (strict_strtoul(argv[arg_nb], 16, &value) < 0) {
- sprintf(string, "invalid %d parameter %s",
- arg_nb, argv[arg_nb]);
- return -1;
- }
- if (value < STM32_DDR_BASE) {
- sprintf(string, "too low address %s", argv[arg_nb]);
- return -1;
- }
- if (value & 0x3 && value != ADDR_INVALID) {
- sprintf(string, "unaligned address %s",
- argv[arg_nb]);
- return -1;
- }
- *addr = value;
- } else {
- *addr = STM32_DDR_BASE;
- }
- return 0;
- }
- static int get_pattern(char *string, int argc, char *argv[], int arg_nb,
- u32 *pattern, u32 default_pattern)
- {
- unsigned long value;
- if (argc > arg_nb) {
- if (!strcmp(argv[arg_nb], PATTERN_DEFAULT)) {
- *pattern = default_pattern;
- return 0;
- }
- if (strict_strtoul(argv[arg_nb], 16, &value) < 0) {
- sprintf(string, "invalid %d parameter %s",
- arg_nb, argv[arg_nb]);
- return -1;
- }
- *pattern = value;
- } else {
- *pattern = default_pattern;
- }
- return 0;
- }
- static u32 check_addr(u32 addr, u32 value)
- {
- u32 data = readl(addr);
- if (value != data) {
- printf("0x%08x: 0x%08x <=> 0x%08x", addr, data, value);
- data = readl(addr);
- printf("(2nd read: 0x%08x)", data);
- if (value == data)
- printf("- read error");
- else
- printf("- write error");
- printf("\n");
- return -1;
- }
- return 0;
- }
- static int progress(u32 offset)
- {
- if (!(offset & 0xFFFFFF)) {
- putc('.');
- if (ctrlc()) {
- printf("\ntest interrupted!\n");
- return 1;
- }
- }
- return 0;
- }
- static int test_loop_end(u32 *loop, u32 nb_loop, u32 progress)
- {
- (*loop)++;
- if (nb_loop && *loop >= nb_loop)
- return 1;
- if ((*loop) % progress)
- return 0;
- /* allow to interrupt the test only for progress step */
- if (ctrlc()) {
- printf("test interrupted!\n");
- return 1;
- }
- printf("loop #%d\n", *loop);
- WATCHDOG_RESET();
- return 0;
- }
- /**********************************************************************
- *
- * Function: memTestDataBus()
- *
- * Description: Test the data bus wiring in a memory region by
- * performing a walking 1's test at a fixed address
- * within that region. The address is selected
- * by the caller.
- *
- * Notes:
- *
- * Returns: 0 if the test succeeds.
- * A non-zero result is the first pattern that failed.
- *
- **********************************************************************/
- static u32 databus(u32 *address)
- {
- u32 pattern;
- u32 read_value;
- /* Perform a walking 1's test at the given address. */
- for (pattern = 1; pattern != 0; pattern <<= 1) {
- /* Write the test pattern. */
- writel(pattern, address);
- /* Read it back (immediately is okay for this test). */
- read_value = readl(address);
- debug("%x: %x <=> %x\n",
- (u32)address, read_value, pattern);
- if (read_value != pattern)
- return pattern;
- }
- return 0;
- }
- /**********************************************************************
- *
- * Function: memTestAddressBus()
- *
- * Description: Test the address bus wiring in a memory region by
- * performing a walking 1's test on the relevant bits
- * of the address and checking for aliasing. This test
- * will find single-bit address failures such as stuck
- * -high, stuck-low, and shorted pins. The base address
- * and size of the region are selected by the caller.
- *
- * Notes: For best results, the selected base address should
- * have enough LSB 0's to guarantee single address bit
- * changes. For example, to test a 64-Kbyte region,
- * select a base address on a 64-Kbyte boundary. Also,
- * select the region size as a power-of-two--if at all
- * possible.
- *
- * Returns: NULL if the test succeeds.
- * A non-zero result is the first address at which an
- * aliasing problem was uncovered. By examining the
- * contents of memory, it may be possible to gather
- * additional information about the problem.
- *
- **********************************************************************/
- static u32 *addressbus(u32 *address, u32 nb_bytes)
- {
- u32 mask = (nb_bytes / sizeof(u32) - 1);
- u32 offset;
- u32 test_offset;
- u32 read_value;
- u32 pattern = 0xAAAAAAAA;
- u32 antipattern = 0x55555555;
- /* Write the default pattern at each of the power-of-two offsets. */
- for (offset = 1; (offset & mask) != 0; offset <<= 1)
- writel(pattern, &address[offset]);
- /* Check for address bits stuck high. */
- test_offset = 0;
- writel(antipattern, &address[test_offset]);
- for (offset = 1; (offset & mask) != 0; offset <<= 1) {
- read_value = readl(&address[offset]);
- debug("%x: %x <=> %x\n",
- (u32)&address[offset], read_value, pattern);
- if (read_value != pattern)
- return &address[offset];
- }
- writel(pattern, &address[test_offset]);
- /* Check for address bits stuck low or shorted. */
- for (test_offset = 1; (test_offset & mask) != 0; test_offset <<= 1) {
- writel(antipattern, &address[test_offset]);
- if (readl(&address[0]) != pattern)
- return &address[test_offset];
- for (offset = 1; (offset & mask) != 0; offset <<= 1) {
- if (readl(&address[offset]) != pattern &&
- offset != test_offset)
- return &address[test_offset];
- }
- writel(pattern, &address[test_offset]);
- }
- return NULL;
- }
- /**********************************************************************
- *
- * Function: memTestDevice()
- *
- * Description: Test the integrity of a physical memory device by
- * performing an increment/decrement test over the
- * entire region. In the process every storage bit
- * in the device is tested as a zero and a one. The
- * base address and the size of the region are
- * selected by the caller.
- *
- * Notes:
- *
- * Returns: NULL if the test succeeds.
- *
- * A non-zero result is the first address at which an
- * incorrect value was read back. By examining the
- * contents of memory, it may be possible to gather
- * additional information about the problem.
- *
- **********************************************************************/
- static u32 *memdevice(u32 *address, u32 nb_bytes)
- {
- u32 offset;
- u32 nb_words = nb_bytes / sizeof(u32);
- u32 pattern;
- u32 antipattern;
- puts("Fill with pattern");
- /* Fill memory with a known pattern. */
- for (pattern = 1, offset = 0; offset < nb_words; pattern++, offset++) {
- writel(pattern, &address[offset]);
- if (progress(offset))
- return NULL;
- }
- puts("\nCheck and invert pattern");
- /* Check each location and invert it for the second pass. */
- for (pattern = 1, offset = 0; offset < nb_words; pattern++, offset++) {
- if (readl(&address[offset]) != pattern)
- return &address[offset];
- antipattern = ~pattern;
- writel(antipattern, &address[offset]);
- if (progress(offset))
- return NULL;
- }
- puts("\nCheck inverted pattern");
- /* Check each location for the inverted pattern and zero it. */
- for (pattern = 1, offset = 0; offset < nb_words; pattern++, offset++) {
- antipattern = ~pattern;
- if (readl(&address[offset]) != antipattern)
- return &address[offset];
- if (progress(offset))
- return NULL;
- }
- printf("\n");
- return NULL;
- }
- static enum test_result databuswalk0(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- int i;
- u32 loop = 0, nb_loop;
- u32 addr;
- u32 error = 0;
- u32 data;
- if (get_nb_loop(string, argc, argv, 0, &nb_loop, 100))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%x\n", nb_loop, addr);
- while (!error) {
- for (i = 0; i < 32; i++)
- writel(~(1 << i), addr + 4 * i);
- for (i = 0; i < 32; i++) {
- data = readl(addr + 4 * i);
- if (~(1 << i) != data) {
- error |= 1 << i;
- debug("%x: error %x expected %x => error:%x\n",
- addr + 4 * i, data, ~(1 << i), error);
- }
- }
- if (test_loop_end(&loop, nb_loop, 1000))
- break;
- for (i = 0; i < 32; i++)
- writel(0, addr + 4 * i);
- }
- if (error) {
- sprintf(string, "loop %d: error for bits 0x%x",
- loop, error);
- return TEST_FAILED;
- }
- sprintf(string, "no error for %d loops", loop);
- return TEST_PASSED;
- }
- static enum test_result databuswalk1(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- int i;
- u32 loop = 0, nb_loop;
- u32 addr;
- u32 error = 0;
- u32 data;
- if (get_nb_loop(string, argc, argv, 0, &nb_loop, 100))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%x\n", nb_loop, addr);
- while (!error) {
- for (i = 0; i < 32; i++)
- writel(1 << i, addr + 4 * i);
- for (i = 0; i < 32; i++) {
- data = readl(addr + 4 * i);
- if ((1 << i) != data) {
- error |= 1 << i;
- debug("%x: error %x expected %x => error:%x\n",
- addr + 4 * i, data, (1 << i), error);
- }
- }
- if (test_loop_end(&loop, nb_loop, 1000))
- break;
- for (i = 0; i < 32; i++)
- writel(0, addr + 4 * i);
- }
- if (error) {
- sprintf(string, "loop %d: error for bits 0x%x",
- loop, error);
- return TEST_FAILED;
- }
- sprintf(string, "no error for %d loops", loop);
- return TEST_PASSED;
- }
- static enum test_result test_databus(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr;
- u32 error;
- if (get_addr(string, argc, argv, 0, &addr))
- return TEST_ERROR;
- error = databus((u32 *)addr);
- if (error) {
- sprintf(string, "0x%x: error for bits 0x%x",
- addr, error);
- return TEST_FAILED;
- }
- sprintf(string, "address 0x%x", addr);
- return TEST_PASSED;
- }
- static enum test_result test_addressbus(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr;
- u32 bufsize;
- u32 error;
- if (get_bufsize(string, argc, argv, 0, &bufsize, STM32_DDR_SIZE, 4))
- return TEST_ERROR;
- if (!is_power_of_2(bufsize)) {
- sprintf(string, "size 0x%x is not a power of 2",
- (u32)bufsize);
- return TEST_ERROR;
- }
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- printf("running at 0x%08x length 0x%x\n", addr, bufsize);
- error = (u32)addressbus((u32 *)addr, bufsize);
- if (error) {
- sprintf(string, "0x%x: error for address 0x%x",
- addr, error);
- return TEST_FAILED;
- }
- sprintf(string, "address 0x%x, size 0x%x",
- addr, bufsize);
- return TEST_PASSED;
- }
- static enum test_result test_memdevice(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr;
- size_t bufsize;
- u32 error;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 4))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- error = (u32)memdevice((u32 *)addr, (unsigned long)bufsize);
- if (error) {
- sprintf(string, "0x%x: error for address 0x%x",
- addr, error);
- return TEST_FAILED;
- }
- sprintf(string, "address 0x%x, size 0x%x",
- addr, bufsize);
- return TEST_PASSED;
- }
- /**********************************************************************
- *
- * Function: sso
- *
- * Description: Test the Simultaneous Switching Output.
- * Verifies succes sive reads and writes to the same memory word,
- * holding one bit constant while toggling all other data bits
- * simultaneously
- * => stress the data bus over an address range
- *
- * The CPU writes to each address in the given range.
- * For each bit, first the CPU holds the bit at 1 while
- * toggling the other bits, and then the CPU holds the bit at 0
- * while toggling the other bits.
- * After each write, the CPU reads the address that was written
- * to verify that it contains the correct data
- *
- **********************************************************************/
- static enum test_result test_sso(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- int i, j;
- u32 addr, bufsize, remaining, offset;
- u32 error = 0;
- u32 data;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 4))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- printf("running sso at 0x%x length 0x%x", addr, bufsize);
- offset = addr;
- remaining = bufsize;
- while (remaining) {
- for (i = 0; i < 32; i++) {
- /* write pattern. */
- for (j = 0; j < 6; j++) {
- switch (j) {
- case 0:
- case 2:
- data = 1 << i;
- break;
- case 3:
- case 5:
- data = ~(1 << i);
- break;
- case 1:
- data = ~0x0;
- break;
- case 4:
- data = 0x0;
- break;
- }
- writel(data, offset);
- error = check_addr(offset, data);
- if (error)
- goto end;
- }
- }
- offset += 4;
- remaining -= 4;
- if (progress(offset << 7))
- goto end;
- }
- puts("\n");
- end:
- if (error) {
- sprintf(string, "error for pattern 0x%x @0x%x",
- data, offset);
- return TEST_FAILED;
- }
- sprintf(string, "no error for sso at 0x%x length 0x%x", addr, bufsize);
- return TEST_PASSED;
- }
- /**********************************************************************
- *
- * Function: Random
- *
- * Description: Verifies r/w with pseudo-ramdom value on one region
- * + write the region (individual access)
- * + memcopy to the 2nd region (try to use burst)
- * + verify the 2 regions
- *
- **********************************************************************/
- static enum test_result test_random(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr, offset, value = 0;
- size_t bufsize;
- u32 loop = 0, nb_loop;
- u32 error = 0;
- unsigned int seed;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 8))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- bufsize /= 2;
- printf("running %d loops copy from 0x%x to 0x%x (buffer size=0x%x)\n",
- nb_loop, addr, addr + bufsize, bufsize);
- while (!error) {
- seed = rand();
- for (offset = 0; offset < bufsize; offset += 4)
- writel(rand(), addr + offset);
- memcpy((void *)addr + bufsize, (void *)addr, bufsize);
- srand(seed);
- for (offset = 0; offset < 2 * bufsize; offset += 4) {
- if (offset == bufsize)
- srand(seed);
- value = rand();
- error = check_addr(addr + offset, value);
- if (error)
- break;
- if (progress(offset))
- return TEST_FAILED;
- }
- if (test_loop_end(&loop, nb_loop, 100))
- break;
- }
- putc('\n');
- if (error) {
- sprintf(string,
- "loop %d: error for address 0x%x: 0x%x expected 0x%x",
- loop, offset, readl(offset), value);
- return TEST_FAILED;
- }
- sprintf(string, "no error for %d loops, size 0x%x",
- loop, bufsize);
- return TEST_PASSED;
- }
- /**********************************************************************
- *
- * Function: noise
- *
- * Description: Verifies r/w while forcing switching of all data bus lines.
- * optimised 4 iteration write/read/write/read cycles...
- * for pattern and inversed pattern
- *
- **********************************************************************/
- void do_noise(u32 addr, u32 pattern, u32 *result)
- {
- __asm__("push {R0-R11}");
- __asm__("mov r0, %0" : : "r" (addr));
- __asm__("mov r1, %0" : : "r" (pattern));
- __asm__("mov r11, %0" : : "r" (result));
- __asm__("mvn r2, r1");
- __asm__("str r1, [r0]");
- __asm__("ldr r3, [r0]");
- __asm__("str r2, [r0]");
- __asm__("ldr r4, [r0]");
- __asm__("str r1, [r0]");
- __asm__("ldr r5, [r0]");
- __asm__("str r2, [r0]");
- __asm__("ldr r6, [r0]");
- __asm__("str r1, [r0]");
- __asm__("ldr r7, [r0]");
- __asm__("str r2, [r0]");
- __asm__("ldr r8, [r0]");
- __asm__("str r1, [r0]");
- __asm__("ldr r9, [r0]");
- __asm__("str r2, [r0]");
- __asm__("ldr r10, [r0]");
- __asm__("stmia R11!, {R3-R10}");
- __asm__("pop {R0-R11}");
- }
- static enum test_result test_noise(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr, pattern;
- u32 result[8];
- int i;
- enum test_result res = TEST_PASSED;
- if (get_pattern(string, argc, argv, 0, &pattern, 0xFFFFFFFF))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- printf("running noise for 0x%x at 0x%x\n", pattern, addr);
- do_noise(addr, pattern, result);
- for (i = 0; i < 0x8;) {
- if (check_addr((u32)&result[i++], pattern))
- res = TEST_FAILED;
- if (check_addr((u32)&result[i++], ~pattern))
- res = TEST_FAILED;
- }
- return res;
- }
- /**********************************************************************
- *
- * Function: noise_burst
- *
- * Description: Verifies r/w while forcing switching of all data bus lines.
- * optimised write loop witrh store multiple to use burst
- * for pattern and inversed pattern
- *
- **********************************************************************/
- void do_noise_burst(u32 addr, u32 pattern, size_t bufsize)
- {
- __asm__("push {R0-R9}");
- __asm__("mov r0, %0" : : "r" (addr));
- __asm__("mov r1, %0" : : "r" (pattern));
- __asm__("mov r9, %0" : : "r" (bufsize));
- __asm__("mvn r2, r1");
- __asm__("mov r3, r1");
- __asm__("mov r4, r2");
- __asm__("mov r5, r1");
- __asm__("mov r6, r2");
- __asm__("mov r7, r1");
- __asm__("mov r8, r2");
- __asm__("loop1:");
- __asm__("stmia R0!, {R1-R8}");
- __asm__("stmia R0!, {R1-R8}");
- __asm__("stmia R0!, {R1-R8}");
- __asm__("stmia R0!, {R1-R8}");
- __asm__("subs r9, r9, #128");
- __asm__("bge loop1");
- __asm__("pop {R0-R9}");
- }
- /* chunk size enough to allow interruption with Ctrl-C*/
- #define CHUNK_SIZE 0x8000000
- static enum test_result test_noise_burst(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 addr, offset, pattern;
- size_t bufsize, remaining, size;
- int i;
- enum test_result res = TEST_PASSED;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 128))
- return TEST_ERROR;
- if (get_pattern(string, argc, argv, 1, &pattern, 0xFFFFFFFF))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running noise burst for 0x%x at 0x%x + 0x%x",
- pattern, addr, bufsize);
- offset = addr;
- remaining = bufsize;
- size = CHUNK_SIZE;
- while (remaining) {
- if (remaining < size)
- size = remaining;
- do_noise_burst(offset, pattern, size);
- remaining -= size;
- offset += size;
- if (progress(offset)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- puts("\ncheck buffer");
- for (i = 0; i < bufsize;) {
- if (check_addr(addr + i, pattern))
- res = TEST_FAILED;
- i += 4;
- if (check_addr(addr + i, ~pattern))
- res = TEST_FAILED;
- i += 4;
- if (progress(i)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- end:
- puts("\n");
- return res;
- }
- /**********************************************************************
- *
- * Function: pattern test
- *
- * Description: optimized loop for read/write pattern (array of 8 u32)
- *
- **********************************************************************/
- #define PATTERN_SIZE 8
- static enum test_result test_loop(const u32 *pattern, u32 *address,
- const u32 bufsize)
- {
- int i;
- int j;
- enum test_result res = TEST_PASSED;
- u32 offset, testsize, remaining;
- offset = (u32)address;
- remaining = bufsize;
- while (remaining) {
- testsize = bufsize > 0x1000000 ? 0x1000000 : bufsize;
- __asm__("push {R0-R10}");
- __asm__("mov r0, %0" : : "r" (pattern));
- __asm__("mov r1, %0" : : "r" (offset));
- __asm__("mov r2, %0" : : "r" (testsize));
- __asm__("ldmia r0!, {R3-R10}");
- __asm__("loop2:");
- __asm__("stmia r1!, {R3-R10}");
- __asm__("stmia r1!, {R3-R10}");
- __asm__("stmia r1!, {R3-R10}");
- __asm__("stmia r1!, {R3-R10}");
- __asm__("subs r2, r2, #128");
- __asm__("bge loop2");
- __asm__("pop {R0-R10}");
- offset += testsize;
- remaining -= testsize;
- if (progress((u32)offset)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- puts("\ncheck buffer");
- for (i = 0; i < bufsize; i += PATTERN_SIZE * 4) {
- for (j = 0; j < PATTERN_SIZE; j++, address++)
- if (check_addr((u32)address, pattern[j])) {
- res = TEST_FAILED;
- goto end;
- }
- if (progress(i)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- end:
- puts("\n");
- return res;
- }
- const u32 pattern_div1_x16[PATTERN_SIZE] = {
- 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF,
- 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF
- };
- const u32 pattern_div2_x16[PATTERN_SIZE] = {
- 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000000,
- 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000000
- };
- const u32 pattern_div4_x16[PATTERN_SIZE] = {
- 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000
- };
- const u32 pattern_div4_x32[PATTERN_SIZE] = {
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000
- };
- const u32 pattern_mostly_zero_x16[PATTERN_SIZE] = {
- 0x00000000, 0x00000000, 0x00000000, 0x0000FFFF,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000
- };
- const u32 pattern_mostly_zero_x32[PATTERN_SIZE] = {
- 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000
- };
- const u32 pattern_mostly_one_x16[PATTERN_SIZE] = {
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000FFFF,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
- };
- const u32 pattern_mostly_one_x32[PATTERN_SIZE] = {
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
- };
- #define NB_PATTERN 5
- static enum test_result test_freq_pattern(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- const u32 * const patterns_x16[NB_PATTERN] = {
- pattern_div1_x16,
- pattern_div2_x16,
- pattern_div4_x16,
- pattern_mostly_zero_x16,
- pattern_mostly_one_x16,
- };
- const u32 * const patterns_x32[NB_PATTERN] = {
- pattern_div2_x16,
- pattern_div4_x16,
- pattern_div4_x32,
- pattern_mostly_zero_x32,
- pattern_mostly_one_x32
- };
- const char *patterns_comments[NB_PATTERN] = {
- "switching at frequency F/1",
- "switching at frequency F/2",
- "switching at frequency F/4",
- "mostly zero",
- "mostly one"
- };
- enum test_result res = TEST_PASSED, pattern_res;
- int i, bus_width;
- const u32 **patterns;
- u32 bufsize, addr;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 128))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 1, &addr))
- return TEST_ERROR;
- switch (readl(&ctl->mstr) & DDRCTRL_MSTR_DATA_BUS_WIDTH_MASK) {
- case DDRCTRL_MSTR_DATA_BUS_WIDTH_HALF:
- case DDRCTRL_MSTR_DATA_BUS_WIDTH_QUARTER:
- bus_width = 16;
- break;
- default:
- bus_width = 32;
- break;
- }
- printf("running test pattern at 0x%08x length 0x%x width = %d\n",
- addr, bufsize, bus_width);
- patterns =
- (const u32 **)(bus_width == 16 ? patterns_x16 : patterns_x32);
- for (i = 0; i < NB_PATTERN; i++) {
- printf("test data pattern %s:", patterns_comments[i]);
- pattern_res = test_loop(patterns[i], (u32 *)addr, bufsize);
- if (pattern_res != TEST_PASSED) {
- printf("Failed\n");
- return pattern_res;
- }
- printf("Passed\n");
- }
- return res;
- }
- /**********************************************************************
- *
- * Function: pattern test with size
- *
- * Description: loop for write pattern
- *
- **********************************************************************/
- static enum test_result test_loop_size(const u32 *pattern, u32 size,
- u32 *address,
- const u32 bufsize)
- {
- int i, j;
- enum test_result res = TEST_PASSED;
- u32 *p = address;
- for (i = 0; i < bufsize; i += size * 4) {
- for (j = 0; j < size ; j++, p++)
- *p = pattern[j];
- if (progress(i)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- puts("\ncheck buffer");
- p = address;
- for (i = 0; i < bufsize; i += size * 4) {
- for (j = 0; j < size; j++, p++)
- if (check_addr((u32)p, pattern[j])) {
- res = TEST_FAILED;
- goto end;
- }
- if (progress(i)) {
- res = TEST_FAILED;
- goto end;
- }
- }
- end:
- puts("\n");
- return res;
- }
- static enum test_result test_checkboard(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr;
- int i;
- u32 checkboard[2] = {0x55555555, 0xAAAAAAAA};
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 8))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 0; i < 2; i++) {
- res = test_loop_size(checkboard, 2, (u32 *)addr,
- bufsize);
- if (res)
- return res;
- checkboard[0] = ~checkboard[0];
- checkboard[1] = ~checkboard[1];
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- static enum test_result test_blockseq(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr, value;
- int i;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 4))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 0; i < 256; i++) {
- value = i | i << 8 | i << 16 | i << 24;
- printf("pattern = %08x", value);
- res = test_loop_size(&value, 1, (u32 *)addr, bufsize);
- if (res != TEST_PASSED)
- return res;
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- static enum test_result test_walkbit0(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr, value;
- int i;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 4))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 0; i < 64; i++) {
- if (i < 32)
- value = 1 << i;
- else
- value = 1 << (63 - i);
- printf("pattern = %08x", value);
- res = test_loop_size(&value, 1, (u32 *)addr, bufsize);
- if (res != TEST_PASSED)
- return res;
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- static enum test_result test_walkbit1(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr, value;
- int i;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 4))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 0; i < 64; i++) {
- if (i < 32)
- value = ~(1 << i);
- else
- value = ~(1 << (63 - i));
- printf("pattern = %08x", value);
- res = test_loop_size(&value, 1, (u32 *)addr, bufsize);
- if (res != TEST_PASSED)
- return res;
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- /*
- * try to catch bad bits which are dependent on the current values of
- * surrounding bits in either the same word32
- */
- static enum test_result test_bitspread(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr, bitspread[4];
- int i, j;
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 32))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 1; i < 32; i++) {
- for (j = 0; j < i; j++) {
- if (i < 32)
- bitspread[0] = (1 << i) | (1 << j);
- else
- bitspread[0] = (1 << (63 - i)) |
- (1 << (63 - j));
- bitspread[1] = bitspread[0];
- bitspread[2] = ~bitspread[0];
- bitspread[3] = ~bitspread[0];
- printf("pattern = %08x", bitspread[0]);
- res = test_loop_size(bitspread, 4, (u32 *)addr,
- bufsize);
- if (res != TEST_PASSED)
- return res;
- }
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- static enum test_result test_bitflip(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED;
- u32 bufsize, nb_loop, loop = 0, addr;
- int i;
- u32 bitflip[4];
- if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024, 32))
- return TEST_ERROR;
- if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, &addr))
- return TEST_ERROR;
- printf("running %d loops at 0x%08x length 0x%x\n",
- nb_loop, addr, bufsize);
- while (1) {
- for (i = 0; i < 32; i++) {
- bitflip[0] = 1 << i;
- bitflip[1] = bitflip[0];
- bitflip[2] = ~bitflip[0];
- bitflip[3] = bitflip[2];
- printf("pattern = %08x", bitflip[0]);
- res = test_loop_size(bitflip, 4, (u32 *)addr, bufsize);
- if (res != TEST_PASSED)
- return res;
- }
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- sprintf(string, "no error for %d loops at 0x%08x length 0x%x",
- loop, addr, bufsize);
- return res;
- }
- /**********************************************************************
- *
- * Function: infinite read access to DDR
- *
- * Description: continuous read the same pattern at the same address
- *
- **********************************************************************/
- static enum test_result test_read(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 *addr;
- u32 data;
- u32 loop = 0;
- int i, size = 1024 * 1024;
- bool random = false;
- if (get_addr(string, argc, argv, 0, (u32 *)&addr))
- return TEST_ERROR;
- if (get_pattern(string, argc, argv, 1, &data, 0xA5A5AA55))
- return TEST_ERROR;
- if ((u32)addr == ADDR_INVALID) {
- printf("running random\n");
- random = true;
- } else {
- printf("running at 0x%08x with pattern=0x%08x\n",
- (u32)addr, data);
- writel(data, addr);
- }
- while (1) {
- for (i = 0; i < size; i++) {
- if (random)
- addr = (u32 *)(STM32_DDR_BASE +
- (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
- data = readl(addr);
- }
- if (test_loop_end(&loop, 0, 1))
- break;
- }
- if (random)
- sprintf(string, "%d loops random", loop);
- else
- sprintf(string, "%d loops at 0x%x: %x", loop, (u32)addr, data);
- return TEST_PASSED;
- }
- /**********************************************************************
- *
- * Function: infinite write access to DDR
- *
- * Description: continuous write the same pattern at the same address
- *
- **********************************************************************/
- static enum test_result test_write(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- u32 *addr;
- u32 data;
- u32 loop = 0;
- int i, size = 1024 * 1024;
- bool random = false;
- if (get_addr(string, argc, argv, 0, (u32 *)&addr))
- return TEST_ERROR;
- if (get_pattern(string, argc, argv, 1, &data, 0xA5A5AA55))
- return TEST_ERROR;
- if ((u32)addr == ADDR_INVALID) {
- printf("running random\n");
- random = true;
- } else {
- printf("running at 0x%08x with pattern 0x%08x\n",
- (u32)addr, data);
- }
- while (1) {
- for (i = 0; i < size; i++) {
- if (random) {
- addr = (u32 *)(STM32_DDR_BASE +
- (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
- data = rand();
- }
- writel(data, addr);
- }
- if (test_loop_end(&loop, 0, 1))
- break;
- }
- if (random)
- sprintf(string, "%d loops random", loop);
- else
- sprintf(string, "%d loops at 0x%x: %x", loop, (u32)addr, data);
- return TEST_PASSED;
- }
- #define NB_TEST_INFINITE 2
- static enum test_result test_all(struct stm32mp1_ddrctl *ctl,
- struct stm32mp1_ddrphy *phy,
- char *string, int argc, char *argv[])
- {
- enum test_result res = TEST_PASSED, result;
- int i, j, nb_error = 0, len;
- u32 loop = 0, nb_loop;
- int argc_test;
- char *argv_test[4];
- char loop_string[] = "1";
- char pattern_string[] = PATTERN_DEFAULT;
- u32 *addr;
- if (get_nb_loop(string, argc, argv, 0, &nb_loop, 1))
- return TEST_ERROR;
- if (get_addr(string, argc, argv, 2, (u32 *)&addr))
- return TEST_ERROR;
- while (!nb_error) {
- /* execute all the test except the lasts which are infinite */
- for (i = 1; i < test_nb - NB_TEST_INFINITE; i++) {
- argc_test = 0;
- j = 0;
- len = strlen(test[i].usage);
- if (argc > 1 && j < len &&
- !strncmp("[size]", &test[i].usage[j], 6)) {
- argv_test[argc_test++] = argv[1];
- j += 7;
- }
- if (argc > 2) {
- if (j < len &&
- !strncmp("[loop]", &test[i].usage[j], 6)) {
- argv_test[argc_test++] = loop_string;
- j += 7;
- }
- if (j < len &&
- !strncmp("[pattern]", &test[i].usage[j],
- 9)) {
- argv_test[argc_test++] = pattern_string;
- j += 10;
- }
- if (j < len &&
- !strncmp("[addr]", &test[i].usage[j], 6)) {
- argv_test[argc_test++] = argv[2];
- j += 7;
- }
- }
- printf("execute %d:%s\n", (int)i, test[i].name);
- result = test[i].fct(ctl, phy, string,
- argc_test, argv_test);
- printf("result %d:%s = ", (int)i, test[i].name);
- if (result != TEST_PASSED) {
- nb_error++;
- res = TEST_FAILED;
- puts("Failed");
- } else {
- puts("Passed");
- }
- puts("\n\n");
- }
- printf("loop %d: %d/%d test failed\n\n\n",
- loop + 1, nb_error, test_nb - NB_TEST_INFINITE);
- if (test_loop_end(&loop, nb_loop, 1))
- break;
- }
- if (res != TEST_PASSED) {
- sprintf(string, "loop %d: %d/%d test failed", loop, nb_error,
- test_nb - NB_TEST_INFINITE);
- } else {
- sprintf(string, "loop %d: %d tests passed", loop,
- test_nb - NB_TEST_INFINITE);
- }
- return res;
- }
- /****************************************************************
- * TEST Description
- ****************************************************************/
- const struct test_desc test[] = {
- {test_all, "All", "[loop] [size] [addr]", "Execute all tests", 3 },
- {test_databus, "Simple DataBus", "[addr]",
- "Verifies each data line by walking 1 on fixed address",
- 1
- },
- {databuswalk0, "DataBusWalking0", "[loop] [addr]",
- "Verifies each data bus signal can be driven low (32 word burst)",
- 2
- },
- {databuswalk1, "DataBusWalking1", "[loop] [addr]",
- "Verifies each data bus signal can be driven high (32 word burst)",
- 2
- },
- {test_addressbus, "AddressBus", "[size] [addr]",
- "Verifies each relevant bits of the address and checking for aliasing",
- 2
- },
- {test_memdevice, "MemDevice", "[size] [addr]",
- "Test the integrity of a physical memory (test every storage bit in the region)",
- 2
- },
- {test_sso, "SimultaneousSwitchingOutput", "[size] [addr] ",
- "Stress the data bus over an address range",
- 2
- },
- {test_noise, "Noise", "[pattern] [addr]",
- "Verifies r/w while forcing switching of all data bus lines.",
- 3
- },
- {test_noise_burst, "NoiseBurst", "[size] [pattern] [addr]",
- "burst transfers while forcing switching of the data bus lines",
- 3
- },
- {test_random, "Random", "[size] [loop] [addr]",
- "Verifies r/w and memcopy(burst for pseudo random value.",
- 3
- },
- {test_freq_pattern, "FrequencySelectivePattern", "[size] [addr]",
- "write & test patterns: Mostly Zero, Mostly One and F/n",
- 2
- },
- {test_blockseq, "BlockSequential", "[size] [loop] [addr]",
- "test incremental pattern",
- 3
- },
- {test_checkboard, "Checkerboard", "[size] [loop] [addr]",
- "test checker pattern",
- 3
- },
- {test_bitspread, "BitSpread", "[size] [loop] [addr]",
- "test Bit Spread pattern",
- 3
- },
- {test_bitflip, "BitFlip", "[size] [loop] [addr]",
- "test Bit Flip pattern",
- 3
- },
- {test_walkbit0, "WalkingOnes", "[size] [loop] [addr]",
- "test Walking Ones pattern",
- 3
- },
- {test_walkbit1, "WalkingZeroes", "[size] [loop] [addr]",
- "test Walking Zeroes pattern",
- 3
- },
- /* need to the the 2 last one (infinite) : skipped for test all */
- {test_read, "infinite read", "[addr] [pattern]",
- "basic test : infinite read access (random: addr=0xFFFFFFFF)", 2},
- {test_write, "infinite write", "[addr] [pattern]",
- "basic test : infinite write access (random: addr=0xFFFFFFFF)", 2},
- };
- const int test_nb = ARRAY_SIZE(test);
|