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: <wdnzttdq5gqthmzztylpu42ps22hpbbwev6onevxl76d5zf7em@bjiryyhqcj6f>
Date: Thu, 18 Apr 2024 21:12:39 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Piyush Malgujar <pmalgujar@...vell.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org, 
	sgarapati@...vell.com, cchavva@...vell.com, jannadurai@...vell.com
Subject: Re: [PATCH v6 2/4] i2c: thunderx: Support for High speed mode

Hi Piyush,

On Tue, Apr 02, 2024 at 06:40:12AM -0700, Piyush Malgujar wrote:
> From: Suneel Garapati <sgarapati@...vell.com>
> 
> To support bus operations for high speed bus frequencies greater than
> 400KHZ following control bits need to be setup accordingly
>  - hs_mode (bit 0) field in Mode register to switch controller
>    between low-speed and high-speed frequency operating mode.
>  - Setup clock divisors for desired TWSI bus frequency using
>    FOSCL output frequency divisor (D):
>    0 - sets the divisor to 10 for low speed mode
>    1 - sets the divisor to 15 for high speed mode.
> The TWSI bus output frequency, in master mode is based on:
> 		TCLK = 100MHz / (THP + 2)
> 		FOSCL = FSAMP / (M+1)×D = TCLK / (2 ^ N × (M + 1) × 15)
> 		FSAMP = TCLK / 2 ^ N
> where,
> 	N is <2:0> and M is <6:3> of TWSI Clock Control Register
> 	D is 10 for low speed or 15 for HS_MODE
> 
> With high speed mode support, HLC mode usage is limited to
> low speed frequency (<=400KHz) bus transfers in hardware.

Thanks! :-)

> Signed-off-by: Suneel Garapati <sgarapati@...vell.com>
> Signed-off-by: Piyush Malgujar <pmalgujar@...vell.com>

..

> -#define SW_TWSI(x)	(x->roff.sw_twsi)
> -#define TWSI_INT(x)	(x->roff.twsi_int)
> -#define SW_TWSI_EXT(x)	(x->roff.sw_twsi_ext)
> +#define OCTEON_REG_SW_TWSI(x)		((x)->roff.sw_twsi)
> +#define OCTEON_REG_TWSI_INT(x)		((x)->roff.twsi_int)
> +#define OCTEON_REG_SW_TWSI_EXT(x)	((x)->roff.sw_twsi_ext)

This is a good cleanup, can we please put it in a different
patch? This way the patch gets smaller and it's easier to review
and bisect.

> +#define OCTEON_REG_MODE(x)		((x)->roff.mode)
> +
> +/* Set REFCLK_SRC and HS_MODE in TWSX_MODE register */
> +#define TWSX_MODE_REFCLK_SRC	BIT(4)
> +#define TWSX_MODE_HS_MODE	BIT(0)
> +#define TWSX_MODE_HS_MASK	(TWSX_MODE_REFCLK_SRC | TWSX_MODE_HS_MODE)

Thanks!

All the rest looks good.

Andi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ