[PATCH linux dev-4.13 3/3] soc: aspeed-lpc-ctrl: Enable FWH cycles

Andrew Jeffery andrew at aj.id.au
Thu Feb 8 18:52:31 AEDT 2018


On Thu, 2018-02-08 at 16:07 +1030, Joel Stanley wrote:
> To date this driver has relied on prevous BMC state in order
> to have the host be able to access data over the LPC bus.
> 
> Now we explicitly enable the FWH cycles from when the user first
> configures the address to map. We chose to do this then as before that
> time there is no way for the kernel to know where it is safe to point
> the LPC window.
> 
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>  drivers/misc/aspeed-lpc-ctrl.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c
> index 4a818ad3827e..21b4ee9d0a38 100644
> --- a/drivers/misc/aspeed-lpc-ctrl.c
> +++ b/drivers/misc/aspeed-lpc-ctrl.c
> @@ -21,6 +21,10 @@
>  
>  #define DEVICE_NAME	"aspeed-lpc-ctrl"
>  
> +#define HICR5 0x0
> +#define HICR5_ENL2H	BIT(8)

Shouldn't we be setting this at the same time as HICR5_ENFWH below?

> +#define HICR5_ENFWH	BIT(10)
> +
>  #define HICR7 0x8
>  #define HICR8 0xc
>  
> @@ -155,8 +159,17 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd,
>  		if (rc)
>  			return rc;
>  
> -		return regmap_write(lpc_ctrl->regmap, HICR8,
> -			(~(map.size - 1)) | ((map.size >> 16) - 1));
> +		rc = regmap_write(lpc_ctrl->regmap, HICR8,
> +				(~(map.size - 1)) | ((map.size >> 16) - 1));
> +		if (rc)
> +			return rc;
> +
> +		/*
> +		 * Enable LPC FHW cycles. This is required for the host to
> +		 * access the regions specified.
> +		 */
> +		return regmap_update_bits(lpc_ctrl->regmap, HICR5,
> +				HICR5_ENFWH, HICR5_ENFWH);
>  	}
>  
>  	return -EINVAL;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20180208/2253d3c0/attachment.sig>


More information about the openbmc mailing list