iPXE
mlx_pci_gw.h
Go to the documentation of this file.
00001 #ifndef INCLUDE_PUBLIC_MLX_PCI_GW_H_
00002 #define INCLUDE_PUBLIC_MLX_PCI_GW_H_
00003 
00004 /*
00005  * Copyright (C) 2015 Mellanox Technologies Ltd.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301, USA.
00021  */
00022 
00023 FILE_LICENCE ( GPL2_OR_LATER );
00024 
00025 #include "mlx_utils.h"
00026 
00027 #define PCI_GW_FIRST_CAPABILITY_POINTER_OFFSET 0x34
00028 
00029 #define PCI_GW_CAPABILITY_ID 0x9
00030 
00031 #define PCI_GW_CAPABILITY_ID_OFFSET 0x0
00032 #define PCI_GW_CAPABILITY_NEXT_POINTER_OFFSET 0x1
00033 #define PCI_GW_CAPABILITY_SPACE_OFFSET 0x4
00034 #define PCI_GW_CAPABILITY_STATUS_OFFSET 0x7
00035 #define PCI_GW_CAPABILITY_COUNTER_OFFSET 0x8
00036 #define PCI_GW_CAPABILITY_SEMAPHORE_OFFSET 0xC
00037 #define PCI_GW_CAPABILITY_ADDRESS_OFFSET 0x10
00038 #define PCI_GW_CAPABILITY_FLAG_OFFSET 0x10
00039 #define PCI_GW_CAPABILITY_DATA_OFFSET 0x14
00040 
00041 #define PCI_GW_SEMPHORE_TRIES 3000000
00042 #define PCI_GW_GET_OWNERSHIP_TRIES 5000
00043 #define PCI_GW_READ_FLAG_TRIES 3000000
00044 
00045 #define PCI_GW_WRITE_FLAG 0x80000000
00046 
00047 #define PCI_GW_SPACE_NODNIC 0x4
00048 #define PCI_GW_SPACE_ALL_ICMD 0x3
00049 #define PCI_GW_SPACE_SEMAPHORE 0xa
00050 #define PCI_GW_SPACE_CR0 0x2
00051 
00052 typedef mlx_uint32      mlx_pci_gw_buffer;
00053 
00054 
00055 mlx_status
00056 mlx_pci_gw_init(
00057                                 IN mlx_utils *utils
00058                                 );
00059 mlx_status
00060 mlx_pci_gw_teardown(
00061                                 IN mlx_utils *utils
00062                                 );
00063 mlx_status
00064 mlx_pci_gw_read(
00065                                 IN mlx_utils *utils,
00066                                 IN mlx_pci_gw_space space,
00067                                 IN mlx_uint32 address,
00068                                 OUT mlx_pci_gw_buffer *buffer
00069                                 );
00070 
00071 mlx_status
00072 mlx_pci_gw_write(
00073                                 IN mlx_utils *utils,
00074                                 IN mlx_pci_gw_space space,
00075                                 IN mlx_uint32 address,
00076                                 IN mlx_pci_gw_buffer buffer
00077                                 );
00078 
00079 
00080 
00081 #endif /* INCLUDE_PUBLIC_MLX_PCI_GW_H_ */