+ case '2':
+ case '3':
+ printf("3btn_idle test..\n");
+ p = (void *)0x200000;
+ len = 0x20000;
+ test_joy_read_log(p, len, b3 == '3');
+ for (i = 0; i < len; i++) {
+ static const u8 e[2] = { 0x33, 0x7f };
+ v = e[i & 1];
+ if (p[i] != v)
+ printf("%06x: bad: %02x %02x\n", &p[i], p[i], v);
+ }
+ printf("done\n");
+ return 0;
+ case '4':
+ printf("3btn_idle data test..\n");
+ p = (void *)0x200000;
+ len = 0x20000;
+ for (i = 0; i < len; i++) {
+ static const u8 e[2] = { 0x33, 0x7f };
+ v = e[i & 1];
+ if (p[i] != v)
+ printf("%06x: bad: %02x %02x\n", &p[i], p[i], v);
+ }
+ printf("done\n");
+ return 0;
+ case '5':
+ seed = read8(0xC00009);
+ printf("testing, seed=%02x\n", seed);
+ p = (void *)0x200000;
+ len = 0x100000;
+ test_byte_write(p, len, seed);
+ for (t = 0; t < 2; t++) {
+ for (i = 0; i < len; i++) {
+ v = (u8)(i + seed);
+ if (p[i] != v)
+ printf("%06x: bad: %02x %02x\n", &p[i], p[i], v);
+ }
+ printf("done (%d)\n", t);
+ }
+ return 0;