- RSB bus communication fixes
- missing IOMMU reference property to H6 Hantro G2 -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSPRixG1tysKC2PKM10Ba7+DO8kkwUCY3fnrQAKCRB0Ba7+DO8k k6W1APwNIbTq+OWpgQpJckCY9GfWGmxinY90BInBcK/yd7FNfAEAx/zXrPj0RjA1 cIyZirTwvOESV4KjGeuIBXWG+IAqeAQ= =fyuv -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmN7YFkACgkQmmx57+YA GNlw+xAAgrOFQqqwdXqngNVQNNrt+xAhGBfDy45aTLbPJsx2cM25BgZ9w4EwRjRV kEqUPg51Ph8Junk0k+zvDi7iHU2Oml8ve/nn6QMfithu/uKDnWOerd7w0zkbUGyx oD3eHlMZPmzSB26YyZNvBQ3XOHpSJZiihWVkeiBnxyUt9hk15eLbmrEvrdn8khWx j1YRQ1PfowrH+IdDDx1zkNPoMRSS9IwguZm69JfN5HWFc6oxNT78wtoGN13sww/f dZs+4Syq0fwTKNPynuQcWb7JSpuk0iRiHyNM3mZIuCrkO8nQEd53Gcxfq6cAVqEk FGdLwHIeLq4eCVnxc9l7612QNwdpy8wqdlvTEL3Mp/eCfWnXPH6kbn4SNVJ1dpcd 4j2zdcnab5atdQpDpzLb4rrw2SZ/k9kSfISPWQKHJP+eK5Kh1OyIP0fHD/L9trAL muP1A0q56Xhzvc/rSashtmGZbMIpT2efxqEO1YNo33BQcuBWLoHE+tmXf2zb/iNl ithqHYTObLI/PiOaPFqw27/9qh7WhIHYsSetFdDvk9j6c7BuiIuXhZBZdaXcHVgK 7BWzExQfgvjWGFMnVguZKx7tfNQC84barazNJXmowVFPCI/DBCgZCCd5GbM//Pgg atMDDZeDbXjjMzVCfStmGuPxPnpuoYdl6vbq3esHv6SMAzerZSY= =yQ3J -----END PGP SIGNATURE----- Merge tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes - RSB bus communication fixes - missing IOMMU reference property to H6 Hantro G2 * tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property bus: sunxi-rsb: Support atomic transfers bus: sunxi-rsb: Remove the shutdown callback Link: https://lore.kernel.org/r/Y3ftpBFk5+fndA4B@jernej-laptop Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
e7135a2843
|
@ -36,6 +36,9 @@ properties:
|
|||
resets:
|
||||
maxItems: 1
|
||||
|
||||
iommus:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
@ -43,6 +46,7 @@ required:
|
|||
- clocks
|
||||
- clock-names
|
||||
- resets
|
||||
- iommus
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
|
@ -59,6 +63,7 @@ examples:
|
|||
clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
|
||||
clock-names = "bus", "mod";
|
||||
resets = <&ccu RST_BUS_VP9>;
|
||||
iommus = <&iommu 5>;
|
||||
};
|
||||
|
||||
...
|
||||
|
|
|
@ -161,6 +161,7 @@
|
|||
clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
|
||||
clock-names = "bus", "mod";
|
||||
resets = <&ccu RST_BUS_VP9>;
|
||||
iommus = <&iommu 5>;
|
||||
};
|
||||
|
||||
video-codec@1c0e000 {
|
||||
|
|
|
@ -267,6 +267,9 @@ EXPORT_SYMBOL_GPL(sunxi_rsb_driver_register);
|
|||
/* common code that starts a transfer */
|
||||
static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)
|
||||
{
|
||||
u32 int_mask, status;
|
||||
bool timeout;
|
||||
|
||||
if (readl(rsb->regs + RSB_CTRL) & RSB_CTRL_START_TRANS) {
|
||||
dev_dbg(rsb->dev, "RSB transfer still in progress\n");
|
||||
return -EBUSY;
|
||||
|
@ -274,13 +277,23 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)
|
|||
|
||||
reinit_completion(&rsb->complete);
|
||||
|
||||
writel(RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER,
|
||||
rsb->regs + RSB_INTE);
|
||||
int_mask = RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER;
|
||||
writel(int_mask, rsb->regs + RSB_INTE);
|
||||
writel(RSB_CTRL_START_TRANS | RSB_CTRL_GLOBAL_INT_ENB,
|
||||
rsb->regs + RSB_CTRL);
|
||||
|
||||
if (!wait_for_completion_io_timeout(&rsb->complete,
|
||||
msecs_to_jiffies(100))) {
|
||||
if (irqs_disabled()) {
|
||||
timeout = readl_poll_timeout_atomic(rsb->regs + RSB_INTS,
|
||||
status, (status & int_mask),
|
||||
10, 100000);
|
||||
writel(status, rsb->regs + RSB_INTS);
|
||||
} else {
|
||||
timeout = !wait_for_completion_io_timeout(&rsb->complete,
|
||||
msecs_to_jiffies(100));
|
||||
status = rsb->status;
|
||||
}
|
||||
|
||||
if (timeout) {
|
||||
dev_dbg(rsb->dev, "RSB timeout\n");
|
||||
|
||||
/* abort the transfer */
|
||||
|
@ -292,18 +305,18 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)
|
|||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
if (rsb->status & RSB_INTS_LOAD_BSY) {
|
||||
if (status & RSB_INTS_LOAD_BSY) {
|
||||
dev_dbg(rsb->dev, "RSB busy\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (rsb->status & RSB_INTS_TRANS_ERR) {
|
||||
if (rsb->status & RSB_INTS_TRANS_ERR_ACK) {
|
||||
if (status & RSB_INTS_TRANS_ERR) {
|
||||
if (status & RSB_INTS_TRANS_ERR_ACK) {
|
||||
dev_dbg(rsb->dev, "RSB slave nack\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (rsb->status & RSB_INTS_TRANS_ERR_DATA) {
|
||||
if (status & RSB_INTS_TRANS_ERR_DATA) {
|
||||
dev_dbg(rsb->dev, "RSB transfer data error\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
@ -812,14 +825,6 @@ static int sunxi_rsb_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void sunxi_rsb_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct sunxi_rsb *rsb = platform_get_drvdata(pdev);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
sunxi_rsb_hw_exit(rsb);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(sunxi_rsb_runtime_suspend,
|
||||
sunxi_rsb_runtime_resume, NULL)
|
||||
|
@ -835,7 +840,6 @@ MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table);
|
|||
static struct platform_driver sunxi_rsb_driver = {
|
||||
.probe = sunxi_rsb_probe,
|
||||
.remove = sunxi_rsb_remove,
|
||||
.shutdown = sunxi_rsb_shutdown,
|
||||
.driver = {
|
||||
.name = RSB_CTRL_NAME,
|
||||
.of_match_table = sunxi_rsb_of_match_table,
|
||||
|
|
Loading…
Reference in New Issue