Changeset 99698fb in rtems


Ignore:
Timestamp:
Sep 18, 2021, 2:05:42 AM (4 weeks ago)
Author:
Chris Johns <chrisj@…>
Branches:
5
Children:
c8a10609
Parents:
cfef84a0
git-author:
Chris Johns <chrisj@…> (09/18/21 02:05:42)
git-committer:
Chris Johns <chrisj@…> (09/22/21 00:58:14)
Message:

powerpc/motorola_powerpc: Map LibBSD bus space to the PCI base address

Closes #4516

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/powerpc/motorola_powerpc/include/bsp.h

    rcfef84a0 r99698fb  
    3232#include <libcpu/io.h>
    3333#include <bsp/vectors.h>
    34  
     34
    3535#ifdef qemu
    3636#include <rtems/bspcmdline.h>
    3737#endif
    38  
     38
    3939#ifdef __cplusplus
    4040extern "C" {
     
    116116#endif
    117117
     118/*
     119 * The BSP has PCI devices. Enable support in LibBSD.
     120 */
     121#define BSP_HAS_PC_PCI
     122
     123/*
     124 * Remap the PCI address space for LibBSD
     125 */
     126#define RTEMS_BSP_PCI_IO_REGION_BASE  0
     127#define RTEMS_BSP_PCI_MEM_REGION_BASE PCI_DRAM_OFFSET
     128
     129/*
     130 * Remap the PCI address space for LibBSD
     131 */
     132#define RTEMS_BSP_ADDR_PTR(_type) uint ## _type ## _t __volatile*
     133#define RTEMS_BSP_ADDR_CPTR(_type) const RTEMS_BSP_ADDR_PTR(_type)
     134#define RTEMS_BSP_ADDRESS_READ(_addr, _type) \
     135       *((RTEMS_BSP_ADDR_CPTR(_type)) (((RTEMS_BSP_ADDR_CPTR(8)) _addr) + PCI_DRAM_OFFSET))
     136#define RTEMS_BSP_ADDRESS_WRITE(_addr, _val, _type) \
     137       *((RTEMS_BSP_ADDR_PTR(_type)) (((RTEMS_BSP_ADDR_PTR(8)) _addr) + PCI_DRAM_OFFSET)) = (_val)
     138
     139#define RTEMS_BSP_READ_1(_addr) RTEMS_BSP_ADDRESS_READ(_addr, 8)
     140#define RTEMS_BSP_READ_2(_addr) RTEMS_BSP_ADDRESS_READ(_addr, 16)
     141#define RTEMS_BSP_READ_4(_addr) RTEMS_BSP_ADDRESS_READ(_addr, 32)
     142#define RTEMS_BSP_READ_8(_addr) RTEMS_BSP_ADDRESS_READ(_addr, 64)
     143
     144#define RTEMS_BSP_WRITE_1(_addr, _val) RTEMS_BSP_ADDRESS_WRITE(_addr, _val, 8)
     145#define RTEMS_BSP_WRITE_2(_addr, _val) RTEMS_BSP_ADDRESS_WRITE(_addr, _val, 16)
     146#define RTEMS_BSP_WRITE_4(_addr, _val) RTEMS_BSP_ADDRESS_WRITE(_addr, _val, 32)
     147#define RTEMS_BSP_WRITE_8(_addr, _val) RTEMS_BSP_ADDRESS_WRITE(_addr, _val, 64)
    118148
    119149/*
Note: See TracChangeset for help on using the changeset viewer.