~ubuntu-branches/ubuntu/wily/openocd/wily

« back to all changes in this revision

Viewing changes to src/ecosboard.c

  • Committer: Bazaar Package Importer
  • Author(s): Uwe Hermann
  • Date: 2009-11-25 12:20:04 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091125122004-4cnrzqw7v9qu064n
Tags: 0.3.1-1
* New upstream release (Closes: #554598, #537740).
* Add sh4 (instead of sh) to the list of architectures (Closes: #555553).
* Standards-Version: 3.8.3 (no changes required).
* debian/watch: Add file.
* debian/docs: Updates, some files were removed, some added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2007-2008 by �yvind Harboe                              *
 
2
 *   Copyright (C) 2007-2008 by Øyvind Harboe                              *
3
3
 *                                                                         *
4
4
 *   This program is free software; you can redistribute it and/or modify  *
5
5
 *   it under the terms of the GNU General Public License as published by  *
155
155
static void zylinjtag_reboot(cyg_addrword_t data)
156
156
{
157
157
        serialLog = true;
158
 
        diag_printf("Rebooting in 100 ticks..\n");
159
 
        cyg_thread_delay(100);
 
158
        diag_printf("Rebooting in 500 ticks..\n");
 
159
        cyg_thread_delay(500);
160
160
        diag_printf("Unmounting /config..\n");
161
161
        umount("/config");
162
162
        diag_printf("Rebooting..\n");
328
328
 
329
329
void format(void)
330
330
{
 
331
#ifdef CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1
331
332
        diag_printf("Formatting JFFS2...\n");
332
333
 
333
334
        cyg_io_handle_t handle;
365
366
        }
366
367
 
367
368
        diag_printf("Flash formatted successfully\n");
 
369
#endif
368
370
 
369
371
        reboot();
370
372
}
503
505
 
504
506
        Jim_CreateCommand(httpstate.jim_interp, "log", zylinjtag_Jim_Command_log,
505
507
                        NULL, NULL);
506
 
        Jim_CreateCommand(httpstate.jim_interp, "reboot",
 
508
        Jim_CreateCommand(httpstate.jim_interp, "zy1000_reboot",
507
509
                        zylinjtag_Jim_Command_reboot, NULL, NULL);
508
510
        Jim_CreateCommand(httpstate.jim_interp, "threads",
509
511
                        zylinjtag_Jim_Command_threads, NULL, NULL);
623
625
#endif
624
626
}
625
627
 
 
628
#define TEST_TCPIP() 0
 
629
 
 
630
#if TEST_TCPIP
626
631
struct
627
632
{
628
633
        int req;
631
636
        int actual2;
632
637
} tcpipSent[512 * 1024];
633
638
int cur;
 
639
#endif
634
640
 
635
641
static void zylinjtag_uart(cyg_addrword_t data)
636
642
{
695
701
                size_t pos, pos2;
696
702
                pos = 0;
697
703
                pos2 = 0;
 
704
#if TEST_TCPIP
698
705
                cur = 0;
 
706
#endif
699
707
                for (;;)
700
708
                {
701
709
                        fd_set write_fds;
796
804
                                }
797
805
                                y2 = written;
798
806
                        }
 
807
#if TEST_TCPIP
799
808
                        if (cur < 1024)
800
809
                        {
801
810
                                tcpipSent[cur].req = x;
804
813
                                tcpipSent[cur].actual2 = y2;
805
814
                                cur++;
806
815
                        }
807
 
 
 
816
#endif
808
817
                }
809
818
                closeSession: close(session);
810
819
                close(serHandle);
811
820
 
 
821
#if TEST_TCPIP
812
822
                int i;
813
823
                for (i = 0; i < 1024; i++)
814
824
                {
816
826
                                        tcpipSent[i].req2, tcpipSent[i].actual2);
817
827
 
818
828
                }
 
829
#endif
819
830
        }
820
831
        close(fd);
821
832
 
918
929
 
919
930
static const char *zylin_config_dir="/config/settings";
920
931
 
921
 
int add_default_dirs(void)
 
932
static int add_default_dirs(void)
922
933
{
923
934
        add_script_search_dir(zylin_config_dir);
924
935
        add_script_search_dir("/rom/lib/openocd");