public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: <david.daney@cavium.com>, <janne.huttunen@nokia.com>,
	<aaro.koskinen@nokia.com>, <ralf@linux-mips.org>,
	<linux-mips@linux-mips.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] MIPS: Octeon: Add Octeon III CN7xxx interface detection
Date: Wed, 3 Feb 2016 10:03:41 -0800	[thread overview]
Message-ID: <56B240FD.4090400@caviumnetworks.com> (raw)
In-Reply-To: <1454522496-35794-1-git-send-email-Zubair.Kakakhel@imgtec.com>

On 02/03/2016 10:01 AM, Zubair Lutfullah Kakakhel wrote:
> Add basic CN7XXX interface detection.
>
> This allows the kernel to boot with ethernet working as it initializes
> the ethernet ports with SGMII instead of defaulting to RGMII routines.
>
> Tested on the utm8 from Rhino Labs with a CN7130.
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>

Acked-by: David Daney <david.daney@cavium.com>


>
> ---
> V1 -> V2
> - Rebase to v4.5-rc2
> - Used switch instead of too many if-else.
> - Change subject from XXX to xxx as lkml bounced the mail..  ¯\_(ツ)_/¯
> ---
>   arch/mips/cavium-octeon/executive/cvmx-helper.c | 43 +++++++++++++++++++++++++
>   1 file changed, 43 insertions(+)
>
> diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
> index 376701f..ff26d02 100644
> --- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
> +++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
> @@ -87,6 +87,8 @@ int cvmx_helper_get_number_of_interfaces(void)
>   		return 9;
>   	if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
>   		return 4;
> +	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
> +		return 5;
>   	else
>   		return 3;
>   }
> @@ -260,6 +262,41 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
>   }
>
>   /**
> + * @INTERNAL
> + * Return interface mode for CN7XXX.
> + */
> +static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface)
> +{
> +	union cvmx_gmxx_inf_mode mode;
> +
> +	mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
> +
> +	switch (interface) {
> +	case 0:
> +	case 1:
> +		switch (mode.cn68xx.mode) {
> +		case 0:
> +			return CVMX_HELPER_INTERFACE_MODE_DISABLED;
> +		case 1:
> +		case 2:
> +			return CVMX_HELPER_INTERFACE_MODE_SGMII;
> +		case 3:
> +			return CVMX_HELPER_INTERFACE_MODE_XAUI;
> +		default:
> +			return CVMX_HELPER_INTERFACE_MODE_SGMII;
> +		}
> +	case 2:
> +		return CVMX_HELPER_INTERFACE_MODE_NPI;
> +	case 3:
> +		return CVMX_HELPER_INTERFACE_MODE_LOOP;
> +	case 4:
> +		return CVMX_HELPER_INTERFACE_MODE_RGMII;
> +	default:
> +		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
> +	}
> +}
> +
> +/**
>    * Get the operating mode of an interface. Depending on the Octeon
>    * chip and configuration, this function returns an enumeration
>    * of the type of packet I/O supported by an interface.
> @@ -278,6 +315,12 @@ cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface)
>   		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
>
>   	/*
> +	 * OCTEON III models
> +	 */
> +	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
> +		return __cvmx_get_mode_cn7xxx(interface);
> +
> +	/*
>   	 * Octeon II models
>   	 */
>   	if (OCTEON_IS_MODEL(OCTEON_CN6XXX) || OCTEON_IS_MODEL(OCTEON_CNF71XX))
>

      reply	other threads:[~2016-02-03 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 18:01 [PATCH v2] MIPS: Octeon: Add Octeon III CN7xxx interface detection Zubair Lutfullah Kakakhel
2016-02-03 18:03 ` David Daney [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=56B240FD.4090400@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=aaro.koskinen@nokia.com \
    --cc=david.daney@cavium.com \
    --cc=janne.huttunen@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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