Full picture
10

System Configuration

10.1 Overview

Zeal Video Board presents a a few registers that can be used to connfigure the currently mapped I/O controller as well the physical video memory.

These configuration area's base address on the I/O bus is 0x90, it is never mapped out, so it is available at any time.

10.2 Firmware Version

The Zeal Video Board runs thanks to an FPGA, its firmware is located on an SPI NOR Flash. This gives the possibility to the user to update the firmware at any time, using a JTAG connector or even a CPU connected to the main port, thanks to the SPI controller. Check the Recovery mode chapter for more information.

Firmware versions follow the conventional vx.y.z semantic versioning format, where x indicates the major version, y the minor version, and z the revision number.

The first three registers in the system configuration area represent the current firmware version: revision, the minor and the major, in that order.

As of today, two firmware versions have ever been released, the first beta one, v0.1.0, and the first release v1.0.0.

10.3 Scratch registers

This configuration area includes four general-purpose scratch registers, SCRATCH0, SCRATCH1, SCRATCH2, and SCRATCH3, that can be used freely by the host. Because this area is always mapped, it can simplify context switches or transitions between user and kernel modes by eliminating the need to modify main memory or the current stack.

10.4 I/O Controllers

To reduce the number of registers to allocated on the I/O bus for the Zeal Video Board, the I/O controller (such as SPI, DMA, etc...) are banked. The register MAPPED_DEVICE can be used to read the current mapped controller or write a new controller to map. The available controllers are:

Controller Index
Text 0
SPI 1
CRC32 2
Sound 3
DMA 4
Reserved 5
Timerexperimental 6

10.5 Physical address

22-bit address bus

As said previously, the Zeal Video Board embeds its own video RAM, so it doesn't need to us the host's RAM. Despite its size of around 80KB, it needs an address space of 128KB, because of the alignment constraint of the sub-systems (such as 64KB tileset memory).

Zeal Video Board expects the physical address space of the computer it will be connected to be 4MB big, hence the 22 address bits present on the main connector. Moreover, it doens't present any explicit chip enable line, the goal being to reduce the required external logic. Indeed, the the upper 5 bits of the 22 address lines will be compared against the PHYS_ADDR register.

As such, by configuring the register, we can configure the physical addresses ZVB will respond to.

For example, the default value of this register upon reset is 8, this means that ZVB will be mapped from physical address 8 << (22 - 5) = 8 << 17 = 0x100000 up to 0x11ffff (128KB).

Any-width address bus

Most computers, particularly 8-bit systems, do not expose a full 22-bit address bus. To allow compatibility with a wide range of hosts, the upper 5 address lines, A21 down to A17, are interpreted as chip enable signals.

These signals are internally compared against the PHYS_ADDR register. By default, this register is set to 8 after reset. Therefore, we can interpret these chip enable signals as:

  • A21: active low
  • A20: active high
  • A19: active low
  • A18: active low
  • A17: active low
Example: 8-bit computer with banked memory

Consider an 8-bit system, based on the Z80 CPU, with a 64KB address space organized as follows:

  • 0x0000-0x7FFF: Internal ROM
  • 0x8000-0xFFFF: Banked memory

It also includes an I/O port at address 0x42, which controls an 8-bit bank register, allowing up to 256 memory banks.

Since the banked memory space is 32KB big, we need to allocate 128KB / 32KB = 4 banks to ZVB. Let's assign banks 0 to 3 to ZVB, the rest of the banks can be allocated to RAM or any other component.

To interface ZVB with this computer, we would have something like this:

Interace
Interfacing with an 8-bit computer

When the Z80 CPU accesses the ROM, 0x0000-0x7FFF, the adress line A15 will be 0, so ZVB won't be selected and won't react. When banked memory is accessed, ZVB will react only if the the bank's pin 7, 6, 5, 4, 3 and 2 are low. In other words, it will be selected only if the current bank value is 0, 1, 2 or 3.

10.6 Registers Summary

Name Description Base-relative address Access
REV Firmware revision code (patch version) 0x00 RO
MINOR Firmware revision code (minor version) 0x01 RO
MAJOR Firmware revision code (major version) 0x02 RO
SCRATCH0 Scratch register 0 0x08 RW
SCRATCH1 Scratch register 1 0x09 RW
SCRATCH2 Scratch register 2 0x0A RW
SCRATCH3 Scratch register 3 0x0B RW
MAPPED_DEVICE Device mapping indicator (mapped I/O controller) 0x0E RW
PHYS_ADDR FPGA high physical address bits 0x0F RW

10.7 Registers

REV (0x00)
Firmware revision code (patch version)
PATCH
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
PATCH
Least significant part of firmware version (RO)
MINOR (0x01)
Firmware revision code (minor version)
MINOR
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
MINOR
Middle part of firmware version (RO)
MAJOR (0x02)
Firmware revision code (major version)
MAJOR
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 1
Reset
MAJOR
Most significant part of firmware version (RO)
SCRATCH0 (0x08)
Scratch register 0
SCRATCH
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
SCRATCH
General-purpose scratch space (byte 0) (RW)
SCRATCH1 (0x09)
Scratch register 1
SCRATCH
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
SCRATCH
General-purpose scratch space (byte 1) (RW)
SCRATCH2 (0x0A)
Scratch register 2
SCRATCH
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
SCRATCH
General-purpose scratch space (byte 2) (RW)
SCRATCH3 (0x0B)
Scratch register 3
SCRATCH
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
SCRATCH
General-purpose scratch space (byte 3) (RW)
MAPPED_DEVICE (0x0E)
Device mapping indicator (mapped I/O controller)
(reserved)
DEVICE_IDX
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
Reset
DEVICE_IDX
Index of mapped I/O controller (RW)
PHYS_ADDR (0x0F)
FPGA high physical address bits
(reserved)
ADDR_BITS
7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0
Reset
ADDR_BITS
Physical base address bits (used by bus or memory map logic) (RW)