Wed May 1 08:58:34 2024 UTC (32d)
Add DELAY(9) to make palette register settings stable on 98543 in HP360.

Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)


(tsutsui)
diff -r1.9 -r1.10 src/sys/arch/hp300/dev/topcat.c

cvs diff -r1.9 -r1.10 src/sys/arch/hp300/dev/topcat.c (expand / switch to unified diff)

--- src/sys/arch/hp300/dev/topcat.c 2024/04/29 17:47:27 1.9
+++ src/sys/arch/hp300/dev/topcat.c 2024/05/01 08:58:34 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: topcat.c,v 1.9 2024/04/29 17:47:27 tsutsui Exp $ */ 1/* $NetBSD: topcat.c,v 1.10 2024/05/01 08:58:34 tsutsui Exp $ */
2/* $OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $ */ 2/* $OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2005, Miodrag Vallat. 5 * Copyright (c) 2005, Miodrag Vallat.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -464,27 +464,29 @@ topcat_setcolor(struct diofb *fb, u_int  @@ -464,27 +464,29 @@ topcat_setcolor(struct diofb *fb, u_int
464 tc->bdata = fb->cmap.b[index]; 464 tc->bdata = fb->cmap.b[index];
465 tc->strobe = 0xff; 465 tc->strobe = 0xff;
466 /* XXX delay required on 68020/30 to avoid bus error */ 466 /* XXX delay required on 68020/30 to avoid bus error */
467 DELAY(100); 467 DELAY(100);
468 468
469 tccm_waitbusy(tc); 469 tccm_waitbusy(tc);
470 tc->cindex = 0; 470 tc->cindex = 0;
471 } else { 471 } else {
472 tccm_waitbusy(tc); 472 tccm_waitbusy(tc);
473 tc->plane_mask = fb->planemask; 473 tc->plane_mask = fb->planemask;
474 tc->rdata = fb->cmap.r[index]; 474 tc->rdata = fb->cmap.r[index];
475 tc->gdata = fb->cmap.g[index]; 475 tc->gdata = fb->cmap.g[index];
476 tc->bdata = fb->cmap.b[index]; 476 tc->bdata = fb->cmap.b[index];
 477 DELAY(1); /* necessary for at least old HP98543 */
477 tc->cindex = ~index; 478 tc->cindex = ~index;
 479 DELAY(1); /* necessary for at least old HP98543 */
478 tc->strobe = 0xff; 480 tc->strobe = 0xff;
479 /* XXX delay required on 68020/30 to avoid bus error */ 481 /* XXX delay required on 68020/30 to avoid bus error */
480 DELAY(100); 482 DELAY(100);
481 483
482 tccm_waitbusy(tc); 484 tccm_waitbusy(tc);
483 tc->rdata = 0; 485 tc->rdata = 0;
484 tc->gdata = 0; 486 tc->gdata = 0;
485 tc->bdata = 0; 487 tc->bdata = 0;
486 tc->cindex = 0; 488 tc->cindex = 0;
487 } 489 }
488} 490}
489 491
490int 492int