Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
Subsystems (7)
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock since in the other .dts files using *-lcdif "pix" is used.
This patchset add also "disp_axi" clock enabling in mxsfb that should make able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.
Giulio Benetti (5):
video: mxsfb: add enabling of "axi" clock other than "per" clock
video: mxsfb: add enabling of "disp_axi" clock
clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to
LCDIF_APB
ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
arch/arm/dts/imxrt1050-evk.dts | 3 -- arch/arm/dts/imxrt1050.dtsi | 7 ++-- drivers/clk/imx/clk-imxrt1050.c | 6 ++-- drivers/video/mxsfb.c | 36 +++++++++++++++++---- include/dt-bindings/clock/imxrt1050-clock.h | 5 +-- 5 files changed, 41 insertions(+), 16 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/5 video: mxsfb: add enabling of "axi" clock other than "per" clock
On some SoC mxsfb needs more than one clock gate(actual "per" clock). So let's introduce "axi" clock that can be provided but it's not mandatory. This is inspired from linux mxsfb driver. Also let's rename "per" clock to "pix" clock for compatibility with already existing .dts lcdif nodes implementation.
--- drivers/video/mxsfb.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/video/mxsfb.c +18 -7
@@ -67,26 +67,37 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,uint32_t vdctrl0;#if CONFIG_IS_ENABLED (CLK ) -struct clk per_clk; +struct clk clk;int ret; - ret =clk_get_by_name (dev,"per" , &per_clk); + ret =clk_get_by_name (dev,"pix" , &clk);if (ret) { -dev_err (dev,"Failed to get mxs clk: %d\n" , ret); +dev_err (dev,"Failed to get mxs pix clk: %d\n" , ret);return ; } - ret =clk_set_rate (&per_clk, timings->pixelclock.typ); + ret =clk_set_rate (&clk, timings->pixelclock.typ);if (ret <0 ) { -dev_err (dev,"Failed to set mxs clk: %d\n" , ret); +dev_err (dev,"Failed to set mxs pix clk: %d\n" , ret);return ; } - ret =clk_enable (&per_clk); + ret =clk_enable (&clk);if (ret <0 ) { -dev_err (dev,"Failed to enable mxs clk: %d\n" , ret); +dev_err (dev,"Failed to enable mxs pix clk: %d\n" , ret);return ; } + + ret =clk_get_by_name (dev,"axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
Signature · 1 line
2.25.1
PATCH 2/5 video: mxsfb: add enabling of "disp_axi" clock
In reply to Giulio BenettiSome SoC needs "disp_axi" clock to be enabled, so let's try to retrieve it and enabling. If it fails it gives only a debug(), but this clock as well as "axi" clock is not mandatory.
--- drivers/video/mxsfb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/video/mxsfb.c +11 -0
@@ -98,6 +98,17 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, return; } } + + ret =clk_get_by_name (dev,"disp_axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs disp_axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs disp_axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
Signature · 1 line
2.25.1
PATCH 3/5 clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to LCDIF_APB
In reply to Giulio BenettiLcd peripheral needs 2 different gates to be enable to work, so let's introduce the missing one(LCDIF_PIX) and rename the existing one (LCDIF_APB).
--- drivers/clk/imx/clk-imxrt1050.c | 6 ++++-- include/dt-bindings/clock/imxrt1050-clock.h | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/clk/imx/clk-imxrt1050.c +4 -2
@@ -255,8 +255,10 @@ static int imxrt1050_clk_probe(struct udevice *dev) imx_clk_gate2("lpuart1", "lpuart_podf", base + 0x7c, 24));clk_dm (IMXRT1050_CLK_SEMC ,imx_clk_gate2 ("semc" ,"semc_podf" , base +0x74 ,4 )); -clk_dm (IMXRT1050_CLK_LCDIF , -imx_clk_gate2 ("lcdif" ,"lcdif_podf" , base +0x74 ,10 )); +clk_dm (IMXRT1050_CLK_LCDIF_APB , +imx_clk_gate2 ("lcdif" ,"lcdif_podf" , base +0x70 ,28 )); +clk_dm (IMXRT1050_CLK_LCDIF_PIX , +imx_clk_gate2 ("lcdif_pix" ,"lcdif" , base +0x74 ,10 ));struct clk *clk, *clk1;
include/dt-bindings/clock/imxrt1050-clock.h +3 -2
@@ -52,7 +52,7 @@#define IMXRT1050_CLK_USDHC2 43#define IMXRT1050_CLK_LPUART1 44#define IMXRT1050_CLK_SEMC 45 -#define IMXRT1050_CLK_LCDIF 46 +#define IMXRT1050_CLK_LCDIF_APB 46#define IMXRT1050_CLK_PLL1_ARM 47#define IMXRT1050_CLK_PLL2_SYS 48#define IMXRT1050_CLK_PLL3_USB_OTG 49
@@ -60,6 +60,7 @@#define IMXRT1050_CLK_PLL5_VIDEO 51#define IMXRT1050_CLK_PLL6_ENET 52#define IMXRT1050_CLK_PLL7_USB_HOST 53 -#define IMXRT1050_CLK_END 54 +#define IMXRT1050_CLK_LCDIF_PIX 54 +#define IMXRT1050_CLK_END 55#endif /* __DT_BINDINGS_CLOCK_IMXRT1050_H */
Signature · 1 line
2.25.1
PATCH 4/5 ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
In reply to Giulio BenettiSince we assume pll5 is the default lcdif clock source let's move assigned-clocks(-parents) properties to .dtsi file.
--- arch/arm/dts/imxrt1050-evk.dts | 3 --- arch/arm/dts/imxrt1050.dtsi | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/dts/imxrt1050-evk.dts +0 -3
@@ -238,9 +238,6 @@ display = <&display0>; status = "okay"; - assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; - assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; - display0: display0 { bits-per-pixel = <16>; bus-width = <16>;
arch/arm/dts/imxrt1050.dtsi +2 -0
@@ -152,6 +152,8 @@ interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMXRT1050_CLK_LCDIF>; clock-names = "per"; + assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; + assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; status = "disabled"; };
Signature · 1 line
2.25.1
PATCH 5/5 ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
In reply to Giulio Benetti--- arch/arm/dts/imxrt1050.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/dts/imxrt1050.dtsi +3 -2
@@ -150,8 +150,9 @@ compatible = "fsl,imxrt-lcdif"; reg = <0x402b8000 0x4000>; interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMXRT1050_CLK_LCDIF>; - clock-names = "per"; + clocks = <&clks IMXRT1050_CLK_LCDIF_PIX>, + <&clks IMXRT1050_CLK_LCDIF_APB>; + clock-names = "pix", "axi"; assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; status = "disabled";
Signature · 1 line
2.25.1
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
In reply to Giulio BenettiQuoted 10 lines · Giulio Benetti
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock since in the other .dts files using *-lcdif "pix" is used.
This patchset add also "
disp_axi" clock enabling in mxsfb that should make able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.
I've forgotten to specify that this patchset depends on this patchset:
https://patchwork.ozlabs.org/project/uboot/list/?series=237909
Best regards
Signature · 2 lines
Giulio Benetti Benetti Engineering sas
Quoted 15 lines
Giulio Benetti (5):
video: mxsfb: add enabling of "axi" clock other than "per" clock
video: mxsfb: add enabling of "disp_axi" clock
clk: imx: clk-imxrt1050: introduceLCDIF_PIXand rename LCDIF to
LCDIF_APB
ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driverarch/arm/dts/imxrt1050-evk.dts | 3 -- arch/arm/dts/imxrt1050.dtsi | 7 ++-- drivers/clk/imx/clk-imxrt1050.c | 6 ++-- drivers/video/mxsfb.c | 36 +++++++++++++++++---- include/dt-bindings/clock/imxrt1050-clock.h | 5 +-- 5 files changed, 41 insertions(+), 16 deletions(-)
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
Quoted 6 lines · Giulio Benetti
Quoted 5 lines · Giulio Benetti
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock since in the other .dts files using *-lcdif "pix" is used.
Quoted 8 lines
Quoted 5 lines
This patchset add also "
disp_axi" clock enabling in mxsfb that should make able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.I've forgotten to specify that this patchset depends on this patchset:
https://patchwork.ozlabs.org/project/uboot/list/?series=237909
This ^^^ series is superseeded by v2:
https://patchwork.ozlabs.org/project/uboot/list/?series=241701
Best regards
Signature · 2 lines
Giulio Benetti Benetti Engineering sas
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
Hi Stefano,
Quoted 13 lines · Giulio Benetti
Quoted 12 lines · Giulio Benetti
Quoted 10 lines · Giulio Benetti
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock since in the other .dts files using *-lcdif "pix" is used.
This patchset add also "
disp_axi" clock enabling in mxsfb that should make able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.
Quoted 5 lines
Quoted 2 lines
I've forgotten to specify that this patchset depends on this patchset:
https://patchwork.ozlabs.org/project/uboot/list/?series=237909This ^^^ series is superseeded by v2:
https://patchwork.ozlabs.org/project/uboot/list/?series=241701
Current patchset is not superseeded, only the one which depends to is superseeded by v2. Do you prefer me to send a unique patchset with all patches of both patchsets?
Kind regards
Signature · 2 lines
Giulio Benetti Benetti Engineering sas
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
Hi Giulio,
Quoted 23 lines · Giulio Benetti
Hi Stefano,
Quoted 20 lines · Giulio Benetti
Quoted 18 lines · Giulio Benetti
Quoted 7 lines · Giulio Benetti
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb
driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock
since in the other .dts files using *-lcdif "pix" is used.Quoted 7 lines
This patchset add also "
disp_axi" clock enabling in mxsfb that should make
able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would
be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.I've forgotten to specify that this patchset depends on this patchset:
https://patchwork.ozlabs.org/project/uboot/list/?series=237909
Quoted 6 lines
Quoted 2 lines
This ^^^ series is superseeded by v2:
https://patchwork.ozlabs.org/project/uboot/list/?series=241701Current patchset is not superseeded, only the one which depends to is superseeded by v2. Do you prefer me to send a unique patchset with all patches of both patchsets?
Yes, or in patchset becomes a mess. Please send a complete series, thanks !
Best regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
v3 cover Fix i.MXRT1020/50
This patchset adds imx-gpt-timer driver that is supported by i.MXRT and also a lot of other i.MX* SoCs. This driver is needed for i.MXRT SoC family that is lacking at the moment the timer at all and that makes u-boot to fail running on i.MXRT.
There are also some fixes in imxrt10*0-evk.dts and other minor fixed and improvements and specifically on imxrt1050 has been fixed lcdif init hang.
---V1->V2:
* fixed 32 to 64 bit conversion on timer as suggested by Sean AndersonV2->V3:
* merge with patchset with https://patchwork.ozlabs.org/project/uboot/list/?series=238842&state=*
that fixes lcdif init hang
* improve some commit log
---
Giulio Benetti (22):
arm: imxrt: soc: make mpu regions generic
timer: imx-gpt: Add timer support for i.MX SoCs family
ARM: dts: imxrt1020: add node label to osc
ARM: dts: imxrt1020: add gpt1 node
ARM: dts: imxrt1020-evk: enable gpt1 timer
ARM: dts: imxrt1020-evk: set gpt1 as tick-timer for u-boot
ARM: dts: imxrt1020-evk-u-boot: make gpt1 present for SPL
ARM: dts: imxrt1020-evk: add device_type = "memory" to memory node
configs: imxrt1020-evk: enable imx gpt timer as tick-timer
ARM: dts: imxrt1050: add node label to osc
ARM: dts: imxrt1050: add gpt1 node
ARM: dts: imxrt1050-evk: enable gpt1 timer
ARM: dts: imxrt1050-evk: set gpt1 as tick-timer for u-boot
ARM: dts: imxrt1050-evk-u-boot: make gpt1 present for SPL
ARM: dts: imxrt1050-evk: add device_type = "memory" to memory node
configs: imxrt1050-evk: enable imx gpt timer as tick-timer
video: mxsfb: add enabling of "axi" clock other than "per" clock
video: mxsfb: add enabling of "disp_axi" clock
clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to
LCDIF_APB
ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
ARM: dts: imxrt1050-evk: remove u-boot,dm-spl
arch/arm/dts/imxrt1020-evk-u-boot.dtsi | 4 + arch/arm/dts/imxrt1020-evk.dts | 6 + arch/arm/dts/imxrt1020.dtsi | 10 +- arch/arm/dts/imxrt1050-evk-u-boot.dtsi | 4 + arch/arm/dts/imxrt1050-evk.dts | 10 +- arch/arm/dts/imxrt1050.dtsi | 17 +- arch/arm/mach-imx/imxrt/soc.c | 6 +- configs/imxrt1020-evk_defconfig | 1 + configs/imxrt1050-evk_defconfig | 1 + drivers/clk/imx/clk-imxrt1050.c | 6 +- drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/imx-gpt-timer.c | 162 ++++++++++++++++++++ drivers/video/mxsfb.c | 36 ++++- include/dt-bindings/clock/imxrt1050-clock.h | 5 +- 15 files changed, 254 insertions(+), 22 deletions(-) create mode 100644 drivers/timer/imx-gpt-timer.c
Signature · 1 line
2.25.1
v3 cover Fix i.MXRT1020/50
In reply to Stefano BabicThis patchset adds imx-gpt-timer driver that is supported by i.MXRT and also a lot of other i.MX* SoCs. This driver is needed for i.MXRT SoC family that is lacking at the moment the timer at all and that makes u-boot to fail running on i.MXRT.
There are also some fixes in imxrt10*0-evk.dts and other minor fixed and improvements and specifically on imxrt1050 has been fixed lcdif init hang.
---V1->V2:
* fixed 32 to 64 bit conversion on timer as suggested by Sean AndersonV2->V3:
* merge with patchset with https://patchwork.ozlabs.org/project/uboot/list/?series=238842&state=*
that fixes lcdif init hang
* improve some commit log
---
Giulio Benetti (22):
arm: imxrt: soc: make mpu regions generic
timer: imx-gpt: Add timer support for i.MX SoCs family
ARM: dts: imxrt1020: add node label to osc
ARM: dts: imxrt1020: add gpt1 node
ARM: dts: imxrt1020-evk: enable gpt1 timer
ARM: dts: imxrt1020-evk: set gpt1 as tick-timer for u-boot
ARM: dts: imxrt1020-evk-u-boot: make gpt1 present for SPL
ARM: dts: imxrt1020-evk: add device_type = "memory" to memory node
configs: imxrt1020-evk: enable imx gpt timer as tick-timer
ARM: dts: imxrt1050: add node label to osc
ARM: dts: imxrt1050: add gpt1 node
ARM: dts: imxrt1050-evk: enable gpt1 timer
ARM: dts: imxrt1050-evk: set gpt1 as tick-timer for u-boot
ARM: dts: imxrt1050-evk-u-boot: make gpt1 present for SPL
ARM: dts: imxrt1050-evk: add device_type = "memory" to memory node
configs: imxrt1050-evk: enable imx gpt timer as tick-timer
video: mxsfb: add enabling of "axi" clock other than "per" clock
video: mxsfb: add enabling of "disp_axi" clock
clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to
LCDIF_APB
ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
ARM: dts: imxrt1050-evk: remove u-boot,dm-spl
arch/arm/dts/imxrt1020-evk-u-boot.dtsi | 4 + arch/arm/dts/imxrt1020-evk.dts | 6 + arch/arm/dts/imxrt1020.dtsi | 10 +- arch/arm/dts/imxrt1050-evk-u-boot.dtsi | 4 + arch/arm/dts/imxrt1050-evk.dts | 10 +- arch/arm/dts/imxrt1050.dtsi | 17 +- arch/arm/mach-imx/imxrt/soc.c | 6 +- configs/imxrt1020-evk_defconfig | 1 + configs/imxrt1050-evk_defconfig | 1 + drivers/clk/imx/clk-imxrt1050.c | 6 +- drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/imx-gpt-timer.c | 162 ++++++++++++++++++++ drivers/video/mxsfb.c | 36 ++++- include/dt-bindings/clock/imxrt1050-clock.h | 5 +- 15 files changed, 254 insertions(+), 22 deletions(-) create mode 100644 drivers/timer/imx-gpt-timer.c
Signature · 1 line
2.25.1
PATCH v3 1/22 arm: imxrt: soc: make mpu regions generic
This mpu handling works for every i.MXRT SoC that we have, so let's generalize imxrt1050_region_config to imxrt_region_config.
--- arch/arm/mach-imx/imxrt/soc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-imx/imxrt/soc.c +3 -3
@@ -14,7 +14,7 @@ int arch_cpu_init(void) {int i; -struct mpu_region_config imxrt1050_region_config[] = { +struct mpu_region_config imxrt_region_config[] = { {0x00000000 ,REGION_0 ,XN_DIS ,PRIV_RW_USR_RW ,STRONG_ORDER ,REGION_4GB }, {PHYS_SDRAM ,REGION_1 ,XN_DIS ,PRIV_RW_USR_RW ,
@@ -29,8 +29,8 @@ int arch_cpu_init(void)* the whole 4GB address space. */ disable_mpu (); -for (i =0 ; i <ARRAY_SIZE (imxrt1050_region_config); i++) -mpu_config (&imxrt1050_region_config[i]); +for (i =0 ; i <ARRAY_SIZE (imxrt_region_config); i++) +mpu_config (&imxrt_region_config[i]);enable_mpu ();return 0 ;
Signature · 1 line
2.25.1
PATCH v3 1/22 arm: imxrt: soc: make mpu regions generic
Quoted 3 lines
This mpu handling works for every i.MXRT SoC that we have, so let's generalize
imxrt1050_region_configtoimxrt_region_config.Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 2/22 timer: imx-gpt: Add timer support for i.MX SoCs family
In reply to Giulio BenettiThis timer driver uses GPT Timer (General Purpose Timer) available on a lot of i.MX SoCs family. This driver deals with both 24Mhz oscillator as well as peripheral clock.
[Giulio: added the driver's stub and handled peripheral clock prescaler setting making driver to work correctly]
[Jesse: added init, setting prescaler for 24Mhz support and enabling timer]
--- drivers/timer/Kconfig | 7 ++ drivers/timer/Makefile | 1 + drivers/timer/imx-gpt-timer.c | 162 ++++++++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 drivers/timer/imx-gpt-timer.c
drivers/timer/Kconfig +7 -0
@@ -227,4 +227,11 @@ config MCHP_PIT64B_TIMER Select this to enable support for Microchip 64-bit periodic interval timer. +config IMX_GPT_TIMER + bool "NXP i.MX GPT timer support" + depends on TIMER + help + Select this to enable support for the timer found on + NXP i.MX devices. + endmenu
drivers/timer/Makefile +1 -0
@@ -25,3 +25,4 @@ obj-$(CONFIG_STM32_TIMER) += stm32_timer.o obj-$(CONFIG_X86_TSC_TIMER) += tsc_timer.o obj-$(CONFIG_MTK_TIMER) += mtk_timer.o obj-$(CONFIG_MCHP_PIT64B_TIMER) += mchp-pit64b-timer.o +obj-$(CONFIG_IMX_GPT_TIMER) += imx-gpt-timer.o
drivers/timer/imx-gpt-timer.c new file +162 -0
162 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 2/22 timer: imx-gpt: Add timer support for i.MX SoCs family
Quoted 9 lines
This timer driver uses GPT Timer (General Purpose Timer) available on a lot of i.MX SoCs family. This driver deals with both 24Mhz oscillator as well as peripheral clock.
Signed-off-by Giulio Benetti <[email protected]>[Giulio: added the driver's stub and handled peripheral clock prescaler setting making driver to work correctly]
Signed-off-by Jesse Taube <[email protected]>[Jesse: added init, setting prescaler for 24Mhz support and enabling timer]
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 3/22 ARM: dts: imxrt1020: add node label to osc
In reply to Giulio BenettiLet's add node label to osc to be used as clock source for other nodes.
--- arch/arm/dts/imxrt1020.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/imxrt1020.dtsi +1 -1
@@ -36,7 +36,7 @@ clock-frequency = <0>; }; - osc { + osc: osc { u-boot,dm-spl; compatible = "fsl,imx-osc", "fixed-clock"; #clock-cells = <0>;
Signature · 1 line
2.25.1
PATCH v3 3/22 ARM: dts: imxrt1020: add node label to osc
Quoted 2 lines
Let's add node label to osc to be used as clock source for other nodes.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 4/22 ARM: dts: imxrt1020: add gpt1 node
In reply to Giulio BenettiAdd gpt1 node for using it as timer.
--- arch/arm/dts/imxrt1020.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/dts/imxrt1020.dtsi +8 -0
@@ -129,5 +129,13 @@ interrupt-controller; #interrupt-cells = <2>; }; + + gpt1: gpt1 at 401ec000 { + compatible = "fsl,imxrt-gpt"; + reg = <0x401ec000 0x4000>; + interrupts = <100>; + clocks = <&osc>; + status = "disabled"; + }; }; };
Signature · 1 line
2.25.1
PATCH v3 4/22 ARM: dts: imxrt1020: add gpt1 node
Quoted 2 lines
Add gpt1 node for using it as timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 5/22 ARM: dts: imxrt1020-evk: enable gpt1 timer
In reply to Giulio BenettiEnable gpt1 timer.
--- arch/arm/dts/imxrt1020-evk.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/imxrt1020-evk.dts +4 -0
@@ -186,6 +186,10 @@ }; }; +&gpt1 { + status = "okay"; +}; + &usdhc1 { pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep"; pinctrl-0 = <&pinctrl_usdhc0>;
Signature · 1 line
2.25.1
PATCH v3 5/22 ARM: dts: imxrt1020-evk: enable gpt1 timer
Quoted 2 lines
Enable gpt1 timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 6/22 ARM: dts: imxrt1020-evk: set gpt1 as tick-timer for u-boot
In reply to Giulio BenettiLet's set gpt1 as u-boot timer.
--- arch/arm/dts/imxrt1020-evk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/imxrt1020-evk.dts +1 -0
@@ -16,6 +16,7 @@ chosen { bootargs = "root=/dev/ram"; stdout-path = "serial0:115200n8"; + tick-timer = &gpt1; }; memory {
Signature · 1 line
2.25.1
PATCH v3 6/22 ARM: dts: imxrt1020-evk: set gpt1 as tick-timer for u-boot
Quoted 2 lines
Let's set gpt1 as u-boot timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 7/22 ARM: dts: imxrt1020-evk-u-boot: make gpt1 present for SPL
In reply to Giulio BenettiTimer needs to be already enabled in spl, so let's add its node to spl dtb.
--- arch/arm/dts/imxrt1020-evk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/imxrt1020-evk-u-boot.dtsi +4 -0
@@ -10,6 +10,10 @@ }; }; +&gpt1 { + u-boot,dm-spl; +}; + &lpuart1 { /* console */ u-boot,dm-spl; };
Signature · 1 line
2.25.1
PATCH v3 7/22 ARM: dts: imxrt1020-evk-u-boot: make gpt1 present for SPL
Quoted 2 lines
Timer needs to be already enabled in spl, so let's add its node to spl dtb.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 8/22 ARM: dts: imxrt1020-evk: add device_type = "memory" to memory node
In reply to Giulio BenettiNow device_type = "memory" is mandatory to allow u-boot to read memory node, so let's add it to memory node.
--- arch/arm/dts/imxrt1020-evk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/imxrt1020-evk.dts +1 -0
@@ -20,6 +20,7 @@ }; memory { + device_type = "memory"; reg = <0x80000000 0x2000000>; }; };
Signature · 1 line
2.25.1
PATCH v3 8/22 ARM: dts: imxrt1020-evk: add device_type = "memory" to memory node
Quoted 3 lines
Now
device_type= "memory" is mandatory to allow u-boot to read memory node, so let's add it to memory node.Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 9/22 configs: imxrt1020-evk: enable imx gpt timer as tick-timer
In reply to Giulio BenettiLet's enable imx-gpt-timer in imx1020-evk defconfig.
--- configs/imxrt1020-evk_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/imxrt1020-evk_defconfig +1 -0
@@ -61,6 +61,7 @@ CONFIG_IMXRT_SDRAM=y CONFIG_FSL_LPUART=y CONFIG_TIMER=y CONFIG_SPL_TIMER=y +CONFIG_IMX_GPT_TIMER=y CONFIG_SHA1=y CONFIG_SHA256=y CONFIG_HEXDUMP=y
Signature · 1 line
2.25.1
PATCH v3 9/22 configs: imxrt1020-evk: enable imx gpt timer as tick-timer
Quoted 2 lines
Let's enable imx-gpt-timer in imx1020-evk defconfig.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 10/22 ARM: dts: imxrt1050: add node label to osc
In reply to Giulio BenettiLet's add node label to osc to be used as clock source for other nodes.
--- arch/arm/dts/imxrt1050.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/imxrt1050.dtsi +1 -1
@@ -28,7 +28,7 @@ clocks { u-boot,dm-spl; - osc { + osc: osc { u-boot,dm-spl; compatible = "fsl,imx-osc", "fixed-clock"; #clock-cells = <0>;
Signature · 1 line
2.25.1
PATCH v3 10/22 ARM: dts: imxrt1050: add node label to osc
Quoted 2 lines
Let's add node label to osc to be used as clock source for other nodes.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 11/22 ARM: dts: imxrt1050: add gpt1 node
In reply to Giulio BenettiAdd gpt1 node for using it as timer.
--- arch/arm/dts/imxrt1050.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/dts/imxrt1050.dtsi +8 -0
@@ -154,5 +154,13 @@ clock-names = "per"; status = "disabled"; }; + + gpt1: gpt1 at 401ec000 { + compatible = "fsl,imxrt-gpt"; + reg = <0x401ec000 0x4000>; + interrupts = <100>; + clocks = <&osc>; + status = "disabled"; + }; }; };
Signature · 1 line
2.25.1
PATCH v3 11/22 ARM: dts: imxrt1050: add gpt1 node
Quoted 2 lines
Add gpt1 node for using it as timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 12/22 ARM: dts: imxrt1050-evk: enable gpt1 timer
In reply to Giulio BenettiEnable gpt1 timer.
--- arch/arm/dts/imxrt1050-evk.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/imxrt1050-evk.dts +4 -0
@@ -215,6 +215,10 @@ }; }; +&gpt1 { + status = "okay"; +}; + &usdhc1 { pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep"; pinctrl-0 = <&pinctrl_usdhc0>;
Signature · 1 line
2.25.1
PATCH v3 12/22 ARM: dts: imxrt1050-evk: enable gpt1 timer
Quoted 2 lines
Enable gpt1 timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 13/22 ARM: dts: imxrt1050-evk: set gpt1 as tick-timer for u-boot
In reply to Giulio BenettiLet's set gpt1 as u-boot timer.
--- arch/arm/dts/imxrt1050-evk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/imxrt1050-evk.dts +1 -0
@@ -16,6 +16,7 @@ chosen { bootargs = "root=/dev/ram"; stdout-path = "serial0:115200n8"; + tick-timer = &gpt1; }; memory {
Signature · 1 line
2.25.1
PATCH v3 13/22 ARM: dts: imxrt1050-evk: set gpt1 as tick-timer for u-boot
Quoted 2 lines
Let's set gpt1 as u-boot timer.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 14/22 ARM: dts: imxrt1050-evk-u-boot: make gpt1 present for SPL
In reply to Giulio BenettiTimer needs to be already enabled in spl, so let's add its node to spl dtb.
--- arch/arm/dts/imxrt1050-evk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/imxrt1050-evk-u-boot.dtsi +4 -0
@@ -10,6 +10,10 @@ }; }; +&gpt1 { + u-boot,dm-spl; +}; + &lpuart1 { /* console */ u-boot,dm-spl; };
Signature · 1 line
2.25.1
PATCH v3 14/22 ARM: dts: imxrt1050-evk-u-boot: make gpt1 present for SPL
Quoted 2 lines
Timer needs to be already enabled in spl, so let's add its node to spl dtb.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 15/22 ARM: dts: imxrt1050-evk: add device_type = "memory" to memory node
In reply to Giulio BenettiNow device_type = "memory" is mandatory to allow u-boot to read memory node, so let's add it to memory node.
--- arch/arm/dts/imxrt1050-evk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/imxrt1050-evk.dts +1 -0
@@ -20,6 +20,7 @@ }; memory { + device_type = "memory"; reg = <0x80000000 0x2000000>; }; };
Signature · 1 line
2.25.1
PATCH v3 15/22 ARM: dts: imxrt1050-evk: add device_type = "memory" to memory node
Quoted 3 lines
Now
device_type= "memory" is mandatory to allow u-boot to read memory node, so let's add it to memory node.Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 16/22 configs: imxrt1050-evk: enable imx gpt timer as tick-timer
In reply to Giulio BenettiLet's enable imx-gpt-timer in imx1050-evk defconfig.
--- configs/imxrt1050-evk_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/imxrt1050-evk_defconfig +1 -0
@@ -64,6 +64,7 @@ CONFIG_IMXRT_SDRAM=y CONFIG_FSL_LPUART=y CONFIG_TIMER=y CONFIG_SPL_TIMER=y +CONFIG_IMX_GPT_TIMER=y CONFIG_DM_VIDEO=y CONFIG_BACKLIGHT_GPIO=y CONFIG_SYS_WHITE_ON_BLACK=y
Signature · 1 line
2.25.1
PATCH v3 16/22 configs: imxrt1050-evk: enable imx gpt timer as tick-timer
Quoted 2 lines
Let's enable imx-gpt-timer in imx1050-evk defconfig.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 17/22 video: mxsfb: add enabling of "axi" clock other than "per" clock
In reply to Giulio BenettiOn some SoC mxsfb needs more than one clock gate(actual "per" clock). So let's introduce "axi" clock that can be provided but it's not mandatory. This is inspired from linux mxsfb driver. Also let's rename "per" clock to "pix" clock for compatibility with already existing .dts lcdif nodes implementation.
--- drivers/video/mxsfb.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/video/mxsfb.c +18 -7
@@ -67,26 +67,37 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,uint32_t vdctrl0;#if CONFIG_IS_ENABLED (CLK ) -struct clk per_clk; +struct clk clk;int ret; - ret =clk_get_by_name (dev,"per" , &per_clk); + ret =clk_get_by_name (dev,"pix" , &clk);if (ret) { -dev_err (dev,"Failed to get mxs clk: %d\n" , ret); +dev_err (dev,"Failed to get mxs pix clk: %d\n" , ret);return ; } - ret =clk_set_rate (&per_clk, timings->pixelclock.typ); + ret =clk_set_rate (&clk, timings->pixelclock.typ);if (ret <0 ) { -dev_err (dev,"Failed to set mxs clk: %d\n" , ret); +dev_err (dev,"Failed to set mxs pix clk: %d\n" , ret);return ; } - ret =clk_enable (&per_clk); + ret =clk_enable (&clk);if (ret <0 ) { -dev_err (dev,"Failed to enable mxs clk: %d\n" , ret); +dev_err (dev,"Failed to enable mxs pix clk: %d\n" , ret);return ; } + + ret =clk_get_by_name (dev,"axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
Signature · 1 line
2.25.1
PATCH v3 17/22 video: mxsfb: add enabling of "axi" clock other than "per" clock
Quoted 6 lines
On some SoC mxsfb needs more than one clock
gate(actual "per" clock). So let's introduce "axi" clock that can be provided but it's not mandatory. This is inspired from linux mxsfb driver. Also let's rename "per" clock to "pix" clock for compatibility with already existing .dts lcdif nodes implementation.Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 18/22 video: mxsfb: add enabling of "disp_axi" clock
In reply to Giulio BenettiSome SoC needs "disp_axi" clock to be enabled, so let's try to retrieve it and enabling. If it fails it gives only a debug(), but this clock as well as "axi" clock is not mandatory.
--- drivers/video/mxsfb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/video/mxsfb.c +11 -0
@@ -98,6 +98,17 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, return; } } + + ret =clk_get_by_name (dev,"disp_axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs disp_axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs disp_axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
Signature · 1 line
2.25.1
PATCH v3 18/22 video: mxsfb: add enabling of "disp_axi" clock
Quoted 4 lines
Some SoC needs "
disp_axi" clock to be enabled, so let's try to retrieve it and enabling. If it fails it gives only adebug(), but this clock as well as "axi" clock is not mandatory.Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 18/22 video: mxsfb: add enabling of "disp_axi" clock
In reply to Stefano BabicSome SoC needs "disp_axi" clock to be enabled, so let's try to retrieve it and enabling. If it fails it gives only a debug(), but this clock as well as "axi" clock is not mandatory.
--- drivers/video/mxsfb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/video/mxsfb.c +11 -0
@@ -98,6 +98,17 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, return; } } + + ret =clk_get_by_name (dev,"disp_axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs disp_axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs disp_axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
Signature · 1 line
2.25.1
PATCH v3 18/22 video: mxsfb: add enabling of "disp_axi" clock
Sorry for this patch sent twice. My e-mail provider doesn't let me send more than 18 e-mail at a time, so I need to send it in 2 times and I've left this.
Best regards
Signature · 2 lines
Giulio Benetti Benetti Engineering sas
Quoted 32 lines · Giulio Benetti
Some SoC needs "
disp_axi" clock to be enabled, so let's try to retrieve it and enabling. If it fails it gives only adebug(), but this clock as well as "axi" clock is not mandatory.Signed-off-by Giulio Benetti <[email protected]>--- drivers/video/mxsfb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/video/mxsfb.c +11
-0@@ -98,6 +98,17 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, return; } } + + ret =clk_get_by_name (dev,"disp_axi" , &clk); +if (!ret) { +debug ("%s: Failed to get mxs disp_axi clk: %d\n" , __func__, ret); + }else { + ret =clk_enable (&clk); +if (ret <0 ) { +dev_err (dev,"Failed to enable mxs disp_axi clk: %d\n" , ret); +return ; + } + }#else /* Kick in the LCDIF clock */ mxs_set_lcdclk (MXS_LCDIF_BASE , timings->pixelclock.typ /1000 );
PATCH v3 19/22 clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to LCDIF_APB
In reply to Giulio BenettiLcd peripheral needs 2 different gates to be enable to work, so let's introduce the missing one(LCDIF_PIX) and rename the existing one (LCDIF_APB).
--- drivers/clk/imx/clk-imxrt1050.c | 6 ++++-- include/dt-bindings/clock/imxrt1050-clock.h | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/clk/imx/clk-imxrt1050.c +4 -2
@@ -255,8 +255,10 @@ static int imxrt1050_clk_probe(struct udevice *dev) imx_clk_gate2("lpuart1", "lpuart_podf", base + 0x7c, 24));clk_dm (IMXRT1050_CLK_SEMC ,imx_clk_gate2 ("semc" ,"semc_podf" , base +0x74 ,4 )); -clk_dm (IMXRT1050_CLK_LCDIF , -imx_clk_gate2 ("lcdif" ,"lcdif_podf" , base +0x74 ,10 )); +clk_dm (IMXRT1050_CLK_LCDIF_APB , +imx_clk_gate2 ("lcdif" ,"lcdif_podf" , base +0x70 ,28 )); +clk_dm (IMXRT1050_CLK_LCDIF_PIX , +imx_clk_gate2 ("lcdif_pix" ,"lcdif" , base +0x74 ,10 ));struct clk *clk, *clk1;
include/dt-bindings/clock/imxrt1050-clock.h +3 -2
@@ -52,7 +52,7 @@#define IMXRT1050_CLK_USDHC2 43#define IMXRT1050_CLK_LPUART1 44#define IMXRT1050_CLK_SEMC 45 -#define IMXRT1050_CLK_LCDIF 46 +#define IMXRT1050_CLK_LCDIF_APB 46#define IMXRT1050_CLK_PLL1_ARM 47#define IMXRT1050_CLK_PLL2_SYS 48#define IMXRT1050_CLK_PLL3_USB_OTG 49
@@ -60,6 +60,7 @@#define IMXRT1050_CLK_PLL5_VIDEO 51#define IMXRT1050_CLK_PLL6_ENET 52#define IMXRT1050_CLK_PLL7_USB_HOST 53 -#define IMXRT1050_CLK_END 54 +#define IMXRT1050_CLK_LCDIF_PIX 54 +#define IMXRT1050_CLK_END 55#endif /* __DT_BINDINGS_CLOCK_IMXRT1050_H */
Signature · 1 line
2.25.1
PATCH v3 19/22 clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to LCDIF_APB
Quoted 4 lines
Lcd peripheral needs 2 different gates to be enable to work, so let's introduce the missing
one(LCDIF_PIX)and rename the existing one (LCDIF_APB).Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 20/22 ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
In reply to Giulio BenettiSince we assume pll5 is the default lcdif clock source let's move assigned-clocks(-parents) properties to .dtsi file.
--- arch/arm/dts/imxrt1050-evk.dts | 3 --- arch/arm/dts/imxrt1050.dtsi | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/dts/imxrt1050-evk.dts +0 -3
@@ -238,9 +238,6 @@ display = <&display0>; status = "okay"; - assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; - assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; - display0: display0 { bits-per-pixel = <16>; bus-width = <16>;
arch/arm/dts/imxrt1050.dtsi +2 -0
@@ -152,6 +152,8 @@ interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMXRT1050_CLK_LCDIF>; clock-names = "per"; + assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; + assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; status = "disabled"; };
Signature · 1 line
2.25.1
PATCH v3 20/22 ARM: dts: imxrt1050: move lcdif assigned clock to dtsi
Quoted 3 lines
Since we assume pll5 is the default lcdif clock source let's move assigned-clocks(-parents) properties to .dtsi file.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 21/22 ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
In reply to Giulio BenettiLcdif needs both "pix" and "axi" clocks to be enabled so let's add them to lcdif node.
--- arch/arm/dts/imxrt1050.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/dts/imxrt1050.dtsi +3 -2
@@ -150,8 +150,9 @@ compatible = "fsl,imxrt-lcdif"; reg = <0x402b8000 0x4000>; interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMXRT1050_CLK_LCDIF>; - clock-names = "per"; + clocks = <&clks IMXRT1050_CLK_LCDIF_PIX>, + <&clks IMXRT1050_CLK_LCDIF_APB>; + clock-names = "pix", "axi"; assigned-clocks = <&clks IMXRT1050_CLK_LCDIF_SEL>; assigned-clock-parents = <&clks IMXRT1050_CLK_PLL5_VIDEO>; status = "disabled";
Signature · 1 line
2.25.1
PATCH v3 21/22 ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver
Quoted 3 lines
Lcdif needs both "pix" and "axi" clocks to be enabled so let's add them to lcdif node.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
PATCH v3 22/22 ARM: dts: imxrt1050-evk: remove u-boot,dm-spl
In reply to Giulio BenettiWe don't need lcdif to be enable in SPL, so let's remove u-boot,dm-spl.
--- arch/arm/dts/imxrt1050-evk.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm/dts/imxrt1050-evk.dts +0 -1
@@ -189,7 +189,6 @@ }; pinctrl_lcdif: lcdifgrp { - u-boot,dm-spl; fsl,pins = < MXRT1050_IOMUXC_GPIO_B0_00_LCD_CLK 0x1b0b1 MXRT1050_IOMUXC_GPIO_B0_01_LCD_ENABLE 0x1b0b1
Signature · 1 line
2.25.1
PATCH v3 22/22 ARM: dts: imxrt1050-evk: remove u-boot,dm-spl
Quoted 2 lines
We don't need lcdif to be enable in SPL, so let's remove u-boot,dm-spl.
Signed-off-by Giulio Benetti <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================
cover Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb
In reply to Stefano BabicHi Stefano,
Quoted 26 lines · Stefano Babic
Hi Giulio,
Quoted 23 lines · Giulio Benetti
Hi Stefano,
Quoted 20 lines · Giulio Benetti
Quoted 18 lines · Giulio Benetti
Quoted 7 lines · Giulio Benetti
This patchset fixes u-boot hang on i.MXRT1050 while setting lcdif in mxsfb
driver. There are 2 gates to be enabled to initialize mxsfb so let's introduce the missing gate as a clock and rename "per" clock to "pix" clock
since in the other .dts files using *-lcdif "pix" is used.Quoted 7 lines
This patchset add also "
disp_axi" clock enabling in mxsfb that should make
able to every i.MX SoC with lcdif using DT. I didn't test it other than i.MXRT1050 since I don't have the boards. If someone can test it it would
be great. Note that i.MX23/28 should fail using DT instead because they don't specify any clock-names in their dts.I've forgotten to specify that this patchset depends on this patchset:
https://patchwork.ozlabs.org/project/uboot/list/?series=237909
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
This ^^^ series is superseeded by v2:
https://patchwork.ozlabs.org/project/uboot/list/?series=241701Current patchset is not superseeded, only the one which depends to is superseeded by v2. Do you prefer me to send a unique patchset with all patches of both patchsets?
Yes, or in patchset becomes a mess. Please send a complete series, thanks !
Well I've merged in a unique patchset both patchsets[1], sorry for my e-mail mess.
[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=243591
Best regards
Signature · 2 lines
Giulio Benetti Benetti Engineering sas