mbgtools-lx
4.2.8
|
Go to the source code of this file.
Data Structures | |
struct | MBG_IOMEM_RSRC |
Bus memory resource information for a device. More... | |
struct | MBG_IOPORT_RSRC |
I/O port resource information for a device. More... | |
struct | MBG_IRQ_RSRC |
IRQ resource information for a device. More... | |
Macros | |
#define | MBG_USE_MM_IO_FOR_PCI 0 |
#define | FAR |
#define | _MBG_IOMEM volatile __iomem |
#define | _mbg_ioremap(_base, _num) ( _base ) |
#define | _mbg_iounmap(_base, _num) _nop_macro_fnc() |
#define | _mbg_mmiowb() _mmiowb() |
#define | _mbg_rmb() _nop_macro_fnc() |
#define | _mbg_wmb() _nop_macro_fnc() |
#define | _mbg_mmrd8(_iomem_addr) readb( (_iomem_addr) ) |
#define | _mbg_mmrd16_native(_iomem_addr) _cpu_to_mbg16( readw( (_iomem_addr) ) ) |
#define | _mbg_mmrd32_native(_iomem_addr) _cpu_to_mbg32( readl( (_iomem_addr) ) ) |
#define | _mbg_mmrd16_to_cpu(_iomem_addr) readw( (_iomem_addr) ) |
#define | _mbg_mmrd32_to_cpu(_iomem_addr) readl( (_iomem_addr) ) |
#define | _mbg_mmwr8(_iomem_addr, _val) writeb( (_val), (_iomem_addr) ) |
#define | _mbg_mmwr16_native(_iomem_addr, _val) writew( _mbg_to_cpu16( (_val) ), (_iomem_addr) ) |
#define | _mbg_mmwr32_native(_iomem_addr, _val) writel( _mbg_to_cpu32( (_val) ), (_iomem_addr) ) |
#define | _mbg_mmwr16_to_mbg(_iomem_addr, _val) writew( (_val), (_iomem_addr) ) |
#define | _mbg_mmwr32_to_mbg(_iomem_addr, _val) writel( (_val), (_iomem_addr) ) |
#define | _mbg_mmrd8_offs(_dev, _rsrc_idx, _iomem_offs) _mbg_mmrd8( (uint8_t _MBG_IOMEM *) (_dev)->mm_asic_addr + (_iomem_offs) ) |
#define | _mbg_mmrd32_to_cpu_offs(_dev, _rsrc_idx, _iomem_offs) _mbg_mmrd32_to_cpu( (uint8_t _MBG_IOMEM *) (_dev)->mm_addr_asic + (_iomem_offs) ) |
#define | _mbg_inp8(_dev, _rsrc_idx, _port_addr) ( (uint8_t) inb( (_port_addr) ) ) |
#define | _mbg_inp16_native(_dev, _rsrc_idx, _port_addr) _cpu_to_mbg16( inw( (_port_addr) ) ) |
#define | _mbg_inp32_native(_dev, _rsrc_idx, _port_addr) _cpu_to_mbg32( inl( (_port_addr) ) ) |
#define | _mbg_inp16_to_cpu(_dev, _rsrc_idx, _port_addr) ( (uint16_t) inw( (_port_addr) ) ) |
#define | _mbg_inp32_to_cpu(_dev, _rsrc_idx, _port_addr) ( (uint32_t) inl( (_port_addr) ) ) |
#define | _mbg_outp8(_dev, _rsrc_idx, _port_addr, _val) outb( (_val), (_port_addr) ) |
#define | _mbg_outp16_native(_dev, _rsrc_idx, _port_addr, _val) outw( _mbg_to_cpu16( (_val) ), (_port_addr) ) |
#define | _mbg_outp32_native(_dev, _rsrc_idx, _port_addr, _val) outl( _mbg_to_cpu32( (_val) ), (_port_addr) ) |
#define | _mbg_outp16_to_mbg(_dev, _rsrc_idx, _port_addr, _val) outw( (_val), (_port_addr) ) |
#define | _mbg_outp32_to_mbg(_dev, _rsrc_idx, _port_addr, _val) outl( (_val), (_port_addr) ) |
Typedefs | |
typedef uint64_t | MBG_IOMEM_ADDR_RAW |
typedef void volatile __iomem * | MBG_IOMEM_ADDR_MAPPED |
typedef ulong | MBG_IOPORT_ADDR_RAW |
typedef ulong | MBG_IOPORT_ADDR_MAPPED |
Functions | |
static __mbg_inline int | mbg_map_iomem_rsrc (MBG_IOMEM_RSRC *p) |
Map I/O memory resource to get a virtual address. More... | |
static __mbg_inline void | mbg_unmap_iomem_rsrc (MBG_IOMEM_RSRC *p) |
Unmap an I/O memory resource to release the virtual address. More... | |
static __mbg_inline int | mbg_map_ioport_rsrc (MBG_IOPORT_RSRC *p) |
Map an I/O port resource to get a virtual address. More... | |
static __mbg_inline void | mbg_unmap_ioport_rsrc (MBG_IOPORT_RSRC *p) |
Unmap an I/O port resource to release the virtual address. More... | |
static __mbg_inline uint8_t | mbg_mmrd8_native (uint8_t volatile __iomem *p) |
static __mbg_inline uint16_t | mbg_mmrd16_native (uint16_t volatile __iomem *p) |
static __mbg_inline uint32_t | mbg_mmrd32_native (uint32_t volatile __iomem *p) |
static __mbg_inline void | mbg_wrmm8_native (uint8_t val, uint8_t volatile __iomem *p) |
static __mbg_inline void | mbg_wrmm16_native (uint16_t val, uint16_t volatile __iomem *p) |
static __mbg_inline void | mbg_wrmm32_native (uint32_t val, uint32_t volatile __iomem *p) |
#define _mbg_inp16_native | ( | _dev, | |
_rsrc_idx, | |||
_port_addr | |||
) | _cpu_to_mbg16( inw( (_port_addr) ) ) |
Definition at line 611 of file mbggenio.h.
#define _mbg_inp16_to_cpu | ( | _dev, | |
_rsrc_idx, | |||
_port_addr | |||
) | ( (uint16_t) inw( (_port_addr) ) ) |
Definition at line 613 of file mbggenio.h.
Referenced by pcps_probe_device(), and pcps_read_amcc_s5933().
#define _mbg_inp32_native | ( | _dev, | |
_rsrc_idx, | |||
_port_addr | |||
) | _cpu_to_mbg32( inl( (_port_addr) ) ) |
Definition at line 612 of file mbggenio.h.
Referenced by pcps_read_amcc_s5920(), and pcps_read_asic().
#define _mbg_inp32_to_cpu | ( | _dev, | |
_rsrc_idx, | |||
_port_addr | |||
) | ( (uint32_t) inl( (_port_addr) ) ) |
Definition at line 614 of file mbggenio.h.
Referenced by mbg_get_asic_features(), mbg_get_asic_version(), pcps_probe_device(), pcps_read_asic(), ptp270pex_has_flagged_ready(), and report_io_cmd().
#define _mbg_inp8 | ( | _dev, | |
_rsrc_idx, | |||
_port_addr | |||
) | ( (uint8_t) inb( (_port_addr) ) ) |
Definition at line 610 of file mbggenio.h.
Referenced by _pcps_ddev_read_status_port(), pcps_read_amcc_s5933(), pcps_read_std(), and report_io_cmd().
#define _MBG_IOMEM volatile __iomem |
Definition at line 165 of file mbggenio.h.
Referenced by do_get_fast_hr_timestamp_cycles_safe(), do_get_fast_hr_timestamp_safe(), and swap_tstamp().
#define _mbg_ioremap | ( | _base, | |
_num | |||
) | ( _base ) |
Definition at line 189 of file mbggenio.h.
Referenced by ioctl_switch(), and mbg_map_ioport_rsrc().
#define _mbg_iounmap | ( | _base, | |
_num | |||
) | _nop_macro_fnc() |
Definition at line 190 of file mbggenio.h.
Referenced by mbg_unmap_ioport_rsrc().
#define _mbg_mmiowb | ( | ) | _mmiowb() |
Definition at line 480 of file mbggenio.h.
#define _mbg_mmrd16_native | ( | _iomem_addr | ) | _cpu_to_mbg16( readw( (_iomem_addr) ) ) |
Definition at line 573 of file mbggenio.h.
#define _mbg_mmrd16_to_cpu | ( | _iomem_addr | ) | readw( (_iomem_addr) ) |
Definition at line 575 of file mbggenio.h.
#define _mbg_mmrd32_native | ( | _iomem_addr | ) | _cpu_to_mbg32( readl( (_iomem_addr) ) ) |
Definition at line 574 of file mbggenio.h.
#define _mbg_mmrd32_to_cpu | ( | _iomem_addr | ) | readl( (_iomem_addr) ) |
Definition at line 576 of file mbggenio.h.
Referenced by do_get_fast_hr_timestamp_cycles_safe(), do_get_fast_hr_timestamp_safe(), pcps_probe_device(), and swap_tstamp().
#define _mbg_mmrd32_to_cpu_offs | ( | _dev, | |
_rsrc_idx, | |||
_iomem_offs | |||
) | _mbg_mmrd32_to_cpu( (uint8_t _MBG_IOMEM *) (_dev)->mm_addr_asic + (_iomem_offs) ) |
Definition at line 590 of file mbggenio.h.
#define _mbg_mmrd8 | ( | _iomem_addr | ) | readb( (_iomem_addr) ) |
Definition at line 572 of file mbggenio.h.
#define _mbg_mmrd8_offs | ( | _dev, | |
_rsrc_idx, | |||
_iomem_offs | |||
) | _mbg_mmrd8( (uint8_t _MBG_IOMEM *) (_dev)->mm_asic_addr + (_iomem_offs) ) |
Definition at line 587 of file mbggenio.h.
Referenced by _pcps_ddev_read_status_port().
#define _mbg_mmwr16_native | ( | _iomem_addr, | |
_val | |||
) | writew( _mbg_to_cpu16( (_val) ), (_iomem_addr) ) |
Definition at line 579 of file mbggenio.h.
#define _mbg_mmwr16_to_mbg | ( | _iomem_addr, | |
_val | |||
) | writew( (_val), (_iomem_addr) ) |
Definition at line 581 of file mbggenio.h.
#define _mbg_mmwr32_native | ( | _iomem_addr, | |
_val | |||
) | writel( _mbg_to_cpu32( (_val) ), (_iomem_addr) ) |
Definition at line 580 of file mbggenio.h.
#define _mbg_mmwr32_to_mbg | ( | _iomem_addr, | |
_val | |||
) | writel( (_val), (_iomem_addr) ) |
Definition at line 582 of file mbggenio.h.
#define _mbg_mmwr8 | ( | _iomem_addr, | |
_val | |||
) | writeb( (_val), (_iomem_addr) ) |
Definition at line 578 of file mbggenio.h.
#define _mbg_outp16_native | ( | _dev, | |
_rsrc_idx, | |||
_port_addr, | |||
_val | |||
) | outw( _mbg_to_cpu16( (_val) ), (_port_addr) ) |
Definition at line 617 of file mbggenio.h.
#define _mbg_outp16_to_mbg | ( | _dev, | |
_rsrc_idx, | |||
_port_addr, | |||
_val | |||
) | outw( (_val), (_port_addr) ) |
Definition at line 619 of file mbggenio.h.
#define _mbg_outp32_native | ( | _dev, | |
_rsrc_idx, | |||
_port_addr, | |||
_val | |||
) | outl( _mbg_to_cpu32( (_val) ), (_port_addr) ) |
Definition at line 618 of file mbggenio.h.
#define _mbg_outp32_to_mbg | ( | _dev, | |
_rsrc_idx, | |||
_port_addr, | |||
_val | |||
) | outl( (_val), (_port_addr) ) |
Definition at line 620 of file mbggenio.h.
Referenced by pcps_read_asic().
#define _mbg_outp8 | ( | _dev, | |
_rsrc_idx, | |||
_port_addr, | |||
_val | |||
) | outb( (_val), (_port_addr) ) |
Definition at line 616 of file mbggenio.h.
Referenced by pcps_read_amcc_s5920(), pcps_read_amcc_s5933(), and pcps_read_std().
#define _mbg_rmb | ( | ) | _nop_macro_fnc() |
Definition at line 486 of file mbggenio.h.
Referenced by mbg_mmrd16_native(), mbg_mmrd32_native(), and mbg_mmrd8_native().
#define _mbg_wmb | ( | ) | _nop_macro_fnc() |
Definition at line 490 of file mbggenio.h.
Referenced by mbg_wrmm16_native(), mbg_wrmm32_native(), and mbg_wrmm8_native().
#define FAR |
Definition at line 132 of file mbggenio.h.
Referenced by pcps_generic_io(), pcps_read_amcc_s5920(), pcps_read_amcc_s5933(), pcps_read_asic(), pcps_read_gps(), pcps_read_gps_block(), pcps_read_std(), pcps_write(), pcps_write_gps(), report_ret_val(), and setup_mm_addr().
#define MBG_USE_MM_IO_FOR_PCI 0 |
Definition at line 125 of file mbggenio.h.
typedef void volatile __iomem* MBG_IOMEM_ADDR_MAPPED |
Definition at line 176 of file mbggenio.h.
typedef uint64_t MBG_IOMEM_ADDR_RAW |
Definition at line 175 of file mbggenio.h.
typedef ulong MBG_IOPORT_ADDR_MAPPED |
Definition at line 187 of file mbggenio.h.
typedef ulong MBG_IOPORT_ADDR_RAW |
Definition at line 186 of file mbggenio.h.
|
static |
Map I/O memory resource to get a virtual address.
[in,out] | p | Pointer to an I/O memory resource structure |
Definition at line 330 of file mbggenio.h.
References _mbg_kdd_msg_2, MBG_IOMEM_RSRC::len, MBG_ERR_NO_MEM, MBG_LOG_WARN, MBG_SUCCESS, MBG_IOMEM_RSRC::start_mapped, and MBG_IOMEM_RSRC::start_raw.
Referenced by pcps_add_rsrc_mem().
|
static |
Map an I/O port resource to get a virtual address.
[in,out] | p | Pointer to an I/O port resource structure |
Definition at line 438 of file mbggenio.h.
References _mbg_ioremap, _mbg_kdd_msg_2, MBG_IOPORT_RSRC::base_mapped, MBG_IOPORT_RSRC::base_raw, MBG_LOG_WARN, MBG_SUCCESS, and MBG_IOPORT_RSRC::num.
Referenced by pcps_add_rsrc_io().
Definition at line 511 of file mbggenio.h.
References _mbg_rmb.
|
static |
Definition at line 521 of file mbggenio.h.
References _mbg_rmb.
Definition at line 500 of file mbggenio.h.
References _mbg_rmb.
|
static |
Unmap an I/O memory resource to release the virtual address.
[in,out] | p | Pointer to an I/O memory resource structure |
Definition at line 397 of file mbggenio.h.
References MBG_IOMEM_RSRC::len, and MBG_IOMEM_RSRC::start_mapped.
Referenced by pcps_release_rsrcs().
|
static |
Unmap an I/O port resource to release the virtual address.
[in,out] | p | Pointer to an I/O port resource structure |
Definition at line 464 of file mbggenio.h.
References _mbg_iounmap, MBG_IOPORT_RSRC::base_mapped, MBG_IOPORT_RSRC::base_raw, and MBG_IOPORT_RSRC::num.
Referenced by pcps_release_rsrcs().
Definition at line 540 of file mbggenio.h.
References _mbg_wmb.
|
static |
Definition at line 549 of file mbggenio.h.
References _mbg_wmb.
Definition at line 531 of file mbggenio.h.
References _mbg_wmb.