remoteproc: k3-r5: Fix rproc init failure on Split-mode _only_ devices
The R5F subsystem/cluster on K3 SoCs can support both LockStep and
Split-modes (superset) or just Split-mode depending on an eFUSE
capability register. The LockStep configuration bit is Read-only
though on Split-mode _only_ devices and as such the System Firmware
does not allow the LockStep mode bit to be configured on such devices.
The current logic in k3_r5f_rproc_configure() fails on Split-mode
devices because of this unconditional programming of the LockStep
mode bit, and results in the probe failure shown during the
"rproc init" step at U-Boot prompt.
Fix this by limiting the LockStep mode bit clear configuration only on
devices supporting both LockStep/Split-modes.
Fixes: 4c850356a8 ("remoteproc: Introduce K3 remoteproc driver for R5F subsystem")
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
			
			
This commit is contained in:
		
							parent
							
								
									0438a0a181
								
							
						
					
					
						commit
						445b45042c
					
				| 
						 | 
					@ -543,6 +543,7 @@ static int k3_r5f_rproc_configure(struct k3_r5f_core *core)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct k3_r5f_cluster *cluster = core->cluster;
 | 
						struct k3_r5f_cluster *cluster = core->cluster;
 | 
				
			||||||
	u32 set_cfg = 0, clr_cfg = 0, cfg, ctrl, sts;
 | 
						u32 set_cfg = 0, clr_cfg = 0, cfg, ctrl, sts;
 | 
				
			||||||
 | 
						bool lockstep_permitted;
 | 
				
			||||||
	u64 boot_vec = 0;
 | 
						u64 boot_vec = 0;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -560,8 +561,9 @@ static int k3_r5f_rproc_configure(struct k3_r5f_core *core)
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Sanity check for Lockstep mode */
 | 
						/* Sanity check for Lockstep mode */
 | 
				
			||||||
	if (cluster->mode && is_primary_core(core) &&
 | 
						lockstep_permitted = !!(sts &
 | 
				
			||||||
	    !(sts & PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED)) {
 | 
									PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED);
 | 
				
			||||||
 | 
						if (cluster->mode && is_primary_core(core) && !lockstep_permitted) {
 | 
				
			||||||
		dev_err(core->dev, "LockStep mode not permitted on this device\n");
 | 
							dev_err(core->dev, "LockStep mode not permitted on this device\n");
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
| 
						 | 
					@ -573,7 +575,7 @@ static int k3_r5f_rproc_configure(struct k3_r5f_core *core)
 | 
				
			||||||
		clr_cfg |= PROC_BOOT_CFG_FLAG_R5_TEINIT;
 | 
							clr_cfg |= PROC_BOOT_CFG_FLAG_R5_TEINIT;
 | 
				
			||||||
		if (cluster->mode == CLUSTER_MODE_LOCKSTEP)
 | 
							if (cluster->mode == CLUSTER_MODE_LOCKSTEP)
 | 
				
			||||||
			set_cfg |= PROC_BOOT_CFG_FLAG_R5_LOCKSTEP;
 | 
								set_cfg |= PROC_BOOT_CFG_FLAG_R5_LOCKSTEP;
 | 
				
			||||||
		else
 | 
							else if (lockstep_permitted)
 | 
				
			||||||
			clr_cfg |= PROC_BOOT_CFG_FLAG_R5_LOCKSTEP;
 | 
								clr_cfg |= PROC_BOOT_CFG_FLAG_R5_LOCKSTEP;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue