Changeset 58127230 in rtems


Ignore:
Timestamp:
Jul 16, 2011, 1:29:05 AM (8 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.11, master
Children:
f616734f
Parents:
9c39236d
Message:

2011-07-15 Till Straumann <strauman@…>

  • shared/bootloader/mm.c, shared/bootloader/pci.c, shared/bootloader/qemu_fakeres.c, shared/bootloader/qemu_fakerom.S, shared/irq/irq.h, shared/motorola/motorola.c, shared/residual/residual.h, shared/startup/bspstart.c, Added 'qemuprep' BSP variant.
Location:
c/src/lib/libbsp/powerpc
Files:
2 added
7 edited

Legend:

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

    r9c39236d r58127230  
     12011-07-15  Till Straumann <strauman@slac.stanford.edu>
     2
     3        * shared/bootloader/mm.c, shared/bootloader/pci.c,
     4        shared/bootloader/qemu_fakeres.c, shared/bootloader/qemu_fakerom.S,
     5        shared/irq/irq.h, shared/motorola/motorola.c, shared/residual/residual.h,
     6        shared/startup/bspstart.c,
     7        Added 'qemuprep' BSP variant.
     8
    192011-07-15  Till Straumann <strauman@slac.stanford.edu>
    210
  • c/src/lib/libbsp/powerpc/shared/bootloader/mm.c

    r9c39236d r58127230  
    475475        u_long minpages = PAGE_ALIGN(image_size)>>PAGE_SHIFT;
    476476
     477        if ( residual_fw_is_qemu( res ) ) {
     478                /* save command-line - QEMU firmware sets R6/R7 to
     479                 * commandline start/end (NON-PReP STD)
     480                 */
     481                int len = bd->r7 - bd->r6;
     482                if ( len > 0 ) {
     483                        if ( len > sizeof(bd->cmd_line) - 1 )
     484                                len = sizeof(bd->cmd_line) - 1;
     485                        codemove(bd->cmd_line, bd->r6, len, bd->cache_lsize);
     486                        bd->cmd_line[len] = 0;
     487                }
     488        }
     489
    477490        /* Fix residual if we are loaded by Motorola NT firmware */
    478491        if ( res && res->VitalProductData.FirmwareSupplier == 0x10000 )
  • c/src/lib/libbsp/powerpc/shared/bootloader/pci.c

    r9c39236d r58127230  
    2525#include <bsp/consoleIo.h>
    2626#include <string.h>
     27#include <bsp.h>
    2728
    2829#include <string.h>
     
    481482   struct pci_dev *dev;
    482483
     484   u_long bus0_mem_start = BUS0_MEM_START;
     485   u_long bus0_mem_end   = BUS0_MEM_END;
     486
     487   if ( residual_fw_is_qemu( bd->residual ) ) {
     488     bus0_mem_start += PREP_ISA_MEM_BASE;
     489     bus0_mem_end   += PREP_ISA_MEM_BASE;
     490   }
     491
    483492   /* FIXME: for now memory is relocated from low, it's better
    484493    * to start from higher addresses.
     
    490499
    491500   init_free_area(&pci->io, BUS0_IO_START, BUS0_IO_END, 0xfff, 0);
    492    init_free_area(&pci->mem, BUS0_MEM_START, BUS0_MEM_END, 0xfffff, 0);
     501   init_free_area(&pci->mem, bus0_mem_start, bus0_mem_end, 0xfffff, 0);
    493502
    494503   /* First reconfigure the I/O space, this will be more
     
    521530                             PCI_BASE_ADDRESS_0+(r->reg<<2),
    522531                             r->base);
     532
     533      if ( residual_fw_is_qemu( bd->residual ) && r->dev->sysdata ) {
     534        if ( PCI_BASE_ADDRESS_SPACE_IO == (r->type &  PCI_BASE_ADDRESS_SPACE) )
     535                        ((pci_resource*)r->dev->sysdata)->cmd |= PCI_COMMAND_IO;
     536                else
     537                        ((pci_resource*)r->dev->sysdata)->cmd |= PCI_COMMAND_MEMORY;
     538      }
     539
    523540      if ((r->type&
    524541           (PCI_BASE_ADDRESS_SPACE|
  • c/src/lib/libbsp/powerpc/shared/irq/irq.h

    r9c39236d r58127230  
    7979 * CAUTION : BSP_PCI_IRQ_LOWEST_OFFSET should be equal to OPENPIC_VEC_SOURCE
    8080 */
     81#ifndef qemu
    8182#define BSP_PCI_IRQ_NUMBER              (16)
     83#else
     84#define BSP_PCI_IRQ_NUMBER              (0)
     85#endif
    8286#define BSP_PCI_IRQ_LOWEST_OFFSET       (BSP_ISA_IRQ_NUMBER)
    8387#define BSP_PCI_IRQ_MAX_OFFSET          (BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER - 1)
     
    9195/* Misc vectors for OPENPIC irqs (IPI, timers)
    9296 */
     97#ifndef qemu
    9398#define BSP_MISC_IRQ_NUMBER             (8)
     99#else
     100#define BSP_MISC_IRQ_NUMBER             (0)
     101#endif
     102
    94103#define BSP_MISC_IRQ_LOWEST_OFFSET      (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
    95104#define BSP_MISC_IRQ_MAX_OFFSET         (BSP_MISC_IRQ_LOWEST_OFFSET + BSP_MISC_IRQ_NUMBER - 1)
     
    113122 */
    114123#define BSP_PCI_IRQ0                    (BSP_PCI_IRQ_LOWEST_OFFSET)
     124#if     BSP_PCI_IRQ_NUMBER > 0
    115125#define BSP_PCI_ISA_BRIDGE_IRQ          (BSP_PCI_IRQ0)
     126#endif
    116127
    117128#if defined(mvme2100)
  • c/src/lib/libbsp/powerpc/shared/motorola/motorola.c

    r9c39236d r58127230  
    6868#define NULL_INTMAP     {-1,-1,-1,{}}
    6969
     70#ifdef qemu
     71static struct _int_map qemu_prep_intmap[] = {
     72    { 0, -1, PCI_FIXUP_OPT_OVERRIDE_NAME,
     73                    { { 1, { 9, -1, -1, -1}},
     74                  { 2, {11, -1  -1, -1}},
     75                  NULL_PINMAP }},
     76        NULL_INTMAP
     77};
     78#endif
     79
    7080static struct _int_map mcp750_intmap[] = {
    7181
     
    305315  {0x060, 0x00, PPC_UNKNOWN, "Utah (Powerstack II Pro4000)", NULL, NULL},
    306316  {0x0A0, 0x00, PPC_UNKNOWN, "Powerstack (Series EX)", NULL, NULL},
     317#ifdef qemu
     318  {0x1E0, 0xE0, PPC_UNKNOWN, "QEMU", qemu_prep_intmap, prep_pci_swizzle},
     319#else
    307320  {0x1E0, 0xE0, PPC_UNKNOWN, "Mesquite cPCI (MCP750)", mcp750_intmap, prep_pci_swizzle},
     321#endif
    308322  {0x1E0, 0xE1, PPC_UNKNOWN, "Sitka cPCI (MCPN750)", mcp750_intmap, prep_pci_swizzle},
    309323  {0x1E0, 0xE2, PPC_UNKNOWN, "Mesquite cPCI (MCP750) w/ HAC", mcp750_intmap, prep_pci_swizzle},
  • c/src/lib/libbsp/powerpc/shared/residual/residual.h

    r9c39236d r58127230  
    6464  FirmWorks = 0x02,                     /* 10/5/95                            */
    6565  Bull = 0x03,                          /* 04/03/96                           */
     66  QEMU = ('q'<<24) | ('e'<<16) | ('m'<<8) | ('u'<<0),
    6667  } FIRMWARE_SUPPLIERS;
    6768
     
    322323#endif
    323324
     325static inline int
     326residual_fw_is_qemu(RESIDUAL *r)
     327{
     328        return QEMU == r->VitalProductData.FirmwareSupplier;
     329}
     330
    324331extern RESIDUAL residualCopy;
    325332
  • c/src/lib/libbsp/powerpc/shared/startup/bspstart.c

    r9c39236d r58127230  
    4242extern Triv121PgTbl BSP_pgtbl_setup(unsigned int *);
    4343extern void                     BSP_pgtbl_activate(Triv121PgTbl);
    44 extern void                     BSP_vme_config(void);
    4544
    4645SPR_RW(SPRG1)
     
    181180   * Must have acces to open pic PCI ACK registers provided by the RAVEN
    182181   */
     182#ifndef qemu
    183183  setdbat(3, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
     184#else
     185  setdbat(3, 0xb0000000, 0xb0000000, 0x10000000, IO_PAGE);
     186#endif
    184187
    185188#if defined(mvme2100)
     
    254257  printk("Residuals are located at %x\n", (unsigned) &residualCopy);
    255258  printk("Additionnal boot options are %s\n", loaderParam);
    256   printk("Initial system stack at %x\n",stack);
    257259  printk("Software IRQ stack starts at %x with size %u\n", intrStackStart, intrStackSize);
    258260  printk("-----------------------------------------\n");
     
    330332
    331333  if (!pt || TRIV121_MAP_SUCCESS != triv121PgTblMap(
    332             pt, TRIV121_121_VSID, 0xfeff0000, 1,
     334            pt, TRIV121_121_VSID,
     335#ifndef qemu
     336            0xfeff0000,
     337#else
     338            0xbffff000,
     339#endif
     340            1,
    333341            TRIV121_ATTR_IO_PAGE, TRIV121_PP_RW_PAGE)) {
    334342        printk("WARNING: unable to setup page tables VME "
Note: See TracChangeset for help on using the changeset viewer.