dt-bindings: power: imx8mn: add defines for DISP blk-ctrl domains
Subsystems (2)
PATCH 1/7 dt-bindings: power: imx8mn: add defines for DISP blk-ctrl domains
This adds the defines for the power domains provided by the DISP blk-ctrl.
--- include/dt-bindings/power/imx8mn-power.h | 5 +++++ 1 file changed, 5 insertions(+)
include/dt-bindings/power/imx8mn-power.h +5 -0
@@ -12,4 +12,9 @@#define IMX8MN_POWER_DOMAIN_DISPMIX 3#define IMX8MN_POWER_DOMAIN_MIPI 4 +#define IMX8MN_DISPBLK_PD_MIPI_DSI 0 +#define IMX8MN_DISPBLK_PD_MIPI_CSI 1 +#define IMX8MN_DISPBLK_PD_LCDIF 2 +#define IMX8MN_DISPBLK_PD_ISI 3 +#endif
Signature · 1 line
2.25.1
PATCH 2/7 dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl
This adds the DT binding for the i.MX8MN DISP blk-ctrl.
--- .../soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +97 -0
@@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mm-disp-blk-ctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX8MN DISP blk-ctrl + +maintainers: + - Lucas Stach <[email protected]> + +description: + The i.MX8MN DISP blk-ctrl is a top-level peripheral providing access to + the NoC and ensuring proper power sequencing of the display and MIPI CSI + peripherals located in the DISP domain of the SoC. + +properties: + compatible: + items: + - const: fsl,imx8mn-disp-blk-ctrl + - const: syscon + + reg: + maxItems: 1 + + '#power-domain-cells': + const: 1 + + power-domains: + minItems: 5 + maxItems: 5 + + power-domain-names: + items: + - const: bus + - const: isi + - const: lcdif + - const: mipi-dsi + - const: mipi-csi + + clocks: + minItems: 11 + maxItems: 11 + + clock-names: + items: + - const: disp_axi + - const: disp_apb + - const: disp_axi_root + - const: disp_apb_root + - const: lcdif-axi + - const: lcdif-apb + - const: lcdif-pix + - const: dsi-pclk + - const: dsi-ref + - const: csi-aclk + - const: csi-pclk + +required: + - compatible + - reg + - power-domains + - power-domain-names + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/imx8mn-clock.h> + #include <dt-bindings/power/imx8mn-power.h> + + disp_blk_ctl: blk_ctrl@32e28000 { + compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon"; + reg = <0x32e28000 0x100>; + power-domains = <&pgc_dispmix>, <&pgc_dispmix>, + <&pgc_dispmix>, <&pgc_mipi>, + <&pgc_mipi>; + power-domain-names = "bus", "isi", "lcdif", "mipi-dsi", + "mipi-csi"; + clocks = <&clk IMX8MN_CLK_DISP_AXI>, + <&clk IMX8MN_CLK_DISP_APB>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_PIXEL_ROOT>, + <&clk IMX8MN_CLK_DSI_CORE>, + <&clk IMX8MN_CLK_DSI_PHY_REF>, + <&clk IMX8MN_CLK_CSI1_PHY_REF>, + <&clk IMX8MN_CLK_CAMERA_PIXEL_ROOT>; + clock-names = "disp_axi", "disp_apb", "disp_axi_root", "disp_apb_root", + "lcdif-axi", "lcdif-apb", "lcdif-pix", "dsi-pclk", + "dsi-ref", "csi-aclk", "csi-pclk"; + #power-domain-cells = <1>; + };
Signature · 1 line
2.25.1
PATCH 3/7 soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl
In reply to Adam FordThis adds the description for the i.MX8MN disp blk-ctrl.
--- drivers/soc/imx/imx8m-blk-ctrl.c | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)
drivers/soc/imx/imx8m-blk-ctrl.c +70 -0
@@ -14,6 +14,7 @@#include <linux/clk.h> #include <dt-bindings/power/imx8mm-power.h> +#include <dt-bindings/power/imx8mn-power.h> #define BLK_SFT_RSTN 0x0#define BLK_CLK_EN 0x4
@@ -498,6 +499,75 @@ static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), }; + +static int imx8mn_disp_power_notifier (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + +if (action !=GENPD_NOTIFY_ON && action !=GENPD_NOTIFY_PRE_OFF ) +return NOTIFY_OK ; + +/* Enable bus clock and deassert bus reset */ +regmap_set_bits (bc->regmap,BLK_CLK_EN ,BIT (8 )); +regmap_set_bits (bc->regmap,BLK_SFT_RSTN ,BIT (8 )); + +/* +* On power up we have no software backchannel to the GPC to +* wait for the ADB handshake to happen, so we just delay for a +* bit. On power down the GPC driver waits for the handshake. +*/ +if (action ==GENPD_NOTIFY_ON ) +udelay (5 ); + + +return NOTIFY_OK ; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { + [IMX8MN_DISPBLK_PD_MIPI_DSI ] = { + .name ="dispblk-mipi-dsi" , + .clk_names = (const char *[]){"dsi-pclk" ,"dsi-ref" , }, + .num_clks =2 , + .gpc_name ="mipi-dsi" , + .rst_mask =BIT (0 ) |BIT (1 ), + .clk_mask =BIT (0 ) |BIT (1 ), + }, + [IMX8MN_DISPBLK_PD_MIPI_CSI ] = { + .name ="dispblk-mipi-csi" , + .clk_names = (const char *[]){"csi-aclk" ,"csi-pclk" }, + .num_clks =2 , + .gpc_name ="mipi-csi" , + .rst_mask =BIT (2 ) |BIT (3 ), + .clk_mask =BIT (2 ) |BIT (3 ), + }, + [IMX8MN_DISPBLK_PD_LCDIF ] = { + .name ="dispblk-lcdif" , + .clk_names = (const char *[]){"lcdif-axi" ,"lcdif-apb" ,"lcdif-pix" , }, + .num_clks =3 , + .gpc_name ="lcdif" , + .rst_mask =BIT (4 ) |BIT (5 ), + .clk_mask =BIT (4 ) |BIT (5 ), + }, + [IMX8MN_DISPBLK_PD_ISI ] = { + .name ="dispblk-isi" , + .clk_names = (const char *[]){"disp_axi" ,"disp_apb" ,"disp_axi_root" , +"disp_apb_root" }, + .num_clks =2 , + .gpc_name ="isi" , + .rst_mask =BIT (6 ) |BIT (7 ), + .clk_mask =BIT (6 ) |BIT (7 ), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { + .max_reg =0x84 , + .power_notifier_fn = imx8mn_disp_power_notifier, + .domains = imx8mn_disp_blk_ctl_domain_data, + .num_domains =ARRAY_SIZE (imx8mn_disp_blk_ctl_domain_data), +}; +static const struct of_device_id imx8m_blk_ctrl_of_match[] = { { .compatible ="fsl,imx8mm-vpu-blk-ctrl" ,
Signature · 1 line
2.25.1
PATCH 4/7 arm64: dts: imx8mn: add GPC node
In reply to Adam FordAdd the DT node for the GPC, including all the PGC power domains, some of them are not fully functional yet, as they require interaction with the blk-ctrls to properly power up/down the peripherals.
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 49 +++++++++++++++++++++++ 1 file changed, 49 insertions(+)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +49 -0
@@ -4,6 +4,8 @@ */ #include <dt-bindings/clock/imx8mn-clock.h> +#include <dt-bindings/power/imx8mn-power.h> +#include <dt-bindings/reset/imx8mq-reset.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -612,6 +614,53 @@ src: reset-controller@30390000 { interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; #reset-cells = <1>; }; + + gpc: gpc@303a0000 { + compatible = "fsl,imx8mn-gpc"; + reg = <0x303a0000 0x10000>; + interrupt-parent = <&gic>; + interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; + + pgc { + #address-cells = <1>; + #size-cells = <0>; + + pgc_hsiomix: power-domain@0 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_HSIOMIX>; + clocks = <&clk IMX8MN_CLK_USB1_CTRL_ROOT>; + }; + + pgc_otg1: power-domain@1 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_OTG1>; + power-domains = <&pgc_hsiomix>; + }; + + pgc_gpumix: power-domain@2 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_GPUMIX>; + clocks = <&clk IMX8MN_CLK_GPU_CORE_ROOT>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>, + <&clk IMX8MN_CLK_GPU_BUS_ROOT>, + <&clk IMX8MN_CLK_GPU_AHB>; + resets = <&src IMX8MQ_RESET_GPU_RESET>; + }; + + pgc_dispmix: power-domain@3 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_DISPMIX>; + clocks = <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>; + }; + + pgc_mipi: power-domain@4 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_MIPI>; + power-domains = <&pgc_dispmix>; + }; + }; + }; }; aips2: bus@30400000 {
Signature · 1 line
2.25.1
PATCH 5/7 arm64: dts: imx8mn: put USB controller into power-domains
In reply to Adam FordNow that we have support for the power domain controller on the i.MX8MN, we can put the USB controller in the respective power domain to allow it to power down the PHY when possible.
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +1 -0
@@ -1021,6 +1021,7 @@ usbotg1: usb@32e40000 { assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_500M>; phys = <&usbphynop1>; fsl,usbmisc = <&usbmisc1 0>; + power-domains = <&pgc_otg1>; status = "disabled"; };
Signature · 1 line
2.25.1
PATCH 6/7 arm64: dts: imx8mn: add DISP blk-ctrl
In reply to Adam FordAdd the DT node for the DISP blk-ctrl. With this in place the display/mipi power domains should be functional.
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +28 -0
@@ -1011,6 +1011,34 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges; + disp_blk_ctrl: blk-ctrl@32e28000 { + compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon"; + reg = <0x32e28000 0x100>; + power-domains = <&pgc_dispmix>, <&pgc_dispmix>, + <&pgc_dispmix>, <&pgc_mipi>, + <&pgc_mipi>; + power-domain-names = "bus", "isi", + "lcdif", "mipi-dsi", + "mipi-csi"; + clocks = <&clk IMX8MN_CLK_DISP_AXI>, + <&clk IMX8MN_CLK_DISP_APB>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_PIXEL_ROOT>, + <&clk IMX8MN_CLK_DSI_CORE>, + <&clk IMX8MN_CLK_DSI_PHY_REF>, + <&clk IMX8MN_CLK_CSI1_PHY_REF>, + <&clk IMX8MN_CLK_CAMERA_PIXEL_ROOT>; + clock-names = "disp_axi", "disp_apb", + "disp_axi_root", "disp_apb_root", + "lcdif-axi", "lcdif-apb", "lcdif-pix", + "dsi-pclk", "dsi-ref", + "csi-aclk", "csi-pclk"; + #power-domain-cells = <1>; + }; + usbotg1: usb@32e40000 { compatible = "fsl,imx8mn-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;
Signature · 1 line
2.25.1
PATCH 7/7 arm64: dts: imx8mn: Enable GPU
In reply to Adam FordThe i.MX8M-Nano features a GC7000. The Etnaviv driver detects it as:
etnaviv-gpu 38000000.gpu: model: GC7000, revision: 6203
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/freescale/imx8mn.dtsi +25 -0
@@ -1089,6 +1089,31 @@ gpmi: nand-controller@33002000 { status = "disabled"; }; + gpu: gpu@38000000 { + compatible = "vivante,gc"; + reg = <0x38000000 0x8000>; + interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MN_CLK_GPU_AHB>, + <&clk IMX8MN_CLK_GPU_BUS_ROOT>, + <&clk IMX8MN_CLK_GPU_CORE_ROOT>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>; + clock-names = "reg", "bus", "core", "shader"; + assigned-clocks = <&clk IMX8MN_CLK_GPU_CORE_SRC>, + <&clk IMX8MN_CLK_GPU_SHADER_SRC>, + <&clk IMX8MN_CLK_GPU_AXI>, + <&clk IMX8MN_CLK_GPU_AHB>, + <&clk IMX8MN_GPU_PLL>, + <&clk IMX8MN_CLK_GPU_CORE_DIV>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>; + assigned-clock-parents = <&clk IMX8MN_GPU_PLL_OUT>, + <&clk IMX8MN_GPU_PLL_OUT>, + <&clk IMX8MN_SYS_PLL1_800M>, + <&clk IMX8MN_SYS_PLL1_800M>; + assigned-clock-rates = <0>, <0>, <800000000>, <400000000>, <1200000000>, + <400000000>, <400000000>; + power-domains = <&pgc_gpumix>; + }; + gic: interrupt-controller@38800000 { compatible = "arm,gic-v3"; reg = <0x38800000 0x10000>,
Signature · 1 line
2.25.1
Re: [PATCH 2/7] dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl
In reply to Adam FordAm Dienstag, dem 05.10.2021 um 19:04 -0500 schrieb Adam Ford:
Quoted 14 lines
This adds the DT binding for the i.MX8MN DISP blk-ctrl.
Signed-off-by Adam Ford <[email protected]>--- .../soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yamlDocumentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +0
-0
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml line 4
Quoted 4 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +4
-0@@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mm-disp-blk-ctrl.yaml#
mm -> mn in the file name.
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml line 10
Quoted 6 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +6
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX8MN DISP blk-ctrl + +maintainers: + - Lucas Stach <[email protected]>
I'm not opposed to being maintainer for this file, just making sure that this is what you intended.
Other than that I think this looks okay.
Regards,
Lucas
Quoted 87 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +87
-0+ +description: + The i.MX8MN DISP blk-ctrl is a top-level peripheral providing access to + the NoC and ensuring proper power sequencing of the display and MIPI CSI + peripherals located in the DISP domain of the SoC. + +properties: + compatible: + items: + - const: fsl,imx8mn-disp-blk-ctrl + - const: syscon + + reg: + maxItems: 1 + + '#power-domain-cells': + const: 1 + + power-domains: + minItems: 5 + maxItems: 5 + + power-domain-names: + items: + - const: bus + - const: isi + - const: lcdif + - const: mipi-dsi + - const: mipi-csi + + clocks: + minItems: 11 + maxItems: 11 + + clock-names: + items: + - const: disp_axi + - const: disp_apb + - const: disp_axi_root + - const: disp_apb_root + - const: lcdif-axi + - const: lcdif-apb + - const: lcdif-pix + - const: dsi-pclk + - const: dsi-ref + - const: csi-aclk + - const: csi-pclk + +required: + - compatible + - reg + - power-domains + - power-domain-names + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/imx8mn-clock.h> + #include <dt-bindings/power/imx8mn-power.h> + + disp_blk_ctl: blk_ctrl@32e28000 { + compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon"; + reg = <0x32e28000 0x100>; + power-domains = <&pgc_dispmix>, <&pgc_dispmix>, + <&pgc_dispmix>, <&pgc_mipi>, + <&pgc_mipi>; + power-domain-names = "bus", "isi", "lcdif", "mipi-dsi", + "mipi-csi"; + clocks = <&clk IMX8MN_CLK_DISP_AXI>, + <&clk IMX8MN_CLK_DISP_APB>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_PIXEL_ROOT>, + <&clk IMX8MN_CLK_DSI_CORE>, + <&clk IMX8MN_CLK_DSI_PHY_REF>, + <&clk IMX8MN_CLK_CSI1_PHY_REF>, + <&clk IMX8MN_CLK_CAMERA_PIXEL_ROOT>; + clock-names = "disp_axi", "disp_apb", "disp_axi_root", "disp_apb_root", + "lcdif-axi", "lcdif-apb", "lcdif-pix", "dsi-pclk", + "dsi-ref", "csi-aclk", "csi-pclk"; + #power-domain-cells = <1>; + };
Re: [PATCH 3/7] soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl
In reply to Adam FordAm Dienstag, dem 05.10.2021 um 19:05 -0500 schrieb Adam Ford:
Quoted 69 lines
This adds the description for the i.MX8MN disp blk-ctrl.
Signed-off-by Adam Ford <[email protected]>--- drivers/soc/imx/imx8m-blk-ctrl.c | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)drivers/soc/imx/imx8m-blk-ctrl.c +47
-0@@ -14,6 +14,7 @@#include <linux/clk.h> #include <dt-bindings/power/imx8mm-power.h> +#include <dt-bindings/power/imx8mn-power.h> #define BLK_SFT_RSTN 0x0#define BLK_CLK_EN 0x4@@ -498,6 +499,75 @@ static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), }; + +static int imx8mn_disp_power_notifier (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + +if (action !=GENPD_NOTIFY_ON && action !=GENPD_NOTIFY_PRE_OFF ) +return NOTIFY_OK ; + +/* Enable bus clock and deassert bus reset */ +regmap_set_bits (bc->regmap,BLK_CLK_EN ,BIT (8 )); +regmap_set_bits (bc->regmap,BLK_SFT_RSTN ,BIT (8 )); + +/* +* On power up we have no software backchannel to the GPC to +* wait for the ADB handshake to happen, so we just delay for a +* bit. On power down the GPC driver waits for the handshake. +*/ +if (action ==GENPD_NOTIFY_ON ) +udelay (5 ); + + +return NOTIFY_OK ; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { + [IMX8MN_DISPBLK_PD_MIPI_DSI ] = { + .name ="dispblk-mipi-dsi" , + .clk_names = (const char *[]){"dsi-pclk" ,"dsi-ref" , }, + .num_clks =2 , + .gpc_name ="mipi-dsi" , + .rst_mask =BIT (0 ) |BIT (1 ), + .clk_mask =BIT (0 ) |BIT (1 ), + }, + [IMX8MN_DISPBLK_PD_MIPI_CSI ] = { + .name ="dispblk-mipi-csi" , + .clk_names = (const char *[]){"csi-aclk" ,"csi-pclk" }, + .num_clks =2 , + .gpc_name ="mipi-csi" , + .rst_mask =BIT (2 ) |BIT (3 ), + .clk_mask =BIT (2 ) |BIT (3 ), + }, + [IMX8MN_DISPBLK_PD_LCDIF ] = { + .name ="dispblk-lcdif" , + .clk_names = (const char *[]){"lcdif-axi" ,"lcdif-apb" ,"lcdif-pix" , },
drivers/soc/imx/imx8m-blk-ctrl.c static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { · line 557
Quoted 10 lines
drivers/soc/imx/imx8m-blk-ctrl.c +10
-0+ .num_clks = 3, + .gpc_name = "lcdif", + .rst_mask = BIT(4) | BIT(5), + .clk_mask = BIT(4) | BIT(5), + }, + [IMX8MN_DISPBLK_PD_ISI] = { + .name = "dispblk-isi", + .clk_names = (const char *[]){"disp_axi" ,"disp_apb" ,"disp_axi_root" , + "disp_apb_root"}, + .num_clks = 2,
I think those are wrong. At least the num_clks and the number of clock names is inconsistent.
drivers/soc/imx/imx8m-blk-ctrl.c static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { · line 570
Quoted 13 lines
drivers/soc/imx/imx8m-blk-ctrl.c +13
-0+ .gpc_name = "isi", + .rst_mask = BIT(6) | BIT(7), + .clk_mask = BIT(6) | BIT(7), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { + .max_reg =0x84 , + .power_notifier_fn = imx8mn_disp_power_notifier, + .domains = imx8mn_disp_blk_ctl_domain_data, + .num_domains =ARRAY_SIZE (imx8mn_disp_blk_ctl_domain_data), +}; +
You need to hook this up in imx8m_blk_ctrl_of_match, otherwise this is all just dead code.
Regards,
Lucas
Quoted 3 lines
drivers/soc/imx/imx8m-blk-ctrl.c +0
-0static const struct of_device_id imx8m_blk_ctrl_of_match[] = { { .compatible ="fsl,imx8mm-vpu-blk-ctrl" ,
Re: [PATCH 4/7] arm64: dts: imx8mn: add GPC node
In reply to Adam FordAm Dienstag, dem 05.10.2021 um 19:05 -0500 schrieb Adam Ford:
Quoted 31 lines
Add the DT node for the GPC, including all the PGC power domains, some of them are not fully functional yet, as they require interaction with the blk-ctrls to properly power up/down the peripherals.
Signed-off-by Adam Ford <[email protected]>--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 49 +++++++++++++++++++++++ 1 file changed, 49 insertions(+)arch/arm64/boot/dts/freescale/imx8mn.dtsi +7
-0@@ -4,6 +4,8 @@ */ #include <dt-bindings/clock/imx8mn-clock.h> +#include <dt-bindings/power/imx8mn-power.h> +#include <dt-bindings/reset/imx8mq-reset.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h>@@ -612,6 +614,53 @@ src: reset-controller@30390000 { interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; #reset-cells = <1>; }; + + gpc: gpc@303a0000 { + compatible = "fsl,imx8mn-gpc"; + reg = <0x303a0000 0x10000>; + interrupt-parent = <&gic>;
arch/arm64/boot/dts/freescale/imx8mn.dtsi src: reset-controller@30390000 { · line 631
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +10
-0+ interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; + + pgc { + #address-cells = <1>; + #size-cells = <0>; + + pgc_hsiomix: power-domain@0 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_HSIOMIX>; + clocks = <&clk IMX8MN_CLK_USB1_CTRL_ROOT>;
This should be IMX8MN_CLK_USB_BUS.
Regards,
Lucas
Quoted 35 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +32
-0+ }; + + pgc_otg1: power-domain@1 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_OTG1>; + power-domains = <&pgc_hsiomix>; + }; + + pgc_gpumix: power-domain@2 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_GPUMIX>; + clocks = <&clk IMX8MN_CLK_GPU_CORE_ROOT>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>, + <&clk IMX8MN_CLK_GPU_BUS_ROOT>, + <&clk IMX8MN_CLK_GPU_AHB>; + resets = <&src IMX8MQ_RESET_GPU_RESET>; + }; + + pgc_dispmix: power-domain@3 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_DISPMIX>; + clocks = <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>; + }; + + pgc_mipi: power-domain@4 { + #power-domain-cells = <0>; + reg = <IMX8MN_POWER_DOMAIN_MIPI>; + power-domains = <&pgc_dispmix>; + }; + }; + }; }; aips2: bus@30400000 {
Re: [PATCH 5/7] arm64: dts: imx8mn: put USB controller into power-domains
In reply to Adam FordAm Dienstag, dem 05.10.2021 um 19:05 -0500 schrieb Adam Ford:
Quoted 5 lines
Now that we have support for the power domain controller on the i.MX8MN, we can put the USB controller in the respective power domain to allow it to power down the PHY when possible.
Signed-off-by Adam Ford <[email protected]>
Quoted 16 lines
--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/freescale/imx8mn.dtsi +1
-0@@ -1021,6 +1021,7 @@ usbotg1: usb@32e40000 { assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_500M>; phys = <&usbphynop1>; fsl,usbmisc = <&usbmisc1 0>; + power-domains = <&pgc_otg1>; status = "disabled"; };
Re: [PATCH 7/7] arm64: dts: imx8mn: Enable GPU
In reply to Adam FordAm Dienstag, dem 05.10.2021 um 19:05 -0500 schrieb Adam Ford:
Quoted 15 lines
The i.MX8M-Nano features a GC7000. The Etnaviv driver detects it as:
etnaviv-gpu 38000000.gpu: model: GC7000, revision: 6203Signed-off-by Adam Ford <[email protected]>--- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+)arch/arm64/boot/dts/freescale/imx8mn.dtsi +0
-0@@ -1089,6 +1089,31 @@ gpmi: nand-controller@33002000 { status = "disabled";
arch/arm64/boot/dts/freescale/imx8mn.dtsi gpmi: nand-controller@33002000 { · line 1099
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +8
-0}; + gpu: gpu@38000000 { + compatible = "vivante,gc"; + reg = <0x38000000 0x8000>; + interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MN_CLK_GPU_AHB>, + <&clk IMX8MN_CLK_GPU_BUS_ROOT>, + <&clk IMX8MN_CLK_GPU_CORE_ROOT>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>;
Last one should be just IMX8MN_CLK_GPU_SHADER.
arch/arm64/boot/dts/freescale/imx8mn.dtsi gpmi: nand-controller@33002000 { · line 1107
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +8
-0+ clock-names = "reg", "bus", "core", "shader"; + assigned-clocks = <&clk IMX8MN_CLK_GPU_CORE_SRC>, + <&clk IMX8MN_CLK_GPU_SHADER_SRC>, + <&clk IMX8MN_CLK_GPU_AXI>, + <&clk IMX8MN_CLK_GPU_AHB>, + <&clk IMX8MN_GPU_PLL>, + <&clk IMX8MN_CLK_GPU_CORE_DIV>, + <&clk IMX8MN_CLK_GPU_SHADER_DIV>;
_SRC and _DIV clocks are just legacy aliases for the now composite clocks and should not be used in new DTs. Please just use the composite clock handles directly.
Regards,
Lucas
Quoted 12 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +9
-0+ assigned-clock-parents = <&clk IMX8MN_GPU_PLL_OUT>, + <&clk IMX8MN_GPU_PLL_OUT>, + <&clk IMX8MN_SYS_PLL1_800M>, + <&clk IMX8MN_SYS_PLL1_800M>; + assigned-clock-rates = <0>, <0>, <800000000>, <400000000>, <1200000000>, + <400000000>, <400000000>; + power-domains = <&pgc_gpumix>; + }; + gic: interrupt-controller@38800000 { compatible = "arm,gic-v3"; reg = <0x38800000 0x10000>,
Re: [PATCH 2/7] dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl
In reply to Lucas StachQuoted 10 lines · Lucas Stach
Am Dienstag, dem 05.10.2021 um 19:04 -0500 schrieb Adam Ford:
Quoted 8 lines
This adds the DT binding for the i.MX8MN DISP blk-ctrl.
Signed-off-by Adam Ford <[email protected]>--- .../soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml
Quoted 12 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml line 4
Quoted 10 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +4
-0@@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mm-disp-blk-ctrl.yaml#mm -> mn in the file name.
Oops, I missed one. Thanks for catching.
Quoted 10 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml line 10
Quoted 7 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +6
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX8MN DISP blk-ctrl + +maintainers: + - Lucas Stach <[email protected]>I'm not opposed to being maintainer for this file, just making sure that this is what you intended.
Because this yaml file points to the driver you wrote, I thought it made sense to have you be the maintainer. In hindsight, I should have asked first. Sorry about that.
Quoted 2 lines
Other than that I think this looks okay.
Thanks for reviewing the series. I'll try to get a V2 prepared tomorrow, and I'll wait a little bit to send it, just in case NXP wants to give some feedback as well.
adam
Quoted 93 lines
Regards,
LucasQuoted 87 lines
Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml new file +87
-0+ +description: + The i.MX8MN DISP blk-ctrl is a top-level peripheral providing access to + the NoC and ensuring proper power sequencing of the display and MIPI CSI + peripherals located in the DISP domain of the SoC. + +properties: + compatible: + items: + - const: fsl,imx8mn-disp-blk-ctrl + - const: syscon + + reg: + maxItems: 1 + + '#power-domain-cells': + const: 1 + + power-domains: + minItems: 5 + maxItems: 5 + + power-domain-names: + items: + - const: bus + - const: isi + - const: lcdif + - const: mipi-dsi + - const: mipi-csi + + clocks: + minItems: 11 + maxItems: 11 + + clock-names: + items: + - const: disp_axi + - const: disp_apb + - const: disp_axi_root + - const: disp_apb_root + - const: lcdif-axi + - const: lcdif-apb + - const: lcdif-pix + - const: dsi-pclk + - const: dsi-ref + - const: csi-aclk + - const: csi-pclk + +required: + - compatible + - reg + - power-domains + - power-domain-names + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/imx8mn-clock.h> + #include <dt-bindings/power/imx8mn-power.h> + + disp_blk_ctl: blk_ctrl@32e28000 { + compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon"; + reg = <0x32e28000 0x100>; + power-domains = <&pgc_dispmix>, <&pgc_dispmix>, + <&pgc_dispmix>, <&pgc_mipi>, + <&pgc_mipi>; + power-domain-names = "bus", "isi", "lcdif", "mipi-dsi", + "mipi-csi"; + clocks = <&clk IMX8MN_CLK_DISP_AXI>, + <&clk IMX8MN_CLK_DISP_APB>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_AXI_ROOT>, + <&clk IMX8MN_CLK_DISP_APB_ROOT>, + <&clk IMX8MN_CLK_DISP_PIXEL_ROOT>, + <&clk IMX8MN_CLK_DSI_CORE>, + <&clk IMX8MN_CLK_DSI_PHY_REF>, + <&clk IMX8MN_CLK_CSI1_PHY_REF>, + <&clk IMX8MN_CLK_CAMERA_PIXEL_ROOT>; + clock-names = "disp_axi", "disp_apb", "disp_axi_root", "disp_apb_root", + "lcdif-axi", "lcdif-apb", "lcdif-pix", "dsi-pclk", + "dsi-ref", "csi-aclk", "csi-pclk"; + #power-domain-cells = <1>; + };
Rob Herring
maintainerRe: [PATCH 2/7] dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl
In reply to Adam FordQuoted 8 lines · Adam Ford
This adds the DT binding for the i.MX8MN DISP blk-ctrl.
Signed-off-by Adam Ford <[email protected]>--- .../soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:./Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml:78:1: [error] syntax error: found character '\t' that cannot start any token (syntax)
dtschema/dtc warnings/errors:
make[1]: *** Deleting file 'Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.example.dts'
Traceback (most recent call last):
File "/usr/local/bin/dt-extract-example", line 45, in <module>
binding = yaml.load(open(args.yamlfile, encoding='utf-8').read())
File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/main.py", line 434, in load
return constructor.get_single_data()
File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", line 120, in get_single_data
node = self.composer.get_single_node()
File "_ruamel_yaml.pyx", line 706, in _ruamel_yaml.CParser.get_single_node
File "_ruamel_yaml.pyx", line 724, in _ruamel_yaml.CParser._compose_document
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 773, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 848, in _ruamel_yaml.CParser._compose_sequence_node
File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
ruamel.yaml.scanner.ScannerError: while scanning a block scalar
in "<unicode string>", line 70, column 5
found a tab character where an indentation space is expected
in "<unicode string>", line 78, column 1
make[1]: *** [Documentation/devicetree/bindings/Makefile:20: Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.example.dts] Error 1 make[1]: *** Waiting for unfinished jobs...../Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml: while scanning a block scalar
in "<unicode string>", line 70, column 5
found a tab character where an indentation space is expected
in "<unicode string>", line 78, column 1
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml: ignoring, error parsing file
warning: no schema found in file: ./Documentation/devicetree/bindings/soc/imx/fsl,imx8mn-disp-blk-ctrl.yaml
make: *** [Makefile:1441: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1536963
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
Re: [PATCH 3/7] soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl
In reply to Lucas StachQuoted 76 lines · Lucas Stach
Am Dienstag, dem 05.10.2021 um 19:05 -0500 schrieb Adam Ford:
Quoted 74 lines
This adds the description for the i.MX8MN disp blk-ctrl.
Signed-off-by Adam Ford <[email protected]>--- drivers/soc/imx/imx8m-blk-ctrl.c | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)drivers/soc/imx/imx8m-blk-ctrl.c +52
-0@@ -14,6 +14,7 @@#include <linux/clk.h> #include <dt-bindings/power/imx8mm-power.h> +#include <dt-bindings/power/imx8mn-power.h> #define BLK_SFT_RSTN 0x0#define BLK_CLK_EN 0x4@@ -498,6 +499,75 @@ static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), }; + +static int imx8mn_disp_power_notifier (struct notifier_block *nb, +unsigned long action,void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + +if (action !=GENPD_NOTIFY_ON && action !=GENPD_NOTIFY_PRE_OFF ) +return NOTIFY_OK ; + +/* Enable bus clock and deassert bus reset */ +regmap_set_bits (bc->regmap,BLK_CLK_EN ,BIT (8 )); +regmap_set_bits (bc->regmap,BLK_SFT_RSTN ,BIT (8 )); + +/* +* On power up we have no software backchannel to the GPC to +* wait for the ADB handshake to happen, so we just delay for a +* bit. On power down the GPC driver waits for the handshake. +*/ +if (action ==GENPD_NOTIFY_ON ) +udelay (5 ); + + +return NOTIFY_OK ; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { + [IMX8MN_DISPBLK_PD_MIPI_DSI ] = { + .name ="dispblk-mipi-dsi" , + .clk_names = (const char *[]){"dsi-pclk" ,"dsi-ref" , }, + .num_clks =2 , + .gpc_name ="mipi-dsi" , + .rst_mask =BIT (0 ) |BIT (1 ), + .clk_mask =BIT (0 ) |BIT (1 ), + }, + [IMX8MN_DISPBLK_PD_MIPI_CSI ] = { + .name ="dispblk-mipi-csi" , + .clk_names = (const char *[]){"csi-aclk" ,"csi-pclk" }, + .num_clks =2 , + .gpc_name ="mipi-csi" , + .rst_mask =BIT (2 ) |BIT (3 ), + .clk_mask =BIT (2 ) |BIT (3 ), + }, + [IMX8MN_DISPBLK_PD_LCDIF ] = { + .name ="dispblk-lcdif" , + .clk_names = (const char *[]){"lcdif-axi" ,"lcdif-apb" ,"lcdif-pix" , }, + .num_clks =3 , + .gpc_name ="lcdif" , + .rst_mask =BIT (4 ) |BIT (5 ), + .clk_mask =BIT (4 ) |BIT (5 ), + },
Quoted 8 lines
drivers/soc/imx/imx8m-blk-ctrl.c static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { · line 557
Quoted 5 lines
drivers/soc/imx/imx8m-blk-ctrl.c +5
-0+ [IMX8MN_DISPBLK_PD_ISI] = { + .name = "dispblk-isi", + .clk_names = (const char *[]){"disp_axi" ,"disp_apb" ,"disp_axi_root" , + "disp_apb_root"}, + .num_clks = 2,I think those are wrong. At least the
num_clksand the number of clock names is inconsistent.
The NXP tree shows 4 clocks on the ISI node are enabled before the ISI can be pulled out of reset. I'll make the num_clks = 4.
Quoted 16 lines
Quoted 4 lines
drivers/soc/imx/imx8m-blk-ctrl.c +3
-0+ .gpc_name = "isi", + .rst_mask = BIT(6) | BIT(7), + .clk_mask = BIT(6) | BIT(7),drivers/soc/imx/imx8m-blk-ctrl.c static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { · line 570
Quoted 10 lines
drivers/soc/imx/imx8m-blk-ctrl.c +10
-0+ }, +}; + +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { + .max_reg =0x84 , + .power_notifier_fn = imx8mn_disp_power_notifier, + .domains = imx8mn_disp_blk_ctl_domain_data, + .num_domains =ARRAY_SIZE (imx8mn_disp_blk_ctl_domain_data), +}; +You need to hook this up in
imx8m_blk_ctrl_of_match, otherwise this is all just dead code.
Oops. I had that, but i forgot to commit after the save. It'll be fixed shortly.
Quoted 4 lines
Regards,
Lucas
thanks for the review.
adam
Quoted 5 lines
Quoted 3 lines
drivers/soc/imx/imx8m-blk-ctrl.c +0
-0static const struct of_device_id imx8m_blk_ctrl_of_match[] = { { .compatible ="fsl,imx8mm-vpu-blk-ctrl" ,