LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Hayes Wang <hayeswang@realtek.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] r8169: Support RTL8105E
Date: Thu, 17 Feb 2011 14:39:51 +0100	[thread overview]
Message-ID: <20110217133951.GA11996@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <1297942668-23274-2-git-send-email-hayeswang@realtek.com>

Hayes Wang <hayeswang@realtek.com> :
[...]
> @@ -227,6 +232,10 @@ enum rtl_registers {
>  	MultiIntr	= 0x5c,
>  	PHYAR		= 0x60,
>  	PHYstatus	= 0x6c,
> +	DLLPR		= 0xd0,
> +	DbgReg		= 0xd1,
> +	TWSI		= 0xd2,
> +	MCU		= 0xd3,

You can probably fill some of those in 'enum rtl8168_8101_registers'
(DbgReg is already there).

>  	RxMaxSize	= 0xda,
>  	CPlusCmd	= 0xe0,
>  	IntrMitigate	= 0xe2,
> @@ -427,6 +436,13 @@ enum rtl_register_content {
>  
>  	/* DumpCounterCommand */
>  	CounterDump	= 0x8,
> +
> +	/* MCU */
> +	EnNDP		= (1 << 3),
> +	EnOOBReset		= (1 << 2),
                  ^^^^ -> extraneous tab
> +
> +	/* DLLPR */
> +	PmSwitch	= (1 << 6),

They are a bit old-fashioned.

See rtl8168_8101_registers / DBG_REG / FIX_NAK_{1, 2}.

[...]
> @@ -2435,6 +2457,57 @@ static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
>  	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
>  }
>  
> +static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
> +{
> +	void __iomem *ioaddr = tp->mmio_addr;
> +	static const struct phy_reg phy_reg_init[] = {
> +		{ 0x1f, 0x0001},
> +		{ 0x15, 0x7701},
> +		{ 0x1f, 0x0000}
> +	};
> +
> +	rtl_writephy(tp, 0x1f, 0x0000);
> +	rtl_writephy(tp, 0x18, 0x0310);
> +	msleep(100);
> +
> +	if (rtl_apply_firmware(tp, FIRMWARE_8105E_1) < 0)
> +		netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
> +
> +	if(RTL_R8(0xef) & 0x08) {
         ^^ -> missing space.

Add a symbol for the 0xef register ?

> +		static const struct phy_reg phy_reg_init1[] = {
> +			{ 0x1f, 0x0005},
> +			{ 0x1a, 0x0004},
> +			{ 0x1f, 0x0000}
> +		};
> +		rtl_writephy_batch(tp, phy_reg_init1, ARRAY_SIZE(phy_reg_init1));
> +	} else {
> +		static const struct phy_reg phy_reg_init1[] = {
> +			{ 0x1f, 0x0005},
> +			{ 0x1a, 0x0000},
> +			{ 0x1f, 0x0000}
> +		};
> +		rtl_writephy_batch(tp, phy_reg_init1, ARRAY_SIZE(phy_reg_init1));
> +	}
> +
> +	if(RTL_R8(0xef) & 0x010) {
         ^^ -> missing space.

> +		static const struct phy_reg phy_reg_init1[] = {
> +			{ 0x1f, 0x0004},
> +			{ 0x1c, 0x0000},
> +			{ 0x1f, 0x0000}
> +		};
> +		rtl_writephy_batch(tp, phy_reg_init1, ARRAY_SIZE(phy_reg_init1));
> +	} else {
> +		static const struct phy_reg phy_reg_init1[] = {
> +			{ 0x1f, 0x0004},
> +			{ 0x1c, 0x0200},
> +			{ 0x1f, 0x0000}
> +		};
> +		rtl_writephy_batch(tp, phy_reg_init1, ARRAY_SIZE(phy_reg_init1));
> +	}

Nit: I would rather use an array of array and remove some code duplication.

Otherwise ok.

-- 
Ueimor

      reply	other threads:[~2011-02-17 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 11:37 [PATCH 1/2] r8169: Correct settings of rtl8102e Hayes Wang
2011-02-17 11:37 ` [PATCH 2/2] r8169: Support RTL8105E Hayes Wang
2011-02-17 13:39   ` Francois Romieu [this message]

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=20110217133951.GA11996@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH 2/2] r8169: Support RTL8105E' \
    /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

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).