Mercurial > nand-ecoscentric
changeset 124:0ec04793409a ecos-sw-2000-09-11
Merge from eCos master repository on 2000-09-11-03:00:13-BST
line wrap: on
line diff
--- a/packages/ChangeLog +++ b/packages/ChangeLog @@ -1,3 +1,7 @@ +2000-09-06 Jesper Skov <jskov@redhat.com> + + * ecos.db: SH serial driver reorg changes. + 2000-08-29 Jonathan Larmour <jlarmour@redhat.co.uk> * ecos.db: Include CYGPKG_IO_PCI in vrc4373 target
--- a/packages/NEWS +++ b/packages/NEWS @@ -1,3 +1,5 @@ +* SH serial driver cleanup. SCIF driver added. SCI and SCIF drivers are + now separate packages. * Move logical ethernet "driver" into io/eth where the interface can be shared between multiple implementations, e.g. BSD TCP/IP and Red Boot's TCP/IP stacks.
--- a/packages/compat/posix/current/ChangeLog +++ b/packages/compat/posix/current/ChangeLog @@ -1,3 +1,11 @@ +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * include/limits.h (OPEN_MAX): Don't define here - let FS infra do + that. + (LINK_MAX): Ditto + (NAME_MAX): Ditto + (PATH_MAX): Ditto + 2000-09-04 Nick Garnett <nickg@cygnus.co.uk> * tests/pthread2.c:
--- a/packages/compat/posix/current/include/limits.h +++ b/packages/compat/posix/current/include/limits.h @@ -78,8 +78,6 @@ #define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX -#define OPEN_MAX _POSIX_OPEN_MAX - #define PAGESIZE 1 #define PTHREAD_DESTRUCTOR_ITERATIONS CYGNUM_POSIX_PTHREAD_DESTRUCTOR_ITERATIONS @@ -114,16 +112,10 @@ // From table 2-6. -#define LINK_MAX _POSIX_LINK_MAX - #define MAX_CANON _POSIX_MAX_CANON #define MAX_INPUT _POSIX_MAX_INPUT -#define NAME_MAX _POSIX_NAME_MAX - -#define PATH_MAX _POSIX_PATH_MAX - #define PIPE_BUF _POSIX_PIPE_BUF
--- a/packages/devs/eth/arm/ebsa285/current/ChangeLog +++ b/packages/devs/eth/arm/ebsa285/current/ChangeLog @@ -1,3 +1,13 @@ +2000-09-06 Hugo Tyson <hmt@cygnus.co.uk> + + * src/if_ebsa285.c (pci_init_find_82559s): Add asserts and an + unconditional check that the PCI window as configured matches the + address and size of the pci_window region from the MLT. This is + here because at present the MLT and CT cannot intercommunicate + enough. The separation of the PCI window is needed because + otherwise the malloc heap will eat all memory. [This is related + to CR 902624-CR, "MLT needs to be configuration aware"] + 2000-09-01 Hugo Tyson <hmt@cygnus.co.uk> * OVERVIEW: This is part of the change to the network stack to
--- a/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c +++ b/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c @@ -74,6 +74,9 @@ #ifdef CYGPKG_IO_PCI #include <cyg/io/pci.h> +// So we can check the validity of the PCI window against the MLTs opinion, +// and thereby what the malloc heap consumes willy-nilly: +#include CYGHWR_MEMORY_LAYOUT_H #else #error "Need PCI package here" #endif @@ -1852,6 +1855,25 @@ pci_init_find_82559s( void ) return 0; } + + CYG_ASSERT( CYGMEM_SECTION_pci_window == + (char *)CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE, + "PCI window configured does not match PCI memory section base" ); + CYG_ASSERT( CYGMEM_SECTION_pci_window_SIZE == + CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE, + "PCI window configured does not match PCI memory section size" ); + + if ( CYGMEM_SECTION_pci_window != + (char *)CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE + || + CYGMEM_SECTION_pci_window_SIZE != + CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE ) { +#ifdef DEBUG + db_printf("pci_init_find_82559s(): PCI window misconfigured\n"); +#endif + return 0; + } + // First initialize the heap in PCI window'd memory i82559_heap_size = CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE; i82559_heap_base = (cyg_uint8 *)CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE;
--- a/packages/devs/flash/arm/assabet/current/ChangeLog +++ b/packages/devs/flash/arm/assabet/current/ChangeLog @@ -1,3 +1,11 @@ +2000-09-10 Gary Thomas <gthomas@redhat.com> + + * src/flash_unlock_block.c: + * src/flash_lock_block.c: New file(s). + + * src/flash.h: + * cdl/flash_assabet.cdl: Add region locking functions. + 2000-08-29 Gary Thomas <gthomas@redhat.com> * src/assabet_flash.c: Improve error decoding.
--- a/packages/devs/flash/arm/assabet/current/cdl/flash_assabet.cdl +++ b/packages/devs/flash/arm/assabet/current/cdl/flash_assabet.cdl @@ -48,6 +48,7 @@ cdl_package CYGPKG_DEVS_FLASH_ASSABET { requires CYGPKG_HAL_ARM_SA11X0_ASSABET implements CYGHWR_IO_FLASH_DEVICE + implements CYGHWR_IO_FLASH_BLOCK_LOCKING include_dir . include_files ; # none _exported_ whatsoever @@ -78,5 +79,21 @@ cdl_package CYGPKG_DEVS_FLASH_ASSABET { $(CC) -c -o flash_query.o flash_query.s $(AR) rcs $(PREFIX)/lib/libtarget.a flash_query.o } + make -priority 1 { + flash_lock_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_lock_block.c + $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_lock_block.c + echo " .globl flash_lock_block_end" >>flash_lock_block.s + echo "flash_lock_block_end:" >>flash_lock_block.s + $(CC) -c -o flash_lock_block.o flash_lock_block.s + $(AR) rcs $(PREFIX)/lib/libtarget.a flash_lock_block.o + } + make -priority 1 { + flash_unlock_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_unlock_block.c + $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_unlock_block.c + echo " .globl flash_unlock_block_end" >>flash_unlock_block.s + echo "flash_unlock_block_end:" >>flash_unlock_block.s + $(CC) -c -o flash_unlock_block.o flash_unlock_block.s + $(AR) rcs $(PREFIX)/lib/libtarget.a flash_unlock_block.o + } }
--- a/packages/devs/flash/arm/assabet/current/src/flash.h +++ b/packages/devs/flash/arm/assabet/current/src/flash.h @@ -57,7 +57,9 @@ #define FLASH_Program 0x00100010 #define FLASH_Block_Erase 0x00200020 #define FLASH_Set_Lock 0x00600060 +#define FLASH_Set_Lock_Confirm 0x00010001 #define FLASH_Clear_Locks 0x00600060 +#define FLASH_Clear_Locks_Confirm 0x00D000D0 #define FLASH_Confirm 0x00D000D0 #define FLASH_Configure 0x00B800B8 #define FLASH_Configure_ReadyWait 0x00000000
new file mode 100644 --- /dev/null +++ b/packages/devs/flash/arm/assabet/current/src/flash_lock_block.c @@ -0,0 +1,87 @@ +//========================================================================== +// +// flash_lock_block.c +// +// Flash programming +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-09-10 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include "flash.h" + +#include <cyg/hal/hal_cache.h> + +// +// CAUTION! This code must be copied to RAM before execution. Therefore, +// it must not contain any code which might be position dependent! +// + +int +flash_lock_block(volatile unsigned long *block) +{ + volatile unsigned long *ROM; + unsigned long stat; + int timeout = 5000000; + int cache_on; + + ROM = (volatile unsigned long *)((unsigned long)block & 0xFF800000); + + HAL_DCACHE_IS_ENABLED(cache_on); + if (cache_on) { + HAL_DCACHE_SYNC(); + HAL_DCACHE_DISABLE(); + } + + // Clear any error conditions + ROM[0] = FLASH_Clear_Status; + + // Set lock bit + block[0] = FLASH_Set_Lock; + block[0] = FLASH_Set_Lock_Confirm; // Confirmation + while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { + if (--timeout == 0) break; + } + + // Restore ROM to "normal" mode + ROM[0] = FLASH_Reset; + + if (cache_on) { + HAL_DCACHE_ENABLE(); + } + + return stat; +}
--- a/packages/devs/flash/arm/assabet/current/src/flash_query.c +++ b/packages/devs/flash/arm/assabet/current/src/flash_query.c @@ -68,15 +68,6 @@ flash_query(unsigned char *data) HAL_DCACHE_DISABLE(); } -#if 0 - ROM = (volatile unsigned long *)0x50000000; - - ROM[0] = FLASH_Read_ID; - for (cnt = CNT; cnt > 0; cnt--) ; - *data++ = *ROM++; // Manufacturer code - *data++ = *ROM++; // Device identifier -#endif - ROM = (volatile unsigned long *)0x50000000; ROM[0] = FLASH_Read_Query; for (cnt = CNT; cnt > 0; cnt--) ;
new file mode 100644 --- /dev/null +++ b/packages/devs/flash/arm/assabet/current/src/flash_unlock_block.c @@ -0,0 +1,126 @@ +//========================================================================== +// +// flash_unlock_block.c +// +// Flash programming +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-09-10 +// Purpose: +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include "flash.h" + +#include <cyg/hal/hal_cache.h> + +// +// CAUTION! This code must be copied to RAM before execution. Therefore, +// it must not contain any code which might be position dependent! +// + +// +// The difficulty with this operation is that the hardware does not support +// unlocking single blocks. However, the logical layer would like this to +// be the case, so this routine emulates it. The hardware can clear all of +// the locks in the device at once. This routine will use that approach and +// then reset the regions which are known to be locked. +// + +#define MAX_FLASH_BLOCKS 128 + +int +flash_unlock_block(volatile unsigned long *block, int block_size, int blocks) +{ + volatile unsigned long *ROM, *bp; + unsigned long stat; + int timeout = 5000000; + unsigned char is_locked[MAX_FLASH_BLOCKS]; + int i, cache_on; + + HAL_DCACHE_IS_ENABLED(cache_on); + if (cache_on) { + HAL_DCACHE_SYNC(); + HAL_DCACHE_DISABLE(); + } + + ROM = (volatile unsigned long *)((unsigned long)block & 0xFF800000); + + // Clear any error conditions + ROM[0] = FLASH_Clear_Status; + + // Get current block lock state. This needs to access each block on + // the device so currently locked blocks can be re-locked. + bp = ROM; + for (i = 0; i < blocks; i++) { + *bp = FLASH_Read_Query; + if (bp == block) { + is_locked[i] = 0; + } else { + is_locked[i] = bp[2]; + } + bp += block_size / sizeof(*bp); + } + + // Clears all lock bits + block[0] = FLASH_Clear_Locks; + block[0] = FLASH_Clear_Locks_Confirm; // Confirmation + timeout = 5000000; + while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { + if (--timeout == 0) break; + } + + // Restore the lock state + bp = ROM; + for (i = 0; i < blocks; i++) { + if (is_locked[i]) { + *bp = FLASH_Set_Lock; + *bp = FLASH_Set_Lock_Confirm; // Confirmation + timeout = 5000000; + while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { + if (--timeout == 0) break; + } + } + bp += block_size / sizeof(*bp); + } + + // Restore ROM to "normal" mode + ROM[0] = FLASH_Reset; + + if (cache_on) { + HAL_DCACHE_ENABLE(); + } + + return stat; +}
--- a/packages/devs/serial/arm/aeb/current/ChangeLog +++ b/packages/devs/serial/arm/aeb/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * src/aeb_serial.h: Define baud rates for 57600 & 115200. + Note: these are untested at this time. + 2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> * src/aeb_serial.c (aeb_serial_set_config): Now use keys to make
--- a/packages/devs/serial/arm/aeb/current/src/aeb_serial.h +++ b/packages/devs/serial/arm/aeb/current/src/aeb_serial.h @@ -146,8 +146,8 @@ static unsigned short select_baud[] = { (69*3)/2, // 14400 26*3, // 19200 13*3, // 38400 - 0, // 57600 - 0, // 115200 + 26, // 57600 + 13, // 115200 0, // 230400 };
--- a/packages/devs/serial/sh/cq7708/current/ChangeLog +++ b/packages/devs/serial/sh/cq7708/current/ChangeLog @@ -1,3 +1,10 @@ +2000-09-05 Jesper Skov <jskov@redhat.com> + + * src/sh_sci_serial.c: Moved to SCI package. + * scr/sh_sci_cq7708.inl: moved... + * include/sh_sh3_cq7708_sci.inl: ... to here. + * cdl/ser_sh_cq7708.cdl: Matching changes. + 2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> * src/sh_sci_serial.c (sh_serial_set_config): Now use keys to make
--- a/packages/devs/serial/sh/cq7708/current/cdl/ser_sh_cq7708.cdl +++ b/packages/devs/serial/sh/cq7708/current/cdl/ser_sh_cq7708.cdl @@ -49,86 +49,61 @@ cdl_package CYGPKG_IO_SERIAL_SH_CQ7708 { requires CYGPKG_ERROR include_dir cyg/io - include_files ; # none _exported_ whatsoever + description " This option enables the serial device drivers for the - CQ SH3 cq7708 board." + CQ SH3 cq7708 board, based on the generic SH SCI driver." doc redirect/ecos-device-drivers.html + # FIXME: This really belongs in the SH_SCI package + cdl_interface CYGINT_IO_SERIAL_SH_SCI_REQUIRED { + display "SH SCI driver required" + } + define_proc { puts $::cdl_system_header "/***** serial driver proc output start *****/" - puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_sh_cq7708.h>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_SH_SCI_INL <cyg/io/sh_sh3_cq7708_sci.inl>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_SH_SCI_CFG <pkgconf/io_serial_sh_cq7708.h>" puts $::cdl_system_header "/***** serial driver proc output end *****/" } -cdl_component CYGPKG_IO_SERIAL_SH_CQ7708_SCI { - display "SH3 CQ7708 SCI device driver" - flavor bool - default_value 1 - description " - This option includes the serial device driver for the SCI port." - - compile -library=libextras.a sh_sci_serial.c - - cdl_option CYGDAT_IO_SERIAL_SH_CQ7708_SCI_NAME { - display "Device name for SH3 CQ7708 SCI" - flavor data - default_value {"\"/dev/ser1\""} + cdl_component CYGPKG_IO_SERIAL_SH_CQ7708_SERIAL1 { + display "SH3 CQ7708 serial 1 device driver (SCI)" + flavor bool + default_value 1 description " - This option specifies the device name for the SCI port." - } - - cdl_option CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BAUD { - display "Baud rate for the SH SCI driver" - flavor data - legal_values { 4800 9600 14400 19200 38400 57600 115200 } - default_value 38400 - description " - This option specifies the default baud rate (speed) for the - SCI port." - } + This option includes the serial device driver for the SCI + port." - cdl_option CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BUFSIZE { - display "Buffer size for the SH SCI driver" - flavor data - legal_values 0 to 8192 - default_value 128 - description " - This option specifies the size of the internal buffers used for - the SCI port." - } -} + implements CYGINT_IO_SERIAL_SH_SCI_REQUIRED - cdl_component CYGPKG_IO_SERIAL_SH_CQ7708_OPTIONS { - display "Serial device driver build options" - flavor none - description " - Package specific build options including control over - compiler flags used only in building this package, - and details of which tests are built." - - - cdl_option CYGPKG_IO_SERIAL_SH_CQ7708_CFLAGS_ADD { - display "Additional compiler flags" - flavor data - no_define - default_value { "" } + cdl_option CYGDAT_IO_SERIAL_SH_CQ7708_SERIAL1_NAME { + display "Device name for SH3 CQ7708 SCI" + flavor data + default_value {"\"/dev/ser1\""} description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are used in addition - to the set of global flags." + This option specifies the device name for the SCI port." } - cdl_option CYGPKG_IO_SERIAL_SH_CQ7708_CFLAGS_REMOVE { - display "Suppressed compiler flags" - flavor data - no_define - default_value { "" } + cdl_option CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BAUD { + display "Baud rate for the SH SCI driver" + flavor data + legal_values { 4800 9600 14400 19200 38400 57600 115200 } + default_value 38400 description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are removed from - the set of global flags if present." + This option specifies the default baud rate (speed) + for the SCI port." + } + + cdl_option CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BUFSIZE { + display "Buffer size for the SH SCI driver" + flavor data + legal_values 0 to 8192 + default_value 128 + description " + This option specifies the size of the internal buffers + used for the SCI port." } } }
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/cq7708/current/include/sh_sh3_cq7708_sci.inl @@ -0,0 +1,93 @@ +#ifndef CYGONCE_DEVS_SH_CQ7708_SCI_H +#define CYGONCE_DEVS_SH_CQ7708_SCI_H + +//========================================================================== +// +// io/serial/sh/sh_sh3_cq7708_sci.inl +// +// Serial I/O Interface Module definitions for SH3/CQ7708 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:jskov +// Date: 1999-06-16 +// Purpose: Defines SCI serial resources for SH3/CQ7708. +// Description: +// +//####DESCRIPTIONEND#### +//========================================================================== + + +#include <pkgconf/io_serial_sh_cq7708.h> + +static sh_sci_info sh_serial_info = {CYGARC_REG_SCSPTR, + CYGNUM_HAL_INTERRUPT_SCI_ERI, + CYGNUM_HAL_INTERRUPT_SCI_RXI, + CYGNUM_HAL_INTERRUPT_SCI_TXI, + SH_SERIAL_SCI_BASE}; + +#if CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BUFSIZE > 0 +static unsigned char sh_serial_out_buf[CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BUFSIZE]; +static unsigned char sh_serial_in_buf[CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BUFSIZE]; + +static SERIAL_CHANNEL_USING_INTERRUPTS(sh_serial_channel, + sh_serial_funs, + sh_serial_info, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT, + &sh_serial_out_buf[0], + sizeof(sh_serial_out_buf), + &sh_serial_in_buf[0], + sizeof(sh_serial_in_buf) + ); +#else +static SERIAL_CHANNEL(sh_serial_channel, + sh_serial_funs, + sh_serial_info, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_CQ7708_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT + ); +#endif + +DEVTAB_ENTRY(sh_serial_io, + CYGDAT_IO_SERIAL_SH_CQ7708_SERIAL1_NAME, + 0, // Does not depend on a lower level interface + &cyg_io_serial_devio, + sh_serial_init, + sh_serial_lookup, // Serial driver may need initializing + &sh_serial_channel + ); + +#endif // CYGONCE_DEVS_SH_CQ7708_SCI_H
deleted file mode 100644 --- a/packages/devs/serial/sh/cq7708/current/src/sh_sci_cq7708.inl +++ /dev/null @@ -1,98 +0,0 @@ -//========================================================================== -// -// io/serial/sh/sh_sci_cq7708.c -// -// Serial I/O Interface Module definitions for SH3/CQ7708 -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors:jskov -// Date: 1999-06-16 -// Purpose: Defines SCI serial resources for SH3/CQ7708. -// Description: -// -//####DESCRIPTIONEND#### -//========================================================================== - -// Controller bases in the SH3/CQ7708 (only one) -#define SH_SERIAL_SCI_BASE 0xfffffe80 - -// The SCI controller register layout on the SH3/CQ7708. -#define SCI_SCSMR 0 // serial mode register -#define SCI_SCBRR 2 // bit rate register -#define SCI_SCSCR 4 // serial control register -#define SCI_SCTDR 6 // transmit data register -#define SCI_SCSSR 8 // serial status register -#define SCI_SCRDR 10 // receive data register -#define SCI_SCSPTR -4 // serial port register - -static sh_sci_info sh_serial_info = {CYGARC_REG_SCSPTR, - CYGNUM_HAL_INTERRUPT_SCI_ERI, - CYGNUM_HAL_INTERRUPT_SCI_RXI, - CYGNUM_HAL_INTERRUPT_SCI_TXI, - SH_SERIAL_SCI_BASE}; - -#if CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BUFSIZE > 0 -static unsigned char sh_serial_out_buf[CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BUFSIZE]; -static unsigned char sh_serial_in_buf[CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BUFSIZE]; - -static SERIAL_CHANNEL_USING_INTERRUPTS(sh_serial_channel, - sh_serial_funs, - sh_serial_info, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT, - &sh_serial_out_buf[0], - sizeof(sh_serial_out_buf), - &sh_serial_in_buf[0], - sizeof(sh_serial_in_buf) - ); -#else -static SERIAL_CHANNEL(sh_serial_channel, - sh_serial_funs, - sh_serial_info, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_CQ7708_SCI_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT - ); -#endif - -DEVTAB_ENTRY(sh_serial_io, - CYGDAT_IO_SERIAL_SH_CQ7708_SCI_NAME, - 0, // Does not depend on a lower level interface - &cyg_io_serial_devio, - sh_serial_init, - sh_serial_lookup, // Serial driver may need initializing - &sh_serial_channel - ); -
deleted file mode 100644 --- a/packages/devs/serial/sh/cq7708/current/src/sh_sci_serial.c +++ /dev/null @@ -1,513 +0,0 @@ -//========================================================================== -// -// io/serial/sh/sh_sci_serial.c -// -// SH Serial SCI I/O Interface Module (interrupt driven) -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors:gthomas, jskov -// Date: 1999-05-24 -// Purpose: SH Serial I/O module (interrupt driven version) -// Description: -// -// Note: Since interrupt sources from the same SCI channel share the same -// interrupt level, there is no risk of races when altering the -// channel's control register from ISRs and DSRs. However, when -// altering the control register from user-level code, interrupts -// must be disabled while the register is being accessed. -// -// FIXME: Receiving in polled mode prevents duplex transfers from working for -// some reason. -//####DESCRIPTIONEND#### -//========================================================================== - -#include <pkgconf/io_serial.h> -#include <pkgconf/io.h> - -#include <cyg/io/io.h> -#include <cyg/hal/hal_intr.h> -#include <cyg/io/devtab.h> -#include <cyg/infra/diag.h> -#include <cyg/io/serial.h> - -#include <cyg/hal/sh_regs.h> - -#ifdef CYGPKG_IO_SERIAL_SH_CQ7708 -#define __CYGPKG_IO_SERIAL_SH_SCI_INL "sh_sci_cq7708.inl" -#endif - - -// Only compile driver if an inline file with driver details was selected. -#ifdef __CYGPKG_IO_SERIAL_SH_SCI_INL - -static short select_word_length[] = { - -1, - -1, - CYGARC_REG_SCSMR_CHR, // 7 bits - 0 // 8 bits -}; - -static short select_stop_bits[] = { - -1, - 0, // 1 stop bit - -1, - CYGARC_REG_SCSMR_STOP // 2 stop bits -}; - -static short select_parity[] = { - 0, // No parity - CYGARC_REG_SCSMR_PE, // Even parity - CYGARC_REG_SCSMR_PE|CYGARC_REG_SCSMR_OE, // Odd parity - -1, - -1 -}; - -static unsigned short select_baud[] = { - 0, // Unused - CYGARC_SCBRR_CKSx(50)<<8 | CYGARC_SCBRR_N(50), - CYGARC_SCBRR_CKSx(75)<<8 | CYGARC_SCBRR_N(75), - CYGARC_SCBRR_CKSx(110)<<8 | CYGARC_SCBRR_N(110), - CYGARC_SCBRR_CKSx(134)<<8 | CYGARC_SCBRR_N(134), - CYGARC_SCBRR_CKSx(150)<<8 | CYGARC_SCBRR_N(150), - CYGARC_SCBRR_CKSx(200)<<8 | CYGARC_SCBRR_N(200), - CYGARC_SCBRR_CKSx(300)<<8 | CYGARC_SCBRR_N(300), - CYGARC_SCBRR_CKSx(600)<<8 | CYGARC_SCBRR_N(600), - CYGARC_SCBRR_CKSx(1200)<<8 | CYGARC_SCBRR_N(1200), - CYGARC_SCBRR_CKSx(1800)<<8 | CYGARC_SCBRR_N(1800), - CYGARC_SCBRR_CKSx(2400)<<8 | CYGARC_SCBRR_N(2400), - CYGARC_SCBRR_CKSx(3600)<<8 | CYGARC_SCBRR_N(3600), - CYGARC_SCBRR_CKSx(4800)<<8 | CYGARC_SCBRR_N(4800), - CYGARC_SCBRR_CKSx(7200)<<8 | CYGARC_SCBRR_N(7200), - CYGARC_SCBRR_CKSx(9600)<<8 | CYGARC_SCBRR_N(9600), - CYGARC_SCBRR_CKSx(14400)<<8 | CYGARC_SCBRR_N(14400), - CYGARC_SCBRR_CKSx(19200)<<8 | CYGARC_SCBRR_N(19200), - CYGARC_SCBRR_CKSx(38400)<<8 | CYGARC_SCBRR_N(38400), - CYGARC_SCBRR_CKSx(57600)<<8 | CYGARC_SCBRR_N(57600), - CYGARC_SCBRR_CKSx(115200)<<8 | CYGARC_SCBRR_N(115200), - CYGARC_SCBRR_CKSx(230400)<<8 | CYGARC_SCBRR_N(230400) -}; - - -typedef struct sh_sci_info { - CYG_ADDRWORD data; // Pointer to data register - - CYG_WORD er_int_num, // Error interrupt number - rx_int_num, // Receive interrupt number - tx_int_num; // Transmit interrupt number - - CYG_ADDRWORD ctrl_base; // Base address of SCI controller - - cyg_interrupt serial_er_interrupt, - serial_rx_interrupt, - serial_tx_interrupt; - cyg_handle_t serial_er_interrupt_handle, - serial_rx_interrupt_handle, - serial_tx_interrupt_handle; - - bool tx_enabled; -} sh_sci_info; - -static bool sh_serial_init(struct cyg_devtab_entry *tab); -static bool sh_serial_putc(serial_channel *chan, unsigned char c); -static Cyg_ErrNo sh_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name); -static unsigned char sh_serial_getc(serial_channel *chan); -static Cyg_ErrNo sh_serial_set_config(serial_channel *chan, cyg_uint32 key, - const void *xbuf, cyg_uint32 *len); -static void sh_serial_start_xmit(serial_channel *chan); -static void sh_serial_stop_xmit(serial_channel *chan); - -static cyg_uint32 sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); -static cyg_uint32 sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); -static cyg_uint32 sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); - -static SERIAL_FUNS(sh_serial_funs, - sh_serial_putc, - sh_serial_getc, - sh_serial_set_config, - sh_serial_start_xmit, - sh_serial_stop_xmit - ); - -#include __CYGPKG_IO_SERIAL_SH_SCI_INL - -// Internal function to actually configure the hardware to desired baud rate, -// etc. -static bool -sh_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, - bool init) -{ - cyg_uint16 baud_divisor = select_baud[new_config->baud]; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr, _smr; - - // Check configuration request - if ((-1 == select_word_length[(new_config->word_length - - CYGNUM_SERIAL_WORD_LENGTH_5)]) - || -1 == select_stop_bits[new_config->stop] - || -1 == select_parity[new_config->parity] - || baud_divisor == 0) - return false; - - // Disable SCI interrupts while changing hardware - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, 0); - - // Set databits, stopbits and parity. - _smr = select_word_length[(new_config->word_length - - CYGNUM_SERIAL_WORD_LENGTH_5)] | - select_stop_bits[new_config->stop] | - select_parity[new_config->parity]; - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); - - // Set baud rate. - _smr &= ~CYGARC_REG_SCSMR_CKSx_MASK; - _smr |= baud_divisor >> 8; - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCBRR, baud_divisor & 0xff); - - // Clear the status register. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, 0); - - if (init) { - // Always enable transmitter and receiver. - _scr = CYGARC_REG_SCSCR_TE | CYGARC_REG_SCSCR_RE; - - if (chan->out_cbuf.len != 0) - _scr |= CYGARC_REG_SCSCR_TIE; // enable tx interrupts - - if (chan->in_cbuf.len != 0) - _scr |= CYGARC_REG_SCSCR_RIE; // enable rx interrupts - } - - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - if (new_config != &chan->config) { - chan->config = *new_config; - } - return true; -} - -// Function to initialize the device. Called at bootstrap time. -static bool -sh_serial_init(struct cyg_devtab_entry *tab) -{ - serial_channel *chan = (serial_channel *)tab->priv; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; -#ifdef CYGDBG_IO_INIT - diag_printf("SH SERIAL init - dev: %x.%d\n", - sh_chan->data, sh_chan->rx_int_num); -#endif - // Really only required for interrupt driven devices - (chan->callbacks->serial_init)(chan); - - if (chan->out_cbuf.len != 0) { - cyg_drv_interrupt_create(sh_chan->tx_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_tx_ISR, - sh_serial_tx_DSR, - &sh_chan->serial_tx_interrupt_handle, - &sh_chan->serial_tx_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_tx_interrupt_handle); - cyg_drv_interrupt_unmask(sh_chan->tx_int_num); - sh_chan->tx_enabled = false; - } - if (chan->in_cbuf.len != 0) { - // Receive interrupt - cyg_drv_interrupt_create(sh_chan->rx_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_rx_ISR, - sh_serial_rx_DSR, - &sh_chan->serial_rx_interrupt_handle, - &sh_chan->serial_rx_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_rx_interrupt_handle); - // Receive error interrupt - cyg_drv_interrupt_create(sh_chan->er_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_er_ISR, - sh_serial_er_DSR, - &sh_chan->serial_er_interrupt_handle, - &sh_chan->serial_er_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_er_interrupt_handle); - // This unmasks both interrupt sources. - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); - } - sh_serial_config_port(chan, &chan->config, true); - return true; -} - -// This routine is called when the device is "looked" up (i.e. attached) -static Cyg_ErrNo -sh_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name) -{ - serial_channel *chan = (serial_channel *)(*tab)->priv; - - // Really only required for interrupt driven devices - (chan->callbacks->serial_init)(chan); - return ENOERR; -} - -// Send a character to the device output buffer. -// Return 'true' if character is sent to device -static bool -sh_serial_putc(serial_channel *chan, unsigned char c) -{ - cyg_uint8 _ssr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - if (_ssr & CYGARC_REG_SCSSR_TDRE) { -// Transmit buffer is empty - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCTDR, c); - // Clear empty flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_TDRE); - return true; - } else { -// No space - return false; - } -} - -// Fetch a character from the device input buffer, waiting if necessary -static unsigned char -sh_serial_getc(serial_channel *chan) -{ - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - unsigned char c; - cyg_uint8 _ssr; - - do { - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - } while ((_ssr & CYGARC_REG_SCSSR_RDRF) == 0); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, c); - - // Clear buffer full flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); - - return c; -} - -// Set up the device characteristics; baud rate, etc. -static Cyg_ErrNo -sh_serial_set_config(serial_channel *chan, cyg_uint32 key, - const void *xbuf, cyg_uint32 *len) -{ - switch (key) { - case CYG_IO_SET_CONFIG_SERIAL_INFO: - { - cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; - if ( *len < sizeof(cyg_serial_info_t) ) { - return -EINVAL; - } - *len = sizeof(cyg_serial_info_t); - if ( true != sh_serial_config_port(chan, config, false) ) - return -EINVAL; - } - break; - default: - return -EINVAL; - } - return ENOERR; -} - -// Enable the transmitter on the device -static void -sh_serial_start_xmit(serial_channel *chan) -{ - cyg_uint8 _scr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - sh_chan->tx_enabled = true; - - // Mask the interrupts (all sources of the unit) while changing - // the CR since a rx interrupt in the middle of this would result - // in a bad CR state. - cyg_drv_interrupt_mask(sh_chan->rx_int_num); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_TIE; // Enable xmit interrupt - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); -} - -// Disable the transmitter on the device -static void -sh_serial_stop_xmit(serial_channel *chan) -{ - cyg_uint8 _scr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - sh_chan->tx_enabled = false; - - // Mask the interrupts (all sources of the unit) while changing - // the CR since a rx interrupt in the middle of this would result - // in a bad CR state. - cyg_drv_interrupt_mask(sh_chan->rx_int_num); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_TIE; // Disable xmit interrupt - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); -} - -// Serial I/O - low level tx interrupt handler (ISR) -static cyg_uint32 -sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_TIE; // mask out tx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level tx interrupt handler (DSR) -static void -sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - (chan->callbacks->xmt_char)(chan); - - if (sh_chan->tx_enabled) { - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_TIE; // unmask tx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - } -} - -// Serial I/O - low level RX interrupt handler (ISR) -static cyg_uint32 -sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level rx interrupt handler (DSR) -static void -sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _ssr, _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - if (_ssr & CYGARC_REG_SCSSR_RDRF) { - cyg_uint8 _c; - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, _c); - // Clear buffer full flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); - - (chan->callbacks->rcv_char)(chan, _c); - } - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_RIE; // unmask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); -} - -static volatile int sh_serial_error_orer = 0; -static volatile int sh_serial_error_fer = 0; -static volatile int sh_serial_error_per = 0; - -// Serial I/O - low level error interrupt handler (ISR) -static cyg_uint32 -sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level error interrupt handler (DSR) -static void -sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _ssr, _ssr2; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - _ssr2 = CYGARC_REG_SCSSR_CLEARMASK; - - if (_ssr & CYGARC_REG_SCSSR_ORER) { - _ssr2 &= ~CYGARC_REG_SCSSR_ORER; - sh_serial_error_orer++; - } - if (_ssr & CYGARC_REG_SCSSR_FER) { - _ssr2 &= ~CYGARC_REG_SCSSR_FER; - sh_serial_error_fer++; - } - if (_ssr & CYGARC_REG_SCSSR_PER) { - _ssr2 &= ~CYGARC_REG_SCSSR_PER; - sh_serial_error_per++; - } - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr2); -} - -#endif // ifdef __CYGPKG_IO_SERIAL_SH_SCI -
--- a/packages/devs/serial/sh/edk7708/current/ChangeLog +++ b/packages/devs/serial/sh/edk7708/current/ChangeLog @@ -1,3 +1,10 @@ +2000-09-05 Jesper Skov <jskov@redhat.com> + + * src/sh_sci_serial.c: Moved to SCI package. + * src/sh_sci_7708.inl: Moved ... + * include/sh_sh3_edk7708_sci.inl: ... to here. + * cdl/ser_sh_edk7708.cdl: Matching changes. + 2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> * src/sh_sci_serial.c (sh_serial_set_config): Now use keys to make
--- a/packages/devs/serial/sh/edk7708/current/cdl/ser_sh_edk7708.cdl +++ b/packages/devs/serial/sh/edk7708/current/cdl/ser_sh_edk7708.cdl @@ -41,7 +41,7 @@ cdl_package CYGPKG_IO_SERIAL_SH_EDK7708 { - display "SH3 EDK7708 serial device drivers" + display "SH3 EDK7708 serial device drivers" parent CYGPKG_IO_SERIAL_DEVICES active_if CYGPKG_IO_SERIAL @@ -49,88 +49,62 @@ cdl_package CYGPKG_IO_SERIAL_SH_EDK7708 requires CYGPKG_ERROR include_dir cyg/io - include_files ; # none _exported_ whatsoever + description " - This option enables the serial device drivers for the - Hitachi SH3 EDK7708 board." + This option enables the serial device drivers for the + Hitachi SH3 EDK7708 board, based on the generic SH SCI driver." + doc redirect/ecos-device-drivers.html + # FIXME: This really belongs in the SH_SCI package + cdl_interface CYGINT_IO_SERIAL_SH_SCI_REQUIRED { + display "SH SCI driver required" + } define_proc { puts $::cdl_system_header "/***** serial driver proc output start *****/" - puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_sh_edk7708.h>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_SH_SCI_INL <cyg/io/sh_sh3_edk7708_sci.inl>" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_SH_SCI_CFG <pkgconf/io_serial_sh_edk7708.h>" puts $::cdl_system_header "/***** serial driver proc output end *****/" } -cdl_component CYGPKG_IO_SERIAL_SH_EDK7708_SCI { - display "SH3 EDK7708 SCI device driver" - flavor bool - default_value 1 - description " - This option includes the serial device driver for the SCI port." - - compile -library=libextras.a sh_sci_serial.c - - cdl_option CYGDAT_IO_SERIAL_SH_EDK7708_SCI_NAME { - display "Device name for SH3 EDK7708 SCI" - flavor data - default_value {"\"/dev/ser1\""} + cdl_component CYGPKG_IO_SERIAL_SH_EDK7708_SERIAL1 { + display "SH EDK7708 serial 1 driver (SCI)" + flavor bool + default_value 1 description " - This option specifies the device name for the SCI port." - } - - cdl_option CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BAUD { - display "Baud rate for the SH SCI driver" - flavor data - legal_values { 4800 9600 14400 19200 38400 57600 115200 } - default_value 38400 - description " - This option specifies the default baud rate (speed) for the - SCI port." - } + This option includes the serial device driver for the SCI + port." - cdl_option CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BUFSIZE { - display "Buffer size for the SH SCI driver" - flavor data - legal_values 0 to 8192 - default_value 128 - description " - This option specifies the size of the internal buffers used for - the SCI port." - } -} + implements CYGINT_IO_SERIAL_SH_SCI_REQUIRED - cdl_component CYGPKG_IO_SERIAL_SH_EDK7708_OPTIONS { - display "Serial device driver build options" - flavor none - description " - Package specific build options including control over - compiler flags used only in building this package, - and details of which tests are built." - - - cdl_option CYGPKG_IO_SERIAL_SH_EDK7708_CFLAGS_ADD { - display "Additional compiler flags" - flavor data - no_define - default_value { "" } + cdl_option CYGDAT_IO_SERIAL_SH_EDK7708_SERIAL1_NAME { + display "Device name for SH3 EDK7708 SCI" + flavor data + default_value {"\"/dev/ser1\""} description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are used in addition - to the set of global flags." + This option specifies the device name for the SCI port." } - cdl_option CYGPKG_IO_SERIAL_SH_EDK7708_CFLAGS_REMOVE { - display "Suppressed compiler flags" - flavor data - no_define - default_value { "" } + cdl_option CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BAUD { + display "Baud rate for the SH SCI driver" + flavor data + legal_values { 4800 9600 14400 19200 38400 57600 115200 } + default_value 38400 description " - This option modifies the set of compiler flags for - building these serial device drivers. These flags are removed from - the set of global flags if present." + This option specifies the default baud rate (speed) + for the SCI port." + } + + cdl_option CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BUFSIZE { + display "Buffer size for the SH SCI driver" + flavor data + legal_values 0 to 8192 + default_value 128 + description " + This option specifies the size of the internal buffers + used for the SCI port." } } } - # EOF ser_sh_edk7708.cdl
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/edk7708/current/include/sh_sh3_edk7708_sci.inl @@ -0,0 +1,93 @@ +#ifndef CYGONCE_DEVS_SH_EDK7708_SCI_H +#define CYGONCE_DEVS_SH_EDK7708_SCI_H + +//========================================================================== +// +// io/serial/sh/sh_sh3_edk7708_sci.inl +// +// Serial I/O specification for Hitachi EDK7708 platform. +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:jskov +// Date: 1999-06-16 +// Purpose: Defines SCI serial resources for SH3/7708. +// Description: +// +//####DESCRIPTIONEND#### +//========================================================================== + + +#include <pkgconf/io_serial_sh_edk7708.h> + +static sh_sci_info sh_serial_info = {CYGARC_REG_SCSPTR, + CYGNUM_HAL_INTERRUPT_SCI_ERI, + CYGNUM_HAL_INTERRUPT_SCI_RXI, + CYGNUM_HAL_INTERRUPT_SCI_TXI, + SH_SERIAL_SCI_BASE}; + +#if CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BUFSIZE > 0 +static unsigned char sh_serial_out_buf[CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BUFSIZE]; +static unsigned char sh_serial_in_buf[CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BUFSIZE]; + +static SERIAL_CHANNEL_USING_INTERRUPTS(sh_serial_channel, + sh_serial_funs, + sh_serial_info, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT, + &sh_serial_out_buf[0], + sizeof(sh_serial_out_buf), + &sh_serial_in_buf[0], + sizeof(sh_serial_in_buf) + ); +#else +static SERIAL_CHANNEL(sh_serial_channel, + sh_serial_funs, + sh_serial_info, + CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_EDK7708_SERIAL1_BAUD), + CYG_SERIAL_STOP_DEFAULT, + CYG_SERIAL_PARITY_DEFAULT, + CYG_SERIAL_WORD_LENGTH_DEFAULT, + CYG_SERIAL_FLAGS_DEFAULT + ); +#endif + +DEVTAB_ENTRY(sh_serial_io, + CYGDAT_IO_SERIAL_SH_EDK7708_SERIAL1_NAME, + 0, // Does not depend on a lower level interface + &cyg_io_serial_devio, + sh_serial_init, + sh_serial_lookup, // Serial driver may need initializing + &sh_serial_channel + ); + +#endif // CYGONCE_DEVS_SH_EDK7708_SCI_H
deleted file mode 100644 --- a/packages/devs/serial/sh/edk7708/current/src/sh_sci_7708.inl +++ /dev/null @@ -1,97 +0,0 @@ -//========================================================================== -// -// io/serial/sh/sh_sci_7708.c -// -// Serial I/O Interface Module definitions for SH3/7708 -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors:jskov -// Date: 1999-06-16 -// Purpose: Defines SCI serial resources for SH3/7708. -// Description: -// -//####DESCRIPTIONEND#### -//========================================================================== - -// Controller bases in the SH3/7708 (only one) -#define SH_SERIAL_SCI_BASE 0xfffffe80 - -// The SCI controller register layout on the SH3/7708. -#define SCI_SCSMR 0 // serial mode register -#define SCI_SCBRR 2 // bit rate register -#define SCI_SCSCR 4 // serial control register -#define SCI_SCTDR 6 // transmit data register -#define SCI_SCSSR 8 // serial status register -#define SCI_SCRDR 10 // receive data register -#define SCI_SCSPTR -4 // serial port register - -static sh_sci_info sh_serial_info = {CYGARC_REG_SCSPTR, - CYGNUM_HAL_INTERRUPT_SCI_ERI, - CYGNUM_HAL_INTERRUPT_SCI_RXI, - CYGNUM_HAL_INTERRUPT_SCI_TXI, - SH_SERIAL_SCI_BASE}; - -#if CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BUFSIZE > 0 -static unsigned char sh_serial_out_buf[CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BUFSIZE]; -static unsigned char sh_serial_in_buf[CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BUFSIZE]; - -static SERIAL_CHANNEL_USING_INTERRUPTS(sh_serial_channel, - sh_serial_funs, - sh_serial_info, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT, - &sh_serial_out_buf[0], - sizeof(sh_serial_out_buf), - &sh_serial_in_buf[0], - sizeof(sh_serial_in_buf) - ); -#else -static SERIAL_CHANNEL(sh_serial_channel, - sh_serial_funs, - sh_serial_info, - CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BAUD), - CYG_SERIAL_STOP_DEFAULT, - CYG_SERIAL_PARITY_DEFAULT, - CYG_SERIAL_WORD_LENGTH_DEFAULT, - CYG_SERIAL_FLAGS_DEFAULT - ); -#endif - -DEVTAB_ENTRY(sh_serial_io, - CYGDAT_IO_SERIAL_SH_EDK7708_SCI_NAME, - 0, // Does not depend on a lower level interface - &cyg_io_serial_devio, - sh_serial_init, - sh_serial_lookup, // Serial driver may need initializing - &sh_serial_channel - );
deleted file mode 100644 --- a/packages/devs/serial/sh/edk7708/current/src/sh_sci_serial.c +++ /dev/null @@ -1,513 +0,0 @@ -//========================================================================== -// -// io/serial/sh/sh_sci_serial.c -// -// SH Serial SCI I/O Interface Module (interrupt driven) -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Red Hat eCos Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.redhat.com/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations under -// the License. -// -// The Original Code is eCos - Embedded Configurable Operating System, -// released September 30, 1998. -// -// The Initial Developer of the Original Code is Red Hat. -// Portions created by Red Hat are -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors:gthomas, jskov -// Date: 1999-05-24 -// Purpose: SH Serial I/O module (interrupt driven version) -// Description: -// -// Note: Since interrupt sources from the same SCI channel share the same -// interrupt level, there is no risk of races when altering the -// channel's control register from ISRs and DSRs. However, when -// altering the control register from user-level code, interrupts -// must be disabled while the register is being accessed. -// -// FIXME: Receiving in polled mode prevents duplex transfers from working for -// some reason. -//####DESCRIPTIONEND#### -//========================================================================== - -#include <pkgconf/io_serial.h> -#include <pkgconf/io.h> - -#include <cyg/io/io.h> -#include <cyg/hal/hal_intr.h> -#include <cyg/io/devtab.h> -#include <cyg/infra/diag.h> -#include <cyg/io/serial.h> - -#include <cyg/hal/sh_regs.h> - -#ifdef CYGPKG_IO_SERIAL_SH_EDK7708 -#define __CYGPKG_IO_SERIAL_SH_SCI_INL "sh_sci_7708.inl" -#endif - - -// Only compile driver if an inline file with driver details was selected. -#ifdef __CYGPKG_IO_SERIAL_SH_SCI_INL - -static short select_word_length[] = { - -1, - -1, - CYGARC_REG_SCSMR_CHR, // 7 bits - 0 // 8 bits -}; - -static short select_stop_bits[] = { - -1, - 0, // 1 stop bit - -1, - CYGARC_REG_SCSMR_STOP // 2 stop bits -}; - -static short select_parity[] = { - 0, // No parity - CYGARC_REG_SCSMR_PE, // Even parity - CYGARC_REG_SCSMR_PE|CYGARC_REG_SCSMR_OE, // Odd parity - -1, - -1 -}; - -static unsigned short select_baud[] = { - 0, // Unused - CYGARC_SCBRR_CKSx(50)<<8 | CYGARC_SCBRR_N(50), - CYGARC_SCBRR_CKSx(75)<<8 | CYGARC_SCBRR_N(75), - CYGARC_SCBRR_CKSx(110)<<8 | CYGARC_SCBRR_N(110), - CYGARC_SCBRR_CKSx(134)<<8 | CYGARC_SCBRR_N(134), - CYGARC_SCBRR_CKSx(150)<<8 | CYGARC_SCBRR_N(150), - CYGARC_SCBRR_CKSx(200)<<8 | CYGARC_SCBRR_N(200), - CYGARC_SCBRR_CKSx(300)<<8 | CYGARC_SCBRR_N(300), - CYGARC_SCBRR_CKSx(600)<<8 | CYGARC_SCBRR_N(600), - CYGARC_SCBRR_CKSx(1200)<<8 | CYGARC_SCBRR_N(1200), - CYGARC_SCBRR_CKSx(1800)<<8 | CYGARC_SCBRR_N(1800), - CYGARC_SCBRR_CKSx(2400)<<8 | CYGARC_SCBRR_N(2400), - CYGARC_SCBRR_CKSx(3600)<<8 | CYGARC_SCBRR_N(3600), - CYGARC_SCBRR_CKSx(4800)<<8 | CYGARC_SCBRR_N(4800), - CYGARC_SCBRR_CKSx(7200)<<8 | CYGARC_SCBRR_N(7200), - CYGARC_SCBRR_CKSx(9600)<<8 | CYGARC_SCBRR_N(9600), - CYGARC_SCBRR_CKSx(14400)<<8 | CYGARC_SCBRR_N(14400), - CYGARC_SCBRR_CKSx(19200)<<8 | CYGARC_SCBRR_N(19200), - CYGARC_SCBRR_CKSx(38400)<<8 | CYGARC_SCBRR_N(38400), - CYGARC_SCBRR_CKSx(57600)<<8 | CYGARC_SCBRR_N(57600), - CYGARC_SCBRR_CKSx(115200)<<8 | CYGARC_SCBRR_N(115200), - CYGARC_SCBRR_CKSx(230400)<<8 | CYGARC_SCBRR_N(230400) -}; - - -typedef struct sh_sci_info { - CYG_ADDRWORD data; // Pointer to data register - - CYG_WORD er_int_num, // Error interrupt number - rx_int_num, // Receive interrupt number - tx_int_num; // Transmit interrupt number - - CYG_ADDRWORD ctrl_base; // Base address of SCI controller - - cyg_interrupt serial_er_interrupt, - serial_rx_interrupt, - serial_tx_interrupt; - cyg_handle_t serial_er_interrupt_handle, - serial_rx_interrupt_handle, - serial_tx_interrupt_handle; - - bool tx_enabled; -} sh_sci_info; - -static bool sh_serial_init(struct cyg_devtab_entry *tab); -static bool sh_serial_putc(serial_channel *chan, unsigned char c); -static Cyg_ErrNo sh_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name); -static unsigned char sh_serial_getc(serial_channel *chan); -static Cyg_ErrNo sh_serial_set_config(serial_channel *chan, cyg_uint32 key, - const void *xbuf, cyg_uint32 *len); -static void sh_serial_start_xmit(serial_channel *chan); -static void sh_serial_stop_xmit(serial_channel *chan); - -static cyg_uint32 sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); -static cyg_uint32 sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); -static cyg_uint32 sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data); -static void sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, - cyg_addrword_t data); - -static SERIAL_FUNS(sh_serial_funs, - sh_serial_putc, - sh_serial_getc, - sh_serial_set_config, - sh_serial_start_xmit, - sh_serial_stop_xmit - ); - -#include __CYGPKG_IO_SERIAL_SH_SCI_INL - -// Internal function to actually configure the hardware to desired baud rate, -// etc. -static bool -sh_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, - bool init) -{ - cyg_uint16 baud_divisor = select_baud[new_config->baud]; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr, _smr; - - // Check configuration request - if ((-1 == select_word_length[(new_config->word_length - - CYGNUM_SERIAL_WORD_LENGTH_5)]) - || -1 == select_stop_bits[new_config->stop] - || -1 == select_parity[new_config->parity] - || baud_divisor == 0) - return false; - - // Disable SCI interrupts while changing hardware - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, 0); - - // Set databits, stopbits and parity. - _smr = select_word_length[(new_config->word_length - - CYGNUM_SERIAL_WORD_LENGTH_5)] | - select_stop_bits[new_config->stop] | - select_parity[new_config->parity]; - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); - - // Set baud rate. - _smr &= ~CYGARC_REG_SCSMR_CKSx_MASK; - _smr |= baud_divisor >> 8; - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCBRR, baud_divisor & 0xff); - - // Clear the status register. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, 0); - - if (init) { - // Always enable transmitter and receiver. - _scr = CYGARC_REG_SCSCR_TE | CYGARC_REG_SCSCR_RE; - - if (chan->out_cbuf.len != 0) - _scr |= CYGARC_REG_SCSCR_TIE; // enable tx interrupts - - if (chan->in_cbuf.len != 0) - _scr |= CYGARC_REG_SCSCR_RIE; // enable rx interrupts - } - - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - if (new_config != &chan->config) { - chan->config = *new_config; - } - return true; -} - -// Function to initialize the device. Called at bootstrap time. -static bool -sh_serial_init(struct cyg_devtab_entry *tab) -{ - serial_channel *chan = (serial_channel *)tab->priv; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; -#ifdef CYGDBG_IO_INIT - diag_printf("SH SERIAL init - dev: %x.%d\n", - sh_chan->data, sh_chan->rx_int_num); -#endif - // Really only required for interrupt driven devices - (chan->callbacks->serial_init)(chan); - - if (chan->out_cbuf.len != 0) { - cyg_drv_interrupt_create(sh_chan->tx_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_tx_ISR, - sh_serial_tx_DSR, - &sh_chan->serial_tx_interrupt_handle, - &sh_chan->serial_tx_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_tx_interrupt_handle); - cyg_drv_interrupt_unmask(sh_chan->tx_int_num); - sh_chan->tx_enabled = false; - } - if (chan->in_cbuf.len != 0) { - // Receive interrupt - cyg_drv_interrupt_create(sh_chan->rx_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_rx_ISR, - sh_serial_rx_DSR, - &sh_chan->serial_rx_interrupt_handle, - &sh_chan->serial_rx_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_rx_interrupt_handle); - // Receive error interrupt - cyg_drv_interrupt_create(sh_chan->er_int_num, - 3, - (cyg_addrword_t)chan, // Data item passed to interrupt handler - sh_serial_er_ISR, - sh_serial_er_DSR, - &sh_chan->serial_er_interrupt_handle, - &sh_chan->serial_er_interrupt); - cyg_drv_interrupt_attach(sh_chan->serial_er_interrupt_handle); - // This unmasks both interrupt sources. - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); - } - sh_serial_config_port(chan, &chan->config, true); - return true; -} - -// This routine is called when the device is "looked" up (i.e. attached) -static Cyg_ErrNo -sh_serial_lookup(struct cyg_devtab_entry **tab, - struct cyg_devtab_entry *sub_tab, - const char *name) -{ - serial_channel *chan = (serial_channel *)(*tab)->priv; - - // Really only required for interrupt driven devices - (chan->callbacks->serial_init)(chan); - return ENOERR; -} - -// Send a character to the device output buffer. -// Return 'true' if character is sent to device -static bool -sh_serial_putc(serial_channel *chan, unsigned char c) -{ - cyg_uint8 _ssr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - if (_ssr & CYGARC_REG_SCSSR_TDRE) { -// Transmit buffer is empty - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCTDR, c); - // Clear empty flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_TDRE); - return true; - } else { -// No space - return false; - } -} - -// Fetch a character from the device input buffer, waiting if necessary -static unsigned char -sh_serial_getc(serial_channel *chan) -{ - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - unsigned char c; - cyg_uint8 _ssr; - - do { - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - } while ((_ssr & CYGARC_REG_SCSSR_RDRF) == 0); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, c); - - // Clear buffer full flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); - - return c; -} - -// Set up the device characteristics; baud rate, etc. -static Cyg_ErrNo -sh_serial_set_config(serial_channel *chan, cyg_uint32 key, - const void *xbuf, cyg_uint32 *len) -{ - switch (key) { - case CYG_IO_SET_CONFIG_SERIAL_INFO: - { - cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; - if ( *len < sizeof(cyg_serial_info_t) ) { - return -EINVAL; - } - *len = sizeof(cyg_serial_info_t); - if ( true != sh_serial_config_port(chan, config, false) ) - return -EINVAL; - } - break; - default: - return -EINVAL; - } - return ENOERR; -} - -// Enable the transmitter on the device -static void -sh_serial_start_xmit(serial_channel *chan) -{ - cyg_uint8 _scr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - sh_chan->tx_enabled = true; - - // Mask the interrupts (all sources of the unit) while changing - // the CR since a rx interrupt in the middle of this would result - // in a bad CR state. - cyg_drv_interrupt_mask(sh_chan->rx_int_num); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_TIE; // Enable xmit interrupt - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); -} - -// Disable the transmitter on the device -static void -sh_serial_stop_xmit(serial_channel *chan) -{ - cyg_uint8 _scr; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - sh_chan->tx_enabled = false; - - // Mask the interrupts (all sources of the unit) while changing - // the CR since a rx interrupt in the middle of this would result - // in a bad CR state. - cyg_drv_interrupt_mask(sh_chan->rx_int_num); - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_TIE; // Disable xmit interrupt - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - cyg_drv_interrupt_unmask(sh_chan->rx_int_num); -} - -// Serial I/O - low level tx interrupt handler (ISR) -static cyg_uint32 -sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_TIE; // mask out tx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level tx interrupt handler (DSR) -static void -sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - - (chan->callbacks->xmt_char)(chan); - - if (sh_chan->tx_enabled) { - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_TIE; // unmask tx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - } -} - -// Serial I/O - low level RX interrupt handler (ISR) -static cyg_uint32 -sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level rx interrupt handler (DSR) -static void -sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _ssr, _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - if (_ssr & CYGARC_REG_SCSSR_RDRF) { - cyg_uint8 _c; - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, _c); - // Clear buffer full flag. - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, - CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); - - (chan->callbacks->rcv_char)(chan, _c); - } - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr |= CYGARC_REG_SCSCR_RIE; // unmask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); -} - -static volatile int sh_serial_error_orer = 0; -static volatile int sh_serial_error_fer = 0; -static volatile int sh_serial_error_per = 0; - -// Serial I/O - low level error interrupt handler (ISR) -static cyg_uint32 -sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _scr; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); - return CYG_ISR_CALL_DSR; // Cause DSR to be run -} - -// Serial I/O - high level error interrupt handler (DSR) -static void -sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) -{ - serial_channel *chan = (serial_channel *)data; - sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; - cyg_uint8 _ssr, _ssr2; - - HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); - _ssr2 = CYGARC_REG_SCSSR_CLEARMASK; - - if (_ssr & CYGARC_REG_SCSSR_ORER) { - _ssr2 &= ~CYGARC_REG_SCSSR_ORER; - sh_serial_error_orer++; - } - if (_ssr & CYGARC_REG_SCSSR_FER) { - _ssr2 &= ~CYGARC_REG_SCSSR_FER; - sh_serial_error_fer++; - } - if (_ssr & CYGARC_REG_SCSSR_PER) { - _ssr2 &= ~CYGARC_REG_SCSSR_PER; - sh_serial_error_per++; - } - HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr2); -} - -#endif // ifdef __CYGPKG_IO_SERIAL_SH_SCI -
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/sci/current/ChangeLog @@ -0,0 +1,134 @@ +2000-09-05 Jesper Skov <jskov@redhat.com> + + * src/sh_sci_serial.c: Moved to generic SH SCI package. + * ChangeLog: Removed all non-SCI related references. + +2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> + + * src/sh_sci_serial.c (sh_serial_set_config): Now use keys to make + more flexible. + +2000-06-22 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/<yournamehere>.cdl: Remove the comment on the empty + include_files directive; the tools now support this correctly. + This keeps internal include files internal. + +2000-04-11 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/ser_sh_edk7708.cdl: Change the parent from CYGPKG_IO_SERIAL + (which is enabled most of the time) to CYGPKG_IO_SERIAL_DEVICES + (which is not...) thus allowing convenient control independent of + platform. Also enable all individual devices by default, now, so + that they can be enabled simply by enabling the above new parent. + +2000-04-11 Jesper Skov <jskov@redhat.com> + + * cdl/ser_sh_edk7708.cdl: Move compile statement into a + sub-component. + +2000-04-07 Hugo Tyson <hmt@cygnus.co.uk> + + * ecos.db: Re-organize device packages. This is a massive change + involving deleting all the sources for serial and ethernet drivers + from where they used to live in + packages/io/serial/current/src/ARCH/PLATFORM.[ch] + packages/net/drivers/eth/PLATFORM/current/src/... + and reinstating them in + packages/devs/serial/ARCH/PLATFORM/current/src/... + packages/devs/eth/ARCH/PLATFORM/current/src/... + + All these new packages are properly defined in ecos.db, and are + all of type "hardware" so that a "target" can grab them. + + This directory layout is descriptive of the devices we have right + now, arch and platform are separate levels just to make it easier + to navigate in the filesystem and similar to the HAL structure in + the filesystem. + + It is *not* prescriptive of future work; for example, the mythical + common highly-portable 16550 serial driver which works on many + targets would be called "devs/serial/s16550/current", or a serial + device for a particular board (cogent springs to mind) that can + work with different CPUs fitted is "devs/serial/cogent/current". + + Changelogs have been preserved and replicated over all the new + packages, so that no history is lost. + + The contents of individual source files are unchanged; they build + in just the same emvironment except for a very few cases where the + config file name changed in this movement. + + Targets in ecos.db have been redefined to bring in all relevant + hardware packages including net and serial drivers (but the newly + included packages are only active if their desired parent is + available.) + + The names of CDL options (and their #defines of course) stay the + same for the serial drivers, for backward compatibility. + + * templates/*/current.ect: these have had CYGPKG_IO_SERIAL added + rather than it being in (almost) all target definitions. + +2000-03-31 Jesper Skov <jskov@redhat.com> + + * cdl/ser_sh_edk7708.cdl: Limit legal baud rate range. + * src/sh/sh_sci_serial.c: Use baud rate macro instead of hardwired + constants. + +2000-02-11 Jesper Skov <jskov@redhat.com> + + * src/sh/sh_sci_7708.inl (DEVTAB_ENTRY): + serial_devio => cyg_io_serial_devio + +1999-06-16 Jesper Skov <jskov@cygnus.co.uk> + + * src/sh/sh_serial.c: [removed] + * src/sh/sh_sci_serial.c: [added] + * src/sh/sh_sci_7708.inl: [added] + Renamed CDL options and restructered driver. + Fixed CDL typo. + +1999-05-31 Jesper Skov <jskov@cygnus.co.uk> + + * src/sh/sh_serial.c: Fixed receive interrupts and added handler for + error interrupts. + +1999-05-26 Jesper Skov <jskov@cygnus.co.uk> + + * src/sh/sh_serial.c: Added more baud rate values. Disabled + interrupt driven receive. Fixed config_port to enable proper + interrupt flags. + +1999-05-24 Jesper Skov <jskov@cygnus.co.uk> + + * src/PKGconf.mak: + * include/pkgconf/io_serial.h: + * src/sh/sh_serial.c: + Added sh driver. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//===========================================================================
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/sci/current/cdl/ser_sh_sci.cdl @@ -0,0 +1,103 @@ +# ==================================================================== +# +# ser_sh_sci.cdl +# +# eCos serial SH/SCI configuration data +# +# ==================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): jskov +# Contributors: +# Date: 1999-07-08 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + + +cdl_package CYGPKG_IO_SERIAL_SH_SCI { + display "SH SCI serial device drivers" + + parent CYGPKG_IO_SERIAL_DEVICES + active_if CYGPKG_IO_SERIAL + active_if CYGPKG_HAL_SH + + active_if CYGINT_IO_SERIAL_SH_SCI_REQUIRED + + requires CYGPKG_ERROR + include_dir cyg/io + include_files ; # none _exported_ whatsoever + description " + This option enables the serial device drivers for the + SCI module in Hitachi SH CPUs." + doc redirect/ecos-device-drivers.html + + compile -library=libextras.a sh_sci_serial.c + + define_proc { + puts $::cdl_system_header "/***** serial driver proc output start *****/" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_sh_sci.h>" + puts $::cdl_system_header "/***** serial driver proc output end *****/" + + puts $::cdl_header "#include <pkgconf/system.h>"; + puts $::cdl_header "#include CYGDAT_IO_SERIAL_SH_SCI_CFG"; + } + + cdl_component CYGPKG_IO_SERIAL_SH_SCI_OPTIONS { + display "SCI serial device driver build options" + flavor none + description " + Package specific build options including control over + compiler flags used only in building this package, + and details of which tests are built." + + cdl_option CYGPKG_IO_SERIAL_SH_SCI_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + used in addition to the set of global flags." + } + + cdl_option CYGPKG_IO_SERIAL_SH_SCI_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + removed from the set of global flags if present." + } + } +} + +# EOF ser_sh_sci.cdl
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/sci/current/src/sh_sci_serial.c @@ -0,0 +1,519 @@ +//========================================================================== +// +// io/serial/sh/sh_sci_serial.c +// +// SH Serial SCI I/O Interface Module (interrupt driven) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:gthomas, jskov +// Date: 1999-05-24 +// Purpose: SH Serial I/O module (interrupt driven version) +// Description: +// +// Note: Since interrupt sources from the same SCI channel share the same +// interrupt level, there is no risk of races when altering the +// channel's control register from ISRs and DSRs. However, when +// altering the control register from user-level code, interrupts +// must be disabled while the register is being accessed. +// +// FIXME: Receiving in polled mode prevents duplex transfers from working for +// some reason. +//####DESCRIPTIONEND#### +//========================================================================== + +#include <pkgconf/io_serial.h> +#include <pkgconf/io.h> + +#include <cyg/io/io.h> +#include <cyg/hal/hal_intr.h> +#include <cyg/io/devtab.h> +#include <cyg/infra/diag.h> +#include <cyg/io/serial.h> + +#include <cyg/hal/sh_regs.h> + +// Only compile driver if an inline file with driver details was selected. +#ifdef CYGDAT_IO_SERIAL_SH_SCI_INL + +// Controller base (only one supported at the moment) +#define SH_SERIAL_SCI_BASE 0xfffffe80 + +// The SCI controller register layout on the SH3/7708. +#define SCI_SCSMR 0 // serial mode register +#define SCI_SCBRR 2 // bit rate register +#define SCI_SCSCR 4 // serial control register +#define SCI_SCTDR 6 // transmit data register +#define SCI_SCSSR 8 // serial status register +#define SCI_SCRDR 10 // receive data register +#define SCI_SCSPTR -4 // serial port register + +static short select_word_length[] = { + -1, + -1, + CYGARC_REG_SCSMR_CHR, // 7 bits + 0 // 8 bits +}; + +static short select_stop_bits[] = { + -1, + 0, // 1 stop bit + -1, + CYGARC_REG_SCSMR_STOP // 2 stop bits +}; + +static short select_parity[] = { + 0, // No parity + CYGARC_REG_SCSMR_PE, // Even parity + CYGARC_REG_SCSMR_PE|CYGARC_REG_SCSMR_OE, // Odd parity + -1, + -1 +}; + +static unsigned short select_baud[] = { + 0, // Unused + CYGARC_SCBRR_CKSx(50)<<8 | CYGARC_SCBRR_N(50), + CYGARC_SCBRR_CKSx(75)<<8 | CYGARC_SCBRR_N(75), + CYGARC_SCBRR_CKSx(110)<<8 | CYGARC_SCBRR_N(110), + CYGARC_SCBRR_CKSx(134)<<8 | CYGARC_SCBRR_N(134), + CYGARC_SCBRR_CKSx(150)<<8 | CYGARC_SCBRR_N(150), + CYGARC_SCBRR_CKSx(200)<<8 | CYGARC_SCBRR_N(200), + CYGARC_SCBRR_CKSx(300)<<8 | CYGARC_SCBRR_N(300), + CYGARC_SCBRR_CKSx(600)<<8 | CYGARC_SCBRR_N(600), + CYGARC_SCBRR_CKSx(1200)<<8 | CYGARC_SCBRR_N(1200), + CYGARC_SCBRR_CKSx(1800)<<8 | CYGARC_SCBRR_N(1800), + CYGARC_SCBRR_CKSx(2400)<<8 | CYGARC_SCBRR_N(2400), + CYGARC_SCBRR_CKSx(3600)<<8 | CYGARC_SCBRR_N(3600), + CYGARC_SCBRR_CKSx(4800)<<8 | CYGARC_SCBRR_N(4800), + CYGARC_SCBRR_CKSx(7200)<<8 | CYGARC_SCBRR_N(7200), + CYGARC_SCBRR_CKSx(9600)<<8 | CYGARC_SCBRR_N(9600), + CYGARC_SCBRR_CKSx(14400)<<8 | CYGARC_SCBRR_N(14400), + CYGARC_SCBRR_CKSx(19200)<<8 | CYGARC_SCBRR_N(19200), + CYGARC_SCBRR_CKSx(38400)<<8 | CYGARC_SCBRR_N(38400), + CYGARC_SCBRR_CKSx(57600)<<8 | CYGARC_SCBRR_N(57600), + CYGARC_SCBRR_CKSx(115200)<<8 | CYGARC_SCBRR_N(115200), + CYGARC_SCBRR_CKSx(230400)<<8 | CYGARC_SCBRR_N(230400) +}; + + +typedef struct sh_sci_info { + CYG_ADDRWORD data; // Pointer to data register + + CYG_WORD er_int_num, // Error interrupt number + rx_int_num, // Receive interrupt number + tx_int_num; // Transmit interrupt number + + CYG_ADDRWORD ctrl_base; // Base address of SCI controller + + cyg_interrupt serial_er_interrupt, + serial_rx_interrupt, + serial_tx_interrupt; + cyg_handle_t serial_er_interrupt_handle, + serial_rx_interrupt_handle, + serial_tx_interrupt_handle; + + bool tx_enabled; +} sh_sci_info; + +static bool sh_serial_init(struct cyg_devtab_entry *tab); +static bool sh_serial_putc(serial_channel *chan, unsigned char c); +static Cyg_ErrNo sh_serial_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name); +static unsigned char sh_serial_getc(serial_channel *chan); +static Cyg_ErrNo sh_serial_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len); +static void sh_serial_start_xmit(serial_channel *chan); +static void sh_serial_stop_xmit(serial_channel *chan); + +static cyg_uint32 sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); +static cyg_uint32 sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); +static cyg_uint32 sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); + +static SERIAL_FUNS(sh_serial_funs, + sh_serial_putc, + sh_serial_getc, + sh_serial_set_config, + sh_serial_start_xmit, + sh_serial_stop_xmit + ); + +#include CYGDAT_IO_SERIAL_SH_SCI_INL + +// Internal function to actually configure the hardware to desired baud rate, +// etc. +static bool +sh_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, + bool init) +{ + cyg_uint16 baud_divisor = select_baud[new_config->baud]; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _scr, _smr; + + // Check configuration request + if ((-1 == select_word_length[(new_config->word_length - + CYGNUM_SERIAL_WORD_LENGTH_5)]) + || -1 == select_stop_bits[new_config->stop] + || -1 == select_parity[new_config->parity] + || baud_divisor == 0) + return false; + + // Disable SCI interrupts while changing hardware + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, 0); + + // Set databits, stopbits and parity. + _smr = select_word_length[(new_config->word_length - + CYGNUM_SERIAL_WORD_LENGTH_5)] | + select_stop_bits[new_config->stop] | + select_parity[new_config->parity]; + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); + + // Set baud rate. + _smr &= ~CYGARC_REG_SCSMR_CKSx_MASK; + _smr |= baud_divisor >> 8; + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSMR, _smr); + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCBRR, baud_divisor & 0xff); + + // Clear the status register. + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, 0); + + if (init) { + // Always enable transmitter and receiver. + _scr = CYGARC_REG_SCSCR_TE | CYGARC_REG_SCSCR_RE; + + if (chan->out_cbuf.len != 0) + _scr |= CYGARC_REG_SCSCR_TIE; // enable tx interrupts + + if (chan->in_cbuf.len != 0) + _scr |= CYGARC_REG_SCSCR_RIE; // enable rx interrupts + } + + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + + if (new_config != &chan->config) { + chan->config = *new_config; + } + return true; +} + +// Function to initialize the device. Called at bootstrap time. +static bool +sh_serial_init(struct cyg_devtab_entry *tab) +{ + serial_channel *chan = (serial_channel *)tab->priv; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; +#ifdef CYGDBG_IO_INIT + diag_printf("SH SERIAL init - dev: %x.%d\n", + sh_chan->data, sh_chan->rx_int_num); +#endif + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + + if (chan->out_cbuf.len != 0) { + cyg_drv_interrupt_create(sh_chan->tx_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh_serial_tx_ISR, + sh_serial_tx_DSR, + &sh_chan->serial_tx_interrupt_handle, + &sh_chan->serial_tx_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_tx_interrupt_handle); + cyg_drv_interrupt_unmask(sh_chan->tx_int_num); + sh_chan->tx_enabled = false; + } + if (chan->in_cbuf.len != 0) { + // Receive interrupt + cyg_drv_interrupt_create(sh_chan->rx_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh_serial_rx_ISR, + sh_serial_rx_DSR, + &sh_chan->serial_rx_interrupt_handle, + &sh_chan->serial_rx_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_rx_interrupt_handle); + // Receive error interrupt + cyg_drv_interrupt_create(sh_chan->er_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh_serial_er_ISR, + sh_serial_er_DSR, + &sh_chan->serial_er_interrupt_handle, + &sh_chan->serial_er_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_er_interrupt_handle); + // This unmasks both interrupt sources. + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); + } + sh_serial_config_port(chan, &chan->config, true); + return true; +} + +// This routine is called when the device is "looked" up (i.e. attached) +static Cyg_ErrNo +sh_serial_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name) +{ + serial_channel *chan = (serial_channel *)(*tab)->priv; + + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + return ENOERR; +} + +// Send a character to the device output buffer. +// Return 'true' if character is sent to device +static bool +sh_serial_putc(serial_channel *chan, unsigned char c) +{ + cyg_uint8 _ssr; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); + if (_ssr & CYGARC_REG_SCSSR_TDRE) { +// Transmit buffer is empty + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCTDR, c); + // Clear empty flag. + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, + CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_TDRE); + return true; + } else { +// No space + return false; + } +} + +// Fetch a character from the device input buffer, waiting if necessary +static unsigned char +sh_serial_getc(serial_channel *chan) +{ + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + unsigned char c; + cyg_uint8 _ssr; + + do { + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); + } while ((_ssr & CYGARC_REG_SCSSR_RDRF) == 0); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, c); + + // Clear buffer full flag. + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, + CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); + + return c; +} + +// Set up the device characteristics; baud rate, etc. +static Cyg_ErrNo +sh_serial_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len) +{ + switch (key) { + case CYG_IO_SET_CONFIG_SERIAL_INFO: + { + cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; + if ( *len < sizeof(cyg_serial_info_t) ) { + return -EINVAL; + } + *len = sizeof(cyg_serial_info_t); + if ( true != sh_serial_config_port(chan, config, false) ) + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return ENOERR; +} + +// Enable the transmitter on the device +static void +sh_serial_start_xmit(serial_channel *chan) +{ + cyg_uint8 _scr; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + + sh_chan->tx_enabled = true; + + // Mask the interrupts (all sources of the unit) while changing + // the CR since a rx interrupt in the middle of this would result + // in a bad CR state. + cyg_drv_interrupt_mask(sh_chan->rx_int_num); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR_TIE; // Enable xmit interrupt + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); +} + +// Disable the transmitter on the device +static void +sh_serial_stop_xmit(serial_channel *chan) +{ + cyg_uint8 _scr; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + + sh_chan->tx_enabled = false; + + // Mask the interrupts (all sources of the unit) while changing + // the CR since a rx interrupt in the middle of this would result + // in a bad CR state. + cyg_drv_interrupt_mask(sh_chan->rx_int_num); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR_TIE; // Disable xmit interrupt + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); +} + +// Serial I/O - low level tx interrupt handler (ISR) +static cyg_uint32 +sh_serial_tx_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR_TIE; // mask out tx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level tx interrupt handler (DSR) +static void +sh_serial_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + + (chan->callbacks->xmt_char)(chan); + + if (sh_chan->tx_enabled) { + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR_TIE; // unmask tx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + } +} + +// Serial I/O - low level RX interrupt handler (ISR) +static cyg_uint32 +sh_serial_rx_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level rx interrupt handler (DSR) +static void +sh_serial_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _ssr, _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); + if (_ssr & CYGARC_REG_SCSSR_RDRF) { + cyg_uint8 _c; + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCRDR, _c); + // Clear buffer full flag. + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, + CYGARC_REG_SCSSR_CLEARMASK & ~CYGARC_REG_SCSSR_RDRF); + + (chan->callbacks->rcv_char)(chan, _c); + } + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR_RIE; // unmask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); +} + +static volatile int sh_serial_error_orer = 0; +static volatile int sh_serial_error_fer = 0; +static volatile int sh_serial_error_per = 0; + +// Serial I/O - low level error interrupt handler (ISR) +static cyg_uint32 +sh_serial_er_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR_RIE; // mask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSCR, _scr); + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level error interrupt handler (DSR) +static void +sh_serial_er_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv; + cyg_uint8 _ssr, _ssr2; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr); + _ssr2 = CYGARC_REG_SCSSR_CLEARMASK; + + if (_ssr & CYGARC_REG_SCSSR_ORER) { + _ssr2 &= ~CYGARC_REG_SCSSR_ORER; + sh_serial_error_orer++; + } + if (_ssr & CYGARC_REG_SCSSR_FER) { + _ssr2 &= ~CYGARC_REG_SCSSR_FER; + sh_serial_error_fer++; + } + if (_ssr & CYGARC_REG_SCSSR_PER) { + _ssr2 &= ~CYGARC_REG_SCSSR_PER; + sh_serial_error_per++; + } + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCI_SCSSR, _ssr2); +} + +#endif // ifdef CYGDAT_IO_SERIAL_SH_SCI_INL
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/scif/current/ChangeLog @@ -0,0 +1,112 @@ +2000-09-05 Jesper Skov <jskov@redhat.com> + + * src/sh_scif_serial.c: Moved to separate SCIF package. + * ChangeLog: Cleaned out all non-SCIF related entries. + +2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> + + * src/sh3_scif_serial.c (sh3_scif_set_config): Now use keys to make + more flexible. + +2000-06-22 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/<yournamehere>.cdl: Remove the comment on the empty + include_files directive; the tools now support this correctly. + This keeps internal include files internal. + +2000-04-11 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/ser_sh_scif.cdl: Change the parent from CYGPKG_IO_SERIAL + (which is enabled most of the time) to CYGPKG_IO_SERIAL_DEVICES + (which is not...) thus allowing convenient control independent of + platform. Also enable all individual devices by default, now, so + that they can be enabled simply by enabling the above new parent. + +2000-04-11 Jesper Skov <jskov@redhat.com> + + * src/sh3_scif_serial.c: Can't get input FIFO to work properly. + Disabled for now. + +2000-04-07 Hugo Tyson <hmt@cygnus.co.uk> + + * ecos.db: Re-organize device packages. This is a massive change + involving deleting all the sources for serial and ethernet drivers + from where they used to live in + packages/io/serial/current/src/ARCH/PLATFORM.[ch] + packages/net/drivers/eth/PLATFORM/current/src/... + and reinstating them in + packages/devs/serial/ARCH/PLATFORM/current/src/... + packages/devs/eth/ARCH/PLATFORM/current/src/... + + All these new packages are properly defined in ecos.db, and are + all of type "hardware" so that a "target" can grab them. + + This directory layout is descriptive of the devices we have right + now, arch and platform are separate levels just to make it easier + to navigate in the filesystem and similar to the HAL structure in + the filesystem. + + It is *not* prescriptive of future work; for example, the mythical + common highly-portable 16550 serial driver which works on many + targets would be called "devs/serial/s16550/current", or a serial + device for a particular board (cogent springs to mind) that can + work with different CPUs fitted is "devs/serial/cogent/current". + + Changelogs have been preserved and replicated over all the new + packages, so that no history is lost. + + The contents of individual source files are unchanged; they build + in just the same emvironment except for a very few cases where the + config file name changed in this movement. + + Targets in ecos.db have been redefined to bring in all relevant + hardware packages including net and serial drivers (but the newly + included packages are only active if their desired parent is + available.) + + The names of CDL options (and their #defines of course) stay the + same for the serial drivers, for backward compatibility. + + * templates/*/current.ect: these have had CYGPKG_IO_SERIAL added + rather than it being in (almost) all target definitions. + +2000-04-10 Jesper Skov <jskov@redhat.com> + + * src/sh/sh3_scif_serial.c: + Working, but FIFO isn't enabled due to an interrupt problem. + +2000-04-04 Jesper Skov <jskov@redhat.com> + + * src/sh/sh3_scif_serial.c: FIFO related changes. + +2000-04-03 Jesper Skov <jskov@redhat.com> + + * cdl/ser_sh_scif.cdl: + * src/sh/sh_scif_serial.c: + Added SCIF driver, based on SCI driver. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//===========================================================================
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/scif/current/cdl/ser_sh_scif.cdl @@ -0,0 +1,103 @@ +# ==================================================================== +# +# ser_sh_scif.cdl +# +# eCos serial SH/SCIF configuration data +# +# ==================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Red Hat eCos Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.redhat.com/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Configurable Operating System, +# released September 30, 1998. +# +# The Initial Developer of the Original Code is Red Hat. +# Portions created by Red Hat are +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +# All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): jskov +# Contributors: +# Date: 2000-04-04 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + + +cdl_package CYGPKG_IO_SERIAL_SH_SCIF { + display "SH SCIF serial device drivers" + + parent CYGPKG_IO_SERIAL_DEVICES + active_if CYGPKG_IO_SERIAL + active_if CYGPKG_HAL_SH + + active_if CYGINT_IO_SERIAL_SH_SCIF_REQUIRED + + requires CYGPKG_ERROR + include_dir cyg/io + include_files ; # none _exported_ whatsoever + description " + This option enables the serial device drivers for the + SCIF module in Hitachi SH CPUs." + doc redirect/ecos-device-drivers.html + + compile -library=libextras.a sh_scif_serial.c + + define_proc { + puts $::cdl_system_header "/***** serial driver proc output start *****/" + puts $::cdl_system_header "#define CYGDAT_IO_SERIAL_DEVICE_HEADER <pkgconf/io_serial_sh_scif.h>" + puts $::cdl_system_header "/***** serial driver proc output end *****/" + + puts $::cdl_header "#include <pkgconf/system.h>"; + puts $::cdl_header "#include CYGDAT_IO_SERIAL_SH_SCIF_CFG"; + } + + cdl_component CYGPKG_IO_SERIAL_SH_SCIF_OPTIONS { + display "SCIF serial device driver build options" + flavor none + description " + Package specific build options including control over + compiler flags used only in building this package, + and details of which tests are built." + + + cdl_option CYGPKG_IO_SERIAL_SH_SCIF_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + used in addition to the set of global flags." + } + + cdl_option CYGPKG_IO_SERIAL_SH_SCIF_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building these serial device drivers. These flags are + removed from the set of global flags if present." + } + } +} +# EOF ser_sh_scif.cdl
new file mode 100644 --- /dev/null +++ b/packages/devs/serial/sh/scif/current/src/sh_scif_serial.c @@ -0,0 +1,527 @@ +//========================================================================== +// +// io/serial/sh/scif/sh_scif_serial.c +// +// SH Serial IRDA/SCIF I/O Interface Module (interrupt driven) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:gthomas, jskov +// Date: 2000-04-04 +// Purpose: SH3 Serial IRDA/SCIF I/O module (interrupt driven version) +// Description: +// +//####DESCRIPTIONEND#### +//========================================================================== + +#include <pkgconf/io_serial.h> +#include <pkgconf/io.h> + +#include <cyg/io/io.h> +#include <cyg/hal/hal_intr.h> +#include <cyg/io/devtab.h> +#include <cyg/infra/diag.h> +#include <cyg/io/serial.h> + +#include <cyg/hal/sh_regs.h> + +// Only compile driver if an inline file with driver details was selected. +#ifdef CYGDAT_IO_SERIAL_SH_SCIF_INL + +// The SCIF controller register layout on the SH3 +// The controller base is defined in the board specification file. +#define SCIF_SCSMR 0 // serial mode register +#define SCIF_SCBRR 2 // bit rate register +#define SCIF_SCSCR 4 // serial control register +#define SCIF_SCFTDR 6 // transmit data register +#define SCIF_SCSSR 8 // serial status register +#define SCIF_SCFRDR 10 // receive data register +#define SCIF_SCFCR 12 // FIFO control +#define SCIF_SCFDR 14 // FIFO data count register + +static short select_word_length[] = { + -1, + -1, + CYGARC_REG_SCSMR2_CHR, // 7 bits + 0 // 8 bits +}; + +static short select_stop_bits[] = { + -1, + 0, // 1 stop bit + -1, + CYGARC_REG_SCSMR2_STOP // 2 stop bits +}; + +static short select_parity[] = { + 0, // No parity + CYGARC_REG_SCSMR2_PE, // Even parity + CYGARC_REG_SCSMR2_PE|CYGARC_REG_SCSMR2_OE, // Odd parity + -1, + -1 +}; + +static unsigned short select_baud[] = { + 0, // Unused + CYGARC_SCBRR2_CKSx(50)<<8 | CYGARC_SCBRR2_N(50), + CYGARC_SCBRR2_CKSx(75)<<8 | CYGARC_SCBRR2_N(75), + CYGARC_SCBRR2_CKSx(110)<<8 | CYGARC_SCBRR2_N(110), + CYGARC_SCBRR2_CKSx(134)<<8 | CYGARC_SCBRR2_N(134), + CYGARC_SCBRR2_CKSx(150)<<8 | CYGARC_SCBRR2_N(150), + CYGARC_SCBRR2_CKSx(200)<<8 | CYGARC_SCBRR2_N(200), + CYGARC_SCBRR2_CKSx(300)<<8 | CYGARC_SCBRR2_N(300), + CYGARC_SCBRR2_CKSx(600)<<8 | CYGARC_SCBRR2_N(600), + CYGARC_SCBRR2_CKSx(1200)<<8 | CYGARC_SCBRR2_N(1200), + CYGARC_SCBRR2_CKSx(1800)<<8 | CYGARC_SCBRR2_N(1800), + CYGARC_SCBRR2_CKSx(2400)<<8 | CYGARC_SCBRR2_N(2400), + CYGARC_SCBRR2_CKSx(3600)<<8 | CYGARC_SCBRR2_N(3600), + CYGARC_SCBRR2_CKSx(4800)<<8 | CYGARC_SCBRR2_N(4800), + CYGARC_SCBRR2_CKSx(7200)<<8 | CYGARC_SCBRR2_N(7200), + CYGARC_SCBRR2_CKSx(9600)<<8 | CYGARC_SCBRR2_N(9600), + CYGARC_SCBRR2_CKSx(14400)<<8 | CYGARC_SCBRR2_N(14400), + CYGARC_SCBRR2_CKSx(19200)<<8 | CYGARC_SCBRR2_N(19200), + CYGARC_SCBRR2_CKSx(38400)<<8 | CYGARC_SCBRR2_N(38400), + CYGARC_SCBRR2_CKSx(57600)<<8 | CYGARC_SCBRR2_N(57600), + CYGARC_SCBRR2_CKSx(115200)<<8 | CYGARC_SCBRR2_N(115200), + CYGARC_SCBRR2_CKSx(230400)<<8 | CYGARC_SCBRR2_N(230400) +}; + +typedef struct sh3_scif_info { + CYG_WORD er_int_num, // Error interrupt number + rx_int_num, // Receive interrupt number + tx_int_num; // Transmit interrupt number + + CYG_ADDRWORD ctrl_base; // Base address of SCI controller + + cyg_interrupt serial_er_interrupt, + serial_rx_interrupt, + serial_tx_interrupt; + cyg_handle_t serial_er_interrupt_handle, + serial_rx_interrupt_handle, + serial_tx_interrupt_handle; + + bool tx_enabled; + + int error_orer; + int error_fer; + int error_per; + +} sh3_scif_info; + +static bool sh3_scif_init(struct cyg_devtab_entry *tab); +static bool sh3_scif_putc(serial_channel *chan, unsigned char c); +static Cyg_ErrNo sh3_scif_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name); +static unsigned char sh3_scif_getc(serial_channel *chan); +static Cyg_ErrNo sh3_scif_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len); +static void sh3_scif_start_xmit(serial_channel *chan); +static void sh3_scif_stop_xmit(serial_channel *chan); + +static cyg_uint32 sh3_scif_tx_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh3_scif_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); +static cyg_uint32 sh3_scif_rx_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh3_scif_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); +static cyg_uint32 sh3_scif_er_ISR(cyg_vector_t vector, cyg_addrword_t data); +static void sh3_scif_er_DSR(cyg_vector_t vector, cyg_ucount32 count, + cyg_addrword_t data); + +static SERIAL_FUNS(sh3_scif_funs, + sh3_scif_putc, + sh3_scif_getc, + sh3_scif_set_config, + sh3_scif_start_xmit, + sh3_scif_stop_xmit + ); + +// Get the board specification +#include CYGDAT_IO_SERIAL_SH_SCIF_INL + +// Internal function to actually configure the hardware to desired baud rate, +// etc. +static bool +sh3_scif_config_port(serial_channel *chan, cyg_serial_info_t *new_config, + bool init) +{ + cyg_uint16 baud_divisor = select_baud[new_config->baud]; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint8 _scr, _smr; + cyg_uint16 _sr; + CYG_ADDRWORD base = sh_chan->ctrl_base; + + // Check configuration request + if ((-1 == select_word_length[(new_config->word_length - + CYGNUM_SERIAL_WORD_LENGTH_5)]) + || -1 == select_stop_bits[new_config->stop] + || -1 == select_parity[new_config->parity] + || baud_divisor == 0) + return false; + + // Disable SCI interrupts while changing hardware + HAL_READ_UINT8(base+SCIF_SCSCR, _scr); + HAL_WRITE_UINT8(base+SCIF_SCSCR, 0); + + // Reset FIFO. + HAL_WRITE_UINT8(base+SCIF_SCFCR, + CYGARC_REG_SCFCR2_TFRST|CYGARC_REG_SCFCR2_RFRST); + + // Set databits, stopbits and parity. + _smr = select_word_length[(new_config->word_length - + CYGNUM_SERIAL_WORD_LENGTH_5)] | + select_stop_bits[new_config->stop] | + select_parity[new_config->parity]; + HAL_WRITE_UINT8(base+SCIF_SCSMR, _smr); + + // Set baud rate. + _smr &= ~CYGARC_REG_SCSMR2_CKSx_MASK; + _smr |= baud_divisor >> 8; + HAL_WRITE_UINT8(base+SCIF_SCSMR, _smr); + HAL_WRITE_UINT8(base+SCIF_SCBRR, baud_divisor & 0xff); + + // FIXME: Should delay 1/<baud> second here. + + // Clear the status register (clear first). + HAL_READ_UINT16(base+SCIF_SCSSR, _sr); + HAL_WRITE_UINT16(base+SCIF_SCSSR, 0); + + // Bring FIFO out of reset and set FIFO trigger marks + // FIXME: Can't get input FIFO work. Never generates any interrupts + // as far as I can tell. + HAL_WRITE_UINT8(base+SCIF_SCFCR, + CYGARC_REG_SCFCR2_RTRG_1|CYGARC_REG_SCFCR2_TTRG_4); + + if (init) { + // Always enable transmitter and receiver. + _scr = CYGARC_REG_SCSCR2_TE | CYGARC_REG_SCSCR2_RE; + + if (chan->out_cbuf.len != 0) + _scr |= CYGARC_REG_SCSCR2_TIE; // enable tx interrupts + + if (chan->in_cbuf.len != 0) + _scr |= CYGARC_REG_SCSCR2_RIE; // enable rx interrupts + } + + HAL_WRITE_UINT8(base+SCIF_SCSCR, _scr); + + if (new_config != &chan->config) { + chan->config = *new_config; + } + return true; +} + +// Function to initialize the device. Called at bootstrap time. +static bool +sh3_scif_init(struct cyg_devtab_entry *tab) +{ + serial_channel *chan = (serial_channel *)tab->priv; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; +#ifdef CYGDBG_IO_INIT + diag_printf("SH SERIAL init - dev: %x.%d\n", + sh_chan->ctrl_base, sh_chan->rx_int_num); +#endif + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + + if (chan->out_cbuf.len != 0) { + cyg_drv_interrupt_create(sh_chan->tx_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh3_scif_tx_ISR, + sh3_scif_tx_DSR, + &sh_chan->serial_tx_interrupt_handle, + &sh_chan->serial_tx_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_tx_interrupt_handle); + cyg_drv_interrupt_unmask(sh_chan->tx_int_num); + sh_chan->tx_enabled = false; + } + if (chan->in_cbuf.len != 0) { + // Receive interrupt + cyg_drv_interrupt_create(sh_chan->rx_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh3_scif_rx_ISR, + sh3_scif_rx_DSR, + &sh_chan->serial_rx_interrupt_handle, + &sh_chan->serial_rx_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_rx_interrupt_handle); + // Receive error interrupt + cyg_drv_interrupt_create(sh_chan->er_int_num, + 3, + (cyg_addrword_t)chan, // Data item passed to interrupt handler + sh3_scif_er_ISR, + sh3_scif_er_DSR, + &sh_chan->serial_er_interrupt_handle, + &sh_chan->serial_er_interrupt); + cyg_drv_interrupt_attach(sh_chan->serial_er_interrupt_handle); + // This unmasks both interrupt sources. + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); + } + sh3_scif_config_port(chan, &chan->config, true); + return true; +} + +// This routine is called when the device is "looked" up (i.e. attached) +static Cyg_ErrNo +sh3_scif_lookup(struct cyg_devtab_entry **tab, + struct cyg_devtab_entry *sub_tab, + const char *name) +{ + serial_channel *chan = (serial_channel *)(*tab)->priv; + + // Really only required for interrupt driven devices + (chan->callbacks->serial_init)(chan); + return ENOERR; +} + +// Send a character to the device output buffer. +// Return 'true' if character is sent to device +static bool +sh3_scif_putc(serial_channel *chan, unsigned char c) +{ + cyg_uint16 _fdr, _sr; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCFDR, _fdr); + if (((_fdr & CYGARC_REG_SCFDR2_TCOUNT_MASK) >> CYGARC_REG_SCFDR2_TCOUNT_shift) < 15) { +// Transmit FIFO has room for another char + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCFTDR, c); + // Clear FIFO-empty/transmit end flags (read back sr first) + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _sr); + HAL_WRITE_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, + CYGARC_REG_SCSSR2_CLEARMASK & ~CYGARC_REG_SCSSR2_TDFE); + return true; + } else { +// No space + return false; + } +} + +// Fetch a character from the device input buffer, waiting if necessary +// Note: Input is running wo FIFO enabled, so the counter is not checked here. +static unsigned char +sh3_scif_getc(serial_channel *chan) +{ + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + unsigned char c; + cyg_uint16 _sr; + + do { + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _sr); + } while ((_sr & CYGARC_REG_SCSSR2_RDF) == 0); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCFRDR, c); + + // Clear buffer full flag (read back first) + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _sr); + HAL_WRITE_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, + CYGARC_REG_SCSSR2_CLEARMASK & ~CYGARC_REG_SCSSR2_RDF); + + return c; +} + +// Set up the device characteristics; baud rate, etc. +static Cyg_ErrNo +sh3_scif_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len) +{ + switch (key) { + case CYG_IO_SET_CONFIG_SERIAL_INFO: + { + cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; + if ( *len < sizeof(cyg_serial_info_t) ) { + return -EINVAL; + } + *len = sizeof(cyg_serial_info_t); + if ( true != sh3_scif_config_port(chan, config, false) ) + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return ENOERR; +} + +// Enable the transmitter on the device +static void +sh3_scif_start_xmit(serial_channel *chan) +{ + cyg_uint8 _scr; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + + // Mask the interrupts (all sources of the unit) while changing + // the CR since a rx interrupt in the middle of this would result + // in a bad CR state. + cyg_drv_interrupt_mask(sh_chan->rx_int_num); + + sh_chan->tx_enabled = true; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR2_TIE; // Enable xmit interrupt + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); +} + +// Disable the transmitter on the device +static void +sh3_scif_stop_xmit(serial_channel *chan) +{ + cyg_uint8 _scr; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + + // Mask the interrupts (all sources of the unit) while changing + // the CR since a rx interrupt in the middle of this would result + // in a bad CR state. + cyg_drv_interrupt_mask(sh_chan->rx_int_num); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR2_TIE; // Disable xmit interrupt + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + + sh_chan->tx_enabled = false; + + cyg_drv_interrupt_unmask(sh_chan->rx_int_num); +} + +// Serial I/O - low level tx interrupt handler (ISR) +static cyg_uint32 +sh3_scif_tx_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR2_TIE; // mask out tx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level tx interrupt handler (DSR) +static void +sh3_scif_tx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + + (chan->callbacks->xmt_char)(chan); + + if (sh_chan->tx_enabled) { + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR2_TIE; // unmask tx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + } +} + +// Serial I/O - low level RX interrupt handler (ISR) +static cyg_uint32 +sh3_scif_rx_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR2_RIE; // mask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level rx interrupt handler (DSR) +static void +sh3_scif_rx_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint8 _scr; + cyg_uint16 _fdr, _sr; + + // Read char + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCFDR, _fdr); + if ((_fdr & CYGARC_REG_SCFDR2_RCOUNT_MASK) != 0) { + cyg_uint8 _c; + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCFRDR, _c); + (chan->callbacks->rcv_char)(chan, _c); + + } + + // Clear buffer full flag (read back first) + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _sr); + HAL_WRITE_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, + CYGARC_REG_SCSSR2_CLEARMASK & ~CYGARC_REG_SCSSR2_RDF); + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr |= CYGARC_REG_SCSCR2_RIE; // unmask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); +} + +// Serial I/O - low level error interrupt handler (ISR) +static cyg_uint32 +sh3_scif_er_ISR(cyg_vector_t vector, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint8 _scr; + + HAL_READ_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + _scr &= ~CYGARC_REG_SCSCR2_RIE; // mask rx interrupts + HAL_WRITE_UINT8(sh_chan->ctrl_base+SCIF_SCSCR, _scr); + return CYG_ISR_CALL_DSR; // Cause DSR to be run +} + +// Serial I/O - high level error interrupt handler (DSR) +static void +sh3_scif_er_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + serial_channel *chan = (serial_channel *)data; + sh3_scif_info *sh_chan = (sh3_scif_info *)chan->dev_priv; + cyg_uint16 _ssr, _ssr2; + + HAL_READ_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _ssr); + _ssr2 = CYGARC_REG_SCSSR_CLEARMASK; + + if (_ssr & CYGARC_REG_SCSSR2_FER) { + _ssr2 &= ~CYGARC_REG_SCSSR2_FER; + sh_chan->error_fer++; + } + if (_ssr & CYGARC_REG_SCSSR2_PER) { + _ssr2 &= ~CYGARC_REG_SCSSR2_PER; + sh_chan->error_per++; + } + HAL_WRITE_UINT16(sh_chan->ctrl_base+SCIF_SCSSR, _ssr2); +} + +#endif // ifdef CYGDAT_IO_SERIAL_SH_SCIF_INL
--- a/packages/devs/serial/v85x/v850/current/ChangeLog +++ b/packages/devs/serial/v85x/v850/current/ChangeLog @@ -1,3 +1,13 @@ +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * src/v85x_v850_serial.h: + * src/v85x_v850_serial.c: Better handling of V850 variants (SA1,SB1) + +2000-08-31 Gary Thomas <gthomas@redhat.com> + + * src/v85x_v850_serial.c (v850_serial_config_port): Better handling + of cpu xtal frequency for baud rate calculations. + 2000-08-01 Jonathan Larmour <jlarmour@redhat.co.uk> * src/v85x_v850_serial.c (v850_serial_set_config): Now use keys to make
--- a/packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c +++ b/packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c @@ -45,6 +45,7 @@ #include <pkgconf/io_serial.h> #include <pkgconf/io.h> #include <pkgconf/kernel.h> +#include CYGBLD_HAL_TARGET_H #include <cyg/io/io.h> #include <cyg/hal/hal_intr.h> @@ -143,6 +144,8 @@ v850_serial_config_port(serial_channel * unsigned char parity = select_parity[new_config->parity]; unsigned char word_length = select_word_length[new_config->word_length-CYGNUM_SERIAL_WORD_LENGTH_5]; unsigned char stop_bits = select_stop_bits[new_config->stop]; + int mode, count; + if ((select_baud[new_config->baud].count == 0) || (word_length == 0xFF) || (parity == 0xFF) || @@ -150,8 +153,19 @@ v850_serial_config_port(serial_channel * return false; // Unsupported configuration } port->asim = ASIM_TxRx_Tx | ASIM_TxRx_Rx | parity | word_length | stop_bits; - port->brgc = select_baud[new_config->baud].count; - port->brgm = select_baud[new_config->baud].mode + 1; + mode = select_baud[new_config->baud].mode + 1; + count = select_baud[new_config->baud].count; + while (count > 0xFF) { + count >>= 1; + mode <<= 1; + } + port->brgc = count; +#if CYGINT_HAL_V85X_VARIANT_SB1 + port->brgm = mode & 0x07; + port->brgm1 = mode >> 3; +#else + port->brgm = mode; +#endif if (new_config != &chan->config) { chan->config = *new_config; }
--- a/packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.h +++ b/packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.h @@ -44,7 +44,10 @@ // // ==================================================================== -// Description of serial ports on NEC CEB/V850SA1 +// Description of serial ports on NEC V850/SA1 & SB1 + +#include <pkgconf/system.h> +#include CYGBLD_HAL_TARGET_H #include <cyg/hal/v850_common.h> @@ -61,6 +64,10 @@ struct serial_port { unsigned char _filler4[5]; unsigned char brgm; // Baud rate mode unsigned char _filler5; +#if CYGINT_HAL_V85X_VARIANT_SB1 + unsigned char _filler6[0x10]; + unsigned char brgm1; // Baud rate overflow +#endif }; // Relative interrupt numbers @@ -118,6 +125,32 @@ static struct v850_baud { unsigned char count; unsigned char mode; } select_baud[] = { +#if CYGINT_HAL_V85X_VARIANT_SB1 +// Baud rate values, using defined system clock +#define BAUD_COUNT (CYGHWR_HAL_V85X_V850_BOARD_FREQUENCY)/19200 + {0, 0}, // Unused + {0, 0}, // 50 + {0, 0}, // 75 + {0, 0}, // 110 + {0, 0}, // 134.5 + {0, 0}, // 150 + {0, 0}, // 200 + {0, 0}, // 300 + {0, 0}, // 600 + {BAUD_COUNT, 5}, // 1200 + {0, 0}, // 1800 + {BAUD_COUNT, 4}, // 2400 + {0, 0}, // 3600 + {BAUD_COUNT, 3}, // 4800 + {0, 0}, // 7200 + {BAUD_COUNT, 2}, // 9600 + {0, 0}, // 14400 + {BAUD_COUNT, 1}, // 19200 + {BAUD_COUNT, 0}, // 38400 + {0, 0}, // 57600 + {0, 0}, // 115200 + {0, 0}, // 230400 +#else // Baud rate values, based on raw 17MHz clock {0, 0}, // Unused {0, 0}, // 50 @@ -141,6 +174,7 @@ static struct v850_baud { {0, 0}, // 57600 {0, 0}, // 115200 {0, 0}, // 230400 +#endif }; #endif // CYGONCE_V85X_V850_SERIAL_H
--- a/packages/ecos.db +++ b/packages/ecos.db @@ -266,6 +266,24 @@ package CYGPKG_IO_SERIAL_I386_PC { description "PC serial device drivers" } +package CYGPKG_IO_SERIAL_SH_SCI { + alias { "SH SCI serial device drivers" + devs_serial_sh_sci sci_serial_driver } + hardware + directory devs/serial/sh/sci + script ser_sh_sci.cdl + description "SH SCI serial device drivers" +} + +package CYGPKG_IO_SERIAL_SH_SCIF { + alias { "SH SCIF serial device drivers" + devs_serial_sh_scif scif_serial_driver } + hardware + directory devs/serial/sh/scif + script ser_sh_scif.cdl + description "SH SCIF serial device drivers" +} + package CYGPKG_IO_SERIAL_SH_EDK7708 { alias { "SH3 EDK7708 serial device drivers" devs_serial_sh3_edk7708 @@ -885,6 +903,7 @@ package CYGPKG_HAL_POWERPC_PPC60x { for this processor variant. It is also necessary to select a specific target platform HAL package." } + package CYGPKG_HAL_POWERPC_COGENT { alias { "Cogent CMA286/287 board" hal_powerpc_cogent powerpc_cogent_hal } directory hal/powerpc/cogent @@ -1219,6 +1238,7 @@ target sh7708 { packages { CYGPKG_HAL_SH CYGPKG_HAL_SH_EDK7708 CYGPKG_DEVICES_WALLCLOCK_SH3 + CYGPKG_IO_SERIAL_SH_SCI CYGPKG_IO_SERIAL_SH_EDK7708 CYGPKG_DEVICES_WATCHDOG_SH_SH3 } @@ -1231,6 +1251,7 @@ target cq7708 { alias { "CqREEK SH7708 board" cq7708 } packages { CYGPKG_HAL_SH CYGPKG_HAL_SH_SH7708_CQ7708 + CYGPKG_IO_SERIAL_SH_SCI CYGPKG_IO_SERIAL_SH_CQ7708 } description " @@ -1310,6 +1331,7 @@ target fads { The fads target provides the packages needed to run eCos on a Motorola MPC8xxFADS board." } + target mbx { alias { "Motorola MBX860/821 board" mbx860 mbx821 } packages { CYGPKG_HAL_POWERPC
--- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-05 Andrew Lunn <andrew.lunn@ascom.ch> + + * include/basetype.h: Override the alignment macros for the ARM + architecture. The ARM compiler only alows a maximum of 4 bytes + of alignment where as the default is 8 + 2000-08-15 Hugo Tyson <hmt@cygnus.co.uk> * src/arm.ld (SECTION_text): Change it back so that
--- a/packages/hal/arm/arch/current/include/basetype.h +++ b/packages/hal/arm/arch/current/include/basetype.h @@ -60,6 +60,13 @@ //#define CYG_LABEL_NAME(_name_) _name_ //----------------------------------------------------------------------------- +// Override the alignment definitions from cyg_type.h. ARM only alows 4 +// bytes alignment where as the default is 8 byte. + +#define CYGARC_ALIGNMENT 4 +#define CYGARC_P2ALIGNMENT 2 + +//----------------------------------------------------------------------------- // Define the standard variable sizes // The ARM architecture uses the default definitions of the base types,
--- a/packages/hal/arm/ebsa285/current/ChangeLog +++ b/packages/hal/arm/ebsa285/current/ChangeLog @@ -1,3 +1,27 @@ +2000-09-06 Hugo Tyson <hmt@cygnus.co.uk> + + * cdl/hal_arm_ebsa285.cdl (CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE + CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE): Add strong constraints + to the alignment and size of the PCI window by means of + legal_values lists so that runtime can check that the MLTs opinion + of the memory usage is valid. [This is related to CR 902624-CR, + "MLT needs to be configuration aware"] + + * include/pkgconf/mlt_arm_ebsa285_ram.h: + * include/pkgconf/mlt_arm_ebsa285_ram.ldi: + * include/pkgconf/mlt_arm_ebsa285_ram.mlt: + * include/pkgconf/mlt_arm_ebsa285_rom.h: + * include/pkgconf/mlt_arm_ebsa285_rom.ldi: + * include/pkgconf/mlt_arm_ebsa285_rom.mlt: + Regenerate these from the MLT featuring a "pci_window" section in + order to prevent the greedy heap code comsuming all of memory. + The pci_window section is from 0xf00000 of size 0x100000 + i.e. Megabyte number 15, at the top of (default) memory. + Unfortunately my previous quick fix (2000-08-15) for this had not + in fact worked, because of the "clever" code which looks for + add-in memory and consumes *that* too, unconditionally... [This + is related to CR 902624-CR, "MLT needs to be configuration aware"] + 2000-08-18 Hugo Tyson <hmt@cygnus.co.uk> * include/hal_platform_setup.h: Initialize the world if you are
--- a/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl +++ b/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl @@ -81,27 +81,45 @@ cdl_package CYGPKG_HAL_ARM_EBSA285 { cdl_option CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE { display "Base of memory accessible via PCI space" flavor data - legal_values 0 to 0x01000000 + legal_values { 0x200000 0x300000 0x400000 0x500000 + 0x600000 0x700000 0x800000 0x900000 + 0xa00000 0xb00000 0xc00000 0xd00000 + 0xe00000 0xf00000 + } default_value 0x00f00000 active_if CYGPKG_IO_PCI description " This option determines the base of the EBSA memory which can be accessed via the PCI bus. The default is to allow - access to the upper 1MB of a 16MB system. Change in 256kB - increments." + access to the upper 1MB of a 16MB system. + NB: We advise *against* changing this option. + The value MUST match the base address of the section + 'pci_window' in the Memory Layout Tool else this memory area + will be consumed by the malloc heap. + This error condition can only be detected at runtime in + current versions of the configuration tools. + CLI users can edit include/pkgconf/mlt_arm_ebsa285_*.h + and include/pkgconf/mlt_arm_ebsa285_*.ldi to acheive the + same effects as moving that region in the MLT." } cdl_option CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE { display "Size of memory accessible via PCI space" flavor data - legal_values 0 to 0x01000000 + legal_values { 0x100000 0x200000 0x300000 0x400000 + 0x500000 0x600000 0x700000 0x800000 + } default_value 0x00100000 active_if CYGPKG_IO_PCI description " This option determines the size of the EBSA memory which can be accessed via the PCI bus. The default is to allow - access to the upper 1MB of a 16MB system. Change in 256kB - increments." + access to the upper 1MB of a 16MB system. + NB: We advise *against* changing this option. + The value MUST match the size of the section 'pci_window' in the + Memory Layout Tool else this memory area will be consumed by the + malloc heap. + Further caveats in the PCI base option." } cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.h +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.h @@ -1,27 +1,22 @@ -// eCos memory layout - Tue Jul 25 19:44:27 2000 +// eCos memory layout - Tue Sep 05 16:58:21 2000 -// This is a generated file - do not edit - ho ho ho. +// This is a generated file - do not edit +#ifndef __ASSEMBLER__ #include <cyg/infra/cyg_type.h> #include <stddef.h> -#include <pkgconf/system.h> -#include CYGBLD_HAL_PLATFORM_H - +#endif #define CYGMEM_REGION_ram (0) - -#ifndef CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE -// Then no PCI window is to be reserved. #define CYGMEM_REGION_ram_SIZE (0x1000000) -#else -// Do not trample the PCI window: -#define CYGMEM_REGION_ram_SIZE CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) +#ifndef __ASSEMBLER__ +extern char CYG_LABEL_NAME (__heap1) []; #endif - -#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) - -extern char CYG_LABEL_NAME (__heap1) []; #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) -#define CYGMEM_SECTION_heap1_SIZE \ - (CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1)) - +#define CYGMEM_SECTION_heap1_SIZE (0xf00000 - (size_t) CYG_LABEL_NAME (__heap1)) +#ifndef __ASSEMBLER__ +extern char CYG_LABEL_NAME (__pci_window) []; +#endif +#define CYGMEM_SECTION_pci_window (CYG_LABEL_NAME (__pci_window)) +#define CYGMEM_SECTION_pci_window_SIZE (0x100000)
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.ldi +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.ldi @@ -1,4 +1,4 @@ -// eCos memory layout - Tue Jul 25 19:44:27 2000 +// eCos memory layout - Tue Sep 05 16:58:21 2000 // This is a generated file - do not edit @@ -23,5 +23,6 @@ SECTIONS SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); + CYG_LABEL_DEFN(__pci_window) = 0xf00000; . = CYG_LABEL_DEFN(__pci_window) + 0x100000; SECTIONS_END }
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.mlt +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_ram.mlt @@ -11,3 +11,4 @@ section gcc_except_table 0 4 0 1 0 1 0 1 section data 0 4 0 1 0 1 0 1 bss bss ! section bss 0 4 0 1 0 1 0 1 heap1 heap1 ! section heap1 0 8 0 0 0 0 0 0 ! +section pci_window 100000 1 0 0 1 0 1 0 f00000 f00000 !This is the memory area that is dual-ported to devices onthe PCI bus. Such devices can read and write this memory areaas their own. Examples include the EBSA-285 Ethernet driver,which receives and transmits packets via this memory area.It must be 1Mb aligned, so that the MMU initialization can arrange for it to be uncacheable.
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.h +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.h @@ -1,31 +1,25 @@ -// eCos memory layout - Tue Jul 25 19:45:02 2000 +// eCos memory layout - Tue Sep 05 18:46:49 2000 -// This is a generated file - do not edit - ho ho ho. +// This is a generated file - do not edit +#ifndef __ASSEMBLER__ #include <cyg/infra/cyg_type.h> #include <stddef.h> -#include <pkgconf/system.h> -#include CYGBLD_HAL_PLATFORM_H - +#endif #define CYGMEM_REGION_ram (0) - -#ifndef CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE -// Then no PCI window is to be reserved. #define CYGMEM_REGION_ram_SIZE (0x1000000) -#else -// Do not trample the PCI window: -#define CYGMEM_REGION_ram_SIZE CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE -#endif - #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) - #define CYGMEM_REGION_rom (0x41000000) #define CYGMEM_REGION_rom_SIZE (0x400000) #define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R) - +#ifndef __ASSEMBLER__ extern char CYG_LABEL_NAME (__heap1) []; +#endif #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) -#define CYGMEM_SECTION_heap1_SIZE \ - (CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1)) - +#define CYGMEM_SECTION_heap1_SIZE (0xf00000 - (size_t) CYG_LABEL_NAME (__heap1)) +#ifndef __ASSEMBLER__ +extern char CYG_LABEL_NAME (__pci_window) []; +#endif +#define CYGMEM_SECTION_pci_window (CYG_LABEL_NAME (__pci_window)) +#define CYGMEM_SECTION_pci_window_SIZE (0x100000)
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.ldi +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.ldi @@ -1,4 +1,4 @@ -// eCos memory layout - Tue Jul 25 19:45:02 2000 +// eCos memory layout - Tue Sep 05 18:46:49 2000 // This is a generated file - do not edit @@ -24,5 +24,6 @@ SECTIONS SECTION_data (ram, 0x8000, FOLLOWING (.gcc_except_table)) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); + CYG_LABEL_DEFN(__pci_window) = 0xf00000; . = CYG_LABEL_DEFN(__pci_window) + 0x100000; SECTIONS_END }
--- a/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.mlt +++ b/packages/hal/arm/ebsa285/current/include/pkgconf/mlt_arm_ebsa285_rom.mlt @@ -5,6 +5,7 @@ section fixed_vectors 0 1 0 1 1 0 1 0 20 section data 0 1 1 1 1 1 0 0 8000 bss ! section bss 0 4 0 1 0 1 0 1 heap1 heap1 ! section heap1 0 8 0 0 0 0 0 0 ! +section pci_window 100000 1 0 0 1 0 1 0 f00000 f00000 !This is the memory area that is dual-ported to devices onthe PCI bus. Such devices can read and write this memory areaas their own. Examples include the EBSA-285 Ethernet driver, which receives and transmits packets via this memory area. It must be 1Mb aligned, so that the MMU initialization can arrange for it to be uncacheable. section rom_vectors 0 1 0 1 1 1 1 1 41000000 41000000 text text ! section text 0 4 0 1 0 1 0 1 fini fini ! section fini 0 4 0 1 0 1 0 1 rodata rodata !
--- a/packages/hal/arm/sa11x0/assabet/current/ChangeLog +++ b/packages/hal/arm/sa11x0/assabet/current/ChangeLog @@ -1,3 +1,16 @@ +2000-09-10 Gary Thomas <gthomas@redhat.com> + + * misc/redhat.xpm: + * misc/escw.xpm: + * misc/eCos.xpm: + * misc/lcd_test.c: Simple test of LCD. + + * include/assabet.h: Add more BCR defines (cosmetic). + + * src/redboot_cmds.c: + * cdl/hal_arm_sa11x0_assabet.cdl: Add RedBoot command to execute + code with MMU off (for booting Linux). + 2000-08-28 Gary Thomas <gthomas@redhat.com> * cdl/hal_arm_sa11x0_assabet.cdl: Define default console [even
--- a/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl +++ b/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl @@ -334,6 +334,8 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_ASSABE no_define description "This option enables the conversion of the Redboot ELF image to a binary image suitable for ROM programming." + + compile -library=libextras.a redboot_cmds.c make -priority 325 { <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
--- a/packages/hal/arm/sa11x0/assabet/current/include/assabet.h +++ b/packages/hal/arm/sa11x0/assabet/current/include/assabet.h @@ -107,6 +107,8 @@ extern unsigned long _assabet_CFG; #define SA1110_BCR_GREEN_LED_ON SA1110_LOGIC_ZERO(SA1110_BCR_GREEN_LED) #define SA1110_BCR_GREEN_LED_OFF SA1110_LOGIC_ONE(SA1110_BCR_GREEN_LED) #define SA1110_BCR_MOTOR 0x00008000 // 1 = Vibrator motor on +#define SA1110_BCR_MOTOR_ON SA1110_LOGIC_ONE(SA1110_BCR_MOTOR) +#define SA1110_BCR_MOTOR_OFF SA1110_LOGIC_ZERO(SA1110_BCR_MOTOR) #define SA1110_BCR_COM_DTR 0x00010000 // COM port Data Terminal Ready #define SA1110_BCR_COM_RTS 0x00020000 // COM port Request To Send #define SA1110_BCR_RADIO_WAKE 0x00040000 // 1 = Wake up CPU with radio
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/misc/eCos.xpm @@ -0,0 +1,254 @@ +/* XPM */ +static char * eCos_xpm[] = { +"320 240 11 1", +" c None", +". c #FFFFFF", +"+ c #C7C7C7", +"@ c #AAAAAA", +"# c #727272", +"$ c #555555", +"% c #1D1D1D", +"& c #000000", +"* c #393939", +"= c #8E8E8E", +"- c #E3E3E3", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"......................................................................................................................................+@#$$$%&&&$$$#@+..........................................................................................................................................................................", +"..................................................................................................................................+#*&&&&&&&&&&&&&&&&&&$=-......................................................................................................................................................................", +"...............................................................................................................................-#%&&&&&&&&&&&&&&&&&&&&&&&&*@....................................................................................................................................................................", +".............................................................................................................................+*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%=..................................................................................................................................................................", +"...........................................................................................................................+*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*-................................................................................................................................................................", +".........................................................................................................................-*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...............................................................................................................................................................", +"........................................................................................................................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$..............................................................................................................................................................", +"......................................................................................................................-*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$.............................................................................................................................................................", +".....................................................................................................................@%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$............................................................................................................................................................", +"....................................................................................................................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...........................................................................................................................................................", +"...................................................................................................................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-..........................................................................................................................................................", +"..................................................................................................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*..........................................................................................................................................................", +".................................................................................................................$&&&&&&&&&&&&&&&&&&&&&&&&&$$*&&&&&&&&&&&&&&&&&&&&&&&&+.........................................................................................................................................................", +"................................................................................................................@&&&&&&&&&&&&&&&&&&&&*#@........+=%&&&&&&&&&&&&&&&&&&&$.........................................................................................................................................................", +"...............................................................................................................@&&&&&&&&&&&&&&&&&&&#-..............+*&&&&&&&&&&&&&&&&&&.........................................................................................................................................................", +"..............................................................................................................+&&&&&&&&&&&&&&&&&&#-..................#&&&&&&&&&&&&&&&&&@........................................................................................................................................................", +".............................................................................................................-%&&&&&&&&&&&&&&&&%+.....................@&&&&&&&&&&&&&&&&$........................................................................................................................................................", +".............................................................................................................$&&&&&&&&&&&&&&&&*-.......................#&&&&&&&&&&&&&&&*........................................................................................................................................................", +"............................................................................................................@&&&&&&&&&&&&&&&&$..........................%&&&&&&&&&&&&&&&........................................................................................................................................................", +"..................................................................@@@$$$$@@@...............................-%&&&&&&&&&&&&&&&$...........................=&&&&&&&&&&&&&&&.............................@@@#$$$$@@@...............................................+@@=$$$$#@@+.....................................................", +".............................................................-@$%&&&&&&&&&&&&%#+...........................#&&&&&&&&&&&&&&&%.............................&&&&&&&&&&&&&&&........................-=$%&&&&&&&&&&&&&%#@......................................-=$%&&&&&&&&&&&&&&%$@.................................................", +"...........................................................=*&&&&&&&&&&&&&&&&&&&%=........................+&&&&&&&&&&&&&&&%-.............................*&&&&&&&&&&&&&&.....................-#%&&&&&&&&&&&&&&&&&&&&%#-................................-=*&&&&&&&&&&&&&&&&&&&&&&#+..............................................", +"........................................................-#&&&&&&&&&&&&&&&&&&&&&&&&%=......................*&&&&&&&&&&&&&&&@..............................$&&&&&&&&&&&&&&...................+*&&&&&&&&&&&&&&&&&&&&&&&&&&#.............................-#&&&&&&&&&&&&&&&&&&&&&&&&&&&$-............................................", +".......................................................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&$-...................+&&&&&&&&&&&&&&&#...............................#&&&&&&&&&&&&&&.................-*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%+..........................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...........................................", +".....................................................+%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-..................*&&&&&&&&&&&&&&%................................@&&&&&&&&&&&&&%................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.......................-*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@..........................................", +"....................................................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-................+&&&&&&&&&&&&&&&=................................@&&&&&&&&&&&&&$..............-*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.....................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.........................................", +"...................................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*................$&&&&&&&&&&&&&&*.............................................................@%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&+........................................", +"..................................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#..............-&&&&&&&&&&&&&&&+............................................................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-.................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*........................................", +".................................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&+.............=&&&&&&&&&&&&&&*............................................................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*.................%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&+.......................................", +"................................................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*.............%&&&&&&&&&&&&&&@...........................................................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=...............#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$.......................................", +"...............................................+&&&&&&&&&&&&&&&&&&&%$$%&&&&&&&&&&&&&&&&&&&+...........+&&&&&&&&&&&&&&%...........................................................-&&&&&&&&&&&&&&&&&&&&%$$%&&&&&&&&&&&&&&&&&&&&%..............+&&&&&&&&&&&&&&&&&&&$$$*&&&&&&&&&&&&&&&&&&&&.......................................", +"..............................................-%&&&&&&&&&&&&&&&%#+......@*&&&&&&&&&&&&&&&&$...........#&&&&&&&&&&&&&&=..........................................................-%&&&&&&&&&&&&&&&&&$@......@$&&&&&&&&&&&&&&&&&&@.............*&&&&&&&&&&&&&&&#@........@$&&&&&&&&&&&&&&&&-......................................", +"..............................................#&&&&&&&&&&&&&&&=...........+%&&&&&&&&&&&&&&&...........%&&&&&&&&&&&&&&-..........................................................$&&&&&&&&&&&&&&&&$-..........+%&&&&&&&&&&&&&&&&$............+&&&&&&&&&&&&&&$-............-%&&&&&&&&&&&&&&@......................................", +".............................................+&&&&&&&&&&&&&&%-.............-%&&&&&&&&&&&&&&@.........+&&&&&&&&&&&&&&*..........................................................@&&&&&&&&&&&&&&&&@.............-%&&&&&&&&&&&&&&&&............*&&&&&&&&&&&&&*...............-%&&&&&&&&&&&&&@......................................", +".............................................*&&&&&&&&&&&&&%-...............=&&&&&&&&&&&&&&$.........=&&&&&&&&&&&&&&=..........................................................%&&&&&&&&&&&&&&%+...............-&&&&&&&&&&&&&&&&+..........-&&&&&&&&&&&&&&+................#&&&&&&&&&&&&&@......................................", +"............................................=&&&&&&&&&&&&&%-.................%&&&&&&&&&&&&&%.........$&&&&&&&&&&&&&&-.........................................................#&&&&&&&&&&&&&&&-.................=&&&&&&&&&&&&&&&@..........@&&&&&&&&&&&&&&.................@&&&&&&&&&&&&&@......................................", +"............................................%&&&&&&&&&&&&&+..................#&&&&&&&&&&&&&&.........&&&&&&&&&&&&&&%.........................................................-&&&&&&&&&&&&&&&@...................&&&&&&&&&&&&&&&#..........$&&&&&&&&&&&&&&.................@&&&&&&&&&&&&&.......................................", +"...........................................=&&&&&&&&&&&&&$...................@&&&&&&&&&&&&&&........+&&&&&&&&&&&&&&$.........................................................#&&&&&&&&&&&&&&#....................$&&&&&&&&&&&&&&$..........*&&&&&&&&&&&&&&=................=$$$$$$$$$$$$$.......................................", +"...........................................*&&&&&&&&&&&&&+...................+&&&&&&&&&&&&&&@.......@&&&&&&&&&&&&&&@........................................................-&&&&&&&&&&&&&&%.....................@&&&&&&&&&&&&&&$..........&&&&&&&&&&&&&&&&#-...................................................................", +"..........................................+&&&&&&&&&&&&&*.....................&&&&&&&&&&&&&&@.......$&&&&&&&&&&&&&&+........................................................=&&&&&&&&&&&&&&+.....................+&&&&&&&&&&&&&&$..........&&&&&&&&&&&&&&&&&&#+.................................................................", +"..........................................$&&&&&&&&&&&&&=.....................&&&&&&&&&&&&&&+.......*&&&&&&&&&&&&&&.........................................................%&&&&&&&&&&&&&*.......................&&&&&&&&&&&&&&$..........&&&&&&&&&&&&&&&&&&&&%$@..............................................................", +"..........................................&&&&&&&&&&&&&&-.....................&&&&&&&&&&&&&&........&&&&&&&&&&&&&&*........................................................+&&&&&&&&&&&&&&+.......................&&&&&&&&&&&&&&$..........%&&&&&&&&&&&&&&&&&&&&&&&*=-..........................................................", +".........................................@&&&&&&&&&&&&&&$$$$$$$$$$$$$$$$$$$$$$&&&&&&&&&&&&&&........&&&&&&&&&&&&&&$........................................................#&&&&&&&&&&&&&*........................&&&&&&&&&&&&&&$..........$&&&&&&&&&&&&&&&&&&&&&&&&&&%#@.......................................................", +".........................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.......@&&&&&&&&&&&&&&$........................................................%&&&&&&&&&&&&&=........................&&&&&&&&&&&&&&@..........+&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$@....................................................", +".........................................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%.......@&&&&&&&&&&&&&&=.......................................................+&&&&&&&&&&&&&&-........................&&&&&&&&&&&&&&@...........*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#+.................................................", +"........................................+&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$.......@&&&&&&&&&&&&&&@.......................................................=&&&&&&&&&&&&&*........................+&&&&&&&&&&&&&&+...........+&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*-...............................................", +"........................................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#.......#&&&&&&&&&&&&&&@.......................................................$&&&&&&&&&&&&&#........................@&&&&&&&&&&&&&&.............@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=..............................................", +"........................................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.......$&&&&&&&&&&&&&&@.......................................................&&&&&&&&&&&&&&@........................@&&&&&&&&&&&&&%..............@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$.............................................", +"........................................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-.......$&&&&&&&&&&&&&&@......................................................+&&&&&&&&&&&&&&-........................$&&&&&&&&&&&&&$...............-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$............................................", +"........................................&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&........$&&&&&&&&&&&&&&@.................................+$$$$$$$$$$$$$$......@&&&&&&&&&&&&&&.........................%&&&&&&&&&&&&&@.................=%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#...........................................", +".......................................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$........$&&&&&&&&&&&&&&@.................................*&&&&&&&&&&&&&$......#&&&&&&&&&&&&&%........................-&&&&&&&&&&&&&&-...................=%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-..........................................", +".......................................@&&&&&&&&&&&&&&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@........$&&&&&&&&&&&&&&$................................-&&&&&&&&&&&&&&@......$&&&&&&&&&&&&&$........................@&&&&&&&&&&&&&%......................@$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#..........................................", +".......................................=&&&&&&&&&&&&&&.............................................$&&&&&&&&&&&&&&$................................#&&&&&&&&&&&&&&-......$&&&&&&&&&&&&&$........................*&&&&&&&&&&&&&#.........................@$&&&&&&&&&&&&&&&&&&&&&&&&&&&&..........................................", +".......................................$&&&&&&&&&&&&&&.............................................$&&&&&&&&&&&&&&%...............................-&&&&&&&&&&&&&&$.......&&&&&&&&&&&&&&$.......................-&&&&&&&&&&&&&&+............................@$&&&&&&&&&&&&&&&&&&&&&&&&&-.........................................", +".......................................$&&&&&&&&&&&&&&.............................................=&&&&&&&&&&&&&&&-..............................#&&&&&&&&&&&&&&@.......&&&&&&&&&&&&&&$.......................#&&&&&&&&&&&&&%................................+#%&&&&&&&&&&&&&&&&&&&&&@.........................................", +".......................................$&&&&&&&&&&&&&&.............................................@&&&&&&&&&&&&&&&=.............................+&&&&&&&&&&&&&&%........&&&&&&&&&&&&&&$......................-&&&&&&&&&&&&&&#...................................+#%&&&&&&&&&&&&&&&&&&@.........................................", +".......................................$&&&&&&&&&&&&&&.............................................+&&&&&&&&&&&&&&&%............................-%&&&&&&&&&&&&&&=........&&&&&&&&&&&&&&%......................#&&&&&&&&&&&&&&-......................................@*&&&&&&&&&&&&&&&&@.........................................", +".......................................$&&&&&&&&&&&&&&..............................................&&&&&&&&&&&&&&&&=...........................$&&&&&&&&&&&&&&%.........&&&&&&&&&&&&&&&.....................-&&&&&&&&&&&&&&$.........................................=&&&&&&&&&&&&&&&@.........................................", +".......................................$&&&&&&&&&&&&&&+.............................................*&&&&&&&&&&&&&&&%-.........................$&&&&&&&&&&&&&&&=.........&&&&&&&&&&&&&&&@....................*&&&&&&&&&&&&&&+.......-@@@@@@@@@@@@@+....................#&&&&&&&&&&&&&&-.........................................", +".......................................@&&&&&&&&&&&&&&=...................*&&&&&&&&&&&&&-...........=&&&&&&&&&&&&&&&&$.......................-*&&&&&&&&&&&&&&&%..........%&&&&&&&&&&&&&&$...................#&&&&&&&&&&&&&&*........@&&&&&&&&&&&&&$....................@&&&&&&&&&&&&&&..........................................", +".......................................@&&&&&&&&&&&&&&%..................=&&&&&&&&&&&&&#............+&&&&&&&&&&&&&&&&&$.....................+%&&&&&&&&&&&&&&&&@..........$&&&&&&&&&&&&&&&-.................@&&&&&&&&&&&&&&&+........$&&&&&&&&&&&&&%....................@&&&&&&&&&&&&&*..........................................", +"........................................&&&&&&&&&&&&&&&=................@&&&&&&&&&&&&&%-.............*&&&&&&&&&&&&&&&&&*-.................-$&&&&&&&&&&&&&&&&&$...........#&&&&&&&&&&&&&&&*................@&&&&&&&&&&&&&&&#.........$&&&&&&&&&&&&&&+...................*&&&&&&&&&&&&&=..........................................", +"........................................*&&&&&&&&&&&&&&&+..............@&&&&&&&&&&&&&&=..............=&&&&&&&&&&&&&&&&&&&#-.............+$&&&&&&&&&&&&&&&&&&%-...........@&&&&&&&&&&&&&&&&$..............$&&&&&&&&&&&&&&&%-.........$&&&&&&&&&&&&&&%-.................#&&&&&&&&&&&&&&-..........................................", +"........................................=&&&&&&&&&&&&&&&&@...........-*&&&&&&&&&&&&&&$................%&&&&&&&&&&&&&&&&&&&&*=@-....-@=$&&&&&&&&&&&&&&&&&&&&&+.............&&&&&&&&&&&&&&&&&$-..........+%&&&&&&&&&&&&&&&&@..........=&&&&&&&&&&&&&&&%+..............-$&&&&&&&&&&&&&&*...........................................", +"........................................-&&&&&&&&&&&&&&&&&*@.......@*&&&&&&&&&&&&&&&%-................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@..............$&&&&&&&&&&&&&&&&&%=-......@*&&&&&&&&&&&&&&&&&#...........@&&&&&&&&&&&&&&&&&*=-........-@$&&&&&&&&&&&&&&&&+...........................................", +".........................................#&&&&&&&&&&&&&&&&&&&*$$$%&&&&&&&&&&&&&&&&&&@..................*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=...............+&&&&&&&&&&&&&&&&&&&&%$$$%&&&&&&&&&&&&&&&&&&&*.............&&&&&&&&&&&&&&&&&&&&&*$$$$*&&&&&&&&&&&&&&&&&&&*............................................", +".........................................-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...................-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$.................*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-.............#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-............................................", +"..........................................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.....................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=..................-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-..............-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.............................................", +"...........................................%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.......................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@....................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-................#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@..............................................", +"...........................................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@.........................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%-......................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$-..................*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@...............................................", +"............................................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%+...........................@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#.........................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#....................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@................................................", +".............................................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$-.............................+%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*+...........................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%+......................-%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*-.................................................", +"..............................................-*&&&&&&&&&&&&&&&&&&&&&&&&&&&%@................................-#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%=..............................=&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#..........................$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%=...................................................", +"................................................=%&&&&&&&&&&&&&&&&&&&&&&&%=....................................-$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@.................................-*&&&&&&&&&&&&&&&&&&&&&&&&&&#-............................+*&&&&&&&&&&&&&&&&&&&&&&&&&&&&%=-....................................................", +".................................................-#%&&&&&&&&&&&&&&&&&&&*@........................................-#%&&&&&&&&&&&&&&&&&&&&&&&*#-.....................................+$&&&&&&&&&&&&&&&&&&&&&*=.................................+*&&&&&&&&&&&&&&&&&&&&&&&&$@.......................................................", +"....................................................@$&&&&&&&&&&&&&%$@-.............................................+=$&&&&&&&&&&&&&&&&*$@-..........................................-@$&&&&&&&&&&&&&&&$=-.....................................-=$&&&&&&&&&&&&&&&&&*#@..........................................................", +".......................................................-@@$$$$$#@@......................................................-@@=$$$$$$#@@+...................................................-@@#$$$$$=@@...............................................@@=$$$$$$$=@@-..............................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................"};
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/misc/escw.xpm @@ -0,0 +1,264 @@ +/* XPM */ +static char * escw_xpm[] = { +"320 240 21 1", +" c None", +". c #28CAFF", +"+ c #6F8695", +"@ c #3FB3C7", +"# c #579DAE", +"$ c #FF0000", +"% c #E61619", +"& c #9E5A64", +"* c #CE2D32", +"= c #B7434A", +"- c #87707C", +"; c #FFFFFF", +"> c #C7C7C7", +", c #AAAAAA", +"' c #727272", +") c #555555", +"! c #1D1D1D", +"~ c #000000", +"{ c #393939", +"] c #8E8E8E", +"^ c #E3E3E3", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"....................+++++++++++++++++++++++++@......................................................................#+++++++#........................#++++++++@................@++++++++#.......................................................................................................................................", +"....................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$&.......................................................................................................................................", +"...................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......................................................................................................................................", +"...................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$........................#$$$$$$$$*.................$$$$$$$$$@.......................................................................................................................................", +"...................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........................-$$$$$$$$=................@$$$$$$$$$..........................................$$$$$$$$&.....................................................................................", +"...................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................=$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.........................................+$$$$$$$$+.....................................................................................", +"..................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........................%$$$$$$$$@................=$$$$$$$$&.........................................+$$$$$$$$@.....................................................................................", +"..................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.............................................................#$$$$$$$$#........................$$$$$$$$$.................*$$$$$$$$+.........................................=$$$$$$$$......................................................................................", +"..................=$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........................................*$$$$$$$=......................................................................................", +"..................*$$$$$$$$#..............@%$$$$$$$$$.............................................................=$$$$$$$*........................&$$$$$$$$&................#$$$$$$$$%..........................................$$$$$$$$-......................................................................................", +"..................$$$$$$$$$................#$$$$$$$$$.............................................................*$$$$$$$=........................=$$$$$$$$+................-$$$$$$$$=.........................................#$$$$$$$$+......................................................................................", +".................#$$$$$$$$=.................*$$$$$$$%...............#++==-+#.........................@++==++......$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-..............@++-===-++.................+$$$$$$$$.......................................................................................", +".................-$$$$$$$$&.................=$$$$$$$=............+=$$$$$$$$$$=#....................-*$$$$$$$$&@..+$$$$$$$$@.......................@$$$$$$$$%.................%$$$$$$$$#...........+=$$$$$$$$$$$$*-..........#+++*$$$$$$$$++++@..................................................................................", +".................=$$$$$$$$+.................*$$$$$$$-.........@&$$$$$$$$$$$$$$$=@................-%$$$$$$$$$$$%@.-$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........-%$$$$$$$$$$$$$$$$%+........$$$$$$$$$$$$$$$$$+..................................................................................", +".................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@*$$$$$$$$$$$$$$%@=$$$$$$$=........................=$$$$$$$$-................+$$$$$$$$*........@*$$$$$$$$$$$$$$$$$$$$+......#$$$$$$$$$$$$$$$$$@..................................................................................", +".................$$$$$$$$$.................&$$$$$$$=........=$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$=.......@%$$$$$$$$$$$$$$$$$$$$$$@.....+$$$$$$$$$$$$$$$$$...................................................................................", +"................+$$$$$$$$=................#$$$$$$$$#.......=$$$$$$$$$$$$$$$$$$$$$$*..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......%$$$$$$$$$$$$$$$$$$$$$$$&.....=$$$$$$$$$$$$$$$$=...................................................................................", +"................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.......................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@......&$$$$$$$$$$$$$$$$$$$$$$$$%.....*$$$$$$$$$$$$$$$$-...................................................................................", +"................=$$$$$$$$+..............-%$$$$$$$*.......#$$$$$$$$$%&+@@+=$$$$$$$$$*........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......@$$$$$$$$$*++..#+*$$$$$$$$$.....++++$$$$$$$$*++++@...................................................................................", +"................$$$$$$$$$-++++++++++++=%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$=........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=......&$$$$$$$$+........%$$$$$$$$........#$$$$$$$$+........................................................................................", +"...............@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........................%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&......%$$$$$$$+.........=$$$$$$$*........+$$$$$$$$@........................................................................................", +"...............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$=..........@$$$$$$$$=.....*$$$$$$$$-..........*$$$$$$$$$+........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.....#$$$$$$$*..........*$$$$$$$=........=$$$$$$$$.........................................................................................", +"...............&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$=....#$$$$$$$$*...........&$$$$$$$$$........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......#=======+.........@$$$$$$$$+........%$$$$$$$=.........................................................................................", +"...............*$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............=$$$$$$$=....&$$$$$$$$@...........+$$$$$$$$*........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%.......................@%$$$$$$$$#........$$$$$$$$&.........................................................................................", +"...............$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............=$$$$$$$=....$$$$$$$$=............+$$$$$$$$=........................=$$$$$$$$&++++++++++++++++&$$$$$$$$=....................++=$$$$$$$$$$........+$$$$$$$$+.........................................................................................", +"..............#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.......=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...+$$$$$$$$#............+$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.............@+-=*$$$$$$$$$$$$$$*........-$$$$$$$$@.........................................................................................", +"..............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...=$$$$$$$%.............+$$$$$$$$#.......................@$$$$$$$$*.................%$$$$$$$$#..........#=%$$$$$$$$$$$$$$$$$$$=........=$$$$$$$%..........................................................................................", +"..............=$$$$$$$$+............+*$$$$$$$$$=.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.........+%$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$=..........................................................................................", +"..............%$$$$$$$$@..............=$$$$$$$$=.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............=$$$$$$$=........................&$$$$$$$$+................+$$$$$$$$*.......@=$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$-..........................................................................................", +"..............$$$$$$$$$...............@$$$$$$$$=.....=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............*$$$$$$$&........................*$$$$$$$$#................-$$$$$$$$=......@%$$$$$$$$$$$$$$*&&$$$$$$$$........+$$$$$$$$+..........................................................................................", +".............+$$$$$$$$=................$$$$$$$$&.....*$$$$$$$$=====================&...-$$$$$$$$.............@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+......%$$$$$$$$$%=-+@...&$$$$$$$=........-$$$$$$$$...........................................................................................", +".............-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................=$$$$$$$$.............-$$$$$$$$@.......................#$$$$$$$$*.................%$$$$$$$$@.....=$$$$$$$$*#........*$$$$$$$&........=$$$$$$$*...........................................................................................", +".............=$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$=.........................=$$$$$$$$.............*$$$$$$$%........................+$$$$$$$$&................@$$$$$$$$$.....#$$$$$$$$=.........@$$$$$$$$+........%$$$$$$$=...........................................................................................", +".............$$$$$$$$$................=$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$............#$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....*$$$$$$$*..........-$$$$$$$$@........$$$$$$$$+...........................................................................................", +"............@$$$$$$$$%................$$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$+...........%$$$$$$$$-........................%$$$$$$$$@................&$$$$$$$$&....@$$$$$$$$#..........%$$$$$$$%........+$$$$$$$$#...........................................................................................", +"............+$$$$$$$$=...............#$$$$$$$$=......%$$$$$$$$...........@========@....&$$$$$$$$&..........=$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....+$$$$$$$$..........-$$$$$$$$=........&$$$$$$$$............................................................................................", +"............&$$$$$$$$-...............&$$$$$$$$&......=$$$$$$$$-..........=$$$$$$$*.....+$$$$$$$$%@........+$$$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.....=$$$$$$$$.........@$$$$$$$$$-........=$$$$$$$=............................................................................................", +"............*$$$$$$$$+...............=$$$$$$$$+......+$$$$$$$$$+.......@=$$$$$$$$@.....#$$$$$$$$$=.......=$$$$$$$$$$*........................-$$$$$$$$&................@$$$$$$$$%.....=$$$$$$$$-.......#%$$$$$$$$$+........$$$$$$$$-............................................................................................", +"............$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$*#..@-%$$$$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....=$$$$$$$$$-@...+&$$$$$$$$$$$........@$$$$$$$$=............................................................................................", +"...........#$$$$$$$$*...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$=........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.....-$$$$$$$$$$$$$$$$$$$$$$$$$$%........+$$$$$$$$$%==-........................................................................................", +"...........+$$$$$$$$=...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$=.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......................@$$$$$$$$%.................*$$$$$$$$+.....#$$$$$$$$$$$$$$$$$$$$$$$$$$=........+$$$$$$$$$$$$&........................................................................................", +"...........=$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$=...........-$$$$$$$$$$$$$$$$$=$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.......*$$$$$$$$$$$$$$$$*%$$$$$$$*........+$$$$$$$$$$$$+........................................................................................", +"...........%$$$$$$$$#...............+$$$$$$$$$=.........#%$$$$$$$$$$$$$$$$$$+.............=$$$$$$$$$$$$$$$+=$$$$$$$=........................&$$$$$$$$-................#$$$$$$$$*.......@$$$$$$$$$$$$$$$=.$$$$$$$$$+........$$$$$$$$$$$$@........................................................................................", +"...........$$$$$$$$$................@$$$$$$$$$*..........@*$$$$$$$$$$$$$$$&@...............=$$$$$$$$$$$$%@.%$$$$$$$&........................*$$$$$$$$+................-$$$$$$$$=........+$$$$$$$$$$$$%+..%$$$$$$$$*........&$$$$$$$$$$$.........................................................................................", +"..........@+++++++++.................+++++++++#............#*$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........................+++++++++.................#++++++++@.........@*$$$$$$$$%&@...#++++++++#.........&$$$$$$$$$=.........................................................................................", +".............................................................@+&====&+@.......................#-====-#.....................................................................................@+====&+..........................@+=====&+@.........................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>,')))!~~~)))',>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>'{~~~~~~~~~~~~~~~~~~)]^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^'!~~~~~~~~~~~~~~~~~~~~~~~~{,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~)){~~~~~~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~{',;;;;;;;;>]!~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~'^;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~~~~'^;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~{^;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,)))),,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,')))),,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>,,]))))',,>;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;^,)!~~~~~~~~~~~~!'>;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;^])!~~~~~~~~~~~~~!',;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^])!~~~~~~~~~~~~~~!),;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;]{~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;^'!~~~~~~~~~~~~~~~~~~~~!'^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^]{~~~~~~~~~~~~~~~~~~~~~~'>;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;^'~~~~~~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;;;;;^'~~~~~~~~~~~~~~~~~~~~~~~~~~~)^;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~)^;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;>!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~);;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;^~~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;;;;]~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;!~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;>~~~~~~~~~~~~~~~~~~~!))!~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;;>~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~~~~~~!))!~~~~~~~~~~~~~~~~~~~~!;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~~~~~))){~~~~~~~~~~~~~~~~~~~~;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;^!~~~~~~~~~~~~~~~!'>;;;;;;,{~~~~~~~~~~~~~~~~);;;;;;;;;;;'~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~),;;;;;;,)~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;{~~~~~~~~~~~~~~~',;;;;;;;;,)~~~~~~~~~~~~~~~~^;;;;;;;;;..............", +".................................................;;;;;;;;;;;;'~~~~~~~~~~~~~~~];;;;;;;;;;;>!~~~~~~~~~~~~~~~;;;;;;;;;;;!~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~)^;;;;;;;;;;>!~~~~~~~~~~~~~~~~);;;;;;;;;;;;>~~~~~~~~~~~~~~)^;;;;;;;;;;;;^!~~~~~~~~~~~~~~,;;;;;;;;;..............", +".................................................;;;;;;;;;;;>~~~~~~~~~~~~~~!^;;;;;;;;;;;;;^!~~~~~~~~~~~~~~,;;;;;;;;;>~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~;;;;;;;;;;;;{~~~~~~~~~~~~~{;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~,;;;;;;;;;..............", +".................................................;;;;;;;;;;;{~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~);;;;;;;;;]~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~~>;;;;;;;;;;^~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~,;;;;;;;;;..............", +".................................................;;;;;;;;;;]~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~!;;;;;;;;;)~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~,;;;;;;;;;;,~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~,;;;;;;;;;..............", +".................................................;;;;;;;;;;!~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~;;;;;;;;;~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~~';;;;;;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~;;;;;;;;;;..............", +".................................................;;;;;;;;;]~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~;;;;;;;;>~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~);;;;;;;;;;{~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;])))))))))))));;;;;;;;;;..............", +".................................................;;;;;;;;;{~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~,;;;;;;;,~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~);;;;;;;;;;~~~~~~~~~~~~~~~~'^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;>~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~,;;;;;;;)~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~);;;;;;;;;;~~~~~~~~~~~~~~~~~~'>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;)~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~>;;;;;;;{~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;~~~~~~~~~~~~~~~~~~~~!),;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~;;;;;;;;~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;!~~~~~~~~~~~~~~~~~~~~~~~{]^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;,~~~~~~~~~~~~~~))))))))))))))))))))))~~~~~~~~~~~~~~;;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~!',;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;;;;;;,~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~,;;;;;;;;;;>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~),;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!;;;;;;;,~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~,;;;;;;;;;;;{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'>;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;,~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~>;;;;;;;;;;;>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{^;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;'~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;)~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~!;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;..............", +".................................................;;;;;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;)~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~);;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;..............", +".................................................;;;;;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;;;;;;;)~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>))))))))))))));;;;;;,~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;!~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;]!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;..............", +".................................................;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;)~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~);;;;;;'~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;]!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;;;;;;;..............", +".................................................;;;;;,~~~~~~~~~~~~~~)))))))))))))))))))))))))))))))))))),;;;;;;;;)~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~,;;;;;;)~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;,)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;..............", +".................................................;;;;;]~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~^;;;;;;)~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;,)~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~);;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;;;;;;,)~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~,;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>'!~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~!;;;;;;;;~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>'!~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~];;;;;;;;~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,{~~~~~~~~~~~~~~~~,;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;~~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~!;;;;;;;;;~~~~~~~~~~~~~~~;;;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~,;;;;;;;;;;;;..............", +".................................................;;;;;)~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~];;;;;;;;;~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~>;;;;;;;^,,,,,,,,,,,,,>;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~^;;;;;;;;;;;;..............", +".................................................;;;;;,~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~^;;;;;;;;;;;]~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~!;;;;;;;;;;!~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~{;;;;;;;;,~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~;;;;;;;;;;;;;..............", +".................................................;;;;;,~~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~';;;;;;;;;;;;>~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;;;;;>!~~~~~~~~~~~~~~~~,;;;;;;;;;;)~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~>;;;;;;;;)~~~~~~~~~~~~~!;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~{;;;;;;;;;;;;;..............", +".................................................;;;;;;~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;,~~~~~~~~~~~~~!^;;;;;;;;;;;;;{~~~~~~~~~~~~~~~~~{^;;;;;;;;;;;;;;;;;^)~~~~~~~~~~~~~~~~~);;;;;;;;;;;'~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~';;;;;;;;;)~~~~~~~~~~~~~~>;;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~];;;;;;;;;;;;;..............", +".................................................;;;;;;{~~~~~~~~~~~~~~~>;;;;;;;;;;;;;;,~~~~~~~~~~~~~~];;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~'^;;;;;;;;;;;;;>)~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;,~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;)~~~~~~~~~~~~~~~!^;;;;;;;;;)~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~^;;;;;;;;;;;;;..............", +".................................................;;;;;;]~~~~~~~~~~~~~~~~,;;;;;;;;;;;^{~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;!~~~~~~~~~~~~~~~~~~~~{],^;;;;^,])~~~~~~~~~~~~~~~~~~~~~>;;;;;;;;;;;;;~~~~~~~~~~~~~~~~~)^;;;;;;;;;;>!~~~~~~~~~~~~~~~~,;;;;;;;;;;]~~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;^)~~~~~~~~~~~~~~{;;;;;;;;;;;;;;..............", +".................................................;;;;;;^~~~~~~~~~~~~~~~~~{,;;;;;;;,{~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~!]^;;;;;;,{~~~~~~~~~~~~~~~~~';;;;;;;;;;;,~~~~~~~~~~~~~~~~~{]^;;;;;;;;^,)~~~~~~~~~~~~~~~~>;;;;;;;;;;;;;;..............", +".................................................;;;;;;;'~~~~~~~~~~~~~~~~~~~{)))!~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;>~~~~~~~~~~~~~~~~~~~~!)))!~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;~~~~~~~~~~~~~~~~~~~~~{)))){~~~~~~~~~~~~~~~~~~~{;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~);;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~];;;;;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)^;;;;;;;;;;;;;;;;;;{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{>;;;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!>;;;;;;;;;;;;;;;;;;;;;;^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{^;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~~!,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';;;;;;;;;;;;;;;;;;;;;;;;;;)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;]!~~~~~~~~~~~~~~~~~~~~~~~!];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^{~~~~~~~~~~~~~~~~~~~~~~~~~~'^;;;;;;;;;;;;;;;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~~~~~~~~~~~!]^;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;^'!~~~~~~~~~~~~~~~~~~~{,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^'!~~~~~~~~~~~~~~~~~~~~~~~{'^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>)~~~~~~~~~~~~~~~~~~~~~{];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>{~~~~~~~~~~~~~~~~~~~~~~~~),;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;,)~~~~~~~~~~~~~!),^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>])~~~~~~~~~~~~~~~~{),^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^,)~~~~~~~~~~~~~~~)]^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^])~~~~~~~~~~~~~~~~~{',;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;^,,)))))',,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^,,]))))))',,>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^,,')))))],,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,])))))))],,^;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +".................................................;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..............", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"....................+++++++++++++++++++++++++@......................................................................#+++++++#........................#++++++++@................@++++++++#.......................................................................................................................................", +"....................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$&.......................................................................................................................................", +"...................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......................................................................................................................................", +"...................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$........................#$$$$$$$$*.................$$$$$$$$$@.......................................................................................................................................", +"...................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........................-$$$$$$$$=................@$$$$$$$$$..........................................$$$$$$$$&.....................................................................................", +"...................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................=$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.........................................+$$$$$$$$+.....................................................................................", +"..................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........................%$$$$$$$$@................=$$$$$$$$&.........................................+$$$$$$$$@.....................................................................................", +"..................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.............................................................#$$$$$$$$#........................$$$$$$$$$.................*$$$$$$$$+.........................................=$$$$$$$$......................................................................................", +"..................=$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........................................*$$$$$$$=......................................................................................", +"..................*$$$$$$$$#..............@%$$$$$$$$$.............................................................=$$$$$$$*........................&$$$$$$$$&................#$$$$$$$$%..........................................$$$$$$$$-......................................................................................", +"..................$$$$$$$$$................#$$$$$$$$$.............................................................*$$$$$$$=........................=$$$$$$$$+................-$$$$$$$$=.........................................#$$$$$$$$+......................................................................................", +".................#$$$$$$$$=.................*$$$$$$$%...............#++==-+#.........................@++==++......$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-..............@++-===-++.................+$$$$$$$$.......................................................................................", +".................-$$$$$$$$&.................=$$$$$$$=............+=$$$$$$$$$$=#....................-*$$$$$$$$&@..+$$$$$$$$@.......................@$$$$$$$$%.................%$$$$$$$$#...........+=$$$$$$$$$$$$*-..........#+++*$$$$$$$$++++@..................................................................................", +".................=$$$$$$$$+.................*$$$$$$$-.........@&$$$$$$$$$$$$$$$=@................-%$$$$$$$$$$$%@.-$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........-%$$$$$$$$$$$$$$$$%+........$$$$$$$$$$$$$$$$$+..................................................................................", +".................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@*$$$$$$$$$$$$$$%@=$$$$$$$=........................=$$$$$$$$-................+$$$$$$$$*........@*$$$$$$$$$$$$$$$$$$$$+......#$$$$$$$$$$$$$$$$$@..................................................................................", +".................$$$$$$$$$.................&$$$$$$$=........=$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$=.......@%$$$$$$$$$$$$$$$$$$$$$$@.....+$$$$$$$$$$$$$$$$$...................................................................................", +"................+$$$$$$$$=................#$$$$$$$$#.......=$$$$$$$$$$$$$$$$$$$$$$*..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......%$$$$$$$$$$$$$$$$$$$$$$$&.....=$$$$$$$$$$$$$$$$=...................................................................................", +"................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.......................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@......&$$$$$$$$$$$$$$$$$$$$$$$$%.....*$$$$$$$$$$$$$$$$-...................................................................................", +"................=$$$$$$$$+..............-%$$$$$$$*.......#$$$$$$$$$%&+@@+=$$$$$$$$$*........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......@$$$$$$$$$*++..#+*$$$$$$$$$.....++++$$$$$$$$*++++@...................................................................................", +"................$$$$$$$$$-++++++++++++=%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$=........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=......&$$$$$$$$+........%$$$$$$$$........#$$$$$$$$+........................................................................................", +"...............@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........................%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&......%$$$$$$$+.........=$$$$$$$*........+$$$$$$$$@........................................................................................", +"...............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$=..........@$$$$$$$$=.....*$$$$$$$$-..........*$$$$$$$$$+........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.....#$$$$$$$*..........*$$$$$$$=........=$$$$$$$$.........................................................................................", +"...............&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$=....#$$$$$$$$*...........&$$$$$$$$$........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......#=======+.........@$$$$$$$$+........%$$$$$$$=.........................................................................................", +"...............*$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............=$$$$$$$=....&$$$$$$$$@...........+$$$$$$$$*........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%.......................@%$$$$$$$$#........$$$$$$$$&.........................................................................................", +"...............$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............=$$$$$$$=....$$$$$$$$=............+$$$$$$$$=........................=$$$$$$$$&++++++++++++++++&$$$$$$$$=....................++=$$$$$$$$$$........+$$$$$$$$+.........................................................................................", +"..............#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.......=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...+$$$$$$$$#............+$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.............@+-=*$$$$$$$$$$$$$$*........-$$$$$$$$@.........................................................................................", +"..............+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...=$$$$$$$%.............+$$$$$$$$#.......................@$$$$$$$$*.................%$$$$$$$$#..........#=%$$$$$$$$$$$$$$$$$$$=........=$$$$$$$%..........................................................................................", +"..............=$$$$$$$$+............+*$$$$$$$$$=.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.........+%$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$=..........................................................................................", +"..............%$$$$$$$$@..............=$$$$$$$$=.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............=$$$$$$$=........................&$$$$$$$$+................+$$$$$$$$*.......@=$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$-..........................................................................................", +"..............$$$$$$$$$...............@$$$$$$$$=.....=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............*$$$$$$$&........................*$$$$$$$$#................-$$$$$$$$=......@%$$$$$$$$$$$$$$*&&$$$$$$$$........+$$$$$$$$+..........................................................................................", +".............+$$$$$$$$=................$$$$$$$$&.....*$$$$$$$$=====================&...-$$$$$$$$.............@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+......%$$$$$$$$$%=-+@...&$$$$$$$=........-$$$$$$$$...........................................................................................", +".............-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................=$$$$$$$$.............-$$$$$$$$@.......................#$$$$$$$$*.................%$$$$$$$$@.....=$$$$$$$$*#........*$$$$$$$&........=$$$$$$$*...........................................................................................", +".............=$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$=.........................=$$$$$$$$.............*$$$$$$$%........................+$$$$$$$$&................@$$$$$$$$$.....#$$$$$$$$=.........@$$$$$$$$+........%$$$$$$$=...........................................................................................", +".............$$$$$$$$$................=$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$............#$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....*$$$$$$$*..........-$$$$$$$$@........$$$$$$$$+...........................................................................................", +"............@$$$$$$$$%................$$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$+...........%$$$$$$$$-........................%$$$$$$$$@................&$$$$$$$$&....@$$$$$$$$#..........%$$$$$$$%........+$$$$$$$$#...........................................................................................", +"............+$$$$$$$$=...............#$$$$$$$$=......%$$$$$$$$...........@========@....&$$$$$$$$&..........=$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....+$$$$$$$$..........-$$$$$$$$=........&$$$$$$$$............................................................................................", +"............&$$$$$$$$-...............&$$$$$$$$&......=$$$$$$$$-..........=$$$$$$$*.....+$$$$$$$$%@........+$$$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.....=$$$$$$$$.........@$$$$$$$$$-........=$$$$$$$=............................................................................................", +"............*$$$$$$$$+...............=$$$$$$$$+......+$$$$$$$$$+.......@=$$$$$$$$@.....#$$$$$$$$$=.......=$$$$$$$$$$*........................-$$$$$$$$&................@$$$$$$$$%.....=$$$$$$$$-.......#%$$$$$$$$$+........$$$$$$$$-............................................................................................", +"............$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$*#..@-%$$$$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....=$$$$$$$$$-@...+&$$$$$$$$$$$........@$$$$$$$$=............................................................................................", +"...........#$$$$$$$$*...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$=........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.....-$$$$$$$$$$$$$$$$$$$$$$$$$$%........+$$$$$$$$$%==-........................................................................................", +"...........+$$$$$$$$=...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$=.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......................@$$$$$$$$%.................*$$$$$$$$+.....#$$$$$$$$$$$$$$$$$$$$$$$$$$=........+$$$$$$$$$$$$&........................................................................................", +"...........=$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$=...........-$$$$$$$$$$$$$$$$$=$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.......*$$$$$$$$$$$$$$$$*%$$$$$$$*........+$$$$$$$$$$$$+........................................................................................", +"...........%$$$$$$$$#...............+$$$$$$$$$=.........#%$$$$$$$$$$$$$$$$$$+.............=$$$$$$$$$$$$$$$+=$$$$$$$=........................&$$$$$$$$-................#$$$$$$$$*.......@$$$$$$$$$$$$$$$=.$$$$$$$$$+........$$$$$$$$$$$$@........................................................................................", +"...........$$$$$$$$$................@$$$$$$$$$*..........@*$$$$$$$$$$$$$$$&@...............=$$$$$$$$$$$$%@.%$$$$$$$&........................*$$$$$$$$+................-$$$$$$$$=........+$$$$$$$$$$$$%+..%$$$$$$$$*........&$$$$$$$$$$$.........................................................................................", +"..........@+++++++++.................+++++++++#............#*$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........................+++++++++.................#++++++++@.........@*$$$$$$$$%&@...#++++++++#.........&$$$$$$$$$=.........................................................................................", +".............................................................@+&====&+@.......................#-====-#.....................................................................................@+====&+..........................@+=====&+@.........................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................"};
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/misc/lcd_test.c @@ -0,0 +1,340 @@ +//========================================================================== +// +// lcd_test.c +// +// SA1110/Assabet - Compact Flash test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-06-05 +// Description: Tool used to test LCD stuff +//####DESCRIPTIONEND#### + +#include <pkgconf/kernel.h> // Configuration header +#include <cyg/kernel/kapi.h> +#include <cyg/infra/diag.h> + +#include <cyg/hal/hal_io.h> // IO macros +#include <cyg/hal/hal_arch.h> // Register state info +#include <cyg/hal/hal_intr.h> // HAL interrupt macros + +#include <cyg/hal/hal_sa11x0.h> // Board definitions +#include <cyg/hal/assabet.h> +#include <cyg/hal/hal_cache.h> + +#include "eCos.xpm" +#include "redhat.xpm" +#include "escw.xpm" + +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif + +#define STACK_SIZE 4096 +static char stack[STACK_SIZE]; +static cyg_thread thread_data; +static cyg_handle_t thread_handle; + +static struct lcd_frame { + unsigned short palette[16]; + unsigned short pixels[240][320]; + unsigned char pad[256]; +} lcd_frame_buffer; + +#define RGB_RED(x) (((x)&0x1F)<<11) +#define RGB_GREEN(x) (((x)&0x3F)<<5) +#define RGB_BLUE(x) ((x)&0x1F) + +static volatile struct lcd_frame *fp; + +// FUNCTIONS + +static void +cyg_test_exit(void) +{ + while (TRUE) ; +} + +static int +_hexdigit(char c) +{ + if ((c >= '0') && (c <= '9')) { + return c - '0'; + } else + if ((c >= 'A') && (c <= 'F')) { + return (c - 'A') + 0x0A; + } else + if ((c >= 'a') && (c <= 'f')) { + return (c - 'a') + 0x0a; + } +} + +static int +_hex(char *cp) +{ + return (_hexdigit(*cp)<<4) | _hexdigit(*(cp+1)); +} + +static unsigned short +parse_color(char *cp) +{ + int red, green, blue; + + if (*cp == '#') { + red = _hex(cp+1); + green = _hex(cp+3); + blue = _hex(cp+5); + return RGB_RED(red>>3) | RGB_GREEN(green>>2) | RGB_BLUE(blue>>3); + } else { + // Should be "None" + return 0xFFFF; + } +} + +static void +show_xpm(char *xpm[]) +{ + int i, row, col; + char *cp; + int nrows, ncols, nclrs; + unsigned short colors[256]; // Mapped by character index + + cp = xpm[0]; + if (sscanf(cp, "%d %d %d", &ncols, &nrows, &nclrs) != 3) { + diag_printf("Can't parse XPM data, sorry\n"); + return; + } + diag_printf("%d rows, %d cols, %d colors\n", nrows, ncols, nclrs); + + for (i = 0; i < 256; i++) { + colors[i] = 0x0000; + } + for (i = 0; i < nclrs; i++) { + cp = xpm[i+1]; + colors[(unsigned int)*cp] = parse_color(&cp[4]); + } + + for (row = 0; row < nrows; row++) { + cp = xpm[nclrs+1+row]; + for (col = 0; col < ncols; col++) { +#if 0 + if (*cp++ != '.') { + fp->pixels[row][col] = 0x0000; + } else { + fp->pixels[row][col] = 0xFFFF; + } +#else + fp->pixels[row][col] = colors[(unsigned int)*cp++]; +#endif + } + } + cyg_thread_delay(100); +} + +static void +lcd_test(cyg_addrword_t p) +{ + int i, pix, row, col; + unsigned long _fp; + int on; + + diag_printf("LCD test here\n"); + +// HAL_DCACHE_SYNC(); +// HAL_DCACHE_DISABLE(); + + // Frame buffer must be aligned on a 16 byte boundary + _fp = (((unsigned long)&lcd_frame_buffer) + 15) & ~15; + fp = (struct lcd_frame *)(_fp + SA11X0_RAM_BANK0_BASE); + // Enable LCD in 320x240 16bpp + *SA1110_DBAR1 = (unsigned long)&(fp->palette); + *SA1110_LCCR1 = 0x1D1D0930; + *SA1110_LCCR2 = 0xEF; + *SA1110_LCCR3 = 0x0c; + fp->palette[0] = 0x2000; // Tell controller 16 bits + *SA1110_LCCR0 = 0xBB; // B&W + *SA1110_LCCR0 = 0xB9; // Color + assabet_BCR(SA1110_BCR_LCD_BPP, SA1110_BCR_LCD_12BPP); + assabet_BCR(SA1110_BCR_LCD_BPP, SA1110_BCR_LCD_16BPP); + assabet_BCR(SA1110_BCR_LCD, SA1110_BCR_LCD_ON); +#if 0 + for (i = 0; i < 16; i++) { + on = true; + diag_printf("Fill with 0x%x\n", i); + for (row = 0; row < 240; row++) { + for (col = 0; col < 320/2; col++) { + if (on) { + fp->pixels[row][col] = RGB_RED(i)|RGB_GREEN(i)|RGB_BLUE(i); + } else { + fp->pixels[row][col] = 0xFFFF; + } + } + for (col = 320/2; col < 320; col++) { + if (!on) { + fp->pixels[row][col] = RGB_RED(i)|RGB_GREEN(i)|RGB_BLUE(i); + } else { + fp->pixels[row][col] = 0xFFFF; + } + } + if ((row & 0x0F) == 0x0F) { + if (on) { + on = false; + } else { + on = true; + } + } + } + cyg_thread_delay(100); + } +#endif +#if 0 + for (i = 0; i < 4; i++) { + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + switch (row/40) { + case 0: + pix = col / 20; // 0..15 + fp->pixels[row][col] = RGB_RED(pix); + break; + case 1: + pix = col / 10; // 0..31 + fp->pixels[row][col] = RGB_GREEN(pix); + break; + case 2: + pix = col / 20; // 0..15 + fp->pixels[row][col] = RGB_BLUE(pix); + break; + case 3: + pix = col / 20; // 0..15 + fp->pixels[row][col] = RGB_BLUE(pix) | RGB_GREEN(pix); + break; + case 4: + pix = col / 20; // 0..15 + fp->pixels[row][col] = RGB_BLUE(15) | RGB_GREEN(pix); + break; + case 5: + fp->pixels[row][col] = 0xFFFF; + break; + } + } + } + cyg_thread_delay(100); +#if 0 + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + pix = col / 20; // 0..15 + switch (row/60) { + case 0: + fp->pixels[row][col] = RGB_RED(pix); + break; + case 1: + fp->pixels[row][col] = RGB_GREEN(pix); + break; + case 2: + fp->pixels[row][col] = RGB_BLUE(pix); + break; + case 3: + fp->pixels[row][col] = 0xFFFF; + break; + } + } + } + cyg_thread_delay(100); +#endif +#if 0 + on = true; + for (row = 0; row < 240; row++) { + for (col = 0; col < 320/2; col++) { + if (on) { + fp->pixels[row][col] = RGB_GREEN(15); + } else { + fp->pixels[row][col] = RGB_BLUE(8); + } + } + for (col = 320/2; col < 320; col++) { + if (!on) { + fp->pixels[row][col] = RGB_GREEN(15); + } else { + fp->pixels[row][col] = RGB_BLUE(8); + } + } + if ((row & 0x0F) == 0x0F) { + if (on) { + on = false; + } else { + on = true; + } + } + } +#endif + } +#endif +#if 1 + for (row = 0; row < 240; row++) { + for (col = 0; col < 320; col++) { + if (col == 59) { + fp->pixels[row][col] = 0x0000; + } else { + fp->pixels[row][col] = 0xFFFF; + } + } + } + cyg_thread_delay(100); +#endif + + for (i = 0; i < 5; i++) { + show_xpm(eCos_xpm); + show_xpm(redhat_xpm); + show_xpm(escw_xpm); + } + + assabet_BCR(SA1110_BCR_MOTOR, SA1110_BCR_MOTOR_ON); + cyg_thread_delay(2*100); + assabet_BCR(SA1110_BCR_MOTOR, SA1110_BCR_MOTOR_OFF); + cyg_test_exit(); +} + +externC void +cyg_start( void ) +{ + // Create a main thread, so we can run the scheduler and have time 'pass' + cyg_thread_create(10, // Priority - just a number + lcd_test, // entry + 0, // entry parameter + "LCD test", // Name + &stack[0], // Stack + STACK_SIZE, // Size + &thread_handle, // Handle + &thread_data // Thread data structure + ); + cyg_thread_resume(thread_handle); // Start it + cyg_scheduler_start(); +} // cyg_package_start()
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/misc/redhat.xpm @@ -0,0 +1,254 @@ +/* XPM */ +static char * redhat_xpm[] = { +"320 240 11 1", +" c None", +". c #FFFFFF", +"+ c #FFAAAA", +"@ c #FFE3E3", +"# c #FFC7C7", +"$ c #FF0000", +"% c #FF1D1D", +"& c #FF7272", +"* c #FF3939", +"= c #FF5555", +"- c #FF8E8E", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"......................+++++++++++++++++++++++++@......................................................................#+++++++#........................#++++++++@................@++++++++#.....................................................................................................................................", +"......................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$&.....................................................................................................................................", +".....................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.....................................................................................................................................", +".....................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$........................#$$$$$$$$*.................$$$$$$$$$@.....................................................................................................................................", +".....................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........................-$$$$$$$$=................@$$$$$$$$$..........................................$$$$$$$$&...................................................................................", +".....................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................=$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.........................................+$$$$$$$$+...................................................................................", +"....................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........................%$$$$$$$$@................=$$$$$$$$&.........................................+$$$$$$$$@...................................................................................", +"....................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.............................................................#$$$$$$$$#........................$$$$$$$$$.................*$$$$$$$$+.........................................=$$$$$$$$....................................................................................", +"....................=$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........................................*$$$$$$$=....................................................................................", +"....................*$$$$$$$$#..............@%$$$$$$$$$.............................................................=$$$$$$$*........................&$$$$$$$$&................#$$$$$$$$%..........................................$$$$$$$$-....................................................................................", +"....................$$$$$$$$$................#$$$$$$$$$.............................................................*$$$$$$$=........................=$$$$$$$$+................-$$$$$$$$=.........................................#$$$$$$$$+....................................................................................", +"...................#$$$$$$$$=.................*$$$$$$$%...............#++==-+#.........................@++==++......$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-..............@++-===-++.................+$$$$$$$$.....................................................................................", +"...................-$$$$$$$$&.................=$$$$$$$=............+=$$$$$$$$$$=#....................-*$$$$$$$$&@..+$$$$$$$$@.......................@$$$$$$$$%.................%$$$$$$$$#...........+=$$$$$$$$$$$$*-..........#+++*$$$$$$$$++++@................................................................................", +"...................=$$$$$$$$+.................*$$$$$$$-.........@&$$$$$$$$$$$$$$$=@................-%$$$$$$$$$$$%@.-$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........-%$$$$$$$$$$$$$$$$%+........$$$$$$$$$$$$$$$$$+................................................................................", +"...................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@*$$$$$$$$$$$$$$%@=$$$$$$$=........................=$$$$$$$$-................+$$$$$$$$*........@*$$$$$$$$$$$$$$$$$$$$+......#$$$$$$$$$$$$$$$$$@................................................................................", +"...................$$$$$$$$$.................&$$$$$$$=........=$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$=.......@%$$$$$$$$$$$$$$$$$$$$$$@.....+$$$$$$$$$$$$$$$$$.................................................................................", +"..................+$$$$$$$$=................#$$$$$$$$#.......=$$$$$$$$$$$$$$$$$$$$$$*..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......%$$$$$$$$$$$$$$$$$$$$$$$&.....=$$$$$$$$$$$$$$$$=.................................................................................", +"..................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.......................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@......&$$$$$$$$$$$$$$$$$$$$$$$$%.....*$$$$$$$$$$$$$$$$-.................................................................................", +"..................=$$$$$$$$+..............-%$$$$$$$*.......#$$$$$$$$$%&+@@+=$$$$$$$$$*........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......@$$$$$$$$$*++..#+*$$$$$$$$$.....++++$$$$$$$$*++++@.................................................................................", +"..................$$$$$$$$$-++++++++++++=%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$=........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=......&$$$$$$$$+........%$$$$$$$$........#$$$$$$$$+......................................................................................", +".................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........................%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&......%$$$$$$$+.........=$$$$$$$*........+$$$$$$$$@......................................................................................", +".................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$=..........@$$$$$$$$=.....*$$$$$$$$-..........*$$$$$$$$$+........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.....#$$$$$$$*..........*$$$$$$$=........=$$$$$$$$.......................................................................................", +".................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$=....#$$$$$$$$*...........&$$$$$$$$$........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......#=======+.........@$$$$$$$$+........%$$$$$$$=.......................................................................................", +".................*$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............=$$$$$$$=....&$$$$$$$$@...........+$$$$$$$$*........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%.......................@%$$$$$$$$#........$$$$$$$$&.......................................................................................", +".................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............=$$$$$$$=....$$$$$$$$=............+$$$$$$$$=........................=$$$$$$$$&++++++++++++++++&$$$$$$$$=....................++=$$$$$$$$$$........+$$$$$$$$+.......................................................................................", +"................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.......=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...+$$$$$$$$#............+$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.............@+-=*$$$$$$$$$$$$$$*........-$$$$$$$$@.......................................................................................", +"................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...=$$$$$$$%.............+$$$$$$$$#.......................@$$$$$$$$*.................%$$$$$$$$#..........#=%$$$$$$$$$$$$$$$$$$$=........=$$$$$$$%........................................................................................", +"................=$$$$$$$$+............+*$$$$$$$$$=.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.........+%$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$=........................................................................................", +"................%$$$$$$$$@..............=$$$$$$$$=.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............=$$$$$$$=........................&$$$$$$$$+................+$$$$$$$$*.......@=$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$-........................................................................................", +"................$$$$$$$$$...............@$$$$$$$$=.....=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............*$$$$$$$&........................*$$$$$$$$#................-$$$$$$$$=......@%$$$$$$$$$$$$$$*&&$$$$$$$$........+$$$$$$$$+........................................................................................", +"...............+$$$$$$$$=................$$$$$$$$&.....*$$$$$$$$=====================&...-$$$$$$$$.............@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+......%$$$$$$$$$%=-+@...&$$$$$$$=........-$$$$$$$$.........................................................................................", +"...............-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................=$$$$$$$$.............-$$$$$$$$@.......................#$$$$$$$$*.................%$$$$$$$$@.....=$$$$$$$$*#........*$$$$$$$&........=$$$$$$$*.........................................................................................", +"...............=$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$=.........................=$$$$$$$$.............*$$$$$$$%........................+$$$$$$$$&................@$$$$$$$$$.....#$$$$$$$$=.........@$$$$$$$$+........%$$$$$$$=.........................................................................................", +"...............$$$$$$$$$................=$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$............#$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....*$$$$$$$*..........-$$$$$$$$@........$$$$$$$$+.........................................................................................", +"..............@$$$$$$$$%................$$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$+...........%$$$$$$$$-........................%$$$$$$$$@................&$$$$$$$$&....@$$$$$$$$#..........%$$$$$$$%........+$$$$$$$$#.........................................................................................", +"..............+$$$$$$$$=...............#$$$$$$$$=......%$$$$$$$$...........@========@....&$$$$$$$$&..........=$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....+$$$$$$$$..........-$$$$$$$$=........&$$$$$$$$..........................................................................................", +"..............&$$$$$$$$-...............&$$$$$$$$&......=$$$$$$$$-..........=$$$$$$$*.....+$$$$$$$$%@........+$$$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.....=$$$$$$$$.........@$$$$$$$$$-........=$$$$$$$=..........................................................................................", +"..............*$$$$$$$$+...............=$$$$$$$$+......+$$$$$$$$$+.......@=$$$$$$$$@.....#$$$$$$$$$=.......=$$$$$$$$$$*........................-$$$$$$$$&................@$$$$$$$$%.....=$$$$$$$$-.......#%$$$$$$$$$+........$$$$$$$$-..........................................................................................", +"..............$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$*#..@-%$$$$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....=$$$$$$$$$-@...+&$$$$$$$$$$$........@$$$$$$$$=..........................................................................................", +".............#$$$$$$$$*...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$=........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.....-$$$$$$$$$$$$$$$$$$$$$$$$$$%........+$$$$$$$$$%==-......................................................................................", +".............+$$$$$$$$=...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$=.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......................@$$$$$$$$%.................*$$$$$$$$+.....#$$$$$$$$$$$$$$$$$$$$$$$$$$=........+$$$$$$$$$$$$&......................................................................................", +".............=$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$=...........-$$$$$$$$$$$$$$$$$=$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.......*$$$$$$$$$$$$$$$$*%$$$$$$$*........+$$$$$$$$$$$$+......................................................................................", +".............%$$$$$$$$#...............+$$$$$$$$$=.........#%$$$$$$$$$$$$$$$$$$+.............=$$$$$$$$$$$$$$$+=$$$$$$$=........................&$$$$$$$$-................#$$$$$$$$*.......@$$$$$$$$$$$$$$$=.$$$$$$$$$+........$$$$$$$$$$$$@......................................................................................", +".............$$$$$$$$$................@$$$$$$$$$*..........@*$$$$$$$$$$$$$$$&@...............=$$$$$$$$$$$$%@.%$$$$$$$&........................*$$$$$$$$+................-$$$$$$$$=........+$$$$$$$$$$$$%+..%$$$$$$$$*........&$$$$$$$$$$$.......................................................................................", +"............@+++++++++.................+++++++++#............#*$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........................+++++++++.................#++++++++@.........@*$$$$$$$$%&@...#++++++++#.........&$$$$$$$$$=.......................................................................................", +"...............................................................@+&====&+@.......................#-====-#.....................................................................................@+====&+..........................@+=====&+@.......................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +".......................................................................................+++++++++++++++++++++++++@......................................................................#+++++++#........................#++++++++@................@++++++++#....................................................................", +".......................................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$&....................................................................", +"......................................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....................................................................", +"......................................................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$........................#$$$$$$$$*.................$$$$$$$$$@....................................................................", +"......................................................................................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........................-$$$$$$$$=................@$$$$$$$$$..........................................$$$$$$$$&..................", +"......................................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................=$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.........................................+$$$$$$$$+..................", +".....................................................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........................%$$$$$$$$@................=$$$$$$$$&.........................................+$$$$$$$$@..................", +".....................................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.............................................................#$$$$$$$$#........................$$$$$$$$$.................*$$$$$$$$+.........................................=$$$$$$$$...................", +".....................................................................................=$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........................................*$$$$$$$=...................", +".....................................................................................*$$$$$$$$#..............@%$$$$$$$$$.............................................................=$$$$$$$*........................&$$$$$$$$&................#$$$$$$$$%..........................................$$$$$$$$-...................", +".....................................................................................$$$$$$$$$................#$$$$$$$$$.............................................................*$$$$$$$=........................=$$$$$$$$+................-$$$$$$$$=.........................................#$$$$$$$$+...................", +"....................................................................................#$$$$$$$$=.................*$$$$$$$%...............#++==-+#.........................@++==++......$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-..............@++-===-++.................+$$$$$$$$....................", +"....................................................................................-$$$$$$$$&.................=$$$$$$$=............+=$$$$$$$$$$=#....................-*$$$$$$$$&@..+$$$$$$$$@.......................@$$$$$$$$%.................%$$$$$$$$#...........+=$$$$$$$$$$$$*-..........#+++*$$$$$$$$++++@...............", +"....................................................................................=$$$$$$$$+.................*$$$$$$$-.........@&$$$$$$$$$$$$$$$=@................-%$$$$$$$$$$$%@.-$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........-%$$$$$$$$$$$$$$$$%+........$$$$$$$$$$$$$$$$$+...............", +"....................................................................................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@*$$$$$$$$$$$$$$%@=$$$$$$$=........................=$$$$$$$$-................+$$$$$$$$*........@*$$$$$$$$$$$$$$$$$$$$+......#$$$$$$$$$$$$$$$$$@...............", +"....................................................................................$$$$$$$$$.................&$$$$$$$=........=$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$=.......@%$$$$$$$$$$$$$$$$$$$$$$@.....+$$$$$$$$$$$$$$$$$................", +"...................................................................................+$$$$$$$$=................#$$$$$$$$#.......=$$$$$$$$$$$$$$$$$$$$$$*..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......%$$$$$$$$$$$$$$$$$$$$$$$&.....=$$$$$$$$$$$$$$$$=................", +"...................................................................................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.......................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@......&$$$$$$$$$$$$$$$$$$$$$$$$%.....*$$$$$$$$$$$$$$$$-................", +"...................................................................................=$$$$$$$$+..............-%$$$$$$$*.......#$$$$$$$$$%&+@@+=$$$$$$$$$*........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......@$$$$$$$$$*++..#+*$$$$$$$$$.....++++$$$$$$$$*++++@................", +"...................................................................................$$$$$$$$$-++++++++++++=%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$=........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=......&$$$$$$$$+........%$$$$$$$$........#$$$$$$$$+.....................", +"..................................................................................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........................%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&......%$$$$$$$+.........=$$$$$$$*........+$$$$$$$$@.....................", +"..................................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$=..........@$$$$$$$$=.....*$$$$$$$$-..........*$$$$$$$$$+........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.....#$$$$$$$*..........*$$$$$$$=........=$$$$$$$$......................", +"..................................................................................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$=....#$$$$$$$$*...........&$$$$$$$$$........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......#=======+.........@$$$$$$$$+........%$$$$$$$=......................", +"..................................................................................*$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............=$$$$$$$=....&$$$$$$$$@...........+$$$$$$$$*........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%.......................@%$$$$$$$$#........$$$$$$$$&......................", +"..................................................................................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............=$$$$$$$=....$$$$$$$$=............+$$$$$$$$=........................=$$$$$$$$&++++++++++++++++&$$$$$$$$=....................++=$$$$$$$$$$........+$$$$$$$$+......................", +".................................................................................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.......=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...+$$$$$$$$#............+$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.............@+-=*$$$$$$$$$$$$$$*........-$$$$$$$$@......................", +".................................................................................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...=$$$$$$$%.............+$$$$$$$$#.......................@$$$$$$$$*.................%$$$$$$$$#..........#=%$$$$$$$$$$$$$$$$$$$=........=$$$$$$$%.......................", +".................................................................................=$$$$$$$$+............+*$$$$$$$$$=.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.........+%$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$=.......................", +".................................................................................%$$$$$$$$@..............=$$$$$$$$=.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............=$$$$$$$=........................&$$$$$$$$+................+$$$$$$$$*.......@=$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$-.......................", +".................................................................................$$$$$$$$$...............@$$$$$$$$=.....=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............*$$$$$$$&........................*$$$$$$$$#................-$$$$$$$$=......@%$$$$$$$$$$$$$$*&&$$$$$$$$........+$$$$$$$$+.......................", +"................................................................................+$$$$$$$$=................$$$$$$$$&.....*$$$$$$$$=====================&...-$$$$$$$$.............@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+......%$$$$$$$$$%=-+@...&$$$$$$$=........-$$$$$$$$........................", +"................................................................................-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................=$$$$$$$$.............-$$$$$$$$@.......................#$$$$$$$$*.................%$$$$$$$$@.....=$$$$$$$$*#........*$$$$$$$&........=$$$$$$$*........................", +"................................................................................=$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$=.........................=$$$$$$$$.............*$$$$$$$%........................+$$$$$$$$&................@$$$$$$$$$.....#$$$$$$$$=.........@$$$$$$$$+........%$$$$$$$=........................", +"................................................................................$$$$$$$$$................=$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$............#$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....*$$$$$$$*..........-$$$$$$$$@........$$$$$$$$+........................", +"...............................................................................@$$$$$$$$%................$$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$+...........%$$$$$$$$-........................%$$$$$$$$@................&$$$$$$$$&....@$$$$$$$$#..........%$$$$$$$%........+$$$$$$$$#........................", +"...............................................................................+$$$$$$$$=...............#$$$$$$$$=......%$$$$$$$$...........@========@....&$$$$$$$$&..........=$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....+$$$$$$$$..........-$$$$$$$$=........&$$$$$$$$.........................", +"...............................................................................&$$$$$$$$-...............&$$$$$$$$&......=$$$$$$$$-..........=$$$$$$$*.....+$$$$$$$$%@........+$$$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.....=$$$$$$$$.........@$$$$$$$$$-........=$$$$$$$=.........................", +"...............................................................................*$$$$$$$$+...............=$$$$$$$$+......+$$$$$$$$$+.......@=$$$$$$$$@.....#$$$$$$$$$=.......=$$$$$$$$$$*........................-$$$$$$$$&................@$$$$$$$$%.....=$$$$$$$$-.......#%$$$$$$$$$+........$$$$$$$$-.........................", +"...............................................................................$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$*#..@-%$$$$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....=$$$$$$$$$-@...+&$$$$$$$$$$$........@$$$$$$$$=.........................", +"..............................................................................#$$$$$$$$*...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$=........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.....-$$$$$$$$$$$$$$$$$$$$$$$$$$%........+$$$$$$$$$%==-.....................", +"..............................................................................+$$$$$$$$=...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$=.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......................@$$$$$$$$%.................*$$$$$$$$+.....#$$$$$$$$$$$$$$$$$$$$$$$$$$=........+$$$$$$$$$$$$&.....................", +"..............................................................................=$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$=...........-$$$$$$$$$$$$$$$$$=$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.......*$$$$$$$$$$$$$$$$*%$$$$$$$*........+$$$$$$$$$$$$+.....................", +"..............................................................................%$$$$$$$$#...............+$$$$$$$$$=.........#%$$$$$$$$$$$$$$$$$$+.............=$$$$$$$$$$$$$$$+=$$$$$$$=........................&$$$$$$$$-................#$$$$$$$$*.......@$$$$$$$$$$$$$$$=.$$$$$$$$$+........$$$$$$$$$$$$@.....................", +"..............................................................................$$$$$$$$$................@$$$$$$$$$*..........@*$$$$$$$$$$$$$$$&@...............=$$$$$$$$$$$$%@.%$$$$$$$&........................*$$$$$$$$+................-$$$$$$$$=........+$$$$$$$$$$$$%+..%$$$$$$$$*........&$$$$$$$$$$$......................", +".............................................................................@+++++++++.................+++++++++#............#*$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........................+++++++++.................#++++++++@.........@*$$$$$$$$%&@...#++++++++#.........&$$$$$$$$$=......................", +"................................................................................................................................@+&====&+@.......................#-====-#.....................................................................................@+====&+..........................@+=====&+@......................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"...........................+++++++++++++++++++++++++@......................................................................#+++++++#........................#++++++++@................@++++++++#................................................................................................................................", +"...........................$$$$$$$$$$$$$$$$$$$$$$$$$$%&@...................................................................$$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$&................................................................................................................................", +"..........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.................................................................@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+................................................................................................................................", +"..........................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+................................................................+$$$$$$$$........................#$$$$$$$$*.................$$$$$$$$$@................................................................................................................................", +"..........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...............................................................&$$$$$$$%........................-$$$$$$$$=................@$$$$$$$$$..........................................$$$$$$$$&..............................................................................", +"..........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%...............................................................=$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.........................................+$$$$$$$$+..............................................................................", +".........................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-..............................................................$$$$$$$$-........................%$$$$$$$$@................=$$$$$$$$&.........................................+$$$$$$$$@..............................................................................", +".........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.............................................................#$$$$$$$$#........................$$$$$$$$$.................*$$$$$$$$+.........................................=$$$$$$$$...............................................................................", +".........................=$$$$$$$$+............+&$$$$$$$$$$$.............................................................+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........................................*$$$$$$$=...............................................................................", +".........................*$$$$$$$$#..............@%$$$$$$$$$.............................................................=$$$$$$$*........................&$$$$$$$$&................#$$$$$$$$%..........................................$$$$$$$$-...............................................................................", +".........................$$$$$$$$$................#$$$$$$$$$.............................................................*$$$$$$$=........................=$$$$$$$$+................-$$$$$$$$=.........................................#$$$$$$$$+...............................................................................", +"........................#$$$$$$$$=.................*$$$$$$$%...............#++==-+#.........................@++==++......$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-..............@++-===-++.................+$$$$$$$$................................................................................", +"........................-$$$$$$$$&.................=$$$$$$$=............+=$$$$$$$$$$=#....................-*$$$$$$$$&@..+$$$$$$$$@.......................@$$$$$$$$%.................%$$$$$$$$#...........+=$$$$$$$$$$$$*-..........#+++*$$$$$$$$++++@...........................................................................", +"........................=$$$$$$$$+.................*$$$$$$$-.........@&$$$$$$$$$$$$$$$=@................-%$$$$$$$$$$$%@.-$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$..........-%$$$$$$$$$$$$$$$$%+........$$$$$$$$$$$$$$$$$+...........................................................................", +"........................%$$$$$$$$@................@$$$$$$$$@........+%$$$$$$$$$$$$$$$$$%@.............@*$$$$$$$$$$$$$$%@=$$$$$$$=........................=$$$$$$$$-................+$$$$$$$$*........@*$$$$$$$$$$$$$$$$$$$$+......#$$$$$$$$$$$$$$$$$@...........................................................................", +"........................$$$$$$$$$.................&$$$$$$$=........=$$$$$$$$$$$$$$$$$$$$%@...........#%$$$$$$$$$$$$$$$$&%$$$$$$$&........................*$$$$$$$$#................&$$$$$$$$=.......@%$$$$$$$$$$$$$$$$$$$$$$@.....+$$$$$$$$$$$$$$$$$............................................................................", +".......................+$$$$$$$$=................#$$$$$$$$#.......=$$$$$$$$$$$$$$$$$$$$$$*..........+$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+.......%$$$$$$$$$$$$$$$$$$$$$$$&.....=$$$$$$$$$$$$$$$$=............................................................................", +".......................-$$$$$$$$&...............@%$$$$$$$&.......-$$$$$$$$$$$$$$$$$$$$$$$$+........@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@.......................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@......&$$$$$$$$$$$$$$$$$$$$$$$$%.....*$$$$$$$$$$$$$$$$-............................................................................", +".......................=$$$$$$$$+..............-%$$$$$$$*.......#$$$$$$$$$%&+@@+=$$$$$$$$$*........%$$$$$$$$$%-#.+&$$$$$$$$$$$$%........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......@$$$$$$$$$*++..#+*$$$$$$$$$.....++++$$$$$$$$*++++@............................................................................", +".......................$$$$$$$$$-++++++++++++=%$$$$$$$$%@.......%$$$$$$$$&.......+$$$$$$$$$#......&$$$$$$$$$&......@%$$$$$$$$$$=........................=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=......&$$$$$$$$+........%$$$$$$$$........#$$$$$$$$+.................................................................................", +"......................@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=@.......&$$$$$$$$+.........&$$$$$$$$-.....@$$$$$$$$$+........+$$$$$$$$$$-........................%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&......%$$$$$$$+.........=$$$$$$$*........+$$$$$$$$@.................................................................................", +"......................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-........@$$$$$$$$=..........@$$$$$$$$=.....*$$$$$$$$-..........*$$$$$$$$$+........................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+.....#$$$$$$$*..........*$$$$$$$=........=$$$$$$$$..................................................................................", +"......................&$$$$$$$$$$$$$$$$$$$$$$$$$$$$&@.........&$$$$$$$%............%$$$$$$$=....#$$$$$$$$*...........&$$$$$$$$$........................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$......#=======+.........@$$$$$$$$+........%$$$$$$$=..................................................................................", +"......................*$$$$$$$$$$$$$$$$$$$$$$$$$$$&@..........%$$$$$$$&............=$$$$$$$=....&$$$$$$$$@...........+$$$$$$$$*........................-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%.......................@%$$$$$$$$#........$$$$$$$$&..................................................................................", +"......................$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&........+$$$$$$$$@............=$$$$$$$=....$$$$$$$$=............+$$$$$$$$=........................=$$$$$$$$&++++++++++++++++&$$$$$$$$=....................++=$$$$$$$$$$........+$$$$$$$$+..................................................................................", +".....................#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=.......=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...+$$$$$$$$#............+$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.............@+-=*$$$$$$$$$$$$$$*........-$$$$$$$$@..................................................................................", +".....................+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+......$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$=...=$$$$$$$%.............+$$$$$$$$#.......................@$$$$$$$$*.................%$$$$$$$$#..........#=%$$$$$$$$$$$$$$$$$$$=........=$$$$$$$%...................................................................................", +".....................=$$$$$$$$+............+*$$$$$$$$$=.....+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$+...$$$$$$$$&.............+$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.........+%$$$$$$$$$$$$$$$$$$$$$$+........%$$$$$$$=...................................................................................", +".....................%$$$$$$$$@..............=$$$$$$$$=.....-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#..#$$$$$$$$+.............=$$$$$$$=........................&$$$$$$$$+................+$$$$$$$$*.......@=$$$$$$$$$$$$$$$$$$$$$$$$@........$$$$$$$$-...................................................................................", +".....................$$$$$$$$$...............@$$$$$$$$=.....=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...+$$$$$$$$#.............*$$$$$$$&........................*$$$$$$$$#................-$$$$$$$$=......@%$$$$$$$$$$$$$$*&&$$$$$$$$........+$$$$$$$$+...................................................................................", +"....................+$$$$$$$$=................$$$$$$$$&.....*$$$$$$$$=====================&...-$$$$$$$$.............@$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+......%$$$$$$$$$%=-+@...&$$$$$$$=........-$$$$$$$$....................................................................................", +"....................-$$$$$$$$&...............#$$$$$$$$+.....$$$$$$$$%.........................=$$$$$$$$.............-$$$$$$$$@.......................#$$$$$$$$*.................%$$$$$$$$@.....=$$$$$$$$*#........*$$$$$$$&........=$$$$$$$*....................................................................................", +"....................=$$$$$$$$+...............-$$$$$$$$+.....$$$$$$$$=.........................=$$$$$$$$.............*$$$$$$$%........................+$$$$$$$$&................@$$$$$$$$$.....#$$$$$$$$=.........@$$$$$$$$+........%$$$$$$$=....................................................................................", +"....................$$$$$$$$$................=$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$............#$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....*$$$$$$$*..........-$$$$$$$$@........$$$$$$$$+....................................................................................", +"...................@$$$$$$$$%................$$$$$$$$$......$$$$$$$$=.........................=$$$$$$$$+...........%$$$$$$$$-........................%$$$$$$$$@................&$$$$$$$$&....@$$$$$$$$#..........%$$$$$$$%........+$$$$$$$$#....................................................................................", +"...................+$$$$$$$$=...............#$$$$$$$$=......%$$$$$$$$...........@========@....&$$$$$$$$&..........=$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$+....+$$$$$$$$..........-$$$$$$$$=........&$$$$$$$$.....................................................................................", +"...................&$$$$$$$$-...............&$$$$$$$$&......=$$$$$$$$-..........=$$$$$$$*.....+$$$$$$$$%@........+$$$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.....=$$$$$$$$.........@$$$$$$$$$-........=$$$$$$$=.....................................................................................", +"...................*$$$$$$$$+...............=$$$$$$$$+......+$$$$$$$$$+.......@=$$$$$$$$@.....#$$$$$$$$$=.......=$$$$$$$$$$*........................-$$$$$$$$&................@$$$$$$$$%.....=$$$$$$$$-.......#%$$$$$$$$$+........$$$$$$$$-.....................................................................................", +"...................$$$$$$$$$................$$$$$$$$$#.......$$$$$$$$$$&#...#&$$$$$$$$$-.......%$$$$$$$$$*#..@-%$$$$$$$$$$$=........................=$$$$$$$$+................+$$$$$$$$=.....=$$$$$$$$$-@...+&$$$$$$$$$$$........@$$$$$$$$=.....................................................................................", +"..................#$$$$$$$$*...............@$$$$$$$$$........&$$$$$$$$$$$$$$$$$$$$$$$$=........&$$$$$$$$$$$$$$$$$$$$$$$$$$$+........................$$$$$$$$$.................=$$$$$$$$-.....-$$$$$$$$$$$$$$$$$$$$$$$$$$%........+$$$$$$$$$%==-.................................................................................", +"..................+$$$$$$$$=...............+$$$$$$$$$.........%$$$$$$$$$$$$$$$$$$$$$$=.........@$$$$$$$$$$$$$$$$$$$$$$$$$$$#.......................@$$$$$$$$%.................*$$$$$$$$+.....#$$$$$$$$$$$$$$$$$$$$$$$$$$=........+$$$$$$$$$$$$&.................................................................................", +"..................=$$$$$$$$+...............+$$$$$$$$$@........@$$$$$$$$$$$$$$$$$$$$$=...........-$$$$$$$$$$$$$$$$$=$$$$$$$$........................+$$$$$$$$=.................$$$$$$$$$.......*$$$$$$$$$$$$$$$$*%$$$$$$$*........+$$$$$$$$$$$$+.................................................................................", +"..................%$$$$$$$$#...............+$$$$$$$$$=.........#%$$$$$$$$$$$$$$$$$$+.............=$$$$$$$$$$$$$$$+=$$$$$$$=........................&$$$$$$$$-................#$$$$$$$$*.......@$$$$$$$$$$$$$$$=.$$$$$$$$$+........$$$$$$$$$$$$@.................................................................................", +"..................$$$$$$$$$................@$$$$$$$$$*..........@*$$$$$$$$$$$$$$$&@...............=$$$$$$$$$$$$%@.%$$$$$$$&........................*$$$$$$$$+................-$$$$$$$$=........+$$$$$$$$$$$$%+..%$$$$$$$$*........&$$$$$$$$$$$..................................................................................", +".................@+++++++++.................+++++++++#............#*$$$$$$$$$$%&@..................+%$$$$$$$$%-...++++++++@........................+++++++++.................#++++++++@.........@*$$$$$$$$%&@...#++++++++#.........&$$$$$$$$$=..................................................................................", +"....................................................................@+&====&+@.......................#-====-#.....................................................................................@+====&+..........................@+=====&+@..................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................", +"................................................................................................................................................................................................................................................................................................................................"};
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/sa11x0/assabet/current/src/redboot_cmds.c @@ -0,0 +1,128 @@ +//========================================================================== +// +// redboot_cmds.c +// +// Assabet [platform] specific RedBoot commands +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 2000-07-14 +// Purpose: +// Description: +// +// This code is part of RedBoot (tm). +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include <redboot.h> + +#include <cyg/hal/hal_sa11x0.h> // Board definitions +#include <cyg/hal/assabet.h> +#include <cyg/hal/hal_intr.h> +#include <cyg/hal/hal_cache.h> + + +// Exported CLI function(s) +RedBoot_cmd("exec", + "Execute an image - with MMU off", + "[-w timeout] [<entry_point>]", + do_exec + ); + +typedef void code_fun(void); + +static void +do_exec(int argc, char *argv[]) +{ + unsigned long entry; + unsigned long oldints; + code_fun *fun, *prg; + bool wait_time_set; + int wait_time, res, i; + struct option_info opts[1]; + char line[8]; + unsigned long _prg[32], *ip; + + entry = (unsigned long)entry_address; // Default from last 'load' operation + init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, + (void **)&wait_time, (bool *)&wait_time_set, "wait timeout"); + if (!scan_opts(argc, argv, 1, opts, 1, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address")) + { + return; + } + if (wait_time_set) { + printf("About to start execution at %p - abort with ^C within %d seconds\n", + (void *)entry, wait_time); + res = gets(line, sizeof(line), wait_time*1000); + if (res == -2) { + return; + } + } + ip = (unsigned long *)&&lab1; + for (i = 0; i < (unsigned long)&&end1-(unsigned long)&&lab1; i++) { + _prg[i] = *ip++; + } + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + ip = (unsigned long *)_prg; + // Not call this code + fun = (code_fun *)(entry + SA11X0_RAM_BANK0_BASE); // Absolute address + prg = (code_fun *)((unsigned long)ip + SA11X0_RAM_BANK0_BASE); // Absolute address + asm volatile ("mov r5,%0" : : "r"(fun) : "r5"); + asm volatile ("mov r1,%0; mov pc,r1" : : "r"(prg)); + lab1: + // Tricky code. We are currently running with the MMU on and the + // memory map convoluted from 1-1. This code must be copied to RAM + // and then executed at the non-mapped address. Then when the code + // turns off the MMU, the control flow is unchanged and control can + // be passed safely to the program to be executed. + // This magic was created in order to be able to execute standard + // Linux kernels with as little change/perturberance as possible. + asm volatile ("mrs r0,cpsr;" + "msr spsr,r0;" + "bic r0,r0,#0x1F;" // Put processor in IRQ mode + "orr r0,r0,#0x12;" + "msr cpsr,r0;" + "mov lr,r5;" + "mov sp,r5;" // Give the kernel a stack just below the entry point + "mov r1,#0;" + "mcr p15,0,r1,c1,c0;" + "mov r0,#0;" // Set up Assabet load magic + "mov r1,#0x19;" + "movs pc,lr" : : ); + end1: +}
--- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,15 @@ +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * include/hal_tables.h (CYG_HAL_TABLE_EXTRA): Use new definition of + CYGBLD_ATTRIB_SECTION, and fix the string name up better. + (CYG_HAL_TABLE_ENTRY): Ditto + (CYG_HAL_TABLE_QUALIFIED_ENTRY): Ditto + +2000-09-07 Jonathan Larmour <jlarmour@redhat.com> + + * include/hal_tables.h: Fix non-standard use of paste operator to + remove warnings with recent gcc + 2000-09-04 Jonathan Larmour <jlarmour@redhat.com> * include/hal_tables.h (CYG_HAL_TABLE_END): Use CYGARC_P2ALIGNMENT
--- a/packages/hal/common/current/include/hal_tables.h +++ b/packages/hal/common/current/include/hal_tables.h @@ -59,7 +59,7 @@ #ifndef CYG_HAL_TABLE_BEGIN #define CYG_HAL_TABLE_BEGIN( _label, _name ) \ -__asm__(".section \"" __string(.ecos.table.##_name##.begin) "\",\"aw\"\n" \ +__asm__(".section \".ecos.table." __xstring(_name) ".begin\",\"aw\"\n" \ ".globl " __xstring(CYG_LABEL_DEFN(_label)) "\n" \ ".type " __xstring(CYG_LABEL_DEFN(_label)) ",@object\n" \ ".p2align " __xstring(CYGARC_P2ALIGNMENT) "\n" \ @@ -70,7 +70,7 @@ #ifndef CYG_HAL_TABLE_END #define CYG_HAL_TABLE_END( _label, _name ) \ -__asm__(".section \"" __string(.ecos.table.##_name##.finish) "\",\"aw\"\n" \ +__asm__(".section \".ecos.table." __xstring(_name) ".finish\",\"aw\"\n" \ ".globl " __xstring(CYG_LABEL_DEFN(_label)) "\n" \ ".type " __xstring(CYG_LABEL_DEFN(_label)) ",@object\n" \ ".p2align " __xstring(CYGARC_P2ALIGNMENT) "\n" \ @@ -87,20 +87,18 @@ #ifndef CYG_HAL_TABLE_EXTRA #define CYG_HAL_TABLE_EXTRA( _name ) \ - CYGBLD_ATTRIB_SECTION(.ecos.table.##_name##.extra) \ - CYGBLD_ATTRIB_ALIGN( CYGARC_ALIGNMENT ) + CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".extra") #endif #ifndef CYG_HAL_TABLE_ENTRY #define CYG_HAL_TABLE_ENTRY( _name ) \ - CYGBLD_ATTRIB_SECTION(.ecos.table.##_name##.data) \ - CYGBLD_ATTRIB_ALIGN( CYGARC_ALIGNMENT ) + CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".data") #endif #ifndef CYG_HAL_TABLE_QUALIFIED_ENTRY #define CYG_HAL_TABLE_QUALIFIED_ENTRY( _name, _qual ) \ - CYGBLD_ATTRIB_SECTION(.ecos.table.##_name##.data.##_qual) \ - CYGBLD_ATTRIB_ALIGN( CYGARC_ALIGNMENT ) + CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".data." \ + __xstring(_qual)) #endif /*------------------------------------------------------------------------*/
--- a/packages/hal/mips/arch/current/ChangeLog +++ b/packages/hal/mips/arch/current/ChangeLog @@ -1,3 +1,19 @@ +2000-09-07 Jesper Skov <jskov@redhat.com> + + * include/basetype.h: Removed change from yesterday. + + * include/hal_intr.h (CYGNUM_HAL_EXCEPTION_FPU): Associated to FPE + exceptions. + +2000-09-06 Jesper Skov <jskov@redhat.com> + + * include/basetype.h: Override the alignment macros for the MIPS + architecture. The MIPS compiler only alows a maximum of 4 bytes + of alignment where as the default is 8 + + * include/hal_cache.h (_HAL_ASM_DCACHE_ALL_WAYS): Force d-cache + selection. + 2000-09-01 Jonathan Larmour <jlarmour@redhat.com> * include/mips-stub.h: No longer need to define
--- a/packages/hal/mips/arch/current/include/hal_cache.h +++ b/packages/hal/mips/arch/current/include/hal_cache.h @@ -96,19 +96,19 @@ #if (HAL_DCACHE_WAYS == 1) #define _HAL_ASM_DCACHE_ALL_WAYS( _cmd_ , _addr_ ) \ asm volatile ("cache %0,0(%1);" \ - : : "I" (_cmd_), "r"(_addr_) ) + : : "I" ((_cmd_) | 1), "r"(_addr_) ) #elif (HAL_DCACHE_WAYS == 2) #define _HAL_ASM_DCACHE_ALL_WAYS( _cmd_ , _addr_ ) \ asm volatile ("cache %0,0(%1);" \ "cache %0,1(%1);" \ - : : "I" (_cmd_), "r"(_addr_) ) + : : "I" ((_cmd_) | 1), "r"(_addr_) ) #elif (HAL_DCACHE_WAYS == 4) #define _HAL_ASM_DCACHE_ALL_WAYS( _cmd_ , _addr_ ) \ asm volatile ("cache %0,0(%1);" \ "cache %0,1(%1);" \ "cache %0,2(%1);" \ "cache %0,3(%1);" \ - : : "I" (_cmd_), "r"(_addr_) ) + : : "I" ((_cmd_) | 1), "r"(_addr_) ) #else # error "Unsupported number of ways" #endif
--- a/packages/hal/mips/arch/current/include/hal_intr.h +++ b/packages/hal/mips/arch/current/include/hal_intr.h @@ -127,6 +127,7 @@ #define CYGNUM_HAL_EXCEPTION_COPROCESSOR CYGNUM_HAL_VECTOR_COPROCESSOR #define CYGNUM_HAL_EXCEPTION_OVERFLOW CYGNUM_HAL_VECTOR_OVERFLOW #define CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO CYGNUM_HAL_VECTOR_DIV_BY_ZERO +#define CYGNUM_HAL_EXCEPTION_FPU CYGNUM_HAL_VECTOR_FPE #define CYGNUM_HAL_EXCEPTION_INTERRUPT CYGNUM_HAL_VECTOR_BREAKPOINT
deleted file mode 100644 --- a/packages/hal/mips/sim/current/include/pkgconf/hal_mips_vr4300_sim.h +++ /dev/null @@ -1,1 +0,0 @@ -#include <pkgconf/hal_mips_sim.h>
--- a/packages/hal/mn10300/am31/current/ChangeLog +++ b/packages/hal/mn10300/am31/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-07 Nick Garnett <nickg@cygnus.co.uk> + + * include/variant.inc: + Added defines for CYGPKG_HAL_MN10300_INTC_DECODE_DEFINED. + 2000-06-21 Nick Garnett <nickg@cygnus.co.uk> * src/mn10300_am31.ld:
--- a/packages/hal/mn10300/am31/current/include/variant.inc +++ b/packages/hal/mn10300/am31/current/include/variant.inc @@ -183,6 +183,8 @@ nmid\@: add 12,\dreg # skip NMI vectors .endm +#define CYGPKG_HAL_MN10300_INTC_DECODE_DEFINED + #else #define CYG_ISR_TABLE_SIZE 34 @@ -194,7 +196,9 @@ nmid\@: mov \dreg,(0,a2) # store real vector in saved state add 12,\dreg # skip NMI vectors .endm - + +#define CYGPKG_HAL_MN10300_INTC_DECODE_DEFINED + #endif #define CYGPKG_HAL_MN10300_INTC_DEFINED
--- a/packages/hal/sh/arch/current/ChangeLog +++ b/packages/hal/sh/arch/current/ChangeLog @@ -1,7 +1,16 @@ +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * include/mod_7729.h: Includes PFC (programmable I/O) module. + +2000-09-06 Jesper Skov <jskov@redhat.com> + + * cdl/hal_sh.cdl: Added 7729 option. + 2000-08-31 Jesper Skov <jskov@redhat.com> * include/mod_7709a.h: Added UBC definition. * include/mod_7708.h: Same. + * include/mod_7729.h: Same. * include/mod_7707a.h: Same. * include/sh_regs.h: Extra UBC definitions. * src/sh_stub.c: If core supports UBC, use it for @@ -15,7 +24,6 @@ 2000-07-18 Gary Thomas <gthomas@redhat * src/vectors.S (__reset): Change calculation of uncached startup address. - * include/mod_7707a.h: 7707a has 32K caches (we believe). 2000-07-17 Gary Thomas <gthomas@redhat.com>
--- a/packages/hal/sh/arch/current/cdl/hal_sh.cdl +++ b/packages/hal/sh/arch/current/cdl/hal_sh.cdl @@ -139,6 +139,22 @@ cdl_package CYGPKG_HAL_SH { } } + cdl_option CYGPKG_HAL_SH_7729 { + display "SH 7729 microprocessor" + implements CYGINT_HAL_SH_VARIANT + default_value 0 + no_define + define -file=system.h CYGPKG_HAL_SH_7729 + description " + The SH3 7729 microprocessor. This is an embedded part that in + addition to the SH3 processor core has built in peripherals + such as memory controllers, serial ports, and timers/counters, + and a DSP engine." + define_proc { + puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7729.h>" + } + } + cdl_option CYGHWR_HAL_SH_BIGENDIAN { display "Use big-endian mode" default_value 1
--- a/packages/hal/sh/arch/current/include/hal_intr.h +++ b/packages/hal/sh/arch/current/include/hal_intr.h @@ -188,7 +188,6 @@ #endif // CYGARC_SH_MOD_INTC_V3 - // CYGNUM_HAL_ISR_COUNT must match CYG_ISR_TABLE_SIZE defined in vectors.S. #define CYGNUM_HAL_ISR_MIN CYGNUM_HAL_INTERRUPT_NMI #define CYGNUM_HAL_ISR_COUNT ( CYGNUM_HAL_ISR_MAX + 1 )
new file mode 100644 --- /dev/null +++ b/packages/hal/sh/arch/current/include/mod_7729.h @@ -0,0 +1,82 @@ +#ifndef CYGONCE_HAL_MOD_77xx_H +#define CYGONCE_HAL_MOD_77xx_H + +//============================================================================= +// +// mod_7729.h +// +// List modules available on CPU +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:jskov +// Date: 2000-08-29 +// Purpose: Define modules (and versions) available on this CPU. +// Usage: Included from <cyg/hal/sh_regs.h> +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +//----------------------------------------------------------------------------- +// Modules provided by the CPU + +#define CYGARC_SH_MOD_BCN_V2 +#define CYGARC_SH_MOD_INTC_V2 +#define CYGARC_SH_MOD_INTC_V3 +#define CYGARC_SH_MOD_PFC +#define CYGARC_SH_MOD_IRDA +#define CYGARC_SH_MOD_SCIF +#define CYGARC_SH_MOD_UBC + +//----------------------------------------------------------------------------- +// Extra details for Cache Module (CAC) + +// Cache dimenions - one unified cache +#define CYGARC_SH_MOD_CAC_SIZE 16384 // Size of cache in bytes +#define CYGARC_SH_MOD_CAC_LINE_SIZE 16 // Size of a cache line +#define CYGARC_SH_MOD_CAC_WAYS 4 // Associativity of the cache + +// Cache addressing information +// way: bits 13 - 12 +// entry: bits 11 - 4 +#define CYGARC_SH_MOD_CAC_ADDRESS_BASE 0xf0000000 +#define CYGARC_SH_MOD_CAC_ADDRESS_TOP 0xf0004000 +#define CYGARC_SH_MOD_CAC_ADDRESS_STEP 0x00000010 +// U : bit 1 +// V : bit 0 +// Writing zero to both forces a flush of the line if it is dirty. +#define CYGARC_SH_MOD_CAC_ADDRESS_FLUSH 0x00000000 + +//----------------------------------------------------------------------------- +// Extra details for interrupt handling +#define CYGARC_SH_SOFTWARE_IP_UPDATE + +#endif // CYGONCE_HAL_MOD_77xx_H
--- a/packages/hal/v85x/arch/current/ChangeLog +++ b/packages/hal/v85x/arch/current/ChangeLog @@ -1,3 +1,15 @@ +2000-09-07 Jonathan Larmour <jlarmour@redhat.com> + + * include/basetype.h: Don't need special alignment after all - it was + a bug elsewhere. + +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * include/basetype.h: Need special alignment to match the way + the compiler/linker actually do things. + + * cdl/hal_v85x.cdl: Improve variant handling and specification. + 2000-08-30 Gary Thomas <gthomas@redhat.com> * src/vectors.S (start): Allow programs to field NMI exceptions.
--- a/packages/hal/v85x/arch/current/cdl/hal_v85x.cdl +++ b/packages/hal/v85x/arch/current/cdl/hal_v85x.cdl @@ -53,6 +53,7 @@ cdl_package CYGPKG_HAL_V85X { cdl_interface CYGINT_HAL_V85X_VARIANT { display "Number of variant implementations in this configuration" + no_define requires 1 == CYGINT_HAL_V85X_VARIANT }
--- a/packages/hal/v85x/v850/current/ChangeLog +++ b/packages/hal/v85x/v850/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_v85x_v850.cdl: Improve [CPU] variant support. + 2000-07-24 Jonathan Larmour <jlarmour@redhat.co.uk> * src/v850_stub.c (__is_breakpoint_function): Removed use
--- a/packages/hal/v85x/v850/current/cdl/hal_v85x_v850.cdl +++ b/packages/hal/v85x/v850/current/cdl/hal_v85x_v850.cdl @@ -57,6 +57,14 @@ cdl_package CYGPKG_HAL_V85X_V850 { compile v850_stub.c v850_misc.c context.S + cdl_interface CYGINT_HAL_V85X_VARIANT_SA1 { + display "Defined if CPU is a V850/SA1" + } + + cdl_interface CYGINT_HAL_V85X_VARIANT_SB1 { + display "Defined if CPU is a V850/SB1" + } + make { <PREFIX>/lib/target.ld: <PACKAGE>/src/v85x_v850.ld $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
--- a/packages/infra/current/ChangeLog +++ b/packages/infra/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-08 Jonathan Larmour <jlarmour@redhat.com> + + * include/cyg_type.h (CYGBLD_ATTRIB_SECTION): Don't stringify arg. + 2000-09-04 Jonathan Larmour <jlarmour@redhat.com> * include/cyg_type.h (CYGARC_ALIGNMENT): Add default of 8
--- a/packages/infra/current/include/cyg_type.h +++ b/packages/infra/current/include/cyg_type.h @@ -301,7 +301,7 @@ typedef cyg_haladdrword CYG_ADDRWORD; # define CYGBLD_ATTRIB_CONST __attribute__((const)) // Assign a defined variable to a specific section -# define CYGBLD_ATTRIB_SECTION(__sect__) __attribute__((section (#__sect__))) +# define CYGBLD_ATTRIB_SECTION(__sect__) __attribute__((section (__sect__))) // Give a type or object explicit minimum alignment # define CYGBLD_ATTRIB_ALIGN(__align__) __attribute__((aligned(__align__))) @@ -312,7 +312,7 @@ typedef cyg_haladdrword CYG_ADDRWORD; # define CYGBLD_ATTRIB_NORET // This intentionally gives an error only if we actually try to - // use it. #error would give an error if we simple can't. + // use it. #error would give an error if we simply can't. // FIXME: Had to disarm the bomb - the CYGBLD_ATTRIB_WEAK macro is now // (indirectly) used in host tools. # define CYGBLD_ATTRIB_WEAK /* !!!-- Attribute weak not defined --!!! */
--- a/packages/io/common/current/ChangeLog +++ b/packages/io/common/current/ChangeLog @@ -1,3 +1,7 @@ +2000-09-07 Jesper Skov <jskov@redhat.com> + + * include/devtab.h (cyg_devtab_entry_t): Fix syntax problem. + 2000-09-04 Jonathan Larmour <jlarmour@redhat.com> * include/devtab.h (cyg_devtab_entry_t): Apply CYG_HAL_TABLE_TYPE
--- a/packages/io/common/current/include/devtab.h +++ b/packages/io/common/current/include/devtab.h @@ -132,7 +132,7 @@ typedef struct cyg_devtab_entry { const char *name); void *priv; unsigned long status; -} cyg_devtab_entry_t CYG_HAL_TABLE_TYPE; +} CYG_HAL_TABLE_TYPE cyg_devtab_entry_t; #define CYG_DEVTAB_STATUS_AVAIL 0x0001 #define CYG_DEVTAB_STATUS_CHAR 0x1000
--- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,17 @@ +2000-09-08 Hugo Tyson <hmt@cygnus.co.uk> + + * include/netdev.h (NETDEVTAB_ENTRY): Work around feature of new + version of CYG_HAL_TABLE_ENTRY() whereby no spaces are allowed. + +2000-09-07 Jonathan Larmour <jlarmour@redhat.com> + + * include/netdev.h (cyg_netdevtab_entry_t): Correct syntax for + CYG_HAL_TABLE_TYPE + +2000-09-04 Jonathan Larmour <jlarmour@redhat.com> + + * include/netdev.h (cyg_netdevtab_entry_t): Apply CYG_HAL_TABLE_TYPE + 2000-09-01 Hugo Tyson <hmt@cygnus.co.uk> * src/stand_alone/eth_drv.c (eth_drv_dsr): New function, never
--- a/packages/io/eth/current/include/netdev.h +++ b/packages/io/eth/current/include/netdev.h @@ -63,7 +63,7 @@ typedef struct cyg_netdevtab_entry { bool (*init)(struct cyg_netdevtab_entry *tab); void *device_instance; // Local data, instance specific unsigned long status; -} cyg_netdevtab_entry_t; +} CYG_HAL_TABLE_TYPE cyg_netdevtab_entry_t; #define CYG_NETDEVTAB_STATUS_AVAIL 0x0001 @@ -71,7 +71,7 @@ extern cyg_netdevtab_entry_t __NETDEVTAB #define NETDEVTAB_ENTRY(_l,_name,_init,_instance) \ static bool _init(struct cyg_netdevtab_entry *tab); \ -cyg_netdevtab_entry_t _l CYG_HAL_TABLE_ENTRY( netdev ) = { \ +cyg_netdevtab_entry_t _l CYG_HAL_TABLE_ENTRY(netdev) = { \ _name, \ _init, \ _instance \
--- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,17 @@ +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * tests/select.c: NA if no POSIX package + + * cdl/fileio.cdl: Set CYGBLD_ISO_OPEN_MAX_HEADER to this package's + limits.h + * include/limits.h: New file to define OPEN_MAX (and other things in + future) + +2000-09-08 Nick Garnett <nickg@cygnus.co.uk> + + * include/fileio.h: + Removed spaces from arguments to CYG_HAL_TABLE_ENTRY(). + 2000-09-04 Jonathan Larmour <jlarmour@redhat.com> * include/sockio.h (struct cyg_nstab_entry): Apply CYG_HAL_TABLE_TYPE
--- a/packages/io/fileio/current/cdl/fileio.cdl +++ b/packages/io/fileio/current/cdl/fileio.cdl @@ -57,6 +57,7 @@ cdl_package CYGPKG_IO_FILEIO { implements CYGINT_ISO_DIRENT requires { CYGBLD_ISO_DIRENT_HEADER == "<cyg/fileio/dirent.h>" } + requires { CYGBLD_ISO_OPEN_MAX_HEADER == "<cyg/fileio/limits.h>" } compile fd.cxx file.cxx io.cxx select.cxx dir.cxx compile -library=libextras.a devfs.cxx misc.cxx
--- a/packages/io/fileio/current/include/fileio.h +++ b/packages/io/fileio/current/include/fileio.h @@ -158,7 +158,7 @@ struct cyg_fstab_entry #define FSTAB_ENTRY( _l, _name, _data, _syncmode, _mount, _umount, \ _open, _unlink, _mkdir, _rmdir, _rename, _link, \ _opendir, _chdir, _stat, _getinfo, _setinfo) \ -struct cyg_fstab_entry _l CYG_HAL_TABLE_ENTRY( fstab ) = \ +struct cyg_fstab_entry _l CYG_HAL_TABLE_ENTRY(fstab) = \ { \ _name, \ _data, \ @@ -198,7 +198,7 @@ struct cyg_mtab_entry // This macro defines an initialized mtab entry #define MTAB_ENTRY( _l, _name, _fsname, _devname, _data ) \ -struct cyg_mtab_entry _l CYG_HAL_TABLE_ENTRY( mtab ) = \ +struct cyg_mtab_entry _l CYG_HAL_TABLE_ENTRY(mtab) = \ { \ _name, \ _fsname, \
new file mode 100644 --- /dev/null +++ b/packages/io/fileio/current/include/limits.h @@ -0,0 +1,55 @@ +#ifndef CYGONCE_IO_FILEIO_LIMITS_H +#define CYGONCE_IO_FILEIO_LIMITS_H +/*============================================================================ +// +// limits.h +// +// Fileio limits header +// +//============================================================================ +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================ +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: +// Date: 2000-09-11 +// Purpose: Provide POSIX limits for file I/O related properties +// Description: +// +// Usage: #include <limits.h> +// +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include <pkgconf/io_fileio.h> + +#define OPEN_MAX CYGNUM_FILEIO_NFILE + +/*--------------------------------------------------------------------------*/ +#endif /* ifndef CYGONCE_IO_FILEIO_LIMITS_H */ +/* End of fileio.h */
--- a/packages/io/fileio/current/tests/select.c +++ b/packages/io/fileio/current/tests/select.c @@ -45,6 +45,15 @@ //========================================================================== #include <pkgconf/system.h> + +#ifndef CYGPKG_POSIX +# define NA_MSG "POSIX package needed to run test" +#endif + +#include <cyg/infra/testcase.h> + +#ifndef NA_MSG + #include <pkgconf/hal.h> #include <pkgconf/kernel.h> #include <pkgconf/io_fileio.h> @@ -59,10 +68,6 @@ #include <cyg/infra/cyg_trac.h> // tracing macros #include <cyg/infra/cyg_ass.h> // assertion macros -#include <cyg/infra/testcase.h> - -#if 1 //defined(CYGPKG_NET) && defined(CYGPKG_POSIX) && defined(CYGPKG_IO_SERIAL_LOOP) - #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> @@ -604,11 +609,11 @@ int main( int argc, char **argv ) //========================================================================== // main -int main( int argc, char **argv ) +void cyg_start(void) { CYG_TEST_INIT(); - CYG_TEST_NA("socket"); + CYG_TEST_NA(NA_MSG); } #endif
--- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,8 @@ +2000-09-06 Jesper Skov <jskov@redhat.com> + + * tests/ser_test_protocol.inl: Renamed some option names due to SH + serial driver reorg. + 2000-08-09 Jonathan Larmour <jlarmour@redhat.co.uk> * src/common/serial.c (serial_indicate_status): Treat flow control
--- a/packages/io/serial/current/tests/ser_test_protocol.inl +++ b/packages/io/serial/current/tests/ser_test_protocol.inl @@ -198,18 +198,18 @@ #endif #if defined(CYGPKG_HAL_SH) \ && defined(CYGPKG_IO_SERIAL_SH_EDK7708) \ - && defined(CYGPKG_IO_SERIAL_SH_EDK7708_SCI) + && defined(CYGPKG_IO_SERIAL_SH_EDK7708_SERIAL1) # define TEST_CRASH_ID "sh7708" -# define TEST_SER_DEV CYGDAT_IO_SERIAL_SH_EDK7708_SCI_NAME +# define TEST_SER_DEV CYGDAT_IO_SERIAL_SH_EDK7708_SERIAL1_NAME # if defined(CYGPKG_IO_SERIAL_TTY_TTY2) # define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY1_DEV # endif #endif #if defined(CYGPKG_HAL_SH) \ && defined(CYGPKG_IO_SERIAL_SH_CQ7708) \ - && defined(CYGPKG_IO_SERIAL_SH_CQ7708_SCI) + && defined(CYGPKG_IO_SERIAL_SH_CQ7708_SERIAL1) # define TEST_CRASH_ID "cq7708" -# define TEST_SER_DEV CYGDAT_IO_SERIAL_SH_CQ7708_SCI_NAME +# define TEST_SER_DEV CYGDAT_IO_SERIAL_SH_CQ7708_SERIAL1_NAME # if defined(CYGPKG_IO_SERIAL_TTY_TTY2) # define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY1_DEV # endif
--- a/packages/isoinfra/current/ChangeLog +++ b/packages/isoinfra/current/ChangeLog @@ -1,3 +1,9 @@ +2000-09-11 Jonathan Larmour <jlarmour@redhat.com> + + * cdl/isoinfra.cdl: Add CYGBLD_ISO_{OPEN,LINK,NAME,PATH}_MAX_HEADER + * include/limits.h: Support definition of OPEN_MAX, LINK_MAX, + NAME_MAX, PATH_MAX + 2000-08-30 Jonathan Larmour <jlarmour@redhat.co.uk> * include/assert.h (assert): Fix logic
--- a/packages/isoinfra/current/cdl/isoinfra.cdl +++ b/packages/isoinfra/current/cdl/isoinfra.cdl @@ -934,6 +934,27 @@ cdl_package CYGPKG_ISOINFRA { flavor booldata default_value 0 } + + cdl_option CYGBLD_ISO_OPEN_MAX_HEADER { + display "OPEN_MAX implementation header" + flavor booldata + default_value 0 + } + cdl_option CYGBLD_ISO_LINK_MAX_HEADER { + display "LINK_MAX implementation header" + flavor booldata + default_value 0 + } + cdl_option CYGBLD_ISO_NAME_MAX_HEADER { + display "NAME_MAX implementation header" + flavor booldata + default_value 0 + } + cdl_option CYGBLD_ISO_PATH_MAX_HEADER { + display "PATH_MAX implementation header" + flavor booldata + default_value 0 + } } # ====================================================================
--- a/packages/isoinfra/current/include/limits.h +++ b/packages/isoinfra/current/include/limits.h @@ -162,6 +162,38 @@ /* INCLUDES */ +#ifdef CYGBLD_ISO_OPEN_MAX_HEADER +# include CYGBLD_ISO_OPEN_MAX_HEADER +#else +# ifndef __STRICT_ANSI__ +# define OPEN_MAX _POSIX_OPEN_MAX +# endif +#endif + +#ifdef CYGBLD_ISO_LINK_MAX_HEADER +# include CYGBLD_ISO_LINK_MAX_HEADER +#else +# ifndef __STRICT_ANSI__ +# define LINK_MAX _POSIX_LINK_MAX +# endif +#endif + +#ifdef CYGBLD_ISO_NAME_MAX_HEADER +# include CYGBLD_ISO_NAME_MAX_HEADER +#else +# ifndef __STRICT_ANSI__ +# define NAME_MAX _POSIX_NAME_MAX +# endif +#endif + +#ifdef CYGBLD_ISO_PATH_MAX_HEADER +# include CYGBLD_ISO_PATH_MAX_HEADER +#else +# ifndef __STRICT_ANSI__ +# define PATH_MAX _POSIX_PATH_MAX +# endif +#endif + #if CYGINT_ISO_POSIX_LIMITS # ifdef CYGBLD_ISO_POSIX_LIMITS_HEADER # include CYGBLD_ISO_POSIX_LIMITS_HEADER
--- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,42 @@ +2000-09-08 Nick Garnett <nickg@cygnus.co.uk> + + * include/sched.hxx: + * include/sched.inl: + Added Cyg_Scheduler::unlock_reschedule() function. This decrements + the scheduler lock by one but also permits the current thread to + be rescheduled if it ready to sleep, or there is a higher priority + thread ready to run. This is to support use of various + synchronization objects while the scheduler lock is claimed. + + * src/sched/sched.cxx (unlock_inner): Modified precondition to + allow for functionality of unlock_reschedule(). + + * src/sched/mlqueue.cxx: + Now uses Cyg_SchedulerThreadQueue_Implementation for all runqueue + pointers. It was using Cyg_ThreadQueue_Implementation in some + places which meant we were trying to sort the run queues! + Changed yield() so it can be called with the scheduler lock + claimed. + Changed Cyg_Scheduler_Implementation::timeslice() to rotate the + queue itself rather than call yield(). The changes to yield() make + it unsafe to call here any more. + + * include/mlqueue.hxx (class Cyg_SchedulerThreadQueue_Implementation): + Made enqueue() member public. + + * include/mboxt2.inl: + * src/common/thread.cxx: + * src/sync/mutex.cxx: + * src/sync/cnt_sem2.cxx: + Removed assertions for zero scheduler lock and replaced some + invocations of Cyg_Scheduler::unlock() with + Cyg_Scheduler::unlock_reschedule() or Cyg_Scheduler::reschedule() + where appropriate. + + * tests/klock.c: + * cdl/kernel.cdl: + Added klock.c to test functionality while scheduler lock is claimed. + 2000-08-17 Hugo Tyson <hmt@cygnus.co.uk> * src/sched/sched.cxx (unlock_inner): Move an assert to some place
--- a/packages/kernel/current/cdl/kernel.cdl +++ b/packages/kernel/current/cdl/kernel.cdl @@ -307,12 +307,12 @@ cdl_package CYGPKG_KERNEL { flavor data no_define calculated { - CYGPKG_HAL_ARM_AEB ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ - CYGPKG_HAL_ARM_EBSA285 ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" : \ - CYGPKG_HAL_ARM_EDB7XXX ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" : \ - CYGPKG_HAL_ARM_CMA230 ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ - CYGPKG_HAL_ARM ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ - "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" + CYGPKG_HAL_ARM_AEB ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ + CYGPKG_HAL_ARM_EBSA285 ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" : \ + CYGPKG_HAL_ARM_EDB7XXX ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" : \ + CYGPKG_HAL_ARM_CMA230 ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ + CYGPKG_HAL_ARM ? "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone" : \ + "tests/bin_sem0 tests/bin_sem1 tests/bin_sem2 tests/clock0 tests/clock1 tests/clockcnv tests/cnt_sem0 tests/cnt_sem1 tests/except1 tests/flag0 tests/flag1 tests/intr0 tests/kclock0 tests/kclock1 tests/kexcept1 tests/kintr0 tests/kmbox1 tests/kmutex0 tests/kmutex1 tests/ksched1 tests/ksem0 tests/ksem1 tests/kflag0 tests/kflag1 tests/klock tests/kthread0 tests/kthread1 tests/mbox1 tests/mqueue1 tests/mutex0 tests/mutex1 tests/mutex2 tests/mutex3 tests/sched1 tests/sync2 tests/sync3 tests/thread0 tests/thread1 tests/thread2 tests/release tests/kill tests/thread_gdb tests/tm_basic tests/dhrystone tests/stress_threads tests/kcache1 tests/kcache2" } description " This option specifies the set of tests for the eCos kernel."
--- a/packages/kernel/current/include/mboxt2.inl +++ b/packages/kernel/current/include/mboxt2.inl @@ -266,11 +266,9 @@ Cyg_Mboxt2<T,QUEUE_SIZE>::get( T &ritem get_threadq.enqueue( self ); CYG_INSTRUMENT_MBOXT(WAIT, this, count); - CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), - "Called with non-zero scheduler lock"); // Unlock scheduler and allow other threads to run - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); cyg_bool result = true; switch( self->get_wake_reason() ) @@ -349,11 +347,8 @@ Cyg_Mboxt2<T,QUEUE_SIZE>::get( T &ritem, CYG_INSTRUMENT_MBOXT(WAIT, this, count); } - CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), - "Called with non-zero scheduler lock"); - // Unlock scheduler and allow other threads to run - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); // clear the timer; if it actually fired, no worries. self->clear_timer(); @@ -475,11 +470,9 @@ Cyg_Mboxt2<T,QUEUE_SIZE>::put( const T i put_threadq.enqueue( self ); CYG_INSTRUMENT_MBOXT(WAIT, this, count); - CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), - "Called with non-zero scheduler lock"); // when this returns, our item is in the queue. - Cyg_Scheduler::unlock(); // unlock, switch threads + Cyg_Scheduler::unlock_reschedule(); // unlock, switch threads CYG_ASSERTCLASS( this, "Bad this pointer"); @@ -565,11 +558,9 @@ Cyg_Mboxt2<T,QUEUE_SIZE>::put( const T i CYG_INSTRUMENT_MBOXT(WAIT, this, count); } - CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), - "Called with non-zero scheduler lock"); // when this returns, our item is in the queue. - Cyg_Scheduler::unlock(); // unlock, switch threads + Cyg_Scheduler::unlock_reschedule(); // unlock, switch threads // clear the timer; if it actually fired, no worries. self->clear_timer();
--- a/packages/kernel/current/include/mlqueue.hxx +++ b/packages/kernel/current/include/mlqueue.hxx @@ -143,6 +143,7 @@ inline cyg_bool Cyg_ThreadQueue_Implemen class Cyg_SchedulerThreadQueue_Implementation : public Cyg_ThreadQueue_Implementation { +public: void enqueue(Cyg_Thread *thread); // Add thread to queue };
--- a/packages/kernel/current/include/sched.hxx +++ b/packages/kernel/current/include/sched.hxx @@ -128,9 +128,13 @@ public: // release the preemption lock and possibly reschedule static void unlock(); - // release and reclaim the lock atomically + // release and reclaim the lock atomically, keeping the old + // value on restart static void reschedule(); - + + // decrement the lock but also look for a reschedule opportunity + static void unlock_reschedule(); + // release the preemption lock without rescheduling static void unlock_simple();
--- a/packages/kernel/current/include/sched.inl +++ b/packages/kernel/current/include/sched.inl @@ -107,6 +107,19 @@ inline void Cyg_Scheduler::reschedule() unlock_inner( sched_lock ); } +inline void Cyg_Scheduler:: unlock_reschedule() +{ + // This function decrements the scheduler lock and also looks for + // a reschedule opportunity. When the lock is being decremented + // from 1 to zero this function is equivalent to unlock. When the + // lock is being decremented to a non-zero value, it is equivalent + // to unlock() followed by reschedule(). + + CYG_INSTRUMENT_SCHED(UNLOCK,sched_lock,0); + + unlock_inner( sched_lock - 1 ); +} + inline void Cyg_Scheduler::unlock_simple() { // This function decrements the lock, but does not call unlock_inner().
--- a/packages/kernel/current/src/common/thread.cxx +++ b/packages/kernel/current/src/common/thread.cxx @@ -458,11 +458,7 @@ Cyg_Thread::counted_sleep( cyg_tick_coun current->sleep(); // prepare to sleep current->state |= COUNTSLEEP; // Set the state - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, - "Called with non-zero scheduler lock"); - - Cyg_Scheduler::unlock(); - Cyg_Scheduler::lock(); + Cyg_Scheduler::reschedule(); // clear the timer; if it actually fired, no worries. clear_timer();
--- a/packages/kernel/current/src/sched/mlqueue.cxx +++ b/packages/kernel/current/src/sched/mlqueue.cxx @@ -135,8 +135,8 @@ Cyg_Scheduler_Implementation::add_thread CYG_REPORT_FUNCTION(); CYG_REPORT_FUNCARG1("thread=%08x", thread); - cyg_priority pri = thread->priority; - Cyg_ThreadQueue_Implementation *queue = &run_queue[pri]; + cyg_priority pri = thread->priority; + Cyg_SchedulerThreadQueue_Implementation *queue = &run_queue[pri]; CYG_ASSERT((CYG_THREAD_MIN_PRIORITY >= pri) && (CYG_THREAD_MAX_PRIORITY <= pri), @@ -186,8 +186,8 @@ Cyg_Scheduler_Implementation::rem_thread CYG_ASSERT( queue_map != 0, "Run queue empty"); - cyg_priority pri = thread->priority; - Cyg_ThreadQueue_Implementation *queue = &run_queue[pri]; + cyg_priority pri = thread->priority; + Cyg_SchedulerThreadQueue_Implementation *queue = &run_queue[pri]; CYG_ASSERT( pri != CYG_THREAD_MIN_PRIORITY, "Idle thread trying to sleep!"); CYG_ASSERT( queue_map & (1<<pri), "Queue map bit not set for pri"); @@ -272,8 +272,24 @@ Cyg_Scheduler_Implementation::timeslice( #ifdef CYGDBG_KERNEL_TRACE_TIMESLICE CYG_TRACE0( true, "quantum consumed, time to reschedule" ); #endif - // And force the current thread to yield. - current_thread->yield(); + + CYG_ASSERT( sched_lock > 0 , "Timeslice called with zero sched_lock"); + + Cyg_Thread *thread = current_thread; + Cyg_Scheduler *sched = &Cyg_Scheduler::scheduler; + + CYG_ASSERTCLASS( thread, "Bad current thread"); + CYG_ASSERTCLASS( sched, "Bad scheduler"); + + cyg_priority pri = thread->priority; + Cyg_SchedulerThreadQueue_Implementation *queue = &sched->run_queue[pri]; + + queue->rotate(); + + if( queue->highpri() != thread ) + sched->need_reschedule = true; + + timeslice_count = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; } @@ -377,8 +393,8 @@ Cyg_SchedThread_Implementation::yield(vo CYG_ASSERTCLASS( sched, "Bad scheduler"); - cyg_priority pri = thread->priority; - Cyg_ThreadQueue_Implementation *queue = &sched->run_queue[pri]; + cyg_priority pri = thread->priority; + Cyg_SchedulerThreadQueue_Implementation *queue = &sched->run_queue[pri]; queue->rotate(); @@ -392,8 +408,16 @@ Cyg_SchedThread_Implementation::yield(vo } // Unlock the scheduler and switch threads - Cyg_Scheduler::unlock(); +#ifdef CYGDBG_USE_ASSERTS + // This test keeps the assertions in unlock_inner() happy if + // need_reschedule was not set above. + if( !Cyg_Scheduler::need_reschedule ) + Cyg_Scheduler::unlock(); + else +#endif + Cyg_Scheduler::unlock_reschedule(); + CYG_REPORT_RETURN(); } @@ -414,7 +438,7 @@ Cyg_SchedThread_Implementation::rotate_q CYG_ASSERTCLASS( sched, "Bad scheduler"); - Cyg_ThreadQueue_Implementation *queue = &sched->run_queue[pri]; + Cyg_SchedulerThreadQueue_Implementation *queue = &sched->run_queue[pri]; if ( !queue->empty() ) { queue->rotate();
--- a/packages/kernel/current/src/sched/sched.cxx +++ b/packages/kernel/current/src/sched/sched.cxx @@ -121,7 +121,8 @@ void Cyg_Scheduler::unlock_inner( cyg_uc do { - CYG_PRECONDITION( new_lock==0 ? sched_lock == 1 : sched_lock == new_lock, + CYG_PRECONDITION( new_lock==0 ? sched_lock == 1 : + ((sched_lock == new_lock) || (sched_lock == new_lock+1)), "sched_lock not at expected value" ); #ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS
--- a/packages/kernel/current/src/sync/cnt_sem2.cxx +++ b/packages/kernel/current/src/sync/cnt_sem2.cxx @@ -114,9 +114,6 @@ cyg_bool Cyg_Counting_Semaphore2::wait() CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, - "Called with non-zero scheduler lock"); - Cyg_Scheduler::unlock(); CYG_INSTRUMENT_CNTSEM( WOKE, this, count ); @@ -180,8 +177,6 @@ Cyg_Counting_Semaphore2::wait( cyg_tick_ CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, - "Called with non-zero scheduler lock"); Cyg_Scheduler::unlock();
--- a/packages/kernel/current/src/sync/mutex.cxx +++ b/packages/kernel/current/src/sync/mutex.cxx @@ -557,11 +557,7 @@ Cyg_Condition_Variable::wait_inner( Cyg_ cyg_bool result = true; Cyg_Thread *self = Cyg_Thread::self(); - cyg_int32 current_lock = Cyg_Scheduler::get_sched_lock(); - - if (current_lock == 0) - // Prevent preemption - Cyg_Scheduler::lock(); + Cyg_Scheduler::lock(); CYG_ASSERTCLASS( this, "Bad this pointer"); CYG_ASSERTCLASS( mx, "Corrupt mutex"); @@ -577,13 +573,11 @@ Cyg_Condition_Variable::wait_inner( Cyg_ queue.enqueue( self ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); - // Avoid calling ASRs during the following unlock. self->set_asr_inhibit(); // Unlock the scheduler and switch threads - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); // Allow ASRs again self->clear_asr_inhibit(); @@ -626,10 +620,6 @@ Cyg_Condition_Variable::wait_inner( Cyg_ CYG_REPORT_RETURN(); - if (current_lock) - // Reacquire the DSR pseudo lock - Cyg_Scheduler::lock(); - return result; } @@ -752,13 +742,11 @@ Cyg_Condition_Variable::wait_inner( Cyg_ if( self->get_wake_reason() == Cyg_Thread::NONE ) queue.enqueue( self ); - CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); - // Avoid calling ASRs during the following unlock. self->set_asr_inhibit(); // Unlock the scheduler and switch threads - Cyg_Scheduler::unlock(); + Cyg_Scheduler::unlock_reschedule(); // Allow ASRs again self->clear_asr_inhibit();
new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/klock.c @@ -0,0 +1,280 @@ +/*================================================================= +// +// kthread1.c +// +// Kernel C API Thread test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-18 +// Description: Tests some basic thread functions. +//####DESCRIPTIONEND#### +*/ +//========================================================================== + +#include <cyg/kernel/kapi.h> + +#include <cyg/infra/testcase.h> + +//========================================================================== + +#ifdef CYGFUN_KERNEL_API_C + +//========================================================================== + +#include "testaux.h" + +#include <cyg/hal/hal_arch.h> // for CYGNUM_HAL_STACK_SIZE_TYPICAL + +//========================================================================== + +#ifdef CYGNUM_HAL_STACK_SIZE_TYPICAL +#define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL +#else +#define STACKSIZE 2000 +#endif + +//========================================================================== + +static char stack[2][STACKSIZE]; + +static cyg_thread thread[2]; + +static cyg_handle_t pt0,pt1; + +static cyg_mutex_t mx; +static cyg_cond_t cv; +static cyg_sem_t sem; +static cyg_flag_t fl; +static cyg_mbox mbox; +static cyg_handle_t mbh; + +volatile static int thread0_state = 0; +volatile static int thread1_state = 0; + +//========================================================================== + +static void entry0( cyg_addrword_t data ) +{ + void *mbret; + + CHECK( 222 == (int)data ); + + // Do everything with the scheduler locked. + cyg_scheduler_lock(); + + // -------------------------------------------------- + // Mutex test + + cyg_mutex_lock( &mx ); + thread0_state = 1; + + // Get thread 2 running. + cyg_thread_resume(pt1); + thread0_state = 2; + + cyg_cond_wait( &cv ); + thread0_state = 3; + + while( thread1_state < 2 ) cyg_thread_yield(); + + cyg_cond_broadcast( &cv ); + thread0_state = 4; + + cyg_mutex_unlock( &mx ); + thread0_state = 5; + + // -------------------------------------------------- + // Semaphore test + + cyg_semaphore_wait( &sem ); + thread0_state = 6; + + cyg_semaphore_post( &sem ); + thread0_state = 7; + + while( thread1_state < 7 ) cyg_thread_yield(); + + // -------------------------------------------------- + // Flags test + + cyg_flag_wait( &fl, 1, CYG_FLAG_WAITMODE_OR|CYG_FLAG_WAITMODE_CLR); + thread0_state = 8; + + cyg_flag_setbits( &fl, 2 ); + thread0_state = 9; + + // -------------------------------------------------- + // Message box test + + mbret = cyg_mbox_get( mbh ); + CYG_TEST_CHECK( mbret == (void *)0xAAAAAAAA , "bad result from cyg_mbox_timed_get()"); + thread0_state = 10; + + cyg_mbox_put( mbh, (void *)0xBBBBBBBB ); + thread0_state = 11; + + // -------------------------------------------------- + + thread0_state = 999; + + cyg_thread_yield(); + cyg_thread_yield(); + cyg_thread_yield(); + + CYG_TEST_CHECK( thread0_state == 999, "thread 0 not in exit state"); + CYG_TEST_CHECK( thread1_state == 999, "thread 1 not in exit state"); + CYG_TEST_PASS_FINISH("Kernel C API Thread 1 OK"); +} + +//========================================================================== + +static void entry1( cyg_addrword_t data ) +{ + cyg_bool res; + void *mbret; + + CHECK( 333 == (int)data ); + + // Do everything with the scheduler locked. + cyg_scheduler_lock(); + + // -------------------------------------------------- + // Mutex test + + cyg_mutex_lock( &mx ); + thread1_state = 1; + + while( thread0_state < 2 ) cyg_thread_yield(); + + cyg_cond_signal( &cv ); + thread1_state = 2; + + res = cyg_cond_timed_wait( &cv, cyg_current_time()+10 ); + CYG_TEST_CHECK( res , "FALSE result from cyg_cond_timed_wait()" ); + thread1_state = 3; + + cyg_mutex_unlock( &mx ); + thread1_state = 4; + + // -------------------------------------------------- + // Semaphore test + + while( thread0_state < 5 ) cyg_thread_yield(); + + cyg_semaphore_post( &sem ); + thread1_state = 5; + + while( thread0_state < 6 ) cyg_thread_yield(); + thread1_state = 6; + + res = cyg_semaphore_timed_wait( &sem, cyg_current_time()+10 ); + CYG_TEST_CHECK( res , "FALSE result from cyg_semaphore_timed_wait()" ); + thread1_state = 7; + + // -------------------------------------------------- + // Flags test + + cyg_flag_setbits( &fl, 1 ); + thread1_state = 8; + + cyg_flag_timed_wait( &fl, 2, CYG_FLAG_WAITMODE_OR|CYG_FLAG_WAITMODE_CLR, + cyg_current_time()+10 ); + thread1_state = 9; + + // -------------------------------------------------- + // Message box test + + cyg_mbox_timed_put( mbh, (void *)0xAAAAAAAA, cyg_current_time()+10 ); + thread1_state = 10; + + mbret = cyg_mbox_timed_get( mbh, cyg_current_time()+10); + CYG_TEST_CHECK( mbret == (void *)0xBBBBBBBB , "bad result from cyg_mbox_timed_get()"); + thread1_state = 9; + + // -------------------------------------------------- + + thread1_state = 999; + cyg_thread_exit(); +} + +//========================================================================== + +void kthread1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0, (cyg_addrword_t)222, "kthread1-0", + (void *)stack[0], STACKSIZE, &pt0, &thread[0] ); + cyg_thread_create(4, entry1, (cyg_addrword_t)333, "kthread1-1", + (void *)stack[1], STACKSIZE, &pt1, &thread[1] ); + + // Init all the objects + + cyg_mutex_init( &mx ); + cyg_cond_init( &cv, &mx ); + cyg_semaphore_init( &sem, 0 ); + cyg_flag_init( &fl ); + cyg_mbox_create( &mbh, &mbox ); + + cyg_thread_resume(pt0); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +//========================================================================== + +externC void +cyg_start( void ) +{ + kthread1_main(); +} + +//========================================================================== + +#else /* def CYGFUN_KERNEL_API_C */ + +//========================================================================== + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_NA("Kernel C API layer disabled"); +} + +//========================================================================== + +#endif /* def CYGFUN_KERNEL_API_C */ + +//========================================================================== +/* EOF kthread1.c */
--- a/packages/language/c/libc/signals/current/ChangeLog +++ b/packages/language/c/libc/signals/current/ChangeLog @@ -1,7 +1,17 @@ +2000-09-07 Jesper Skov <jskov@redhat.com> + + * tests/signal2.c: Fix compiler warning. Also reset FPU exception + vectors. Check for SH7708, not EDK7708 in test3 skip code. + * tests/signal1.c: Fix compiler warning. + 2000-05-16 Jesper Skov <jskov@redhat.com> * tests/signal2.c: Also reset DIV_BY_ZERO vector. +2000-05-08 Jesper Skov <jskov@redhat.com> + + * tests/signal2.c: Skip test3 on SH7709A. + 2000-05-02 Jonathan Larmour <jlarmour@redhat.co.uk> * New package
--- a/packages/language/c/libc/signals/current/tests/signal1.c +++ b/packages/language/c/libc/signals/current/tests/signal1.c @@ -195,6 +195,7 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " "library signal functions"); + return 0; } // main() // EOF signal1.c
--- a/packages/language/c/libc/signals/current/tests/signal2.c +++ b/packages/language/c/libc/signals/current/tests/signal2.c @@ -173,6 +173,12 @@ main( int argc, char *argv[] ) #ifdef CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO, NULL ); #endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU, NULL ); +#endif +#ifdef CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO + HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO, NULL ); +#endif #endif #ifdef CYGSEM_LIBC_SIGNALS_HWEXCEPTIONS @@ -239,8 +245,10 @@ main( int argc, char *argv[] ) state = 3; -#if defined(CYGPKG_HAL_SH_EDK7708) +#if defined(CYGPKG_HAL_SH_7708) CYG_TEST_PASS("Test 3 not applicable to sh 7708"); +#elif defined(CYGPKG_HAL_SH_7709A) + CYG_TEST_PASS("Test 3 not applicable to sh 7709A"); #elif defined(CYGPKG_HAL_MN10300) CYG_TEST_PASS("Test 3 not applicable to mn10300"); #elif defined(CYGPKG_HAL_MIPS_TX39) @@ -271,6 +279,7 @@ main( int argc, char *argv[] ) CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " "library signal functions"); + return 0; } // main() // EOF signal2.c
--- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,13 @@ +2000-09-07 Andrew Lunn <andrew.lunn@ascom.ch> + + * src/load.c, include/redboot.h: renamed the getc functions to + redboot_getc and made them globel so custom boot loaders can use + them. + +2000-09-06 Gary Thomas <gthomas@redhat.com> + + * doc/users_guide: Add info about region locking/unlocking. + 2000-09-04 Jonathan Larmour <jlarmour@redhat.com> * include/flash_config.h (struct config_option): Apply
--- a/packages/redboot/current/doc/users_guide +++ b/packages/redboot/current/doc/users_guide @@ -192,6 +192,30 @@ a loaded image. ... Erase from 0xa0040000-0xa0060000: . ======================================================================= + fis lock -f <flash_addr> -l <length> + +This command is used to write-protect [lock] a portion of flash memory. This +command is optional and will only be provided on hardware which can support +write-protection of the flash space. Note: depending on the system, attempting +to write to write-protected flash may generate errors or warnings or be +benignly quiet. + + ======================================================================= + RedBoot> fis lock -f 0xa0040000 -l 0x20000 + ... Lock from 0xa0040000-0xa0060000: . + ======================================================================= + + fis unlock -f <flash_addr> -l <length> + +This command is used to unlock forceably erase a portion of flash memory. +It must be issued for regions which have been locked before the FIS can reuse +those portions of flash. + + ======================================================================= + RedBoot> fis unlock -f 0xa0040000 -l 0x20000 + ... Unlock from 0xa0040000-0xa0060000: . + ======================================================================= + - Persistent state [flash-based configuration] control Additionally, if the platform has flash memory, certain control and configuration
--- a/packages/redboot/current/include/redboot.h +++ b/packages/redboot/current/include/redboot.h @@ -161,6 +161,20 @@ extern bool scan_opts(int argc, char *ar struct option_info *opts, int num_opts, void **def_arg, int def_arg_type, char *def_descr); +extern int redboot_getc(void); +extern void redboot_getc_init(int (*fun)(char *, int, int *), int verbose); +extern void redboot_getc_rewind(void); + +#define BUF_SIZE 256 +typedef struct { + int (*fun)(char *, int len, int *err); + unsigned char buf[BUF_SIZE]; + unsigned char *bufp; + int avail, len, err; + int verbose, tick; +} getc_info_t; + + // // Validate a hex character //
--- a/packages/redboot/current/src/load.c +++ b/packages/redboot/current/src/load.c @@ -45,6 +45,10 @@ #include <redboot.h> +// Buffer used by redboot_getc +getc_info_t getc_info; + + // Exported CLI function RedBoot_cmd("load", "Load a file", @@ -186,19 +190,14 @@ load_srec_image(int (*getc)(void), unsig } } -#define BUF_SIZE 256 -static struct { - int (*fun)(char *, int len, int *err); - unsigned char buf[BUF_SIZE]; - unsigned char *bufp; - int avail, len, err; - int verbose, tick; -} getc_info; -static int -getc(void) +int +redboot_getc(void) { static char spin[] = "|/-\\|-"; + if (getc_info.avail < 0) { + return -1; + } if (getc_info.avail == 0) { if (getc_info.verbose) { printf("%c\b", spin[getc_info.tick++]); @@ -222,8 +221,8 @@ getc(void) return *getc_info.bufp++; } -static void -getc_init(int (*fun)(char *, int, int *), int verbose) +void +redboot_getc_init(int (*fun)(char *, int, int *), int verbose) { getc_info.avail = 0; getc_info.len = BUF_SIZE; @@ -232,8 +231,8 @@ getc_init(int (*fun)(char *, int, int *) getc_info.tick = 0; } -static void -getc_rewind(void) +void +redboot_getc_rewind(void) { getc_info.bufp = getc_info.buf; getc_info.avail = getc_info.len; @@ -328,9 +327,9 @@ do_load(int argc, char *argv[]) printf("Can't load '%s': %s\n", filename, tftp_error(err)); return; } - getc_init(tftp_stream_read, verbose); + redboot_getc_init(tftp_stream_read, verbose); for (i = 0; i < sizeof(type); i++) { - if ((res = getc()) < 0) { + if ((res = redboot_getc()) < 0) { err = getc_info.err; break; } @@ -347,13 +346,13 @@ do_load(int argc, char *argv[]) printf("Sorry, zmodem download not yet available\n"); return; } - getc_rewind(); // Restore header to stream + redboot_getc_rewind(); // Restore header to stream if (raw) { if (!base_addr_set) { printf("Raw load requires a memory address\n"); } else { unsigned char *mp = (unsigned char *)base; - while ((res = getc()) >= 0) { + while ((res = redboot_getc()) >= 0) { *mp++ = res; } printf("Raw file loaded %p-%p\n", (void *)base, (void *)mp); @@ -361,10 +360,10 @@ do_load(int argc, char *argv[]) } else { // Treat data as some sort of executable image if (strncmp(&type[1], "ELF", 3) == 0) { - load_elf_image(getc); + load_elf_image(redboot_getc); } else if ((type[0] == 'S') && ((type[1] >= '0') && (type[1] <= '9'))) { - load_srec_image(getc, base); + load_srec_image(redboot_getc, base); } else { printf("Unrecognized image type: %lx\n", *(unsigned long *)type); }
--- a/packages/templates/uitron/ChangeLog +++ b/packages/templates/uitron/ChangeLog @@ -1,3 +1,8 @@ +2000-09-07 Jonathan Larmour <jlarmour@redhat.com> + + * current.ect: Add libc signals package because there's no real reason + not to. + 2000-07-04 Jonathan Larmour <jlarmour@redhat.co.uk> * current.ect: Update to reflect new libc package layout, isoinfra,
--- a/packages/templates/uitron/current.ect +++ b/packages/templates/uitron/current.ect @@ -23,6 +23,7 @@ features." ; package CYGPKG_LIBC current ; package CYGPKG_LIBC_I18N current ; package CYGPKG_LIBC_SETJMP current ; + package CYGPKG_LIBC_SIGNALS current ; package CYGPKG_LIBC_STARTUP current ; package CYGPKG_LIBC_STDIO current ; package CYGPKG_LIBC_STDLIB current ;
