diff --git a/arch/8051/Kconfig b/arch/8051/Kconfig index ae2bf31307d..9c389b95935 100644 --- a/arch/8051/Kconfig +++ b/arch/8051/Kconfig @@ -2,3 +2,47 @@ # For a description of the syntax of this configuration file, # see misc/tools/kconfig-language.txt. # + +if ARCH_8051 +comment "ARM Options" + +choice + prompt "8051 Chip Selection" + default ARCH_CHIP_8052 + +config ARCH_CHIP_8051 + bool "8051" + +config ARCH_CHIP_8052 + bool "8052" + +endchoice # 8051 Chip Selection + +comment "Bring-up Debug Options" + +config ARCH_8051_BRINGUP + bool "Bring-up debug" + default n + ---help--- + Enable bring-up debug instrumentation + +config ARCH_8051_NOSYSTIMER + bool "No system timer" + ---help--- + By default, Timer0 will be used as the system timer. Use of the + system timer can be suppressed with the setting. This is useful + during bring-up. + +config ARCH_8051_BRINGUP + bool "Bring-up debug" + default n + ---help--- + Enable bring-up debug instrumentation + +config ARCH_8051_SUPRESS_INTERRUPTS + bool "Suppress interrupts" + default n + ---help--- + It is useful during low-level bring-up to suppress all interrupts. + +endif # ARCH_8051 diff --git a/arch/8051/include/arch.h b/arch/8051/include/arch.h index 4626662e42a..48ab2b331bf 100644 --- a/arch/8051/include/arch.h +++ b/arch/8051/include/arch.h @@ -64,7 +64,8 @@ #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif @@ -74,7 +75,7 @@ extern "C" { * code to dump the stack pointer at critical locations. */ -EXTERN void up_showsp(uint8_t ch) __naked; +void up_showsp(uint8_t ch) __naked; #undef EXTERN #ifdef __cplusplus diff --git a/arch/8051/src/up_debug.c b/arch/8051/src/up_debug.c index 27049f7f5e3..35a5d1d50ca 100644 --- a/arch/8051/src/up_debug.c +++ b/arch/8051/src/up_debug.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_assert.c + * arch/8051/src/up_debug.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ * Private Functions ************************************************************************/ -#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_8051_BRINGUP) static void up_putspace(void) __naked { _asm @@ -103,7 +103,7 @@ static void _up_dump8(__code char *ptr, uint8_t b) * Name: up_puthex, up_puthex16, up_putnl, up_puts ************************************************************************/ -#if defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_ARCH_8051_BRINGUP) void up_puthex(uint8_t hex) __naked { hex; /* To avoid unreferenced argument warning */ @@ -141,7 +141,7 @@ void up_puts(__code char *ptr) * Name: up_dumpstack ************************************************************************/ -#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_8051_BRINGUP) void up_dumpstack(void) { NEAR uint8_t *start = (NEAR uint8_t *)(STACK_BASE & 0xf0); @@ -177,7 +177,7 @@ void up_dumpstack(void) * Name: up_dumpframe ************************************************************************/ -#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_8051_BRINGUP) void up_dumpframe(FAR struct xcptcontext *context) { #ifdef CONFIG_FRAME_DUMP_SHORT @@ -238,7 +238,7 @@ void up_dumpframe(FAR struct xcptcontext *context) * code to dump the stack pointer at critical locations. */ -#ifdef CONFIG_ARCH_PJRC +#ifdef CONFIG_ARCH_8051_BRINGUP void up_showsp(uint8_t ch) __naked { ch; diff --git a/arch/8051/src/up_head.S b/arch/8051/src/up_head.S index 81653d603cc..ee39cd54dee 100644 --- a/arch/8051/src/up_head.S +++ b/arch/8051/src/up_head.S @@ -1,7 +1,7 @@ /************************************************************ - * up_head.S + * arch/8051/src/up_head.S * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ .area REG_BANK_0 (REL,OVR,DATA) .ds 8 -#ifndef CONFIG_8052_TIMER2 +#ifndef CONFIG_ARCH_8051_NOSYSTIMER .area XSEG _g_timer0tick: .ds 1 @@ -99,7 +99,7 @@ _g_timer0tick: .org PM2_VECTOR_TIMER0 push acc -#ifdef CONFIG_8052_TIMER2 +#ifdef CONFIG_ARCH_8051_NOSYSTIMER mov a, #TIMER0_IRQ ljmp _up_interrupt #else @@ -162,7 +162,7 @@ start: * ************************************************************/ -#ifndef CONFIG_8052_TIMER2 +#ifndef CONFIG_ARCH_8051_NOSYSTIMER _up_timer0: ar2 = 0x02 ar3 = 0x03 diff --git a/arch/8051/src/up_idle.c b/arch/8051/src/up_idle.c index 02125e4e253..a5d39bcfb0c 100644 --- a/arch/8051/src/up_idle.c +++ b/arch/8051/src/up_idle.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_idle.c + * arch/8051/src/up_idle.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ * Private Data ************************************************************************/ -#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_8051_BRINGUP) static uint8_t g_ledtoggle = 0; #endif @@ -81,7 +81,7 @@ static uint8_t g_ledtoggle = 0; void up_idle(void) { -#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP) +#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_8051_BRINGUP) g_ledtoggle++; if (g_ledtoggle == 0x80) { diff --git a/arch/8051/src/up_initialize.c b/arch/8051/src/up_initialize.c index 3dd9b1bdf59..d812552a608 100644 --- a/arch/8051/src/up_initialize.c +++ b/arch/8051/src/up_initialize.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_initialize.c + * arch/8051/src/up_initialize.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -135,7 +135,7 @@ void up_initialize(void) /* Initialize the system timer interrupt */ -#ifndef CONFIG_SUPPRESS_INTERRUPTS +#ifndef CONFIG_ARCH_8051_SUPRESS_INTERRUPTS up_timerinit(); #endif diff --git a/arch/8051/src/up_internal.h b/arch/8051/src/up_internal.h index 4260be05a39..43742b10902 100644 --- a/arch/8051/src/up_internal.h +++ b/arch/8051/src/up_internal.h @@ -1,7 +1,7 @@ /************************************************************************** - * up_internal.h + * arch/8051/src/up_internal.h * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * **************************************************************************/ -#ifndef __ARCH_UP_INTERNAL_H -#define __ARCH_UP_INTERNAL_H +#ifndef __ARCH_8051_SRC_UP_INTERNAL_H +#define __ARCH_8051_SRC_UP_INTERNAL_H /************************************************************************** * Included Files @@ -108,29 +108,30 @@ extern const uint8_t g_ntobit[8]; #ifndef __ASSEMBLY__ #if CONFIG_MM_REGIONS > 1 -extern void up_addregion(void); +void up_addregion(void); #endif -extern void up_delay(uint8_t milliseconds) __naked; -extern void up_irqinitialize(void); -extern void up_restorecontext(FAR struct xcptcontext *context) _naked; -extern void up_restoreregisters(FAR uint8_t *regs) _naked; -extern uint8_t up_savecontext(FAR struct xcptcontext *context) __naked; -extern void up_saveregisters(FAR uint8_t *regs) _naked; -extern void up_saveirqcontext(FAR struct xcptcontext *context); -extern void up_timerinit(void); +void up_delay(uint8_t milliseconds) __naked; +void up_irqinitialize(void); +void up_restorecontext(FAR struct xcptcontext *context) _naked; +void up_restoreregisters(FAR uint8_t *regs) _naked; +uint8_t up_savecontext(FAR struct xcptcontext *context) __naked; +void up_saveregisters(FAR uint8_t *regs) _naked; +void up_saveirqcontext(FAR struct xcptcontext *context); +void up_timerinit(void); /* Defined in up_debug.c */ -#if defined(CONFIG_ARCH_BRINGUP) -extern void up_puthex(uint8_t hex) __naked; -extern void up_puthex16(int hex) __naked; -extern void up_putnl(void) __naked; -extern void up_puts(__code char *ptr); +#if defined(CONFIG_ARCH_8051_BRINGUP) +void up_puthex(uint8_t hex) __naked; +void up_puthex16(int hex) __naked; +void up_putnl(void) __naked; +void up_puts(__code char *ptr); +void up_showsp(uint8_t ch) __naked; #endif -#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP) -extern void up_dumpstack(void); -extern void up_dumpframe(FAR struct xcptcontext *context); +#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_8051_BRINGUP) +void up_dumpstack(void); +void up_dumpframe(FAR struct xcptcontext *context); #else # define up_dumpstack() # define up_dumpframe(x) @@ -139,9 +140,9 @@ extern void up_dumpframe(FAR struct xcptcontext *context); /* Defined in board/up_leds.c */ #ifdef CONFIG_ARCH_LEDS -extern void board_led_initialize(void); -extern void board_led_on(uint8_t led); -extern void board_led_off(uint8_t led); +void board_led_initialize(void); +void board_led_on(uint8_t led); +void board_led_off(uint8_t led); #else # define board_led_initialize() # define board_led_on(led) @@ -149,4 +150,4 @@ extern void board_led_off(uint8_t led); #endif #endif /* __ASSEMBLY */ -#endif /* __ARCH_UP_INTERNAL_H */ +#endif /* __ARCH_8051_SRC_UP_INTERNAL_H */ diff --git a/arch/8051/src/up_irq.c b/arch/8051/src/up_irq.c index dee3120c8b8..85b30aeaf77 100644 --- a/arch/8051/src/up_irq.c +++ b/arch/8051/src/up_irq.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_irq.c + * arch/8051/src/up_irq.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -78,7 +78,7 @@ void up_irqinitialize(void) IP = 0; -#ifdef CONFIG_SUPPRESS_INTERRUPTS +#ifdef CONFIG_ARCH_8051_SUPRESS_INTERRUPTS /* Disable all interrupts */ IE = 0; diff --git a/arch/8051/src/up_irqtest.c b/arch/8051/src/up_irqtest.c index a5a37492c2e..ec3ee487dcc 100644 --- a/arch/8051/src/up_irqtest.c +++ b/arch/8051/src/up_irqtest.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_irqtest.c + * arch/8051/src/up_irqtest.c * - * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -160,13 +160,12 @@ void os_start(void) IE = 0; - /* Then verify all of the interrupt */ + /* Then verify all of the interrupts */ g_irqtest = false; up_extint0(); - up_timer0(); -#ifndef CONFIG_8052_TIMER2 +#ifdef CONFIG_ARCH_8051_NOSYSTIMER up_timer0(); #endif up_extint1(); diff --git a/arch/8051/src/up_timerisr.c b/arch/8051/src/up_timerisr.c index e31c5e13fd2..60cde0bb64f 100644 --- a/arch/8051/src/up_timerisr.c +++ b/arch/8051/src/up_timerisr.c @@ -1,7 +1,7 @@ /************************************************************************ - * up_timerisr.c + * arch/8051/src/up_timerisr.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ int up_timerisr(int irq, FAR uint8_t *frame) void up_timerinit(void) { -#ifdef CONFIG_8052_TIMER2 +#ifdef CONFIG_ARCH_8051_NOSYSTIMER up_disable_irq(TIMER2_IRQ); /* Set up timer 2 -- See pjrc.h for details */ diff --git a/arch/Kconfig b/arch/Kconfig index 54acc2aa73d..f84817f9408 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -11,7 +11,7 @@ config ARCH_8051 bool "8051" select CUSTOM_STACK ---help--- - Intel 8051 architectures and derivaties + Intel 8051 architectures and derivatives config ARCH_ARM bool "ARM"