Squashed commit of the following:

nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_mmuinit should be called z80_mmu_initialize.

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_loweserialinit should be called z80_lowserial_initialize.

    configs/z80sim/src/z80_serial.c:  Remove unused function up_earlyserialinit()

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_serialinit should be called z80_serial_initialize.

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_doirq should be called z80_doirq.

    arch/z80/src/common:  up_addregion() must be prototyped in nuttx/mm/mm.h, not up_internal.h
This commit is contained in:
Gregory Nutt 2019-06-08 22:01:53 -06:00
parent d39ac6c3a1
commit 0148124e33
32 changed files with 65 additions and 126 deletions

View File

@ -45,6 +45,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mm/mm.h>
#include "up_arch.h"
#include "up_internal.h"

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/z80/src/common/up_doirq.c
* arch/z80/src/common/z80_doirq.c
*
* Copyright (C) 2007-2009, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -58,7 +58,7 @@
* Public Functions
****************************************************************************/
FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs)
FAR chipreg_t *z80_doirq(uint8_t irq, FAR chipreg_t *regs)
{
board_autoled_on(LED_INIRQ);

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/sched_note.h>
#include <nuttx/mm/mm.h>
#include <nuttx/mm/iob.h>
#include <nuttx/drivers/drivers.h>
#include <nuttx/fs/loop.h>
@ -126,7 +127,7 @@ void up_initialize(void)
*/
#ifdef CONFIG_ARCH_ADDRENV
(void)up_mmuinit();
(void)z80_mmu_initialize();
#endif
#ifdef CONFIG_MM_IOB
@ -165,7 +166,7 @@ void up_initialize(void)
/* Initialize the serial device driver */
#ifdef USE_SERIALDRIVER
up_serialinit();
z80_serial_initialize();
#endif
/* Initialize the console device driver (if it is other than the standard

View File

@ -95,15 +95,7 @@
#endif
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/
#ifndef __ASSEMBLY__
@ -121,35 +113,29 @@ void z80_rtc_irqinitialize(void);
#endif
#ifdef USE_LOWSERIALINIT
void up_lowserialinit(void);
void z80_lowserial_initialize(void);
#endif
/* Defined in up_doirq.c */
/* Defined in xyz_doirq.c */
FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs);
FAR chipreg_t *z80_doirq(uint8_t irq, FAR chipreg_t *regs);
/* Define in zyz_sigdeliver */
void up_sigdeliver(void);
void z80_sigdeliver(void);
#ifdef CONFIG_ARCH_ADDRENV
/* Defined in CPU-specific logic (only for Z180) */
int up_mmuinit(void);
#endif
/* Defined in xyz_allocateheap.c */
#if CONFIG_MM_REGIONS > 1
void up_addregion(void);
int z80_mmu_initialize(void);
#endif
/* Defined in xyz_serial.c */
#ifdef USE_SERIALDRIVER
void up_serialinit(void);
void z80_serial_initialize(void);
#else
# define up_serialinit()
# define z80_serial_initialize()
#endif
/* Defined in drivers/lowconsole.c */

View File

@ -176,10 +176,10 @@ static void ez80_setbaud(void)
****************************************************************************/
/****************************************************************************
* Name: up_lowserialinit
* Name: z80_lowserial_initialize
****************************************************************************/
void up_lowserialinit(void)
void z80_lowserial_initialize(void)
{
#ifdef HAVE_SERIAL
uint8_t regval;

View File

@ -69,42 +69,6 @@
# error "CONFIG_RTC_DATETIME must be set to use this driver"
#endif
#ifdef CONFIG_RTC_HIRES
# error "CONFIG_RTC_HIRES must NOT be set with this driver"
#endif
/* Constants ****************************************************************/
#define SYNCHRO_TIMEOUT (0x00020000)
#define INITMODE_TIMEOUT (0x00010000)
/* Proxy definitions to make the same code work for all the EZ80 series ****/
# define EZ80_RCC_XXX EZ80_RCC_BDCR
# define RCC_XXX_YYYRST RCC_BDCR_BDRST
# define RCC_XXX_RTCEN RCC_BDCR_RTCEN
# define RCC_XXX_RTCSEL_MASK RCC_BDCR_RTCSEL_MASK
# define RCC_XXX_RTCSEL_LSE RCC_BDCR_RTCSEL_LSE
# define RCC_XXX_RTCSEL_LSI RCC_BDCR_RTCSEL_LSI
# define RCC_XXX_RTCSEL_HSE RCC_BDCR_RTCSEL_HSE
/* Time conversions */
#define MINUTES_IN_HOUR 60
#define HOURS_IN_DAY 24
#define hours_add(parm_hrs) \
time->tm_hour += parm_hrs;\
if ((HOURS_IN_DAY-1) < (time->tm_hour))\
{\
time->tm_hour = (parm_hrs - HOURS_IN_DAY);\
}
#define RTC_ALRMR_DIS_MASK (RTC_ALRMR_MSK4 | RTC_ALRMR_MSK3 | \
RTC_ALRMR_MSK2 | RTC_ALRMR_MSK1)
#define RTC_ALRMR_DIS_DATE_MASK (RTC_ALRMR_MSK4)
#define RTC_ALRMR_ENABLE (0)
/****************************************************************************
* Private Types
*****************************************************************************/
@ -783,6 +747,7 @@ int ez80_rtc_cancelalarm(void)
#ifdef CONFIG_RTC_ALARM
int ez80_rtc_rdalarm(FAR struct rtc_time *almtime)
{
struct rtc_almregs_s almregs;
int ret = -EINVAL;

View File

@ -97,11 +97,11 @@ struct alm_setalarm_s
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
# define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
# define EXTERN extern
#endif
/****************************************************************************
@ -205,4 +205,5 @@ int ez80_rtc_rdalarm(FAR struct rtc_time *almtime);
int ez80_rtc_cancelalarm(void);
#endif /* CONFIG_RTC_ALARM */
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_EZ80_SRC_EZ80_RTC_H */

View File

@ -70,7 +70,7 @@ static void ez80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR c
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_PC] = (chipreg_t)z80_sigdeliver;
regs[XCPT_I] = 0;
}

View File

@ -652,14 +652,14 @@ static bool ez80_txempty(struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
* Name: up_serialinit
* Name: z80_serial_initialize
*
* Description:
* Register serial console and serial ports.
*
****************************************************************************/
void up_serialinit(void)
void z80_serial_initialize(void)
{
uint8_t regval;

View File

@ -59,7 +59,7 @@
****************************************************************************/
/****************************************************************************
* Name: up_sigdeliver
* Name: z80_sigdeliver
*
* Description:
* This is the a signal handling trampoline. When a signal action was
@ -68,7 +68,7 @@
*
****************************************************************************/
void up_sigdeliver(void)
void z80_sigdeliver(void)
{
FAR struct tcb_s *rtcb = this_task();
chipreg_t regs[XCPTCONTEXT_REGS];

View File

@ -57,7 +57,7 @@ EZ80_UNUSED EQU 40h
;**************************************************************************
xref _ez80_startup
xref _up_doirq
xref _z80_doirq
;**************************************************************************
; Global Symbols Exported
@ -241,7 +241,7 @@ _ez80_rstcommon:
ld bc, #0 ; BC = reset number
ld c, a ; Save the reset number in C
push bc ; Argument #1 is the Reset number
call _up_doirq ; Decode the IRQ
call _z80_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the

View File

@ -63,7 +63,7 @@
****************************************************************************/
/****************************************************************************
* Name: up_lowserialinit
* Name: z80_lowserial_initialize
*
* Description:
* Called early in the boot sequence to initialize the serial ports
@ -71,7 +71,7 @@
****************************************************************************/
#ifdef USE_LOWSERIALINIT
void up_lowserialinit(void)
void z80_lowserial_initialize(void)
{
/* Initialize UART and [E]SCC serial devices */

View File

@ -126,7 +126,7 @@ static inline FAR struct z180_cbr_s *z180_mmu_alloccbr(void)
* called very early in the boot process to get the basic operating
* memory configuration correct. This function does *not* perform all
* necessray MMU initialization... only the basics needed at power-up.
* up_mmuinit() must be called later to complete the entire MMU
* z80_mmu_initialize() must be called later to complete the entire MMU
* initialization.
*
****************************************************************************/
@ -151,7 +151,7 @@ void z180_mmu_lowinit(void) __naked
}
/****************************************************************************
* Name: up_mmuinit
* Name: z80_mmu_initialize
*
* Description:
* Perform higher level initialization of the MMU and physical memory
@ -159,7 +159,7 @@ void z180_mmu_lowinit(void) __naked
*
****************************************************************************/
int up_mmuinit(void)
int z80_mmu_initialize(void)
{
/* Here we use the granule allocator as a page allocator. We lie and
* say that 1 page is 1 byte.

View File

@ -126,7 +126,7 @@
* called very early in the boot process to get the basic operating
* memory configuration correct. This function does *not* perform all
* necessray MMU initialization... only the basics needed at power-up.
* up_mmuinit() must be called later to complete the entire MMU
* z80_mmu_initialize() must be called later to complete the entire MMU
* initialization.
*
****************************************************************************/
@ -134,7 +134,7 @@
void z180_mmu_lowinit(void) __naked;
/****************************************************************************
* Name: up_mmuinit
* Name: z80_mmu_initialize
*
* Description:
* Perform higher level initialization of the MMU and physical memory
@ -142,6 +142,6 @@ void z180_mmu_lowinit(void) __naked;
*
****************************************************************************/
int up_mmuinit(void);
int z80_mmu_initialize(void);
#endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */

View File

@ -565,14 +565,14 @@ static bool z180_txempty(struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
* Name: up_serialinit
* Name: z80_serial_initialize
*
* Description:
* Register serial console and serial ports.
*
****************************************************************************/
void up_serialinit(void)
void z80_serial_initialize(void)
{
/* Make sure that all UART interrupts are disabled */
#warning "Missing logic"

View File

@ -74,7 +74,7 @@ static void z180_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver,
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_PC] = (chipreg_t)z80_sigdeliver;
regs[XCPT_I] = 0;
}

View File

@ -55,7 +55,7 @@
****************************************************************************/
/****************************************************************************
* Name: up_sigdeliver
* Name: z80_sigdeliver
*
* Description:
* This is the a signal handling trampoline. When a signal action was
@ -64,7 +64,7 @@
*
****************************************************************************/
void up_sigdeliver(void)
void z80_sigdeliver(void)
{
FAR struct tcb_s *rtcb = this_task();
chipreg_t regs[XCPTCONTEXT_REGS];

View File

@ -56,7 +56,7 @@
; Global symbols used
;**************************************************************************
.globl _up_doirq ; Interrupt decoding logic
.globl _z80_doirq ; Interrupt decoding logic
;**************************************************************************
; Vector Handlers
@ -178,7 +178,7 @@ _up_vectcommon::
push hl ; Place argument #2 at the top of stack
push bc ; Argument #1 is the Reset number
inc sp ; (make byte sized)
call _up_doirq ; Decode the IRQ
call _z80_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the

View File

@ -68,7 +68,7 @@
* value[0] = RP (MS byte) and Flags (LS) byte
* value[1] = PC
*
* The pointer to the save structure is a stack pointer at the time that up_doirq()
* The pointer to the save structure is a stack pointer at the time that z80_doirq()
* was called:
*
* PC[7:0]

View File

@ -71,7 +71,7 @@
xref _board_autoled_initialize:ROM
#endif
xref _nx_start:ROM
xref _up_doirq:ROM
xref _z80_doirq:ROM
xref _low_nearbss
xref _len_nearbss
xref _low_farbss

View File

@ -70,10 +70,10 @@ extern uint32_t get_freq(void);
****************************************************************************/
/****************************************************************************
* Name: up_lowserialinit
* Name: z80_lowserial_initialize
****************************************************************************/
void up_lowserialinit(void)
void z80_lowserial_initialize(void)
{
#if defined(CONFIG_UART0_SERIAL_CONSOLE) || \
(defined(EZ8_UART1) && defined(CONFIG_UART1_SERIAL_CONSOLE))

View File

@ -102,7 +102,7 @@ void z8_registerdump(void)
/* Dump the saved machine state:
* The g_z8irqstate.regs pointer is the value of the stack pointer at
* the time that up_doirq() was called. Therefore, we can calculate
* the time that z80_doirq() was called. Therefore, we can calculate
* the correct value for the stack pointer on return from interrupt:
*/

View File

@ -109,7 +109,7 @@ void z8_saveirqcontext(FAR chipreg_t *regs)
regs[XCPT_IRQCTL] = 0x0080; /* IRQE bit will enable interrupts */
/* The g_z8irqstate.regs pointer is the value of the stack pointer at
* the time that up_doirq() was called. Therefore, we can calculate
* the time that z80_doirq() was called. Therefore, we can calculate
* the correct value for the stack pointer on return from interrupt:
*/

View File

@ -71,7 +71,7 @@ static void z8_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver,
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_PC] = (chipreg_t)z80_sigdeliver;
regs[XCPT_IRQCTL] = 0;
}

View File

@ -701,14 +701,14 @@ static bool z8_txempty(FAR struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
* Name: up_serialinit
* Name: z80_serial_initialize
*
* Description:
* Register serial console and serial ports.
*
****************************************************************************/
void up_serialinit(void)
void z80_serial_initialize(void)
{
/* Disable all UART interrupts */

View File

@ -75,7 +75,7 @@ static void z8_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src)
****************************************************************************/
/****************************************************************************
* Name: up_sigdeliver
* Name: z80_sigdeliver
*
* Description:
* This is the a signal handling trampoline. When a signal action was
@ -84,7 +84,7 @@ static void z8_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src)
*
****************************************************************************/
void up_sigdeliver(void)
void z80_sigdeliver(void)
{
FAR struct tcb_s *rtcb = this_task();
chipreg_t regs[XCPTCONTEXT_REGS];

View File

@ -52,7 +52,7 @@
* External References / External Definitions
**************************************************************************/
xref _up_doirq:ROM
xref _z80_doirq:ROM
#if defined(ENCORE_VECTORS)
xdef _z8_wdt_handler
@ -758,7 +758,7 @@ _z8_common_handler:
/* Process the interrupt */
call _up_doirq /* Call the IRQ handler */
call _z80_doirq /* Call the IRQ handler */
/* Release arguments from the stack */

View File

@ -61,7 +61,7 @@
;**************************************************************************
.globl _nx_start ; OS entry point
.globl _up_doirq ; Interrupt decoding logic
.globl _z80_doirq ; Interrupt decoding logic
;**************************************************************************
; Reset entry point
@ -216,7 +216,7 @@ _up_rstcommon::
push hl ; Place argument #2 at the top of stack
push bc ; Argument #1 is the Reset number
inc sp ; (make byte sized)
call _up_doirq ; Decode the IRQ
call _z80_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the

View File

@ -61,7 +61,7 @@
;**************************************************************************
.globl _nx_start ; OS entry point
.globl _up_doirq ; Interrupt decoding logic
.globl _z80_doirq ; Interrupt decoding logic
;**************************************************************************
; System start logic
@ -209,7 +209,7 @@ _up_rstcommon:
push hl ; Place argument #2 at the top of stack
push bc ; Argument #1 is the Reset number
inc sp ; (make byte sized)
call _up_doirq ; Decode the IRQ
call _z80_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the

View File

@ -72,7 +72,7 @@ static void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver,
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_PC] = (chipreg_t)z80_sigdeliver;
regs[XCPT_I] = 0;
}

View File

@ -56,7 +56,7 @@
****************************************************************************/
/****************************************************************************
* Name: up_sigdeliver
* Name: z80_sigdeliver
*
* Description:
* This is the a signal handling trampoline. When a signal action was
@ -65,7 +65,7 @@
*
****************************************************************************/
void up_sigdeliver(void)
void z80_sigdeliver(void)
{
FAR struct tcb_s *rtcb = this_task();
chipreg_t regs[XCPTCONTEXT_REGS];

View File

@ -309,29 +309,14 @@ static bool up_txempty(FAR struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
* Name: up_serialinit
* Name: z80_serial_initialize
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
* during bootup. This must be called before up_serialinit.
* Register serial console and serial ports.
*
****************************************************************************/
void up_earlyserialinit(void)
{
}
/****************************************************************************
* Name: up_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that up_earlyserialinit was called previously.
*
****************************************************************************/
void up_serialinit(void)
void z80_serial_initialize(void)
{
(void)uart_register("/dev/console", &g_uartport);
(void)uart_register("/dev/ttyS0", &g_uartport);