{
int rc;
command_fields_t cmd_desc;
- __u16 result[2];
+ union {
+ __u32 u32;
+ __u16 u16[2];
+ } result;
memset(&cmd_desc, 0, sizeof cmd_desc);
rc = cmd_invoke(&cmd_desc);
if (!rc) {
- rc = gw_read_cr(HCR_BASE + 16, (__u32 *) result);
+ rc = gw_read_cr(HCR_BASE + 16, &result.u32);
if (!rc) {
- *mgid_hash_p = result[0];
+ *mgid_hash_p = result.u16[0];
}
}
eprintf("");
return -1;
}
- tprintf("allocated snd_wqe=0x%lx", snd_wqe);
+ tprintf("allocated snd_wqe=%p", snd_wqe);
mad = get_send_wqe_buf(snd_wqe, 0);
memset(mad, 0, 256);
#include "mt23108.h"
#include "ib_driver.h"
-#include "pci.h"
+#include <gpxe/pci.h>
struct device_buffers_st {
union recv_wqe_u mads_qp_rcv_queue[NUM_MADS_RCV_WQES]
eprintf("");
return -1;
}
- tprintf("uar_base (pa:va) = 0x%lx 0x%lx",
+ tprintf("uar_base (pa:va) = 0x%lx %p",
tavor_pci_dev.dev.bar[2] + UAR_IDX * 0x1000, tavor_pci_dev.uar);
tprintf("");
dev_buffers_p = bus_to_virt(tmp);
memreg_size = (__u32) (&memreg_size) - (__u32) dev_buffers_p;
- tprintf("src_buf=0x%lx, dev_buffers_p=0x%lx, memreg_size=0x%x", src_buf,
+ tprintf("src_buf=%p, dev_buffers_p=%p, memreg_size=0x%lx", src_buf,
dev_buffers_p, memreg_size);
return 0;
tprintf("fw_rev_major=%d", qfw.fw_rev_major);
tprintf("fw_rev_minor=%d", qfw.fw_rev_minor);
tprintf("fw_rev_subminor=%d", qfw.fw_rev_subminor);
- tprintf("error_buf_start_h=0x%x", qfw.error_buf_start_h);
- tprintf("error_buf_start_l=0x%x", qfw.error_buf_start_l);
- tprintf("error_buf_size=%d", qfw.error_buf_size);
+ tprintf("error_buf_start_h=0x%lx", qfw.error_buf_start_h);
+ tprintf("error_buf_start_l=0x%lx", qfw.error_buf_start_l);
+ tprintf("error_buf_size=%ld", qfw.error_buf_size);
}
if (qfw.error_buf_start_h) {
__u32 *psrc, *pdst;
__u32 nds;
- tprintf("snd_wqe=0x%lx, virt_to_bus(snd_wqe)=0x%lx", snd_wqe,
+ tprintf("snd_wqe=%p, virt_to_bus(snd_wqe)=0x%lx", snd_wqe,
virt_to_bus(snd_wqe));
memset(&dbell, 0, sizeof dbell);
/* update data */
qp->rcv_wq[i].wqe_cont.qp = qp;
qp->rcv_bufs[i] = ib_buffers.ipoib_rcv_buf[i];
- tprintf("rcv_buf=%lx", qp->rcv_bufs[i]);
+ tprintf("rcv_buf=%p", qp->rcv_bufs[i]);
}
/* init send queue WQEs list */
eprintf("syndrome=0x%lx",
EX_FLD(cqe.error_cqe, tavorprm_completion_with_error_st,
syndrome));
- eprintf("wqe_addr=0x%lx", wqe_p);
+ eprintf("wqe_addr=%p", wqe_p);
eprintf("wqe_size=0x%lx",
EX_FLD(cqe.error_cqe, tavorprm_completion_with_error_st,
wqe_size));
wqe->mpointer[1].lkey = dev_ib_data.mkey;
wqe->mpointer[1].byte_count = qp->rcv_buf_sz;
- tprintf("rcv_buf=%lx\n", qp->rcv_bufs[new_entry]);
+ tprintf("rcv_buf=%p\n", qp->rcv_bufs[new_entry]);
/* we do it only on the data segment since the control
segment is always owned by HW */
struct eq_st *eq = &dev_ib_data.eq;
ptr = (__u32 *) (&(eq->eq_buf[eq->cons_idx]));
- tprintf("cons)idx=%d, addr(eqe)=%x, val=0x%x", eq->cons_idx, virt_to_bus(ptr), ptr[7]);
+ tprintf("cons)idx=%ld, addr(eqe)=%lx, val=0x%lx", eq->cons_idx, virt_to_bus(ptr), ptr[7]);
owner = (ptr[7] & 0x80000000) ? OWNER_HW : OWNER_SW;
if (owner == OWNER_SW) {
tprintf("got eqe");
#include "mt25218.h"
#include "ib_driver.h"
-#include "pci.h"
+#include <gpxe/pci.h>
#define MOD_INC(counter, max_count) (counter) = ((counter)+1) & ((max_count) - 1)
eprintf("");
return -1;
}
- tprintf("uar_base (pa:va) = 0x%lx 0x%lx",
+ tprintf("uar_base (pa:va) = 0x%lx %p",
memfree_pci_dev.dev.bar[2] + UAR_IDX * 0x1000,
memfree_pci_dev.uar);
dev_buffers_p = bus_to_virt(tmp);
memreg_size = (__u32) (&memreg_size) - (__u32) dev_buffers_p;
- tprintf("src_buf=0x%lx, dev_buffers_p=0x%lx, memreg_size=0x%x", src_buf,
+ tprintf("src_buf=%p, dev_buffers_p=%p, memreg_size=0x%lx", src_buf,
dev_buffers_p, memreg_size);
- tprintf("inprm: va=0x%lx, pa=0x%lx", dev_buffers_p->inprm_buf,
+ tprintf("inprm: va=%p, pa=0x%lx", dev_buffers_p->inprm_buf,
virt_to_bus(dev_buffers_p->inprm_buf));
- tprintf("outprm: va=0x%lx, pa=0x%lx", dev_buffers_p->outprm_buf,
+ tprintf("outprm: va=%p, pa=0x%lx", dev_buffers_p->outprm_buf,
virt_to_bus(dev_buffers_p->outprm_buf));
phys_mem.base =
tprintf("fw_rev_major=%d", qfw.fw_rev_major);
tprintf("fw_rev_minor=%d", qfw.fw_rev_minor);
tprintf("fw_rev_subminor=%d", qfw.fw_rev_subminor);
- tprintf("error_buf_start_h=0x%x", qfw.error_buf_start_h);
- tprintf("error_buf_start_l=0x%x", qfw.error_buf_start_l);
- tprintf("error_buf_size=%d", qfw.error_buf_size);
+ tprintf("error_buf_start_h=0x%lx", qfw.error_buf_start_h);
+ tprintf("error_buf_start_l=0x%lx", qfw.error_buf_start_l);
+ tprintf("error_buf_size=%ld", qfw.error_buf_size);
}
uar_context_pa = phys_mem.base + phys_mem.offset +
dev_ib_data.uar_idx * 4096;
uar_context_va = phys_to_virt(uar_context_pa);
- tprintf("uar_context: va=0x%lx, pa=0x%lx", uar_context_va,
+ tprintf("uar_context: va=%p, pa=0x%lx", uar_context_va,
uar_context_pa);
dev_ib_data.uar_context_base = uar_context_va;
phys_mem.offset += (1 << (map_obj.vpm_arr[0].log2_size + 12));
init_hca.log_max_uars = log_max_uars;
- tprintf("inprm: va=0x%lx, pa=0x%lx", inprm, virt_to_bus(inprm));
+ tprintf("inprm: va=%p, pa=0x%lx", inprm, virt_to_bus(inprm));
prep_init_hca_buf(&init_hca, inprm);
rc = cmd_init_hca(inprm, MT_STRUCT_SIZE(arbelprm_init_hca_st));
if (rc) {
eprintf("vendor_syndrome=0x%lx",
EX_FLD(cqe.error_cqe, arbelprm_completion_with_error_st,
vendor_code));
- eprintf("wqe_addr=0x%lx", wqe_p);
+ eprintf("wqe_addr=%p", wqe_p);
eprintf("myqpn=0x%lx",
EX_FLD(cqe.error_cqe, arbelprm_completion_with_error_st,
myqpn));
new_size = ib_cqe.count - GRH_SIZE;
buf = get_rcv_wqe_buf(ib_cqe.wqe, 1);
- tprintf("buf=%lx", buf);
+ tprintf("buf=%p", buf);
rc = ipoib_handle_rcv(buf, &out_buf, &new_size, is_bcast_p);
if (rc) {
eprintf("");
ipoib_data.ipoib_qpn = ib_get_qpn(qph);
if(print_info)
- printf("local ipoib qpn=0x%x\n", ipoib_data.ipoib_qpn);
+ printf("local ipoib qpn=0x%lx\n", ipoib_data.ipoib_qpn);
ipoib_data.bcast_av = ib_data.bcast_av;
ipoib_data.port_gid_raw = ib_data.port_gid.raw;
#include "etherboot.h"
/* to get the interface to the body of the program */
#include "nic.h"
-/* to get the PCI support functions, if this is a PCI NIC */
-#include "pci.h"
-/* to get the ISA support functions, if this is an ISA NIC */
-#include "isa.h"
#include "mt_version.c"
#include "mt23108_imp.c"
int i;
while (n > 0) {
- printf("%X ", where);
+ printf("%p ", where);
for (i = 0; i < ((n > 16) ? 16 : n); i++)
printf(" %hhX", ((char *)where)[i]);
printf("\n");
#include "etherboot.h"
/* to get the interface to the body of the program */
#include "nic.h"
-/* to get the PCI support functions, if this is a PCI NIC */
-#include "pci.h"
-/* to get the ISA support functions, if this is an ISA NIC */
-#include "isa.h"
#include "mt_version.c"
#include "mt25218_imp.c"
int i;
while (n > 0) {
- printf("%X ", where);
+ printf("%p ", where);
for (i = 0; i < ((n > 16) ? 16 : n); i++)
printf(" %hhX", ((char *)where)[i]);
printf("\n");