Commit Graph

120 Commits

Author SHA1 Message Date
scw 009e79b59b Remove some accidentally committed debug code. 2002-11-24 10:43:15 +00:00
scw a3885e9bdd - Change VM_MIN_KERNEL_ADDRESS to start at KSEG1 instead of KSEG0.
- Overhaul the TLB management code such that we now keep track of
   the exact TLB slot at which a mapping was inserted, both for user-
   space and kernel mappings. This addresses #2 on the TODO list.
2002-11-23 09:25:54 +00:00
scw 7e40fdd6f9 Keep evbsh5-specific major device declarations separate from the shared
sh5 devices.
2002-11-23 09:13:18 +00:00
scw 5f18a49912 Add alphaledio.h 2002-11-23 09:05:27 +00:00
scw a354470bbf Support for the alphanumeric LED display on the SuperH Cayman board. 2002-11-23 09:05:03 +00:00
scw f8647e7e3c Make interrupt routing work for PCI slots 2 and 3. 2002-10-31 14:54:37 +00:00
scw 590d641525 A 64-bit config file for the Cayman. 2002-10-23 13:28:01 +00:00
scw c774ffbae4 MD glue for COMPAT_NETBSD32 on SH-5. 2002-10-23 13:26:35 +00:00
scw 1ad6189f11 No, really attach sm(4) at sysfpga... 2002-10-22 15:35:25 +00:00
scw b604625664 - sm at sysfpga,
- gsip at pci (and its phy)
2002-10-22 15:21:24 +00:00
scw 8477927799 - Attach sm(4) at sysfpga instead of at superio. The latter was a relic
of when we used to attach sm(4) to the isabus.
- Re-work sysfpga's interrupt naming scheme to reflect that used in the docs.
2002-10-22 15:19:06 +00:00
scw b12d613c40 Enable the NMI only if DDB is defined, instead of DEBUG. 2002-10-22 14:38:26 +00:00
scw bce8874166 Make this compile when DEBUG is not defined. 2002-10-22 14:17:34 +00:00
scw 6a2132797e - Simplify early initialisation so we do most of it in C.
- Call allocsys() much earlier so we can use uvm_pageboot_alloc() to
  steal KSEG0 pages for system tables.
2002-10-22 09:30:26 +00:00
scw c01b319dcc There seem to be some stability problems with the scif serial port driver
at the moment, possibly as a side-effect of some yet-to-be-committed SH5
speed-ups.

Work-around it for now by using com0 as the console.
2002-10-19 08:43:32 +00:00
scw 472a1ad6b2 When setting up to probe a com(4) port for use as the console, make sure
the port is powered up and configured correctly.
2002-10-19 08:39:50 +00:00
scw a92b12e63a Enable the early bus_space_map() of the sysfpga's registers. 2002-10-14 14:21:35 +00:00
scw 89612efe30 Interrupt overhaul:
- Allocate interrupt handles dynamically from a pool(9) to reduce the
   number of TLB misses during interrupt dispatch.
 - Fully support evcnt(9) in all interrupt dispatchers.
2002-10-14 14:19:27 +00:00
scw f07358cb66 - Make sure not to sign-extend the PA of KSEG0, particulary in 64-bit mode,
- Moved intrnames/eintrnames here, since they're pretty much board-specific.
2002-10-08 15:52:02 +00:00
scw 199e165526 Add a cacheop for purging/invalidating the whole operand/insn caches.
This is currently not used (actually, it was used locally for a short time
while tracking down a pmap bug), but is here in case it's needed later.
2002-10-07 14:48:14 +00:00
scw c3ed42912c Simplify the scsibus attatchment as pointed out by Simon Burge. 2002-10-07 08:20:07 +00:00
scw c784454024 Use a more aesthetically pleasing 10% duty-cycle for the heartbeat LED. 2002-10-05 12:18:58 +00:00
scw a7330033a9 Add ex(4), ahc(4), scsibus(4), and sd(4). 2002-10-05 11:43:23 +00:00
scw 1b3c8f3be0 Flesh out cpu_reboot(). 2002-10-05 11:01:13 +00:00
scw fa307a78a6 A couple of additions:
- sysfpga_sreset()
   Hit the soft-reset register to reset the board.

 - sysfpga_twinkle_led()
   Might as well put the blinkenlight on the Cayman to good use as
   a "heartbeat" indicator.
2002-10-05 10:59:10 +00:00
scw db80ebe781 Add needs-flag to sysfpga, and check it before calling sysfpga_nmi_clear(). 2002-10-04 09:24:52 +00:00
scw d4c3160197 pmap_bootstrap() needs to know the physical address of KSEG0. 2002-10-04 09:23:27 +00:00
thorpej c5e91d447d Use CFATTACH_DECL(). 2002-10-02 04:55:47 +00:00
scw 9d94c9899c Check if an interrupt is already claimed _after_ locating the
right interrupt handle.
2002-10-01 07:58:54 +00:00
scw a7be636d26 Rename the SH5 PCI attachment to "sh5pci" instead of abusing the "pcibus"
config definition. The new config world order is more picky about such things.
2002-09-28 13:08:22 +00:00
scw f5138efc2e Fix things so the com(4) probe in consinit() works. 2002-09-28 12:50:27 +00:00
scw 5868dbcbf6 Make this work following the gehenna_devsw merge. 2002-09-28 12:49:17 +00:00
scw 251ba05b3f Support for the SH5 on-chip PCI bridge, and support for its deployment
in the Cayman board.
2002-09-28 11:16:36 +00:00
thorpej 9a711d6985 Declare all cfattach structures const. 2002-09-27 20:29:02 +00:00
thorpej 6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
thorpej d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
thorpej c12a2960bb In sysfpgamatch(), the expression "cf->cf_driver == &sysfpga_cd" is
always true, so just return the constant 1.
2002-09-26 20:25:41 +00:00
scw d942ee4018 - Setup the cpu-specific cache manipulation function pointers.
- Add sh5_nmi_clear().
2002-09-22 20:52:12 +00:00
scw f1780fd0ae Add sysfpga_nmi_clear(). This resets the NMI one-shot in Cayman's
System FPGA chip.
2002-09-22 20:51:09 +00:00
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