All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Fäcknitz" <faecknitz@hotsplots.de>
To: mhi@lists.linux.dev
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: MHI MMIO endian issue
Date: Tue, 30 Apr 2024 23:30:57 +0200	[thread overview]
Message-ID: <ZjFjEe0-tJ6un10J@dev2> (raw)

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

             reply	other threads:[~2024-04-30 21:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 21:30 Martin Fäcknitz [this message]
2024-05-01  0:44 ` MHI MMIO endian issue Mayank Rana
2024-05-01  6:55 ` Manivannan Sadhasivam
2024-05-10  0:54   ` Paul Davey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZjFjEe0-tJ6un10J@dev2 \
    --to=faecknitz@hotsplots.de \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhi@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.