ARM: imx: Fix bmode detection from grp10
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 ARM: imx: Fix bmode detection from grp10
Hi Claudius,
Quoted 16 lines · Claudius Heine
imx6_is_bmode_from_gpr10always returns false, becauseIMX6_SRC_GPR10_BMODEis 1<<28 and gets casted to u8 on return.Instead cast them to a boolean value before return of the function.
Signed-off-by Claudius Heine <[email protected]>--- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/include/asm/mach-imx/sys_proto.h +0
-0
arch/arm/include/asm/mach-imx/sys_proto.h enum imx6_bmode { · line 92
Quoted 2 lines
arch/arm/include/asm/mach-imx/sys_proto.h +0
-0@@ -91,7 +91,7 @@ enum imx6_bmode {static inline u8 imx6_is_bmode_from_gpr10 (void )
Would it make more sense to convert imx6_is_bmode_from_gpr10() to return bool instead of u8?
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/3 ARM: imx: Rename imx6_is_bmode_from_gpr9 to imx6_is_bmode_from_gpr10
Quoted 5 lines · Claudius Heine
The only register used in that function is gpr10, which is used to store the flag. So naming it after this makes sense.
Signed-off-by Claudius Heine <[email protected]>
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 2/3 ARM: imx: Fix bmode detection from grp10
Quoted 7 lines · Claudius Heine
imx6_is_bmode_from_gpr10always returns false, becauseIMX6_SRC_GPR10_BMODEis 1<<28 and gets casted to u8 on return.This changes the return type to bool in order to cast correctly.
Signed-off-by Claudius Heine <[email protected]>
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 3/3 ARM: imx: Use IMX6_SRC_GPR10_BMODE instead of magic number
Quoted 2 lines · Claudius Heine
Signed-off-by Claudius Heine <[email protected]>
PATCH 1/3 ARM: imx: Rename imx6_is_bmode_from_gpr9 to imx6_is_bmode_from_gpr10
In reply to a message not in the archiveHi Claudius,
Quoted 2 lines · Claudius Heine
The only register used in that function is gpr10, which is used to store the flag. So naming it after this makes sense.
I think the old name had a reason: The _value_ for bmode is stored in GPR9 if this function returns true. But I agree that the name is a bit confusing.
Maybe it would make more sense to call it imx6_is_bmode_from_gpr, without any specific register name and add a comment documenting that if bit (GPR10 & IMX6_SRC_GPR10_BMODE) is set, the bmode value is stored in GPR9?
Quoted 32 lines
Signed-off-by Claudius Heine <[email protected]>--- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- arch/arm/mach-imx/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/include/asm/mach-imx/sys_proto.h +1
-1@@ -89,7 +89,7 @@ enum imx6_bmode { IMX6_BMODE_NAND_MAX = 0xf, }; -static inline u8 imx6_is_bmode_from_gpr9 (void ) +static inline u8 imx6_is_bmode_from_gpr10 (void ) {return readl (&src_base->gpr10) &IMX6_SRC_GPR10_BMODE ; }arch/arm/mach-imx/init.c +1
-1@@ -118,7 +118,7 @@ void boot_mode_apply(unsigned cfg_val)#if defined(CONFIG_MX6 )u32 imx6_src_get_boot_mode (void ) { -if (imx6_is_bmode_from_gpr9 ()) +if (imx6_is_bmode_from_gpr10 ())return readl (&src_base->gpr9);else return readl (&src_base->sbmr1);
Signature · 5 lines
Harald DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-62 Fax: +49-8142-66989-80 Email: hws at denx.de
PATCH 1/3 ARM: imx: Rename imx6_is_bmode_from_gpr9 to imx6_is_bmode_from_gpr10
Hi Harald,
Quoted 9 lines · Harald Seiler
Hi Claudius,
Quoted 2 lines · Claudius Heine
The only register used in that function is gpr10, which is used to store the flag. So naming it after this makes sense.
I think the old name had a reason: The _value_ for bmode is stored in GPR9 if this function returns true. But I agree that the name is a bit confusing.
Hmm.. imx6_is_bmode_from_gprX is only used once and where it is used direct register access happens anyway, so maybe we could just remove it and do it directly in boot_mode_apply.
I will do that in v3 if its ok.
regards,
Claudius
Quoted 39 lines
Maybe it would make more sense to call it
imx6_is_bmode_from_gpr, without any specific register name and add a comment documenting that if bit (GPR10 &IMX6_SRC_GPR10_BMODE) is set, the bmode value is stored in GPR9?Quoted 32 lines
Signed-off-by Claudius Heine <[email protected]>--- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- arch/arm/mach-imx/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/include/asm/mach-imx/sys_proto.h +1
-1@@ -89,7 +89,7 @@ enum imx6_bmode { IMX6_BMODE_NAND_MAX = 0xf, }; -static inline u8 imx6_is_bmode_from_gpr9 (void ) +static inline u8 imx6_is_bmode_from_gpr10 (void ) {return readl (&src_base->gpr10) &IMX6_SRC_GPR10_BMODE ; }arch/arm/mach-imx/init.c +1
-1@@ -118,7 +118,7 @@ void boot_mode_apply(unsigned cfg_val)#if defined(CONFIG_MX6 )u32 imx6_src_get_boot_mode (void ) { -if (imx6_is_bmode_from_gpr9 ()) +if (imx6_is_bmode_from_gpr10 ())return readl (&src_base->gpr9);else return readl (&src_base->sbmr1);
Signature · 14 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch at denx.de
PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191021/523d00a0/attachment.sig>