-##############################################################################
-#
-# Makefile - ID_CPU1 makefile for drivers
-#
-##############################################################################
+# Generic directory or leaf node makefile for OCERA make framework
-ifndef TOP
-TOP = ..
-CONFIG = $(TOP)/config
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
endif
-include $(CONFIG)
-
-######################## Additional Flags section ############################
-
-# Directories list for header files
-INCLUDEDIRS +=
-# Defines for preprocessor
-DEFINES +=
-
-# Compilation flags for C files OTHER than include directories
-# Some drivers use outb macro, requires -O optimization
-CFLAGS += -O
-# Preprocessor flags OTHER than defines
-CPPFLAGS +=
-# Linking flags
-LDFLAGS +=
-
-############################# targets section ################################
-
-# If you want to create a library with the objects files, define the name here
-LIBNAME = libgdbstub.a
-LIBNAMESO = libgdbstub.so
-
-# List of objects to compile
-
-OBJS += gdb-stub.o h8s-2633.o h8s-2633-sci.o
-
-ASMOBJS += h8s-2633-asm.o
-
-######################### Makefile.rules section #############################
-
-include $(TOP)/Makefile.rules
-
-######################## Tools targets section ###############################
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+ @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
--- /dev/null
+# -*- makefile -*-
+
+lib_LIBRARIES = gdbstub
+
+gdbstub_SOURCES = gdb-stub.c h8s-2633.c h8s-2633-sci.c h8s-2633-asm.S
+
+include_HEADERS = gdb-stub.h
--- /dev/null
+##############################################################################
+#
+# Makefile - ID_CPU1 makefile for drivers
+#
+##############################################################################
+
+ifndef TOP
+TOP = ..
+CONFIG = $(TOP)/config
+endif
+
+include $(CONFIG)
+
+######################## Additional Flags section ############################
+
+# Directories list for header files
+INCLUDEDIRS +=
+# Defines for preprocessor
+DEFINES +=
+
+# Compilation flags for C files OTHER than include directories
+# Some drivers use outb macro, requires -O optimization
+CFLAGS += -O
+# Preprocessor flags OTHER than defines
+CPPFLAGS +=
+# Linking flags
+LDFLAGS +=
+
+############################# targets section ################################
+
+# If you want to create a library with the objects files, define the name here
+LIBNAME = libgdbstub.a
+LIBNAMESO = libgdbstub.so
+
+# List of objects to compile
+
+OBJS += gdb-stub.o h8s-2633.o h8s-2633-sci.o
+
+ASMOBJS += h8s-2633-asm.o
+
+######################### Makefile.rules section #############################
+
+include $(TOP)/Makefile.rules
+
+######################## Tools targets section ###############################
+
--- /dev/null
+#ifndef _COMMON_DEF_H
+#define _COMMON_DEF_H
+
+#define UNUSED __attribute ((unused))
+
+#ifndef BIT
+#define BIT(n) (1 << n)
+#endif
+
+#endif /* _COMMON_DEF_H */
#ifndef H8S_2633_DEFS
#define H8S_2633_DEFS
+#include <system_def.h>
+
/* use expedited response insead of just signal */
#define GDB_STATUS_EXPEDITED 1
/* fetch MAC from register file */
#define GDB_HOOK_SUPPORT 0
/* serial port to talk to gdb */
/*#define GDB_SCI_PORT 4 */ /* RS232/485 */
-#define GDB_SCI_PORT 0 /* IRDA */
+#define GDB_SCI_PORT 1 /* IRDA */
/* serial speed */
/*#define GDB_SCI_SPEED 115200U*/
#define GDB_SCI_SPEED 38400U
/* clock speed */
/*#define TARGET_CLOCK_HZ 18432000.0*/
//#define TARGET_CLOCK_HZ 12000000 /*CPU_SYS_HZ*/
-#define TARGET_CLOCK_HZ 11059200 /*CPU_SYS_HZ*/
-
+//#define TARGET_CLOCK_HZ 11059200 /*CPU_SYS_HZ*/
+#define TARGET_CLOCK_HZ CPU_SYS_HZ
#endif
#define RTCOR R_UCHAR(0xfffffed9) /* Refresh timer const */
#define PFCR R_UCHAR(0xfffffdeb) /* Pin Function control */
+/* Exception vectors */
+#define EXCPTVEC_ERI0 80 /* SCI 0 */
+#define EXCPTVEC_ERI1 84 /* SCI 1 */
+#define EXCPTVEC_ERI2 88 /* SCI 2 */
+#define EXCPTVEC_NMI 7
+#define EXCPTVEC_TRAP2 10
+#define EXCPTVEC_TRAP3 11
+#define EXCPTVEC_PBC 27
+
#endif
#if defined(HW_INDEPENDENT)&&HW_INDEPENDENT
#include "cpu_def.h"
#include "system_def.h"
-#include "h8s2633h.h"
+/* #include "h8s2638h.h" */
/* extern void *excptvec_get(int vectnum); */
/* extern void *excptvec_set(int vectnum,void *vect); */
void gdb_platform_init() {
#if defined(HW_INDEPENDENT)&&HW_INDEPENDENT
static const int sci_vect_tab[]=
- {EXCPTVEC_ERI0,EXCPTVEC_ERI1,EXCPTVEC_ERI2,EXCPTVEC_ERI3,EXCPTVEC_ERI4};
+ {EXCPTVEC_ERI0,EXCPTVEC_ERI1,EXCPTVEC_ERI2};
int sci_vect=sci_vect_tab[GDB_SCI_PORT];
excptvec_initfill(gdb_unhandled_isr,0);