netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: Martin Capitanio <c4p7n@capitanio.org>
Cc: "Francois Romieu" <romieu@fr.zoreil.com>,
	"David Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, jeff@garzik.org,
	"Edward Hsu" <edward_hsu@realtek.com.tw>,
	"Petr Vandrovec" <petr@vandrovec.name>,
	"Plamen Petrov" <pvp-lsts@fs.ru.acad.bg>,
	"\"\\\"J.A.\\\" Magallón\"" <jamagallon@ono.com>
Subject: Re: [PATCH 2/2] r8169: checks against wrong mac addresse init
Date: Tue, 21 Oct 2008 19:10:39 +0200	[thread overview]
Message-ID: <48FE0D0F.7020300@redhat.com> (raw)
In-Reply-To: <1224265672.17605.27.camel@marvin>

Martin Capitanio wrote:
> Please take a look at the realtek r8101_n aka RealTek RTL8101E,
> RTL8102E(L) code. Only CFG_METHOD_1, CFG_METHOD_2
> and #(ioaddr, 0x00) == 0x8128 are here allowed to EEPROM access.
> 
> ...
> 	rtl_eeprom_write_sc(ioaddr, 0x00, 0x8129);
> 
> 	RTL_W8(Cfg9346, Cfg9346_EEM0);
> 	mdelay(15);
> 	rtl_eeprom_write_sc(ioaddr, 0x00, 0x8128);

1) According specification when EEM0 is set to 1 and EEM1 is set to 0
then adapter enters "auto load" mode. Entering this mode will make the
adapter load the contents of the 93C46 (93C56) as when the PCI RSTB
signal is asserted. This auto-load operation will take about 2 ms.
Upon completion, the it automatically returns to normal mode
(EEM1 = EEM0 = 0) and all of the other registers are reset to default
values.
2) First 2 bytes of the EEPROM contain ID code words for the adapter.
It will load the contents of the EEPROM into the corresponding location
if the ID word (0x8129) is correct.

So the Realtek's driver at first sets these bytes to value 0x8129 to ensure
that auto-load will be a success. Then it initiates auto-load (EMM0 = 1 and
EMM1 = 0) then wait some time and finally writes back original value (0x8128).

Ivan

  parent reply	other threads:[~2008-10-21 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 21:45 [PATCH 0/2] Pull request for 'r8169-fixes' branch Francois Romieu
2008-10-16 21:47 ` [PATCH 1/2] r8169: verbose mac address init Francois Romieu
2008-10-16 21:48 ` [PATCH 2/2] r8169: checks against wrong mac addresse init Francois Romieu
2008-10-17 17:47   ` Martin Capitanio
2008-10-17 20:01     ` Francois Romieu
2008-10-17 23:52       ` Martin Capitanio
2008-10-21 17:10     ` Ivan Vecera [this message]
2008-10-21 21:55       ` Martin Capitanio
2008-10-21  5:05 ` [PATCH 0/2] Pull request for 'r8169-fixes' branch Jeff Garzik

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=48FE0D0F.7020300@redhat.com \
    --to=ivecera@redhat.com \
    --cc=c4p7n@capitanio.org \
    --cc=davem@davemloft.net \
    --cc=edward_hsu@realtek.com.tw \
    --cc=jamagallon@ono.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=petr@vandrovec.name \
    --cc=pvp-lsts@fs.ru.acad.bg \
    --cc=romieu@fr.zoreil.com \
    /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;
as well as URLs for NNTP newsgroup(s).