From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 A00C3363C5F for ; Tue, 7 Apr 2026 15:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775575179; cv=none; b=QFEkMfgfXP4eKmGzZ6y+KfghKIrBYiqAEwUweIdEM24dOTOkgcTs3E0s3tARhty2ddqyAGg8Zm0IzitRJ+8bTKYzpCcbiR6ys0Evqx65vtKmFXIND2nChkLbylmTbAWwzvj0U6QH/3SNfpjL46Qs7G2I+K2HYkrtqnjhw5i+nfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775575179; c=relaxed/simple; bh=Esr4m/CWzlzGxIEXM4jv9Iy3Hrt7tqhgId2RGV+BjP0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rz81w6tNBjjwc6nrLwmFHFU+LruolWd2ojz4bByMS4/6svtAD/MbxCYXn493L2RvrQj/w8VssQ4/fLXhD3xIitAnG91eh5dIvDK20rIiLdIFzpNr7J0b/fZ3AHivxcEjyi9vVVya/jiTJqEX+PzWudk3DfZzVAQVm0SAdeCfmsA= 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=K6cdDzB7; arc=none smtp.client-ip=209.85.210.173 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="K6cdDzB7" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-82a7ebc729dso2216889b3a.3 for ; Tue, 07 Apr 2026 08:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775575178; x=1776179978; 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=px+aTSO680+yUdTUoCh2tkBc+4urCGyGCdnmZi+tHi8=; b=K6cdDzB7ua+XmUA45Lin2VIetbvOKK/wffm12AUzyrjYmXFM7xFiV/uSKyfro+dRGI LvOmiOJV7FGxpHyU6Qqgw4m6wNQpOYsAmIDUGtVsqSUf0JOPvZxq1HdtJCD0zvjC4amt EJHElZY0TavY/qe0hyynWCUYg1LJoD1dirDPUG/cenqb/huHbhPe8qIFIKHpDjHNHiMn ldzB/5QgnWWAEWaWJW718D4B357YF2H//3LSJwybmqoWrnFyJu05+MubTS6iMVdOjHSv GQDi/1WTw7OD/Wr8w+PdFxf65c8jGRRsFZYNworRYp/sUl0/9uwCSsg+vMvNmMDJqES5 yJCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775575178; x=1776179978; 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=px+aTSO680+yUdTUoCh2tkBc+4urCGyGCdnmZi+tHi8=; b=oy8WzOnlAjiyPvlvJtB7TvcExg7vbCxvYUOrBby77iF1CbQ7OOv4AZrwIeGL8bCsKj bQMBZCxxoD3LZtNDd3CWB/JumGm9cLAV1Wtlbt5rCA50EFlI89RvLdsIEBI/142bGOsz DpW1Z1III7WtX2x5NBBDJUvbLnoBYR/KVSZKxz8l6syWiU/6SGWRs13fUQCS3u9K1C7z v+5ZMhU1LdLRDZBf2POqciGEKxZI4GzDdNhLvg8DV9K2qt3aKQ1VjGedgzlfbLDHiMxU SwWt4mlWEqrC0r1QGLaPW277rYYvV6v/rWi44mao86Lfu458h2NP9L7S3E32YmzDOqcH eE7Q== X-Forwarded-Encrypted: i=1; AJvYcCVBqP5yvOP/rMdGcMpm7kLjUNF2r+KyhEwsT6H3HJUcegFLYIRD6fExRbmpBN0EyfTxfAYg4Euj8npqSuA=@vger.kernel.org X-Gm-Message-State: AOJu0YxCO/dynvyoa6+sb1AxOGlIwYktgq8htaHDjrkL9ANcT75Q3ynN BI15LYKmmVxy+wkeE0+UvoNXPmwLJSh6b9axYRPkTjIQvThgRwpM3pD7yJwQ1IbIbAs= X-Gm-Gg: AeBDievGzMMLkWn6t8eU1spbgotABj3J/nRZJ6Z/9f2eC8XJxN538CCxOt2RPGUli5S o4HzKo0F7uOV0HcQSlhDAjGNojZGU/xQjY1UaNuCC1vEPmOiW9FGD6SvnU+9saGfTKznnDWZaTM e3G/vvetp7HOBzPcLdO6EM9JN3x/Pt4hZx3qt2gEBRO5ONTzU4CpWyfS1Vhu157p/QfYl+KoYKC n+POBYaYPgSoSNVTbaznn3Yb9Vg0NrRWoWC01JwAzxxdmFf8lOXhJ4dPXKxrSuEB1hMKC6LVt9f 49dEv1XgQbhYrTZMm5VYk5qdD+KhmG0Zt/apO71r4WL8xbuGVj5wOw4P0aESyK15Yqv0o7hUmE7 mlba4DdXSZW5MCQmKJ/OghljaYfNozKP0CNHdZUuf02fQOj1gznZQY/urI96J1yTyOSddQdTndl zjFy7HlCAAIcg1CHyQjvR9QQ21m+A= X-Received: by 2002:a05:6a00:3926:b0:7f7:2f82:9904 with SMTP id d2e1a72fcca58-82d0da2c50cmr17909669b3a.5.1775575177733; Tue, 07 Apr 2026 08:19:37 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:97a2:befd:d439:79fb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82cf9c6ba2fsm18101364b3a.45.2026.04.07.08.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 08:19:37 -0700 (PDT) Date: Tue, 7 Apr 2026 09:19:34 -0600 From: Mathieu Poirier To: Peng Fan Cc: 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, Peng Fan 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 Tue, Mar 31, 2026 at 10:49:32AM +0800, Peng Fan wrote: > On Mon, Mar 30, 2026 at 10:22:35AM -0600, Mathieu Poirier wrote: > >On Fri, Mar 27, 2026 at 10:42:03AM +0800, Peng Fan (OSS) wrote: > >> From: Peng Fan > >> > >> Cortex-M[7,33] processors use a fixed reset vector table format: > >> > >> 0x00 Initial SP value > >> 0x04 Reset vector > >> 0x08 NMI > >> 0x0C ... > >> ... > >> IRQ[n] > >> > >> In ELF images, the corresponding layout is: > >> > >> reset_vectors: --> hardware reset address > >> .word __stack_end__ > >> .word Reset_Handler > >> .word NMI_Handler > >> .word HardFault_Handler > >> ... > >> .word UART_IRQHandler > >> .word SPI_IRQHandler > >> ... > >> > >> Reset_Handler: --> ELF entry point address > >> ... > >> > >> The hardware fetches the first two words from reset_vectors and populates > >> SP with __stack_end__ and PC with Reset_Handler. Execution proceeds from > >> Reset_Handler. > >> > >> However, the ELF entry point does not always match the hardware reset > >> address. For example, on i.MX94 CM33S: > >> > >> ELF entry point: 0x0ffc211d > >> hardware reset base: 0x0ffc0000 (default reset value, sw programmable) > >> > > > >But why? Why can't the ELF image be set to the right reset base? > > Per zephyr general link script[1]: > ENTRY(CONFIG_KERNEL_ENTRY) > > CONFIG_KERNEL_ENTRY(_start) is the first instruction that Cortex-M starts to > execute. > > config KERNEL_ENTRY > string "Kernel entry symbol" > default "__start" > help > Code entry symbol, to be set at linking phase. > > The hardware reset base is different: it is the address where the hardware > fetches the initial MSP and PC values from the vector table. Hardware uses > this base to initialize the stack pointer and program counter, and only then > does the Cortex‑M begin execution at the reset handler. That part is clear. > > 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. > 1, Semantic mismatch (ELF vs. hardware behavior) > 2, Debuggers may attempt to set breakpoints or start execution at the entry symbol > > [1] https://elixir.bootlin.com/zephyr/v4.4.0-rc1/source/include/zephyr/arch/arm/cortex_m/scripts/linker.ld#L103 > > Regards > Peng. > >