ARM: imx6q: Add GPR6 and GPR7 register definitions for iomuxc gpr
Subsystems (4)
PATCH 1/2 ARM: imx6q: Add GPR6 and GPR7 register definitions for iomuxc gpr
From: Philipp Zabel <[email protected]>
Masks for IPU AXI transaction QoS settings
--- include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +18 -0
@@ -241,6 +241,24 @@#define IMX6Q_GPR5_L2_CLK_STOP BIT(8) +#define IMX6Q_GPR6_IPU1_ID00_WR_QOS_MASK (0xf << 0) +#define IMX6Q_GPR6_IPU1_ID01_WR_QOS_MASK (0xf << 4) +#define IMX6Q_GPR6_IPU1_ID10_WR_QOS_MASK (0xf << 8) +#define IMX6Q_GPR6_IPU1_ID11_WR_QOS_MASK (0xf << 12) +#define IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK (0xf << 16) +#define IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK (0xf << 20) +#define IMX6Q_GPR6_IPU1_ID10_RD_QOS_MASK (0xf << 24) +#define IMX6Q_GPR6_IPU1_ID11_RD_QOS_MASK (0xf << 28) + +#define IMX6Q_GPR7_IPU2_ID00_WR_QOS_MASK (0xf << 0) +#define IMX6Q_GPR7_IPU2_ID01_WR_QOS_MASK (0xf << 4) +#define IMX6Q_GPR7_IPU2_ID10_WR_QOS_MASK (0xf << 8) +#define IMX6Q_GPR7_IPU2_ID11_WR_QOS_MASK (0xf << 12) +#define IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK (0xf << 16) +#define IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK (0xf << 20) +#define IMX6Q_GPR7_IPU2_ID10_RD_QOS_MASK (0xf << 24) +#define IMX6Q_GPR7_IPU2_ID11_RD_QOS_MASK (0xf << 28) +#define IMX6Q_GPR9_TZASC2_BYP BIT(1)#define IMX6Q_GPR9_TZASC1_BYP BIT(0)
Signature · 1 line
1.8.2.1
PATCH 2/2 ARM: imx6q: Mark VPU and IPU AXI transfers as cacheable, increase IPU priority
From: Philipp Zabel <[email protected]>
This is needed so that the IPU framebuffer scanout cannot be starved by VPU or GPU activity.
The Freescale SabreLite and SabreSD boards seem to set this in the boot rom already, but the documented register reset values do not contain the necessary settings.
--- arch/arm/mach-imx/mach-imx6q.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +32 -0
@@ -29,6 +29,7 @@#include <linux/regmap.h> #include <linux/micrel_phy.h> #include <linux/mfd/syscon.h> +#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -161,6 +162,36 @@ static void __init imx6q_usb_init(void)imx_anatop_usb_chrg_detect_disable (); } +static void __init imx6q_gpr_init (void ) +{ +struct regmap *gpr; + + gpr =syscon_regmap_lookup_by_compatible ("fsl,imx6q-iomuxc-gpr" ); +if (IS_ERR (gpr)) { +pr_warn ("failed to find fsl,imx6q-iomuxc-gpr regmap\n" ); +return ; + } + +/* Enable the cacheable attribute of VPU and IPU AXI transactions */ +regmap_update_bits (gpr,IOMUXC_GPR4 ,0 , +IMX6Q_GPR4_VPU_WR_CACHE_SEL | +IMX6Q_GPR4_VPU_RD_CACHE_SEL | +IMX6Q_GPR4_VPU_P_WR_CACHE_VAL | +IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK | +IMX6Q_GPR4_IPU_WR_CACHE_CTL | +IMX6Q_GPR4_IPU_RD_CACHE_CTL ); + +/* Increase IPU read QoS priority */ +regmap_update_bits (gpr,IOMUXC_GPR6 , +IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK | +IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 )); +regmap_update_bits (gpr,IOMUXC_GPR7 , +IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK | +IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 )); +} +static void __init imx6q_init_machine (void ) {if (of_machine_is_compatible ("fsl,imx6q-sabrelite" ))
@@ -172,6 +203,7 @@ static void __init imx6q_init_machine(void)imx6q_pm_init ();imx6q_usb_init ();imx6q_1588_init (); +imx6q_gpr_init (); }#define OCOTP_CFG3 0x440
Signature · 1 line
1.8.2.1
PATCH 2/2 ARM: imx6q: Mark VPU and IPU AXI transfers as cacheable, increase IPU priority
Quoted 6 lines · Markus Pargmann
From: Philipp Zabel <[email protected]>
This is needed so that the IPU framebuffer scanout cannot be starved by VPU or GPU activity.
The Freescale SabreLite and SabreSD boards seem to set this in the boot rom already,
The boot rom is not board specific but SoC, so you meant boot loader?
Quoted 59 lines
but the documented register reset values do not contain the necessary settings.
Signed-off-by Philipp Zabel <[email protected]>Signed-off-by Markus Pargmann <[email protected]>--- arch/arm/mach-imx/mach-imx6q.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)arch/arm/mach-imx/mach-imx6q.c +31
-0@@ -29,6 +29,7 @@#include <linux/regmap.h> #include <linux/micrel_phy.h> #include <linux/mfd/syscon.h> +#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> @@ -161,6 +162,36 @@ static void __init imx6q_usb_init(void)imx_anatop_usb_chrg_detect_disable (); } +static void __init imx6q_gpr_init (void ) +{ +struct regmap *gpr; + + gpr =syscon_regmap_lookup_by_compatible ("fsl,imx6q-iomuxc-gpr" ); +if (IS_ERR (gpr)) { +pr_warn ("failed to find fsl,imx6q-iomuxc-gpr regmap\n" ); +return ; + } + +/* Enable the cacheable attribute of VPU and IPU AXI transactions */ +regmap_update_bits (gpr,IOMUXC_GPR4 ,0 , +IMX6Q_GPR4_VPU_WR_CACHE_SEL | +IMX6Q_GPR4_VPU_RD_CACHE_SEL | +IMX6Q_GPR4_VPU_P_WR_CACHE_VAL | +IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK | +IMX6Q_GPR4_IPU_WR_CACHE_CTL | +IMX6Q_GPR4_IPU_RD_CACHE_CTL ); + +/* Increase IPU read QoS priority */ +regmap_update_bits (gpr,IOMUXC_GPR6 , +IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK | +IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 )); +regmap_update_bits (gpr,IOMUXC_GPR7 , +IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK | +IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 )); +} +static void __init imx6q_init_machine (void ) {if (of_machine_is_compatible ("fsl,imx6q-sabrelite" ))
arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_init_machine(void) · line 206
Quoted 4 lines
arch/arm/mach-imx/mach-imx6q.c +1
-0@@ -172,6 +203,7 @@ static void __init imx6q_init_machine(void)imx6q_pm_init ();imx6q_usb_init ();imx6q_1588_init (); +imx6q_gpr_init ();
The function imx6q_1588_init() is all about setting up some IOMUXC GPR bits, so can you consolidate it into imx6q_gpr_init()?
Shawn
Quoted 6 lines
arch/arm/mach-imx/mach-imx6q.c +0
-0}#define OCOTP_CFG3 0x440Signature · 1 line
1.8.2.1
PATCH 2/2 ARM: imx6q: Mark VPU and IPU AXI transfers as cacheable, increase IPU priority
In reply to Markus PargmannQuoted 38 lines · Markus Pargmann
From: Philipp Zabel <[email protected]>
This is needed so that the IPU framebuffer scanout cannot be starved by VPU or GPU activity.
The Freescale SabreLite and SabreSD boards seem to set this in the boot rom already, but the documented register reset values do not contain the necessary settings.Signed-off-by Philipp Zabel <[email protected]>Signed-off-by Markus Pargmann <[email protected]>--- arch/arm/mach-imx/mach-imx6q.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)arch/arm/mach-imx/mach-imx6q.c +9
-0@@ -29,6 +29,7 @@#include <linux/regmap.h> #include <linux/micrel_phy.h> #include <linux/mfd/syscon.h> +#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> @@ -161,6 +162,36 @@ static void __init imx6q_usb_init(void)imx_anatop_usb_chrg_detect_disable (); } +static void __init imx6q_gpr_init (void ) +{ +struct regmap *gpr; + + gpr =syscon_regmap_lookup_by_compatible ("fsl,imx6q-iomuxc-gpr" ); +if (IS_ERR (gpr)) { +pr_warn ("failed to find fsl,imx6q-iomuxc-gpr regmap\n" ); +return ;
arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_usb_init(void) · line 182
Quoted 10 lines
arch/arm/mach-imx/mach-imx6q.c +10
-0+ } + +/* Enable the cacheable attribute of VPU and IPU AXI transactions */ +regmap_update_bits (gpr,IOMUXC_GPR4 ,0 , +IMX6Q_GPR4_VPU_WR_CACHE_SEL | +IMX6Q_GPR4_VPU_RD_CACHE_SEL | +IMX6Q_GPR4_VPU_P_WR_CACHE_VAL | +IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK | +IMX6Q_GPR4_IPU_WR_CACHE_CTL | +IMX6Q_GPR4_IPU_RD_CACHE_CTL );
I have to admit that I don't understand much of this ;) But comparing this with the U-Boot settings
U-Boot additionally sets GPR4[31-28]:
/* enable AXI cache for VDOA/VPU/IPU */
DATA 4 0x020e0010 0xF00000CF
arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_usb_init(void) · line 192
Quoted 9 lines
arch/arm/mach-imx/mach-imx6q.c +9
-0+/* Increase IPU read QoS priority */ +regmap_update_bits (gpr,IOMUXC_GPR6 , +IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK | +IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 )); +regmap_update_bits (gpr,IOMUXC_GPR7 , +IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK | +IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK , + (0xf <<16 ) | (0x7 <<20 ));
and here U-Boot additionally touches GPR6/7[6-0]:
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ DATA 4 0x020e0018 0x007F007F
DATA 4 0x020e001c 0x007F007F
As mentioned above, I have no idea if/why this is necessary ;)
Best regards
Dirk