[PATCH linux dev-5.4 2/2] fsi: aspeed: Add module param for bus divisor

Eddie James eajames at linux.vnet.ibm.com
Wed Apr 15 08:27:55 AEST 2020


On 4/14/20 5:51 AM, Joel Stanley wrote:
> For testing and hardware debugging a user may wish to override the
> divisor at runtime. By setting fsi_master_aspeed.bus_div=N, the divisor
> will be set to N, if 0 < N <= 0x3ff.
>
> This is a module parameter and not a device tree option as it will only
> need to be set when testing or debugging.


Looks good.

Reviewed-by: Eddie James <eajames at linux.ibm.com>


>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>   drivers/fsi/fsi-master-aspeed.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
> index 80bc9132e4f8..b44f71f1f0a8 100644
> --- a/drivers/fsi/fsi-master-aspeed.c
> +++ b/drivers/fsi/fsi-master-aspeed.c
> @@ -87,6 +87,7 @@ static const u32 fsi_base = 0xa0000000;
>   #define FSI_DIVISOR_DEFAULT            1
>   #define FSI_DIVISOR_CABLED             2
>   static u16 aspeed_fsi_divisor = FSI_DIVISOR_DEFAULT;
> +module_param_named(bus_div,aspeed_fsi_divisor, ushort, 0);
>   
>   #define OPB_POLL_TIMEOUT		10000
>   
> @@ -458,9 +459,12 @@ static int tacoma_cabled_fsi_fixup(struct device *dev)
>   	if (gpio) {
>   		/*
>   		 * Cable signal integrity means we should run the bus
> -		 * slightly slower
> +		 * slightly slower. Do not override if a kernel param
> +		 * has already overridden.
>   		 */
> -		aspeed_fsi_divisor = FSI_DIVISOR_CABLED;
> +		if (aspeed_fsi_divisor == FSI_DIVISOR_DEFAULT)
> +			aspeed_fsi_divisor = FSI_DIVISOR_CABLED;
> +
>   		gpiod_direction_output(mux_gpio, 0);
>   		dev_info(dev, "FSI configured for external cable\n");
>   	} else {


More information about the openbmc mailing list