configs/: Rename ZDS-II start files from xxx_lowinit.c to xxx_boot.c; rename board initialization logic from xxx_lowinit() to xxx_board_initialize(). These changes make the ZDS-II configurations more similar to board initialization conventions to used for other architectures.

This commit is contained in:
Gregory Nutt 2019-06-05 10:14:58 -06:00
parent 2c1e905aa6
commit fbb6f6cde0
18 changed files with 162 additions and 160 deletions

View File

@ -652,12 +652,13 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/* The following two routines are called from the low-level reset logic. z16f_lowinit() /* The following two routines are called from the low-level reset logic.
* must be provided by the board-specific logic; z16f_lowuartinit() is called only if * z16f_board_initialize() must be provided by the board-specific logic;
* debugging support for up_lowputc (or getc) is enabled. * z16f_lowuartinit() is called only if debugging support for up_lowputc (or getc)
* is enabled.
*/ */
void z16f_lowinit(void); void z16f_board_initialize(void);
#if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC) #if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC)
void z16f_lowuartinit(void); void z16f_lowuartinit(void);
#endif #endif

View File

@ -52,7 +52,7 @@
**************************************************************************/ **************************************************************************/
xref _z16f_clkinit:EROM xref _z16f_clkinit:EROM
xref _z16f_lowinit:EROM xref _z16f_board_initialize:EROM
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
xref _board_autoled_initialize:EROM xref _board_autoled_initialize:EROM
#endif #endif
@ -84,43 +84,43 @@
* Flash Option Byte Setup * Flash Option Byte Setup
**************************************************************************/ **************************************************************************/
define FOPTIONSEG, SPACE=ROM, ORG=0 define FOPTIONSEG, SPACE=ROM, ORG=0
segment FOPTIONSEG segment FOPTIONSEG
db BOARD_FLOPTION0 db BOARD_FLOPTION0
db BOARD_FLOPTION1 db BOARD_FLOPTION1
db BOARD_FLOPTION2 db BOARD_FLOPTION2
db BOARD_FLOPTION3 db BOARD_FLOPTION3
/************************************************************************** /**************************************************************************
* vectors * vectors
**************************************************************************/ **************************************************************************/
vector RESET=_z16f_reset vector RESET=_z16f_reset
vector SYSEXC=_sysexc_isr vector SYSEXC=_sysexc_isr
vector TIMER2=_timer2_isr vector TIMER2=_timer2_isr
vector TIMER1=_timer1_isr vector TIMER1=_timer1_isr
vector TIMER0=_timer0_isr vector TIMER0=_timer0_isr
vector UART0_RX=_uart0rx_isr vector UART0_RX=_uart0rx_isr
vector UART0_TX=_uart0tx_isr vector UART0_TX=_uart0tx_isr
vector I2C=_i2c_isr vector I2C=_i2c_isr
vector SPI=_spi_isr vector SPI=_spi_isr
vector ADC=_adc_isr vector ADC=_adc_isr
vector P7AD=_p7ad_isr vector P7AD=_p7ad_isr
vector P6AD=_p6ad_isr vector P6AD=_p6ad_isr
vector P5AD=_p5ad_isr vector P5AD=_p5ad_isr
vector P4AD=_p4ad_isr vector P4AD=_p4ad_isr
vector P3AD=_p3ad_isr vector P3AD=_p3ad_isr
vector P2AD=_p2ad_isr vector P2AD=_p2ad_isr
vector P1AD=_p1ad_isr vector P1AD=_p1ad_isr
vector P0AD=_p0ad_isr vector P0AD=_p0ad_isr
vector PWM_TIMER=_pwmtimer_isr vector PWM_TIMER=_pwmtimer_isr
vector UART1_RX=_uart1rx_isr vector UART1_RX=_uart1rx_isr
vector UART1_TX=_uart1tx_isr vector UART1_TX=_uart1tx_isr
vector PWM_FAULT=_pwmfault_isr vector PWM_FAULT=_pwmfault_isr
vector C3=_c3_isr vector C3=_c3_isr
vector C2=_c3_isr vector C2=_c3_isr
vector C1=_c2_isr vector C1=_c2_isr
vector C0=_c0_isr vector C0=_c0_isr
/************************************************************************** /**************************************************************************
* Equates * Equates
@ -134,8 +134,8 @@
* Code * Code
**************************************************************************/ **************************************************************************/
define CODESEG, SPACE=EROM define CODESEG, SPACE=EROM
segment CODESEG segment CODESEG
/************************************************************************** /**************************************************************************
* Name: _z16f_reset * Name: _z16f_reset
@ -213,7 +213,7 @@ _z16f_reset8:
/* Perform low-level hardware initialization */ /* Perform low-level hardware initialization */
call _z16f_lowinit /* Perform low-level hardware initialization */ call _z16f_board_initialize /* Perform low-level hardware initialization */
#ifdef USE_EARLYSERIALINIT #ifdef USE_EARLYSERIALINIT
/* Perform early serial initialization */ /* Perform early serial initialization */

View File

@ -704,7 +704,7 @@ void up_earlyserialinit(void)
uint8_t regval; uint8_t regval;
/* Configure UART alternate pin functions. This may duplicate logic in /* Configure UART alternate pin functions. This may duplicate logic in
* z16f_lowuartinit() or z16f_lowinit(). * z16f_lowuartinit() or z16f_board_initialize().
*/ */
#ifdef CONFIG_Z16F_UART0 #ifdef CONFIG_Z16F_UART0

View File

@ -49,13 +49,13 @@
xref _ez80_init xref _ez80_init
xref _ez80_initvectors xref _ez80_initvectors
xref _ez80_initsysclk xref _ez80_initsysclk
xref _ez80_lowinit xref _ez80_board_initialize
xref __low_bss ; Low address of bss segment xref __low_bss ; Low address of bss segment
xref __len_bss ; Length of bss segment xref __len_bss ; Length of bss segment
xref __low_data ; Address of initialized data section xref __low_data ; Address of initialized data section
xref __low_romdata ; Addr of initialized data section in ROM xref __low_romdata ; Addr of initialized data section in ROM
xref __len_data ; Length of initialized data section xref __len_data ; Length of initialized data section
xref __copy_code_to_ram xref __copy_code_to_ram
xref __len_code xref __len_code
@ -80,7 +80,7 @@ _ez80_startup:
; Set up the stack pointer at the location determined the lincmd ; Set up the stack pointer at the location determined the lincmd
; file ; file
ld sp, __stack ld sp, __stack
; Peform chip-specific initialization ; Peform chip-specific initialization
@ -97,59 +97,60 @@ _ez80_startup:
; Perform C initializations ; Perform C initializations
; Clear the uninitialized data section ; Clear the uninitialized data section
ld bc, __len_bss ; Check for non-zero length ld bc, __len_bss ; Check for non-zero length
ld a, __len_bss >> 16 ld a, __len_bss >> 16
or a, c or a, c
or a, b or a, b
jr z, _ez80_bssdone ; BSS is zero-length ... jr z, _ez80_bssdone ; BSS is zero-length ...
xor a, a xor a, a
ld (__low_bss), a ld (__low_bss), a
sbc hl, hl ; hl = 0 sbc hl, hl ; hl = 0
dec bc ; 1st byte's taken care of dec bc ; 1st byte's taken care of
sbc hl, bc sbc hl, bc
jr z, _ez80_bssdone ; Just 1 byte ... jr z, _ez80_bssdone ; Just 1 byte ...
ld hl, __low_bss ; reset hl ld hl, __low_bss ; reset hl
ld de, __low_bss + 1 ; [de] = bss + 1 ld de, __low_bss + 1 ; [de] = bss + 1
ldir ldir
_ez80_bssdone: _ez80_bssdone:
; Copy the initialized data section ; Copy the initialized data section
ld bc, __len_data ; [bc] = data length
ld a, __len_data >> 16 ; Check for non-zero length ld bc, __len_data ; [bc] = data length
or a, c ld a, __len_data >> 16 ; Check for non-zero length
or a, b or a, c
jr z, _ez80_datadone ; __len_data is zero-length ... or a, b
ld hl, __low_romdata ; [hl] = data_copy jr z, _ez80_datadone ; __len_data is zero-length ...
ld de, __low_data ; [de] = data ld hl, __low_romdata ; [hl] = data_copy
ld de, __low_data ; [de] = data
ldir ; Copy the data section ldir ; Copy the data section
_ez80_datadone: _ez80_datadone:
; Copy CODE (which may be in FLASH) to RAM if the ; Copy CODE (which may be in FLASH) to RAM if the
; copy_code_to_ram symbol is set in the link control file ; copy_code_to_ram symbol is set in the link control file
ld a, __copy_code_to_ram
or a, a ld a, __copy_code_to_ram
jr z, _ez80_codedone or a, a
ld bc, __len_code ; [bc] = code length jr z, _ez80_codedone
ld a, __len_code >> 16 ; Check for non-zero length ld bc, __len_code ; [bc] = code length
or a, c ld a, __len_code >> 16 ; Check for non-zero length
or a, b or a, c
jr z, _ez80_codedone ; __len_code is zero-length or a, b
ld hl, __low_romcode ; [hl] = code_copy jr z, _ez80_codedone ; __len_code is zero-length
ld de, __low_code ; [de] = code ld hl, __low_romcode ; [hl] = code_copy
ldir ; Copy the code section ld de, __low_code ; [de] = code
ldir ; Copy the code section
_ez80_codedone: _ez80_codedone:
; Perform board-specific initializeation ; Perform board-specific initialization
call _ez80_lowinit call _ez80_board_initialize
; Then start NuttX ; Then start NuttX
call _nx_start ; jump to the OS entry point call _nx_start ; jump to the OS entry point
; NuttX will never return, but just in case... ; NuttX will never return, but just in case...
_ez80_halt: _ez80_halt:
halt ; We should never get here halt ; We should never get here
jp _ez80_halt jp _ez80_halt

View File

@ -66,7 +66,7 @@
**************************************************************************/ **************************************************************************/
xref _z16f_clkinit:ROM xref _z16f_clkinit:ROM
xref _z16f_lowinit:ROM xref _z16f_board_initialize:ROM
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
xref _board_autoled_initialize:ROM xref _board_autoled_initialize:ROM
#endif #endif
@ -118,119 +118,119 @@
_z8_reset: _z8_reset:
/* Set the register pointer for working registers e0-ef */ /* Set the register pointer for working registers e0-ef */
srp #%e0 srp #%e0
/* Initialize the stack pointer */ /* Initialize the stack pointer */
ldx spl, #low(_far_stacktop+1) ldx spl, #low(_far_stacktop+1)
ldx sph, #high(_far_stacktop+1) ldx sph, #high(_far_stacktop+1)
/* Clear internal register ram area (c_nearbss) */ /* Clear internal register ram area (c_nearbss) */
ld r0, #_low_nearbss ld r0, #_low_nearbss
ld r2, #_len_nearbss ld r2, #_len_nearbss
cp r2, #0 cp r2, #0
jr z, _z8_reset2 jr z, _z8_reset2
_z8_reset1: _z8_reset1:
clr @r0 clr @r0
inc r0 inc r0
djnz r2, _z8_reset1 djnz r2, _z8_reset1
/* Clear extended ram area (c_farbss) */ /* Clear extended ram area (c_farbss) */
_z8_reset2: _z8_reset2:
ld r2, #high(_low_farbss) ld r2, #high(_low_farbss)
ld r3, #low(_low_farbss) ld r3, #low(_low_farbss)
ld r0, #high(_len_farbss) ld r0, #high(_len_farbss)
ld r1, #low(_len_farbss) ld r1, #low(_len_farbss)
ld r4, r0 ld r4, r0
or r4, r1 or r4, r1
jr z, _z8_reset4 jr z, _z8_reset4
clr r4 clr r4
_z8_reset3: _z8_reset3:
ldx @rr2,r4 ldx @rr2,r4
incw rr2 incw rr2
decw rr0 decw rr0
jr nz, _z8_reset3 jr nz, _z8_reset3
/* Copy ROM data into internal RAM */ /* Copy ROM data into internal RAM */
_z8_reset4: _z8_reset4:
#ifdef CONFIG_Z8_COPYNEARDATA #ifdef CONFIG_Z8_COPYNEARDATA
ld r0, #high(_low_near_romdata) ld r0, #high(_low_near_romdata)
ld r1, #low(_low_near_romdata) ld r1, #low(_low_near_romdata)
ld r3, #_len_neardata ld r3, #_len_neardata
ld r4, #_low_neardata ld r4, #_low_neardata
cp r3, #0 cp r3, #0
jr z, _z8_reset6 jr z, _z8_reset6
_z8_reset5: _z8_reset5:
ldci @r4, @rr0 ldci @r4, @rr0
djnz r3, _z8_reset5 djnz r3, _z8_reset5
_z8_reset6: _z8_reset6:
#endif #endif
/* Copy ROM data into extended RAM */ /* Copy ROM data into extended RAM */
ld r0, #high(_low_fardata) ld r0, #high(_low_fardata)
ld r1, #low(_low_fardata) ld r1, #low(_low_fardata)
ld r2, #high(_low_far_romdata) ld r2, #high(_low_far_romdata)
ld r3, #low(_low_far_romdata) ld r3, #low(_low_far_romdata)
ld r4, #high(_len_fardata) ld r4, #high(_len_fardata)
ld r5, #low(_len_fardata) ld r5, #low(_len_fardata)
ld r6, r4 ld r6, r4
or r6, r5 or r6, r5
jr z, _z8_reset8 jr z, _z8_reset8
_z8_reset7: _z8_reset7:
ldc r6, @rr2 ldc r6, @rr2
ldx @rr0, r6 ldx @rr0, r6
incw rr0 incw rr0
incw rr2 incw rr2
decw rr4 decw rr4
jr nz, _z8_reset7 jr nz, _z8_reset7
/* Copy ROM copy of code into Program RAM */ /* Copy ROM copy of code into Program RAM */
_z8_reset8: _z8_reset8:
#ifdef CONFIG_Z8_COPYPRAM #ifdef CONFIG_Z8_COPYPRAM
ld r0, #high(_low_pramseg) ld r0, #high(_low_pramseg)
ld r1, #low(_low_pramseg) ld r1, #low(_low_pramseg)
ld r2, #high(_low_pram_romdata) ld r2, #high(_low_pram_romdata)
ld r3, #low(_low_pram_romdata) ld r3, #low(_low_pram_romdata)
ld r4, #high(_len_pramseg) ld r4, #high(_len_pramseg)
ld r5, #low(_len_pramseg) ld r5, #low(_len_pramseg)
ld r6, r4 ld r6, r4
or r6, r5 or r6, r5
jr z, _z8_reset10 jr z, _z8_reset10
_z8_reset9: _z8_reset9:
ldc r6, @rr2 ldc r6, @rr2
ldc @rr0, r6 ldc @rr0, r6
incw rr0 incw rr0
incw rr2 incw rr2
decw rr4 decw rr4
jr nz, _z8_reset9 jr nz, _z8_reset9
_z8_reset10: _z8_reset10:
#endif #endif
/* Start NuttX */ /* Start NuttX */
ldx __intrp,#0 ldx __intrp,#0
xor r15, r15 xor r15, r15
xor r14, r14 xor r14, r14
call _nx_start call _nx_start
/* We should never get here */ /* We should never get here */
_z8_reset_halt: _z8_reset_halt:
jr _z8_reset_halt jr _z8_reset_halt
/************************************************************************** /**************************************************************************
* Data * Data

View File

@ -36,6 +36,6 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = ez80_lowinit.c ez80_leds.c CSRCS = ez80_boot.c ez80_leds.c
include $(TOPDIR)/configs/Board.mk include $(TOPDIR)/configs/Board.mk

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/ez80f910200zco/src/ez80_lowinit.c * configs/ez80f910200kitg/src/ez80_boot.c
* *
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -59,7 +59,7 @@ static void ez80_gpioinit(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void ez80_lowinit(void) void ez80_board_initialize(void)
{ {
ez80_gpioinit(); ez80_gpioinit();
} }

View File

@ -36,7 +36,7 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = ez80_lowinit.c CSRCS = ez80_boot.c
ifeq ($(CONFIG_ARCH_LEDS),y) ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += ez80_leds.c CSRCS += ez80_leds.c
endif endif

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/ez80f910200kitg/src/ez80_lowinit.c * configs/ez80f910200zco/src/ez80_boot.c
* *
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -59,7 +59,7 @@ static void ez80_gpioinit(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void ez80_lowinit(void) void ez80_board_initialize(void)
{ {
ez80_gpioinit(); ez80_gpioinit();
} }

View File

@ -36,7 +36,7 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = ez80_lowinit.c ez80_bringup.c CSRCS = ez80_boot.c ez80_bringup.c
ifeq ($(CONFIG_LIB_BOARDCTL),y) ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += ez80_appinit.c CSRCS += ez80_appinit.c

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/makerlisp/src/ez80_lowinit.c * configs/makerlisp/src/ez80_boot.c
* *
* Copyright (C) 2019 Gregory Nutt. All rights reserved. * Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -122,7 +122,7 @@ static void ez80_vga_initialize(void)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: ez80_lowinit * Name: ez80_board_initialize
* *
* Description: * Description:
* All eZ80 architectures must provide the following entry point. This * All eZ80 architectures must provide the following entry point. This
@ -131,7 +131,7 @@ static void ez80_vga_initialize(void)
* *
****************************************************************************/ ****************************************************************************/
void ez80_lowinit(void) void ez80_board_initialize(void)
{ {
register uint8_t regval; register uint8_t regval;

View File

@ -36,6 +36,6 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = z16f_lowinit.c z16f_leds.c CSRCS = z16f_boot.c z16f_leds.c
include $(TOPDIR)/configs/Board.mk include $(TOPDIR)/configs/Board.mk

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/z16f2800100zcog/src/z16f_lowinit.c * configs/z16f2800100zcog/src/z16f_boot.c
* *
* Copyright (C) 2008, 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2008, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -88,7 +88,7 @@ static void z16f_gpioinit(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void z16f_lowinit(void) void z16f_board_initialize(void)
{ {
z16f_gpioinit(); z16f_gpioinit();
} }

View File

@ -75,7 +75,7 @@
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void board_autoled_initialize(void) void board_autoled_initialize(void)
{ {
/* The following is performed up_lowinit() as well */ /* The following is performed up_board_initialize() as well */
putreg8(getreg8(Z16F_GPIOA_OUT) | 0x07, Z16F_GPIOA_OUT); putreg8(getreg8(Z16F_GPIOA_OUT) | 0x07, Z16F_GPIOA_OUT);
putreg8(getreg8(Z16F_GPIOA_DD) & 0xF8, Z16F_GPIOA_DD); putreg8(getreg8(Z16F_GPIOA_DD) & 0xF8, Z16F_GPIOA_DD);

View File

@ -36,6 +36,6 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = z8_lowinit.c z8_leds.c CSRCS = z8_boot.c z8_leds.c
include $(TOPDIR)/configs/Board.mk include $(TOPDIR)/configs/Board.mk

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/z8encore000zco/src/z8_lowinit.c * configs/z8encore000zco/src/z8_boot.c
* *
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -59,7 +59,7 @@ static void z8_gpioinit(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void z8_lowinit(void) void z8_board_initialize(void)
{ {
z8_gpioinit(); z8_gpioinit();
} }

View File

@ -36,6 +36,6 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
ASRCS = ASRCS =
CSRCS = z8_lowinit.c z8_leds.c CSRCS = z8_boot.c z8_leds.c
include $(TOPDIR)/configs/Board.mk include $(TOPDIR)/configs/Board.mk

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* configs/z8f64200100kit/src/z8_lowinit.c * configs/z8f64200100kit/src/z8_boot.c
* *
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -59,7 +59,7 @@ static void z8_gpioinit(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void z8_lowinit(void) void z8_board_initialize(void)
{ {
z8_gpioinit(); z8_gpioinit();
} }