add SH4 configuration.

(SH) don't access SCIF if the Windows CE's COM1 is not connected to SCIF.
This commit is contained in:
uch 2001-03-13 16:31:29 +00:00
parent 43bd337868
commit 2e79fe1ec7
10 changed files with 1733 additions and 1654 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2001/03/04 16:51:04 uch Exp $
# $NetBSD: Makefile,v 1.4 2001/03/13 16:31:29 uch Exp $
#
PROJECT_DIRS = hpcboot libz libsa
@ -52,8 +52,7 @@ clean:
rm -f hpcboot/hpcboot.plg
# compile directory
rm -rf compile/ARMDebug compile/ARMRelease \
compile/SH3Debug compile/SH3Release \
compile/SHDebug compile/SHRelease \
compile/SH*Debug compile/SH*Release \
compile/MIPSDebug compile/MIPSRelease
find . -name "hpcboot.exe" -print |xargs rm -f
@ -62,7 +61,7 @@ distclean: clean
# WCE210 or later binary
install:
for a in SH3 ARM MIPS; do \
for a in SH3 SH4 ARM MIPS; do \
file=`echo "compile/"$$a"Release/hpcboot.exe"`; \
cp $$file binary/$$a/hpcboot.exe; \
done

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ M35J0``,````$````__\``+@`````````0```````````````````````````
M````````````````````T`````X?N@X`M`G-(;@!3,TA5&AI<R!P<F]G<F%M
M(&-A;FYO="!B92!R=6X@:6X@1$]3(&UO9&4N#0T*)`````````!]KZ(^.<[,
M;3G.S&TYSLQM"/^0(#K.S&UQ/MYM*L[,;;S1WVU-SLQM.<[,;2/.S&U:R<IM
M.,[,;5)I8V@YSLQM`````````````````````%!%``!F`04`'AFA.@``````
M.,[,;5)I8V@YSLQM`````````````````````%!%``!F`04`'?BL.@``````
M````X``/`0L!!@$`Y@```*(```````"X\P```!```````0````$``!`````"
M```$``````````(`"P```````,`!```$````````"0```````0``$``````0
M```0````````$```````````````(`H!`%``````D`$`%"$```!P`0`4%```

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.2 2001/03/04 16:51:05 uch Exp $
# $NetBSD: Makefile,v 1.3 2001/03/13 16:31:31 uch Exp $
BUILD_ARCH = ARM SH3 MIPS
BUILD_ARCH = ARM SH3 SH4 MIPS
vc5: clean
TYPE=application sh gen_template.sh vc5 SH MIPS

View File

@ -1,4 +1,4 @@
# $NetBSD: do_subst.awk,v 1.2 2001/03/04 16:51:05 uch Exp $
# $NetBSD: do_subst.awk,v 1.3 2001/03/13 16:31:31 uch Exp $
#
# Copyright (c) 1999, 2000 Christopher G. Demetriou. All rights reserved.
#
@ -82,6 +82,7 @@ BEGIN {
SRCFILES_ARM = setup_md_files("ARM", "SRCFILE_LIST_ARM", SRCFILES_ARM)
SRCFILES_SH3 = setup_md_files("SH3", "SRCFILE_LIST_SH3", SRCFILES_SH3)
SRCFILES_SH4 = setup_md_files("SH4", "SRCFILE_LIST_SH3", SRCFILES_SH3)
SRCFILES_SH = setup_md_files("SH", "SRCFILE_LIST_SH3", SRCFILES_SH3)
SRCFILES_MIPS = setup_md_files("MIPS", "SRCFILE_LIST_MIPS",
SRCFILES_MIPS)
@ -191,6 +192,7 @@ BEGIN {
gsub("%%% SRCFILES %%%", SRCFILES)
gsub("%%% SRCFILES_ARM %%%", SRCFILES_ARM)
gsub("%%% SRCFILES_SH3 %%%", SRCFILES_SH3)
gsub("%%% SRCFILES_SH4 %%%", SRCFILES_SH4)
gsub("%%% SRCFILES_SH %%%", SRCFILES_SH)
gsub("%%% SRCFILES_MIPS %%%", SRCFILES_MIPS)
gsub("%%% CPPDEFS %%%", CPPDEFS)

View File

@ -1,4 +1,4 @@
/* $NetBSD: scifreg.h,v 1.1 2001/02/09 18:35:14 uch Exp $ */
/* $NetBSD: scifreg.h,v 1.2 2001/03/13 16:31:31 uch Exp $ */
/*-
* Copyright (C) 1999 SAITOH Masanobu. All rights reserved.
@ -46,12 +46,6 @@
#define SHREG_SCFCR2 (*(volatile unsigned char *) 0xa400015C)
#define SHREG_SCFDR2 (*(volatile unsigned short *) 0xa400015E)
#define SCSMR2_CHR 0x40 /* Character length */
#define SCSMR2_PE 0x20 /* Parity enable */
#define SCSMR2_OE 0x10 /* Parity mode */
#define SCSMR2_STOP 0x08 /* Stop bit length */
#define SCSMR2_CKS 0x03 /* Clock select */
#define SCSCR2_TIE 0x80 /* Transmit Interrupt Enable */
#define SCSCR2_RIE 0x40 /* Recieve Interrupt Enable */
#define SCSCR2_TE 0x20 /* Transmit Enable */
@ -148,4 +142,10 @@
#define SCFDR2_TXF_FULL 0x1000 /* Tx FULL */
#define SCFDR2_RXF_EPTY 0x0000 /* Rx EMPTY */
#define SCSMR2_CHR 0x40 /* Character length */
#define SCSMR2_PE 0x20 /* Parity enable */
#define SCSMR2_OE 0x10 /* Parity mode */
#define SCSMR2_STOP 0x08 /* Stop bit length */
#define SCSMR2_CKS 0x03 /* Clock select */
#endif /* !_SH3_SCIFREG_ */

View File

@ -1,4 +1,4 @@
/* -*-C++-*- $NetBSD: sh3.h,v 1.2 2001/02/21 16:01:54 uch Exp $ */
/* -*-C++-*- $NetBSD: sh3.h,v 1.3 2001/03/13 16:31:31 uch Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -229,7 +229,7 @@ void resumeIntr(u_int32_t);
__END_DECLS
/*
* SCIF (Windows CE's COM1)
* SCIF
*/
#define SCIF_SCSMR2_REG8 0xa4000150 /* R/W */
#define SCIF_SCBRR2_REG8 0xa4000152 /* R/W */
@ -246,12 +246,12 @@ __END_DECLS
#define SCIF_SCSSR2_TEND 0x00000040
/* simple serial console macros. */
#define TX_BUSY() \
#define SCIF_TX_BUSY() \
while ((VOLATILE_REF16(SCIF_SCSSR2_REG16) & SCIF_SCSSR2_TDFE) == 0)
#define PUTC(c) \
#define SCIF_PUTC(c) \
__BEGIN_MACRO \
TX_BUSY(); \
SCIF_TX_BUSY(); \
/* wait until previous transmit done. */ \
VOLATILE_REF8(SCIF_SCFTDR2_REG8) =(c); \
/* Clear transmit FIFO empty flag */ \
@ -259,29 +259,29 @@ __BEGIN_MACRO \
~(SCIF_SCSSR2_TDFE | SCIF_SCSSR2_TEND); \
__END_MACRO
#define PRINT(s) \
#define SCIF_PRINT(s) \
__BEGIN_MACRO \
char *__s =(char *)(s); \
int __i; \
for (__i = 0; __s[__i] != '\0'; __i++) { \
char __c = __s[__i]; \
if (__c == '\n') \
PUTC('\r'); \
PUTC(__c); \
SCIF_PUTC('\r'); \
SCIF_PUTC(__c); \
} \
__END_MACRO
#define PRINT_HEX(h) \
#define SCIF_PRINT_HEX(h) \
__BEGIN_MACRO \
u_int32_t __h =(u_int32_t)(h); \
int __i; \
PUTC('0'); PUTC('x'); \
SCIF_PUTC('0'); SCIF_PUTC('x'); \
for (__i = 0; __i < 8; __i++, __h <<= 4) { \
int __n =(__h >> 28) & 0xf; \
char __c = __n > 9 ? 'A' + __n - 10 : '0' + __n; \
PUTC(__c); \
SCIF_PUTC(__c); \
} \
PUTC('\r'); PUTC('\n'); \
SCIF_PUTC('\r'); SCIF_PUTC('\n'); \
__END_MACRO
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: sh_console.cpp,v 1.1 2001/02/09 18:35:18 uch Exp $ */
/* $NetBSD: sh_console.cpp,v 1.2 2001/03/13 16:31:31 uch Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -36,13 +36,73 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <hpcmenu.h>
#include <sh3/sh_console.h>
SHConsole *SHConsole::_instance = 0;
struct SHConsole::console_info
SHConsole::_console_info[] = {
{ PLATID_CPU_SH_3_7709 , PLATID_MACH_HP_LX_620 , SCIFPrint },
{ PLATID_CPU_SH_3_7709 , PLATID_MACH_HP_LX_620JP , SCIFPrint },
{ PLATID_CPU_SH_3_7709A , PLATID_MACH_HP_JORNADA_680 , SCIFPrint },
{ PLATID_CPU_SH_3_7709A , PLATID_MACH_HP_JORNADA_680JP , SCIFPrint },
{ PLATID_CPU_SH_3_7709A , PLATID_MACH_HP_JORNADA_690 , SCIFPrint },
{ PLATID_CPU_SH_3_7709A , PLATID_MACH_HP_JORNADA_690JP , SCIFPrint },
{ PLATID_CPU_SH_3_7709 , PLATID_MACH_HITACHI_PERSONA_HPW230JC , 0 }, // HD64461 Serial module
{ 0, 0, 0 } // terminator.
};
SHConsole::SHConsole()
{
_print = 0;
}
SHConsole::~SHConsole()
{
}
SHConsole *
SHConsole::Instance()
{
if (!_instance)
_instance = new SHConsole();
return _instance;
}
BOOL
SHConsole::init()
{
HpcMenuInterface &menu = HpcMenuInterface::Instance();
struct console_info *tab = _console_info;
u_int32_t cpu, machine;
_kmode = SetKMode(1);
cpu = menu._pref.platid_hi;
machine = menu._pref.platid_lo;
for (; tab->cpu; tab++) {
if (tab->cpu == cpu && tab->machine == machine) {
_print = tab->print;
break;
}
}
/*
* always open COM1 to supply clock and power for the
* sake of kernel serial driver
*/
return openCOM1();
}
void
SHConsole::print(const TCHAR *fmt, ...)
{
if (_print == 0)
return;
va_list ap;
va_start(ap, fmt);
wvsprintf(_bufw, fmt, ap);
@ -51,5 +111,12 @@ SHConsole::print(const TCHAR *fmt, ...)
if (!setupBuffer())
return;
PRINT(_bufm);
_print(_bufm);
}
void
SHConsole::SCIFPrint(const char *buf)
{
SCIF_PRINT(buf);
}

View File

@ -1,4 +1,4 @@
/* -*-C++-*- $NetBSD: sh_console.h,v 1.1 2001/02/09 18:35:19 uch Exp $ */
/* -*-C++-*- $NetBSD: sh_console.h,v 1.2 2001/03/13 16:31:31 uch Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -45,27 +45,27 @@
#include <sh3/sh3.h>
class SHConsole : public SerialConsole {
public:
typedef void (*print_func_t)(const char *);
struct console_info {
u_int32_t cpu, machine;
print_func_t print;
};
static struct console_info _console_info[];
static void SCIFPrint(const char *);
private:
static SHConsole *_instance;
int _kmode;
print_func_t _print;
SHConsole(void);
SHConsole(void) { /* NO-OP */ }
public:
virtual ~SHConsole() {
SetKMode(_kmode);
}
static SHConsole *Instance(void) {
if (!_instance)
_instance = new SHConsole();
return _instance;
}
virtual BOOL init(void) {
_kmode = SetKMode(1);
return openCOM1();
}
virtual ~SHConsole();
static SHConsole *Instance(void);
virtual BOOL init(void);
virtual void print(const TCHAR *fmt, ...);
};
#endif //_HPCBOOT_SH_CONSOLE_H_