Changeset 7cdabc49 in rtems


Ignore:
Timestamp:
Dec 14, 2014, 10:27:06 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
cfe6d05
Parents:
09220c8
git-author:
Joel Sherrill <joel.sherrill@…> (12/14/14 22:27:06)
git-committer:
Joel Sherrill <joel.sherrill@…> (01/04/15 19:44:57)
Message:

pc386: Add Edison base support

The current support for the Edison supports a single polled
UART for input and output plus a simulated clock tick. The
activities forward for supporting the Edison have been posted
on the RTEMS mailing lists and at:

http://rtemsramblings.blogspot.com/2014/12/intel-edison-and-rtems-road-forward.html

Location:
c/src/lib/libbsp/i386/pc386
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/Makefile.am

    r09220c8 r7cdabc49  
    6969
    7070# clock
     71if RTEMS_EDISON
     72libbsp_a_SOURCES += ../../shared/clock_driver_simidle.c
     73else
    7174libbsp_a_SOURCES += clock/ckinit.c
     75endif
     76libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
    7277libbsp_a_SOURCES += clock/todcfg.c
    7378libbsp_a_SOURCES += ../../shared/tod.c
    74 libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
    7579
    7680include_rtemsdir = $(includedir)/rtems
     
    8185include_rtems_HEADERS += console/kd.h
    8286include_rtems_HEADERS += console/ps2_drv.h
    83 include_rtems_HEADERS += ../../shared/console_private.h
    8487include_rtems_HEADERS += console/vgacons.h
    8588libbsp_a_SOURCES += console/inch.c
     
    109112
    110113# console (non-graphics support)
     114if RTEMS_EDISON
     115libbsp_a_SOURCES += console/console_edison.c
     116endif
    111117include_HEADERS += ../../i386/shared/comm/i386_io.h
     118include_rtems_HEADERS += ../../shared/console_private.h
    112119libbsp_a_SOURCES += console/serial_mouse_config.c
    113120libbsp_a_SOURCES += ../../i386/shared/comm/uart.c
  • c/src/lib/libbsp/i386/pc386/configure.ac

    r09220c8 r7cdabc49  
    1818RTEMS_CHECK_SMP
    1919
     20# Is this an Intel Edison?
     21# NOTE: As we learn more, this could be trimmed if more issues
     22#       turn out fo lack of legacy peripherals
     23RTEMS_BSPOPTS_SET([BSP_IS_EDISON],[edison],[1])
     24RTEMS_BSPOPTS_SET([BSP_IS_EDISON],[*],[0])
     25RTEMS_BSPOPTS_HELP([BSP_IS_EDISON],[Set if the BSP variant is Intel Edison.])
     26AM_CONDITIONAL(RTEMS_EDISON,[test "$BSP_IS_EDISON" = "1"])
     27
     28RTEMS_BSPOPTS_SET([BSP_ENABLE_VGA],[edison],[0])
    2029RTEMS_BSPOPTS_SET([BSP_ENABLE_VGA],[*],[1])
    2130RTEMS_BSPOPTS_HELP([BSP_ENABLE_VGA],
     
    2837AM_CONDITIONAL(RTEMS_VGA,[test "$BSP_ENABLE_COM1_COM4" = "1"])
    2938
     39RTEMS_BSPOPTS_SET([BSP_ENABLE_IDE],[edison],[0])
    3040RTEMS_BSPOPTS_SET([BSP_ENABLE_IDE],[*],[1])
    3141RTEMS_BSPOPTS_HELP([BSP_ENABLE_IDE],
  • c/src/lib/libbsp/i386/pc386/console/conscfg.c

    r09220c8 r7cdabc49  
    6161#endif
    6262
     63#if (BSP_IS_EDISON == 1 )
     64  extern const console_fns edison_fns;
     65#endif
     66
    6367console_tbl     Console_Configuration_Ports[] = {
     68#if (BSP_IS_EDISON == 1)
     69  {
     70    "/dev/vgacons",                        /* sDeviceName */
     71    -1,                                     /* deviceType */
     72    &edison_fns,                           /* pDeviceFns */
     73    NULL,                                  /* deviceProbe */
     74    NULL,                                  /* pDeviceFlow */
     75    16,                                    /* ulMargin */
     76    8,                                     /* ulHysteresis */
     77    (void *) NULL,              /* NULL */ /* pDeviceParams */
     78    0x00000000,                            /* ulCtrlPort1 */
     79    0x00000000,                            /* ulCtrlPort2 */
     80    0x00000000,                            /* ulDataPort */
     81    NULL,                                  /* getRegister */
     82    NULL,                                  /* setRegister */
     83    NULL,/* unused */                      /* getData */
     84    NULL,/* unused */                      /* setData */
     85    0X0,                                   /* ulClock */
     86    0x0                                     /* ulIntVector -- base for port */
     87  },
     88#endif
    6489#if BSP_ENABLE_VGA
    6590  {
  • c/src/lib/libbsp/i386/pc386/console/printk_support.c

    r09220c8 r7cdabc49  
    2929
    3030rtems_device_minor_number         BSPPrintkPort = 0;
     31
     32#if (BSP_IS_EDISON == 1)
     33void edison_write_polled(int minor, char cChar); /* XXX */
     34int edison_inbyte_nonblocking_polled(int minor);
     35#endif
    3136
    3237#if BSP_ENABLE_COM1_COM4
     
    6772    }
    6873  #endif
     74  #if (BSP_IS_EDISON == 1)
     75    do {
     76      result = edison_inbyte_nonblocking_polled( BSPPrintkPort );
     77    } while (result == -1);
     78  #endif
    6979  return result;
    7080}
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r09220c8 r7cdabc49  
    190190void bsp_size_memory(void);              /* from 'bspstart.c' */
    191191
    192 void Clock_driver_install_handler(void); /* from 'ckinit.c'  */
    193 void Clock_driver_support_initialize_hardware(void); /* from 'ckinit.c'  */
     192#if (BSP_IS_EDISON == 0)
     193  void Clock_driver_install_handler(void);             /* from 'ckinit.c'  */
     194  void Clock_driver_support_initialize_hardware(void); /* from 'ckinit.c'  */
     195#else
     196  /**
     197   *  @defgroup edison_bsp Clock Tick Support
     198   *
     199   *  @ingroup i386_pc386
     200   *
     201   *  @brief Clock Tick Support Package
     202   */
     203   Thread clock_driver_sim_idle_body(uintptr_t);
     204   #define BSP_IDLE_TASK_BODY clock_driver_sim_idle_body
     205  /* 
     206   * hack to kill some time. Hopefully hitting a hardware register is slower
     207   * than an empty loop.
     208   */
     209  #define BSP_CLOCK_DRIVER_DELAY() \
     210    do { \
     211      uint64_t _i = 2500000; \
     212      while (_i) { \
     213        _i--; \
     214      } \
     215    } while ( 0 )
     216#endif /* edison */
    194217
    195218void kbd_reset_setup(char *str, int *ints);   /* from 'pc_keyb.c' */
  • c/src/lib/libbsp/i386/pc386/preinstall.am

    r09220c8 r7cdabc49  
    137137PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/ps2_drv.h
    138138
    139 $(PROJECT_INCLUDE)/rtems/console_private.h: ../../shared/console_private.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    140         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/console_private.h
    141 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/console_private.h
    142 
    143139$(PROJECT_INCLUDE)/rtems/vgacons.h: console/vgacons.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    144140        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/vgacons.h
     
    165161PREINSTALL_FILES += $(PROJECT_INCLUDE)/i386_io.h
    166162
     163$(PROJECT_INCLUDE)/rtems/console_private.h: ../../shared/console_private.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     164        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/console_private.h
     165PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/console_private.h
     166
    167167$(PROJECT_INCLUDE)/pcibios.h: ../../i386/shared/pci/pcibios.h $(PROJECT_INCLUDE)/$(dirstamp)
    168168        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pcibios.h
  • c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c

    r09220c8 r7cdabc49  
    5757  uintptr_t topAddr;
    5858
     59#if (BSP_IS_EDISON == 0)
    5960  /* Set the value of start of free memory. */
    6061  rtemsWorkAreaStart = (uint32_t)WorkAreaBase + _stack_size;
     
    117118  }
    118119
     120#else
     121    topAddr = (1 * 1024 * 1024 * 1024);
     122#endif
    119123 
    120124  bsp_mem_size = topAddr;
  • c/src/lib/libbsp/i386/pc386/startup/bspreset.c

    r09220c8 r7cdabc49  
    1515{
    1616  /* shutdown and reboot */
    17   outport_byte(0x64, 0xFE);      /* use keyboard controler to do the job... */
     17  #if (BSP_IS_EDISON == 0)
     18    outport_byte(0x64, 0xFE);        /* use keyboard controller */
     19  #else
     20   *((uint32_t*)0xff009000) = 0xf3;  /* use watchdog */
     21  #endif
    1822}
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r09220c8 r7cdabc49  
    3535
    3636/*
    37  *  External routines
     37 * Helper to initialize the PCI Bus
    3838 */
    39 void Clock_driver_install_handler(void);
     39static void bsp_pci_initialize_helper(void)
     40{
     41#if (BSP_IS_EDISON == 0)
     42  int pci_init_retval;
     43
     44  pci_init_retval = pci_initialize();
     45  if (pci_init_retval != PCIB_ERR_SUCCESS) {
     46      printk("PCI bus: could not initialize PCI BIOS interface\n");
     47  }
     48#endif
     49}
    4050
    4151/*-------------------------------------------------------------------------+
     
    4858static void bsp_start_default( void )
    4959{
    50   int pci_init_retval;
    51 
    5260  /*
    5361   *  We need to determine how much memory there is in the system.
     
    5664
    5765  /*
     66   * Turn off watchdog
     67   */
     68#if (BSP_IS_EDISON == 1)
     69  volatile uint32_t *edison_wd = (volatile uint32_t *)0xff009000;
     70  *edison_wd = 0x11f8;
     71#endif
     72
     73
     74  /*
    5875   * Calibrate variable for 1ms-loop (see timer.c)
    5976   */
     77#if (BSP_IS_EDISON == 0)
    6078  Calibrate_loop_1ms();
     79#endif
    6180
    6281  /*
     
    7392   * init PCI Bios interface...
    7493   */
    75   pci_init_retval = pci_initialize();
    76   if (pci_init_retval != PCIB_ERR_SUCCESS) {
    77       printk("PCI bus: could not initialize PCI BIOS interface\n");
    78   }
     94  bsp_pci_initialize_helper();
    7995
     96#if (BSP_IS_EDISON == 0)
    8097  Clock_driver_install_handler();
     98#endif
    8199
    82100#if BSP_ENABLE_IDE
  • c/src/lib/libbsp/i386/pc386/startup/ldsegs.S

    r09220c8 r7cdabc49  
    3636#include <rtems/asm.h>
    3737#include <bsp/tblsizes.h> /* contains sizes of GDT and IDT */
     38#include <bspopts.h>
    3839
    3940/*----------------------------------------------------------------------------+
     
    110111        movw ax, gs
    111112
     113#if (BSP_IS_EDISON == 0)
    112114/*---------------------------------------------------------------------+
    113115| Now we have to reprogram the interrupts :-(. We put them right after
     
    155157        movw    $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
    156158
     159  #endif
    157160        jmp     SYM (_establish_stack)  # return to the bsp entry code
    158161
Note: See TracChangeset for help on using the changeset viewer.