Changeset 837a1323 in rtems


Ignore:
Timestamp:
Feb 20, 2003, 9:45:49 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
e7625fc6
Parents:
422d561d
Message:

2003-02-20 Till Straumann <strauman@…>

PR 349/bsps

  • startup/pgtbl_setup.c, startup/pgtbl_activate.c: New files
  • startup/Makefile.am, startup/bspstart.c, startup/linkcmds: Let the powerpc/shared (+derived) BSPs use pagetable support

from libcpu.

Location:
c/src/lib/libbsp/powerpc/shared
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/ChangeLog

    r422d561d r837a1323  
     12003-02-20      Till Straumann <strauman@slac.stanford.edu>
     2
     3        PR 349/bsps
     4        * startup/pgtbl_setup.c, startup/pgtbl_activate.c: New files
     5        * startup/Makefile.am, startup/bspstart.c, startup/linkcmds:
     6        Let the powerpc/shared (+derived) BSPs use pagetable support
     7        from libcpu.
     8
    192003-02-20      Till Straumann <strauman@slac.stanford.edu>
    210
  • c/src/lib/libbsp/powerpc/shared/startup/Makefile.am

    r422d561d r837a1323  
    44
    55
    6 C_FILES = bspstart.c
     6C_FILES = bspstart.c pgtbl_setup.c pgtbl_activate.c
    77
    88noinst_DATA = linkcmds
    99
    10 EXTRA_DIST = bspstart.c linkcmds
     10EXTRA_DIST = bspstart.c linkcmds  pgtbl_setup.c pgtbl_activate.c
    1111
    1212include $(top_srcdir)/../../../../../automake/local.am
  • c/src/lib/libbsp/powerpc/shared/startup/bspstart.c

    r422d561d r837a1323  
    2828#include <bsp/openpic.h>
    2929#include <bsp/irq.h>
     30#include <bsp/VME.h>
    3031#include <bsp.h>
    3132#include <libcpu/bat.h>
     33#include <libcpu/pte121.h>
    3234#include <libcpu/cpuIdent.h>
    3335#include <bsp/vectors.h>
     
    4244extern void set_L2CR(unsigned);
    4345extern void bsp_cleanup(void);
     46extern Triv121PgTbl BSP_pgtbl_setup();
     47extern void                     BSP_pgtbl_activate();
     48extern void                     BSP_vme_config();
     49
     50SPR_RW(SPR0)
     51SPR_RW(SPR1)
     52
    4453/*
    4554 * Copy of residuals passed by firmware
     
    174183  prep_t boardManufacturer;
    175184  motorolaBoard myBoard;
     185  Triv121PgTbl  pt=0;
    176186  /*
    177187   * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
     
    218228  *((unsigned32 *)intrStack) = 0;
    219229
    220   asm volatile ("mtspr  273, %0" : "=r" (intrStack) : "0" (intrStack));
    221   asm volatile ("mtspr  272, %0" : "=r" (intrNestingLevel) : "0" (intrNestingLevel));
     230  _write_SPR1((unsigned int)intrStack);
     231  _write_SPR0(intrNestingLevel);
    222232  /*
    223233   * Initialize default raw exception hanlders. See vectors/vectors_init.c
     
    232242   * compatible hardware
    233243   */
    234   setdbat(1, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
     244  setdbat(1, _IO_BASE, _IO_BASE, 0x10000000, IO_PAGE);
    235245  /*
    236246   * PCI devices memory area. Needed to access OPENPIC features
     
    238248   */
    239249  /* T. Straumann: give more PCI address space */
    240   setdbat(2, 0xc0000000, 0xc0000000, 0x10000000, IO_PAGE);
     250  setdbat(2, PCI_MEM_BASE, PCI_MEM_BASE, 0x10000000, IO_PAGE);
    241251  /*
    242252   * Must have acces to open pic PCI ACK registers
    243253   * provided by the RAVEN
     254   *
    244255   */
    245256  setdbat(3, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
     257
    246258  select_console(CONSOLE_LOG);
    247259
     
    305317  BSP_time_base_divisor                 = (residualCopy.VitalProductData.TimeBaseDivisor?
    306318                                           residualCopy.VitalProductData.TimeBaseDivisor : 4000);
     319
     320  /* Allocate and set up the page table mappings
     321   * This is only available on >604 CPUs.
     322   *
     323   * NOTE: This setup routine may modify the available memory
     324   *       size. It is essential to call it before
     325   *       calculating the workspace etc.
     326   */
     327  pt = BSP_pgtbl_setup(&BSP_mem_size);
     328
     329  if (!pt ||
     330          TRIV121_MAP_SUCCESS != triv121PgTblMap(
     331                                                                                pt,
     332                                                                                TRIV121_121_VSID,
     333                                                                                0xfeff0000,
     334                                                                                1,
     335                                                                                TRIV121_ATTR_IO_PAGE,
     336                                                                                TRIV121_PP_RW_PAGE
     337                                                                                )) {
     338        printk("WARNING: unable to setup page tables VME bridge must share PCI space\n");
     339  }
    307340 
    308341  /*
     
    336369   */
    337370  BSP_rtems_irq_mng_init(0);
     371
     372 
     373  /* Activate the page table mappings only after
     374   * initializing interrupts because the irq_mng_init()
     375   * routine needs to modify the text
     376   */           
     377  if (pt) {
     378#ifdef  SHOW_MORE_INIT_SETTINGS
     379    printk("Page table setup finished; will activate it NOW...\n");
     380#endif
     381    BSP_pgtbl_activate(pt);
     382        /* finally, switch off DBAT3 */
     383        setdbat(3, 0, 0, 0, 0);
     384  }
     385
     386  /*
     387   * Initialize VME bridge - needs working PCI
     388   * and IRQ subsystems...
     389   */
     390#ifdef SHOW_MORE_INIT_SETTINGS
     391  printk("Going to initialize VME bridge\n");
     392#endif
     393  /* VME initialization is in a separate file so apps which don't use
     394   * VME or want a different configuration may link against a customized
     395   * routine.
     396   */
     397  BSP_vme_config();
     398
    338399#ifdef SHOW_MORE_INIT_SETTINGS
    339400  printk("Exit from bspstart\n");
  • c/src/lib/libbsp/powerpc/shared/startup/linkcmds

    r422d561d r837a1323  
    88MEMORY {
    99        VECTORS : ORIGIN = 0x0 ,  LENGTH = 0x3000
    10         CODE : ORIGIN = 0x3000 , LENGTH = 0x100000
     10        CODE : ORIGIN = 0x3000 , LENGTH = 0x400000
    1111}
    1212SECTIONS
     
    7676  .rodata1        : { *(.rodata1) }     > CODE
    7777  .eh_frame       : { *.(eh_frame)              } >CODE
     78  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >CODE
     79  .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >CODE
    7880  _etext = .;
    7981  PROVIDE (etext = .);
    80   .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >CODE
    81   .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >CODE
    8282  /* Adjust the address for the data segment.  We want to adjust up to
    8383     the same address within the page on the next page up.  It would
Note: See TracChangeset for help on using the changeset viewer.