public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: u-boot@lists.denx.de
Subject: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B
Date: Thu, 11 Jun 2020 03:18:52 +0000	[thread overview]
Message-ID: <43e79ab399134d4392770f0f28a29372@realtek.com> (raw)
In-Reply-To: <6c791826-d28b-cc89-b230-6b5d1a252399@denx.de>

Marek Vasut [mailto:marex at denx.de]
> Sent: Wednesday, June 10, 2020 9:21 PM
[...]
> >>>>> +	/* ADC Bias Calibration:
> >>>>> +	 * read efuse offset 0x7d to get a 17-bit data. Remove the
> >> dummy/fake
> >>>>> +	 * bit (bit3) to rebuild the real 16-bit data. Write the data to the
> >>>>> +	 * ADC ioffset.
> >>>>> +	 */
> >>>>> +	ocp_data = r8152_efuse_read(tp, 0x7d);
> >>>>> +	data = (u16)(((ocp_data & 0x1fff0) >> 1) | (ocp_data & 0x7));
> >>>>
> >>>> Are these type casts really needed ?
> >>>
> >>> Is there not a warning from u32 to u16?
> >>
> >> There is, but it seems justified to warn about conversion from u32 to
> >> u16, so maybe that needs to be fixed ?
> >
> > Excuse me. I don't understand what you mean.
> > The original is 17-bit data, so I use u32 to store it. And,
> > the final desired data is 16-bit. That is why
> > I have to convert it from u32 to u16.
> 
> So what happens to that bit 17 , is it dropped ?

I have descripted is in the code, such as following.

	/* ADC Bias Calibration:
	 * read efuse offset 0x7d to get a 17-bit data. Remove the dummy/fake
	 * bit (bit3) to rebuild the real 16-bit data. Write the data to the
	 * ADC ioffset.
	 */

The real data (16-bit) would be inserted a dummy bit,
and store the 17-bit to efuse offset 0x7d. Therefore, when
reading the 17-bit data from efuse, we have to remove the
dummy to get the real data.

Best Regards,
Hayes

  reply	other threads:[~2020-06-11  3:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09  8:53 [PATCH u-boot 0/4] r8152: support more chips Hayes Wang
2020-06-09  8:53 ` [PATCH u-boot 1/4] eth/r8152: reset bmu after disabling Tx/Rx Hayes Wang
2020-06-09 14:20   ` Marek Vasut
2020-06-10  9:27     ` Hayes Wang
2020-06-10 11:04       ` Marek Vasut
2020-06-11  3:18         ` Hayes Wang
2020-06-09  8:53 ` [PATCH u-boot 2/4] eth/r8152: reset PHY after setting it Hayes Wang
2020-06-09 14:22   ` Marek Vasut
2020-06-10  9:47     ` Hayes Wang
2020-06-10 11:06       ` Marek Vasut
2020-06-09  8:53 ` [PATCH u-boot 3/4] eth/r8152: modify rtl_clear_bp function Hayes Wang
2020-06-09 14:23   ` Marek Vasut
2020-06-09  8:53 ` [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B Hayes Wang
2020-06-09 14:27   ` Marek Vasut
2020-06-10 12:44     ` Hayes Wang
2020-06-10 12:54       ` Marek Vasut
2020-06-10 13:12         ` Hayes Wang
2020-06-10 13:20           ` Marek Vasut
2020-06-11  3:18             ` Hayes Wang [this message]
2020-06-12  0:05               ` Marek Vasut
2020-06-12  3:50                 ` Hayes Wang
2020-06-12 11:52                   ` Marek Vasut
2020-06-15  6:52                     ` Hayes Wang
2020-06-15  7:34                       ` Marek Vasut

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=43e79ab399134d4392770f0f28a29372@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox