Mercurial > nand-ecoscentric
changeset 36:e97d78785e2d ecos-sw-1999-09-12
Merge from eCos master repository on 1999-09-12-15:40:34-BST
line wrap: on
line diff
--- a/packages/ChangeLog +++ b/packages/ChangeLog @@ -1,3 +1,27 @@ +1999-09-10 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * packages: Tidy whitespace a bit + +1999-09-10 Gary Thomas <gthomas@cygnus.co.uk> + + * targets: Update processor type for EB7211 board (arm7tdmi). + +1999-09-09 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * packages: Rename CYGPKG_HAL_MN10300_SIM to CYGPKG_HAL_MN10300_AM31_SIM + +1999-09-08 Gary Thomas <gthomas@cygnus.co.uk> + + * targets: Missing base platform for EB7211 ==> CL7211 + +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + + * NEWS: Added drivers/watchdog + +1999-09-06 Gary Thomas <gthomas@cygnus.co.uk> + + * targets: Rename Cirrus Logic platforms to match actual boards. + 1999-08-16 Jonathan Larmour <jlarmour@cygnus.co.uk> * packages:
--- a/packages/NEWS +++ b/packages/NEWS @@ -57,6 +57,10 @@ **** FIXME +** Drivers +*** Watchdog Drivers added for: + Sharp LH77790 (ARM7DI core) - ARM AEB-1 board + ** New toolchain features ** API additions (are there any?)
--- a/packages/compat/uitron/current/ChangeLog +++ b/packages/compat/uitron/current/ChangeLog @@ -1,3 +1,15 @@ +1999-09-06 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * include/uit_objs.hxx (CYG_UITRON_OBJS_INIT_PRIORITY): Revert the + below change - we may still be shipping antiquated compilers to + customers. Sigh. + +1999-09-02 Hugo Tyson <hmt@cygnus.co.uk> + + * include/uit_objs.hxx (CYG_UITRON_OBJS_INIT_PRIORITY): Enable + using init priority on uitron objects, now that the compilers all + support it fully. AFAI can tell from a quite broad experiment. + 1999-09-01 Hugo Tyson <hmt@cygnus.co.uk> * tests/testintr.cxx (attach_isr): Make it all work: my chosen
--- a/packages/devs/watchdog/current/ChangeLog +++ b/packages/devs/watchdog/current/ChangeLog @@ -1,3 +1,21 @@ +1999-09-09 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * include/pkgconf/watchdog.h: Rename CYGPKG_HAL_MN10300_SIM to + CYGPKG_HAL_MN10300_AM31_SIM + +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + + * include/pkgconf/watchdog.h: + * src/aeb1.cxx: [added] + * src/PKGconf.mak: + * tests/PKGconf.mak: + Added watchdog driver for AEB-1 board. + +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + PRs 20427, 20428, 20432 + * tests/PKGconf.mak (TESTS): Clear on targets that reset the + board. + 1999-08-27 Jesper Skov <jskov@cygnus.co.uk> * tests/watchdog_reset.cxx:
--- a/packages/devs/watchdog/current/include/pkgconf/watchdog.h +++ b/packages/devs/watchdog/current/include/pkgconf/watchdog.h @@ -73,11 +73,15 @@ #define CYGIMP_WATCHDOG_EMULATE -#if defined(CYGPKG_HAL_MN10300) && !defined(CYGPKG_HAL_MN10300_SIM) +#if defined(CYGPKG_HAL_MN10300) && !defined(CYGPKG_HAL_MN10300_AM31_SIM) #undef CYGIMP_WATCHDOG_EMULATE #endif +#if defined(CYGPKG_HAL_ARM_AEB) +#undef CYGIMP_WATCHDOG_EMULATE +#endif + /* -------------------------------------------------------------------- */ #endif /* CYGONCE_PKGCONF_WATCHDOG_H */
--- a/packages/devs/watchdog/current/src/PKGconf.mak +++ b/packages/devs/watchdog/current/src/PKGconf.mak @@ -32,7 +32,7 @@ PACKAGE := devices_watchdog include ../../../../pkgconf/pkgconf.mak LIBRARY := libtarget.a -COMPILE := emulate.cxx +COMPILE := emulate.cxx aeb1.cxx COMPILE := $(COMPILE) mn10300.cxx OTHER_OBJS := OTHER_TARGETS :=
new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/src/aeb1.cxx @@ -0,0 +1,194 @@ +//========================================================================== +// +// watchdog/aeb1.cxx +// +// Watchdog implementation for ARM AEB1 board (SHARP LH77790 CPU) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors: jskov +// Date: 1999-09-01 +// Purpose: Watchdog class implementation +// Description: Contains an implementation of the Watchdog class for use +// with the SHARP LH77790 watchdog timer. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include <pkgconf/system.h> // system configuration file +#include <pkgconf/watchdog.h> // configuration for this package + +#if defined(CYGPKG_HAL_ARM_AEB) && !defined(CYGIMP_WATCHDOG_EMULATE) + +#include <cyg/infra/cyg_trac.h> // tracing macros +#include <cyg/infra/cyg_ass.h> // assertion macros +#include <cyg/kernel/instrmnt.h> // instrumentation + +#include <cyg/hal/hal_io.h> // IO register access + +#include <cyg/devs/watchdog.hxx> // my header + +// ------------------------------------------------------------------------- +// Register definitions +#define CYGARC_REG_WATCHDOG_BASE 0xFFFFAC00 +#define CYGARC_REG_WATCHDOG_WDCTLR (CYGARC_REG_WATCHDOG_BASE+0x30) +#define CYGARC_REG_WATCHDOG_WDCNTR (CYGARC_REG_WATCHDOG_BASE+0x34) + +// Control register bits +#define CYGARC_REG_WATCHDOG_WDCTLR_EN 0x01 // enable +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_NMF 0x00 // non-maskable fiq +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_ER 0x04 // external reset +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_SR 0x06 // system reset +#define CYGARC_REG_WATCHDOG_WDCTLR_FRZ 0x08 // lock enable bit +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_MASK 0x70 // time out period + +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_17 0x00 // 2^17 +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_17_P 5242880 // = 5.2ms + +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_25 0x40 // 2^25 +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_25_P 1342177300 // = 1.3421773s + + +// ------------------------------------------------------------------------- +// Statics +// A static pointer to the single system defined watchdog device. +Cyg_Watchdog Cyg_Watchdog::watchdog; + +// ------------------------------------------------------------------------- +// Constructor + + +Cyg_Watchdog::Cyg_Watchdog() +{ + CYG_REPORT_FUNCTION(); + + action_list = 0; + + resolution = CYGARC_REG_WATCHDOG_WDCTLR_TOP_25_P; + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Return reset resolution + +cyg_uint64 Cyg_Watchdog::get_resolution() +{ + return resolution; +} + + +// ------------------------------------------------------------------------- +// Start the watchdog running. + +void +Cyg_Watchdog::start() +{ + CYG_REPORT_FUNCTION(); + + // Clear the watchdog counter. + HAL_WRITE_UINT32(CYGARC_REG_WATCHDOG_WDCNTR, 0); + + // Enable the watchdog (and lock/FRZ it). + HAL_WRITE_UINT8(CYGARC_REG_WATCHDOG_WDCTLR, + (CYGARC_REG_WATCHDOG_WDCTLR_TOP_25 + | CYGARC_REG_WATCHDOG_WDCTLR_FRZ + | CYGARC_REG_WATCHDOG_WDCTLR_RSP_SR + | CYGARC_REG_WATCHDOG_WDCTLR_EN)); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Reset watchdog timer. This needs to be called regularly to prevent +// the watchdog firing. + +void +Cyg_Watchdog::reset() +{ + CYG_REPORT_FUNCTION(); + + HAL_WRITE_UINT32(CYGARC_REG_WATCHDOG_WDCNTR, 0); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Trigger the watchdog as if the timer had expired. + +void +Cyg_Watchdog::trigger() +{ + CYG_REPORT_FUNCTION(); + + // Clear the watchdog counter. + HAL_WRITE_UINT32(CYGARC_REG_WATCHDOG_WDCNTR, 0); + + // Enable the watchdog with the smallest timeout. + HAL_WRITE_UINT8(CYGARC_REG_WATCHDOG_WDCTLR, + (CYGARC_REG_WATCHDOG_WDCTLR_TOP_17 + | CYGARC_REG_WATCHDOG_WDCTLR_FRZ + | CYGARC_REG_WATCHDOG_WDCTLR_RSP_SR + | CYGARC_REG_WATCHDOG_WDCTLR_EN)); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Register an action routine that will be called when the timer +// triggers. + +void +Cyg_Watchdog::install_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + // Not implemented. Possible to select a FIQ interrupt instead of reset. + CYG_FAIL("Not implemented."); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Deregister a previously registered action routine. + +void +Cyg_Watchdog::uninstall_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + // Not implemented. Possible to select a FIQ interrupt instead of reset. + CYG_FAIL("Not implemented."); + + CYG_REPORT_RETURN(); +} + +#endif // defined(CYGPKG_HAL_ARM_AEB) && + // !defined(CYGIMP_WATCHDOG_EMULATE) +// ------------------------------------------------------------------------- +// EOF watchdog/aeb1.cxx
--- a/packages/devs/watchdog/current/tests/PKGconf.mak +++ b/packages/devs/watchdog/current/tests/PKGconf.mak @@ -30,15 +30,20 @@ PACKAGE := devices_watchdog include ../../../../pkgconf/pkgconf.mak +include ../../../../pkgconf/system.mak TESTS := watchdog +# The automatic test fails on some targets (i.e., the watchdog resets +# the board preventing the test from PASSing). Clear TESTS on those +# targets here. +ifdef CYGPKG_HAL_ARM_AEB +TESTS := +endif + # Invoke make with RUN_BY_HAND=1 as argument ifdef RUN_BY_HAND TESTS += watchdog_reset endif include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst - - -
--- a/packages/hal/arm/aeb/current/ChangeLog +++ b/packages/hal/arm/aeb/current/ChangeLog @@ -1,3 +1,9 @@ +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + + * include/plf_stub.h: + * src/plf_stub.c (hal_aeb_reset): + Added reset on detach. + 1999-08-08 Gary Thomas <gthomas@cygnus.co.uk> * misc/Notes:
--- a/packages/hal/arm/aeb/current/include/plf_stub.h +++ b/packages/hal/arm/aeb/current/include/plf_stub.h @@ -73,7 +73,8 @@ extern int hal_aeb_interruptible(int); //---------------------------------------------------------------------------- // Reset. -#define HAL_STUB_PLATFORM_RESET() CYG_EMPTY_STATEMENT +extern void hal_aeb_reset(void); +#define HAL_STUB_PLATFORM_RESET() hal_aeb_reset() #endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
--- a/packages/hal/arm/aeb/current/src/plf_stub.c +++ b/packages/hal/arm/aeb/current/src/plf_stub.c @@ -266,6 +266,46 @@ int hal_aeb_get_char(void) return c; } + +//----------------------------------------------------------------------------- +// Reset board (definitions from watchdog file aeb1.cxx) + +// Register definitions +#define CYGARC_REG_WATCHDOG_BASE 0xFFFFAC00 +#define CYGARC_REG_WATCHDOG_WDCTLR (CYGARC_REG_WATCHDOG_BASE+0x30) +#define CYGARC_REG_WATCHDOG_WDCNTR (CYGARC_REG_WATCHDOG_BASE+0x34) + +// Control register bits +#define CYGARC_REG_WATCHDOG_WDCTLR_EN 0x01 // enable +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_NMF 0x00 // non-maskable fiq +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_ER 0x04 // external reset +#define CYGARC_REG_WATCHDOG_WDCTLR_RSP_SR 0x06 // system reset +#define CYGARC_REG_WATCHDOG_WDCTLR_FRZ 0x08 // lock enable bit +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_MASK 0x70 // time out period + +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_17 0x00 // 2^17 +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_17_P 5242880 // = 5.2ms + +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_25 0x40 // 2^25 +#define CYGARC_REG_WATCHDOG_WDCTLR_TOP_25_P 1342177300 // = 1.3421773s + +void +hal_aeb_reset(void) +{ + // Clear the watchdog counter. + HAL_WRITE_UINT32(CYGARC_REG_WATCHDOG_WDCNTR, 0); + + // Enable the watchdog with the smallest timeout. + HAL_WRITE_UINT8(CYGARC_REG_WATCHDOG_WDCTLR, + (CYGARC_REG_WATCHDOG_WDCTLR_TOP_17 + | CYGARC_REG_WATCHDOG_WDCTLR_FRZ + | CYGARC_REG_WATCHDOG_WDCTLR_RSP_SR + | CYGARC_REG_WATCHDOG_WDCTLR_EN)); + + // Wait for it... + for(;;); +} + #endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS //----------------------------------------------------------------------------- // End of plf_stub.c
--- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,14 @@ +1999-09-11 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * src/arm_stub.c (__computeSignal): Synchronise return value with + what libbsp does and GDB expects + (__get_trap_number): Don't shift right 8 - it's already the right number + +1999-09-10 Jesper Skov <jskov@cygnus.co.uk> + + * src/vectors.S (start): Moved stub vector changeover to after + stub init. + 1999-08-24 Hugo Tyson <hmt@masala.cygnus.co.uk> * src/vectors.S (handle_IRQ_or_FIQ): Set up the pointer-to-regset
--- a/packages/hal/arm/arch/current/include/hal_arch.h +++ b/packages/hal/arm/arch/current/include/hal_arch.h @@ -171,7 +171,7 @@ externC void hal_thread_load_context( CY // HAL_BREAKINST is the value of the breakpoint instruction and // HAL_BREAKINST_SIZE is its size in bytes. -#define HAL_BREAKPOINT(_label_) \ +#define HAL_BREAKPOINT(_label_) \ asm volatile (" .globl " #_label_ ";" \ #_label_":" \ " .word 0xE7FFDEFE" \
--- a/packages/hal/arm/arch/current/src/arm_stub.c +++ b/packages/hal/arm/arch/current/src/arm_stub.c @@ -32,6 +32,7 @@ #define TRUE 1 #endif + #ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT #include <cyg/hal/dbg-threads-api.h> // dbg_currthread_id #endif @@ -40,7 +41,16 @@ int __computeSignal (unsigned int trap_number) { + // should also catch CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION here but we + // can't tell the different between a real one and a breakpoint :-( switch (trap_number) { + case CYGNUM_HAL_VECTOR_ABORT_PREFETCH: // Fall through + case CYGNUM_HAL_VECTOR_ABORT_DATA: // Fall through + case CYGNUM_HAL_VECTOR_reserved: + return SIGBUS; + case CYGNUM_HAL_VECTOR_IRQ: + case CYGNUM_HAL_VECTOR_FIQ: + return SIGINT; default: return SIGTRAP; } @@ -48,12 +58,12 @@ int __computeSignal (unsigned int trap_n /* Return the trap number corresponding to the last-taken trap. */ - +volatile int jifl; int __get_trap_number (void) { // The vector is not not part of the GDB register set so get it // directly from the save context. - return _hal_registers->vector >> 8; + return _hal_registers->vector; } /* Set the currently-saved pc register value to PC. This also updates NPC @@ -77,6 +87,7 @@ void set_pc (target_register_t pc) static unsigned long *ss_saved_pc = NULL_PTR; static unsigned long ss_saved_instr; + #define FIXME() {diag_printf("FIXME - %s\n", __FUNCTION__); } static int @@ -391,4 +402,5 @@ void __skipinst (void) put_register (PC, get_register (PC) + 4); } + #endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
--- a/packages/hal/arm/arch/current/src/vectors.S +++ b/packages/hal/arm/arch/current/src/vectors.S @@ -140,14 +140,17 @@ reset_vector: // We cannot perform a store until after PLATFORM_SETUP1 str r0, [r0,#0x40] // DRAM size to zero => unknown ldr r1,.__exception_handlers +#ifndef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + // Wait with this if stubs are included (see further down). ldr r2,[r1,#0x04] // undefined instruction str r2,[r0,#0x04] ldr r2,[r1,#0x24] str r2,[r0,#0x24] +#endif ldr r2,[r1,#0x08] // software interrupt str r2,[r0,#0x08] #if defined(CYG_HAL_STARTUP_RAM) -// Ugly hack to get into supervisor mode +// Ugly hack to get into supervisor mode ldr r2,[r1,#0x40] str r2,[r0,#0x28] @@ -259,15 +262,26 @@ 2: // Call platform specific hardware initialization bl hal_hardware_init +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + bl initialize_stub + + // Now that stub is initialized, change vector. It is possible + // to single-step through most of the init code, except the below. + // Put a breakpoint at the call to cyg_hal_invoke_constructors to + // pass over this bit (s-s depends on internal state in the stub). + mov r0,#0 // move vectors + ldr r1,=__exception_handlers + ldr r2,[r1,#0x04] // undefined instruction + str r2,[r0,#0x04] + ldr r2,[r1,#0x24] + str r2,[r0,#0x24] +#endif + LED 2 // Run through static constructors bl cyg_hal_invoke_constructors -#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS - bl initialize_stub -#endif - LED 1 // This starts up the eCos kernel
--- a/packages/hal/arm/cl7211/current/ChangeLog +++ b/packages/hal/arm/cl7211/current/ChangeLog @@ -1,3 +1,69 @@ +1999-09-10 Gary Thomas <gthomas@cygnus.co.uk> + + * include/hal_platform_setup.h: Fix spelling error. + +1999-09-08 Gary Thomas <gthomas@cygnus.co.uk> + + * misc/panel_test.c: Trick for these interrupts is that they + only happen when the drive is 0x70. + + * misc/kbd_test.c: Found trick to get interrupts - need to leave + columns hot! + + * include/pkgconf/mlt_arm_eb7211_rom.mlt: + * include/pkgconf/mlt_arm_eb7211_rom.ldi: Change RAM layout. + + * include/hal_platform_setup.h: Made ROM segment #1 non-cacheable. + + * misc/kbd_test.c: New test for ASCII keyboard. Interrupts + not yet working. + + * misc/panel_test.c: Fix panel driving code. Can now read + panel samples, but no interrupts. + + * src/cl7211_misc.c: Add missing clear for keyboard interrupt. + +1999-09-06 Gary Thomas <gthomas@cygnus.co.uk> + + * misc/PKGconf.mak (PROGS): Add new test. + + * misc/panel_test.c: New file. Test code for LCD touch panel. + + * misc/lcd_support.c: New file. + + * misc/lcd_test.c: Move LCD driving code to 'lcd_support.c' so it + can be shared. + +1999-09-03 Gary Thomas <gthomas@cygnus.co.uk> + + * misc/lcd_test.c (lcd_drawc): Correct drawing of larger characters. + + * misc/PKGconf.mak: Make LCD test program for all platforms. + + * include/pkgconf/mlt_arm_cl7211_rom.mlt: + * include/pkgconf/mlt_arm_cl7211_rom.ldi: + * include/pkgconf/mlt_arm_cl7211_ram.mlt: + * include/pkgconf/mlt_arm_cl7211_ram.ldi: 72xx has 16M by default. + + * misc/PKGconf.mak: Remove extra [left over] step in make. + +1999-09-02 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * misc/PKGconf.mak: Use correct EXEEXT for gdb_module program. + +1999-09-02 Gary Thomas <gthomas@cygnus.co.uk> + + * support/io.c (uspin): Change timing - ugly. + + * src/cl7211_misc.c: Disable out BATLOW testing code. + + * include/hal_platform_setup.h: Better setup when LCD is installed. + + * include/pkgconf/hal_arm_cl7211.h: Make LCD installed by default. + + * misc/lcd_test.c: Rework for larger ALPS unit. Also make characters + twice as big (so there's a chance at seeing them!) + 1999-08-16 John Dallaway <jld@cygnus.co.uk> * include/pkgconf/hal_arm_cl7211.h:
index e1d220c575d4ebe724a5b6e4ed650c17d3abb911..54384e59563b3a0492f0e638a3e00cb1fcfe06c4 GIT binary patch literal 15412 zc%0Q+4|EjAd7s_8lf-eLl?09uidlh(l~^PztT;lI$=QJGL^L^&a7aSkBNi_1qw&?j zDQ%tR^at!vL1n;+Lx{DB-Gn-6LT$Ho)3g=F_Oo4HpTM}Gu9EKU-uAF?9i`>9PNMkw z`_0ZuCm}m-`r7xZ_eL{2^UcgR-}lY;Z}(~^hW*-EMc^-NuSa_{BAks;;d~RNDJC3_ zi!$L{Ks&DsXY7h$f9xHYXZHH%(LS%*=g{soZBLjd{nKclX1`^7&)zufKYR1Aucz%? zRmS$p)BAGKbZ=f8w7th~8}`e@mK=7d`zBywfI0r@VV^MC@7i88-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(?AgA1J6d~S)5S`wZEL&9 zdi7SWYnn3GB+R?fcdHP01892x>u*@Me#4D~>$qWik9pf2cmC$~-R7ru-+B8df1Rsf zUb_%$F{k5`ckSXkoQ@COvD@4}1!C<1%vurry>^vw{<n(wfBbi(PB{6xnP=c{Z%Uu- zwKJwjo`rvq9|7GeV0#4Y0DmSV$CD`8w*XK&9FA$Fo0W-d7A1)?QXVWB{*9ndpf6b- uz=ZwT5bkX=;Y)GmR!JT6P?$Vf%;#!6qg;VDOL94$m(RV%?7s`J(f<V(gZ7I6
--- a/packages/hal/arm/cl7211/current/include/hal_cl7211.h +++ b/packages/hal/arm/cl7211/current/include/hal_cl7211.h @@ -57,6 +57,11 @@ #define PEDDR 0x800000C0 // Port E data direction register #define SYSCON1 0x80000100 // System control register #1 +#define SYSCON1_KBD_CTL 0xF // Keyboard scan - mask +#define SYSCON1_KBD_HIGH 0 // Keyboard scan - all columns high +#define SYSCON1_KBD_LOW 1 // Keyboard scan - all columns low +#define SYSCON1_KBD_TRISTATE 2 // Keyboard scan - all columns tri-state +#define SYSCON1_KBD_COL(n) (n+8)// Keyboard scan - select column 'n' #define SYSCON1_TC1M (1<<4) // Timer/counter #1 - prescale mode #define SYSCON1_TC1S (1<<5) // Timer/counter #1 - source (1=512KHz,0=2KHz) #define SYSCON1_TC2M (1<<6) // Timer/counter #2 - prescale mode @@ -70,6 +75,10 @@ #define SYSCON1_CDENRX (1<<14) // Enable Rx on CODEC #define SYSCON1_SIREN (1<<15) // Enable SIR protocol on UART #1 #define SYSCON1_ADCKSEL (3<<16) // Microwire clock +#define SYSCON1_ADC_CLOCK_4kHZ (0<<16) +#define SYSCON1_ADC_CLOCK_16kHZ (1<<16) +#define SYSCON1_ADC_CLOCK_64kHZ (2<<16) +#define SYSCON1_ADC_CLOCK_128kHZ (3<<16) #define SYSCON1_EXCKEN (1<<18) // External expansion clock enable #define SYSCON1_WAKEDIS (1<<19) // Disable wakeup from snooze (do not disturb) #define SYSCON1_IRTXM (1<<20) // IrDA Tx mode @@ -92,6 +101,7 @@ #define SYSCON2_BUZFREQ (1<<14) // Buzzer frequency 0=timer, 1=fixed PLL/xtal #define SYSCON3 0x80002200 // System control #3 +#define SYSCON3_ADCCON (1<<0) // ADC enable #define SYSCON3_CLKCTL(n) (n<<1) // Processor block speed ((n+1)*18.432)MHz #define SYSFLG1 0x80000140 // System flags #1 @@ -148,7 +158,9 @@ #define INTMR2 0x80001280 // Interrupt mask #2 #define INTSR3 0x80002240 // Interrupt status #3 +#if defined(__CL7211) #define INTSR3_MCPINT (1<<0) // MCP interrupt +#endif #define INTMR3 0x80002280 // Interrupt mask #3 #define UARTDR1 0x80000480 // UART #1 data register @@ -227,17 +239,22 @@ #define SNOOZE 0x80001800 // Enter 'snooze' state +#if defined(__CL7211) #define MCCR 0x80002000 // MCP control register #define MCDR0 0x80002040 // MCP data register #0 #define MCDR1 0x80002080 // MCP data register #1 #define MCDR2 0x800020C0 // MCP data register #2 #define MCSR 0x80002100 // MCP status register +#endif + #define LEDFLSH 0x800022C0 // LED flash control #define LEDFLSH_ENABLE (1<<6) // LED enabled #define LEDFLSH_DUTY(n) ((n-1)<<2) // LED on ratio #define LEDFLSH_PERIOD(n) (n-1) // LED active time (1..4) +#define KBD_PORT 0x30010000 // Extra 8 bits of keyboard data + /*---------------------------------------------------------------------------*/ /* end of hal_cl7211.h */ #endif /* CYGONCE_HAL_CL7211_H */
--- a/packages/hal/arm/cl7211/current/include/hal_platform_ints.h +++ b/packages/hal/arm/cl7211/current/include/hal_platform_ints.h @@ -35,7 +35,7 @@ // Contributors: gthomas // Date: 1999-04-21 // Purpose: Define Interrupt support -// Description: The interrupt details for the CL7211 are defined here. +// Description: The interrupt details for the CL7xxx are defined here. // Usage: // #include <cyg/hal/hal_platform_ints.h> // ... @@ -72,10 +72,10 @@ #endif #define CYGNUM_HAL_ISR_MIN 0 -#if defined(__CL7211) +#if defined(__CL7111) +#define CYGNUM_HAL_ISR_MAX 21 +#else #define CYGNUM_HAL_ISR_MAX 22 -#else -#define CYGNUM_HAL_ISR_MAX 21 #endif #define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX+1)
--- a/packages/hal/arm/cl7211/current/include/hal_platform_setup.h +++ b/packages/hal/arm/cl7211/current/include/hal_platform_setup.h @@ -50,7 +50,7 @@ #define CYGHWR_HAL_ARM_HAS_MMU // This processor has an MMU -#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_STUBS) +#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_STUBS) // // Memory map - set up by ROM (GDB stubs) @@ -69,14 +69,12 @@ // ROM 0xF0000000..0xFFFFFFFF 0x10000000 #ifdef CYGHWR_HAL_ARM_CL7211_LCD_INSTALLED -#define MMU_BASE 0xC0020000 -#define PTE_BASE 0xC0024000 #define LCD_BUFFER_SIZE 0x00020000 #else -#define MMU_BASE 0xC0000000 -#define PTE_BASE 0xC0004000 #define LCD_BUFFER_SIZE 0x00000000 #endif +#define MMU_BASE 0xC0000000+LCD_BUFFER_SIZE +#define PTE_BASE 0xC0004000+LCD_BUFFER_SIZE #if (CYGHWR_HAL_ARM_CL7211_DRAM_SIZE == 2) #define MMU_TABLES_SIZE 0x4000+0x1000+0x1000 // RAM used for PTE entries #define DRAM_LA_END 0x00200000-MMU_TABLES_SIZE @@ -91,6 +89,7 @@ #define LCD_PA 0xC0000000 #define ROM0_LA_START 0xE0000000 #define ROM0_PA 0x00000000 +#define ROM0_LA_END 0xF0000000 #define ROM1_LA_START 0xF0000000 #define ROM1_LA_END 0x00000000 #define ROM1_PA 0x10000000 @@ -290,7 +289,7 @@ 10: str r5,[r1],#4 add r3,r3,r7 ;\ cmp r3,r4 ;\ bne 10b ;\ -/* EXPANSION2, EXNAPSION3, PCMCIA0, PCMCIA1 */ ;\ +/* EXPANSION2, EXPANSION3, PCMCIA0, PCMCIA1 */ ;\ ldr r3,=EXPANSION2_LA_START ;\ ldr r4,=SRAM_LA_START ;\ ldr r5,=EXPANSION2_PA ;\ @@ -368,9 +367,9 @@ 10: orr r0,r5,r6 add r3,r3,r7 ;\ cmp r3,r4 ;\ bne 10b ;\ -/* ROM0, ROM1 */ ;\ +/* ROM0 */ ;\ ldr r3,=ROM0_LA_START ;\ - ldr r4,=ROM1_LA_END ;\ + ldr r4,=ROM0_LA_END ;\ ldr r5,=ROM0_PA ;\ ldr r6,=MMU_L1_TYPE_Section|MMU_AP_Any|MMU_Cacheable ;\ ldr r7,=MMU_SECTION_SIZE ;\ @@ -380,6 +379,18 @@ 10: orr r0,r5,r6 add r3,r3,r7 ;\ cmp r3,r4 ;\ bne 10b ;\ +/* ROM1 */ ;\ + ldr r3,=ROM1_LA_START ;\ + ldr r4,=ROM1_LA_END ;\ + ldr r5,=ROM1_PA ;\ + ldr r6,=MMU_L1_TYPE_Section|MMU_AP_Any ;\ + ldr r7,=MMU_SECTION_SIZE ;\ +10: orr r0,r5,r6 ;\ + str r0,[r1],#4 ;\ + add r5,r5,r7 ;\ + add r3,r3,r7 ;\ + cmp r3,r4 ;\ + bne 10b ;\ /* Now initialize the MMU to use this new page table */ ;\ MMU_INITIALIZE
--- a/packages/hal/arm/cl7211/current/include/pkgconf/hal_arm_cl7211.h +++ b/packages/hal/arm/cl7211/current/include/pkgconf/hal_arm_cl7211.h @@ -63,13 +63,13 @@ Cirrus Logic CL7111 board with ARM710C processor." } - cdl_option CYGHWR_HAL_ARM_CLxx11_CL7211 { - display "CL7211-1 variant" + cdl_option CYGHWR_HAL_ARM_CLxx11_EB7211 { + display "EB7211-1 variant" parent CYGPKG_HAL_ARM_CL7211 - platform cl7211 + platform eb7211 type radio description " - Cirrus Logic CL7211 board with ARM720 processor." + Cirrus Logic EB7211 board with CL7211 (ARM720) processor." } cdl_option CYGHWR_HAL_ARM_CL7211_STARTUP { @@ -196,7 +196,7 @@ } }}CFG_DATA */ -#undef CYGHWR_HAL_ARM_CL7211_LCD_INSTALLED +#define CYGHWR_HAL_ARM_CL7211_LCD_INSTALLED // Real-time clock/counter specifics
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_ram.ldi +++ /dev/null @@ -1,51 +0,0 @@ -//=========================================================================== -// -// MLT linker script export -// -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Cygnus eCos Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://sourceware.cygnus.com/ecos -// -// 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 Cygnus Operating System, released -// September 30, 1998. -// -// The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== - -// eCos memory layout - Mon May 17 08:04:39 1999 - -// This is a generated file - do not edit - -MEMORY -{ - ram : ORIGIN = 0x8000, LENGTH = 0x1b8000 -} - -SECTIONS -{ - SECTIONS_BEGIN - SECTION_rom_vectors (ram, 0x8000, LMA_EQ_VMA) - SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTIONS_END -}
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_ram.mlt +++ /dev/null @@ -1,11 +0,0 @@ -version 0 -region ram 8000 1b8000 0 ! -section rom_vectors 0 1 0 1 1 1 1 1 8000 8000 text text ! -section text 0 1 0 1 0 1 0 1 fini fini ! -section fini 0 1 0 1 0 1 0 1 rodata rodata ! -section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! -section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! -section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! -section gcc_except_table 0 1 0 1 0 1 0 1 data data ! -section data 0 1 0 1 0 1 0 1 bss bss ! -section bss 0 4 0 1 0 0 0 0 !
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_rom.ldi +++ /dev/null @@ -1,53 +0,0 @@ -//=========================================================================== -// -// MLT linker script export -// -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Cygnus eCos Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://sourceware.cygnus.com/ecos -// -// 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 Cygnus Operating System, released -// September 30, 1998. -// -// The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== - - -// eCos memory layout - Mon May 17 08:14:13 1999 - -// This is a generated file - do not edit - -MEMORY -{ - ram : ORIGIN = 0xc0000000, LENGTH = 0x200000 - rom : ORIGIN = 0xe0000000, LENGTH = 0x40000 -} - -SECTIONS -{ - SECTIONS_BEGIN - SECTION_rom_vectors (rom, 0xe0000000, LMA_EQ_VMA) - SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, 0xc0000000, FOLLOWING (.gcc_except_table)) - SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTIONS_END -}
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_rom.mlt +++ /dev/null @@ -1,12 +0,0 @@ -version 0 -region ram c0000000 200000 0 ! -region rom e0000000 40000 1 ! -section data 0 1 1 1 1 1 0 0 c0000000 bss ! -section bss 0 4 0 1 0 0 0 0 ! -section rom_vectors 0 1 0 1 1 1 1 1 e0000000 e0000000 text text ! -section text 0 1 0 1 0 1 0 1 fini fini ! -section fini 0 1 0 1 0 1 0 1 rodata rodata ! -section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! -section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! -section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! -section gcc_except_table 0 1 0 1 0 0 0 1 data !
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_stubs.ldi +++ /dev/null @@ -1,52 +0,0 @@ -//=========================================================================== -// -// MLT linker script export -// -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Cygnus eCos Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://sourceware.cygnus.com/ecos -// -// 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 Cygnus Operating System, released -// September 30, 1998. -// -// The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== - -// eCos memory layout - Tue Jun 15 18:13:06 1999 - -// This is a generated file - do not edit - -MEMORY -{ - ram : ORIGIN = 0x1000, LENGTH = 0x7000 - rom : ORIGIN = 0xe0000000, LENGTH = 0x800000 -} - -SECTIONS -{ - SECTIONS_BEGIN - SECTION_rom_vectors (rom, 0xe0000000, LMA_EQ_VMA) - SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, 0x1000, FOLLOWING (.gcc_except_table)) - SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTIONS_END -}
deleted file mode 100644 --- a/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_cl7211_stubs.mlt +++ /dev/null @@ -1,12 +0,0 @@ -version 0 -region ram 1000 7000 0 ! -region rom e0000000 800000 1 !This is ROM bank 0, physical address 0x00000000.When running eCos, this space is remapped to 0xE0000000. -section data 0 1 1 1 1 1 0 0 1000 bss ! -section bss 0 4 0 1 0 0 0 0 ! -section rom_vectors 0 1 0 1 1 1 1 1 e0000000 e0000000 text text ! -section text 0 1 0 1 0 1 0 1 fini fini ! -section fini 0 1 0 1 0 1 0 1 rodata rodata ! -section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! -section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! -section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! -section gcc_except_table 0 1 0 1 0 0 0 1 data !
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_ram.ldi @@ -0,0 +1,51 @@ +//=========================================================================== +// +// MLT linker script export +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + +// eCos memory layout - Mon May 17 08:04:39 1999 + +// This is a generated file - do not edit + +MEMORY +{ + ram : ORIGIN = 0x8000, LENGTH = 0x1b8000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (ram, 0x8000, LMA_EQ_VMA) + SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTIONS_END +}
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_ram.mlt @@ -0,0 +1,11 @@ +version 0 +region ram 8000 1b8000 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 8000 8000 text text ! +section text 0 1 0 1 0 1 0 1 fini fini ! +section fini 0 1 0 1 0 1 0 1 rodata rodata ! +section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! +section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! +section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! +section gcc_except_table 0 1 0 1 0 1 0 1 data data ! +section data 0 1 0 1 0 1 0 1 bss bss ! +section bss 0 4 0 1 0 0 0 0 !
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_rom.ldi @@ -0,0 +1,52 @@ +//=========================================================================== +// +// MLT linker script export +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + +// eCos memory layout - Tue Jun 15 18:13:06 1999 + +// This is a generated file - do not edit + +MEMORY +{ + ram : ORIGIN = 0x1000, LENGTH = 0x00FFF000 + rom : ORIGIN = 0xe0000000, LENGTH = 0x800000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (rom, 0xe0000000, LMA_EQ_VMA) + SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_data (ram, 0x1000, FOLLOWING (.gcc_except_table)) + SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTIONS_END +}
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_rom.mlt @@ -0,0 +1,12 @@ +version 0 +region ram 1000 fff000 0 ! +region rom e0000000 800000 1 !This is ROM bank 0, physical address 0x00000000.When running eCos, this space is remapped to 0xE0000000. +section data 0 1 1 1 1 1 0 0 1000 bss ! +section bss 0 4 0 1 0 0 0 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 e0000000 e0000000 text text ! +section text 0 1 0 1 0 1 0 1 fini fini ! +section fini 0 1 0 1 0 1 0 1 rodata rodata ! +section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! +section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! +section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! +section gcc_except_table 0 1 0 1 0 0 0 1 data !
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_stubs.ldi @@ -0,0 +1,52 @@ +//=========================================================================== +// +// MLT linker script export +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + +// eCos memory layout - Tue Jun 15 18:13:06 1999 + +// This is a generated file - do not edit + +MEMORY +{ + ram : ORIGIN = 0x1000, LENGTH = 0x7000 + rom : ORIGIN = 0xe0000000, LENGTH = 0x800000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (rom, 0xe0000000, LMA_EQ_VMA) + SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) + SECTION_data (ram, 0x1000, FOLLOWING (.gcc_except_table)) + SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTIONS_END +}
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/include/pkgconf/mlt_arm_eb7211_stubs.mlt @@ -0,0 +1,12 @@ +version 0 +region ram 1000 7000 0 ! +region rom e0000000 800000 1 !This is ROM bank 0, physical address 0x00000000.When running eCos, this space is remapped to 0xE0000000. +section data 0 1 1 1 1 1 0 0 1000 bss ! +section bss 0 4 0 1 0 0 0 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 e0000000 e0000000 text text ! +section text 0 1 0 1 0 1 0 1 fini fini ! +section fini 0 1 0 1 0 1 0 1 rodata rodata ! +section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! +section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! +section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! +section gcc_except_table 0 1 0 1 0 0 0 1 data !
--- a/packages/hal/arm/cl7211/current/misc/PKGconf.mak +++ b/packages/hal/arm/cl7211/current/misc/PKGconf.mak @@ -34,24 +34,22 @@ include ../../../../../pkgconf/system.ma ifdef CYG_HAL_STARTUP_STUBS PROGS := gdb_module -OTHER_PROGS := gdb_module.img +OTHER_PROGS := gdb_module.bin endif ifdef CYG_HAL_STARTUP_RAM PROGS := prog_flash -ifdef CYG_HAL_CL7111 -PROGS += lcd_test -endif +PROGS += lcd_test panel_test kbd_test endif WHEREAMI := misc include $(COMPONENT_REPOSITORY)/pkgconf/makrules.prv ifdef CYG_HAL_STARTUP_STUBS -gdb_module.img: gdb_module.stamp - $(OBJCOPY) --strip-all gdb_module$(EXEEXT) gdb_module.img.XX - $(OBJCOPY) -O binary gdb_module gdb_module.bin - $(RM) -f gdb_module.img.XX +gdb_module.bin: gdb_module.stamp + $(OBJCOPY) -O binary gdb_module$(EXEEXT) gdb_module.bin endif + +
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/misc/kbd_test.c @@ -0,0 +1,504 @@ +//========================================================================== +// +// kbd_test.c +// +// Cirrus CL72xx eval board ASCII keyboard test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 1999-05-15 +// Description: Tool used to test ASCII keyboard +//####DESCRIPTIONEND#### + +#include <pkgconf/kernel.h> // Configuration header +#include <cyg/kernel/kapi.h> +#include <cyg/infra/diag.h> + +#include <cyg/hal/hal_cl7211.h> // Board definitions + +#include <cyg/hal/hal_io.h> // IO macros +#include <cyg/hal/hal_arch.h> // Register state info +#include <cyg/hal/hal_diag.h> +#include <cyg/hal/hal_intr.h> // HAL interrupt macros +#include <cyg/hal/drv_api.h> // HAL ISR support + +#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 char kbd_server_stack[STACK_SIZE]; +static cyg_thread kbd_server_thread_data; +static cyg_handle_t kbd_server_thread_handle; + +static cyg_interrupt kbd_interrupt; +static cyg_handle_t kbd_interrupt_handle; + +#include "lcd_support.c" + +// FUNCTIONS + +static void +cyg_test_exit(void) +{ + while (TRUE) ; +} + +static cyg_uint8 col_state[8]; +static cyg_uint8 ext_state[8]; + +static void +kbd_delay(void) +{ + volatile int i; + for (i = 0; i < 250; i++) ; +} + +static void +kbd_scan(void) +{ + int i; + cyg_uint8 port_data, ext_data; + // Turn off drive (de-select) all columns + *(volatile cyg_uint32 *)SYSCON1 = (*(volatile cyg_uint32 *)SYSCON1 & ~SYSCON1_KBD_CTL) | + SYSCON1_KBD_LOW; + for (i = 0; i < 8; i++) { + // Select column 'i' + *(volatile cyg_uint32 *)SYSCON1 = (*(volatile cyg_uint32 *)SYSCON1 & ~SYSCON1_KBD_CTL) | + SYSCON1_KBD_COL(i); + // Small pause to let the wires charge up :-) + kbd_delay(); + // Grab the data + col_state[i] = port_data = *(volatile cyg_uint8 *)PADR; + ext_state[i] = ext_data = *(volatile cyg_uint8 *)KBD_PORT; + // De-Select column 'i' + *(volatile cyg_uint32 *)SYSCON1 = (*(volatile cyg_uint32 *)SYSCON1 & ~SYSCON1_KBD_CTL) | + SYSCON1_KBD_TRISTATE; + // Allow line to gl slack + kbd_delay(); + } + // Turn on drive (select) all columns - necessary to see interrupts + *(volatile cyg_uint32 *)SYSCON1 = (*(volatile cyg_uint32 *)SYSCON1 & ~SYSCON1_KBD_CTL) | + SYSCON1_KBD_HIGH; +} + + +static cyg_mbox kbd_events_mbox; +static cyg_handle_t kbd_events_mbox_handle; +static cyg_sem_t kbd_sem; +static cyg_uint8 kbd_state[128]; // Known state of each key +static cyg_uint8 kbd_new_state[128]; // Current state of each key + +#define MOD_Shift 0x40 +#define MOD_Ctrl 0x20 +#define MOD_CapsLock 0x10 +static cyg_uint32 kbd_modifiers; + +// Row #1 +#define KBD_Escape 0x00 +#define KBD_F1 0x01 +#define KBD_F2 0x02 +#define KBD_F3 0x03 +#define KBD_F4 0x04 +#define KBD_F5 0x05 +#define KBD_F6 0x06 +#define KBD_F7 0x07 +#define KBD_F8 0x08 +#define KBD_F9 0x09 +#define KBD_F10 0x0A +#define KBD_NumLock 0x0B +#define KBD_SysReq 0x0C +#define KBD_ScrlLock 0x0D +#define KBD_Break 0x0E +// Row #2 +#define KBD_1 0x10 +#define KBD_2 0x11 +#define KBD_3 0x12 +#define KBD_4 0x13 +#define KBD_5 0x14 +#define KBD_6 0x15 +#define KBD_7 0x16 +#define KBD_8 0x17 +#define KBD_9 0x18 +#define KBD_0 0x19 +#define KBD_Hyphen 0x1A +#define KBD_Equals 0x1B +#define KBD_BackSpace 0x1C +#define KBD_Home 0x1D +// Row #3 +#define KBD_Tab 0x20 +#define KBD_Q 0x21 +#define KBD_W 0x22 +#define KBD_E 0x23 +#define KBD_R 0x24 +#define KBD_T 0x25 +#define KBD_Y 0x26 +#define KBD_U 0x27 +#define KBD_I 0x28 +#define KBD_O 0x29 +#define KBD_P 0x2A +#define KBD_LeftBrkt 0x2B +#define KBD_RightBrkt 0x2C +#define KBD_BackSlash 0x2D +#define KBD_PageUp 0x2E +// Row #4 +#define KBD_CapsLock 0x30 +#define KBD_A 0x31 +#define KBD_S 0x32 +#define KBD_D 0x33 +#define KBD_F 0x34 +#define KBD_G 0x35 +#define KBD_H 0x36 +#define KBD_J 0x37 +#define KBD_K 0x38 +#define KBD_L 0x39 +#define KBD_SemiColon 0x3A +#define KBD_Quote 0x3B +#define KBD_Enter 0x3C +#define KBD_PageDown 0x3D +// Row #5 +#define KBD_LeftShift 0x40 +#define KBD_Z 0x41 +#define KBD_X 0x42 +#define KBD_C 0x43 +#define KBD_V 0x44 +#define KBD_B 0x45 +#define KBD_N 0x46 +#define KBD_M 0x47 +#define KBD_Comma 0x48 +#define KBD_Period 0x49 +#define KBD_Slash 0x4A +#define KBD_RightShift 0x4B +#define KBD_UpArrow 0x4C +#define KBD_End 0x4D +// Row #6 +#define KBD_Ctrl 0x50 +#define KBD_Function 0x51 +#define KBD_LeftAlt 0x52 +#define KBD_Accent 0x53 +#define KBD_Space 0x54 +#define KBD_RightAlt 0x55 +#define KBD_Ins 0x56 +#define KBD_Del 0x57 +#define KBD_LeftArrow 0x58 +#define KBD_DownArrow 0x59 +#define KBD_RightArrow 0x5A + +#define KBD_Press 0x80 // Event has this bit when the key is pressed +#define KBD_Empty 0xFF + +// Map column, bit -> keycode +static cyg_uint32 kbd_map[8][16] = { + // Column #0 + {KBD_Escape, KBD_1, KBD_Tab, KBD_CapsLock, + KBD_BackSlash, KBD_Space, KBD_LeftArrow, KBD_UpArrow, + KBD_DownArrow, KBD_RightArrow, KBD_LeftShift, KBD_Ctrl, + KBD_Function, KBD_LeftAlt, KBD_RightAlt, KBD_RightShift }, + // Column #1 + {KBD_F5, KBD_6, KBD_T, KBD_G, + KBD_B, KBD_Slash, KBD_SemiColon, KBD_P, + KBD_Hyphen, KBD_F10, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #2 + {KBD_F4, KBD_5, KBD_R, KBD_F, + KBD_V, KBD_Del, KBD_Quote, KBD_LeftBrkt, + KBD_Equals, KBD_NumLock, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #3 + {KBD_F3, KBD_4, KBD_E, KBD_D, + KBD_C, KBD_Ins, KBD_Empty, KBD_RightBrkt, + KBD_BackSpace, KBD_SysReq, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #4 + {KBD_F2, KBD_3, KBD_W, KBD_S, + KBD_X, KBD_Empty, KBD_Enter, KBD_Empty, + KBD_Empty, KBD_ScrlLock, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #5 + {KBD_F1, KBD_2, KBD_Q, KBD_A, + KBD_Z, KBD_End, KBD_PageDown, KBD_PageUp, + KBD_Home, KBD_Break, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #6 + {KBD_F6, KBD_7, KBD_Y, KBD_H, + KBD_N, KBD_Period, KBD_L, KBD_O, + KBD_Empty, KBD_F9, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, + // Column #7 + {KBD_F7, KBD_8, KBD_U, KBD_J, + KBD_M, KBD_Comma, KBD_K, KBD_I, + KBD_Empty, KBD_F8, KBD_Empty, KBD_Empty, + KBD_Empty, KBD_Empty, KBD_Empty, KBD_Empty }, +}; + +static cyg_uint8 kbd_chars[96] = { + /* 0x00 - 0x0F */ + 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x10 - 0x1F */ + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0x08, 0x00, 0x00, 0x00, + /* 0x20 - 0x2F */ + '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\\', 0x00, 0x00, + /* 0x30 - 0x3F */ + 0x00, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', 0x0D, 0x00, 0x00, 0x00, + /* 0x40 - 0x4F */ + 0x00, 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x50 - 0x5F */ + 0x00, 0x00, 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static cyg_uint8 kbd_shifted_chars[96] = { + /* 0x00 - 0x0F */ + '\b', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x10 - 0x1F */ + '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 0x08, 0x00, 0x00, 0x00, + /* 0x20 - 0x2F */ + '\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '|', 0x00, 0x00, + /* 0x30 - 0x3F */ + 0x00, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', 0x0D, 0x00, 0x00, 0x00, + /* 0x40 - 0x4F */ + 0x00, 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x50 - 0x5F */ + 0x00, 0x00, 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +// This ISR is called when the keyboard interrupt occurs +int +keyboard_isr(cyg_vector_t vector, cyg_addrword_t data, HAL_SavedRegisters *regs) +{ + cyg_drv_interrupt_mask(CYGNUM_HAL_INTERRUPT_KBDINT); + return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR); // Run the DSR +} + +// This DSR handles the keyboard [logical] processing +void +keyboard_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + // Tell the keyboard processing thread to give it a shot + cyg_semaphore_post(&kbd_sem); +} + +static void +kbd_server(cyg_addrword_t p) +{ + int col, bit, key, event, timeout; + diag_printf("KBD server here\n"); + // This semaphore is set when there is a keypress + cyg_semaphore_init(&kbd_sem, 0); + while (TRUE) { + cyg_semaphore_wait(&kbd_sem); + // As long as keys are pressed, scan and update + timeout = 0; + while (TRUE) { + // Wait for 20ms - time to debounce keyboard + cyg_thread_delay(2); + // Scan keyboard + kbd_scan(); + // Reset state + for (key = 0; key < sizeof(kbd_new_state); key++) { + kbd_new_state[key] = 0; + } + // Check state of all keys and send events for those that change + for (col = 0; col < 8; col++) { + for (bit = 0; bit < 8; bit++) { + if (col_state[col] & (1<<bit)) { + key = kbd_map[col][bit]; + if (key != KBD_Empty) { + kbd_new_state[key] = 1; + } + } + if (ext_state[col] & (1<<bit)) { + key = kbd_map[col][bit+8]; + if (key != KBD_Empty) { + kbd_new_state[key] = 1; + } + } + } + } + // Compare new and old (known) states, generate events for changes + // Send events for modifier keys first. + for (key = 0; key < sizeof(kbd_new_state); key++) { + if (kbd_state[key] != kbd_new_state[key]) { + event = 0xFF; + switch (key) { + case KBD_LeftShift: + case KBD_RightShift: + case KBD_Ctrl: + case KBD_LeftAlt: + case KBD_RightAlt: + case KBD_Function: + case KBD_CapsLock: + if (kbd_state[key]) { + // Key going up + event = key; + } else { + // Key going down + event = key + KBD_Press; + } + kbd_state[key] = kbd_new_state[key]; + } + if (event != 0xFF) { + if (!cyg_mbox_tryput(kbd_events_mbox_handle, (void *)event)) { + diag_printf("KBD event lost: %x\n", event); + } + } + } + } + // First key up events + for (key = 0; key < sizeof(kbd_new_state); key++) { + if (kbd_state[key] != kbd_new_state[key]) { + if (kbd_state[key]) { + // Key going up + event = key; + } else { + // Key going down + event = key + KBD_Press; + } + if (!cyg_mbox_tryput(kbd_events_mbox_handle, (void *)event)) { + diag_printf("KBD event lost: %x\n", event); + } + } + kbd_state[key] = kbd_new_state[key]; + } + // Clear interrupt (true when keys are pressed) + cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_KBDINT); + if (*(volatile cyg_uint32 *)INTSR2 & INTSR2_KBDINT) { + timeout = 0; + } else if (++timeout == 5) { + // No keys for 100ms + break; + } + } + // Allow interrupts to happen again + cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_KBDINT); + cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_KBDINT); + } +} + +static void +kbd_exercise(cyg_addrword_t p) +{ + int i; + cyg_uint8 kbd_event, ch; + diag_printf("KBD test here!\n"); + + while (TRUE) { + kbd_event = (cyg_uint8)cyg_mbox_get(kbd_events_mbox_handle); + switch (kbd_event & 0x7F) { + case KBD_LeftShift: + case KBD_RightShift: + if (kbd_event & KBD_Press) { + kbd_modifiers |= MOD_Shift; + } else { + kbd_modifiers &= ~MOD_Shift; + } + break; + case KBD_Ctrl: + if (kbd_event & KBD_Press) { + kbd_modifiers |= MOD_Ctrl; + } else { + kbd_modifiers &= ~MOD_Ctrl; + } + break; + case KBD_CapsLock: + if (kbd_event & KBD_Press) { + kbd_modifiers |= MOD_CapsLock; + } else { + kbd_modifiers &= ~MOD_CapsLock; + } + break; + case KBD_LeftAlt: + case KBD_RightAlt: + case KBD_Function: + default: + } + // Show character + if (kbd_event & KBD_Press) { + if (kbd_modifiers & (MOD_Shift|MOD_CapsLock)) { + ch = kbd_shifted_chars[kbd_event & 0x7F]; + } else { + ch = kbd_chars[kbd_event & 0x7F]; + } + if (ch) { + diag_printf("CH = 0x%x:'%c'\n", ch, ch); + } + } + } + + diag_printf("All done!\n"); + cyg_test_exit(); +} + +externC void +cyg_start( void ) +{ + // Initialize environment, setup interrupt handler + *(volatile cyg_uint8 *)PADDR = 0x00; // All bits input + cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_KBDINT, + 99, // Priority - what goes here? + 0, // Data item passed to interrupt handler + (cyg_ISR_t *)keyboard_isr, + (cyg_DSR_t *)keyboard_dsr, + &kbd_interrupt_handle, + &kbd_interrupt); + cyg_drv_interrupt_attach(kbd_interrupt_handle); + cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_KBDINT); + cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_KBDINT); + // Set up the mbox for keyboard data + cyg_mbox_create(&kbd_events_mbox_handle, &kbd_events_mbox); + // Create a main thread, so we can run the scheduler and have time 'pass' + cyg_thread_create(11, // Priority - just a number + kbd_exercise, // entry + 0, // initial parameter + "KBD_thread", // Name + &stack[0], // Stack + STACK_SIZE, // Size + &thread_handle, // Handle + &thread_data // Thread data structure + ); + cyg_thread_resume(thread_handle); // Start it + // Create another thread whose job it is to de-bounce the keyboard and + // actually process the input, turning it into a series of events + cyg_thread_create(10, // Priority - just a number + kbd_server, // entry + 0, // initial parameter + "KBD_server", // Name + &kbd_server_stack[0], // Stack + STACK_SIZE, // Size + &kbd_server_thread_handle, // Handle + &kbd_server_thread_data // Thread data structure + ); + cyg_thread_resume(kbd_server_thread_handle); // Start it + // Let 'em fly... + cyg_scheduler_start(); +} // cyg_package_start() +
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/misc/lcd_support.c @@ -0,0 +1,320 @@ +//========================================================================== +// +// lcd_support.c +// +// Cirrus CL72xx eval board LCD support code +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 1999-09-01 +// Description: Functions to drive LCD display +//####DESCRIPTIONEND#### + +// 8x8 Font - from Helios + +#define FIRST_CHAR 0x20 +#define LAST_CHAR 0x7E +#define FONT_HEIGHT 8 +#define FONT_WIDTH 8 +static char font_table[LAST_CHAR-FIRST_CHAR+1][8] = +{ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */ + { 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ! */ + { 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* " */ + { 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00 }, /* # */ + { 0x30, 0xFC, 0x16, 0x7C, 0xD0, 0x7E, 0x18, 0x00 }, /* $ */ + { 0x06, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x60, 0x00 }, /* % */ + { 0x1C, 0x36, 0x36, 0x1C, 0xB6, 0x66, 0xDC, 0x00 }, /* & */ + { 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ' */ + { 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00 }, /* ( */ + { 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00 }, /* ) */ + { 0x00, 0x18, 0x7E, 0x3C, 0x7E, 0x18, 0x00, 0x00 }, /* * */ + { 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00 }, /* + */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x0C }, /* , */ + { 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 }, /* - */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00 }, /* . */ + { 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00 }, /* / */ + { 0x3C, 0x66, 0x76, 0x7E, 0x6E, 0x66, 0x3C, 0x00 }, /* 0 */ + { 0x18, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* 1 */ + { 0x3C, 0x66, 0x60, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* 2 */ + { 0x3C, 0x66, 0x60, 0x38, 0x60, 0x66, 0x3C, 0x00 }, /* 3 */ + { 0x30, 0x38, 0x3C, 0x36, 0x7E, 0x30, 0x30, 0x00 }, /* 4 */ + { 0x7E, 0x06, 0x3E, 0x60, 0x60, 0x66, 0x3C, 0x00 }, /* 5 */ + { 0x38, 0x0C, 0x06, 0x3E, 0x66, 0x66, 0x3C, 0x00 }, /* 6 */ + { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00 }, /* 7 */ + { 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00 }, /* 8 */ + { 0x3C, 0x66, 0x66, 0x7C, 0x60, 0x30, 0x1C, 0x00 }, /* 9 */ + { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00 }, /* : */ + { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x0C }, /* ; */ + { 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00 }, /* < */ + { 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00 }, /* = */ + { 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00 }, /* > */ + { 0x3C, 0x66, 0x30, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ? */ + { 0x3C, 0x66, 0x76, 0x56, 0x76, 0x06, 0x3C, 0x00 }, /* @ */ + { 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* A */ + { 0x3E, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3E, 0x00 }, /* B */ + { 0x3C, 0x66, 0x06, 0x06, 0x06, 0x66, 0x3C, 0x00 }, /* C */ + { 0x1E, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1E, 0x00 }, /* D */ + { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x7E, 0x00 }, /* E */ + { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* F */ + { 0x3C, 0x66, 0x06, 0x76, 0x66, 0x66, 0x3C, 0x00 }, /* G */ + { 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* H */ + { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* I */ + { 0x7C, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00 }, /* J */ + { 0x66, 0x36, 0x1E, 0x0E, 0x1E, 0x36, 0x66, 0x00 }, /* K */ + { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x7E, 0x00 }, /* L */ + { 0xC6, 0xEE, 0xFE, 0xD6, 0xD6, 0xC6, 0xC6, 0x00 }, /* M */ + { 0x66, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0x66, 0x00 }, /* N */ + { 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* O */ + { 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* P */ + { 0x3C, 0x66, 0x66, 0x66, 0x56, 0x36, 0x6C, 0x00 }, /* Q */ + { 0x3E, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x66, 0x00 }, /* R */ + { 0x3C, 0x66, 0x06, 0x3C, 0x60, 0x66, 0x3C, 0x00 }, /* S */ + { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* T */ + { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* U */ + { 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* V */ + { 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00 }, /* W */ + { 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00 }, /* X */ + { 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00 }, /* Y */ + { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x7E, 0x00 }, /* Z */ + { 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E, 0x00 }, /* [ */ + { 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00 }, /* \ */ + { 0x7C, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7C, 0x00 }, /* ] */ + { 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ^ */ + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF }, /* _ */ + { 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ` */ + { 0x00, 0x00, 0x3C, 0x60, 0x7C, 0x66, 0x7C, 0x00 }, /* a */ + { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00 }, /* b */ + { 0x00, 0x00, 0x3C, 0x66, 0x06, 0x66, 0x3C, 0x00 }, /* c */ + { 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* d */ + { 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x06, 0x3C, 0x00 }, /* e */ + { 0x38, 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x00 }, /* f */ + { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* g */ + { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* h */ + { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* i */ + { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x0E }, /* j */ + { 0x06, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x00 }, /* k */ + { 0x1C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* l */ + { 0x00, 0x00, 0x6C, 0xFE, 0xD6, 0xD6, 0xC6, 0x00 }, /* m */ + { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* n */ + { 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* o */ + { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06 }, /* p */ + { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xE0 }, /* q */ + { 0x00, 0x00, 0x36, 0x6E, 0x06, 0x06, 0x06, 0x00 }, /* r */ + { 0x00, 0x00, 0x7C, 0x06, 0x3C, 0x60, 0x3E, 0x00 }, /* s */ + { 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x38, 0x00 }, /* t */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* u */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* v */ + { 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00 }, /* w */ + { 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00 }, /* x */ + { 0x00, 0x00, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* y */ + { 0x00, 0x00, 0x7E, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* z */ + { 0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00 }, /* { */ + { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* | */ + { 0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00 }, /* } */ + { 0x8C, 0xD6, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00 } /* ~ */ +}; + +#define ALPS_LH +#ifdef ALPS_LH +#define LCD_WIDTH 640 +#define LCD_HEIGHT 240 +#else +#define LCD_WIDTH 320 +#define LCD_HEIGHT 240 +#endif +// This can be 1 or 2 +#define SCREEN_SCALE 2 +#define NIBBLES_PER_PIXEL (1*SCREEN_SCALE) +#define PIXELS_PER_BYTE (2/NIBBLES_PER_PIXEL) +#define PIXEL_MASK ((1<<PIXELS_PER_BYTE)-1) + +// Physical screen info +int lcd_depth; // Should be 1, 2, or 4 +int lcd_width = LCD_WIDTH; +int lcd_height = LCD_HEIGHT; +cyg_uint8 *lcd_base = (cyg_uint8 *)0xC0000000; + +// Virtual screen info +int curX = 0; // Last used position +int curY = 0; +int width = LCD_WIDTH / (FONT_WIDTH*NIBBLES_PER_PIXEL); +int height = LCD_HEIGHT / (FONT_HEIGHT*SCREEN_SCALE); +int fg = 0x0F; +int bg = 0x00; + +// Functions + +void +lcd_on(int depth) +{ + cyg_int32 ctl_word = 0; + lcd_depth = depth; + switch (depth) { + case 1: + *(volatile cyg_int32 *)PALLSW = 0xF0F0F0F0; + *(volatile cyg_int32 *)PALMSW = 0xF0F0F0F0; + ctl_word = 0; + break; + case 2: + *(volatile cyg_int32 *)PALLSW = 0xFA50FA50; + *(volatile cyg_int32 *)PALMSW = 0xFA50FA50; + ctl_word = LCDCON_GSEN; + break; + case 4: + *(volatile cyg_int32 *)PALLSW = 0x76543210; + *(volatile cyg_int32 *)PALMSW = 0xFEDCBA98; + ctl_word = LCDCON_GSEN | LCDCON_GSMD; + break; + } + // Video buffer size + ctl_word |= ((lcd_width * lcd_height * lcd_depth) / 128 - 1) << LCDCON_BUFSIZ_S; + // Line length + ctl_word |= ((lcd_width / 16) - 1) << LCDCON_LINE_LENGTH_S; + // Pixel prescale + ctl_word |= ((526628 / (lcd_height * lcd_width)) - 1) << LCDCON_PIX_PRESCALE_S; + // AC frequency bias + ctl_word |= 0 << LCDCON_AC_PRESCALE_S; + *(volatile cyg_int32 *)LCDCON = ctl_word; + diag_printf("Depth: %d, ctl: %x\n", depth, ctl_word); + +#ifdef ALPS_LH +#define LCD_DCDC 0x02 +#define LCD_ENABLE 0x04 +#define LCD_BACKLIGHT 0x08 +#define LCD_INIT (LCD_DCDC|LCD_ENABLE|LCD_BACKLIGHT) + *(volatile cyg_uint8 *)PDDDR = 0x40; // 1's are inputs (backwards from A/B/E) + *(volatile cyg_uint8 *)PDDR = LCD_INIT; // Enable video + backlight + DC-DC converter +#else +#ifdef _CL7111 + *(volatile cyg_uint8 *)PDDR = 0x20; // Enable video + *(volatile cyg_uint8 *)PEDDR = 0x0F; // Register E data direction + *(volatile cyg_uint8 *)PEDR |= 0x01; // Enable PE2 + + *(volatile cyg_uint32 *)PMPCON = 0x500; // Enable DC-to-DC pump #1 +#endif +#endif + + *(volatile cyg_uint8 *)FRBADDR = 0x0C; // Highest order nibble of LCD frame address + + *(volatile cyg_uint32 *)SYSCON1 |= SYSCON1_LCDEN; +} + +// Clear screen +static void +lcd_clear(void) +{ + cyg_int8 *ptr = lcd_base; + int i; + for (i = 0; i < (lcd_width*lcd_height*lcd_depth)/8; i++) { + *ptr++ = 0; + } + curX = 0; curY = 0; +} + +// Render a character at position (X,Y) with current background/foreground +static void +lcd_drawc(cyg_int8 c, int x, int y) +{ + // Note: this only works for fonts which are a multiple of 8 bits wide! + cyg_uint8 *bufptr, bits; + int l, p, w; + switch (lcd_depth) { + case 1: + bufptr = lcd_base + ((y * FONT_HEIGHT * (lcd_width*lcd_depth)) + (x * FONT_WIDTH)) / 8; + for (l = 0; l < FONT_HEIGHT; l++) { + *bufptr = font_table[c][l]; + bufptr += (lcd_width*lcd_depth)/8; + } + break; + case 2: + diag_printf("Depth 2 not implemented\n"); + break; + case 4: + bufptr = lcd_base + ((y * (FONT_HEIGHT*SCREEN_SCALE) * (lcd_width*lcd_depth)) + + (x * (FONT_WIDTH*SCREEN_SCALE) * lcd_depth)) / 8; + for (l = 0; l < FONT_HEIGHT; l++) { + for (w = 0; w < SCREEN_SCALE; w++) { + bits = font_table[c-FIRST_CHAR][l]; + for (p = 0; p < 8; p += PIXELS_PER_BYTE) { + switch (bits & PIXEL_MASK) { + case 0: + *bufptr++ = (bg << 4) | bg; + break; + case 1: +#if SCREEN_SCALE == 1 + *bufptr++ = (bg << 4) | fg; +#else + *bufptr++ = (fg << 4) | fg; +#endif + break; +#if SCREEN_SCALE == 1 + case 2: + *bufptr++ = (fg << 4) | bg; + break; + case 3: + *bufptr++ = (fg << 4) | fg; + break; +#endif + } + bits >>= PIXELS_PER_BYTE; + } + bufptr += (lcd_width*lcd_depth)/8 - (8/PIXELS_PER_BYTE); + } + } + break; + } +} + +static void +lcd_putc(cyg_int8 c) +{ + switch (c) { + case '\r': + curX = 0; + break; + case '\n': + curY++; + break; + case '\b': + curX--; + if (curX < 0) { + curY--; + if (curY < 0) curY = 0; + curX = width-1; + } + default: + lcd_drawc(c, curX, curY); + curX++; + if (curX == width) { + curY++; + curX = 0; + } + } +} +
--- a/packages/hal/arm/cl7211/current/misc/lcd_test.c +++ b/packages/hal/arm/cl7211/current/misc/lcd_test.c @@ -31,7 +31,7 @@ // // Author(s): gthomas // Contributors: gthomas -// Date: 1999-05-15 +// Date: 1999-09-01 // Description: Tool used to test LCD controller //####DESCRIPTIONEND#### @@ -51,124 +51,7 @@ static char stack[STACK_SIZE]; static cyg_thread thread_data; static cyg_handle_t thread_handle; -// 8x8 Font - from Helios - -#define FIRST_CHAR 0x20 -#define LAST_CHAR 0x7E -#define FONT_HEIGHT 8 -#define FONT_WIDTH 8 -static char font_table[LAST_CHAR-FIRST_CHAR+1][8] = -{ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */ - { 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ! */ - { 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* " */ - { 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00 }, /* # */ - { 0x30, 0xFC, 0x16, 0x7C, 0xD0, 0x7E, 0x18, 0x00 }, /* $ */ - { 0x06, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x60, 0x00 }, /* % */ - { 0x1C, 0x36, 0x36, 0x1C, 0xB6, 0x66, 0xDC, 0x00 }, /* & */ - { 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ' */ - { 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00 }, /* ( */ - { 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00 }, /* ) */ - { 0x00, 0x18, 0x7E, 0x3C, 0x7E, 0x18, 0x00, 0x00 }, /* * */ - { 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00 }, /* + */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x0C }, /* , */ - { 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00 }, /* - */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00 }, /* . */ - { 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00 }, /* / */ - { 0x3C, 0x66, 0x76, 0x7E, 0x6E, 0x66, 0x3C, 0x00 }, /* 0 */ - { 0x18, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* 1 */ - { 0x3C, 0x66, 0x60, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* 2 */ - { 0x3C, 0x66, 0x60, 0x38, 0x60, 0x66, 0x3C, 0x00 }, /* 3 */ - { 0x30, 0x38, 0x3C, 0x36, 0x7E, 0x30, 0x30, 0x00 }, /* 4 */ - { 0x7E, 0x06, 0x3E, 0x60, 0x60, 0x66, 0x3C, 0x00 }, /* 5 */ - { 0x38, 0x0C, 0x06, 0x3E, 0x66, 0x66, 0x3C, 0x00 }, /* 6 */ - { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00 }, /* 7 */ - { 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00 }, /* 8 */ - { 0x3C, 0x66, 0x66, 0x7C, 0x60, 0x30, 0x1C, 0x00 }, /* 9 */ - { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00 }, /* : */ - { 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x0C }, /* ; */ - { 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00 }, /* < */ - { 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00 }, /* = */ - { 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00 }, /* > */ - { 0x3C, 0x66, 0x30, 0x18, 0x18, 0x00, 0x18, 0x00 }, /* ? */ - { 0x3C, 0x66, 0x76, 0x56, 0x76, 0x06, 0x3C, 0x00 }, /* @ */ - { 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* A */ - { 0x3E, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3E, 0x00 }, /* B */ - { 0x3C, 0x66, 0x06, 0x06, 0x06, 0x66, 0x3C, 0x00 }, /* C */ - { 0x1E, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1E, 0x00 }, /* D */ - { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x7E, 0x00 }, /* E */ - { 0x7E, 0x06, 0x06, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* F */ - { 0x3C, 0x66, 0x06, 0x76, 0x66, 0x66, 0x3C, 0x00 }, /* G */ - { 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00 }, /* H */ - { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00 }, /* I */ - { 0x7C, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00 }, /* J */ - { 0x66, 0x36, 0x1E, 0x0E, 0x1E, 0x36, 0x66, 0x00 }, /* K */ - { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x7E, 0x00 }, /* L */ - { 0xC6, 0xEE, 0xFE, 0xD6, 0xD6, 0xC6, 0xC6, 0x00 }, /* M */ - { 0x66, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0x66, 0x00 }, /* N */ - { 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* O */ - { 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x06, 0x00 }, /* P */ - { 0x3C, 0x66, 0x66, 0x66, 0x56, 0x36, 0x6C, 0x00 }, /* Q */ - { 0x3E, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x66, 0x00 }, /* R */ - { 0x3C, 0x66, 0x06, 0x3C, 0x60, 0x66, 0x3C, 0x00 }, /* S */ - { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* T */ - { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* U */ - { 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* V */ - { 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00 }, /* W */ - { 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00 }, /* X */ - { 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00 }, /* Y */ - { 0x7E, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x7E, 0x00 }, /* Z */ - { 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E, 0x00 }, /* [ */ - { 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00 }, /* \ */ - { 0x7C, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7C, 0x00 }, /* ] */ - { 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ^ */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF }, /* _ */ - { 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ` */ - { 0x00, 0x00, 0x3C, 0x60, 0x7C, 0x66, 0x7C, 0x00 }, /* a */ - { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00 }, /* b */ - { 0x00, 0x00, 0x3C, 0x66, 0x06, 0x66, 0x3C, 0x00 }, /* c */ - { 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* d */ - { 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x06, 0x3C, 0x00 }, /* e */ - { 0x38, 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x00 }, /* f */ - { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* g */ - { 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* h */ - { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* i */ - { 0x18, 0x00, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x0E }, /* j */ - { 0x06, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x00 }, /* k */ - { 0x1C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00 }, /* l */ - { 0x00, 0x00, 0x6C, 0xFE, 0xD6, 0xD6, 0xC6, 0x00 }, /* m */ - { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x66, 0x66, 0x00 }, /* n */ - { 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00 }, /* o */ - { 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06 }, /* p */ - { 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xE0 }, /* q */ - { 0x00, 0x00, 0x36, 0x6E, 0x06, 0x06, 0x06, 0x00 }, /* r */ - { 0x00, 0x00, 0x7C, 0x06, 0x3C, 0x60, 0x3E, 0x00 }, /* s */ - { 0x0C, 0x0C, 0x3E, 0x0C, 0x0C, 0x0C, 0x38, 0x00 }, /* t */ - { 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00 }, /* u */ - { 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00 }, /* v */ - { 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00 }, /* w */ - { 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00 }, /* x */ - { 0x00, 0x00, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x3C }, /* y */ - { 0x00, 0x00, 0x7E, 0x30, 0x18, 0x0C, 0x7E, 0x00 }, /* z */ - { 0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00 }, /* { */ - { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00 }, /* | */ - { 0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00 }, /* } */ - { 0x8C, 0xD6, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00 } /* ~ */ -}; - -// Physical screen info -int lcd_depth; // Should be 1, 2, or 4 -int lcd_width = 320; -int lcd_height = 240; -cyg_uint8 *lcd_base = 0xC0000000; - -// Virtual screen info -int curX = 0; // Last used position -int curY = 0; -int width = 320 / FONT_WIDTH; -int height = 240 / FONT_HEIGHT; -int fg = 0x0F; -int bg = 0x00; +#include "lcd_support.c" // FUNCTIONS @@ -178,136 +61,6 @@ cyg_test_exit(void) while (TRUE) ; } -void -lcd_on(int depth) -{ - cyg_int32 ctl_word; - lcd_depth = depth; - switch (depth) { - case 1: - *(volatile cyg_int32 *)PALLSW = 0xF0F0F0F0; - *(volatile cyg_int32 *)PALMSW = 0xF0F0F0F0; - ctl_word = 0; - break; - case 2: - *(volatile cyg_int32 *)PALLSW = 0xFA50FA50; - *(volatile cyg_int32 *)PALMSW = 0xFA50FA50; - ctl_word = LCDCON_GSEN; - break; - case 4: - *(volatile cyg_int32 *)PALLSW = 0x76543210; - *(volatile cyg_int32 *)PALMSW = 0xFEDCBA98; - ctl_word = LCDCON_GSEN | LCDCON_GSMD; - break; - } - // Video buffer size - ctl_word |= ((lcd_width * lcd_height * lcd_depth) / 128 - 1) << LCDCON_BUFSIZ_S; - // Line length - ctl_word |= ((lcd_width / 16) - 1) << LCDCON_LINE_LENGTH_S; - // Pixel prescale - ctl_word |= ((526628 / (lcd_height * lcd_width)) - 1) << LCDCON_PIX_PRESCALE_S; - // AC frequency bias - ctl_word |= 0 << LCDCON_AC_PRESCALE_S; - *(volatile cyg_int32 *)LCDCON = ctl_word; - diag_printf("Depth: %d, ctl: %x\n", depth, ctl_word); - - *(volatile cyg_uint8 *)PDDR = 0x20; // Enable video - *(volatile cyg_uint8 *)PEDDR = 0x0F; // Register E data direction - *(volatile cyg_uint8 *)PEDR |= 0x01; // Enable PE2 - - *(volatile cyg_uint32 *)PMPCON = 0x500; // Enable DC-to-DC pump #1 - - *(volatile cyg_uint8 *)FRBADDR = 0x0C; // Highest order nibble of LCD frame address - - *(volatile cyg_uint32 *)SYSCON1 |= SYSCON1_LCDEN; -} - -// Clear screen -static void -lcd_clear(void) -{ - cyg_int8 *ptr = lcd_base; - int i; - for (i = 0; i < (lcd_width*lcd_height*lcd_depth)/8; i++) { - *ptr++ = 0; - } - curX = 0; curY = 0; -} - -// Render a character at position (X,Y) with current background/foreground -static void -lcd_drawc(cyg_int8 c, int x, int y) -{ - // Note: this only works for fonts which are a multiple of 8 bits wide! - cyg_uint8 *bufptr, bits; - int l, p; - switch (lcd_depth) { - case 1: - bufptr = lcd_base + ((y * FONT_HEIGHT * (lcd_width*lcd_depth)) + (x * FONT_WIDTH)) / 8; - for (l = 0; l < FONT_HEIGHT; l++) { - *bufptr = font_table[c][l]; - bufptr += (lcd_width*lcd_depth)/8; - } - break; - case 2: - diag_printf("Depth 2 not implemented\n"); - break; - case 4: - bufptr = lcd_base + ((y * FONT_HEIGHT * (lcd_width*lcd_depth)) + (x * FONT_WIDTH * lcd_depth)) / 8; - for (l = 0; l < FONT_HEIGHT; l++) { - bits = font_table[c][l]; - for (p = 0; p < 8; p += 2) { -// switch ((bits>>6) & 0x03) { - switch (bits & 0x03) { - case 0: - *bufptr++ = (bg << 4) | bg; - break; - case 1: - *bufptr++ = (bg << 4) | fg; - break; - case 2: - *bufptr++ = (fg << 4) | bg; - break; - case 3: - *bufptr++ = (fg << 4) | fg; - break; - } - bits >>= 2; -// bits <<= 2; - } - bufptr += (lcd_width*lcd_depth)/8 - 4;; - } - break; - } -} - -static void -lcd_putc(cyg_int8 c) -{ - switch (c) { - case '\r': - curX = 0; - break; - case '\n': - curY++; - break; - case '\b': - curX--; - if (curX < 0) { - curY--; - if (curY < 0) curY = 0; - curX = width-1; - } - default: - lcd_drawc(c, curX, curY); - curX++; - if (curX == width) { - curY++; - curX = 0; - } - } -} - static void lcd_test(int depth) { @@ -332,11 +85,11 @@ lcd_test(int depth) } static void -lcd_exercise(void) +lcd_exercise(cyg_addrword_t p) { diag_printf("LCD test here!\n"); - lcd_test(1); +// lcd_test(1); // lcd_test(2); lcd_test(4); @@ -350,7 +103,7 @@ 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_exercise, // entry - 1, // index + 0, // entry parameter "LCD_test_thread", // Name &stack[0], // Stack STACK_SIZE, // Size
new file mode 100644 --- /dev/null +++ b/packages/hal/arm/cl7211/current/misc/panel_test.c @@ -0,0 +1,175 @@ +//========================================================================== +// +// panel_test.c +// +// Cirrus CL72xx eval board LCD touch panel test code +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 1999-05-15 +// Description: Tool used to test LCD touch panel +//####DESCRIPTIONEND#### + +#include <pkgconf/kernel.h> // Configuration header +#include <cyg/kernel/kapi.h> +#include <cyg/infra/diag.h> + +#include <cyg/hal/hal_cl7211.h> // Board definitions + +#include <cyg/hal/hal_io.h> // IO macros +#include <cyg/hal/hal_arch.h> // Register state info +#include <cyg/hal/hal_diag.h> +#include <cyg/hal/hal_intr.h> // HAL interrupt macros +#include <cyg/hal/drv_api.h> // HAL ISR support + +#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 cyg_interrupt panel_interrupt; +static cyg_handle_t panel_interrupt_handle; + +#include "lcd_support.c" + +#define SYNCIO_TXFRMEN (1<<14) +#define SYNCIO_FRAMELEN(n) (n<<8) +#define ADC_START (1<<7) +#define ADC_CHAN(n) (n<<4) +#define ADC_UNIPOLAR (1<<3) +#define ADC_SINGLE (1<<2) +#define ADC_EXT_CLOCK (3<<0) +#define TOUCH_CTL KBD_PORT + +// FUNCTIONS + +static void +cyg_test_exit(void) +{ + while (TRUE) ; +} + +static cyg_uint32 +adc_sample(int chan) +{ + cyg_uint32 val; + *(volatile cyg_uint32 *)SYNCIO = SYNCIO_TXFRMEN | SYNCIO_FRAMELEN(24) | + ADC_START | ADC_CHAN(chan) | ADC_UNIPOLAR | ADC_SINGLE | ADC_EXT_CLOCK; + while (*(volatile cyg_uint32 *)SYSFLG1 & SYSFLG1_SSIBUSY) ; + val = *(volatile cyg_uint32 *)SYNCIO; + return val & 0xFFFF; +} + +static void +panel_delay(void) +{ + volatile int i; + for (i = 0; i < 50; i++) ; +} + +// This ISR is called when the touch panel interrupt occurs +int +cyg_hal_panel_isr(cyg_vector_t vector, cyg_addrword_t data, HAL_SavedRegisters *regs) +{ + int iX, iY; + cyg_drv_interrupt_mask(CYGNUM_HAL_INTERRUPT_EINT2); + diag_printf("Touched!\n"); + *(volatile cyg_uint8 *)TOUCH_CTL = 0x50; // Drive TSPY, ground TSMY, and disconnect TSPX and TSMX + panel_delay(); + iY = adc_sample(2); + *(volatile cyg_uint8 *)TOUCH_CTL = 0xA0; // Drive TSPX, ground TSMX, and disconnect TSPY and TSMY + panel_delay(); + iX = adc_sample(7); + diag_printf("X = %d, Y = %d, ISR1: %x\n", iX, iY, *(volatile cyg_uint32 *)INTSR1); + *(volatile cyg_uint8 *)TOUCH_CTL = 0x00; // Disable drives + while (*(volatile cyg_uint32 *)INTSR1 & INTSR1_EINT2) ; + *(volatile cyg_uint8 *)TOUCH_CTL = 0x70; // Idle state (so interrupt works) +// cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EINT2); + return 0; // No need to run DSR +} + +static void +panel_exercise(cyg_addrword_t p) +{ + int i, j; + diag_printf("LCD touch panel test here!\n"); + + *(volatile cyg_uint8 *)PEDDR = 0x0F; // Register E data direction + *(volatile cyg_uint8 *)PEDR |= 0x04; // Enable touch panel + + diag_printf("PEDR = %x\n", *(volatile cyg_uint8 *)PEDR); + + *(volatile cyg_uint8 *)TOUCH_CTL = 0x70; // Idle state (so interrupt works) + + lcd_on(4); + lcd_clear(); + + *(volatile cyg_uint32 *)SYSCON1 |= SYSCON1_ADC_CLOCK_128kHZ; + + cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_EINT2, + 99, // Priority - what goes here? + 0, // Data item passed to interrupt handler + cyg_hal_panel_isr, + 0, + &panel_interrupt_handle, + &panel_interrupt); + cyg_drv_interrupt_attach(panel_interrupt_handle); + cyg_drv_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_EINT2); + cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EINT2); + + for (i = 0; i < 50; i++) { + diag_printf("Please touch screen now:\n"); + cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EINT2); + cyg_thread_delay(5*100); + } + + diag_printf("All done!\n"); + 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 + panel_exercise, // entry + 0, // initial parameter + "LCD_panel_thread", // 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() +
--- a/packages/hal/arm/cl7211/current/src/cl7211_misc.c +++ b/packages/hal/arm/cl7211/current/src/cl7211_misc.c @@ -54,7 +54,7 @@ #include <cyg/hal/hal_cache.h> #include <cyg/hal/hal_cl7211.h> // Hardware definitions -#define CYGHWR_HAL_ARM_CL7211_BATLOW +// #define CYGHWR_HAL_ARM_CL7211_BATLOW #ifdef CYGHWR_HAL_ARM_CL7211_BATLOW #include <cyg/hal/hal_intr.h> // HAL interrupt macros #include <cyg/hal/drv_api.h> // HAL ISR support @@ -188,7 +188,7 @@ static cyg_uint32 hal_interrupt_clear_ma 0, // CYGNUM_HAL_INTERRUPT_URXINT1 14 UMSEOI, // CYGNUM_HAL_INTERRUPT_UMSINT 15 0, // CYGNUM_HAL_INTERRUPT_SSEOTI 16 - 0, // CYGNUM_HAL_INTERRUPT_KBDINT 17 + KBDEOI, // CYGNUM_HAL_INTERRUPT_KBDINT 17 0, // CYGNUM_HAL_INTERRUPT_SS2RX 18 0, // CYGNUM_HAL_INTERRUPT_SS2TX 19 0, // CYGNUM_HAL_INTERRUPT_UTXINT2 20 @@ -248,7 +248,7 @@ void hal_hardware_init(void) // Reset all interrupt masks (disable all interrupt sources) *(volatile cyg_uint32 *)INTMR1 = 0; *(volatile cyg_uint32 *)INTMR2 = 0; -#if defined(__CL7211) +#if !defined(__CL7111) *(volatile cyg_uint32 *)INTMR3 = 0; *(volatile cyg_uint8 *)SYSCON3 = SYSCON3_CLKCTL(CPU_CLOCK); #endif @@ -315,7 +315,7 @@ void hal_interrupt_unmask(int vector) void hal_interrupt_acknowledge(int vector) { // Some interrupt sources have a register for this. - volatile cyg_uint32 *icr; + volatile cyg_uint8 *icr; icr = (volatile cyg_uint32 *)hal_interrupt_clear_map[vector]; if (icr) { *icr = 0; // Any data clears interrupt
--- a/packages/hal/arm/cl7211/current/support/io.c +++ b/packages/hal/arm/cl7211/current/support/io.c @@ -61,7 +61,7 @@ uspin(int len) { volatile int cnt; while (--len >= 0) { - for (cnt = 1; cnt < 100; cnt++) ; + for (cnt = 1; cnt < 2000; cnt++) ; } }
--- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,16 @@ +1999-09-09 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * include/pkgconf/hal.h (CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS): Rename + CYGPKG_HAL_MN10300_SIM to CYGPKG_HAL_MN10300_AM31_SIM + +1999-09-07 Nick Garnett <nickg@cygnus.co.uk> + + * src/dbg-threads-syscall.c (dbg_currthread_id): Fixed to return + zero if dbg_currthread() returns false. Previously it could have + returned a random value which would have made GDB think there had + been a thread switch when there hadn't. It was particularly prone + to do this in configurations where the kernel was absent. + 1999-09-01 Gary Thomas <gthomas@cygnus.co.uk> * include/pkgconf/hal.h: Always include target and platform package
--- a/packages/hal/common/current/include/pkgconf/hal.h +++ b/packages/hal/common/current/include/pkgconf/hal.h @@ -312,7 +312,7 @@ display "Include GDB stubs in HAL" parent CYGPKG_HAL_DEBUG requires !CYGPKG_HAL_POWERPC_SIM - requires !CYGPKG_HAL_MN10300_SIM + requires !CYGPKG_HAL_MN10300_AM31_SIM requires !CYGPKG_HAL_MIPS_SIM requires !CYGPKG_HAL_I386_LINUX requires !CYGPKG_HAL_SPARCLITE
--- a/packages/hal/common/current/src/dbg-threads-syscall.c +++ b/packages/hal/common/current/src/dbg-threads-syscall.c @@ -179,9 +179,9 @@ unsigned long swap32(unsigned long x) int dbg_currthread_id(void) { threadref ref; - dbg_currthread( &ref ); - - return (cyg_uint16)swap32(((unsigned long *)ref)[1]); + if( dbg_currthread( &ref ) ) + return (cyg_uint16)swap32(((unsigned long *)ref)[1]); + else return 0; } #endif
--- a/packages/hal/mips/arch/current/ChangeLog +++ b/packages/hal/mips/arch/current/ChangeLog @@ -1,3 +1,14 @@ +1999-09-09 Nick Garnett <nickg@cygnus.co.uk> + + * include/arch.inc: + Moved code to initialize cache out to variant header since it is + variant specific. + +1999-09-08 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * src/hal_misc.c (exception_handler): Catch exceptions that come from + within GDB stubs and return if that's what the stubs intend + 1999-08-19 Nick Garnett <nickg@cygnus.co.uk> * include/hal_io.h: Added include of plf_io.h.
--- a/packages/hal/mips/arch/current/include/arch.inc +++ b/packages/hal/mips/arch/current/include/arch.inc @@ -407,8 +407,8 @@ hal_intc_translation_table: # General macro to save everything .macro hal_fpu_save regs + hal_fpu_save_caller \regs hal_fpu_save_callee \regs - hal_fpu_save_caller \regs .endm # Reload the caller-saved registers. @@ -526,6 +526,7 @@ hal_intc_translation_table: .endm #else .macro hal_cache_init + mfc0 v0,config0 # disable Kseg0 caching in config0 register nop nop @@ -537,32 +538,6 @@ hal_intc_translation_table: nop nop - .set mips3 # Set ISA to MIPS 3 to allow cache insns - - # Now ensure the caches are invalidated - may be applicable if the - # target has soft-reset - # D-cache: - la a0,0x80000000 - addi a1,a0,0x2000 -1: - cache 0x01,0(a0) - addi a0,a0,0x10 - sub v0,a1,a0 - bgez v0,1b - nop # delay slot - - # I-cache: - la a0,0x80000000 - addi a1,a0,0x4000 -1: - cache 0x00,0(a0) - addi a0,a0,0x20 - sub v0,a1,a0 - bgez v0,1b - nop # delay slot - - .set mips0 # reset ISA to default - .endm #endif
--- a/packages/hal/mips/arch/current/src/hal_misc.c +++ b/packages/hal/mips/arch/current/src/hal_misc.c @@ -68,6 +68,8 @@ externC void __handle_exception (void); externC HAL_SavedRegisters *_hal_registers; +externC void *__mem_fault_handler; + externC cyg_uint8 cyg_hal_mips_process_fpe( HAL_SavedRegisters *regs ); externC void exception_handler(HAL_SavedRegisters *regs) @@ -88,6 +90,13 @@ externC void exception_handler(HAL_Saved #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + // If we caught an exception inside the stubs, see if we were expecting it + // and if so jump to the saved address + if (__mem_fault_handler) { + regs->pc = (CYG_ADDRWORD)__mem_fault_handler; + return; // Caught an exception inside stubs + } + // Set the pointer to the registers of the current exception // context. At entry the GDB stub will expand the // HAL_SavedRegisters structure into a (bigger) register array.
--- a/packages/hal/mn10300/am31/current/ChangeLog +++ b/packages/hal/mn10300/am31/current/ChangeLog @@ -1,3 +1,20 @@ +1999-09-10 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * src/var_misc.c (cyg_hal_dcache_store): Condition on + CYG_HAL_MN10300_AM31_SIM rather than CYG_HAL_MN10300_SIM + +1999-09-10 Nick Garnett <nickg@cygnus.co.uk> + + * include/variant.inc: Added test to code that installs hardware + interrupt vectors so that it also works in the minimal simulator. + Also changed instance of CYG_HAL_MN10300_SIM to + CYGPKG_HAL_MN10300_AM31_SIM. + +1999-09-09 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * src/mn10300_am31.ld: Rename CYGPKG_HAL_MN10300_SIM to + CYGPKG_HAL_MN10300_AM31_SIM + 1999-08-16 Jonathan Larmour <jlarmour@cygnus.co.uk> Copy entire package from hal/mn10300/am32
--- a/packages/hal/mn10300/am31/current/include/variant.inc +++ b/packages/hal/mn10300/am31/current/include/variant.inc @@ -248,7 +248,8 @@ led_foo3: .byte 0x00 hal_mon_init_vsr .endm -#if defined(CYG_HAL_STARTUP_ROM) +#if defined(CYG_HAL_STARTUP_ROM) || \ + defined(CYGPKG_HAL_MN10300_AM31_SIM) .macro hal_mon_init_vectors mov _mn10300_interrupt_vectors,a0 mov __hardware_vector_0,d0 @@ -301,8 +302,8 @@ led_foo3: .byte 0x00 .endm #endif -#if !(defined(CYG_HAL_STARTUP_ROM) || \ - defined(CYG_HAL_MN10300_SIM) || \ +#if !(defined(CYG_HAL_STARTUP_ROM) || \ + defined(CYGPKG_HAL_MN10300_AM31_SIM) || \ !defined(CYG_HAL_USE_ROM_MONITOR)) #define CYG_HAL_MN10300_VSR_TABLE_DEFINED
--- a/packages/hal/mn10300/am31/current/src/mn10300_am31.ld +++ b/packages/hal/mn10300/am31/current/src/mn10300_am31.ld @@ -111,7 +111,7 @@ GROUP(libtarget.a libgcc.a) _mn10300_interrupt_control = 0x34000100; _mn10300_interrupt_vectors = 0x20000000; -#if (defined (CYG_HAL_STARTUP_RAM) && ! defined (CYGPKG_HAL_MN10300_SIM)) +#if (defined (CYG_HAL_STARTUP_RAM) && ! defined (CYGPKG_HAL_MN10300_AM31_SIM)) #define VSR_BASE 0x48000000 _hal_vsr_table = VSR_BASE; _hal_virtual_vector_table = VSR_BASE + 0x80;
--- a/packages/hal/mn10300/am31/current/src/var_misc.c +++ b/packages/hal/mn10300/am31/current/src/var_misc.c @@ -58,7 +58,7 @@ void hal_variant_init(void) /*------------------------------------------------------------------------*/ /* Cache functions. */ -#if !defined(CYG_HAL_MN10300_SIM) +#if !defined(CYG_HAL_MN10300_AM31_SIM) void cyg_hal_dcache_store(CYG_ADDRWORD base, int size) { volatile register CYG_BYTE *way0 = HAL_DCACHE_PURGE_WAY0;
--- a/packages/hal/mn10300/arch/current/ChangeLog +++ b/packages/hal/mn10300/arch/current/ChangeLog @@ -1,3 +1,9 @@ +1999-09-10 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * include/hal_cache.h: Change CYG_HAL_MN10300_SIM to + CYG_HAL_MN10300_AM31_SIM + Only include var_cache.h when not sim + 1999-08-18 Nick Garnett <nickg@cygnus.co.uk> * src/hal_misc.c (cyg_hal_exception_handler):
--- a/packages/hal/mn10300/arch/current/include/arch.inc +++ b/packages/hal/mn10300/arch/current/include/arch.inc @@ -183,49 +183,5 @@ #endif #------------------------------------------------------------------------------ -# temporary trace macros - -#if 1 - -#ifdef CYGPKG_HAL_MN10300_AM31_STDEVAL1 -#define TRACE_BASE 0x48100000 -#else -#error TRACE_BASE not defined for platform -#endif - - .macro traceinit - mov TRACE_BASE,a2 - mov TRACE_BASE+0x10,d0 - mov d0,(a2) - .endm - - .macro trace,tag,arg1=0,arg2=0 - movm [d2,a2,a3],(sp) - mov TRACE_BASE,a2 - mov (a2),a3 - mov \tag,d2 - mov d2,(a3) - mov (12,a2),d2 - mov d2,(4,a3) - add 1,d2 - mov d2,(12,a2) - mov \arg1,d2 - mov d2,(8,a3) - mov \arg2,d2 - mov d2,(12,a3) - add 16,a3 - mov a3,(a2) - movm (sp),[d2,a2,a3] - .endm -#else - .macro traceinit - .endm - - .macro trace,tag,arg1=0,arg2=0 - .endm -#endif - - -#------------------------------------------------------------------------------ #endif // ifndef CYGONCE_HAL_ARCH_INC # end of arch.inc
--- a/packages/hal/mn10300/arch/current/include/hal_cache.h +++ b/packages/hal/mn10300/arch/current/include/hal_cache.h @@ -50,13 +50,15 @@ #include <pkgconf/hal.h> #include <cyg/infra/cyg_type.h> +#if !defined(CYG_HAL_MN10300_AM31_SIM) + #include <cyg/hal/var_cache.h> +#else + //============================================================================= // MN10300 Simulator -#if defined(CYG_HAL_MN10300_SIM) - //----------------------------------------------------------------------------- // Cache dimensions
--- a/packages/hal/mn10300/sim/current/ChangeLog +++ b/packages/hal/mn10300/sim/current/ChangeLog @@ -1,3 +1,29 @@ +1999-09-09 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * src/plf_misc.c: New file. + + * src/PKGconf.mak (PACKAGE): Rename hal_mn10300_sim to + hal_mn10300_am31_sim + (COMPILE): Add plf_misc.c + + * tests/PKGconf.mak (PACKAGE): Likewise + + * include/platform.inc: New file, effectively empty + * include/plf_intr.h: Likewise + * include/pkgconf/mlt_mn10300_sim_ram.ldi: Rename to + mlt_mn10300_am31_sim_ram.ldi + * include/pkgconf/mlt_mn10300_am31_sim_ram.ldi: New file + * include/pkgconf/mlt_mn10300_sim_ram.mlt: Rename to + mlt_mn10300_am31_sim_ram.mlt + * include/pkgconf/mlt_mn10300_am31_sim_ram.mlt: New file + * src/makefile: delete + +1999-09-06 Jonathan Larmour <jlarmour@cygnus.co.uk> + + * include/pkgconf/hal_mn10300_sim.h: Rename to hal_mn10300_am31_sim.h + * include/pkgconf/hal_mn10300_am31_sim.h: New file + Require AM31 target + 1999-05-20 Gary Thomas <gthomas@cygnus.co.uk> * include/pkgconf/hal_mn10300_sim.h: Move RTC setup here.
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/pkgconf/hal_mn10300_am31_sim.h @@ -0,0 +1,74 @@ +#ifndef CYGONCE_PKGCONF_HAL_MN10300_AM31_SIM_H +#define CYGONCE_PKGCONF_HAL_MN10300_AM31_SIM_H +// ==================================================================== +// +// pkgconf/hal_mn10300_am31_sim.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_MN10300_AM31_SIM { + display "AM31 minimal simulator" + type radio + parent CYGPKG_HAL_MN10300 + requires CYGPKG_HAL_MN10300_AM31 + platform sim + description " + The minimal simulator HAL package is provided for use when + only a simple simulation of the processor architecture is + desired, as opposed to detailed simulation of any specific + board. In particular it is not possible to simulate any of + the I/O devices, so device drivers cannot be used." + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ + + +// Real-time clock/counter specifics + +#define CYGNUM_HAL_RTC_NUMERATOR 1000000000 +#define CYGNUM_HAL_RTC_DENOMINATOR 100 +#define CYGNUM_HAL_RTC_PERIOD 9999 + +#endif /* CYGONCE_PKGCONF_HAL_MN10300_AM31_SIM_H */ +/* EOF hal_mn10300_am31_sim.h */
deleted file mode 100644 --- a/packages/hal/mn10300/sim/current/include/pkgconf/hal_mn10300_sim.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef CYGONCE_PKGCONF_HAL_MN10300_SIM_H -#define CYGONCE_PKGCONF_HAL_MN10300_SIM_H -// ==================================================================== -// -// pkgconf/hal_mn10300_sim.h -// -// HAL configuration file -// -// ==================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Cygnus eCos Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://sourceware.cygnus.com/ecos -// -// 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 Cygnus Operating System, released -// September 30, 1998. -// -// The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -// ==================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-09-02 -// Purpose: To allow the user to edit HAL configuration options. -// Description: -// -//####DESCRIPTIONEND#### -// -// ==================================================================== - - -/* --------------------------------------------------------------------- - {{CFG_DATA - - cdl_package CYGPKG_HAL_MN10300_SIM { - display "Minimal simulator" - type radio - parent CYGPKG_HAL_MN10300 - platform sim - description " - The minimal simulator HAL package is provided for use when - only a simple simulation of the processor architecture is - desired, as opposed to detailed simulation of any specific - board. In particular it is not possible to simulate any of - the I/O devices, so device drivers cannot be used." - } - - }}CFG_DATA */ - -/* -------------------------------------------------------------------*/ - - -// Real-time clock/counter specifics - -#define CYGNUM_HAL_RTC_NUMERATOR 1000000000 -#define CYGNUM_HAL_RTC_DENOMINATOR 100 -#define CYGNUM_HAL_RTC_PERIOD 9999 - -#endif /* CYGONCE_PKGCONF_HAL_MN10300_SIM_H */ -/* EOF hal_mn10300_sim.h */
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/pkgconf/mlt_mn10300_am31_sim_ram.ldi @@ -0,0 +1,47 @@ +//=========================================================================== +// +// MLT linker script export - Tue Jan 12 11:09:07 1999 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + +MEMORY +{ + ram : ORIGIN = 0x40000000, LENGTH = 0x200000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (ram, 0x40000000, LMA_EQ_VMA) + SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTIONS_END +}
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/pkgconf/mlt_mn10300_am31_sim_ram.mlt @@ -0,0 +1,11 @@ +version 0 +region ram 48000000 200000 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 48000000 48000000 text text ! +section text 0 1 0 1 0 1 0 1 fini fini ! +section fini 0 1 0 1 0 1 0 1 rodata rodata ! +section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! +section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! +section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! +section gcc_except_table 0 1 0 1 0 1 0 1 data data ! +section data 0 4 0 1 0 1 0 1 bss bss ! +section bss 0 4 0 1 0 0 0 0 !
deleted file mode 100644 --- a/packages/hal/mn10300/sim/current/include/pkgconf/mlt_mn10300_sim_ram.ldi +++ /dev/null @@ -1,47 +0,0 @@ -//=========================================================================== -// -// MLT linker script export - Tue Jan 12 11:09:07 1999 -// -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ------------------------------------------- -// The contents of this file are subject to the Cygnus eCos Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://sourceware.cygnus.com/ecos -// -// 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 Cygnus Operating System, released -// September 30, 1998. -// -// The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. -// ------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== - -MEMORY -{ - ram : ORIGIN = 0x40000000, LENGTH = 0x200000 -} - -SECTIONS -{ - SECTIONS_BEGIN - SECTION_rom_vectors (ram, 0x40000000, LMA_EQ_VMA) - SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTIONS_END -}
deleted file mode 100644 --- a/packages/hal/mn10300/sim/current/include/pkgconf/mlt_mn10300_sim_ram.mlt +++ /dev/null @@ -1,11 +0,0 @@ -version 0 -region ram 48000000 200000 0 ! -section rom_vectors 0 1 0 1 1 1 1 1 48000000 48000000 text text ! -section text 0 1 0 1 0 1 0 1 fini fini ! -section fini 0 1 0 1 0 1 0 1 rodata rodata ! -section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 ! -section rodata1 0 1 0 1 0 1 0 1 fixup fixup ! -section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table ! -section gcc_except_table 0 1 0 1 0 1 0 1 data data ! -section data 0 4 0 1 0 1 0 1 bss bss ! -section bss 0 4 0 1 0 0 0 0 !
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/platform.inc @@ -0,0 +1,56 @@ +#ifndef CYGONCE_HAL_PLATFORM_INC +#define CYGONCE_HAL_PLATFORM_INC +##============================================================================= +## +## platform.inc +## +## AM31 simulator "board" assembler header file +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# 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 Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): jlarmour +## Contributors: jlarmour +## Date: 1999-09-09 +## Purpose: AM31 Simulator "board" definitions. +## Description: This file contains various definitions and macros that are +## required for writing assembly code for the am31 simulator. +## Currently there are none +## Usage: +## #include <cyg/hal/platform.inc> +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +##----------------------------------------------------------------------------- + +# Nothing required + +#------------------------------------------------------------------------------ +#endif // ifndef CYGONCE_HAL_PLATFORM_INC +# end of platform.inc
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/plf_intr.h @@ -0,0 +1,59 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// MN10300 sim interrupt and clock support +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour +// Date: 1999-09-09 +// Purpose: Define Interrupt support +// Description: The macros defined here provide the HAL APIs for handling +// interrupts and the clock for the simulator. This file +// is empty since none are required! +// +// Usage: +// #include <cyg/hal/plf_intr.h> +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + + +//-------------------------------------------------------------------------- + +// Nothing to do + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h
--- a/packages/hal/mn10300/sim/current/src/PKGconf.mak +++ b/packages/hal/mn10300/sim/current/src/PKGconf.mak @@ -28,11 +28,11 @@ #####COPYRIGHTEND#### #=============================================================================== -PACKAGE := hal_mn10300_sim +PACKAGE := hal_mn10300_am31_sim include ../../../../../pkgconf/pkgconf.mak LIBRARY := libtarget.a -COMPILE := hal_diag.c +COMPILE := hal_diag.c plf_misc.c OTHER_OBJS := OTHER_TARGETS := OTHER_CLEAN :=
new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/src/plf_misc.c @@ -0,0 +1,66 @@ +//========================================================================== +// +// plf_misc.c +// +// HAL platform miscellaneous functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// 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 Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg, jlarmour +// Date: 1999-09-09 +// Purpose: HAL miscellaneous functions +// Description: This file contains miscellaneous functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include <pkgconf/hal.h> + +#include <cyg/infra/cyg_type.h> // Base types + +#include <cyg/hal/hal_arch.h> // architectural definitions + +/*------------------------------------------------------------------------*/ + +void hal_platform_init(void) +{ + /* Nothing to do here */ +} + +/*------------------------------------------------------------------------*/ +/* Control C ISR support */ + +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + +struct Hal_SavedRegisters *hal_saved_interrupt_state; + +#endif + +/*------------------------------------------------------------------------*/ +/* End of plf_misc.c */
--- a/packages/hal/mn10300/sim/current/tests/PKGconf.mak +++ b/packages/hal/mn10300/sim/current/tests/PKGconf.mak @@ -28,7 +28,7 @@ #####COPYRIGHTEND#### #=============================================================================== -PACKAGE := hal_mn10300_sim +PACKAGE := hal_mn10300_am31_sim include ../../../../../pkgconf/pkgconf.mak TESTS :=
--- a/packages/hal/mn10300/stdeval1/current/ChangeLog +++ b/packages/hal/mn10300/stdeval1/current/ChangeLog @@ -1,3 +1,7 @@ +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + + * include/plf_stub.h: Include proper config header file. + 1999-08-27 Nick Garnett <nickg@cygnus.co.uk> * src/hal_diag.c (hal_diag_write_char): Added code to disable
--- a/packages/hal/mn10300/stdeval1/current/include/plf_stub.h +++ b/packages/hal/mn10300/stdeval1/current/include/plf_stub.h @@ -44,7 +44,7 @@ //============================================================================= #include <pkgconf/hal.h> -#include <pkgconf/hal_mn10300_stdeval1.h> +#include <pkgconf/hal_mn10300_am31_stdeval1.h> #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
--- a/packages/hal/powerpc/arch/current/ChangeLog +++ b/packages/hal/powerpc/arch/current/ChangeLog @@ -1,3 +1,9 @@ +1999-09-06 Jesper Skov <jskov@cygnus.co.uk> + + * src/hal_misc.c (hal_null_call): + * src/vectors.S: + Trap calls to address 0. + 1999-09-01 Gary Thomas <gthomas@cygnus.co.uk> * src/hal_misc.c: Clean up list of included files. <hal.h>
--- a/packages/hal/powerpc/arch/current/src/hal_misc.c +++ b/packages/hal/powerpc/arch/current/src/hal_misc.c @@ -511,4 +511,14 @@ hal_enable_caches(void) } //--------------------------------------------------------------------------- +//A jump via a null pointer causes the CPU to end up here. +externC void +hal_null_call() +{ + + CYG_FAIL("Call via NULL-pointer!"); + for(;;); +} + +//--------------------------------------------------------------------------- // End of hal_misc.c
--- a/packages/hal/powerpc/arch/current/src/vectors.S +++ b/packages/hal/powerpc/arch/current/src/vectors.S @@ -120,17 +120,11 @@ .section ".vectors","ax" #--------------------------------------------------------------------------- -# Unused first vector. +# Unused first vector. Jump to special handler, trapping null-pointer calls. -rom_vectors: - lwi r3,_start - mtlr r3 - blr - - .byte 0x11 - .byte 0x22 - .byte 0x33 - .byte 0x44 +rom_vectors: + .extern hal_null_call + b hal_null_call #--------------------------------------------------------------------------- # Reset vector.
--- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,8 @@ +1999-09-09 Gary Thomas <gthomas@cygnus.co.uk> + + * include/pkgconf/hal_powerpc_mbx.h (CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED): + Rename CDL option to avoid a name clash. + 1999-07-27 Hugo Tyson <hmt@cygnus.co.uk> * src/mbx.S: Fix typo in PLL setup value. Reported from the net.
--- a/packages/hal/powerpc/mbx/current/include/pkgconf/hal_powerpc_mbx.h +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/hal_powerpc_mbx.h @@ -69,7 +69,7 @@ using powerpc-eabi-gdb." } - cdl_option CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED { + cdl_option CYGHWR_HAL_POWERPC_BOARD_SPEED { display "Development board clock speed (MHz)" parent CYGPKG_HAL_POWERPC_MBX #type count @@ -97,6 +97,8 @@ #define CYGNUM_HAL_RTC_NUMERATOR 1000000000 #define CYGNUM_HAL_RTC_DENOMINATOR 100 +# define CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED CYGHWR_HAL_POWERPC_BOARD_SPEED + #if 40 == CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED # define CYGNUM_HAL_RTC_PERIOD 25000 #elif 50 == CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED
--- a/packages/hal/powerpc/quicc/current/ChangeLog +++ b/packages/hal/powerpc/quicc/current/ChangeLog @@ -1,3 +1,7 @@ +1999-09-02 Gary Thomas <gthomas@cygnus.co.uk> + + * src/quicc_smc1.c (init_smc1_uart): Generalize baud rate computation. + 1999-09-01 Gary Thomas <gthomas@cygnus.co.uk> * include/ppc8xx.h: Add some missing definitions (MAR, MBMR).
--- a/packages/hal/powerpc/quicc/current/src/quicc_smc1.c +++ b/packages/hal/powerpc/quicc/current/src/quicc_smc1.c @@ -58,15 +58,8 @@ #include <cyg/hal/hal_intr.h> // HAL_INTERRUPT_UNMASK(...) #endif -#if 40 == CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED -# define __40MHZ 1 -#elif 50 == CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED -# define __50MHZ 1 -#else -# error Bad Board speed defined: see CYGBLD_HAL_PLATFORM_H -#endif - -#define USE38400BAUD // otherwise it uses 9600 by default +#define UART_BIT_RATE(n) (((CYGHWR_HAL_POWERPC_MBX_BOARD_SPEED*1000000)/16)/n) +#define UART_BAUD_RATE 38400 #define Rxbd 0x2800 /* Rx Buffer Descriptor Offset */ #define Txbd 0x2808 /* Tx Buffer Descriptor Offset */ @@ -110,27 +103,9 @@ init_smc1_uart(void) eppc->pip_pbpar |= 0xc0; eppc->pip_pbdir &= ~0xc0; -#ifdef __50MHZ - /* - * Configure BRG for 9600 baud @ 50MHZ sysclk - * (Section 16.13.2) - */ -#ifdef USE38400BAUD - eppc->brgc1 = 0x100a2; -#else - eppc->brgc1 = 0x10288; -#endif -#else - /* - * Configure BRG for 9600 baud @ 40MHz sysclk - * (Section 16.13.2) - */ -#ifdef USE38400BAUD - eppc->brgc1 = 0x10082; -#else - eppc->brgc1 = 0x10204; -#endif -#endif + + /* Configure baud rate generator (Section 16.13.2) */ + eppc->brgc1 = 0x10000 | (UART_BIT_RATE(UART_BAUD_RATE)<<1); /*
--- a/packages/io/serial/current/src/arm/cl7211_serial.c +++ b/packages/io/serial/current/src/arm/cl7211_serial.c @@ -137,7 +137,7 @@ DEVTAB_ENTRY(cl7211_serial_io1, cl7211_serial_lookup, // Serial driver may need initializing &cl7211_serial_channel1 ); -#endif // CYGPKG_IO_SERIAL_ARM_CL7212_SERIAL2 +#endif // CYGPKG_IO_SERIAL_ARM_CL7211_SERIAL2 #ifdef CYGPKG_IO_SERIAL_ARM_CL7211_SERIAL2 static cl7211_serial_info cl7211_serial_info2 = {UARTDR2, // Data register @@ -182,7 +182,7 @@ DEVTAB_ENTRY(cl7211_serial_io2, cl7211_serial_lookup, // Serial driver may need initializing &cl7211_serial_channel2 ); -#endif // CYGPKG_IO_SERIAL_ARM_CL7212_SERIAL2 +#endif // CYGPKG_IO_SERIAL_ARM_CL7211_SERIAL2 // Internal function to actually configure the hardware to desired baud rate, etc. static bool
--- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,8 @@ +1999-09-10 Jesper Skov <jskov@cygnus.co.uk> + + * tests/stress_threads.c: Print out more info. Reduce dump + frequency as test runs. + 1999-08-25 Jonathan Larmour <jlarmour@cygnus.co.uk> * include/pkgconf/kernel.h: Add missing close brace in
--- a/packages/kernel/current/tests/stress_threads.c +++ b/packages/kernel/current/tests/stress_threads.c @@ -80,16 +80,35 @@ /* #undef DEATH_TIME_LIMIT */ // STACK_SIZE is typical +2kB for printf family calls which use big -// auto variables. +// auto variables. Add more for handler which calls perform_stressful_tasks() #define STACK_SIZE (2*1024 + CYGNUM_HAL_STACK_SIZE_TYPICAL) -#define STACK_SIZE2 (8*1024 + CYGNUM_HAL_STACK_SIZE_TYPICAL) +#define STACK_SIZE_HANDLER (4*1024 + CYGNUM_HAL_STACK_SIZE_TYPICAL) + +#define N_MAIN 1 -// The number of instances in each thread class -#define N_MAIN 1 +//----------------------------------------------------------------------- +// Some targets need to define a smaller number of handlers due to +// memory restrictions. +#ifdef CYGPKG_HAL_ARM_AEB +#define MAX_HANDLERS 4 +#define N_LISTENERS 1 +#define N_CLIENTS 1 +#define N_THREADS (N_MAIN+MAX_HANDLERS+N_LISTENERS+N_CLIENTS) + +#undef STACK_SIZE +#undef STACK_SIZE_HANDLER +#define STACK_SIZE (1024 + CYGNUM_HAL_STACK_SIZE_TYPICAL) +#define STACK_SIZE_HANDLER (1024 + CYGNUM_HAL_STACK_SIZE_TYPICAL) +#endif + +//----------------------------------------------------------------------- +// If no target specific definitions, use defaults +#ifndef MAX_HANDLERS #define MAX_HANDLERS 19 #define N_LISTENERS 4 #define N_CLIENTS 4 #define N_THREADS (N_MAIN+MAX_HANDLERS+N_LISTENERS+N_CLIENTS) +#endif /* Allocate priorities in this order. This ensures that handlers (which are the ones using the CPU) get enough CPU time to actually @@ -117,7 +136,7 @@ cyg_thread client_thread_s[N_CLIENTS]; /* space for stacks for all threads */ char main_stack[STACK_SIZE]; -char handler_stack[MAX_HANDLERS][STACK_SIZE2]; +char handler_stack[MAX_HANDLERS][STACK_SIZE_HANDLER]; char listener_stack[N_LISTENERS][STACK_SIZE]; char client_stack[N_CLIENTS][STACK_SIZE]; @@ -272,7 +291,7 @@ main(void) if (cyg_test_is_simulator) { time_report_delay = 2; } else { - time_report_delay = 30; + time_report_delay = 60; } cyg_alarm_initialize(report_alarmH, cyg_current_time()+200, @@ -397,7 +416,7 @@ void listener_program(cyg_addrword_t dat sc_thread_create(prio, handler_program, (cyg_addrword_t) handler_slot, name, (void *) handler_stack[handler_slot], - STACK_SIZE2, &handlerH[handler_slot], + STACK_SIZE_HANDLER, &handlerH[handler_slot], &handler_thread_s[handler_slot]); cyg_thread_resume(handlerH[handler_slot]); ++statistics.handler_invocation_histogram[handler_slot]; @@ -601,19 +620,51 @@ void sc_thread_create( } +#define MINS_HOUR (60) +#define MINS_DAY (60*24) +externC void *cyg_libc_get_pool( void ); + void print_statistics(int print_full) { int i; + static int stat_dumps = 0; static int print_count = 0; + static int shift_count = 0; + int minutes; + + stat_dumps++; + + // Find number of minutes. + minutes = time_report_delay*stat_dumps / 60; + + if (!print_full) { + // Return if time/minutes not integer. + if ((time_report_delay*stat_dumps % 60) != 0) + return; - printf("State dump %d (time %02d.%02d.%02d)\n", - print_count, - print_count*time_report_delay / (60*60), // hours - (print_count*time_report_delay / 60) % 60, // minutes - (print_count*time_report_delay ) % 60); // seconds - print_count++; + // After the first day, only dump stat once per day. Do print + // a . on the hour though. + if ((minutes > MINS_DAY) && ((minutes % MINS_DAY) != 0)) { + if ((minutes % MINS_HOUR) == 0) + printf("."); + return; + } + + // After the first hour of the first day, only dump stat once + // per hour. Do print . each minute though. + if ((minutes < MINS_DAY) && (minutes > MINS_HOUR) + && ((minutes % MINS_HOUR) != 0)) { + printf("."); + return; + } + } + + printf("\nState dump %d (%d hours, %d minutes) [numbers >>%d]\n", + ++print_count, minutes / MINS_HOUR, minutes, shift_count); cyg_mutex_lock(&statistics_print_lock); { + //-------------------------------- + // Information private to this test: printf(" Handler-invocations: "); for (i = 0; i < MAX_HANDLERS; ++i) { printf("%4lu ", statistics.handler_invocation_histogram[i]); @@ -622,12 +673,53 @@ void print_statistics(int print_full) printf(" malloc()-tries/failures: -- %7lu %7lu\n", statistics.malloc_tries, statistics.malloc_failures); printf(" client_makes_request: %d\n", client_makes_request); + + // Check for big numbers and reduce if getting close to overflow + if (statistics.malloc_tries > 0x40000000) { + shift_count++; + for (i = 0; i < MAX_HANDLERS; ++i) { + statistics.handler_invocation_histogram[i] >>= 1; + } + statistics.malloc_tries >>= 1; + statistics.malloc_failures >>= 1; + } + + //-------------------------------- + // System information +#if 0 + // We want to (occasionally) pause the test so all memory is + // freed. Otherwise it's hard to tell if there's a malloc + // leak. + { + cyg_mempool_info mem_info; + + cyg_mempool_var_get_info((cyg_handle_t) cyg_libc_get_pool(), + &mem_info); + printf(" Memory system: Total=0x%08x Free=0x%08x Max=0x%08x\n", + mem_info.totalmem, mem_info.freemem, mem_info.maxfree); + } +#endif + } cyg_mutex_unlock(&statistics_print_lock); - // Add: Also occasionally dump individual threads' stack status. - if (0 == print_count % 5 || print_full) { - cyg_test_dump_interrupt_stack_stats( " Status" ); - cyg_test_dump_idlethread_stack_stats( " Status" ); + // Dump stack status + printf(" Stack usage:\n"); + cyg_test_dump_interrupt_stack_stats( " Interrupt" ); + cyg_test_dump_idlethread_stack_stats( " Idle" ); + + cyg_test_dump_stack_stats(" Main", main_stack, + main_stack + sizeof(main_stack)); + for (i = 0; i < MAX_HANDLERS; i++) { + cyg_test_dump_stack_stats(" Handler", handler_stack[i], + handler_stack[i] + sizeof(handler_stack[i])); + } + for (i = 0; i < N_LISTENERS; i++) { + cyg_test_dump_stack_stats(" Listener", listener_stack[i], + listener_stack[i] + sizeof(listener_stack[i])); + } + for (i = 0; i < N_CLIENTS; i++) { + cyg_test_dump_stack_stats(" Client", client_stack[i], + client_stack[i] + sizeof(client_stack[i])); } }
--- a/packages/language/c/libc/current/ChangeLog +++ b/packages/language/c/libc/current/ChangeLog @@ -1,3 +1,12 @@ +1999-09-10 Jesper Skov <jskov@cygnus.co.uk> + + * src/stdlib/malloc.cxx (cyg_libc_get_malloc_pool): Added for + stress_threads test. + +1999-09-07 Jesper Skov <jskov@cygnus.co.uk> + PRs 20243, 20433 + * tests/signal/signal2.c: Disabled test3 on ARM. + 1999-09-02 Hugo Tyson <hmt@cygnus.co.uk> * include/assert.h: Make the sense of NDEBUG correct; it is "set"
--- a/packages/language/c/libc/current/src/stdlib/malloc.cxx +++ b/packages/language/c/libc/current/src/stdlib/malloc.cxx @@ -218,6 +218,14 @@ externC void * return ret_ptr; } // _realloc() + +// Allows stress_threads test to access memory pool information. +externC void * +cyg_libc_get_malloc_pool( void ) +{ + return (void*) &pool; +} + #endif // ifdef CYGPKG_LIBC_MALLOC // EOF malloc.cxx
--- a/packages/language/c/libc/current/tests/signal/signal2.c +++ b/packages/language/c/libc/current/tests/signal/signal2.c @@ -241,6 +241,8 @@ main( int argc, char *argv[] ) // See linux.S for details. #elif defined(CYGPKG_HAL_POWERPC) CYG_TEST_PASS("Test 3 not applicable to PowerPC"); +#elif defined(CYGPKG_HAL_ARM) + CYG_TEST_PASS("Test 3 not applicable to ARM"); #else if (0==setjmp(jbuf)) {
--- a/packages/packages +++ b/packages/packages @@ -138,21 +138,20 @@ package CYGPKG_HAL_ARM_PID { } package CYGPKG_HAL_ARM_AEB { - alias { "Arm evaulation board (AEB-1) support" hal_arm_aeb arm_aeb_hal } + alias { "Arm evaluation board (AEB-1) support" hal_arm_aeb arm_aeb_hal } directory hal/arm/aeb include_dir cyg/hal hardware } package CYGPKG_HAL_ARM_CL7211 { - alias { "Cirrus Logic CL7211 evaulation board support" hal_arm_cl7211 arm_cl7211_hal } + alias { "Cirrus Logic CL7211 evaluation board support" hal_arm_cl7211 arm_cl7211_hal } directory hal/arm/cl7211 include_dir cyg/hal hardware } - package CYGPKG_HAL_I386 { alias { "i386 common HAL" hal_i386 i386_hal i386_arch_hal } directory hal/i386/arch @@ -202,7 +201,7 @@ package CYGPKG_HAL_MN10300_AM31_STDEVAL1 hardware } -package CYGPKG_HAL_MN10300_SIM { +package CYGPKG_HAL_MN10300_AM31_SIM { alias { "MN10300 simulator support" hal_mn10300_sim mn10300_sim_hal } directory hal/mn10300/sim include_dir cyg/hal @@ -230,7 +229,6 @@ package CYGPKG_HAL_POWERPC_FADS { hardware } - package CYGPKG_HAL_POWERPC_MBX { alias { "PowerPC Motorola MBX860/821 board support" hal_powerpc_mbx powerpc_mbx_hal } directory hal/powerpc/mbx @@ -250,7 +248,6 @@ package CYGPKG_HAL_POWERPC_SIM { hardware } - package CYGPKG_HAL_SPARCLITE { alias { "SPARClite common HAL" hal_sparclite sparclite_hal sparclite_arch_hal } directory hal/sparclite/arch @@ -286,7 +283,6 @@ package CYGPKG_HAL_MIPS_TX39_JMR3904 { hardware } - package CYGPKG_IO { alias { "Common I/O Code" io io_common } directory io/common @@ -301,8 +297,6 @@ package CYGPKG_IO_SERIAL { include_dir cyg/io } - - package CYGPKG_DEVICES_WALLCLOCK { alias { "Wallclock Device Code" wallclock devices_wallclock device_wallclock } directory devs/wallclock
--- a/packages/targets +++ b/packages/targets @@ -100,7 +100,7 @@ target mn10300_am31 { alias { "Simulator" } startup { ram } packages { - CYGPKG_HAL_MN10300_SIM + CYGPKG_HAL_MN10300_AM31_SIM } } } @@ -266,9 +266,10 @@ target arm { } } # FIXME: ARCHFLAGS "-mcpu=arm720" - platform cl7211 { - alias { "Cirrus Logic Eval Board (CL7211)" } + platform eb7211 { + alias { "Cirrus Logic Eval Board (EB7211)" } startup { ram rom stubs } + base_platform cl7211 packages { CYGPKG_HAL_ARM_CL7211 }
