All of lore.kernel.org
 help / color / mirror / Atom feed
* MHI MMIO endian issue
@ 2024-04-30 21:30 Martin Fäcknitz
  2024-05-01  0:44 ` Mayank Rana
  2024-05-01  6:55 ` Manivannan Sadhasivam
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Fäcknitz @ 2024-04-30 21:30 UTC (permalink / raw)
  To: mhi; +Cc: Manivannan Sadhasivam

Hello,

the function mhi_init_mmio configures MMIO registers using the reg_info
table:

  eg_info[] = {
    {
	  CCABAP_HIGHER,
      upper_32_bits(mhi_cntrl->mhi_ctxt->chan_ctxt_addr),
	},
	...

  mhi_write_reg(mhi_cntrl, base, reg_info[i].offset,
    reg_info[i].val);

However, the values are in host byte orders, not in device byte order. I
have a PPC64 system which is big endian, but the device is little
endian. Without wrapping each value in eg_info using cpu_to_le32 the
device (sdx55) doesn't response:

  cpu_to_le32(upper_32_bits(mhi_cntrl->mhi_ctxt->chan_ctxt_addr))

Hard to believe i am the first one which has this issue? Let me know if
i should make a patch.

-- 
Martin Fäcknitz

hotsplots GmbH
Rotherstr. 22
10245 Berlin
Fon: +49 (0)30 29 77 348-0
Fax: +49 (0)30 29 77 348-99
E-Mail: faecknitz@hotsplots.de

Amtsgericht Charlottenburg HRB 93460B
Geschäftsführung: Dipl. Ing. Sascha Schaub

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-10  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 21:30 MHI MMIO endian issue Martin Fäcknitz
2024-05-01  0:44 ` Mayank Rana
2024-05-01  6:55 ` Manivannan Sadhasivam
2024-05-10  0:54   ` Paul Davey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.