From: Tom Rini Date: Tue, 7 Jul 2020 16:08:59 -0400 Subject: [PATCH v4 1/5] cmd: bind: allow to bind driver with driver data In-Reply-To: <20200430100619.28557-2-patrice.chotard@st.com> References: <20200430100619.28557-1-patrice.chotard@st.com> <20200430100619.28557-2-patrice.chotard@st.com> Message-ID: <20200707200859.GA10034@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 30, 2020 at 12:06:15PM +0200, Patrice Chotard wrote: > Initial implementation invokes device_bind_with_driver_data() > with driver_data parameter equal to 0. > For driver with driver data, the bind command can't bind > correctly this driver or even worse causes data abort as shown below: > > As example, for debug purpose on STM32MP1 platform, ethernet (dwc_eth_qos.c) > driver needed to be unbinded/binded. This driver is using driver data: > > static const struct udevice_id eqos_ids[] = { > { > .compatible = "nvidia,tegra186-eqos", > .data = (ulong)&eqos_tegra186_config > }, > { > .compatible = "snps,dwmac-4.20a", > .data = (ulong)&eqos_stm32_config > }, > > { } > }; > > After unbinding/binding this driver and probing it (with the dhcp command), > we got a prefetch abort as below: > > STM32MP> unbind eth ethernet at 5800a000 > STM32MP> bind /soc/ethernet at 5800a000 eth_eqos > STM32MP> dhcp > prefetch abort > pc : [<4310801c>] lr : [] > reloc pc : [<035ba01c>] lr : [] > sp : fdaf19b0 ip : ffcea83c fp : 00000001 > r10: ffcfd4a0 r9 : fdaffed0 r8 : 00000000 > r7 : ffcff304 r6 : fdc63220 r5 : 00000000 r4 : fdc5b108 > r3 : 43108020 r2 : 00003d39 r1 : ffcea544 r0 : fdc63220 > Flags: nZCv IRQs off FIQs off Mode SVC_32 > Code: data abort > pc : [] lr : [] > reloc pc : [] lr : [] > sp : fdaf18b8 ip : 00000000 fp : 00000001 > r10: ffcd69b2 r9 : fdaffed0 r8 : ffcd69aa > r7 : 00000000 r6 : 00000008 r5 : 4310801c r4 : fffffffc > r3 : 00000001 r2 : 00000028 r1 : 00000000 r0 : 00000006 > Flags: NzCv IRQs on FIQs on Mode SVC_32 (T) > Code: 2f00 d1e9 2c00 dce9 (f855) 2024 > Resetting CPU ... > > Signed-off-by: Patrice Chotard > Cc: Jean-Jacques Hiblot > Reviewed-by: Simon Glass Sorry for the delay in getting to this. Currently, this breaks the dm unit tests on sandbox, can you please investigate? Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: