69 Commits

Author SHA1 Message Date
99d9b4dcf2 Provide a minimal Console Terminal Block in the HWRPB.
Provide a minimal Console Terminal Block in the HWRPB so that operating
systems that depend on it can correctly initialize the console device.
This is suffucient, at least, for the BSD operating systems, but may not
be sufficient for Digital UNIX.

In addition to defining and filling out the structures, there are a couple
of other key changes:

- Redefine the a2 register passed by Qemu at start-up to also include
  some configuration flags, in addition to the CPU count, and define
  a flag to mirror the "-nographics" option.

- We need to initialize the HWRPB *after* initializing VGA, so that
  we'll know if a VGA device is present and in which slot for filling
  out the CTB.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210613210934.21143-2-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-14 20:55:38 -07:00
5e91534647 Fixes for secondary CPU start-up.
Changes to make secondary CPU start-up work on NetBSD, which depends
on some specific behavior in the architecture specification:

- Change the internal swppal() function to take the new VPTPTR and
  Procedure Value as explicit arguments.  Adapt do_start() to the
  new the new swppal() signature.

- In do_start_wait(), extract the new VPTPTR and PV from the relevant
  HWRPB fields, which will have been initialized by the OS, and pass
  them to swppal().

- In the SWPPAL PAL call, get the value to stuff into PV (r27) from
  a4 (r20), and add a comment describing why this implementation detail
  is allowed by the architecture specification.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-9-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-06 13:26:29 -07:00
b5bee82277 Provide interrupt mapping information in PCI config registers.
Use system-specific information to program the interrupt line register
with the interrupt mappings, which is what the SRM console does on real
hardware; some operating systems (e.g. NetBSD) use this information
rather than having interrupt mappings tables for every possible system
variation.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-7-thorpej@me.com>
[rth: Use inline not macro; fold -1 -> 0xff map into interface.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 18:47:29 -07:00
4793b28415 Fix incorrect initialization of PCI BARs
Only program a BAR as a 64-bit MEM BAR if it really is a 64-bit MEM BAR.
Fixes an issue with the CMD646 IDE controller under NetBSD.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-6-thorpej@me.com>
[rth: Combine the two tests.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:44:34 -07:00
0cbd87c2c4 Make some PCI macros available to other files. NFC.
Move PCI_DEVFN(), PCI_BUS(), PCI_SLOT(), and PCI_FUNC() to pci.h.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-5-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:32:11 -07:00
7accd8de6b Tidy comment re CY82C693UB vs PIIX
Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-4-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:29:30 -07:00
90e70ede8a Fix initialization of the hwrpb.hwrpb.cpuid field.
Initialize the hwrpb.hwrpb.cpuid field with the primary CPU ID, not
the processor type, as per the architecture specification.  Some
operating systems check and assert this.

Improve a couple of comments.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-4-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:27:29 -07:00
a169c0ba88 Fix delivery of unaligned access exceptions.
In the unaligned access exception vector, actually pass the return PC
in the exception frame.  This is required in order for unaligned access
fixup handlers in the operating system to work.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-3-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:26:13 -07:00
394234f7d7 Make qemu-palcode build environment standalone. NFC.
Don't include system headers.  Instead, provide standalone definitions
and declarations of types needed and functions used by the PALcode that
are compatible with the standard Alpha / GCC ABI.

Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-2-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-05 17:26:13 -07:00
bf0e136988 Report machine checks to the kernel
Use a minimally populated logout frame.  This is good enough to
handle probing of devices using the kernel's mcheck_expected.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2019-03-25 13:09:53 -07:00
51c237d7e2 Do not increment PC for OPCDEC
This will already have been done by QEMU.

Fixes: https://bugs.launchpad.net/bugs/1810545
Signed-off-by: Richard Henderson <rth@twiddle.net>
2019-01-08 12:08:37 +10:00
f3c7e44c70 Reinstate do_console if kernel not provided
Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-11-13 19:08:24 +01:00
6dd8bea7b9 Tidy clipper Sys_Setup
Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-11-13 12:21:45 +01:00
333f7da2d9 Add smp support
Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-11-13 12:04:29 +01:00
c87a92639b Add Cserve_Get_VM_Time
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-16 06:46:36 -07:00
25b1ca4615 Build with -O2 and -g1. 2013-07-08 12:13:01 -07:00
7a72670104 Don't initialize COM2.
At least not until we implement MCHK handling.  The current QEMU will
(properly) MCHK when accessing a non-existant device.
2013-07-08 11:49:21 -07:00
e959a30a6a Optimize memory layout.
Minimizing the amount of padding between page-aligned data structures.
2013-07-08 11:48:03 -07:00
7974e1e03f Declare vgahw_init where init.c can find it. 2013-07-08 11:46:21 -07:00
ead7ef0a58 Omit video_save_pointer_table as unused. 2013-07-08 11:45:58 -07:00
b54e85c107 Fix use of undefined PACKED macro. 2013-07-08 11:45:34 -07:00
187bba34b3 Make vga fonts const 2013-07-08 11:34:57 -07:00
7abb12f60e Properly detect the presence of a vga device. 2011-06-03 17:12:52 -05:00
db3b5b6935 Initialize a VGA controler.
Doesn't actually check to see that one exists yet...
2011-06-02 23:15:49 -05:00
4f4608beab Begin initiallizing the VGA card. 2011-05-09 10:59:50 -07:00
6248b55bfa Add in/out functions for 16 and 32-bit quantities. 2011-05-09 10:59:22 -07:00
1a4a2299f3 Hack: Move pci BAR ranges.
The Linux kernel will re-allocate all of these, tickling what appears
to be a bug in QEMU.  Work around this by moving the ranges allocated
by the console so that the new ranges don't overlap.
2011-05-09 10:58:45 -07:00
a7b2ef5dd9 Don't use alarms for ndelay. 2011-05-06 18:05:46 -07:00
2d46a7ec8f Initial PCI setup. 2011-05-06 18:05:13 -07:00
90bb73f3fb Inline i/o routines. 2011-05-06 18:04:44 -07:00
45a30cd864 Handle padding in printf numerical output. 2011-05-06 15:50:07 -07:00
87fb8be285 Use level-triggered ISA interrupts. 2011-05-06 11:52:02 -07:00
2166044b71 Add ps2 keyboard initialization.
Which also requires that we properly initialize the i8259 (ISA)
interrupt controller.
2011-05-06 11:07:37 -07:00
369d1d9a68 Beginnings of the SRM console prompt. 2011-05-05 13:12:49 -07:00
9e75c89f00 Read the correct register for typhoon device interrupt ready. 2011-05-03 07:49:58 -07:00
ee671d4ef8 Implement the console callback interface.
At least enough for GETC and PUTS.
2011-05-02 10:46:14 -07:00
2441ea1234 clipper: Report ISA interrupts properly. 2011-05-02 10:16:53 -07:00
28a139998d Fix SMP stack initialization. 2011-05-01 20:17:07 -07:00
784fbf5895 Add copyright information. 2011-05-01 09:11:52 -07:00
ac57e53396 Rearrange Cserve. Add QMU clock/alarm related entry points. 2011-04-28 08:45:05 -07:00
2337817db1 Set max_asn properly for the cpu. 2011-04-27 14:46:50 -07:00
ea0e38f6bc Re-org for Clipper system. 2011-04-27 09:43:00 -07:00
331e6b4c75 Fix error in SWPCTX code. 2011-04-25 14:09:29 -07:00
27d5d3c453 Use fixed frequency for rpcc. 2011-04-24 13:40:23 -07:00
6d3e153cf8 Implement CallPal_Cserve.
This is just good enough to handle the cserve_ena/dis used by
the Linux kernel for managing interrupts.
2011-04-22 07:04:56 -07:00
71b4db6096 Implement WTINT. 2011-04-22 06:48:21 -07:00
2eec0e49ac Use qemu_sysval and qemu_usp, newly exported from QEMU. 2011-04-18 15:20:38 -07:00
2c3764b53d Build palcode-sx164 instead of palcode. 2011-04-18 15:17:40 -07:00
53e49943d2 Optimize for size, and pca56. 2011-04-16 08:24:30 -07:00
5c54b53299 Use explicit division avoidance in print_decimal. 2011-04-16 08:24:15 -07:00