提交 f4d02909 编写于 作者: J Joel Stanley 提交者: Greg Kroah-Hartman

misc: aspeed-lpc-ctrl: Enable FWH and A2H bridge cycles

To date this driver has relied on prevous state from out of tree hacks
and vendor u-boot trees in order to have the host be able to access
data over the LPC bus.

Now we explicitly enable the AHB to LPC bridge and 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.
Tested-by: NLei YU <mine260309@gmail.com>
Reviewed-by: NAndrew Jeffery <andrew@aj.id.au>
Signed-off-by: NJoel Stanley <joel@jms.id.au>
Reviewed-by: NCyril Bur <cyrilbur@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 99aad9e3
......@@ -21,6 +21,10 @@
#define DEVICE_NAME "aspeed-lpc-ctrl"
#define HICR5 0x0
#define HICR5_ENL2H BIT(8)
#define HICR5_ENFWH BIT(10)
#define HICR7 0x8
#define HICR8 0xc
......@@ -155,8 +159,18 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd,
if (rc)
return rc;
return regmap_write(lpc_ctrl->regmap, HICR8,
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_ENL2H,
HICR5_ENFWH | HICR5_ENL2H);
}
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册