Commit Graph

81 Commits

Author SHA1 Message Date
scw f9a4918dc0 INT1 Select is at offset 0x72, not 0x71. 2002-09-22 20:49:27 +00:00
scw 7fa549e8d4 Move the RESVEC vector table/handlers to here, since some if it is,
essentially, machine dependent.
2002-09-10 11:53:14 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
scw 4b8905020d - #define the physical start of RAM.
- Set up a Panic Stack,
 - Don't pre-map the sysfpga at this time.
 - Calculate the CPU speed only if SH5_CPU_SPEED isn't defined.
 - On a related note, make the CPU speed probing code more accurate.
 - Print the CPU speed at startup.
 - Force RB_SINGLE for now, at least until I get a bootloader written.
2002-09-04 15:14:46 +00:00
scw e94347123e Set SMC_FLAGS_32BIT_READ flag before calling the MI code. 2002-09-04 14:55:42 +00:00
scw 9c10dc5c22 If DEBUG is defined, enable Cayman's NMI button. 2002-08-31 09:30:02 +00:00
scw 7da5ef1b84 Delete the CPU_CTB1 option; it was never used.
Add the SH5_INTC_IRL_MODE_INDEP option, to correctly configure
the interrupt controller for Cayman.
2002-08-30 11:25:09 +00:00
scw 877f6b7143 Add some options:
- SH5_SIM, as we're targetting the simulator.
 - KERNEL_IPT_SIZE, as we want to reduce startup time.
 - DDB. Yes, DDB inside a debugger/simulator. :)
2002-08-30 11:23:12 +00:00
scw aaa2f7e5ca When running on the simulator, assume there is 16MB of "RAM". This
greatly reduces startup time.
2002-08-30 11:06:03 +00:00
scw 1fd693d5b5 In the IRL1 interrupt handler, you need to read the Interrupt
Source Register#0, Steve. Not the Board Operating Mode register. Duh.
2002-08-30 11:03:25 +00:00
scw de63e7f1e4 Swap the IRL numbers for FEMI and SUPERIO, after reading the Cayman
docs a bit more closely...
2002-08-30 10:59:39 +00:00
scw 5cc4fe3194 Slight tweak to how the sm(4) driver attaches to superio. Also, just
use the regular bus tag for sm(4) instead of superio's "special" ISA
bus tag.
2002-08-30 10:57:05 +00:00
scw 873939f14a Fix a typo which resulted in a bus_space_write_stream_4() where it
should have been bus_space_write_stream_2().

The sm(4) driver gets a bit further now.

While I'm here, g/c a debug printf accidentally commited last time around.
2002-08-29 18:11:07 +00:00
scw 2ccf86d7da Re-sync with current reality.
Add options DDB.
Add debug makeoptions.
G/C some unnecessary stuff.
2002-08-26 11:16:02 +00:00
scw 9bcd736b9d Attach sm(4) at superio, instead of the previous isa bus attachment.
The latter's probe doesn't pick up the ethernet controller, and the
attach function needs to set MIIF_NOISOLATE.
We attach it at superio mainly because they share the same region of
address space, and the ethernet controller's interrupt is routed
through the superio.
2002-08-26 11:04:44 +00:00
scw fe7de4db3f Need <machine/db_machdep.h> 2002-08-26 10:58:38 +00:00
scw a1fda8f587 Call ddb_init() right after initialising the console.
We have no symbols at this time (due to lack of a bootloader)
so just hardcode symbol length to zero for now.
2002-08-26 10:55:39 +00:00
scw 0eb22d79b4 Try to preserve more bits in the status register (e.g. trace/watch).
Bump the (currently hardcoded) size of onboard RAM to match the Cayman.
2002-08-26 10:52:13 +00:00
thorpej 139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
briggs 0b956d0b8b Implement pmc(9) -- An interface to hardware performance monitoring
counters.  These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface.  Initially, the Intel XScale
counters are the only ones supported.
2002-08-07 05:14:47 +00:00
scw d911ae5d57 SH5 systrace(5) glue. 2002-07-12 20:43:12 +00:00
scw e6115d56d5 Add some devices which should be present in the latest simulator. 2002-07-12 20:41:55 +00:00
scw 6daca7f652 Ditch the "simulated clock" hack. It would never really have worked,
and the latest simulator won't need it anyway.
2002-07-12 19:52:21 +00:00
scw e9688612da Make it so kernels can be compiled for 32-bit or 64-bit with a
simple config file option.

Also, don't hard code the endian setting in a header file. Rely instead
on the compiler defining __LITTLE_ENDIAN__ and DTRT as appropriate.
2002-07-12 19:33:27 +00:00
scw c02c1c7cd2 Clean up <sh5/asm.h> to be more 64-bit friendly.
Clean up the kernel asm files to be less 32-bit dependent.
2002-07-12 15:42:27 +00:00
scw 0d0a6374ef Some cleanups for the MACHINE_ARCH endian suffix change. 2002-07-11 14:42:55 +00:00
scw e700a799a3 Follow convention for MACHINE_ARCH endian suffix. 2002-07-11 14:07:41 +00:00
scw 0b074fa253 SH5 floating point support, based on sh3. 2002-07-10 10:38:22 +00:00
scw ea38860915 SH5 profiling support. 2002-07-10 10:24:16 +00:00
scw 293298968a Descend into include subdirs and install relevant headers. 2002-07-10 08:56:11 +00:00
scw 59474a8c82 NetBSD, meet the SH-5 cpu.
SH-5, meet NetBSD.

Let's hope this is the start of a long and fruitful relationship. :-)

This code, funded by Wasabi Systems, adds initial support for the
Hitachi SuperH(tm) SH-5 cpu architecture to NetBSD.

At the present time, NetBSD/evbsh5 only runs on a SH-5 core simulator
which has no simulated devices other than a simple console. However, it
is good enough to get to the "root device: " prompt.

Device driver support for Real SH-5 Hardware is in place, particularly for
supporting the up-coming Cayman evaluation board, and should be quite
easy to get running when the hardware is available.

There is no in-tree toolchain for this port at this time. Gcc-current has
rudimentary SH-5 support but it is known to be buggy. A working toolchain
was obtained from SuperH to facilitate this port. Gcc-current will be
fixed in due course.

The SH-5 architecture is fully 64-bit capable, although NetBSD/evbsh5 has
currently only been tested in 32-bit mode. It is bi-endian, via a boot-
time option and it also has an "SHcompact" mode in which it will execute
SH-[34] user-land instructions.

For more information on the SH-5, see www.superh.com. Suffice to say it
is *not* just another respin of the SH-[34].
2002-07-05 13:31:28 +00:00