Skip to content

Commit 0aaf191

Browse files
sumanannaandersson
authored andcommitted
remoteproc/omap: Add support for DRA7xx remote processors
DRA7xx/AM57xx SoCs have two IPU and up to two DSP processor subsystems for offloading different computation algorithms. The IPU processor subsystem contains dual-core ARM Cortex-M4 processors, and is very similar to those on OMAP5. The DSP processor subsystem is based on the TI's standard TMS320C66x DSP CorePac core. Support has been added to the OMAP remoteproc driver through new DRA7xx specific compatibles for properly probing and booting all the different processor subsystem instances on DRA7xx/AM57xx SoCs - IPU1, IPU2, DSP1 & DSP2. A build dependency with SOC_DRA7XX is added to enable the driver to be built in DRA7xx-only configuration. The DSP boot address programming needed enhancement for DRA7xx as the boot register fields are different on DRA7 compared to OMAP4 and OMAP5 SoCs. The register on DRA7xx contains additional fields within the register and the boot address bit-field is right-shifted by 10 bits. The internal memory parsing logic has also been updated to compute the device addresses for the L2 RAM for DSP devices using relative addressing logic, and to parse two additional RAMs at L1 level - L1P and L1D. This allows the remoteproc driver to support loading into these regions for a small subset of firmware images requiring as such. The most common usage would be to use the L1 programmable RAMs as L1 Caches. The firmware lookup logic also has to be adjusted for DRA7xx as there are (can be) more than one instance of both the IPU and DSP remote processors for the first time in OMAP4+ SoCs. Signed-off-by: Suman Anna <[email protected]> [[email protected]: moved address translation quirks to pdata] Signed-off-by: Tero Kristo <[email protected]> Reviewed-by: Andrew F. Davis <[email protected]> Acked-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent f4af5bd commit 0aaf191

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

drivers/remoteproc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ config MTK_SCP
3535

3636
config OMAP_REMOTEPROC
3737
tristate "OMAP remoteproc support"
38-
depends on ARCH_OMAP4 || SOC_OMAP5
38+
depends on ARCH_OMAP4 || SOC_OMAP5 || SOC_DRA7XX
3939
depends on OMAP_IOMMU
4040
select MAILBOX
4141
select OMAP2PLUS_MBOX

drivers/remoteproc/omap_remoteproc.c

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@
3434
* struct omap_rproc_boot_data - boot data structure for the DSP omap rprocs
3535
* @syscon: regmap handle for the system control configuration module
3636
* @boot_reg: boot register offset within the @syscon regmap
37+
* @boot_reg_shift: bit-field shift required for the boot address value in
38+
* @boot_reg
3739
*/
3840
struct omap_rproc_boot_data {
3941
struct regmap *syscon;
4042
unsigned int boot_reg;
43+
unsigned int boot_reg_shift;
4144
};
4245

4346
/**
@@ -161,14 +164,19 @@ static int omap_rproc_write_dsp_boot_addr(struct rproc *rproc)
161164
struct omap_rproc *oproc = rproc->priv;
162165
struct omap_rproc_boot_data *bdata = oproc->boot_data;
163166
u32 offset = bdata->boot_reg;
167+
u32 value;
168+
u32 mask;
164169

165170
if (rproc->bootaddr & (SZ_1K - 1)) {
166171
dev_err(dev, "invalid boot address 0x%llx, must be aligned on a 1KB boundary\n",
167172
rproc->bootaddr);
168173
return -EINVAL;
169174
}
170175

171-
return regmap_write(bdata->syscon, offset, rproc->bootaddr);
176+
value = rproc->bootaddr >> bdata->boot_reg_shift;
177+
mask = ~(SZ_1K - 1) >> bdata->boot_reg_shift;
178+
179+
return regmap_update_bits(bdata->syscon, offset, mask, value);
172180
}
173181

174182
/*
@@ -297,6 +305,13 @@ static const struct omap_rproc_mem_data ipu_mems[] = {
297305
{ },
298306
};
299307

308+
static const struct omap_rproc_mem_data dra7_dsp_mems[] = {
309+
{ .name = "l2ram", .dev_addr = 0x800000 },
310+
{ .name = "l1pram", .dev_addr = 0xe00000 },
311+
{ .name = "l1dram", .dev_addr = 0xf00000 },
312+
{ },
313+
};
314+
300315
static const struct omap_rproc_dev_data omap4_dsp_dev_data = {
301316
.device_name = "dsp",
302317
};
@@ -315,6 +330,16 @@ static const struct omap_rproc_dev_data omap5_ipu_dev_data = {
315330
.mems = ipu_mems,
316331
};
317332

333+
static const struct omap_rproc_dev_data dra7_dsp_dev_data = {
334+
.device_name = "dsp",
335+
.mems = dra7_dsp_mems,
336+
};
337+
338+
static const struct omap_rproc_dev_data dra7_ipu_dev_data = {
339+
.device_name = "ipu",
340+
.mems = ipu_mems,
341+
};
342+
318343
static const struct of_device_id omap_rproc_of_match[] = {
319344
{
320345
.compatible = "ti,omap4-dsp",
@@ -332,6 +357,14 @@ static const struct of_device_id omap_rproc_of_match[] = {
332357
.compatible = "ti,omap5-ipu",
333358
.data = &omap5_ipu_dev_data,
334359
},
360+
{
361+
.compatible = "ti,dra7-dsp",
362+
.data = &dra7_dsp_dev_data,
363+
},
364+
{
365+
.compatible = "ti,dra7-ipu",
366+
.data = &dra7_ipu_dev_data,
367+
},
335368
{
336369
/* end */
337370
},
@@ -384,6 +417,9 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
384417
return -EINVAL;
385418
}
386419

420+
of_property_read_u32_index(np, "ti,bootreg", 2,
421+
&oproc->boot_data->boot_reg_shift);
422+
387423
return 0;
388424
}
389425

0 commit comments

Comments
 (0)