1 1.1 tsutsui /* $NetBSD: nwb225reg.h,v 1.2 2026/09/20 11:52:56 tsutsui Exp $ */ 2 1.1 tsutsui 3 1.1 tsutsui /*- 4 1.1 tsutsui * Copyright (c) 2026 Izumi Tsutsui. All rights reserved. 5 1.1 tsutsui * 6 1.1 tsutsui * Redistribution and use in source and binary forms, with or without 7 1.1 tsutsui * modification, are permitted provided that the following conditions 8 1.1 tsutsui * are met: 9 1.1 tsutsui * 1. Redistributions of source code must retain the above copyright 10 1.1 tsutsui * notice, this list of conditions and the following disclaimer. 11 1.1 tsutsui * 2. Redistributions in binary form must reproduce the above copyright 12 1.1 tsutsui * notice, this list of conditions and the following disclaimer in the 13 1.1 tsutsui * documentation and/or other materials provided with the distribution. 14 1.1 tsutsui * 15 1.1 tsutsui * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 1.1 tsutsui * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 1.1 tsutsui * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 1.1 tsutsui * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 1.1 tsutsui * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 1.1 tsutsui * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 1.1 tsutsui * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 1.1 tsutsui * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 1.1 tsutsui * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 1.1 tsutsui * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 1.1 tsutsui */ 26 1.1 tsutsui 27 1.1 tsutsui #ifndef _NEWS68K_NWB225REG_H_ 28 1.1 tsutsui #define _NEWS68K_NWB225REG_H_ 29 1.1 tsutsui 30 1.1 tsutsui /* NWB-225 MMIO addresses */ 31 1.1 tsutsui #define NWB225_KROM_BASE 0xf0600000UL 32 1.1 tsutsui #define NWB225_KROM_SIZE 0x00100000UL 33 1.1 tsutsui #define NWB225_RCONT_BASE 0xf0700000UL 34 1.1 tsutsui #define NWB225_RCONT_SIZE 0x00100000UL 35 1.1 tsutsui 36 1.1 tsutsui /* 37 1.1 tsutsui * ROP controller register/aperture offsets from NWB225_RCONT_BASE 38 1.1 tsutsui */ 39 1.1 tsutsui 40 1.1 tsutsui /* Status: ROP status register */ 41 1.1 tsutsui #define NWB225_STATUS 0x00080000UL 42 1.1 tsutsui #define NWB225_STATUS_REQ 0x0001 43 1.1 tsutsui #define NWB225_STATUS_EXEC 0x0002 44 1.1 tsutsui #define NWB225_STATUS_BUSY (NWB225_STATUS_EXEC | NWB225_STATUS_REQ) 45 1.1 tsutsui #define NWB225_STATUS_DISPVER 0x00e0 46 1.1 tsutsui #define NWB225_STATUS_DISPVER_SHIFT 5 47 1.1 tsutsui #define NWB225_STATUS_4PLANE 0x0080 48 1.1 tsutsui 49 1.1 tsutsui /* Command-address flags: A13 Set Shift / A14 Execute */ 50 1.1 tsutsui #define NWB225_ROP_ADDR_FLAG_SET_SHIFT 0x00002000UL 51 1.1 tsutsui #define NWB225_ROP_ADDR_FLAG_EXECUTE 0x00004000UL 52 1.1 tsutsui 53 1.1 tsutsui /* Command-addresses: COPY and FILL */ 54 1.1 tsutsui #define NWB225_ROP_COPY_XR_YR 0x00060300UL 55 1.1 tsutsui #define NWB225_ROP_COPY_XF_YR 0x00060310UL 56 1.1 tsutsui #define NWB225_ROP_COPY_XR_YF 0x00060320UL 57 1.1 tsutsui #define NWB225_ROP_COPY_XF_YF 0x00060330UL 58 1.1 tsutsui #define NWB225_ROP_CONST_FILL 0x000603b0UL 59 1.1 tsutsui 60 1.1 tsutsui /* Parameter-addresses: rectangles of COPY, FILL, and HWRITE */ 61 1.1 tsutsui /* y must be in the range 0..NWB225_FB_HEIGHT - 1 */ 62 1.1 tsutsui #define NWB225_DST_ADDR(y) (0x00008000UL | 2UL * (y)) 63 1.1 tsutsui #define NWB225_SRC_ADDR(y) (0x00020000UL | 2UL * (y)) 64 1.1 tsutsui /* h must be in the range 1..NWB225_FB_HEIGHT */ 65 1.1 tsutsui #define NWB225_HWRITE_LIMIT(h) (0x00040000UL | 2UL * ((h) - 1)) 66 1.1 tsutsui #define NWB225_ROP_LIMIT(h) (0x00050000UL | 2UL * ((h) - 1)) 67 1.1 tsutsui 68 1.1 tsutsui /* Parameter-addresses: ROP func of COPY, FILL, and HWRITE */ 69 1.1 tsutsui /* p must be in the range 0..7 and less than dc_nplanes */ 70 1.1 tsutsui #define NWB225_ROP_FUNC(p) (0x00060730UL | 2UL * (p)) 71 1.1 tsutsui 72 1.1 tsutsui /* Parameter-addresses: for host data of HWRITE */ 73 1.1 tsutsui #define NWB225_HWRITE_DATA 0x00070230UL 74 1.1 tsutsui #define NWB225_HWRITE_BITS_PER_WORD 16 75 1.1 tsutsui 76 1.1 tsutsui #define NWB225_PLANE_CTRL 0x000a0000UL 77 1.1 tsutsui #define NWB225_PLANE_CTRL_SHIFT 8 78 1.1 tsutsui 79 1.1 tsutsui #define NWB225_CTL_SELECT 0x000c0000UL 80 1.1 tsutsui #define NWB225_PAL_INDEX 0x000c0000UL 81 1.1 tsutsui #define NWB225_PAL_DATA 0x000c0002UL 82 1.1 tsutsui #define NWB225_CTL_DATA 0x000c0004UL 83 1.1 tsutsui #define NWB225_INIT_BASE 0x000e0000UL 84 1.1 tsutsui 85 1.1 tsutsui /* Fixed hardware geometry used by the NWB-225 NEWS-OS/PROM setup */ 86 1.1 tsutsui #define NWB225_FB_WIDTH 2048 87 1.1 tsutsui #define NWB225_FB_HEIGHT 1024 88 1.1 tsutsui #define NWB225_VIS_WIDTH 1280 89 1.1 tsutsui #define NWB225_VIS_HEIGHT 1024 90 1.1 tsutsui 91 1.1 tsutsui /* NEWS-OS KROM glyph and text-cell geometry */ 92 1.1 tsutsui #define NWB225_FONT_WIDTH 12 93 1.1 tsutsui #define NWB225_FONT_HEIGHT 24 94 1.1 tsutsui #define NWB225_CELL_WIDTH 16 95 1.1 tsutsui #define NWB225_CELL_HEIGHT 30 96 1.1 tsutsui #define NWB225_GLYPH_YOFFSET 4 97 1.1 tsutsui 98 1.1 tsutsui #define NWB225_KROM_ASCII_FIRST 0x20 99 1.1 tsutsui #define NWB225_KROM_ASCII_LAST 0x7e 100 1.1 tsutsui #define NWB225_KROM_ROWBYTES 4 101 1.1 tsutsui #define NWB225_KROM_ASCII_MASK 0xfff0 102 1.1 tsutsui #define NWB225_TEXT_COLS 80 103 1.1 tsutsui #define NWB225_TEXT_ROWS 33 104 1.1 tsutsui #define NWB225_TEXT_XORIGIN 0 105 1.1 tsutsui #define NWB225_TEXT_YORIGIN 8 106 1.1 tsutsui 107 1.1 tsutsui #endif /* _NEWS68K_NWB225REG_H_ */ 108