Skip to content

Commit 11e864e

Browse files
marcanjannau
authored andcommitted
media: apple: isp: Drop the DART mirroring stuff
Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 7f97756 commit 11e864e

4 files changed

Lines changed: 0 additions & 87 deletions

File tree

drivers/media/platform/apple/isp/isp-drv.c

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ static int apple_isp_init_iommu(struct apple_isp *isp)
126126

127127
drm_mm_init(&isp->iovad, isp->fw.heap_top, vm_size - heap_base);
128128

129-
apple_isp_iommu_sync_ttbr(isp);
130-
131129
return 0;
132130
}
133131

@@ -140,7 +138,6 @@ static int apple_isp_probe(struct platform_device *pdev)
140138
{
141139
struct device *dev = &pdev->dev;
142140
struct apple_isp *isp;
143-
struct resource *res;
144141
int err;
145142

146143
isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL);
@@ -176,31 +173,6 @@ static int apple_isp_probe(struct platform_device *pdev)
176173
goto detach_genpd;
177174
}
178175

179-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dart0");
180-
if (!res) {
181-
err = -ENODEV;
182-
goto detach_genpd;
183-
}
184-
185-
/* Simply ioremap since it's a shared register zone */
186-
isp->dart0 = devm_ioremap(dev, res->start, resource_size(res));
187-
if (IS_ERR(isp->dart0)) {
188-
err = PTR_ERR(isp->dart0);
189-
goto detach_genpd;
190-
}
191-
192-
isp->dart1 = devm_platform_ioremap_resource_byname(pdev, "dart1");
193-
if (IS_ERR(isp->dart1)) {
194-
err = PTR_ERR(isp->dart1);
195-
goto detach_genpd;
196-
}
197-
198-
isp->dart2 = devm_platform_ioremap_resource_byname(pdev, "dart2");
199-
if (IS_ERR(isp->dart2)) {
200-
err = PTR_ERR(isp->dart2);
201-
goto detach_genpd;
202-
}
203-
204176
isp->irq = platform_get_irq(pdev, 0);
205177
if (isp->irq < 0) {
206178
err = isp->irq;
@@ -270,12 +242,6 @@ static void apple_isp_remove(struct platform_device *pdev)
270242
return 0;
271243
}
272244

273-
/* T8020/T6000 registers */
274-
#define DART_T8020_STREAM_COMMAND 0x20
275-
#define DART_T8020_STREAM_SELECT 0x34
276-
#define DART_T8020_TTBR 0x200
277-
#define DART_T8020_STREAM_COMMAND_INVALIDATE BIT(20)
278-
279245
static const struct apple_isp_hw apple_isp_hw_t8103 = {
280246
.pmu_base = 0x23b704000,
281247

@@ -296,11 +262,6 @@ static const struct apple_isp_hw apple_isp_hw_t8103 = {
296262
.bandwidth_base = 0x23bc3c000,
297263
.bandwidth_bit = 0x0,
298264
.bandwidth_size = 0x4,
299-
300-
.stream_command = DART_T8020_STREAM_COMMAND,
301-
.stream_select = DART_T8020_STREAM_SELECT,
302-
.ttbr = DART_T8020_TTBR,
303-
.stream_command_invalidate = DART_T8020_STREAM_COMMAND_INVALIDATE,
304265
};
305266

306267
static const struct apple_isp_hw apple_isp_hw_t6000 = {
@@ -323,11 +284,6 @@ static const struct apple_isp_hw apple_isp_hw_t6000 = {
323284
.bandwidth_base = 0x0,
324285
.bandwidth_bit = 0x0,
325286
.bandwidth_size = 0x8,
326-
327-
.stream_command = DART_T8020_STREAM_COMMAND,
328-
.stream_select = DART_T8020_STREAM_SELECT,
329-
.ttbr = DART_T8020_TTBR,
330-
.stream_command_invalidate = DART_T8020_STREAM_COMMAND_INVALIDATE,
331287
};
332288

333289
static const struct apple_isp_hw apple_isp_hw_t8110 = {
@@ -350,11 +306,6 @@ static const struct apple_isp_hw apple_isp_hw_t8110 = {
350306
.bandwidth_base = 0x0,
351307
.bandwidth_bit = 0x0,
352308
.bandwidth_size = 0x8,
353-
354-
.stream_command = DART_T8020_STREAM_COMMAND, // TODO
355-
.stream_select = DART_T8020_STREAM_SELECT,
356-
.ttbr = DART_T8020_TTBR,
357-
.stream_command_invalidate = DART_T8020_STREAM_COMMAND_INVALIDATE,
358309
};
359310

360311
static const struct of_device_id apple_isp_of_match[] = {
@@ -366,19 +317,11 @@ MODULE_DEVICE_TABLE(of, apple_isp_of_match);
366317

367318
static __maybe_unused int apple_isp_suspend(struct device *dev)
368319
{
369-
struct apple_isp *isp = dev_get_drvdata(dev);
370-
371-
apple_isp_iommu_invalidate_tlb(isp);
372-
373320
return 0;
374321
}
375322

376323
static __maybe_unused int apple_isp_resume(struct device *dev)
377324
{
378-
struct apple_isp *isp = dev_get_drvdata(dev);
379-
380-
apple_isp_iommu_sync_ttbr(isp);
381-
382325
return 0;
383326
}
384327
DEFINE_RUNTIME_DEV_PM_OPS(apple_isp_pm_ops, apple_isp_suspend, apple_isp_resume, NULL);

drivers/media/platform/apple/isp/isp-drv.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ struct apple_isp_hw {
8282
u64 bandwidth_base;
8383
u8 bandwidth_bit;
8484
u8 bandwidth_size;
85-
86-
u32 stream_command;
87-
u32 stream_select;
88-
u32 ttbr;
89-
u32 stream_command_invalidate;
9085
};
9186

9287
struct isp_resv {
@@ -187,9 +182,6 @@ struct apple_isp {
187182
void __iomem *asc;
188183
void __iomem *mbox;
189184
void __iomem *gpio;
190-
void __iomem *dart0;
191-
void __iomem *dart1;
192-
void __iomem *dart2;
193185

194186
struct iommu_domain *domain;
195187
unsigned long shift;

drivers/media/platform/apple/isp/isp-iommu.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,6 @@
66

77
#include "isp-iommu.h"
88

9-
void apple_isp_iommu_sync_ttbr(struct apple_isp *isp)
10-
{
11-
writel(readl(isp->dart0 + isp->hw->ttbr), isp->dart1 + isp->hw->ttbr);
12-
writel(readl(isp->dart0 + isp->hw->ttbr), isp->dart2 + isp->hw->ttbr);
13-
}
14-
15-
void apple_isp_iommu_invalidate_tlb(struct apple_isp *isp)
16-
{
17-
iommu_flush_iotlb_all(isp->domain);
18-
writel(0x1, isp->dart1 + isp->hw->stream_select);
19-
writel(isp->hw->stream_command_invalidate,
20-
isp->dart1 + isp->hw->stream_command);
21-
writel(0x1, isp->dart2 + isp->hw->stream_select);
22-
writel(isp->hw->stream_command_invalidate,
23-
isp->dart2 + isp->hw->stream_command);
24-
}
25-
269
static void isp_surf_free_pages(struct isp_surf *surf)
2710
{
2811
for (u32 i = 0; i < surf->num_pages && surf->pages[i] != NULL; i++) {
@@ -113,7 +96,6 @@ static int isp_surf_reserve_iova(struct apple_isp *isp, struct isp_surf *surf)
11396
static void isp_surf_iommu_unmap(struct apple_isp *isp, struct isp_surf *surf)
11497
{
11598
iommu_unmap(isp->domain, surf->iova, surf->size);
116-
apple_isp_iommu_invalidate_tlb(isp);
11799
sg_free_table(&surf->sgt);
118100
}
119101

@@ -270,6 +252,5 @@ int apple_isp_iommu_map_sgt(struct apple_isp *isp, struct isp_surf *surf,
270252
void apple_isp_iommu_unmap_sgt(struct apple_isp *isp, struct isp_surf *surf)
271253
{
272254
iommu_unmap(isp->domain, surf->iova, surf->size);
273-
apple_isp_iommu_invalidate_tlb(isp);
274255
isp_surf_unreserve_iova(isp, surf);
275256
}

drivers/media/platform/apple/isp/isp-iommu.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include "isp-drv.h"
88

9-
void apple_isp_iommu_sync_ttbr(struct apple_isp *isp);
10-
void apple_isp_iommu_invalidate_tlb(struct apple_isp *isp);
11-
129
struct isp_surf *__isp_alloc_surface(struct apple_isp *isp, u64 size, bool gc);
1310
#define isp_alloc_surface(isp, size) (__isp_alloc_surface(isp, size, false))
1411
#define isp_alloc_surface_gc(isp, size) (__isp_alloc_surface(isp, size, true))

0 commit comments

Comments
 (0)