Exemplo n.º 1
0
static void dhcp_check () {
  /* Monitor DHCP IP address assignment. */

  if (tick == __FALSE || dhcp_tout == 0) {
    return;
  }
#ifdef RTX_KERNEL
  tick = __FALSE;
#endif
  if (mem_test (&MY_IP, 0, IP_ADRLEN) == __FALSE && !(dhcp_tout & 0x80000000)) {
    /* Success, DHCP has already got the IP address. */
    dhcp_tout = 0;
    sprintf((char *)lcd_text[0],"IP address:");
    sprintf((char *)lcd_text[1],"%d.%d.%d.%d", MY_IP[0], MY_IP[1],
                                               MY_IP[2], MY_IP[3]);
    LCDupdate = __TRUE;
    return;
  }
  if (--dhcp_tout == 0) {
    /* A timeout, disable DHCP and use static IP address. */
    dhcp_disable ();
    sprintf((char *)lcd_text[1]," DHCP failed    " );
    LCDupdate = __TRUE;
    dhcp_tout = 30 | 0x80000000;
    return;
  }
  if (dhcp_tout == 0x80000000) {
    dhcp_tout = 0;
    sprintf((char *)lcd_text[0],"IP address:");
    sprintf((char *)lcd_text[1],"%d.%d.%d.%d", MY_IP[0], MY_IP[1],
                                               MY_IP[2], MY_IP[3]);
    LCDupdate = __TRUE;
  }
}
Exemplo n.º 2
0
Arquivo: echo.c Projeto: Saruta/atomos
int main () {

  unsigned long sp;
  __asm__ volatile (
    "mov %%esp,%0\n"
    :"=m"(sp)
    :
  );
  //printf ("%x\n",sp);

  printf ("\n############################\n");
  printf ("####### Hello World! #######\n");
  printf ("############################\n\n");
  while (1) {
    printf ("$ ");
    char buffer[80];
    read (buffer);
    if (buffer[0] == 't')
      sleep_test ();
    else if (buffer[0] == 'm')
     mem_test();
    else if (buffer[0] == 'r'){
      int ret = read(buffer);
      printf ("\n%i\n", ret);
    } else
      printf ("\n%s\n", buffer);
  }
  for (;;)
    ;
  return 0;
}
Exemplo n.º 3
0
gnum emu_test (gleam_emu_t *emu) {
	gnum ret;
	
	ret = mem_test(emu->mem);
	mem_dump(emu->mem);

	return ret;
}
Exemplo n.º 4
0
static unsigned char ExtRAM_TestOk(void)
{
	unsigned int i;
	unsigned int *ptr = (unsigned int *) EXTRAM_ADDR;
	TRACE_INFO( "External mem addr: %x\n\r", EXTRAM_ADDR);

	return	mem_test((EXTRAM_ADDR), (EXTRAM_ADDR) + 0x4000000 - 0x4, 0) ? 0: 1;
}
Exemplo n.º 5
0
Arquivo: test.cpp Projeto: minnowc/nes
int test(){
    printf("test start!\n");
    op_test();
    mem_test();
    stack_test();
    file_test();
    return 0;
}
Exemplo n.º 6
0
int main(int argc, char const *argv[])
{
	TL.init();
	printf("%s %s",TL.getName(),TL.getVersion());
	printf("\n");
	mem_test();
	dispatch_test();
	return 0;
}
Exemplo n.º 7
0
void test_all(void)
{
//	print_test();
//	jitoa_test();
//	jatoi_test();
	str_test();
	mem_test();

	return;
}
gint
main (gint argc,
      gchar **argv)
{
	myrand = g_rand_new ();
	mem_test ();
	random_test ();
	g_print ("Everything OK\n");

	return 0;
}
Exemplo n.º 9
0
void DHCP_Check (void) {
  /* Monitor DHCP IP address assignment. */

	if (DHCP_TICK == __TRUE) {
		DHCP_TICK = __FALSE;

		if (mem_test(&DEVICE_IP, 0, IP_ADRLEN) == __FALSE && DHCP_SUCCESS == __FALSE) {
			/* Success, DHCP has already got the IP address. */
			DHCP_SUCCESS = __TRUE;
			return;
		}
	}
}
Exemplo n.º 10
0
/*****************************************************************************
** Function name:		void dhcp_check (void)
**
** Descriptions:		verifica se há servidor DHCP na rede, se não houver então
**									configuramos com ip estático
**
** parameters:			None
**
** Returned value:		None
** 
*****************************************************************************/
void dhcp_check (void)
{
	U8 ip[4], mask[4], gateway[4],i;
	
	if (dhcp_tout == 0)
		return; 
	
	if (mem_test (&MY_IP, 0, IP_ADRLEN) == __FALSE  && !(dhcp_tout & 0x80000000)) 
	{
		dhcp_tout = 0;
		tcp_state.bit.dhcp = __TRUE;
		printf("\r[IP (DHCP): %d.%d.%d.%d]\r", MY_IP[0], MY_IP[1], MY_IP[2], MY_IP[3]);
		printf("[MASK: %d.%d.%d.%d]\r", MY_MASK[0], MY_MASK[1], MY_MASK[2], MY_MASK[3]);
		printf("[GATEWAY: %d.%d.%d.%d]\r", MY_GATEWAY[0], MY_GATEWAY[1], MY_GATEWAY[2], MY_GATEWAY[3]);
		fflush (stdout);
		return;
	}

	if (--dhcp_tout == 0) 
	{
		dhcp_disable ();
		dhcp_tout = 30 | 0x80000000;
		printf("\r[DHCP failed]\r" );
		fflush (stdout);
   		return;
  	}

	if (dhcp_tout == 0x80000000)
	{
		inet_aton((U8*)cfg.tcp.static_ip,ip);
		inet_aton((U8*)cfg.tcp.mask,mask);
		inet_aton((U8*)cfg.tcp.gateway,gateway);
		dhcp_tout = 0;
		tcp_state.bit.dhcp = __FALSE;
		for(i=0;i<4;i++)
		{
			MY_IP[i] = ip[i];
			MY_MASK[i] = mask[i];
			MY_GATEWAY[i] = gateway[i];
		}
		
		printf("\r[IP (STATIC): %d.%d.%d.%d]\r", MY_IP[0], MY_IP[1], MY_IP[2], MY_IP[3]);
		printf("[MASK: %d.%d.%d.%d]\r", MY_MASK[0], MY_MASK[1], MY_MASK[2], MY_MASK[3]);
		printf("[GATEWAY: %d.%d.%d.%d]\r", MY_GATEWAY[0], MY_GATEWAY[1], MY_GATEWAY[2], MY_GATEWAY[3]);
		fflush (stdout);
		return;
	}
}
Exemplo n.º 11
0
static int do_mem_mtest(struct command *cmdtp, int argc, char *argv[])
{
	ulong start, end, pattern = 0;

	if (argc < 3)
		return COMMAND_ERROR_USAGE;

	start = simple_strtoul(argv[1], NULL, 0);
	end = simple_strtoul(argv[2], NULL, 0);

	if (argc > 3)
		pattern = simple_strtoul(argv[3], NULL, 0);

	printf ("Testing 0x%08x ... 0x%08x:\n", (uint)start, (uint)end);
	
	return mem_test(start, end, pattern);
}
Exemplo n.º 12
0
gleam_emu_t *emu_new (void) {
	gleam_emu_t *emu = (gleam_emu_t*)malloc(sizeof(gleam_emu_t));

		emu->mem = mem_new();
		if (!emu->mem) {
			DBG("No mem!\n");
			free(emu);
			return 0;
		}

		if (mem_test(emu->mem)) {
			DBG("Mem test failed!\n");
			mem_free(emu->mem);
			free(emu);
			return 0;
		}
		
		emu_rom(emu);
	return emu;
}
Exemplo n.º 13
0
void *pt_final_test(void *args)
{
  final_test_t arg = *(final_test_t *) args; 
  free(args);

  int i;
  int result;
  // once this is set we can no longer send other commands
  running_final_test = 1;
  // now we can unlock our things, since nothing else should use them
  sbc_lock = 0;
  xl3_lock[arg.crate_num] = 0;

  fd_set thread_fdset;
  FD_ZERO(&thread_fdset);
  FD_SET(rw_xl3_fd[arg.crate_num],&thread_fdset);

  char ft_ids[16][250];
  char id_string[16*250];
  JsonNode *ft_docs[16];

  char comments[1000];
  memset(comments,'\0',1000);
  char command_buffer[100];

  system("clear");
  pt_printsend("------------------------------------------\n");
  pt_printsend("Welcome to final test!\nHit enter to start\n");
  read_from_tut(comments);
  pt_printsend("------------------------------------------\n");

  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -x -v",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }
  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}
  pt_printsend("------------------------------------------\n");


  while (rw_sbc_fd <= 0){
    pt_printsend("Attempting to connecting to sbc\n");
    do {
      sprintf(command_buffer,"sbc_control");
    } while (sbc_control(command_buffer) != 0);
    while (sbc_lock != 0){}
  }
  pt_printsend("------------------------------------------\n");

  do {
    sprintf(command_buffer,"mtc_init -x");
    result = mtc_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);

  while (sbc_lock != 0 || xl3_lock[arg.crate_num] != 0){}
  pt_printsend("------------------------------------------\n");
  pt_printsend("If any boards could not initialize properly, type \"quit\" now "
      "to exit the test.\n Otherwise hit enter to continue.\n");
  read_from_tut(comments);
  if (strncmp("quit",comments,4) == 0){
    pt_printsend("Exiting final test\n");
    running_final_test = 0;
    unthread_and_unlock(1,(0x1<<arg.crate_num),arg.thread_num); 
    return;
  }

  // set up the final test documents
  for (i=0;i<16;i++){
    if ((0x1<<i) & arg.slot_mask){
      get_new_id(ft_ids[i]);
      ft_docs[i] = json_mkobject();
      sprintf(id_string+strlen(id_string),"%s ",ft_ids[i]);
      pt_printsend(".%s.\n",id_string);
    }
  }

  pt_printsend("Now starting board_id\n");
  do {
    sprintf(command_buffer,"board_id -c %d -s %04x",arg.crate_num,arg.slot_mask);
    result = board_id(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}
  pt_printsend("-------------------------------------------\n");

  if (arg.skip == 0){

    for (i=0;i<16;i++){
      if ((0x1<<i) & arg.slot_mask){
        pt_printsend("Please enter any comments for slot %i motherboard now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"fec_comments",json_mkstring(comments));
        pt_printsend("Has this slot been refurbished? (y/n)\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"refurbished",json_mkbool(comments[0] == 'y'));
        pt_printsend("Has this slot been cleaned? (y/n)\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"cleaned",json_mkbool(comments[0] == 'y'));
        pt_printsend("Time to measure resistance across analog outs and cmos address lines. For the cmos address lines"
            "it's easier if you do it during the fifo mod\n");
        read_from_tut(comments);
        json_append_member(ft_docs[i],"analog_out_res",json_mkstring(comments));
        pt_printsend("Please enter any comments for slot %i db 0 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db0_comments",json_mkstring(comments));
        pt_printsend("Please enter any comments for slot %i db 1 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db1_comments",json_mkstring(comments));
        pt_printsend("Please enter any comments for slot %i db 2 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db2_comments",json_mkstring(comments));
        pt_printsend("Please enter any comments for slot %i db 3 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db3_comments",json_mkstring(comments));
        pt_printsend("Please enter dark matter measurements for slot %i db 0 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db0_dark_matter",json_mkstring(comments));
        pt_printsend("Please enter dark matter measurements for slot %i db 1 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db1_dark_matter",json_mkstring(comments));
        pt_printsend("Please enter dark matter measurements for slot %i db 2 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db2_dark_matter",json_mkstring(comments));
        pt_printsend("Please enter dark matter measurements for slot %i db 3 now.\n",i);
        read_from_tut(comments);
        json_append_member(ft_docs[i],"db3_dark_matter",json_mkstring(comments));
      }
    }


    pt_printsend("Enter N100 DC offset\n");
    read_from_tut(comments);
    for (i=0;i<16;i++){
      if ((0x1<<i) & arg.slot_mask){
        json_append_member(ft_docs[i],"dc_offset_n100",json_mkstring(comments));
      }
    }
    pt_printsend("Enter N20 DC offset\n");
    read_from_tut(comments);
    for (i=0;i<16;i++){
      if ((0x1<<i) & arg.slot_mask){
        json_append_member(ft_docs[i],"dc_offset_n20",json_mkstring(comments));
      }
    }
    pt_printsend("Enter esum hi DC offset\n");
    read_from_tut(comments);
    for (i=0;i<16;i++){
      if ((0x1<<i) & arg.slot_mask){
        json_append_member(ft_docs[i],"dc_offset_esumhi",json_mkstring(comments));
      }
    }
    pt_printsend("Enter esum lo DC offset\n");
    read_from_tut(comments);
    for (i=0;i<16;i++){
      if ((0x1<<i) & arg.slot_mask){
        json_append_member(ft_docs[i],"dc_offset_esumlo",json_mkstring(comments));
      }
    }

    pt_printsend("Thank you. Please hit enter to continue with the rest of final test. This may take a while.\n");
    read_from_tut(comments);
  }

  // starting the tests
  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"fec_test -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = fec_test(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"vmon -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = vmon(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"cgt_test_1 -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = cgt_test(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  //////////////////////////////////////////////////////////////
  // now gotta turn pulser on and off to get rid of garbage
  //sprintf(command_buffer,"readout_add_mtc -c %d -f 0",arg.crate_num);
  //readout_add_mtc(command_buffer);
  //sprintf(command_buffer,"stop_pulser");
  //stop_pulser(command_buffer);
  //////////////////////////////////////////////////////////////

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"ped_run -c %d -s %04x -l 300 -u 1000 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = ped_run(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}


  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_cbal -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = crate_cbal(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  //////////////////////////////////////////////////////////////
  // now gotta turn pulser on and off to get rid of garbage
  //sprintf(command_buffer,"readout_add_mtc -c %d -f 0",arg.crate_num);
  //readout_add_mtc(command_buffer);
  //sprintf(command_buffer,"stop_pulser");
  //stop_pulser(command_buffer);
  //////////////////////////////////////////////////////////////

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -B",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"ped_run -c %d -s %04x -b -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = ped_run(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"chinj_scan -c %d -s %04x -l 400 -u 5000 -w 100 -n 10 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = chinj_scan(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  if (arg.tub_tests == 1){
    pt_printsend("You should now connect the cable to ext_ped for ttot tests\nHit enter when ready\n");
    read_from_tut(comments);
    do {
      sprintf(command_buffer,"set_ttot -c %d -s %04x -t 400 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
      result = set_ttot(command_buffer);
      if (result == -2 || result == -3){
        return;
      }

    } while (result != 0);
    while (xl3_lock[arg.crate_num] != 0){}
  }




  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -B -D",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  if (arg.tub_tests == 1){
    do {
      sprintf(command_buffer,"get_ttot -c %d -s %04x -t 390 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
      result = get_ttot(command_buffer);
      if (result == -2 || result == -3){
        return;
      }

    } while (result != 0);
    while (xl3_lock[arg.crate_num] != 0){}
  }

  pt_printsend("-------------------------------------------\n");
  pt_printsend("You should now disconnect the cable to ext_ped\nHit enter when ready\n");
  read_from_tut(comments);
  do {
    sprintf(command_buffer,"disc_check -c %d -s %04x -n 500000 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = disc_check(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"cmos_m_gtvalid -c %d -s %04x -g 400 -n -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = cmos_m_gtvalid(command_buffer); 
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  // would put see_reflections here

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"zdisc -c %d -s %04x -o 0 -r 100 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = zdisc(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"mtc_init");
    result = mtc_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (sbc_lock != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -x",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do{
    sprintf(command_buffer,"mb_stability_test -c %d -s %04x -n 50 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = mb_stability_test(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"fifo_test -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = fifo_test(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -X",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"cald_test -c %d -s %04x -l 750 -u 3500 -n 200 -d -# %s",arg.crate_num,arg.slot_mask,id_string);
    result = cald_test(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  for (i=0;i<16;i++){
    if ((0x1<<i) & arg.slot_mask){
      do {

        pt_printsend("-------------------------------------------\n");
        do {
          sprintf(command_buffer,"crate_init -c %d -s %04x -x",arg.crate_num,arg.slot_mask);
          result = crate_init(command_buffer);
          if (result == -2 || result == -3){
            return;
          }

        } while (result != 0);
        while (xl3_lock[arg.crate_num] != 0){}

        pt_printsend("-------------------------------------------\n");

        sprintf(command_buffer,"mem_test -c %d -s %d -d -# %s",arg.crate_num,i,ft_ids[i]);
        result = mem_test(command_buffer);
        if (result == -2 || result == -3){
          return;
        }

      } while (result != 0);
      while (xl3_lock[arg.crate_num] != 0){}
    }
  }

  pt_printsend("-------------------------------------------\n");
  do {
    sprintf(command_buffer,"crate_init -c %d -s %04x -x",arg.crate_num,arg.slot_mask);
    result = crate_init(command_buffer);
    if (result == -2 || result == -3){
      return;
    }

  } while (result != 0);
  while (xl3_lock[arg.crate_num] != 0){}

  pt_printsend("-------------------------------------------\n");
  pt_printsend("Ready for see_refl test. Hit enter to begin or type \"skip\" to end the final test.\n");
  read_from_tut(comments);
  if (strncmp("skip",comments,4) != 0){
    do {
      sprintf(command_buffer,"see_refl -c %d -s %04x -d -# %s",arg.crate_num,arg.slot_mask,id_string);
      result = see_refl(command_buffer);
      if (result == -2 || result == -3){
        return;
      }

    } while (result != 0);
    while (xl3_lock[arg.crate_num] != 0){}
  }



  pt_printsend("-------------------------------------------\n");
  pt_printsend("Final test finished. Now updating the database.\n");

  // update the database
  for (i=0;i<16;i++){
    if ((0x1<<i) & arg.slot_mask){
      json_append_member(ft_docs[i],"type",json_mkstring("final_test"));
      pthread_mutex_lock(&socket_lock);
      xl3_lock[arg.crate_num] = 1; // we gotta lock this shit down before we call post_doc
      pthread_mutex_unlock(&socket_lock);
      post_debug_doc_with_id(arg.crate_num, i, ft_ids[i], ft_docs[i],&thread_fdset);
      json_delete(ft_docs[i]);
    }
  }

  pt_printsend("-------------------------------------------\n");



  running_final_test = 0;
  unthread_and_unlock(1,(0x1<<arg.crate_num),arg.thread_num); 
}
Exemplo n.º 14
0
int main()
{
  mem_test(0xff);
  mem_test2();
  return 0;
}
Exemplo n.º 15
0
void start_armboot (void)
{
  	init_fnc_t **init_fnc_ptr;
	uchar *buf;
	char boot_dev_name[8];
	u32 si_type, omap4_rev;
	int len = 0;
	u8 val = SWITCH_OFF;
	image_type image;
 
   	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
		if ((*init_fnc_ptr)() != 0) {
			hang ();
		}
	}

	image.image = 2;
        image.val =99;

	omap4_rev = omap_revision();
	if (omap4_rev >= OMAP4460_ES1_0) {
		omap_temp_sensor_check();
		if (omap4_rev == OMAP4470_ES1_0) {
			writel(((TSHUT_HIGH_ADC_CODE << 16) |
			TSHUT_COLD_ADC_CODE), CORE_TSHUT_THRESHOLD);
			MV1(WK(CONTROL_SPARE_RW) , (M1));
		}
		si_type = omap4_silicon_type();
		if (si_type == PROD_ID_1_SILICON_TYPE_HIGH_PERF)
			printf("OMAP4470: 1.5 GHz capable SOM\n");
		else if (si_type == PROD_ID_1_SILICON_TYPE_STD_PERF)
			printf("OMAP4470: 1.3 GHz capable SOM\n");
	}
#ifdef CONFIG_USBBOOT_ERASER
	/* Erase mlo and poweroff */
	mlo_erase();
#else

#ifdef CONFIG_USBBOOT
	/*usb boot does not check power button */
	printf("boot_device=0x%x boot_mode=0x%x\n", get_boot_device(), get_boot_mode());
	printf("id_code=%08x\n", readl(CONTROL_ID_CODE));
#endif

#ifdef CONFIG_USBOOT_MEMTEST
	/* the device will power off after the test */
	mem_test();
	/*power off  PMIC */
	printf("Memtest done, powering off!\n");
	select_bus(CFG_I2C_BUS, CFG_I2C_SPEED);
	val = SWITCH_OFF;
	i2c_write(TWL6030_PMC_ID, PHOENIX_DEV_ON, 1, &val, 1);
	/* we should never get here */
	hang();
#endif

#ifdef START_LOADB_DOWNLOAD
	strcpy(boot_dev_name, "UART");
	do_load_serial_bin (CFG_LOADADDR, 115200);
#else
	buf = (uchar *) (CFG_LOADADDR - 0x120);
	image.data = (uchar *) (CFG_LOADADDR - 0x120);

	switch (get_boot_device()) {
#ifdef CONFIG_USBBOOT
	case 0x45:
		printf("boot_dev=USB\n");
		strcpy(boot_dev_name, "USB");
		/* read data from usb and write to sdram */
		if (usb_read_bootloader(&len) != 0) {
			hang();
		}
		printf("usb read len=%d\n", len);
		break;
#else
	case 0x03:
		strcpy(boot_dev_name, "ONENAND");
#if defined(CFG_ONENAND)
		for (i = ONENAND_START_BLOCK; i < ONENAND_END_BLOCK; i++) {
			if (!onenand_read_block(buf, i))
				buf += ONENAND_BLOCK_SIZE;
			else
				goto error;
		}
#endif
		break;
	case 0x02:
	default:
		strcpy(boot_dev_name, "NAND");
#if defined(CFG_NAND)
		for (i = NAND_UBOOT_START; i < NAND_UBOOT_END;
				i+= NAND_BLOCK_SIZE) {
			if (!nand_read_block(buf, i))
				buf += NAND_BLOCK_SIZE; /* advance buf ptr */
		}
#endif
		break;
	case 0x05:
		strcpy(boot_dev_name, "MMC/SD1");
#if defined(CONFIG_MMC)
		if (mmc_read_bootloader(0) != 0)
			goto error;
#endif
		break;
	case 0x06:
		strcpy(boot_dev_name, "EMMC");
#if defined(CONFIG_MMC)
		if (mmc_read_bootloader(1) != 0)
			goto error;
#endif
		break;
#endif	/* CONFIG_USBBOOT */
	};
#endif
	SEC_ENTRY_Std_Ppa_Call ( PPA_SERV_HAL_BN_CHK , 1 , &image );
 
	if ( image.val == 0 ) {
		/* go run U-Boot and never return */
		printf("Starting OS Bootloader from %s ...\n", boot_dev_name);
		((init_fnc_t *)CFG_LOADADDR)();
	}

	/* should never come here */
#if defined(CFG_ONENAND) || defined(CONFIG_MMC)
error:
#endif
	printf("Could not read bootloader!\n");
	hang();
#endif   /* CONFIG_USBBOOT_ERASER */	
}
Exemplo n.º 16
0
int
main (int argc, char **argv)
{
  int i;
  char *endptr;

  if (argc <= 2)
    usage();

  max_allocation = strtol (argv[1], &endptr, 10);
  if (endptr == argv[1])
    usage();

  g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);

  /* memory tests */

  /* How do the loaders behave when memory is low?
     It depends on the state the above tests left the
     memory in.

     - Sometimes the png loader tries to report an
       "out of memory", but then g_strdup_printf() calls
       g_malloc(), which fails.

     - There are unchecked realloc()s inside libtiff, which means it
       will never work with low memory, unless something drastic is
       done, like allocating a lot of memory upfront and release it
       before entering libtiff.  Also, some TIFFReadRGBAImage calls
       returns successfully, even though they have called the error
       handler with an 'out of memory' message.
  */

  almost_exhaust_memory ();

  g_print ("Allocated %dK of %dK, %dK free during tests\n",
           current_allocation / 1024, max_allocation / 1024,
           (max_allocation - current_allocation) / 1024);

  for (i = 2; i < argc; ++i)
    {
      gchar *contents;
      gsize size;
      GError *err = NULL;

      if (!g_file_get_contents (argv[i], &contents, &size, &err))
	{
	  g_print ("couldn't read %s: %s\n", argv[i], err->message);
	  exit (EXIT_FAILURE);
	}
      else
	{
	  g_print ("%-40s memory            ", argv[i]);
	  fflush (stdout);
	  mem_test (contents, size);
	  g_print ("\tpassed\n");
	  g_free (contents);
	}
    }
  
  return 0;
}
Exemplo n.º 17
0
    /**< 32bit Loopback test */
    {
        uint32_t * p_uint32_t = (uint32_t *)address;
        for(i=0; i<size/sizeof(uint32_t); i++)
        {
            *p_uint32_t  = (uint32_t)p_uint32_t;
            *p_uint32_t++;
        }

        p_uint32_t = (uint32_t *)address;
        for(i=0; i<size/sizeof(uint32_t); i++)
        {
            if( *p_uint32_t != (uint32_t)p_uint32_t )
            {
                rt_kprintf("32bit Loopback test fail @ 0x%08X", (uint32_t)p_uint32_t);
                rt_kprintf(" data:0x%08X \r\n", (uint32_t)*p_uint32_t);
                rt_kprintf("system halt!!!!!",(uint32_t)p_uint32_t);
                while(1);
            }
            p_uint32_t++;
        }
        rt_kprintf("32bit Loopback test pass!!\r\n");
    }
}

#ifdef RT_USING_FINSH
#include <finsh.h>
FINSH_FUNCTION_EXPORT(mem_test, mem_test(0xA0000000, 0x00100000)  );
#endif