[1/5] arm64: zynqmp: Add firmware DT node
diff mbox series

Message ID 20191018160735.15658-2-m.tretter@pengutronix.de
State New
Headers show
Series
  • arm64: zynqmp: add firmware device tree node
Related show

Commit Message

Michael Tretter Oct. 18, 2019, 4:07 p.m. UTC
From: Rajan Vaja <rajan.vaja@xilinx.com>

Add firmware DT node in ZynqMP device tree. This node
uses bindings as per new firmware interface driver.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Guenter Roeck Dec. 8, 2019, 10:38 p.m. UTC | #1
On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> 
> Add firmware DT node in ZynqMP device tree. This node
> uses bindings as per new firmware interface driver.
> 
> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

With this patch applied in the mainline kernel, the qemu xlnx-zcu102
emulation crashes (see below). Any idea what it might take to get
qemu back to working ?

Thanks,
Guenter

---
[   30.719268] ------------[ cut here ]------------
[   30.719403] kernel BUG at arch/arm64/kernel/traps.c:406!
[   30.719971] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[   30.720358] Modules linked in:
[   30.720741] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.4.0-13331-g9455d25f4e3b #1
[   30.720852] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[   30.721157] pstate: 00000005 (nzcv daif -PAN -UAO)
[   30.721261] pc : do_undefinstr+0x2f4/0x318
[   30.721336] lr : do_undefinstr+0x1fc/0x318
[   30.721410] sp : ffff80001003b930
[   30.721486] x29: ffff80001003b930 x28: ffff00007d178040
[   30.721597] x27: 0000000000000000 x26: ffff8000117d0514
[   30.721683] x25: ffff8000118c90d0 x24: 0000000000000000
[   30.721769] x23: 0000000040000005 x22: 00000000d4000003
[   30.721854] x21: ffff800011e1c850 x20: ffff80001003b990
[   30.721940] x19: ffff800011e0fa08 x18: 0000000000000001
[   30.722025] x17: ffff800010c0f1d8 x16: ffff800010c11fb8
[   30.722111] x15: ffffffffffffffff x14: ffffffffffffffff
[   30.722196] x13: 0000000000000018 x12: 0101010101010101
[   30.722281] x11: 0000000000000000 x10: 00000000628e21fa
[   30.722384] x9 : ffff00007d178858 x8 : ffff00007d178880
[   30.722471] x7 : ffff80001003b8b0 x6 : 0000000000000001
[   30.722560] x5 : 0000000000000001 x4 : 0000000000000001
[   30.722646] x3 : 0000000000000000 x2 : 00000000000174b1
[   30.722730] x1 : ffff00007d178040 x0 : 0000000040000005
[   30.722913] Call trace:
[   30.722993]  do_undefinstr+0x2f4/0x318
[   30.723070]  el1_sync_handler+0xb0/0x108
[   30.723138]  el1_sync+0x7c/0x100
[   30.723201]  __arm_smccc_smc+0x0/0x2c
[   30.723272]  zynqmp_pm_get_api_version.part.1+0x40/0x68
[   30.723352]  zynqmp_firmware_probe+0xbc/0x298
Michal Simek Dec. 9, 2019, 6:42 a.m. UTC | #2
Hi, +Edgar


On 08. 12. 19 23:38, Guenter Roeck wrote:
> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>
>> Add firmware DT node in ZynqMP device tree. This node
>> uses bindings as per new firmware interface driver.
>>
>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> 
> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
> emulation crashes (see below). Any idea what it might take to get
> qemu back to working ?

Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
concept is working with mainline qemu. But crash is too hard. It should
be no response from PMU and then this panic.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/xilinx/zynqmp.c?h=v5.5-rc1#n728

Edgar: can you please comment this?

Thanks,
Michal
Guenter Roeck Dec. 9, 2019, 7:19 a.m. UTC | #3
On 12/8/19 10:42 PM, Michal Simek wrote:
> Hi, +Edgar
> 
> 
> On 08. 12. 19 23:38, Guenter Roeck wrote:
>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>
>>> Add firmware DT node in ZynqMP device tree. This node
>>> uses bindings as per new firmware interface driver.
>>>
>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>
>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>> emulation crashes (see below). Any idea what it might take to get
>> qemu back to working ?
> 
> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
> concept is working with mainline qemu. But crash is too hard. It should
> be no response from PMU and then this panic.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/xilinx/zynqmp.c?h=v5.5-rc1#n728
> 

Isn't that a bit harsh too ? Normally one would print an error message
and abort driver instantiation.

It sounds like you are saying that qemu's xlnx-zcu102 emulation is
no longer supported and expected to crash the kernel. Is this a
correct assumption ? If so, I'll drop it from my list of tests.

Thanks,
Guenter
Edgar E. Iglesias Dec. 9, 2019, 7:48 a.m. UTC | #4
On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
> On 12/8/19 10:42 PM, Michal Simek wrote:
> > Hi, +Edgar
> > 
> > 
> > On 08. 12. 19 23:38, Guenter Roeck wrote:
> > > On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
> > > > From: Rajan Vaja <rajan.vaja@xilinx.com>
> > > > 
> > > > Add firmware DT node in ZynqMP device tree. This node
> > > > uses bindings as per new firmware interface driver.
> > > > 
> > > > Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> > > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > 
> > > With this patch applied in the mainline kernel, the qemu xlnx-zcu102
> > > emulation crashes (see below). Any idea what it might take to get
> > > qemu back to working ?
> > 
> > Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
> > concept is working with mainline qemu. But crash is too hard. It should

Yes, QEMU doesn't support the Cortex-A53s along with the PMU MicroBlaze.

My workaround when using upstream QEMU is a modified DT without the PMU firmware
and with fixed-clock nodes.


> > be no response from PMU and then this panic.
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/xilinx/zynqmp.c?h=v5.5-rc1#n728
> > 
> 
> Isn't that a bit harsh too ? Normally one would print an error message
> and abort driver instantiation.

I agree, it would be nice if ATF & kernel drivers would somehow handle
this more gracefully.

Cheers,
Edgar


> 
> It sounds like you are saying that qemu's xlnx-zcu102 emulation is
> no longer supported and expected to crash the kernel. Is this a
> correct assumption ? If so, I'll drop it from my list of tests.
> 
> Thanks,
> Guenter
Michal Simek Dec. 9, 2019, 8:33 a.m. UTC | #5
On 09. 12. 19 8:48, Edgar E. Iglesias wrote:
> On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
>> On 12/8/19 10:42 PM, Michal Simek wrote:
>>> Hi, +Edgar
>>>
>>>
>>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>>
>>>>> Add firmware DT node in ZynqMP device tree. This node
>>>>> uses bindings as per new firmware interface driver.
>>>>>
>>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>>
>>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>>> emulation crashes (see below). Any idea what it might take to get
>>>> qemu back to working ?
>>>
>>> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
>>> concept is working with mainline qemu. But crash is too hard. It should
> 
> Yes, QEMU doesn't support the Cortex-A53s along with the PMU MicroBlaze.
> 
> My workaround when using upstream QEMU is a modified DT without the PMU firmware
> and with fixed-clock nodes.

IIRC you said that there is still discussion how to upstream this.
Fixed clock should work for u-boot too. But SPL reads that registers
directly. Are you implementing them with any default values?

> 
> 
>>> be no response from PMU and then this panic.
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/xilinx/zynqmp.c?h=v5.5-rc1#n728
>>>
>>
>> Isn't that a bit harsh too ? Normally one would print an error message
>> and abort driver instantiation.
> 
> I agree, it would be nice if ATF & kernel drivers would somehow handle
> this more gracefully.

Rajan: can you please take a look at it?

Thanks,
Michal
Michal Simek Dec. 9, 2019, 8:36 a.m. UTC | #6
On 09. 12. 19 8:19, Guenter Roeck wrote:
> On 12/8/19 10:42 PM, Michal Simek wrote:
>> Hi, +Edgar
>>
>>
>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>
>>>> Add firmware DT node in ZynqMP device tree. This node
>>>> uses bindings as per new firmware interface driver.
>>>>
>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>
>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>> emulation crashes (see below). Any idea what it might take to get
>>> qemu back to working ?
>>
>> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
>> concept is working with mainline qemu. But crash is too hard. It should
>> be no response from PMU and then this panic.
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/xilinx/zynqmp.c?h=v5.5-rc1#n728
>>
>>
> 
> Isn't that a bit harsh too ? Normally one would print an error message
> and abort driver instantiation.

Using different DT as Edgar mentioned should work but the question is
how to properly wire it up.
Edgar: What about "simply" generate that DT by qemu model based on what
implementation is available?


> 
> It sounds like you are saying that qemu's xlnx-zcu102 emulation is
> no longer supported and expected to crash the kernel. Is this a
> correct assumption ? If so, I'll drop it from my list of tests.

Let's discuss this first. I definitely appreciate that you run these tests.

Thanks,
Michal
Guenter Roeck Dec. 9, 2019, 2:32 p.m. UTC | #7
On 12/8/19 11:48 PM, Edgar E. Iglesias wrote:
> On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
>> On 12/8/19 10:42 PM, Michal Simek wrote:
>>> Hi, +Edgar
>>>
>>>
>>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>>
>>>>> Add firmware DT node in ZynqMP device tree. This node
>>>>> uses bindings as per new firmware interface driver.
>>>>>
>>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>>
>>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>>> emulation crashes (see below). Any idea what it might take to get
>>>> qemu back to working ?
>>>
>>> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
>>> concept is working with mainline qemu. But crash is too hard. It should
> 
> Yes, QEMU doesn't support the Cortex-A53s along with the PMU MicroBlaze.
> 
> My workaround when using upstream QEMU is a modified DT without the PMU firmware
> and with fixed-clock nodes.
> 

I can't do that for my boot tests. Normally I would just disable ZYNQMP_FIRMWARE,
but that is hard enabled with ARCH_ZYNQMP. I'll have to drop those tests,
unfortunately, if the firmware driver is considered mandatory.

Guenter
Michal Simek Dec. 9, 2019, 3:02 p.m. UTC | #8
On 09. 12. 19 15:32, Guenter Roeck wrote:
> On 12/8/19 11:48 PM, Edgar E. Iglesias wrote:
>> On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
>>> On 12/8/19 10:42 PM, Michal Simek wrote:
>>>> Hi, +Edgar
>>>>
>>>>
>>>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>>>
>>>>>> Add firmware DT node in ZynqMP device tree. This node
>>>>>> uses bindings as per new firmware interface driver.
>>>>>>
>>>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>>>
>>>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>>>> emulation crashes (see below). Any idea what it might take to get
>>>>> qemu back to working ?
>>>>
>>>> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
>>>> concept is working with mainline qemu. But crash is too hard. It should
>>
>> Yes, QEMU doesn't support the Cortex-A53s along with the PMU MicroBlaze.
>>
>> My workaround when using upstream QEMU is a modified DT without the
>> PMU firmware
>> and with fixed-clock nodes.
>>
> 
> I can't do that for my boot tests. Normally I would just disable
> ZYNQMP_FIRMWARE,
> but that is hard enabled with ARCH_ZYNQMP. I'll have to drop those tests,
> unfortunately, if the firmware driver is considered mandatory.

We can make it optional.
Rajan: please send a patch for it.

M
Guenter Roeck Dec. 15, 2019, 5:28 a.m. UTC | #9
On 12/9/19 7:02 AM, Michal Simek wrote:
> On 09. 12. 19 15:32, Guenter Roeck wrote:
>> On 12/8/19 11:48 PM, Edgar E. Iglesias wrote:
>>> On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
>>>> On 12/8/19 10:42 PM, Michal Simek wrote:
>>>>> Hi, +Edgar
>>>>>
>>>>>
>>>>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>>>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>>>>
>>>>>>> Add firmware DT node in ZynqMP device tree. This node
>>>>>>> uses bindings as per new firmware interface driver.
>>>>>>>
>>>>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>>>>
>>>>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>>>>> emulation crashes (see below). Any idea what it might take to get
>>>>>> qemu back to working ?
>>>>>
>>>>> Driver talks through ATF to PMU unit(microblaze). I don't think A53+MB
>>>>> concept is working with mainline qemu. But crash is too hard. It should
>>>
>>> Yes, QEMU doesn't support the Cortex-A53s along with the PMU MicroBlaze.
>>>
>>> My workaround when using upstream QEMU is a modified DT without the
>>> PMU firmware
>>> and with fixed-clock nodes.
>>>
>>
>> I can't do that for my boot tests. Normally I would just disable
>> ZYNQMP_FIRMWARE,
>> but that is hard enabled with ARCH_ZYNQMP. I'll have to drop those tests,
>> unfortunately, if the firmware driver is considered mandatory.
> 
> We can make it optional.
> Rajan: please send a patch for it.
> 

I'll disable the related boot tests for now. If/when this is fixed, let me know,
and I'll re-enable it.

Guenter
Michal Simek Dec. 16, 2019, 6:28 a.m. UTC | #10
On 15. 12. 19 6:28, Guenter Roeck wrote:
> On 12/9/19 7:02 AM, Michal Simek wrote:
>> On 09. 12. 19 15:32, Guenter Roeck wrote:
>>> On 12/8/19 11:48 PM, Edgar E. Iglesias wrote:
>>>> On Sun, Dec 08, 2019 at 11:19:33PM -0800, Guenter Roeck wrote:
>>>>> On 12/8/19 10:42 PM, Michal Simek wrote:
>>>>>> Hi, +Edgar
>>>>>>
>>>>>>
>>>>>> On 08. 12. 19 23:38, Guenter Roeck wrote:
>>>>>>> On Fri, Oct 18, 2019 at 06:07:31PM +0200, Michael Tretter wrote:
>>>>>>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>>>>>>
>>>>>>>> Add firmware DT node in ZynqMP device tree. This node
>>>>>>>> uses bindings as per new firmware interface driver.
>>>>>>>>
>>>>>>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>>> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
>>>>>>>
>>>>>>> With this patch applied in the mainline kernel, the qemu xlnx-zcu102
>>>>>>> emulation crashes (see below). Any idea what it might take to get
>>>>>>> qemu back to working ?
>>>>>>
>>>>>> Driver talks through ATF to PMU unit(microblaze). I don't think
>>>>>> A53+MB
>>>>>> concept is working with mainline qemu. But crash is too hard. It
>>>>>> should
>>>>
>>>> Yes, QEMU doesn't support the Cortex-A53s along with the PMU
>>>> MicroBlaze.
>>>>
>>>> My workaround when using upstream QEMU is a modified DT without the
>>>> PMU firmware
>>>> and with fixed-clock nodes.
>>>>
>>>
>>> I can't do that for my boot tests. Normally I would just disable
>>> ZYNQMP_FIRMWARE,
>>> but that is hard enabled with ARCH_ZYNQMP. I'll have to drop those
>>> tests,
>>> unfortunately, if the firmware driver is considered mandatory.
>>
>> We can make it optional.
>> Rajan: please send a patch for it.
>>
> 
> I'll disable the related boot tests for now. If/when this is fixed, let
> me know,
> and I'll re-enable it.

ok. Sure.

Thanks,
Michal

Patch
diff mbox series

diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
index 9aa67340a4d8..9115eaebbf70 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
@@ -115,6 +115,13 @@ 
 		method = "smc";
 	};
 
+	firmware {
+		zynqmp_firmware: zynqmp-firmware {
+			compatible = "xlnx,zynqmp-firmware";
+			method = "smc";
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupt-parent = <&gic>;