This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
H8/300 patches (8/8) miscellaneous
- From: Yoshinori Sato <ysato at users dot sourceforge dot jp>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: Fri, 05 Mar 2004 01:42:35 +0900
- Subject: H8/300 patches (8/8) miscellaneous
micellaneous updates.
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
Index: hal/h8300/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvsroot/ecos-h8/ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 redboot_linux_exec.c
--- hal/h8300/arch/current/src/redboot_linux_exec.c 27 Nov 2003 14:27:21 -0000 1.1.1.1
+++ hal/h8300/arch/current/src/redboot_linux_exec.c 4 Mar 2004 13:31:23 -0000
@@ -59,12 +59,20 @@
#define str(s...) #s
static void do_exec(int argc, char *argv[]);
+static void do_set_mem(int argc, char *argv[]);
+
RedBoot_cmd("exec",
"Execute an image",
"[-b <command line addr>] [-c \"kernel command line\"]\n"
" [<entry point>]",
do_exec
);
+RedBoot_cmd("set",
+ "Set Memory",
+ "-b address -[1|2|4] -d data",
+ do_set_mem
+ );
+
static void
do_exec(int argc, char *argv[])
@@ -80,9 +88,9 @@
int oldints;
init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM,
- (void **)&command_addr, &command_addr_set, "command line address");
+ &command_addr, &command_addr_set, "command line address");
init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR,
- (void **)&cmd_line, &command_line_set, "kernel command line");
+ &cmd_line, &command_line_set, "kernel command line");
if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry,
OPTION_ARG_TYPE_NUM, "entry address"))
@@ -104,4 +112,61 @@
while ((*pcmd++ = *cmd_line++));
asm ("jmp @%0" : : "r" (entry));
+}
+
+static void
+do_set_mem(int argc, char *argv[])
+{
+ struct option_info opts[5];
+ unsigned long base, data;
+ bool base_set, data_set,len_set = 0;
+ static char _size = 1;
+ bool set_32bit, set_16bit, set_8bit;
+
+ init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM,
+ &base, (bool *)&base_set, "base address");
+ init_opts(&opts[1], 'd', true, OPTION_ARG_TYPE_NUM,
+ &data, (bool *)&data_set, "write_data");
+ init_opts(&opts[2], '4', false, OPTION_ARG_TYPE_FLG,
+ &set_32bit, (bool *)0, "dump 32 bit units");
+ init_opts(&opts[3], '2', false, OPTION_ARG_TYPE_FLG,
+ &set_16bit, (bool *)0, "dump 16 bit units");
+ init_opts(&opts[4], '1', false, OPTION_ARG_TYPE_FLG,
+ &set_8bit, (bool *)0, "dump 8 bit units");
+ if (!scan_opts(argc, argv, 1, opts, 5, 0, 0, "")) {
+ return;
+ }
+ if (!base_set) {
+ diag_printf("illigal base\n");
+ return ;
+ }
+
+ if (!data_set) {
+ diag_printf("illigal data\n");
+ return ;
+ }
+
+ if (set_32bit) {
+ _size = 4;
+ } else if (set_16bit) {
+ _size = 2;
+ } else if (set_8bit) {
+ _size = 1;
+ }
+
+ if (!len_set) {
+ _size = 4;
+ }
+ diag_printf("%d %x = %x\n",_size,base,data);
+ switch( _size ) {
+ case 1:
+ *(unsigned char *)base=data;
+ break;
+ case 2:
+ *(unsigned short *)base=data;
+ break;
+ case 4:
+ *(unsigned long *)base=data;
+ break;
+ }
}
Index: hal/h8300/h8300h/current/src/var_misc.c
===================================================================
RCS file: /cvsroot/ecos-h8/ecos/packages/hal/h8300/h8300h/current/src/var_misc.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 var_misc.c
--- hal/h8300/h8300h/current/src/var_misc.c 27 Nov 2003 14:27:22 -0000 1.1.1.4
+++ hal/h8300/h8300h/current/src/var_misc.c 4 Mar 2004 13:31:29 -0000
@@ -145,7 +145,7 @@
ier &= ~0x20;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | ier);
} else {
- if ((vector > 12) && regs->ier) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->ier) {
HAL_READ_UINT8(regs->ier,ier);
ier &= ~(regs->mask);
HAL_WRITE_UINT8(regs->ier,ier);
@@ -168,7 +168,7 @@
ier |= 0x20;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | ier);
} else {
- if ((vector > 12) && regs->ier) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->ier) {
HAL_READ_UINT8(regs->ier,ier);
ier |= regs->mask;
HAL_WRITE_UINT8(regs->ier,ier);
@@ -194,7 +194,7 @@
isr &= ~0x80;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | isr);
} else {
- if ((vector > 12) && regs->isr) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->isr) {
HAL_READ_UINT8(regs->isr,isr);
isr &= ~(regs->status);
HAL_WRITE_UINT8(regs->isr,isr);
Index: hal/h8300/h8s/current/src/var_misc.c
===================================================================
RCS file: /cvsroot/ecos-h8/ecos/packages/hal/h8300/h8s/current/src/var_misc.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 var_misc.c
--- hal/h8300/h8s/current/src/var_misc.c 27 Nov 2003 14:27:24 -0000 1.1.1.1
+++ hal/h8300/h8s/current/src/var_misc.c 4 Mar 2004 13:31:34 -0000
@@ -196,13 +196,13 @@
hal_interrupt_mask(int vector)
{
CYG_BYTE ier;
- const struct int_regs *regs=&interrupt_registers[vector-12];
+ const struct int_regs *regs=&interrupt_registers[vector-CYGNUM_HAL_INTERRUPT_EXTERNAL_0];
if (vector == CYGNUM_HAL_INTERRUPT_WDT) {
HAL_READ_UINT8(CYGARC_TCSR,ier);
ier &= ~0x20;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | ier);
} else {
- if ((vector > 16) && regs->ier) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->ier) {
HAL_READ_UINT8(regs->ier,ier);
ier &= ~(regs->mask);
HAL_WRITE_UINT8(regs->ier,ier);
@@ -216,13 +216,13 @@
hal_interrupt_unmask(int vector)
{
CYG_BYTE ier;
- const struct int_regs *regs=&interrupt_registers[vector-12];
+ const struct int_regs *regs=&interrupt_registers[vector-CYGNUM_HAL_INTERRUPT_EXTERNAL_0];
if (vector == CYGNUM_HAL_INTERRUPT_WDT) {
HAL_READ_UINT8(CYGARC_TCSR,ier);
ier |= 0x20;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | ier);
} else {
- if ((vector > 16) && regs->ier) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->ier) {
HAL_READ_UINT8(regs->ier,ier);
ier |= regs->mask;
HAL_WRITE_UINT8(regs->ier,ier);
@@ -236,7 +236,7 @@
hal_interrupt_acknowledge(int vector)
{
CYG_BYTE isr;
- const struct int_regs *regs=&interrupt_registers[vector-12];
+ const struct int_regs *regs=&interrupt_registers[vector-CYGNUM_HAL_INTERRUPT_EXTERNAL_0];
if (vector >= CYGNUM_HAL_INTERRUPT_DEND0A &&
vector <= CYGNUM_HAL_INTERRUPT_DEND1B)
return;
@@ -245,7 +245,7 @@
isr &= ~0x80;
HAL_WRITE_UINT16(CYGARC_TCSR,0xa500 | isr);
} else {
- if ((vector > 16) && regs->isr) {
+ if ((vector >= CYGNUM_HAL_INTERRUPT_EXTERNAL_0) && regs->isr) {
HAL_READ_UINT8(regs->isr,isr);
isr &= ~(regs->status);
HAL_WRITE_UINT8(regs->isr,isr);
Index: hal/h8300/sim_s/current/include/plf_intr.h
===================================================================
RCS file: /cvsroot/ecos-h8/ecos/packages/hal/h8300/sim_s/current/include/plf_intr.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 plf_intr.h
--- hal/h8300/sim_s/current/include/plf_intr.h 27 Nov 2003 14:27:25 -0000 1.1.1.1
+++ hal/h8300/sim_s/current/include/plf_intr.h 4 Mar 2004 13:31:36 -0000
@@ -5,7 +5,7 @@
//
// plf_intr.h
//
-// EDOSK-2674R interrupt and clock support
+// H8S SIM interrupt and clock support
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####