lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfMX1ob3+1RT+d8/@lunn.ch>
Date:   Thu, 27 Jan 2022 23:08:22 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next 4/5] net: lan743x: Add support of selection
 between SGMII and GMII Interface

> +	/* GPY211 Interface enable */
> +	chip_ver = lan743x_csr_read(adapter, FPGA_REV);
> +	if (chip_ver) {
> +		netif_info(adapter, drv, adapter->netdev,
> +			   "FPGA Image version: 0x%08X\n", chip_ver);

We try to avoid spamming the kernel logs, so:

netif_dbg()

> +		if (chip_ver & FPGA_SGMII_OP) {
> +			sgmii_ctl = lan743x_csr_read(adapter, SGMII_CTL);
> +			sgmii_ctl |= SGMII_CTL_SGMII_ENABLE_;
> +			sgmii_ctl &= ~SGMII_CTL_SGMII_POWER_DN_;
> +			lan743x_csr_write(adapter, SGMII_CTL, sgmii_ctl);
> +			netif_info(adapter, drv, adapter->netdev, "SGMII operation\n");
> +		} else {
> +			sgmii_ctl = lan743x_csr_read(adapter, SGMII_CTL);
> +			sgmii_ctl &= ~SGMII_CTL_SGMII_ENABLE_;
> +			sgmii_ctl |= SGMII_CTL_SGMII_POWER_DN_;
> +			lan743x_csr_write(adapter, SGMII_CTL, sgmii_ctl);
> +			netif_info(adapter, drv, adapter->netdev, "GMII operation\n");
> +		}
> +	} else {
> +		chip_ver = lan743x_csr_read(adapter, STRAP_READ);
> +		netif_info(adapter, drv, adapter->netdev,
> +			   "ASIC Image version: 0x%08X\n", chip_ver);

Here as well

> +		if (chip_ver & STRAP_READ_SGMII_EN_) {
> +			sgmii_ctl = lan743x_csr_read(adapter, SGMII_CTL);
> +			sgmii_ctl |= SGMII_CTL_SGMII_ENABLE_;
> +			sgmii_ctl &= ~SGMII_CTL_SGMII_POWER_DN_;
> +			lan743x_csr_write(adapter, SGMII_CTL, sgmii_ctl);
> +			netif_info(adapter, drv, adapter->netdev, "SGMII operation\n");

And def initially this and the next one.

> +		} else {
> +			sgmii_ctl = lan743x_csr_read(adapter, SGMII_CTL);
> +			sgmii_ctl &= ~SGMII_CTL_SGMII_ENABLE_;
> +			sgmii_ctl |= SGMII_CTL_SGMII_POWER_DN_;
> +			lan743x_csr_write(adapter, SGMII_CTL, sgmii_ctl);
> +			netif_info(adapter, drv, adapter->netdev, "GMII operation\n");
> +		}
> +	}

  Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ