[U-Boot] imx: add lowlevel init for ARM64
diff mbox series

Message ID 20190415053345.30364-1-peng.fan@nxp.com
State Accepted
Commit 7a0c9b08886e5dc7d50e640ed56eed0fe612161f
Delegated to: Stefano Babic
Headers show
Series
  • [U-Boot] imx: add lowlevel init for ARM64
Related show

Commit Message

Peng Fan April 15, 2019, 5:20 a.m. UTC
Sometimes we met SERROR, but only to catch it when Linux boots up.
Let's enable catching in U-Boot to catch it ealier and ease debug.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/Makefile   |  2 +-
 arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-imx/lowlevel.S

Comments

Marcel Ziswiler April 26, 2019, 6:38 p.m. UTC | #1
Hi Peng and Stefano

Unfortunately, this seems to break Ethernet on Colibri iMX8X:

=> dhcp
"Error" handler, esr 0xbf000002
elr: 0000000080049664 lr : 000000008004964c (reloc)
elr: 00000000ffef6664 lr : 00000000ffef664c
x0 : 000000005b040288 x1 : 0000000000000001
x2 : 00000000fd6c5ff4 x3 : 0000000000000020
x4 : 00000000fd6c5ff0 x5 : 0000000000000020
x6 : 00000000ffef079c x7 : 00000000fd6f1600
x8 : 0000000000000044 x9 : 0000000000000008
x10: 00000000fd6d1620 x11: 00000000fd6d3a10
x12: 0000000000000000 x13: 0000000000000200
x14: 00000000fd6c62cc x15: 0000000000000002
x16: 0000000000002080 x17: 0000000000000000
x18: 00000000fd6cada8 x19: 00000000fd6d1160
x20: 0000000000000200 x21: 000000005b040300
x22: 00000000fd6f1000 x23: 00000000fd6cfdf0
x24: 00000000ffff8000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 00000000fd6d15c0 x29: 00000000fd6c6030

Resetting CPU ...

resetting ...

Reverting commit 5955c6eeb453 ("imx: add lowlevel init for ARM64")
makes it work again.

Unfortunately, I don't have a MEK in my home office but will check
Ethernet operation there on Monday as well.

Anyway, does anybody know what exactly is going on?

Cheers

Marcel

On Mon, 2019-04-15 at 05:20 +0000, Peng Fan wrote:
> Sometimes we met SERROR, but only to catch it when Linux boots up.
> Let's enable catching in U-Boot to catch it ealier and ease debug.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm/mach-imx/Makefile   |  2 +-
>  arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
>  2 files changed, 23 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-imx/lowlevel.S
> 
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index c3ed62aed6..37675d0558 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -204,7 +204,7 @@ endif
>  
>  targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-
> dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
>  
> -obj-$(CONFIG_ARM64) += sip.o
> +obj-$(CONFIG_ARM64) += lowlevel.o sip.o
>  
>  obj-$(CONFIG_MX5) += mx5/
>  obj-$(CONFIG_MX6) += mx6/
> diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-
> imx/lowlevel.S
> new file mode 100644
> index 0000000000..158fdb7d87
> --- /dev/null
> +++ b/arch/arm/mach-imx/lowlevel.S
> @@ -0,0 +1,22 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright 2019 NXP
> + */
> +
> +#include <linux/linkage.h>
> +
> +ENTRY(lowlevel_init)
> +	mrs	x0, CurrentEL
> +	cmp	x0, #8
> +	b.eq	1f
> +	ret
> +1:
> +	msr daifclr, #4
> +
> +	/* set HCR_EL2.AMO to catch SERROR */
> +	mrs	x0, hcr_el2
> +	orr	x0, x0, #0x20
> +	msr	hcr_el2, x0
> +	isb
> +	ret
> +ENDPROC(lowlevel_init)
> -- 
> 2.16.4
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Peng Fan April 26, 2019, 11:58 p.m. UTC | #2
Hi Marcel,

Please apply this patch, Joe has not pick it up.
https://patchwork.ozlabs.org/patch/1085432/

Stefano,

Would you pick it up?


> Subject: [REGRESSION] [PATCH] imx: add lowlevel init for ARM64
> 
> Hi Peng and Stefano
> 
> Unfortunately, this seems to break Ethernet on Colibri iMX8X:
> 
> => dhcp
> "Error" handler, esr 0xbf000002
> elr: 0000000080049664 lr : 000000008004964c (reloc)
> elr: 00000000ffef6664 lr : 00000000ffef664c
> x0 : 000000005b040288 x1 : 0000000000000001
> x2 : 00000000fd6c5ff4 x3 : 0000000000000020
> x4 : 00000000fd6c5ff0 x5 : 0000000000000020
> x6 : 00000000ffef079c x7 : 00000000fd6f1600
> x8 : 0000000000000044 x9 : 0000000000000008
> x10: 00000000fd6d1620 x11: 00000000fd6d3a10
> x12: 0000000000000000 x13: 0000000000000200
> x14: 00000000fd6c62cc x15: 0000000000000002
> x16: 0000000000002080 x17: 0000000000000000
> x18: 00000000fd6cada8 x19: 00000000fd6d1160
> x20: 0000000000000200 x21: 000000005b040300
> x22: 00000000fd6f1000 x23: 00000000fd6cfdf0
> x24: 00000000ffff8000 x25: 0000000000000000
> x26: 0000000000000000 x27: 0000000000000000
> x28: 00000000fd6d15c0 x29: 00000000fd6c6030
> 
> Resetting CPU ...
> 
> resetting ...
> 
> Reverting commit 5955c6eeb453 ("imx: add lowlevel init for ARM64") makes
> it work again.
> 
> Unfortunately, I don't have a MEK in my home office but will check Ethernet
> operation there on Monday as well.
> 
> Anyway, does anybody know what exactly is going on?

Regards,
Peng.

> 
> Cheers
> 
> Marcel
> 
> On Mon, 2019-04-15 at 05:20 +0000, Peng Fan wrote:
> > Sometimes we met SERROR, but only to catch it when Linux boots up.
> > Let's enable catching in U-Boot to catch it ealier and ease debug.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  arch/arm/mach-imx/Makefile   |  2 +-
> >  arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
> >  2 files changed, 23 insertions(+), 1 deletion(-)  create mode 100644
> > arch/arm/mach-imx/lowlevel.S
> >
> > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > index c3ed62aed6..37675d0558 100644
> > --- a/arch/arm/mach-imx/Makefile
> > +++ b/arch/arm/mach-imx/Makefile
> > @@ -204,7 +204,7 @@ endif
> >
> >  targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-
> > dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
> >
> > -obj-$(CONFIG_ARM64) += sip.o
> > +obj-$(CONFIG_ARM64) += lowlevel.o sip.o
> >
> >  obj-$(CONFIG_MX5) += mx5/
> >  obj-$(CONFIG_MX6) += mx6/
> > diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-
> > imx/lowlevel.S new file mode 100644 index 0000000000..158fdb7d87
> > --- /dev/null
> > +++ b/arch/arm/mach-imx/lowlevel.S
> > @@ -0,0 +1,22 @@
> > +/* SPDX-License-Identifier: GPL-2.0+ */
> > +/*
> > + * Copyright 2019 NXP
> > + */
> > +
> > +#include <linux/linkage.h>
> > +
> > +ENTRY(lowlevel_init)
> > +	mrs	x0, CurrentEL
> > +	cmp	x0, #8
> > +	b.eq	1f
> > +	ret
> > +1:
> > +	msr daifclr, #4
> > +
> > +	/* set HCR_EL2.AMO to catch SERROR */
> > +	mrs	x0, hcr_el2
> > +	orr	x0, x0, #0x20
> > +	msr	hcr_el2, x0
> > +	isb
> > +	ret
> > +ENDPROC(lowlevel_init)
> > --
> > 2.16.4
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> >
> s.denx.de%2Flistinfo%2Fu-boot&amp;data=02%7C01%7Cpeng.fan%40nxp.co
> m%7C
> >
> d671eca9f1cc4d06a7d008d6ca7661b1%7C686ea1d3bc2b4c6fa92cd99c5c30
> 1635%7C
> >
> 0%7C0%7C636919007134459412&amp;sdata=R6xBpoVJHL7meQkRkBi1I8vg
> MgOTXlFEA
> > QfMePrDdSc%3D&amp;reserved=0
Stefano Babic April 28, 2019, 4:52 p.m. UTC | #3
On 27/04/19 01:58, Peng Fan wrote:
> Hi Marcel,
> 
> Please apply this patch, Joe has not pick it up.
> https://patchwork.ozlabs.org/patch/1085432/
> 
> Stefano,
> 
> Would you pick it up?

It is acked by Joe, i assign the patch to me in patchwork and I pick it up.

Regards,
Stefano

> 
> 
>> Subject: [REGRESSION] [PATCH] imx: add lowlevel init for ARM64
>>
>> Hi Peng and Stefano
>>
>> Unfortunately, this seems to break Ethernet on Colibri iMX8X:
>>
>> => dhcp
>> "Error" handler, esr 0xbf000002
>> elr: 0000000080049664 lr : 000000008004964c (reloc)
>> elr: 00000000ffef6664 lr : 00000000ffef664c
>> x0 : 000000005b040288 x1 : 0000000000000001
>> x2 : 00000000fd6c5ff4 x3 : 0000000000000020
>> x4 : 00000000fd6c5ff0 x5 : 0000000000000020
>> x6 : 00000000ffef079c x7 : 00000000fd6f1600
>> x8 : 0000000000000044 x9 : 0000000000000008
>> x10: 00000000fd6d1620 x11: 00000000fd6d3a10
>> x12: 0000000000000000 x13: 0000000000000200
>> x14: 00000000fd6c62cc x15: 0000000000000002
>> x16: 0000000000002080 x17: 0000000000000000
>> x18: 00000000fd6cada8 x19: 00000000fd6d1160
>> x20: 0000000000000200 x21: 000000005b040300
>> x22: 00000000fd6f1000 x23: 00000000fd6cfdf0
>> x24: 00000000ffff8000 x25: 0000000000000000
>> x26: 0000000000000000 x27: 0000000000000000
>> x28: 00000000fd6d15c0 x29: 00000000fd6c6030
>>
>> Resetting CPU ...
>>
>> resetting ...
>>
>> Reverting commit 5955c6eeb453 ("imx: add lowlevel init for ARM64") makes
>> it work again.
>>
>> Unfortunately, I don't have a MEK in my home office but will check Ethernet
>> operation there on Monday as well.
>>
>> Anyway, does anybody know what exactly is going on?
> 
> Regards,
> Peng.
> 
>>
>> Cheers
>>
>> Marcel
>>
>> On Mon, 2019-04-15 at 05:20 +0000, Peng Fan wrote:
>>> Sometimes we met SERROR, but only to catch it when Linux boots up.
>>> Let's enable catching in U-Boot to catch it ealier and ease debug.
>>>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>>  arch/arm/mach-imx/Makefile   |  2 +-
>>>  arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
>>>  2 files changed, 23 insertions(+), 1 deletion(-)  create mode 100644
>>> arch/arm/mach-imx/lowlevel.S
>>>
>>> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
>>> index c3ed62aed6..37675d0558 100644
>>> --- a/arch/arm/mach-imx/Makefile
>>> +++ b/arch/arm/mach-imx/Makefile
>>> @@ -204,7 +204,7 @@ endif
>>>
>>>  targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-
>>> dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
>>>
>>> -obj-$(CONFIG_ARM64) += sip.o
>>> +obj-$(CONFIG_ARM64) += lowlevel.o sip.o
>>>
>>>  obj-$(CONFIG_MX5) += mx5/
>>>  obj-$(CONFIG_MX6) += mx6/
>>> diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-
>>> imx/lowlevel.S new file mode 100644 index 0000000000..158fdb7d87
>>> --- /dev/null
>>> +++ b/arch/arm/mach-imx/lowlevel.S
>>> @@ -0,0 +1,22 @@
>>> +/* SPDX-License-Identifier: GPL-2.0+ */
>>> +/*
>>> + * Copyright 2019 NXP
>>> + */
>>> +
>>> +#include <linux/linkage.h>
>>> +
>>> +ENTRY(lowlevel_init)
>>> +	mrs	x0, CurrentEL
>>> +	cmp	x0, #8
>>> +	b.eq	1f
>>> +	ret
>>> +1:
>>> +	msr daifclr, #4
>>> +
>>> +	/* set HCR_EL2.AMO to catch SERROR */
>>> +	mrs	x0, hcr_el2
>>> +	orr	x0, x0, #0x20
>>> +	msr	hcr_el2, x0
>>> +	isb
>>> +	ret
>>> +ENDPROC(lowlevel_init)
>>> --
>>> 2.16.4
>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
>>>
>> s.denx.de%2Flistinfo%2Fu-boot&amp;data=02%7C01%7Cpeng.fan%40nxp.co
>> m%7C
>>>
>> d671eca9f1cc4d06a7d008d6ca7661b1%7C686ea1d3bc2b4c6fa92cd99c5c30
>> 1635%7C
>>>
>> 0%7C0%7C636919007134459412&amp;sdata=R6xBpoVJHL7meQkRkBi1I8vg
>> MgOTXlFEA
>>> QfMePrDdSc%3D&amp;reserved=0
Joe Hershberger April 28, 2019, 6:24 p.m. UTC | #4
> On Apr 28, 2019, at 12:52 PM, Stefano Babic <sbabic@denx.de> wrote:
> 
> 
> 
>> On 27/04/19 01:58, Peng Fan wrote:
>> Hi Marcel,
>> 
>> Please apply this patch, Joe has not pick it up.
>> https://patchwork.ozlabs.org/patch/1085432/
>> 
>> Stefano,
>> 
>> Would you pick it up?
> 
> It is acked by Joe, i assign the patch to me in patchwork and I pick it up.
> 
> Regards,
> Stefano
> 
>> 
>> 
>>> Subject: [REGRESSION] [PATCH] imx: add lowlevel init for ARM64
>>> 
>>> Hi Peng and Stefano
>>> 
>>> Unfortunately, this seems to break Ethernet on Colibri iMX8X:

Has this been addressed?

>>> 
>>> => dhcp
>>> "Error" handler, esr 0xbf000002
>>> elr: 0000000080049664 lr : 000000008004964c (reloc)
>>> elr: 00000000ffef6664 lr : 00000000ffef664c
>>> x0 : 000000005b040288 x1 : 0000000000000001
>>> x2 : 00000000fd6c5ff4 x3 : 0000000000000020
>>> x4 : 00000000fd6c5ff0 x5 : 0000000000000020
>>> x6 : 00000000ffef079c x7 : 00000000fd6f1600
>>> x8 : 0000000000000044 x9 : 0000000000000008
>>> x10: 00000000fd6d1620 x11: 00000000fd6d3a10
>>> x12: 0000000000000000 x13: 0000000000000200
>>> x14: 00000000fd6c62cc x15: 0000000000000002
>>> x16: 0000000000002080 x17: 0000000000000000
>>> x18: 00000000fd6cada8 x19: 00000000fd6d1160
>>> x20: 0000000000000200 x21: 000000005b040300
>>> x22: 00000000fd6f1000 x23: 00000000fd6cfdf0
>>> x24: 00000000ffff8000 x25: 0000000000000000
>>> x26: 0000000000000000 x27: 0000000000000000
>>> x28: 00000000fd6d15c0 x29: 00000000fd6c6030
>>> 
>>> Resetting CPU ...
>>> 
>>> resetting ...
>>> 
>>> Reverting commit 5955c6eeb453 ("imx: add lowlevel init for ARM64") makes
>>> it work again.
>>> 
>>> Unfortunately, I don't have a MEK in my home office but will check Ethernet
>>> operation there on Monday as well.
>>> 
>>> Anyway, does anybody know what exactly is going on?
>> 
>> Regards,
>> Peng.
>> 
>>> 
>>> Cheers
>>> 
>>> Marcel
>>> 
>>>> On Mon, 2019-04-15 at 05:20 +0000, Peng Fan wrote:
>>>> Sometimes we met SERROR, but only to catch it when Linux boots up.
>>>> Let's enable catching in U-Boot to catch it ealier and ease debug.
>>>> 
>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>>> ---
>>>> arch/arm/mach-imx/Makefile   |  2 +-
>>>> arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
>>>> 2 files changed, 23 insertions(+), 1 deletion(-)  create mode 100644
>>>> arch/arm/mach-imx/lowlevel.S
>>>> 
>>>> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
>>>> index c3ed62aed6..37675d0558 100644
>>>> --- a/arch/arm/mach-imx/Makefile
>>>> +++ b/arch/arm/mach-imx/Makefile
>>>> @@ -204,7 +204,7 @@ endif
>>>> 
>>>> targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-
>>>> dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
>>>> 
>>>> -obj-$(CONFIG_ARM64) += sip.o
>>>> +obj-$(CONFIG_ARM64) += lowlevel.o sip.o
>>>> 
>>>> obj-$(CONFIG_MX5) += mx5/
>>>> obj-$(CONFIG_MX6) += mx6/
>>>> diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-
>>>> imx/lowlevel.S new file mode 100644 index 0000000000..158fdb7d87
>>>> --- /dev/null
>>>> +++ b/arch/arm/mach-imx/lowlevel.S
>>>> @@ -0,0 +1,22 @@
>>>> +/* SPDX-License-Identifier: GPL-2.0+ */
>>>> +/*
>>>> + * Copyright 2019 NXP
>>>> + */
>>>> +
>>>> +#include <linux/linkage.h>
>>>> +
>>>> +ENTRY(lowlevel_init)
>>>> +    mrs    x0, CurrentEL
>>>> +    cmp    x0, #8
>>>> +    b.eq    1f
>>>> +    ret
>>>> +1:
>>>> +    msr daifclr, #4
>>>> +
>>>> +    /* set HCR_EL2.AMO to catch SERROR */
>>>> +    mrs    x0, hcr_el2
>>>> +    orr    x0, x0, #0x20
>>>> +    msr    hcr_el2, x0
>>>> +    isb
>>>> +    ret
>>>> +ENDPROC(lowlevel_init)
>>>> --
>>>> 2.16.4
>>>> 
>>>> _______________________________________________
>>>> U-Boot mailing list
>>>> U-Boot@lists.denx.de
>>>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
>>>> 
>>> s.denx.de%2Flistinfo%2Fu-boot&amp;data=02%7C01%7Cpeng.fan%40nxp.co
>>> m%7C
>>>> 
>>> d671eca9f1cc4d06a7d008d6ca7661b1%7C686ea1d3bc2b4c6fa92cd99c5c30
>>> 1635%7C
>>>> 
>>> 0%7C0%7C636919007134459412&amp;sdata=R6xBpoVJHL7meQkRkBi1I8vg
>>> MgOTXlFEA
>>>> QfMePrDdSc%3D&amp;reserved=0
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Marcel Ziswiler April 28, 2019, 11:33 p.m. UTC | #5
On Sun, 2019-04-28 at 14:24 -0400, Joe Hershberger wrote:
> > On Apr 28, 2019, at 12:52 PM, Stefano Babic <sbabic@denx.de> wrote:
> > 
> > 
> > 
> > > On 27/04/19 01:58, Peng Fan wrote:
> > > Hi Marcel,
> > > 
> > > Please apply this patch, Joe has not pick it up.
> > > https://patchwork.ozlabs.org/patch/1085432/
> > > 
> > > Stefano,
> > > 
> > > Would you pick it up?
> > 
> > It is acked by Joe, i assign the patch to me in patchwork and I
> > pick it up.
> > 
> > Regards,
> > Stefano
> > 
> > > 
> > > > Subject: [REGRESSION] [PATCH] imx: add lowlevel init for ARM64
> > > > 
> > > > Hi Peng and Stefano
> > > > 
> > > > Unfortunately, this seems to break Ethernet on Colibri iMX8X:
> 
> Has this been addressed?

Yes, sorry. The following patch as suggested by Peng does fix it:

https://patchwork.ozlabs.org/patch/1085432/

Thanks!

> > > > => dhcp
> > > > "Error" handler, esr 0xbf000002
> > > > elr: 0000000080049664 lr : 000000008004964c (reloc)
> > > > elr: 00000000ffef6664 lr : 00000000ffef664c
> > > > x0 : 000000005b040288 x1 : 0000000000000001
> > > > x2 : 00000000fd6c5ff4 x3 : 0000000000000020
> > > > x4 : 00000000fd6c5ff0 x5 : 0000000000000020
> > > > x6 : 00000000ffef079c x7 : 00000000fd6f1600
> > > > x8 : 0000000000000044 x9 : 0000000000000008
> > > > x10: 00000000fd6d1620 x11: 00000000fd6d3a10
> > > > x12: 0000000000000000 x13: 0000000000000200
> > > > x14: 00000000fd6c62cc x15: 0000000000000002
> > > > x16: 0000000000002080 x17: 0000000000000000
> > > > x18: 00000000fd6cada8 x19: 00000000fd6d1160
> > > > x20: 0000000000000200 x21: 000000005b040300
> > > > x22: 00000000fd6f1000 x23: 00000000fd6cfdf0
> > > > x24: 00000000ffff8000 x25: 0000000000000000
> > > > x26: 0000000000000000 x27: 0000000000000000
> > > > x28: 00000000fd6d15c0 x29: 00000000fd6c6030
> > > > 
> > > > Resetting CPU ...
> > > > 
> > > > resetting ...
> > > > 
> > > > Reverting commit 5955c6eeb453 ("imx: add lowlevel init for
> > > > ARM64") makes
> > > > it work again.
> > > > 
> > > > Unfortunately, I don't have a MEK in my home office but will
> > > > check Ethernet
> > > > operation there on Monday as well.
> > > > 
> > > > Anyway, does anybody know what exactly is going on?
> > > 
> > > Regards,
> > > Peng.
> > > 
> > > > Cheers
> > > > 
> > > > Marcel
> > > > 
> > > > > On Mon, 2019-04-15 at 05:20 +0000, Peng Fan wrote:
> > > > > Sometimes we met SERROR, but only to catch it when Linux
> > > > > boots up.
> > > > > Let's enable catching in U-Boot to catch it ealier and ease
> > > > > debug.
> > > > > 
> > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > > ---
> > > > > arch/arm/mach-imx/Makefile   |  2 +-
> > > > > arch/arm/mach-imx/lowlevel.S | 22 ++++++++++++++++++++++
> > > > > 2 files changed, 23 insertions(+), 1 deletion(-)  create mode
> > > > > 100644
> > > > > arch/arm/mach-imx/lowlevel.S
> > > > > 
> > > > > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-
> > > > > imx/Makefile
> > > > > index c3ed62aed6..37675d0558 100644
> > > > > --- a/arch/arm/mach-imx/Makefile
> > > > > +++ b/arch/arm/mach-imx/Makefile
> > > > > @@ -204,7 +204,7 @@ endif
> > > > > 
> > > > > targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-
> > > > > boot-
> > > > > dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
> > > > > 
> > > > > -obj-$(CONFIG_ARM64) += sip.o
> > > > > +obj-$(CONFIG_ARM64) += lowlevel.o sip.o
> > > > > 
> > > > > obj-$(CONFIG_MX5) += mx5/
> > > > > obj-$(CONFIG_MX6) += mx6/
> > > > > diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-
> > > > > imx/lowlevel.S new file mode 100644 index
> > > > > 0000000000..158fdb7d87
> > > > > --- /dev/null
> > > > > +++ b/arch/arm/mach-imx/lowlevel.S
> > > > > @@ -0,0 +1,22 @@
> > > > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > > > +/*
> > > > > + * Copyright 2019 NXP
> > > > > + */
> > > > > +
> > > > > +#include <linux/linkage.h>
> > > > > +
> > > > > +ENTRY(lowlevel_init)
> > > > > +    mrs    x0, CurrentEL
> > > > > +    cmp    x0, #8
> > > > > +    b.eq    1f
> > > > > +    ret
> > > > > +1:
> > > > > +    msr daifclr, #4
> > > > > +
> > > > > +    /* set HCR_EL2.AMO to catch SERROR */
> > > > > +    mrs    x0, hcr_el2
> > > > > +    orr    x0, x0, #0x20
> > > > > +    msr    hcr_el2, x0
> > > > > +    isb
> > > > > +    ret
> > > > > +ENDPROC(lowlevel_init)
> > > > > --
> > > > > 2.16.4
> > > > > 
> > > > > _______________________________________________
> > > > > U-Boot mailing list
> > > > > U-Boot@lists.denx.de
> > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > > > > 
> > > > s.denx.de%2Flistinfo%2Fu-
> > > > boot&amp;data=02%7C01%7Cpeng.fan%40nxp.co
> > > > m%7C
> > > > d671eca9f1cc4d06a7d008d6ca7661b1%7C686ea1d3bc2b4c6fa92cd99c5c30
> > > > 1635%7C
> > > > 0%7C0%7C636919007134459412&amp;sdata=R6xBpoVJHL7meQkRkBi1I8vg
> > > > MgOTXlFEA
> > > > > QfMePrDdSc%3D&amp;reserved=0
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://lists.denx.de/listinfo/u-boot

Patch
diff mbox series

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index c3ed62aed6..37675d0558 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -204,7 +204,7 @@  endif
 
 targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
 
-obj-$(CONFIG_ARM64) += sip.o
+obj-$(CONFIG_ARM64) += lowlevel.o sip.o
 
 obj-$(CONFIG_MX5) += mx5/
 obj-$(CONFIG_MX6) += mx6/
diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-imx/lowlevel.S
new file mode 100644
index 0000000000..158fdb7d87
--- /dev/null
+++ b/arch/arm/mach-imx/lowlevel.S
@@ -0,0 +1,22 @@ 
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 NXP
+ */
+
+#include <linux/linkage.h>
+
+ENTRY(lowlevel_init)
+	mrs	x0, CurrentEL
+	cmp	x0, #8
+	b.eq	1f
+	ret
+1:
+	msr daifclr, #4
+
+	/* set HCR_EL2.AMO to catch SERROR */
+	mrs	x0, hcr_el2
+	orr	x0, x0, #0x20
+	msr	hcr_el2, x0
+	isb
+	ret
+ENDPROC(lowlevel_init)