9
0
Fork 0

Add M16C serial driver

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1509 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2009-02-17 02:43:47 +00:00
parent 7578682022
commit 2bd3d88d6a
5 changed files with 1223 additions and 21 deletions

View File

@ -43,10 +43,8 @@ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c \
up_udelay.c up_unblocktask.c up_usestack.c
CHIP_ASRCS = m16c_vectors.S
#CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c \
# m16c_timerisr.c m16c_serial.c m16c_dumpstate.c
CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c \
m16c_timerisr.c m16c_dumpstate.c
m16c_timerisr.c m16c_serial.c m16c_dumpstate.c
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CHIP_CSRCS += m16c_schedulesigaction.c m16c_sigdeliver.c

View File

@ -251,20 +251,28 @@
#ifndef __ASSEMBLY__
extern uint16 g_snbss; /* Start of near .bss */
extern uint16 g_enbss; /* End+1 of near .bss */
extern uint16 g_sndata; /* Start of near .data */
extern uint16 g_endata; /* End+1 of near .data */
extern uint32 g_enronly; /* Start of relocated read-only data in FLASH */
extern uint16 g_snbss; /* Start of near .bss */
extern uint16 g_enbss; /* End+1 of near .bss */
extern uint16 g_sndata; /* Start of near .data */
extern uint16 g_endata; /* End+1 of near .data */
extern uint32 g_enronly; /* Start of relocated read-only data in FLASH */
#ifdef CONFIG_M16C_HAVEFARRAM
extern uint32 g_sfbss; /* Start of far .bss */
extern uint32 g_efbss; /* End+1 of far .bss */
extern uint32 g_sfdata; /* Start of far .data */
extern uint32 g_efdata; /* End_1 of far .data */
extern uint32 g_efronly; /* Start of relocated read-only data in FLASH */
extern uint32 g_sfbss; /* Start of far .bss */
extern uint32 g_efbss; /* End+1 of far .bss */
extern uint32 g_sfdata; /* Start of far .data */
extern uint32 g_efdata; /* End_1 of far .data */
xtern uint32 g_efronly; /* Start of relocated read-only data in FLASH */
#endif
extern uint32 g_svarvect; /* Start of variable vectors */
extern uint32 g_heapbase; /* Start of the heap */
/* Address of the saved user stack pointer */
#ifndef __ASSEMBLY__
# if CONFIG_ARCH_INTERRUPTSTACK > 3
extern uint16 g_userstack;
# endif
#endif
extern uint32 g_svarvect; /* Start of variable vectors */
extern uint32 g_heapbase; /* Start of the heap */
#endif /* __ASSEMBLY__ */

View File

@ -91,6 +91,18 @@ static inline uint16 m16c_getsp(void)
return sp;
}
/****************************************************************************
* Name: m16c_getusersp
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
static inline uint16 m16c_getusersp(void)
{
ubyte *ptr = (ubyte*) current_regs;
return (uint16)ptr[REG_SP] << 8 | ptr[REG_SP+1];
}
#endif
/****************************************************************************
* Name: m16c_stackdump
****************************************************************************/
@ -199,11 +211,9 @@ void up_dumpstate(void)
m16c_stackdump(sp, istackbase);
/* Extract the user stack pointer which should lie
* at the base of the interrupt stack.
*/
/* Extract the user stack pointer from the register area */
sp = g_userstack;
sp = m16c_getusersp();
lldbg("sp: %04x\n", sp);
}

View File

@ -71,8 +71,8 @@
# undef CONFIG_UART2_SERIAL_CONSOLE
#elif defined(CONFIG_UART2_SERIAL_CONSOLE) && !defined(CONFIG_UART2_DISABLE)
# define HAVE_CONSOLE 1
# undef CONFIG_UART0_SERIAL_CONSOLE
# undef CONFIG_UART1_SERIAL_CONSOLE
# undef CONFIG_UART2_SERIAL_CONSOLE
#else
# if defined(CONFIG_UART0_SERIAL_CONSOLE) || defined(CONFIG_UART1_SERIAL_CONSOLE)|| defined(CONFIG_UART2_SERIAL_CONSOLE)
# error "Serial console selected, but corresponding UART not enabled"
@ -183,7 +183,7 @@
#ifdef HAVE_CONSOLE
static inline int up_txready(void)
{
/* Check the TI bit in the CI register. 1=Transmit buffer emptyy */
/* Check the TI bit in the CI register. 1=Transmit buffer empty */
return ((getreg8(M16C_UART_BASE + M16C_UART_C1) & UART_C1_TI) != 0);
}

File diff suppressed because it is too large Load Diff