diff -Nru ecos/packages/ecos.db ecos.work/packages/ecos.db --- ecos/packages/ecos.db Wed Aug 28 07:20:45 2002 +++ ecos.work/packages/ecos.db Sat Aug 31 01:40:32 2002 @@ -1304,6 +1304,14 @@ micom board." } +package CYGPKG_DEVS_ETH_H8300_H8MAX { + alias { "H8MAX Board ethernet driver" h8max_eth_drivers } + directory devs/eth/h8300/h8max + script h8300_h8max_eth_drivers.cdl + hardware + description "Ethernet drivers for H8MAX board." +} + package CYGPKG_DEVS_ETH_MCF5272 { alias { "MCF5272 Fast Ethernet Controller driver" mcf5272_eth_driver} hardware @@ -2152,6 +2160,26 @@ eCos on a Akizuki H8/3068 Network micom board." } +package CYGPKG_HAL_H8300_H8300H_AKI3068IDE { + alias { "Akizuki H8/3068 board + CF" hal_h8300h_aki3068ide h8300h_aki3068ide_hal } + directory hal/h8300/aki3068ide + script hal_h8300_h8300h_aki3068ide.cdl + hardware + description " + The aki HAL package provides the support needed to run + eCos on a Akizuki H8/3068 Network micom board and CompactFlash Expantion." +} + +package CYGPKG_HAL_H8300_H8300H_H8MAX { + alias { "H8MAX board" hal_h8300h_h8max h8300h_h8max_hal } + directory hal/h8300/h8max + script hal_h8300_h8300h_h8max.cdl + hardware + description " + The aki HAL package provides the support needed to run + eCos on a H8MAX board." +} + # ========================================================================== # -------------------------------------------------------------------------- # i386 packages @@ -3897,12 +3925,41 @@ CYGPKG_HAL_H8300_H8300H_AKI3068NET CYGPKG_IO_SERIAL_H8300_SCI CYGPKG_DEVS_ETH_H8300_AKI3068NET + CYGPKG_DEVICES_WATCHDOG_H8300_H8300H } description " The aki3068net target provides the packages need to run eCos in the Akizuki H8/3068 Network board." } +target aki3068ide { + alias { "Akizuki H8/3068 Network board + CF" } + packages { CYGPKG_HAL_H8300 + CYGPKG_HAL_H8300_H8300H + CYGPKG_HAL_H8300_H8300H_AKI3068IDE + CYGPKG_IO_SERIAL_H8300_SCI + CYGPKG_DEVS_ETH_H8300_AKI3068NET + CYGPKG_DEVICES_WATCHDOG_H8300_H8300H + } + description " + The aki3068net target provides the packages need to run + eCos in the Akizuki H8/3068 Network board and CompactFlash Expantion." +} + +target h8max { + alias { "H8MAX" } + packages { CYGPKG_HAL_H8300 + CYGPKG_HAL_H8300_H8300H + CYGPKG_HAL_H8300_H8300H_H8MAX + CYGPKG_IO_SERIAL_H8300_SCI + CYGPKG_DEVS_ETH_H8300_H8MAX + CYGPKG_DEVICES_WATCHDOG_H8300_H8300H + } + description " + The h8max target provides the packages need to run + eCos in the strawberry-linux.com H8MAX board." +} + # -------------------------------------------------------------------------- # CalmRISC16 targets diff -Nru ecos/packages/devs/eth/h8300/h8max/current/cdl/h8300_h8max_eth_drivers.cdl ecos.work/packages/devs/eth/h8300/h8max/current/cdl/h8300_h8max_eth_drivers.cdl --- ecos/packages/devs/eth/h8300/h8max/current/cdl/h8300_h8max_eth_drivers.cdl Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/devs/eth/h8300/h8max/current/cdl/h8300_h8max_eth_drivers.cdl Sun Aug 11 00:03:47 2002 @@ -0,0 +1,130 @@ +# ==================================================================== +# +# h8300_h8max_eth_drivers.cdl +# +# Ethernet drivers - support for DP83902A(RTL8019AS) +# ethernet controller on the H8MAX board. +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +## at http://sources.redhat.com/ecos/ecos-license/ +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): ysato +# Contributors: ysato +# Date: 2002-08-10 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_DEVS_ETH_H8300_H8MAX { + display "H8MAX board ethernet driver" + description " + Ethernet driver for H8MAX" + + parent CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_HAL_H8300_H8300H_H8MAX + compile -library=libextras.a if_h8max.c + + include_dir cyg/io + + # FIXME: This really belongs in the NS DP83902A package + cdl_interface CYGINT_DEVS_ETH_NS_DP83902A_REQUIRED { + display "NS dp83902a ethernet driver required" + } + + define_proc { + puts $::cdl_system_header "/***** ethernet driver proc output start *****/" + puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_NS_DP83902A_INL " + puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_NS_DP83902A_CFG " + puts $::cdl_system_header "/***** ethernet driver proc output end *****/" + } + + cdl_component CYGPKG_DEVS_ETH_H8300_H8MAX_ETH0 { + display "Ethernet port 0 driver" + flavor bool + default_value 1 + + implements CYGHWR_NET_DRIVERS + implements CYGHWR_NET_DRIVER_ETH0 + + implements CYGINT_DEVS_ETH_NS_DP83902A_REQUIRED + + cdl_option CYGDAT_DEVS_ETH_H8300_H8MAX_ETH0_NAME { + display "Device name for the ETH0 ethernet port 0 driver" + flavor data + default_value {"\"eth0\""} + description " + This option sets the name of the ethernet device for the + RTL8019AS ethernet port 0." + } + + cdl_component CYGSEM_DEVS_ETH_H8300_H8MAX_ETH0_SET_ESA { + display "Set the ethernet station address" + flavor bool + default_value 0 + description "Enabling this option will allow the ethernet + station address to be forced to the value set by the + configuration. This may be required if the hardware does + not include a serial EEPROM for the ESA." + + cdl_option CYGDAT_DEVS_ETH_H8300_H8MAX_ETH0_ESA { + display "The ethernet station address" + flavor data + default_value {"{0x08, 0x00, 0x00, 0x00, 0x00, 0x01}"} + description "The ethernet station address" + } + } + } + + cdl_component CYGPKG_DEVS_ETH_H8300_AKI3068NET_OPTIONS { + display "PCMCIA ethernet driver build options" + flavor none + no_define + + cdl_option CYGPKG_DEVS_ETH_CF_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "-D_KERNEL -D__ECOS" } + description " + This option modifies the set of compiler flags for + building the PCMCIA ethernet driver package. + These flags are used in addition + to the set of global flags." + } + } +} diff -Nru ecos/packages/devs/eth/h8300/h8max/current/include/devs_eth_h8300_h8max.inl ecos.work/packages/devs/eth/h8300/h8max/current/include/devs_eth_h8300_h8max.inl --- ecos/packages/devs/eth/h8300/h8max/current/include/devs_eth_h8300_h8max.inl Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/devs/eth/h8300/h8max/current/include/devs_eth_h8300_h8max.inl Wed Aug 14 18:18:30 2002 @@ -0,0 +1,103 @@ +//========================================================================== +// +// devs_eth_h8300_h8max.inl +// +// DP83902(RTL8019AS) ethernet I/O definitions. +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Yoshinori Sato +// Contributors: Yoshinori Sato +// Date: 2002-08-10 +// Purpose: h8max ethernet defintions +//####DESCRIPTIONEND#### +//========================================================================== + +#include // CYGNUM_HAL_INTERRUPT_ETHR +#include + +#define CYGHWR_NS_DP83902A_PLF_INIT ns_dp83902a_plf_init +#define CYGHWR_NS_DP83902A_PLF_16BIT_DATA +#define BIGEND +#define DELAY() +#define DP_IN(_b_, _o_, _d_) HAL_READ_UINT8 ((cyg_addrword_t)(_b_)+((_o_)<<1)+1, (_d_)) +#define DP_OUT(_b_, _o_, _d_) HAL_WRITE_UINT16((cyg_addrword_t)(_b_)+((_o_)<<1), (_d_)) +//#define DP_IN_DATA(_b_, _d_) HAL_READ_UINT16 ((cyg_addrword_t)(_b_), (_d_)) +//#define DP_OUT_DATA(_b_, _d_) HAL_WRITE_UINT16 ((cyg_addrword_t)(_b_), (_d_)) + +#ifdef __WANT_DEVS + +#ifdef CYGPKG_DEVS_ETH_H8300_H8MAX_ETH0 + +static dp83902a_priv_data_t dp83902a_eth0_priv_data = { + base: 0x800600, + interrupt: 16, + tx_buf1: 0x40, + tx_buf2: 0x48, + rx_buf_start: 0x50, + rx_buf_end: 0x80, +#ifdef CYGSEM_DEVS_ETH_H8300_H8MAX_ETH0_SET_ESA + hardwired_esa: true, + mac_address: CYGDAT_DEVS_ETH_H8300_H8MAX_ETH0_ESA +#else + hardwired_esa: false, +#endif +}; + +ETH_DRV_SC(dp83902a_sc, + &dp83902a_eth0_priv_data, // Driver specific data + CYGDAT_DEVS_ETH_H8300_H8MAX_ETH0_NAME, + dp83902a_start, + dp83902a_stop, + dp83902a_control, + dp83902a_can_send, + dp83902a_send, + dp83902a_recv, + dp83902a_deliver, // "pseudoDSR" called from fast net thread + dp83902a_poll, // poll function, encapsulates ISR and DSR + dp83902a_int_vector); + +NETDEVTAB_ENTRY(dp83902a_netdev, + "dp83902a_" CYGDAT_DEVS_ETH_H8300_H8MAX_ETH0_NAME, + dp83902a_init, + &dp83902a_sc); + +void ns_dp83902a_plf_init(dp83902a_priv_data_t *dp); + +#endif // CYGPKG_DEVS_ETH_H8300_H8MAX_ETH0 +#endif +// EOF devs_eth_h8300_h8max.inl diff -Nru ecos/packages/devs/eth/h8300/h8max/current/src/if_h8max.c ecos.work/packages/devs/eth/h8300/h8max/current/src/if_h8max.c --- ecos/packages/devs/eth/h8300/h8max/current/src/if_h8max.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/devs/eth/h8300/h8max/current/src/if_h8max.c Wed Aug 14 02:52:18 2002 @@ -0,0 +1,123 @@ +//========================================================================== +// +// if_h8max.c +// +// Ethernet device driver for H8MAX +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//####BSDCOPYRIGHTBEGIN#### +// +// ------------------------------------------- +// +// Portions of this software may have been derived from OpenBSD or other sources, +// and are covered by the appropriate copyright disclaimers included herein. +// +// ------------------------------------------- +// +//####BSDCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): +// Contributors: +// Date: +// Purpose: +// Description: +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include +#include +#include +#include +#include +#include + +#define DP_CARD_RESET 0x1f + +#include + +void ns_dp83902a_plf_init(dp83902a_priv_data_t *dp) +{ + static struct { + unsigned short offset; + unsigned short data; + } init_data[] = { + {DP_DCR, 0x49}, // Wordwide access + {DP_RBCH, 0}, // Remote byte count + {DP_RBCL, 0}, + {DP_ISR, 0xFF}, // Clear any pending interrupts + {DP_IMR, 0x00}, // Mask all interrupts + {DP_RCR, 0x20}, // Monitor + {DP_TCR, 0x02}, // loopback + {DP_RBCH, 32/2}, // Remote byte count + {DP_RBCL, 0}, + {DP_RSAL, 0}, // Remote address + {DP_RSAH, 0}, + {DP_CR, DP_CR_START|DP_CR_RDMA} // Read data + }; + unsigned short prom[32]; + int cnt,tmp; + + HAL_READ_UINT8(dp->base+(DP_CARD_RESET<<1)+1, tmp); + HAL_WRITE_UINT16(dp->base+(DP_CARD_RESET<<1), tmp); + dp->data = dp->base+(DP_DATAPORT<<1); + // Wait for card + do { + int cnt; + DP_IN(dp->base, DP_ISR, tmp); + for (cnt=0; cnt< 1024; cnt++); + } while (0 == (tmp & DP_ISR_RESET)); + if (dp->hardwired_esa) + return ; + + for (cnt=0; cntbase, init_data[cnt].offset, init_data[cnt].data); + for (cnt = 0; cnt < 32/2; cnt++) { + DP_IN_DATA(dp->data, prom[cnt]); + } + if ((prom[0] == 0xffff) && (prom[1] == 0xffff) && (prom[2] == 0xffff)) { + dp->base = 0; + return ; + } + DP_OUT(dp->base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1); + for (cnt = 0; cnt < 6; cnt ++) { + DP_OUT(dp->base, DP_P1_PAR0+cnt, prom[cnt] >> 8); + } +} diff -Nru ecos/packages/hal/h8300/arch/current/cdl/hal_h8300.cdl ecos.work/packages/hal/h8300/arch/current/cdl/hal_h8300.cdl --- ecos/packages/hal/h8300/arch/current/cdl/hal_h8300.cdl Fri May 24 08:02:56 2002 +++ ecos.work/packages/hal/h8300/arch/current/cdl/hal_h8300.cdl Wed May 29 02:26:05 2002 @@ -40,10 +40,10 @@ # ==================================================================== ######DESCRIPTIONBEGIN#### # -# Author(s): jskov +# Author(s): yoshinori sato # Original data: bartv, nickg -# Contributors: dmoseley -# Date: 1999-11-02 +# Contributors: yoshinori sato +# Date: 2002-02-16 # #####DESCRIPTIONEND#### # @@ -86,4 +86,47 @@ @echo >> $(notdir $@).deps @rm vectors.tmp } + cdl_component CYGPKG_REDBOOT_H8300_OPTIONS { + display "Redboot for H8300 options" + flavor none + no_define + parent CYGPKG_REDBOOT + active_if CYGPKG_REDBOOT + description " + This option lists the target's requirements for a valid Redboot + configuration." + + cdl_component CYGSEM_REDBOOT_H8300_LINUX_BOOT { + display "Support booting uCinux via RedBoot" + flavor bool + default_value 1 + description " + This option enables RedBoot to support booting of a uClinux kernel." + compile -library=libextras.a redboot_linux_exec.c + + cdl_option CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY { + display "Default kernel entry address" + flavor data + default_value 0x400000 + description " + This option uClinux kernel entry address of default." + } + + cdl_option CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START { + display "Default kernel command line start address" + flavor data + default_value 0x5ffe00 + description " + This option uClinux kernel command line start address of default." + } + + cdl_option CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE { + display "Default command line" + flavor data + default_value { "console=/dev/ttyS1" } + description " + This option uClinux kernel startup command line of default." + } + } + } } diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c --- ecos/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/arch/current/src/redboot_linux_exec.c Wed May 29 23:49:16 2002 @@ -0,0 +1,107 @@ +//========================================================================== +// +// redboot_linux_exec.c +// +// RedBoot exec command for Linux booting +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-05-28 +// Purpose: RedBoot exec command for uClinux booting +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include + +#include +#include +#include + +#define xstr(s) str(s) +#define str(s...) #s + +static void do_exec(int argc, char *argv[]); +RedBoot_cmd("exec", + "Execute an image", + "[-b ] [-c \"kernel command line\"]\n" + " []", + do_exec + ); + +static void +do_exec(int argc, char *argv[]) +{ + cyg_uint32 entry = CYGDAT_REDBOOT_H8300_LINUX_BOOT_ENTRY; + cyg_uint32 command_addr = CYGDAT_REDBOOT_H8300_LINUX_COMMAND_START; + char *cmd_line = xstr( CYGDAT_REDBOOT_H8300_LINUX_BOOT_COMMAND_LINE ); + + bool command_addr_set,command_line_set; + + struct option_info opts[2]; + char *pcmd; + int oldints; + + init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, + (void **)&command_addr, &command_addr_set, "command line address"); + init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, + (void **)&cmd_line, &command_line_set, "kernel command line"); + + if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, + OPTION_ARG_TYPE_NUM, "entry address")) + return ; + + diag_printf("Now booting linux kernel:\n"); + diag_printf(" Entry Address 0x%08x\n", entry); + diag_printf(" Cmdline : %s\n", cmd_line); + + HAL_DISABLE_INTERRUPTS(oldints); + HAL_DCACHE_SYNC(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + HAL_DCACHE_SYNC(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + + pcmd = (char *)command_addr; + while ((*pcmd++ = *cmd_line++)); + + asm ("jmp @%0" : : "r" (entry)); +} diff -Nru ecos/packages/hal/h8300/aki3068ide/current/cdl/hal_h8300_h8300h_aki3068ide.cdl ecos.work/packages/hal/h8300/aki3068ide/current/cdl/hal_h8300_h8300h_aki3068ide.cdl --- ecos/packages/hal/h8300/aki3068ide/current/cdl/hal_h8300_h8300h_aki3068ide.cdl Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/cdl/hal_h8300_h8300h_aki3068ide.cdl Fri Aug 30 14:07:30 2002 @@ -0,0 +1,296 @@ +# ==================================================================== +# +# hal_h8300_h8300h_aki3068ide.cdl +# +# AKI3068NET board + CF Expantion HAL package configuration data +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +## at http://sources.redhat.com/ecos/ecos-license/ +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): yoshinori sato +# Original data: bartv +# Contributors: yoshinori sato +# Date: 2002-08-30 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_HAL_H8300_H8300H_AKI3068IDE { + display "AKI3068NET+IDE" + parent CYGPKG_HAL_H8300 + requires CYGPKG_HAL_H8300_H8300H + implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT + implements CYGINT_HAL_DEBUG_GDB_STUBS + implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK + implements CYGINT_HAL_PLF_IF_IDE + define_header hal_h8300_h8300h_aki3068ide.h + include_dir cyg/hal + description " + The aki HAL package provides the support needed to run + eCos on a Akizuki H8/3068 Network micom board. + + CompactFlash Expantion" + + compile hal_diag.c plf_misc.c delay_us.S plf_ide.c + + define_proc { + puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H " + puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H " + puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_IO_H " + + puts $::cdl_header "#define CYG_HAL_H8300" + puts $::cdl_header "#define CYGNUM_HAL_H8300_SCI_PORTS 1" + puts $::cdl_header "#define CYGHWR_HAL_VECTOR_TABLE 0xfffe20" + puts $::cdl_header "#define HAL_PLATFORM_CPU \"H8/300H\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Akizuki H8/3068 Network micom + CF\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" + } + + cdl_component CYG_HAL_STARTUP { + display "Startup type" + flavor data + legal_values {"ROM" "RAM"} + default_value {"ROM"} + no_define + define -file system.h CYG_HAL_STARTUP + description " + When targetting the AKI3068NET board it is possible to + build the system for either RAM bootstrap or ROM bootstrap. + RAM bootstrap generally requires that the board + is equipped with ROMs containing a suitable ROM monitor or + equivalent software that allows GDB to download the eCos + application and extend Memory on to the board. + The ROM bootstrap typically + requires that the eCos application be blown into EPROMs or + equivalent technology." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { + display "Number of communication channels on the board" + flavor data + calculated 1 + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL { + display "Debug serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The AKI3068NET board has only one serial port. This option + chooses which port will be used to connect to a host + running GDB." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL { + display "Diagnostic serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The CQ/7708 board has only one serial port. This option + chooses which port will be used for diagnostic output." + } + + # Real-time clock/counter specifics + cdl_component CYGNUM_HAL_RTC_CONSTANTS { + display "Real-time clock constants." + flavor none + + cdl_option CYGNUM_HAL_RTC_NUMERATOR { + display "Real-time clock numerator" + flavor data + calculated 1000000000 + } + cdl_option CYGNUM_HAL_RTC_DENOMINATOR { + display "Real-time clock denominator" + flavor data + calculated 100 + } + cdl_option CYGNUM_HAL_H8300_RTC_PRESCALE { + display "Real-time clock base prescale" + flavor data + calculated 8192 + } + # Isn't a nice way to handle freq requirement! + cdl_option CYGNUM_HAL_RTC_PERIOD { + display "Real-time clock period" + flavor data + calculated 10 + } + } + + cdl_option CYGHWR_HAL_H8300_CPG_INPUT { + display "OSC/Clock Freqency" + flavor data + default_value 20000000 + } + + cdl_option CYGHWR_HAL_AKI3068NET_EXTRAM { + display "Extend DRAM Using" + flavor bool + default_value 1 + } + + cdl_option CYGHWR_HAL_IDE_COMMAND { + display "IDE Command Port Address" + flavor data + default_value 0x800000 + } + + cdl_option CYGHWR_HAL_IDE_CONTROL { + display "IDE Control Port Address" + flavor data + default_value 0xA00000 + } + + cdl_option CYGHWR_HAL_IDE_BUSWIDTH { + display "IDE Command Port Address" + flavor data + legal_values {8 16} + default_value 8 + } + + cdl_component CYGBLD_GLOBAL_OPTIONS { + display "Global build options" + flavor none + parent CYGPKG_NONE + description " + Global build options including control over + compiler flags, linker flags and choice of toolchain." + + + cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX { + display "Global command prefix" + flavor data + no_define + default_value { "h8300-elf" } + description " + This option specifies the command prefix used when + invoking the build tools." + } + + cdl_option CYGBLD_GLOBAL_CFLAGS { + display "Global compiler flags" + flavor data + no_define + default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -mh -mint32 -fsigned-char -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" } + description " + This option controls the global compiler flags which + are used to compile all packages by + default. Individual packages may define + options which override these global flags." + } + + cdl_option CYGBLD_GLOBAL_LDFLAGS { + display "Global linker flags" + flavor data + no_define + default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static -mh -mint32" } + description " + This option controls the global linker flags. Individual + packages may define options which override these global flags." + } + cdl_option CYGBLD_BUILD_GDB_STUBS { + display "Build GDB stub ROM image" + default_value 0 + requires CYGSEM_HAL_ROM_MONITOR + requires CYGBLD_BUILD_COMMON_GDB_STUBS + requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + no_define + description " + This option enables the building of the GDB stubs for the + board. The common HAL controls takes care of most of the + build process, but the final conversion from ELF image to + binary data is handled by the platform CDL, allowing + relocation of the data if necessary." + + make -priority 320 { + /bin/gdb_module.bin : /bin/gdb_module.img + $(OBJCOPY) -O binary $< $@ + } + } + } + + cdl_component CYGHWR_MEMORY_LAYOUT { + display "Memory layout" + flavor data + no_define + calculated { CYG_HAL_STARTUP == "RAM" ? "h8300_h8300h_aki3068net_ram" : \ + "h8300_h8300h_aki3068net_rom" } + + cdl_option CYGHWR_MEMORY_LAYOUT_LDI { + display "Memory layout linker script fragment" + flavor data + no_define + define -file system.h CYGHWR_MEMORY_LAYOUT_LDI + calculated { CYG_HAL_STARTUP == "RAM" ? "" : \ + "" } + } + + cdl_option CYGHWR_MEMORY_LAYOUT_H { + display "Memory layout header file" + flavor data + no_define + define -file system.h CYGHWR_MEMORY_LAYOUT_H + calculated { CYG_HAL_STARTUP == "RAM" ? "" : \ + "" } + } + } + cdl_option CYGSEM_HAL_ROM_MONITOR { + display "Behave as a ROM monitor" + flavor bool + default_value 0 + parent CYGPKG_HAL_ROM_MONITOR + requires { CYG_HAL_STARTUP == "ROM" } + description " + Enable this option if this program is to be used as a ROM monitor, + i.e. applications will be loaded into RAM on the board, and this + ROM monitor may process exceptions or interrupts generated from the + application. This enables features such as utilizing a separate + interrupt stack when exceptions are generated." + } + cdl_option CYGSEM_HAL_H8300_VECTOR_HOOK { + display "Interrupt Vector Hook" + flavor bool + default_value 1 + parent CYGPKG_HAL_ROM_MONITOR + description " + Interrupt Vector Table Hooking Support" + } +} diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/hal_diag.h ecos.work/packages/hal/h8300/aki3068ide/current/include/hal_diag.h --- ecos/packages/hal/h8300/aki3068ide/current/include/hal_diag.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/hal_diag.h Fri Aug 30 11:34:46 2002 @@ -0,0 +1,80 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-04-06 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +externC void hal_diag_init(void); +externC void hal_diag_write_char(cyg_uint8 c); +externC void hal_diag_read_char(cyg_uint8 *c); + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() hal_diag_init() + +#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) + +//----------------------------------------------------------------------------- +// Simple LED control. +externC void hal_diag_led_on( void ); +externC void hal_diag_led_off( void ); + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.h ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.h --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.h Fri Aug 30 11:34:46 2002 @@ -0,0 +1,14 @@ +// eCos memory layout - Wed Nov 24 13:10:23 1999 + +// This is a generated file - changes will be lost if ConfigTool(MLT) is run + +#ifndef __ASSEMBLER__ +#include +#include + +#endif + +#define CYGMEM_REGION_ram (0x420000) +#define CYGMEM_REGION_ram_SIZE (0x1E0000) +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) + diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi Fri Aug 30 11:34:46 2002 @@ -0,0 +1,32 @@ +// eCos memory layout - Fri Oct 20 08:25:16 2000 + +// This is a generated file - do not edit + +#include + +OUTPUT_FORMAT("elf32-h8300") +OUTPUT_ARCH(h8300h) + +MEMORY +{ + ram : ORIGIN = 0x400000, LENGTH = 0x20000 + iram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_text (ram, 0x400000, 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) + SECTION_int_hook_table (iram, 0xffbf20,FOLLOWING (.data)) +// SECTION_int_hook_table (ram, ALIGN (0x4), LMA_EQ_VMA) +// SECTION_data (ram, ALIGN (0x4),LMA_EQ_VMA) +// SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) + SECTIONS_END +} diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt Fri Aug 30 11:34:46 2002 @@ -0,0 +1,12 @@ +version 0 +region ram 400000 10000 0 ! +section text 0 1 0 1 0 1 0 1 400000 400000 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 int_fook_table int_hook_table ! +section int_hook_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 1 0 0 ! + diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.h ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.h --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.h Fri Aug 30 11:34:46 2002 @@ -0,0 +1,18 @@ +// eCos memory layout - Wed Nov 24 13:10:23 1999 + +// This is a generated file - changes will be lost if ConfigTool(MLT) is run + +#ifndef __ASSEMBLER__ +#include +#include + +#endif + +#define CYGMEM_REGION_ram (0x400000) +#if !defined(CYGPKG_IO_ETH_DRIVERS) +#define CYGMEM_REGION_ram_SIZE (0x200000) +#else +#define CYGMEM_REGION_ram_SIZE (0x200000-0xC000) +#endif +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) + diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi Fri Aug 30 11:34:46 2002 @@ -0,0 +1,41 @@ +// eCos memory layout - Fri Oct 20 08:25:16 2000 + +// This is a generated file - do not edit + +#include + +OUTPUT_FORMAT("elf32-h8300") +OUTPUT_ARCH(h8300h) + +MEMORY +{ + rom : ORIGIN = 0x000000, LENGTH = 0x60000 +#if !defined(CYGPKG_IO_ETH_DRIVERS) + ram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100 +#else + ram : ORIGIN = 0x5F4000, LENGTH = 0xC000 + iram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100 +#endif +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (rom, 0x000000, 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) +#if !defined(CYGPKG_IO_ETH_DRIVERS) + SECTION_int_hook_table (ram, 0xffbf20,FOLLOWING (.gcc_except_table)) + SECTION_data (ram, ALIGN (0x4),FOLLOWING (.int_hook_table)) + SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) +#else + SECTION_data (ram, 0x5F4000,FOLLOWING (.gcc_except_table)) + SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) + SECTION_int_hook_table (iram, 0xffbf20,FOLLOWING (.data)) +#endif + SECTIONS_END +} diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.mlt ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.mlt --- ecos/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.mlt Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.mlt Fri Aug 30 11:34:46 2002 @@ -0,0 +1,12 @@ +version 0 +region ram ffbf20 ffff20 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 0 60000 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 1 0 1 heap1 heap1 ! +section heap1 0 8 0 0 0 0 0 0 ! diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/platform.inc ecos.work/packages/hal/h8300/aki3068ide/current/include/platform.inc --- ecos/packages/hal/h8300/aki3068ide/current/include/platform.inc Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/platform.inc Fri Aug 30 11:34:46 2002 @@ -0,0 +1,128 @@ +#ifndef CYGONCE_HAL_PLATFORM_INC +#define CYGONCE_HAL_PLATFORM_INC +##============================================================================= +## +## platform.inc +## +## AKI3068NET "board" assembler header file +## +##============================================================================= +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +## at http://sources.redhat.com/ecos/ecos-license/ +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): jlarmour +## Contributors: Yoshinori Sato +## Date: 1999-09-09 +## Purpose: AKI3068NET "board" definitions. +## Description: This file contains various definitions and macros that are +## required for writing assembly code for the AKI3068NET board +## Currently there are none +## Usage: +## #include +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include +#include + +##----------------------------------------------------------------------------- + +#define CYGPKG_HAL_H8300_MEMC_DEFINED + .macro hal_memc_init +#if defined(CYG_HAL_STARTUP_ROM) + mov.l #init_regs,er0 +1: + mov.l @er0+,er2 + beq 2f + mov.w @er0+,r1 + mov.b r1l,@er2 + bra 1b + +init_regs: + .long CYGARC_RTCOR + .word 99 + .long CYGARC_RTMCSR + .word 0x0f + .long CYGARC_DRCRB + .word 0x98 + .long CYGARC_DRCRA + .word 0x3c + .long CYGARC_ASTCR + .word 0xfb + .long CYGARC_P1DDR + .word 0xff + .long CYGARC_P2DDR + .word 0xff + .long CYGARC_P5DDR + .word 0x01 + .long CYGARC_P8DDR + .word 0x0c + .long 0 +init_regs_end: + +2: +#endif + .endm + +#define CYGPKG_HAL_H8300_DIAG_DEFINED + + .macro hal_diag_init + mov.b #0x83,r0l + mov.b r0l,@CYGARC_PADDR + mov.b #0,r0l + mov.b r0l,@CYGARC_PADR + .endm + + .macro hal_diag_excpt_start + .endm + + .macro hal_diag_intr_start + .endm + + .macro hal_diag_restore + .endm + + .macro hal_diag_data + .endm + +#------------------------------------------------------------------------------ +#endif // ifndef CYGONCE_HAL_PLATFORM_INC +# end of platform.inc diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/plf_intr.h ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_intr.h --- ecos/packages/hal/h8300/aki3068ide/current/include/plf_intr.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_intr.h Fri Aug 30 11:34:46 2002 @@ -0,0 +1,76 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// AKI3068NET board interrupt and clock support +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####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 +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + + +//-------------------------------------------------------------------------- + +externC void h8300h_reset (void); +externC void hal_delay_us(int usecs); + +#define HAL_PLATFORM_RESET(x) +#define HAL_PLATFORM_RESET_ENTRY &h8300h_reset + +#define HAL_DELAY_US(n) hal_delay_us((n) / 16) + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/plf_io.h ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_io.h --- ecos/packages/hal/h8300/aki3068ide/current/include/plf_io.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_io.h Fri Aug 30 14:18:30 2002 @@ -0,0 +1,91 @@ +#ifndef CYGONCE_HAL_PLF_IO_H +#define CYGONCE_HAL_PLF_IO_H + +//============================================================================= +// +// plf_io.h +// +// platform specific IO support +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ysato +// Contributors: ysato +// Date: 2002-08-30 +// Purpose: Aki3068net + CF IO support +// Description: The macros defined here provide the HAL APIs for handling +// basic IO +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +//----------------------------------------------------------------------------- +// IDE interface macros +// +#define HAL_IDE_NUM_CONTROLLERS 1 + +// Initialize the IDE controller(s). +#define HAL_IDE_INIT() aki3068ide_ide_setup() + +#define HAL_IDE_READ_UINT8( __ctlr, __regno, __val ) \ + aki3068ide_read_command(__regno, __val) +#define HAL_IDE_READ_UINT16( __ctlr, __regno, __val ) \ + aki3068ide_read_data(__regno, __val) +#define HAL_IDE_READ_ALTSTATUS( __ctlr, __val ) \ + aki3068ide_read_control( __val) + +#define HAL_IDE_WRITE_UINT8( __ctlr, __regno, __val ) \ + aki3068ide_write_command(__regno, __val) +#define HAL_IDE_WRITE_UINT16( __ctlr, __regno, __val ) \ + aki3068ide_write_data(__regno, __val) +#define HAL_IDE_WRITE_CONTROL( __ctlr, __val ) \ + aki3068ide_write_control( __val) + +void aki3068ide_read_command(cyg_uint16 r, cyg_uint8 *d); +void aki3068ide_read_data (cyg_uint16 r, cyg_uint16 *d); +void aki3068ide_read_control(cyg_uint8 *d); + +void aki3068ide_write_command(cyg_uint16 r, cyg_uint8 d); +void aki3068ide_write_data (cyg_uint16 r, cyg_uint16 d); +void aki3068ide_write_control(cyg_uint8 d); + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_PLF_IO_H +// end of plf_io.h diff -Nru ecos/packages/hal/h8300/aki3068ide/current/include/plf_stub.h ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_stub.h --- ecos/packages/hal/h8300/aki3068ide/current/include/plf_stub.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/include/plf_stub.h Fri Aug 30 11:34:46 2002 @@ -0,0 +1,90 @@ +#ifndef CYGONCE_HAL_PLF_STUB_H +#define CYGONCE_HAL_PLF_STUB_H + +//============================================================================= +// +// plf_stub.h +// +// Platform header for GDB stub support. +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:jskov +// Date: 1999-05-18 +// Purpose: Platform HAL stub support for H8/300H simulator +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include // CYG_UNUSED_PARAM, externC + +#include // architecture stub support + +#include // hal_diag_led_on + +//---------------------------------------------------------------------------- +// Define some platform specific communication details. This is mostly +// handled by hal_if now, but we need to make sure the comms tables are +// properly initialized. + +externC void cyg_hal_plf_comms_init(void); + +#define HAL_STUB_PLATFORM_INIT_SERIAL() cyg_hal_plf_comms_init() + +#define HAL_STUB_PLATFORM_SET_BAUD_RATE(baud) CYG_UNUSED_PARAM(int, (baud)) +#define HAL_STUB_PLATFORM_INTERRUPTIBLE 0 + +//---------------------------------------------------------------------------- +// Stub initializer. +#ifdef CYGSEM_HAL_ROM_MONITOR +# define HAL_STUB_PLATFORM_INIT() hal_diag_led_on() +#else +# define HAL_STUB_PLATFORM_INIT() CYG_EMPTY_STATEMENT +#endif + +#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_PLF_STUB_H +// End of plf_stub.h diff -Nru ecos/packages/hal/h8300/aki3068ide/current/src/delay_us.S ecos.work/packages/hal/h8300/aki3068ide/current/src/delay_us.S --- ecos/packages/hal/h8300/aki3068ide/current/src/delay_us.S Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/src/delay_us.S Fri Aug 30 11:34:46 2002 @@ -0,0 +1,39 @@ +;;delay_us + +#include + +#include +#include +#include + +#define DELAY_COUNT (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)*16/8 + +// .file "delay_us.S" + .h8300h + .text + + .global CYG_LABEL_DEFN(hal_delay_us) +CYG_LABEL_DEFN(hal_delay_us): + mov.b #0,r1l + mov.b r1l,@CYGARC_8TCNT2:8 + mov.b r1l,@CYGARC_8TCSR2:8 + mov.b #DELAY_COUNT+1,r1l + mov.b r1l,@CYGARC_TCORA2:8 + mov.b #0x09,r1l + mov.b r1l,@CYGARC_8TCR2:8 + mov.b #0,r2h + sub.w e1,e1 +1: + mov.l er0,er0 + ble 3f +2: + btst #6,@CYGARC_8TCSR2:8 + beq 2b + bclr #6,@CYGARC_8TCSR2:8 + dec.l #1,er0 + bra 1b +3: + mov.b #0,r0l + mov.b r0l,@CYGARC_8TCR2 + rts + diff -Nru ecos/packages/hal/h8300/aki3068ide/current/src/hal_diag.c ecos.work/packages/hal/h8300/aki3068ide/current/src/hal_diag.c --- ecos/packages/hal/h8300/aki3068ide/current/src/hal_diag.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/src/hal_diag.c Fri Aug 30 11:34:46 2002 @@ -0,0 +1,187 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ysato +// Contributors: ysato +// Date: 2002-04-05 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include +#include +#include +#include +#include + +#define SCI_BASE ((cyg_uint8*)0xffffb8) + +const static channel_data_t channel = { (cyg_uint8*)SCI_BASE, 0, 0}; + +void +cyg_hal_plf_comms_init(void) +{ + static int initialized = 0; + + if (initialized) + return; + + initialized = 1; + + cyg_hal_plf_sci_init(0, 0, CYGNUM_HAL_INTERRUPT_RXI1, SCI_BASE); +} + +//============================================================================= +// Led control +//============================================================================= +#define LED CYGARC_PADR + +void +hal_diag_led_on( void ) +{ + HAL_WRITE_UINT8(LED, 0x01); +} + +void +hal_diag_led_off( void ) +{ + HAL_WRITE_UINT8(LED, 0); +} + +//============================================================================= +// Compatibility with older stubs +//============================================================================= + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) +#include // hal_output_gdb_string +#endif + +void hal_diag_init(void) +{ + cyg_hal_plf_sci_init_channel(&channel); +} + +void +hal_diag_write_char( cyg_uint8 c ) +{ +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + static char line[100]; + static int pos = 0; + + // No need to send CRs + if( c == '\r' ) return; + + line[pos++] = c; + + if( c == '\n' || pos == sizeof(line) ) + { + CYG_INTERRUPT_STATE old; + + // Disable interrupts. This prevents GDB trying to interrupt us + // while we are in the middle of sending a packet. The serial + // receive interrupt will be seen when we re-enable interrupts + // later. + + CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old); + + while(1) + { + char c1; + static char hex[] = "0123456789ABCDEF"; + cyg_uint8 csum = 0; + int i; + + cyg_hal_plf_sci_putc(&channel, '$'); + cyg_hal_plf_sci_putc(&channel, 'O'); + csum += 'O'; + for( i = 0; i < pos; i++ ) + { + char ch = line[i]; + char h = hex[(ch>>4)&0xF]; + char l = hex[ch&0xF]; + cyg_hal_plf_sci_putc(&channel, h); + cyg_hal_plf_sci_putc(&channel, l); + csum += h; + csum += l; + } + cyg_hal_plf_sci_putc(&channel, '#'); + cyg_hal_plf_sci_putc(&channel, hex[(csum>>4)&0xF]); + cyg_hal_plf_sci_putc(&channel, hex[csum&0xF]); + + // Wait for the ACK character '+' from GDB here and handle + // receiving a ^C instead. + c1 = (char) cyg_hal_plf_sci_getc(&channel); + + if( c1 == '+' ) + break; // a good acknowledge + + // Check for user break. + if( cyg_hal_is_break( &c1, 1 ) ) + cyg_hal_user_break( NULL ); + + // otherwise, loop round again + } + + pos = 0; + + // And re-enable interrupts + CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old); + } +#else // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + cyg_hal_plf_sci_putc(&channel, c); +#endif +} + +void +hal_diag_read_char(cyg_uint8 *c) +{ + *c = (char) cyg_hal_plf_sci_getc(&channel); +} + +/*===========================================================================*/ +/* EOF hal_diag.c */ + diff -Nru ecos/packages/hal/h8300/aki3068ide/current/src/plf_ide.c ecos.work/packages/hal/h8300/aki3068ide/current/src/plf_ide.c --- ecos/packages/hal/h8300/aki3068ide/current/src/plf_ide.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/src/plf_ide.c Fri Aug 30 14:19:06 2002 @@ -0,0 +1,132 @@ +//========================================================================== +// +// plf_ide.c +// +// HAL platform IDE support function +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ysato +// Contributors: ysato +// Date: 2002-08-30 +// Purpose: HAL IDE support function +// Description: This file contains IDE support functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include + +#include // Base types + +#include // architectural definitions +#include +#include +#include +#include + +/*------------------------------------------------------------------------*/ + +#define IDE_REG_FEATUERS 1 +#define IDE_REG_COMMAND 7 + +void aki3068ide_ide_setup(void) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + aki3068ide_write_command(IDE_REG_FEATUERS,0x01); /* 8bit transfer mode */ + aki3068ide_write_command(IDE_REG_COMMAND, 0xef); /* set featuers */ +#endif +} + +void aki3068ide_read_command(cyg_uint16 r, cyg_uint8 *d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *d = *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_COMMAND + r); +#else + *d = *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_COMMAND + (r << 1)); +#endif +} + +void aki3068ide_read_data (cyg_uint16 r, cyg_uint16 *d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *d = *(volatile cyg_uint16 *)(CYGHWR_HAL_IDE_COMMAND + r); +#else + *d = *(volatile cyg_uint16 *)(CYGHWR_HAL_IDE_COMMAND + (r << 1)); +#endif +} + +void aki3068ide_read_control(cyg_uint8 *d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *d = *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_CONTROL); +#else + *d = *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_CONTROL); +#endif +} + +void aki3068ide_write_command(cyg_uint16 r, cyg_uint8 d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_COMMAND + r) = d; +#else + *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_COMMAND + (r << 1)) = d; +#endif +} + +void aki3068ide_write_data (cyg_uint16 r, cyg_uint16 d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_COMMAND + r) = d; +#else + *(volatile cyg_uint16 *)(CYGHWR_HAL_IDE_COMMAND + (r << 1)) = d; +#endif +} + +void aki3068ide_write_control(cyg_uint8 d) +{ +#if CYGHWR_HAL_IDE_BUSWIDTH == 8 + *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_CONTROL) = d; +#else + *(volatile cyg_uint8 *)(CYGHWR_HAL_IDE_CONTROL) = d; +#endif +} + +/*------------------------------------------------------------------------*/ +/* End of plf_ide.c */ diff -Nru ecos/packages/hal/h8300/aki3068ide/current/src/plf_misc.c ecos.work/packages/hal/h8300/aki3068ide/current/src/plf_misc.c --- ecos/packages/hal/h8300/aki3068ide/current/src/plf_misc.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/aki3068ide/current/src/plf_misc.c Fri Aug 30 12:05:12 2002 @@ -0,0 +1,126 @@ +//========================================================================== +// +// plf_misc.c +// +// HAL platform miscellaneous functions +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####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 + +#include // Base types + +#include // architectural definitions +#include +#include +#include +#include + +/*------------------------------------------------------------------------*/ + +void hal_platform_init(void) +{ + hal_if_init(); +} + +void h8300h_reset(void) +{ + __asm__ ("ldc #0x80,ccr\n" + "jmp @@0\n\t"); +} + +/*------------------------------------------------------------------------*/ +/* Control C ISR support */ + +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + +struct Hal_SavedRegisters *hal_saved_interrupt_state; + +#endif + +/*------------------------------------------------------------------------*/ +/* clock support */ + +void hal_clock_initialize(cyg_uint32 period) +{ + CYG_BYTE prescale; +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8 + prescale = 0x01; +#else +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 64 + prescale = 0x02; +#else +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8192 + prescale = 0x03; +#else +#error illigal RTC prescale setting +#endif +#endif +#endif + HAL_WRITE_UINT8(CYGARC_TCORA3,period); + HAL_WRITE_UINT8(CYGARC_8TCNT3,0x00); + HAL_WRITE_UINT8(CYGARC_8TCR3,0x48 | prescale); + HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00); +} + +void hal_clock_reset(cyg_uint32 vector, cyg_uint32 period) +{ + HAL_WRITE_UINT8(CYGARC_8TCR3,0x00); + HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00); + hal_clock_initialize(period); +} + +void hal_clock_read(cyg_uint32 *pvalue) +{ + CYG_BYTE val; + HAL_READ_UINT8(CYGARC_8TCNT3,val); + *pvalue = val; +} + +/*------------------------------------------------------------------------*/ +/* End of plf_misc.c */ diff -Nru ecos/packages/hal/h8300/h8max/current/cdl/hal_h8300_h8300h_h8max.cdl ecos.work/packages/hal/h8300/h8max/current/cdl/hal_h8300_h8300h_h8max.cdl --- ecos/packages/hal/h8300/h8max/current/cdl/hal_h8300_h8300h_h8max.cdl Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/cdl/hal_h8300_h8300h_h8max.cdl Thu Aug 29 21:43:36 2002 @@ -0,0 +1,276 @@ +# ==================================================================== +# +# hal_h8300_h8300h_h8max.cdl +# +# H8MAX board HAL package configuration data +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +## at http://sources.redhat.com/ecos/ecos-license/ +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): yoshinori sato +# Original data: bartv +# Contributors: yoshinori sato +# Date: 2002-08-10 +# +#####DESCRIPTIONEND#### +# +# ==================================================================== + +cdl_package CYGPKG_HAL_H8300_H8300H_H8MAX { + display "H8MAX" + parent CYGPKG_HAL_H8300 + requires CYGPKG_HAL_H8300_H8300H + implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT + implements CYGINT_HAL_DEBUG_GDB_STUBS + implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK + implements CYGINT_HAL_PLF_IF_IDE + define_header hal_h8300_h8300h_h8max.h + include_dir cyg/hal + description " + The aki HAL package provides the support needed to run + eCos on a Akizuki H8/3068 Network micom board." + + compile hal_diag.c plf_misc.c delay_us.S + + define_proc { + puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H " + puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H " + puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_IO_H " + + puts $::cdl_header "#define CYG_HAL_H8300" + puts $::cdl_header "#define CYGNUM_HAL_H8300_SCI_PORTS 1" + puts $::cdl_header "#define CYGHWR_HAL_VECTOR_TABLE 0xfffe20" + puts $::cdl_header "#define HAL_PLATFORM_CPU \"H8/300H\"" + puts $::cdl_header "#define HAL_PLATFORM_BOARD \"H8MAX\"" + puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\"" + } + + cdl_component CYG_HAL_STARTUP { + display "Startup type" + flavor data + legal_values {"ROM" "RAM"} + default_value {"ROM"} + no_define + define -file system.h CYG_HAL_STARTUP + description " + When targetting the H8MAX board it is possible to + build the system for either RAM bootstrap or ROM bootstrap. + RAM bootstrap generally requires that the board + is equipped with ROMs containing a suitable ROM monitor or + equivalent software that allows GDB to download the eCos + application and extend Memory on to the board. + The ROM bootstrap typically + requires that the eCos application be blown into EPROMs or + equivalent technology." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { + display "Number of communication channels on the board" + flavor data + calculated 1 + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL { + display "Debug serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The AKI3068NET board has only one serial port. This option + chooses which port will be used to connect to a host + running GDB." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL { + display "Diagnostic serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The CQ/7708 board has only one serial port. This option + chooses which port will be used for diagnostic output." + } + + # Real-time clock/counter specifics + cdl_component CYGNUM_HAL_RTC_CONSTANTS { + display "Real-time clock constants." + flavor none + + cdl_option CYGNUM_HAL_RTC_NUMERATOR { + display "Real-time clock numerator" + flavor data + calculated 1000000000 + } + cdl_option CYGNUM_HAL_RTC_DENOMINATOR { + display "Real-time clock denominator" + flavor data + calculated 100 + } + cdl_option CYGNUM_HAL_H8300_RTC_PRESCALE { + display "Real-time clock base prescale" + flavor data + calculated 8192 + } + # Isn't a nice way to handle freq requirement! + cdl_option CYGNUM_HAL_RTC_PERIOD { + display "Real-time clock period" + flavor data + calculated 10 + } + } + + cdl_option CYGHWR_HAL_H8300_CPG_INPUT { + display "OSC/Clock Freqency" + flavor data + default_value 25000000 + } + + cdl_option CYGHWR_HAL_H8MAX_EXTRAM { + display "Extend DRAM Using" + flavor bool + default_value 1 + } + + cdl_component CYGBLD_GLOBAL_OPTIONS { + display "Global build options" + flavor none + parent CYGPKG_NONE + description " + Global build options including control over + compiler flags, linker flags and choice of toolchain." + + + cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX { + display "Global command prefix" + flavor data + no_define + default_value { "h8300-elf" } + description " + This option specifies the command prefix used when + invoking the build tools." + } + + cdl_option CYGBLD_GLOBAL_CFLAGS { + display "Global compiler flags" + flavor data + no_define + default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -mh -mint32 -fsigned-char -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" } + description " + This option controls the global compiler flags which + are used to compile all packages by + default. Individual packages may define + options which override these global flags." + } + + cdl_option CYGBLD_GLOBAL_LDFLAGS { + display "Global linker flags" + flavor data + no_define + default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static -mh -mint32" } + description " + This option controls the global linker flags. Individual + packages may define options which override these global flags." + } + cdl_option CYGBLD_BUILD_GDB_STUBS { + display "Build GDB stub ROM image" + default_value 0 + requires CYGSEM_HAL_ROM_MONITOR + requires CYGBLD_BUILD_COMMON_GDB_STUBS + requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + no_define + description " + This option enables the building of the GDB stubs for the + board. The common HAL controls takes care of most of the + build process, but the final conversion from ELF image to + binary data is handled by the platform CDL, allowing + relocation of the data if necessary." + + make -priority 320 { + /bin/gdb_module.bin : /bin/gdb_module.img + $(OBJCOPY) -O binary $< $@ + } + } + } + + cdl_component CYGHWR_MEMORY_LAYOUT { + display "Memory layout" + flavor data + no_define + calculated { CYG_HAL_STARTUP == "RAM" ? "h8300_h8300h_h8max_ram" : \ + "h8300_h8300h_h8max_rom" } + + cdl_option CYGHWR_MEMORY_LAYOUT_LDI { + display "Memory layout linker script fragment" + flavor data + no_define + define -file system.h CYGHWR_MEMORY_LAYOUT_LDI + calculated { CYG_HAL_STARTUP == "RAM" ? "" : \ + "" } + } + + cdl_option CYGHWR_MEMORY_LAYOUT_H { + display "Memory layout header file" + flavor data + no_define + define -file system.h CYGHWR_MEMORY_LAYOUT_H + calculated { CYG_HAL_STARTUP == "RAM" ? "" : \ + "" } + } + } + cdl_option CYGSEM_HAL_ROM_MONITOR { + display "Behave as a ROM monitor" + flavor bool + default_value 0 + parent CYGPKG_HAL_ROM_MONITOR + requires { CYG_HAL_STARTUP == "ROM" } + description " + Enable this option if this program is to be used as a ROM monitor, + i.e. applications will be loaded into RAM on the board, and this + ROM monitor may process exceptions or interrupts generated from the + application. This enables features such as utilizing a separate + interrupt stack when exceptions are generated." + } + cdl_option CYGSEM_HAL_H8300_VECTOR_HOOK { + display "Interrupt Vector Hook" + flavor bool + default_value 1 + parent CYGPKG_HAL_ROM_MONITOR + description " + Interrupt Vector Table Hooking Support" + } +} diff -Nru ecos/packages/hal/h8300/h8max/current/include/hal_diag.h ecos.work/packages/hal/h8300/h8max/current/include/hal_diag.h --- ecos/packages/hal/h8300/h8max/current/include/hal_diag.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/hal_diag.h Sat Aug 10 23:39:10 2002 @@ -0,0 +1,80 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): yoshinori sato +// Contributors: yoshinori sato +// Date: 2002-04-06 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +externC void hal_diag_init(void); +externC void hal_diag_write_char(cyg_uint8 c); +externC void hal_diag_read_char(cyg_uint8 *c); + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() hal_diag_init() + +#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) + +//----------------------------------------------------------------------------- +// Simple LED control. +externC void hal_diag_led_on( void ); +externC void hal_diag_led_off( void ); + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.h ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.h --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.h Sat Aug 10 23:39:10 2002 @@ -0,0 +1,14 @@ +// eCos memory layout - Wed Nov 24 13:10:23 1999 + +// This is a generated file - changes will be lost if ConfigTool(MLT) is run + +#ifndef __ASSEMBLER__ +#include +#include + +#endif + +#define CYGMEM_REGION_ram (0x420000) +#define CYGMEM_REGION_ram_SIZE (0x1E0000) +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) + diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.ldi ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.ldi --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.ldi Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.ldi Sat Aug 10 23:39:10 2002 @@ -0,0 +1,30 @@ +// eCos memory layout - Fri Oct 20 08:25:16 2000 + +// This is a generated file - do not edit + +#include + +OUTPUT_FORMAT("elf32-h8300") +OUTPUT_ARCH(h8300h) + +MEMORY +{ + ram : ORIGIN = 0x400000, LENGTH = 0x20000 +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_text (ram, 0x400000, 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_int_hook_table (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_data (ram, ALIGN (0x4),LMA_EQ_VMA) + SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) + SECTIONS_END +} + +hook_table_address = 0xffbf20; diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.mlt ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.mlt --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.mlt Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_ram.mlt Sat Aug 10 23:39:10 2002 @@ -0,0 +1,12 @@ +version 0 +region ram 400000 10000 0 ! +section text 0 1 0 1 0 1 0 1 400000 400000 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 int_fook_table int_hook_table ! +section int_hook_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 1 0 0 ! + diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.h ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.h --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.h Sat Aug 10 23:39:10 2002 @@ -0,0 +1,18 @@ +// eCos memory layout - Wed Nov 24 13:10:23 1999 + +// This is a generated file - changes will be lost if ConfigTool(MLT) is run + +#ifndef __ASSEMBLER__ +#include +#include + +#endif + +#define CYGMEM_REGION_ram (0x400000) +#if !defined(CYGPKG_IO_ETH_DRIVERS) +#define CYGMEM_REGION_ram_SIZE (0x200000) +#else +#define CYGMEM_REGION_ram_SIZE (0x200000-0xC000) +#endif +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) + diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.ldi ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.ldi --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.ldi Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.ldi Tue Aug 13 15:38:27 2002 @@ -0,0 +1,41 @@ +// eCos memory layout - Fri Oct 20 08:25:16 2000 + +// This is a generated file - do not edit + +#include + +OUTPUT_FORMAT("elf32-h8300") +OUTPUT_ARCH(h8300h) + +MEMORY +{ + rom : ORIGIN = 0x000000, LENGTH = 0x60000 +#if !defined(CYGPKG_IO_ETH_DRIVERS) + ram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100 +#else + ram : ORIGIN = 0x5F4000, LENGTH = 0xC000 + iram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100 +#endif +} + +SECTIONS +{ + SECTIONS_BEGIN + SECTION_rom_vectors (rom, 0x000000, 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) +#if !defined(CYGPKG_IO_ETH_DRIVERS) + SECTION_int_hook_table (ram, 0xffbf20,FOLLOWING (.gcc_except_table)) + SECTION_data (ram, ALIGN (0x4),FOLLOWING (.int_hook_table)) + SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) +#else + SECTION_data (ram, 0x5F4000,FOLLOWING (.gcc_except_table)) + SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA) + SECTION_int_hook_table (iram, 0xffbf20,FOLLOWING (.data)) +#endif + SECTIONS_END +} diff -Nru ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.mlt ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.mlt --- ecos/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.mlt Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/pkgconf/mlt_h8300_h8300h_h8max_rom.mlt Sat Aug 10 23:39:10 2002 @@ -0,0 +1,12 @@ +version 0 +region ram ffbf20 ffff20 0 ! +section rom_vectors 0 1 0 1 1 1 1 1 0 60000 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 1 0 1 heap1 heap1 ! +section heap1 0 8 0 0 0 0 0 0 ! diff -Nru ecos/packages/hal/h8300/h8max/current/include/platform.inc ecos.work/packages/hal/h8300/h8max/current/include/platform.inc --- ecos/packages/hal/h8300/h8max/current/include/platform.inc Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/platform.inc Thu Aug 22 21:49:19 2002 @@ -0,0 +1,135 @@ +#ifndef CYGONCE_HAL_PLATFORM_INC +#define CYGONCE_HAL_PLATFORM_INC +##============================================================================= +## +## platform.inc +## +## H8MAX "board" assembler header file +## +##============================================================================= +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +## at http://sources.redhat.com/ecos/ecos-license/ +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): jlarmour +## Contributors: Yoshinori Sato,Masahiro Ochiai +## Date: 2002-08-10 +## Purpose: H8MAX "board" definitions. +## Description: This file contains various definitions and macros that are +## required for writing assembly code for the H8MAX board +## Currently there are none +## Usage: +## #include +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include +#include + +##----------------------------------------------------------------------------- + +#define CYGPKG_HAL_H8300_MEMC_DEFINED + .macro hal_memc_init +#if defined(CYG_HAL_STARTUP_ROM) + mov.l #init_regs,er0 +1: + mov.l @er0+,er2 + beq 2f + mov.w @er0+,r1 + mov.b r1l,@er2 + bra 1b + +init_regs: + .long CYGARC_RTCOR + .word 195 + .long CYGARC_RTMCSR + .word 0x0f + .long CYGARC_DRCRB + .word 0xb8 + .long CYGARC_DRCRA + .word 0x30 + .long CYGARC_ABWCR + .word 0xe0 + .long CYGARC_ASTCR + .word 0xff + .long CYGARC_BCR + .word 0xc7 + .long CYGARC_CSCR + .word 0x1f + .long CYGARC_P1DDR + .word 0xff + .long CYGARC_P2DDR + .word 0xff + .long CYGARC_P6DDR + .word 0xf6 + .long CYGARC_P8DDR + .word 0x0ee + .long 0 +init_regs_end: +;; Special Thanks Masahiro Ochiai + +2: +#endif + .endm + +#define CYGPKG_HAL_H8300_DIAG_DEFINED + + .macro hal_diag_init + mov.b #0x83,r0l + mov.b r0l,@CYGARC_PADDR + mov.b #0,r0l + mov.b r0l,@CYGARC_PADR + .endm + + .macro hal_diag_excpt_start + .endm + + .macro hal_diag_intr_start + .endm + + .macro hal_diag_restore + .endm + + .macro hal_diag_data + .endm + +#------------------------------------------------------------------------------ +#endif // ifndef CYGONCE_HAL_PLATFORM_INC +# end of platform.inc diff -Nru ecos/packages/hal/h8300/h8max/current/include/plf_intr.h ecos.work/packages/hal/h8300/h8max/current/include/plf_intr.h --- ecos/packages/hal/h8300/h8max/current/include/plf_intr.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/plf_intr.h Sat Aug 10 23:54:02 2002 @@ -0,0 +1,76 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// H8MAX board interrupt and clock support +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: ysato +// Date: ysato +// 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 +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + + +//-------------------------------------------------------------------------- + +externC void h8300h_reset (void); +externC void hal_delay_us(int usecs); + +#define HAL_PLATFORM_RESET(x) +#define HAL_PLATFORM_RESET_ENTRY &h8300h_reset + +#define HAL_DELAY_US(n) hal_delay_us((n) / 16) + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h diff -Nru ecos/packages/hal/h8300/h8max/current/include/plf_io.h ecos.work/packages/hal/h8300/h8max/current/include/plf_io.h --- ecos/packages/hal/h8300/h8max/current/include/plf_io.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/plf_io.h Fri Aug 30 12:03:10 2002 @@ -0,0 +1,97 @@ +#ifndef CYGONCE_HAL_PLF_IO_H +#define CYGONCE_HAL_PLF_IO_H + +//============================================================================= +// +// plf_io.h +// +// platform specific IO support +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ysato +// Contributors: ysato +// Date: 2002-08-29 +// Purpose: H8MAX IO support +// Description: The macros defined here provide the HAL APIs for handling +// basic IO +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +//----------------------------------------------------------------------------- +// IDE interface macros +// +#define HAL_IDE_NUM_CONTROLLERS 1 + +// Initialize the IDE controller(s). +#define HAL_IDE_INIT() + +#define IDE_CMD_ADDRESS 0x200000 +#define IDE_CTL_ADDRESS 0x600000 + +#define HAL_IDE_READ_UINT8( __ctlr, __regno, __val ) \ + HAL_READ_UINT8(IDE_CMD_ADDRESS + ((__regno)<<1)+1 , (__val)) +#define HAL_IDE_READ_UINT16( __ctlr, __regno, __val ) \ + hal_ide_read_uint16_swap(__regno,&(__val) ) +#define HAL_IDE_READ_ALTSTATUS( __ctlr, __val ) \ + HAL_READ_UINT16(IDE_CTL_ADDRESS + 4, (__val)) + +#define HAL_IDE_WRITE_UINT8( __ctlr, __regno, __val ) \ + HAL_WRITE_UINT16(IDE_CMD_ADDRESS + ((__regno)<<1)+1 , (__val)) +#define HAL_IDE_WRITE_UINT16( __ctlr, __regno, __val ) \ + hal_ide_write_uint16_swap(__regno, __val ) +#define HAL_IDE_WRITE_CONTROL( __ctlr, __val ) \ + HAL_WRITE_UINT16(IDE_CTL_ADDRESS + 4, (__val)) + +static inline void hal_ide_read_uint16_swap(CYG_WORD16 __regno, CYG_WORD16 *__val ) +{ + CYG_WORD16 d; + d = *(volatile CYG_WORD16 *)(IDE_CMD_ADDRESS + (__regno <<1)); + *__val = (d >> 8) | (d << 8); +} + +static inline void hal_ide_write_uint16_swap(CYG_WORD16 __regno, CYG_WORD16 __val ) +{ + *(volatile CYG_WORD16 *)(IDE_CMD_ADDRESS + (__regno <<1)) = (__val >> 8) | (__val << 8); +} +//----------------------------------------------------------------------------- +#endif +// end of plf_io.h diff -Nru ecos/packages/hal/h8300/h8max/current/include/plf_stub.h ecos.work/packages/hal/h8300/h8max/current/include/plf_stub.h --- ecos/packages/hal/h8300/h8max/current/include/plf_stub.h Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/include/plf_stub.h Sat Aug 10 23:39:10 2002 @@ -0,0 +1,90 @@ +#ifndef CYGONCE_HAL_PLF_STUB_H +#define CYGONCE_HAL_PLF_STUB_H + +//============================================================================= +// +// plf_stub.h +// +// Platform header for GDB stub support. +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov +// Contributors:jskov +// Date: 1999-05-18 +// Purpose: Platform HAL stub support for H8/300H simulator +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include // CYG_UNUSED_PARAM, externC + +#include // architecture stub support + +#include // hal_diag_led_on + +//---------------------------------------------------------------------------- +// Define some platform specific communication details. This is mostly +// handled by hal_if now, but we need to make sure the comms tables are +// properly initialized. + +externC void cyg_hal_plf_comms_init(void); + +#define HAL_STUB_PLATFORM_INIT_SERIAL() cyg_hal_plf_comms_init() + +#define HAL_STUB_PLATFORM_SET_BAUD_RATE(baud) CYG_UNUSED_PARAM(int, (baud)) +#define HAL_STUB_PLATFORM_INTERRUPTIBLE 0 + +//---------------------------------------------------------------------------- +// Stub initializer. +#ifdef CYGSEM_HAL_ROM_MONITOR +# define HAL_STUB_PLATFORM_INIT() hal_diag_led_on() +#else +# define HAL_STUB_PLATFORM_INIT() CYG_EMPTY_STATEMENT +#endif + +#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_PLF_STUB_H +// End of plf_stub.h diff -Nru ecos/packages/hal/h8300/h8max/current/src/delay_us.S ecos.work/packages/hal/h8300/h8max/current/src/delay_us.S --- ecos/packages/hal/h8300/h8max/current/src/delay_us.S Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/src/delay_us.S Sat Aug 10 23:39:10 2002 @@ -0,0 +1,39 @@ +;;delay_us + +#include + +#include +#include +#include + +#define DELAY_COUNT (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)*16/8 + +// .file "delay_us.S" + .h8300h + .text + + .global CYG_LABEL_DEFN(hal_delay_us) +CYG_LABEL_DEFN(hal_delay_us): + mov.b #0,r1l + mov.b r1l,@CYGARC_8TCNT2:8 + mov.b r1l,@CYGARC_8TCSR2:8 + mov.b #DELAY_COUNT+1,r1l + mov.b r1l,@CYGARC_TCORA2:8 + mov.b #0x09,r1l + mov.b r1l,@CYGARC_8TCR2:8 + mov.b #0,r2h + sub.w e1,e1 +1: + mov.l er0,er0 + ble 3f +2: + btst #6,@CYGARC_8TCSR2:8 + beq 2b + bclr #6,@CYGARC_8TCSR2:8 + dec.l #1,er0 + bra 1b +3: + mov.b #0,r0l + mov.b r0l,@CYGARC_8TCR2 + rts + diff -Nru ecos/packages/hal/h8300/h8max/current/src/hal_diag.c ecos.work/packages/hal/h8300/h8max/current/src/hal_diag.c --- ecos/packages/hal/h8300/h8max/current/src/hal_diag.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/src/hal_diag.c Sat Aug 10 23:39:10 2002 @@ -0,0 +1,187 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ysato +// Contributors: ysato +// Date: 2002-04-05 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include +#include +#include +#include +#include + +#define SCI_BASE ((cyg_uint8*)0xffffb8) + +const static channel_data_t channel = { (cyg_uint8*)SCI_BASE, 0, 0}; + +void +cyg_hal_plf_comms_init(void) +{ + static int initialized = 0; + + if (initialized) + return; + + initialized = 1; + + cyg_hal_plf_sci_init(0, 0, CYGNUM_HAL_INTERRUPT_RXI1, SCI_BASE); +} + +//============================================================================= +// Led control +//============================================================================= +#define LED CYGARC_PADR + +void +hal_diag_led_on( void ) +{ + HAL_WRITE_UINT8(LED, 0x01); +} + +void +hal_diag_led_off( void ) +{ + HAL_WRITE_UINT8(LED, 0); +} + +//============================================================================= +// Compatibility with older stubs +//============================================================================= + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) +#include // hal_output_gdb_string +#endif + +void hal_diag_init(void) +{ + cyg_hal_plf_sci_init_channel(&channel); +} + +void +hal_diag_write_char( cyg_uint8 c ) +{ +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + static char line[100]; + static int pos = 0; + + // No need to send CRs + if( c == '\r' ) return; + + line[pos++] = c; + + if( c == '\n' || pos == sizeof(line) ) + { + CYG_INTERRUPT_STATE old; + + // Disable interrupts. This prevents GDB trying to interrupt us + // while we are in the middle of sending a packet. The serial + // receive interrupt will be seen when we re-enable interrupts + // later. + + CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old); + + while(1) + { + char c1; + static char hex[] = "0123456789ABCDEF"; + cyg_uint8 csum = 0; + int i; + + cyg_hal_plf_sci_putc(&channel, '$'); + cyg_hal_plf_sci_putc(&channel, 'O'); + csum += 'O'; + for( i = 0; i < pos; i++ ) + { + char ch = line[i]; + char h = hex[(ch>>4)&0xF]; + char l = hex[ch&0xF]; + cyg_hal_plf_sci_putc(&channel, h); + cyg_hal_plf_sci_putc(&channel, l); + csum += h; + csum += l; + } + cyg_hal_plf_sci_putc(&channel, '#'); + cyg_hal_plf_sci_putc(&channel, hex[(csum>>4)&0xF]); + cyg_hal_plf_sci_putc(&channel, hex[csum&0xF]); + + // Wait for the ACK character '+' from GDB here and handle + // receiving a ^C instead. + c1 = (char) cyg_hal_plf_sci_getc(&channel); + + if( c1 == '+' ) + break; // a good acknowledge + + // Check for user break. + if( cyg_hal_is_break( &c1, 1 ) ) + cyg_hal_user_break( NULL ); + + // otherwise, loop round again + } + + pos = 0; + + // And re-enable interrupts + CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old); + } +#else // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + cyg_hal_plf_sci_putc(&channel, c); +#endif +} + +void +hal_diag_read_char(cyg_uint8 *c) +{ + *c = (char) cyg_hal_plf_sci_getc(&channel); +} + +/*===========================================================================*/ +/* EOF hal_diag.c */ + diff -Nru ecos/packages/hal/h8300/h8max/current/src/plf_misc.c ecos.work/packages/hal/h8300/h8max/current/src/plf_misc.c --- ecos/packages/hal/h8300/h8max/current/src/plf_misc.c Thu Jan 1 09:00:00 1970 +++ ecos.work/packages/hal/h8300/h8max/current/src/plf_misc.c Sat Aug 10 23:39:10 2002 @@ -0,0 +1,161 @@ +//========================================================================== +// +// plf_misc.c +// +// HAL platform miscellaneous functions +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####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 + +#include // Base types + +#include // architectural definitions +#include +#include +#include +#include + +/*------------------------------------------------------------------------*/ + +void hal_platform_init(void) +{ + hal_if_init(); +} + +void h8300h_reset(void) +{ + __asm__ ("ldc #0x80,ccr\n" + "jmp @@0\n\t"); +} + +/*------------------------------------------------------------------------*/ +/* Control C ISR support */ + +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + +struct Hal_SavedRegisters *hal_saved_interrupt_state; + +#endif + +/*------------------------------------------------------------------------*/ +/* clock support */ + +void hal_clock_initialize(cyg_uint32 period) +{ + CYG_BYTE prescale; +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8 + prescale = 0x01; +#else +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 64 + prescale = 0x02; +#else +#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8192 + prescale = 0x03; +#else +#error illigal RTC prescale setting +#endif +#endif +#endif + HAL_WRITE_UINT8(CYGARC_TCORA3,period); + HAL_WRITE_UINT8(CYGARC_8TCNT3,0x00); + HAL_WRITE_UINT8(CYGARC_8TCR3,0x48 | prescale); + HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00); +} + +void hal_clock_reset(cyg_uint32 vector, cyg_uint32 period) +{ + HAL_WRITE_UINT8(CYGARC_8TCR3,0x00); + HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00); + hal_clock_initialize(period); +} + +void hal_clock_read(cyg_uint32 *pvalue) +{ + CYG_BYTE val; + HAL_READ_UINT8(CYGARC_8TCNT3,val); + *pvalue = val; +} + +//--------------------------------------------------------------------------- +// Low-level delay (in microseconds) + +#if 0 +void hal_delay_us(int usecs) +{ + volatile CYG_BYTE *tcr = (CYG_BYTE *)CYGARC_8TCR2; + volatile CYG_BYTE *tcnt = (CYG_BYTE *)CYGARC_8TCNT2; + short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/8*25; + //short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/20; + unsigned char val1,val2; + short diff; + + usecs /= 25; + + *tcnt = 0x00; + *tcr = 0x01; + + diff = 0; + while (usecs > 0) { + while (diff < clocks_per_us) { + val1 = *tcnt; + while ((val2 = *tcnt) == val1); + if (val2 < val1) + diff += val2 + 0x100 - val1; + else + diff += val2 - val1; + } + usecs -= diff / clocks_per_us; + diff -= clocks_per_us; + } + *tcr = 0x00; +} +#endif + +/*------------------------------------------------------------------------*/ +/* End of plf_misc.c */