Skip to content

Commit be36c9c

Browse files
committed
Add "no-reset" DT property to optionally avoid resetting the SEC
In cases where the SHARC cores absolutely must be booted before ARM Linux, applications utilizing ADI's SHARC FreeRTOS image will crash if the SEC is reset due to using the SEC for the rescheduler interrupt. This is due to a silicon anomaly that prevents utilizing SHARC core-level interrupts instead of the SEC. Therefore, an optional DT property is added to the SEC driver which allows NOT resetting the SEC in the event that an RTOS-based application is running prior to ARM Linux booting. - Add boolean "no-reset" property to DT bindings for ADI SEC driver - Add condition check to NOT reset the SEC if "no-reset" is set in DT Signed-off-by: Brandon Hurst <brandon.hurst97@gmail.com>
1 parent 22c9d49 commit be36c9c

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

Documentation/devicetree/bindings/soc/adi/adi,system-event-controller.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ properties:
2929
$ref: /schemas/types.yaml#/definitions/uint32
3030
description: Number of SHARC cores available
3131

32+
"no-reset":
33+
description: "Prevents resetting the SEC to preserve interrupts"
34+
type: boolean
35+
3236
required:
3337
- compatible
3438
- reg

drivers/soc/adi/mach-sc5xx/sec.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,24 @@ static int adi_sec_probe(struct platform_device *pdev)
209209

210210
adi_sec->ioaddr = base;
211211

212-
/* Disable SYSCD_RESETb and clear RCU reset status */
213-
adi_rcu_writel(0x00, adi_rcu, ADI_RCU_REG_CTL);
214-
adi_rcu_writel(0x0f, adi_rcu, ADI_RCU_REG_STAT);
215-
216-
/* Reset SEC */
217-
adi_sec_writel(0x02, adi_sec, ADI_SEC_REG_GCTL);
218-
adi_sec_writel(0x02, adi_sec, ADI_SEC_REG_FCTL);
219-
220-
/* Initialize each core */
221-
for (cores = 0; cores < adi_sec->cores; ++cores) {
222-
adi_sec_writel(0x02, adi_sec,
223-
ADI_SEC_REG_CCTL_BASE + (cores +
224-
1) *
225-
ADI_SEC_CCTL_SIZE);
212+
if ( !(of_property_read_bool(np, "no-reset")) ) {
213+
/* Disable SYSCD_RESETb and clear RCU reset status */
214+
adi_rcu_writel(0x00, adi_rcu, ADI_RCU_REG_CTL);
215+
adi_rcu_writel(0x0f, adi_rcu, ADI_RCU_REG_STAT);
216+
217+
/* Reset SEC */
218+
adi_sec_writel(0x02, adi_sec, ADI_SEC_REG_GCTL);
219+
adi_sec_writel(0x02, adi_sec, ADI_SEC_REG_FCTL);
220+
221+
/* Initialize each core */
222+
for (cores = 0; cores < adi_sec->cores; ++cores) {
223+
adi_sec_writel(0x02, adi_sec,
224+
ADI_SEC_REG_CCTL_BASE + (cores +
225+
1) *
226+
ADI_SEC_CCTL_SIZE);
227+
}
228+
udelay(100);
226229
}
227-
udelay(100);
228230

229231
/* Enable SEC fault event */
230232
adi_sec_writel(0x01, adi_sec, ADI_SEC_REG_GCTL);

0 commit comments

Comments
 (0)