OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [common/] [common.c] - Diff between revs 2 and 140

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 140
Line 25... Line 25...
  case CT_NONE:
  case CT_NONE:
    break;
    break;
  case CT_UART:
  case CT_UART:
    uart_putc (c);
    uart_putc (c);
    break;
    break;
#ifdef CRT_ENABLED
#if CRT_ENABLED==1
  case CT_CRT:
  case CT_CRT:
#endif
 
    screen_putc (c);
    screen_putc (c);
    break;
    break;
 
#endif
  case CT_SIM:
  case CT_SIM:
    __printf ("%c", c);
    __printf ("%c", c);
    break;
    break;
  }
  }
}
}
Line 41... Line 41...
int getc ()
int getc ()
{
{
  int ch = 0;
  int ch = 0;
  debug ("getc %i\n", bd.bi_console_type);
  debug ("getc %i\n", bd.bi_console_type);
  switch (bd.bi_console_type) {
  switch (bd.bi_console_type) {
#if KBD_ENABLED
#if KBD_ENABLED==1
  case CT_CRT:
  case CT_CRT:
    while ((volatile int)kbd_head == (volatile int)kbd_tail);
    while ((volatile int)kbd_head == (volatile int)kbd_tail);
    ch = kbd_buf[kbd_tail];
    ch = kbd_buf[kbd_tail];
    kbd_tail = (kbd_tail + 1) % KBDBUF_SIZE;
    kbd_tail = (kbd_tail + 1) % KBDBUF_SIZE;
    return ch;
    return ch;
Line 123... Line 123...
    break;
    break;
  case CT_UART:
  case CT_UART:
    uart_init ();
    uart_init ();
    break;
    break;
  case CT_CRT:
  case CT_CRT:
#if CRT_ENABLED
#if CRT_ENABLED==1
    screen_init ();
    screen_init ();
#endif
#endif
#if KBD_ENABLED
#if KBD_ENABLED
    kbd_init ();
    kbd_init ();
#endif
#endif
Line 226... Line 226...
  }
  }
 
 
}
}
 
 
#if HELP_ENABLED
#if HELP_ENABLED
 
extern unsigned long src_addr; // Stack section ends here
/* Displays help screen */
/* Displays help screen */
int help_cmd (int argc, char *argv[])
int help_cmd (int argc, char *argv[])
{
{
  int i;
  int i;
  for (i = 0; i < num_commands; i++)
  for (i = 0; i < num_commands; i++)
    printf ("%-10s %-20s - %s\n", command[i].name, command[i].params, command[i].help);
    printf ("%-10s %-20s - %s\n", command[i].name, command[i].params, command[i].help);
 
 
 
  // Build info....
 
  printf("Info: CPU@ %dMHz", IN_CLK/1000000);
 
#if IC_ENABLE==1
 
  printf(" IC=%dB",IC_SIZE);
 
#endif
 
#if DC_ENABLE==1
 
  printf(" DC=%dB",DC_SIZE);
 
#endif
 
  printf("\n");
 
  printf("Info: Stack section addr 0x%x\n",(unsigned long) &src_addr);
 
  printf("Build tag: %s", BUILD_VERSION);
 
 
  return 0;
  return 0;
}
}
#endif /* HELP_ENABLED */
#endif /* HELP_ENABLED */
 
 
void module_cpu_init (void);
void module_cpu_init (void);
Line 265... Line 279...
  global.eth_add[5] = ETH_MACADDR5;
  global.eth_add[5] = ETH_MACADDR5;
  global.ip = BOARD_DEF_IP;
  global.ip = BOARD_DEF_IP;
  global.gw_ip = BOARD_DEF_GW;
  global.gw_ip = BOARD_DEF_GW;
  global.mask = BOARD_DEF_MASK;
  global.mask = BOARD_DEF_MASK;
 
 
 
#define CPU_CMDS
 
#define MEM_CMDS
 
#define DHRY_CMDS
 
  //#define CAMERA_CMDS
 
#define LOAD_CMDS
 
    //#define TOUCHSCREEN_CMDS
 
    //#define ATA_CMDS
 
    //#define HDBUG_CMDS
 
#define TICK_CMDS
 
#define ETH_CMDS
 
#define LOAD_CMDS
 
 
  /* Init modules */
  /* Init modules */
 
#ifdef CPU_CMDS
  module_cpu_init ();
  module_cpu_init ();
 
#endif
 
#ifdef MEM_CMDS
  module_memory_init ();
  module_memory_init ();
 
#endif
 
#ifdef ETH_CMDS
  module_eth_init ();
  module_eth_init ();
 
#endif
 
#ifdef DHRY_CMDS
  module_dhry_init ();
  module_dhry_init ();
 
#endif
 
#ifdef CAMERA_CMDS
  module_camera_init ();
  module_camera_init ();
 
#endif
 
#ifdef LOAD_CMDS
  module_load_init ();
  module_load_init ();
 
#endif
 
#ifdef TOUCHSCREEN_CMDS
  module_touch_init ();
  module_touch_init ();
 
#endif
 
#ifdef ATA_CMDS
  module_ata_init ();
  module_ata_init ();
 
#endif
 
#ifdef HDBUG_CMDS
  module_hdbug_init ();
  module_hdbug_init ();
 
#endif
 
 
  tick_init();
  tick_init();
}
 
 
 
 
}
 
int tboot_cmd (int argc, char *argv[]);
/* Main shell loop */
/* Main shell loop */
int main(int argc, char **argv)
int main(int argc, char **argv)
{
{
  extern unsigned long calc_mycrc32 (void);
  extern unsigned long calc_mycrc32 (void);
#if 0
#if 0
  extern unsigned long mycrc32, mysize;
  extern unsigned long mycrc32, mysize;
#endif
#endif
 
  timestamp = 0; // clear timer counter
 
 
  int_init ();
  int_init ();
  change_console_type (CONSOLE_TYPE);
  change_console_type (CONSOLE_TYPE);
  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE);
  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE);
 
 
Line 298... Line 344...
  if ((t = calc_mycrc32 ()))
  if ((t = calc_mycrc32 ()))
      printf ("FAILED!!!\n");
      printf ("FAILED!!!\n");
  else
  else
      printf ("OK\n");
      printf ("OK\n");
#endif /* SELF_CHECK */
#endif /* SELF_CHECK */
 
  num_commands=0;
  mon_init ();
  mon_init ();
 
 
  if (HELP_ENABLED) register_command ("help", "", "shows this help", help_cmd);
  if (HELP_ENABLED) register_command ("help", "", "shows this help", help_cmd);
 
 
#ifdef XESS
#ifdef XESS
  printf ("\nORP-XSV Monitor (type 'help' for help)\n");
  printf ("\nORP-XSV Monitor (type 'help' for help)\n");
#else
#else
  printf ("\n" BOARD_DEF_NAME " Monitor (type 'help' for help)\n");
  printf ("\n" BOARD_DEF_NAME " monitor (type 'help' for help)\n");
 
  printf("\tbuild: %s", BUILD_VERSION);
#endif
#endif
 
 
  while(1) mon_command();
  while(1) mon_command();
 
  // Run tboot in sim for now:  tboot_cmd (0,0);
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.