ARM: i.MX: boot: Make use of FIELD_GET() in imx51_get_boot_source()
Subsystems (3)
PATCH 1/2 ARM: i.MX: boot: Make use of FIELD_GET() in imx51_get_boot_source()
Signed-off-by Andrey Smirnov <[email protected]>
--- arch/arm/mach-imx/boot.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-imx/boot.c +7 -7
@@ -167,10 +167,10 @@ void imx27_boot_save_loc(void)imx_boot_save_loc (imx27_get_boot_source); } -#define IMX51_SRC_SBMR 0x4 -#define IMX51_SBMR_BT_MEM_TYPE_SHIFT 7 -#define IMX51_SBMR_BT_MEM_CTL_SHIFT 0 -#define IMX51_SBMR_BMOD_SHIFT 14 +#define IMX51_SRC_SBMR 0x4 +#define IMX51_SBMR_BT_MEM_TYPE GENMASK(8, 7) +#define IMX51_SBMR_BT_MEM_CTL GENMASK(1, 0) +#define IMX51_SBMR_BMOD GENMASK(15, 14)void imx51_get_boot_source (enum bootsource *src,int *instance) {
@@ -180,12 +180,12 @@ void imx51_get_boot_source(enum bootsource *src, int *instance) reg =readl (src_base +IMX51_SRC_SBMR ); -switch ((reg >>IMX51_SBMR_BMOD_SHIFT ) &0x3 ) { +switch (FIELD_GET (IMX51_SBMR_BMOD , reg)) {case 0 :case 2 :/* internal boot */ - ctrl = (reg >>IMX51_SBMR_BT_MEM_CTL_SHIFT ) &0x3 ; - type = (reg >>IMX51_SBMR_BT_MEM_TYPE_SHIFT ) &0x3 ; + ctrl =FIELD_GET (IMX51_SBMR_BT_MEM_CTL , reg); + type =FIELD_GET (IMX51_SBMR_BT_MEM_TYPE , reg); *src = locations[ctrl][type];break ;
Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/2 ARM: i.MX: boot: Detect boot instance on i.MX51
Signed-off-by Andrey Smirnov <[email protected]>
--- arch/arm/mach-imx/boot.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-imx/boot.c +2 -0
@@ -170,6 +170,7 @@ void imx27_boot_save_loc(void)#define IMX51_SRC_SBMR 0x4#define IMX51_SBMR_BT_MEM_TYPE GENMASK(8, 7)#define IMX51_SBMR_BT_MEM_CTL GENMASK(1, 0) +#define IMX51_SBMR_BT_SRC GENMASK(20, 19)#define IMX51_SBMR_BMOD GENMASK(15, 14)void imx51_get_boot_source (enum bootsource *src,int *instance)
@@ -188,6 +189,7 @@ void imx51_get_boot_source(enum bootsource *src, int *instance) type =FIELD_GET (IMX51_SBMR_BT_MEM_TYPE , reg); *src = locations[ctrl][type]; + *instance =FIELD_GET (IMX51_SBMR_BT_SRC , reg);break ;case 1 :/* reserved */
Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 4 lines · Andrey Smirnov
Signed-off-by Andrey Smirnov <[email protected]>--- arch/arm/mach-imx/boot.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Applied, thanks
Sascha
Quoted 45 lines
arch/arm/mach-imx/boot.c +7
-7@@ -167,10 +167,10 @@ void imx27_boot_save_loc(void)imx_boot_save_loc (imx27_get_boot_source); } -#define IMX51_SRC_SBMR 0x4 -#define IMX51_SBMR_BT_MEM_TYPE_SHIFT 7 -#define IMX51_SBMR_BT_MEM_CTL_SHIFT 0 -#define IMX51_SBMR_BMOD_SHIFT 14 +#define IMX51_SRC_SBMR 0x4 +#define IMX51_SBMR_BT_MEM_TYPE GENMASK(8, 7) +#define IMX51_SBMR_BT_MEM_CTL GENMASK(1, 0) +#define IMX51_SBMR_BMOD GENMASK(15, 14)void imx51_get_boot_source (enum bootsource *src,int *instance) {@@ -180,12 +180,12 @@ void imx51_get_boot_source(enum bootsource *src, int *instance) reg =readl (src_base +IMX51_SRC_SBMR ); -switch ((reg >>IMX51_SBMR_BMOD_SHIFT ) &0x3 ) { +switch (FIELD_GET (IMX51_SBMR_BMOD , reg)) {case 0 :case 2 :/* internal boot */ - ctrl = (reg >>IMX51_SBMR_BT_MEM_CTL_SHIFT ) &0x3 ; - type = (reg >>IMX51_SBMR_BT_MEM_TYPE_SHIFT ) &0x3 ; + ctrl =FIELD_GET (IMX51_SBMR_BT_MEM_CTL , reg); + type =FIELD_GET (IMX51_SBMR_BT_MEM_TYPE , reg); *src = locations[ctrl][type];break ;Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox