Add M16C serial driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1509 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
84afa0acb5
commit
2c7e99fd96
@ -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
|
||||
|
@ -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__ */
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
1186
arch/sh/src/m16c/m16c_serial.c
Normal file
1186
arch/sh/src/m16c/m16c_serial.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user