From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD2A230B508 for ; Wed, 8 Apr 2026 15:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775663198; cv=none; b=NzRQbCCUi9ouwBbqA879oY9lgLAiI1UgwcOFDD7dDqrJE/qXl6t70wzsePznTwa13nMPOv0NsaRdoedkDMjorbtzpcG7ziU+GURB+rduLIoxGMOJAtDSTH4nEd7/dgCGkT06Klwi29X615xNu0+yGre4ppGY7KYMI3AKF7FIyBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775663198; c=relaxed/simple; bh=V1TTOcmexzvL0zMGH90+djDV/QILglULKt5i2NNrPeY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PdM5WgAI4PEyD0R6EHxJA/KRupSjXnizsBuG3b+gni8PBZhUi9uVS1LE2EEHoHk9OA9KJo2uBbmAIp2Rv0n0yaKWTNJn3yJ9FyfAuXcguPAs8mXj2/Y7mp4KzR6dt8zNHGGmL2DLmVPSqM4PM0fm/rLvomfGJfaYug9xLnndZM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BA9JNBzd; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BA9JNBzd" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-82c68339cf0so597706b3a.0 for ; Wed, 08 Apr 2026 08:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775663196; x=1776267996; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=R5zH5Yy++LFl5X1883WPkm0h00qGtgJqcjU1g/XLy30=; b=BA9JNBzd8Lb5daOid6hiG9Ov+QJr/xcwSHdoZnhDrGwyM/pXzemiBr/II69zar3dgK rrZ+lUHwML0QwZUbzcBJsF+m85dKq4Kpbk/DS15pSiieEuDA4N7F05DzMRRXzt/gJyf1 PNxY+WxWcPbW1MO6Ih27q6ErPhRjAeRXkfZVul534Kf0j9mnENHwjhkKCpcBpt/kuRC6 9onxKxpLgQ8KORiXelstlPUtEJwYLNu55eUhBdL7WV0NCvroWZtLPsJqBrFM9Lww4vxb ytcIrwDzBqjfCqdX4VAAXJLouQWyNq8qWeF0ojTVTbSMP2DQfYETg6YD0d1JLFCKH31V dmcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775663196; x=1776267996; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R5zH5Yy++LFl5X1883WPkm0h00qGtgJqcjU1g/XLy30=; b=JrxVYHHsU00PDiw6H2Pe1uNO8rD7b0cS/kBSTKtOx2yKyFJvbGE5wVfZi6TlQcaTMX CVfBNYHwKqpVNGLfXl4rs4fPxOA2rETHQJdHgiMTfDSyNkGOso4/ZWTY/Dro1cTr9ndw HO9HSV5+j4ItorGYH2Y94wa4kQyUXqMW70h6gdv5xpXgTpZk9a/n0WgvV64YI6IeM47C xbv/dWzpxflDWXrddNYJRSTwmAYDyEe5IaMHcA9iD0zvxVtOdA5rfNa568mBUnk/8/+e orXz2MLkl3YhcytAZdrrBZHgplRy85R5yGztqBqoZOL6hf78/iwXqzQFki5v0ulHwyan rVwg== X-Forwarded-Encrypted: i=1; AJvYcCWfOfxbdW23VKsW+UxNRkfJ5oRjWPpOMXRnPG/xse8pI5R6GHQyhRcC6lcG39cj/kXBnk1NLxQApVxR9Gs=@vger.kernel.org X-Gm-Message-State: AOJu0YyFPuxYtqc12ItiAzEfhbN/2CijMDr66fybZGwGtVaGn5x3zSRt /7NCP4QImdo+zFmLbgi51bA973JnF9lr9QMaF3YZ/aSb7ZS3oNcXQt1IA8P9VHQFzRY= X-Gm-Gg: AeBDievtpJVrT4SjYx+axC37wYAwRdh1q+e2JWxs0PavsQxMvNIgi8/IpQgj4vJn/pT FpjAngxMYoAdbbN9vRnHPzSbLVReCnV3LCZb1wJu0V0hIUm77i1Qus2H1dtnrb09X65R/d17Te0 E4ZBslaoVyIzM680EW/5k0sFkFmzilKz13IuI+EWkMKRapzhFFCirFTa45lq//jeVgTxNqa9Dsd bK9lDgHEcFLlhGrGPULE8D/x0IbWXeQgAZXxeOGzvTcPh50x7Lv46TOJOYwN7kzHgOrEjcSOL5Q L/vZT/ZDSQ9kVZSa9ayDwNCz8RibKZ6DRFwAXgluitrW3Pikc3s7O5W4l8bjhpO2Gtw1eTILbVk BX/UORtAgFb5MyNTRyxdTBKmQIUQlPzw+KueQ3sVe428gZcKeGPPnXCOMgNjPmy53uAvhHhZLvY /OEJ48cnvTt+L4mZIlazjMTSTlzQ== X-Received: by 2002:a05:6a00:188e:b0:82a:170d:fe1d with SMTP id d2e1a72fcca58-82d001e92efmr22313731b3a.1.1775663196006; Wed, 08 Apr 2026 08:46:36 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:bec3:28f:3ce4:6925]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82cf9c41bc6sm21534378b3a.29.2026.04.08.08.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 08:46:35 -0700 (PDT) Date: Wed, 8 Apr 2026 09:46:32 -0600 From: Mathieu Poirier To: Peng Fan Cc: "Peng Fan (OSS)" , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Daniel Baluta , "linux-remoteproc@vger.kernel.org" , "devicetree@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 2/3] remoteproc: imx_rproc: Pass bootaddr to SM CPU/LMM reset vector Message-ID: References: <20260327-imx943-rproc-v2-0-a547a3588730@nxp.com> <20260327-imx943-rproc-v2-2-a547a3588730@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Apr 08, 2026 at 01:30:16AM +0000, Peng Fan wrote: > > Subject: Re: [PATCH v2 2/3] remoteproc: imx_rproc: Pass bootaddr to > > SM CPU/LMM reset vector > > > [...] > > > > > > > > Aligning the ELF entry point with the hardware reset base on > > Cortex‑M > > > systems is possible, but it comes with several risks. > > > > I'm not asking to align the ELF entry point with the hardware reset base. > > All I want is to have the correct start address embedded in the ELF file > > to avoid having to use a mask. > > I see, per my understanding: > FreeRTOS typically exposes __isr_vector, which corresponds to the hardware > reset / vector table base. > Zephyr (Cortex‑M) exposes _vector_table, which serves the same purpose. > I am not certain about other RTOSes, but the pattern seems consistent: > the vector table base is already available as a named ELF symbol. > > Given that, if the preferred approach is to parse the ELF and explicitly > retrieve the hardware reset base, I can update the implementation accordingly. > If you prefer to parse the elf file to get the hardware reset base, > I could update to use them. > > Options1: Something as below: > 1. Include rproc_elf_find_symbol in remoteproc_elf_loader.c > 2. Use below in imx_rproc.c > ret = rproc_elf_find_symbol(rproc, fw, "__isr_vector", &vector_base); > if (ret) > ret = rproc_elf_find_symbol(rproc, fw, "__vector_table", &vector_base); > > if (!ret) > rproc->bootaddr = vector_base > else > dev_info(dev, "no __isr_vector or __vector_table\n") No > > This makes the hardware reset base explicit, avoids masking e_entry. > > Option 2: User‑provided reset symbol via sysfs > As an alternative, we could expose a sysfs attribute, > e.g. reset_symbol, allowing users to specify the symbol name > to be used as the reset base: > > echo __isr_vector > /sys/class/remoteproc/remoteprocX/reset_symbol > Definitely not. The definition of e_entry in the specification is clear, i.e "the address of the entry point from where the process starts executing". If masking is required because the tool that puts the image together gets the wrong address, then it should be fixed. > The remoteproc core would then resolve that symbol from > the ELF and set rproc->bootaddr accordingly. > This provides maximum flexibility but does introduce a new user‑visible ABI, > so I see it more as an opt‑in or fallback mechanism. > > Please let me know which approach you prefer, and I will update > this series accordingly in v3.. > > Thanks, > Peng. > > > > > > > 1, Semantic mismatch (ELF vs. hardware behavior) 2, Debuggers may > > > attempt to set breakpoints or start execution at the entry symbol > > >