IPUv3: Add i.MX53 IPU support
Subsystems (4)
PATCH 1/3 IPUv3: Add i.MX53 IPU support
From: Jason Chen <[email protected]>
--- arch/arm/mach-mx5/board-mx51_babbage.c | 2 +- arch/arm/mach-mx5/devices-imx51.h | 3 - arch/arm/plat-mxc/devices/platform-imx_ipuv3.c | 97 +++++++++++++++++++++-- arch/arm/plat-mxc/include/mach/devices-common.h | 4 +- arch/arm/plat-mxc/include/mach/ipu-v3.h | 1 + drivers/mfd/Kconfig | 6 +- drivers/mfd/imx-ipu-v3/ipu-common.c | 66 +++------------ drivers/mfd/imx-ipu-v3/ipu-prv.h | 32 ++++---- 8 files changed, 126 insertions(+), 85 deletions(-)
arch/arm/mach-mx5/board-mx51_babbage.c +1 -1
@@ -457,7 +457,7 @@ static void __init mxc_board_init(void)gpio_request (GPIO_DVI_I2C ,"dvi i2c" );gpio_direction_output (GPIO_DVI_I2C ,0 ); -imx51_add_ipuv3 (&ipu_data); +imx_add_ipuv3 (&ipu_data); }static void __init mx51_babbage_timer_init (void )
arch/arm/mach-mx5/devices-imx51.h +0 -3
@@ -56,6 +56,3 @@ extern const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst;#define imx51_add_imx_keypad (pdata) \ imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) -extern const struct imx_ipuv3_data imx51_ipuv3_data__initconst ; -#define imx51_add_ipuv3 (pdata) \ - imx_add_ipuv3(&imx51_ipuv3_data, pdata)
arch/arm/plat-mxc/devices/platform-imx_ipuv3.c +90 -7
120 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/devices-common.h +2 -2
@@ -268,9 +268,9 @@ struct platform_device *__init imx_add_spi_imx(#include <mach/ipu-v3.h> struct imx_ipuv3_data {resource_size_t iobase; +resource_size_t iosize;resource_size_t irq_err;resource_size_t irq; };struct platform_device *__init imx_add_ipuv3 ( -const struct imx_ipuv3_data *data, -const struct imx_ipuv3_platform_data *pdata); +struct imx_ipuv3_platform_data *pdata);
arch/arm/plat-mxc/include/mach/ipu-v3.h +1 -0
@@ -42,6 +42,7 @@ struct ipuv3_fb_platform_data {struct imx_ipuv3_platform_data {int rev; +int (*init) (void );struct ipuv3_fb_platform_data *fb_head0_platform_data;struct ipuv3_fb_platform_data *fb_head1_platform_data; };
drivers/mfd/Kconfig +3 -3
@@ -625,11 +625,11 @@ config MFD_WL1273_CORE audio codec. config MFD_IMX_IPU_V3 - tristate "Support the Image Processing Unit (IPU) found on the i.MX51" - depends on ARCH_MX51 + tristate "Support the Image Processing Unit (IPUv3) found on the i.MX5X" + depends on ARCH_MX51 || ARCH_MX53 select MFD_CORE help - Say yes here to support the IPU on i.MX51. + Say yes here to support the IPUv3 on i.MX5X. endif # MFD_SUPPORT
drivers/mfd/imx-ipu-v3/ipu-common.c +13 -53
123 lines not on this page · raw message
drivers/mfd/imx-ipu-v3/ipu-prv.h +16 -16
@@ -21,22 +21,22 @@#include <linux/platform_device.h> #include <mach/hardware.h> -#define MX51_IPU_CHANNEL_CSI0 0 -#define MX51_IPU_CHANNEL_CSI1 1 -#define MX51_IPU_CHANNEL_CSI2 2 -#define MX51_IPU_CHANNEL_CSI3 3 -#define MX51_IPU_CHANNEL_MEM_BG_SYNC 23 -#define MX51_IPU_CHANNEL_MEM_FG_SYNC 27 -#define MX51_IPU_CHANNEL_MEM_DC_SYNC 28 -#define MX51_IPU_CHANNEL_MEM_FG_SYNC_ALPHA 31 -#define MX51_IPU_CHANNEL_MEM_DC_ASYNC 41 -#define MX51_IPU_CHANNEL_ROT_ENC_MEM 45 -#define MX51_IPU_CHANNEL_ROT_VF_MEM 46 -#define MX51_IPU_CHANNEL_ROT_PP_MEM 47 -#define MX51_IPU_CHANNEL_ROT_ENC_MEM_OUT 48 -#define MX51_IPU_CHANNEL_ROT_VF_MEM_OUT 49 -#define MX51_IPU_CHANNEL_ROT_PP_MEM_OUT 50 -#define MX51_IPU_CHANNEL_MEM_BG_SYNC_ALPHA 51 +#define MX5_IPU_CHANNEL_CSI0 0 +#define MX5_IPU_CHANNEL_CSI1 1 +#define MX5_IPU_CHANNEL_CSI2 2 +#define MX5_IPU_CHANNEL_CSI3 3 +#define MX5_IPU_CHANNEL_MEM_BG_SYNC 23 +#define MX5_IPU_CHANNEL_MEM_FG_SYNC 27 +#define MX5_IPU_CHANNEL_MEM_DC_SYNC 28 +#define MX5_IPU_CHANNEL_MEM_FG_SYNC_ALPHA 31 +#define MX5_IPU_CHANNEL_MEM_DC_ASYNC 41 +#define MX5_IPU_CHANNEL_ROT_ENC_MEM 45 +#define MX5_IPU_CHANNEL_ROT_VF_MEM 46 +#define MX5_IPU_CHANNEL_ROT_PP_MEM 47 +#define MX5_IPU_CHANNEL_ROT_ENC_MEM_OUT 48 +#define MX5_IPU_CHANNEL_ROT_VF_MEM_OUT 49 +#define MX5_IPU_CHANNEL_ROT_PP_MEM_OUT 50 +#define MX5_IPU_CHANNEL_MEM_BG_SYNC_ALPHA 51#define IPU_DISP0_BASE 0x00000000#define IPU_MCU_T_DEFAULT 8
Signature · 1 line
1.7.1
PATCH 2/3 ARM i.MX53 LoCo: Add ipu device & framebuffer support
From: Jason Chen <[email protected]>
--- arch/arm/mach-mx5/Kconfig | 1 + arch/arm/mach-mx5/board-mx53_loco.c | 52 +++++++++++++++++++++++++++++++++++ arch/arm/mach-mx5/clock-mx51-mx53.c | 5 +++- 3 files changed, 57 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
@@ -147,6 +147,7 @@ config MACH_MX53_LOCO bool "Support MX53 LOCO platforms" select SOC_IMX53 select IMX_HAVE_PLATFORM_IMX_UART + select IMX_HAVE_PLATFORM_IMX_IPUV3 help Include support for MX53 LOCO platform. This includes specific configurations for the board and its peripherals.
arch/arm/mach-mx5/board-mx53_loco.c +52 -0
87 lines not on this page · raw message
arch/arm/mach-mx5/clock-mx51-mx53.c +4 -1
@@ -1317,7 +1317,7 @@ static struct clk_lookup mx51_lookups[] = { _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) _REGISTER_CLOCK(NULL, "mipi_hsp", mipi_hsp_clk) - _REGISTER_CLOCK("imx-ipuv3", NULL, ipu_clk) + _REGISTER_CLOCK("imx-ipuv3", "ipu", ipu_clk) _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk) _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk) };
@@ -1336,6 +1336,9 @@ static struct clk_lookup mx53_lookups[] = { _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) + _REGISTER_CLOCK("imx-ipuv3", "ipu", ipu_clk) + _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk) + _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk) };static void clk_tree_init (void )
Signature · 1 line
1.7.1
PATCH 3/3 ARM i.MX53 LoCo: Add PWM backlight device support
In reply to jason.chen at freescale.comFrom: Jason Chen <[email protected]>
--- arch/arm/mach-mx5/board-mx53_loco.c | 29 ++++++++++++++++++++++++++ arch/arm/mach-mx5/clock-mx51-mx53.c | 2 + arch/arm/mach-mx5/devices-imx53.h | 2 + arch/arm/mach-mx5/devices.c | 10 +++++++++ arch/arm/mach-mx5/devices.h | 2 + arch/arm/plat-mxc/devices/Kconfig | 1 + arch/arm/plat-mxc/devices/platform-mxc_pwm.c | 9 ++++++++ arch/arm/plat-mxc/pwm.c | 3 +- 8 files changed, 57 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/board-mx53_loco.c +29 -0
@@ -24,6 +24,7 @@#include <linux/delay.h> #include <linux/gpio.h> #include <linux/mfd/imx-ipu-v3.h> +#include <linux/pwm_backlight.h> #include <mach/common.h> #include <mach/hardware.h>
@@ -39,6 +40,7 @@#include "devices-imx53.h" #include "devices.h" +#define LOCO_DISP0_PWR IMX_GPIO_NR(3, 24)#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6)static iomux_v3_cfg_t mx53_loco_pads[] = {
@@ -74,6 +76,12 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 ,MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 ,MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 , + +/* DISP0_POWER_EN */ +MX53_PAD_EIM_D24__GPIO3_24 , + +/* PWM */ + MX53_PAD_GPIO_1__PWM2_PWMO, };static inline void mx53_loco_fec_reset (void )
@@ -95,6 +103,13 @@ static struct fec_platform_data mx53_loco_fec_data = { .phy = PHY_INTERFACE_MODE_RMII, }; +static struct platform_pwm_backlight_data loco_pwm_backlight_data = { + .pwm_id =1 , + .max_brightness =255 , + .dft_brightness =128 , + .pwm_period_ns =50000 , +}; +static struct ipuv3_fb_platform_data loco_fb0_data = { .interface_pix_fmt =IPU_PIX_FMT_RGB565 , .flags =IMX_IPU_FB_USE_MODEDB |IMX_IPU_FB_USE_OVERLAY ,
@@ -114,6 +129,8 @@ static struct imx_ipuv3_platform_data ipu_data = {static void __init mx53_loco_board_init (void ) { +int ret; +mxc_iomux_v3_setup_multiple_pads (mx53_loco_pads,ARRAY_SIZE (mx53_loco_pads));imx53_add_imx_uart (0 ,NULL );
@@ -121,6 +138,18 @@ static void __init mx53_loco_board_init(void)imx53_add_fec (&mx53_loco_fec_data);imx_add_ipuv3 (&ipu_data); + +imx_add_mxc_pwm (&imx53_mxc_pwm_data[1 ]); +mxc_register_device (&mxc_pwm1_backlight_device, + &loco_pwm_backlight_data); + +/* enable disp0 power */ + ret =gpio_request (LOCO_DISP0_PWR ,"disp0-power-en" ); +if (ret) { +printk (KERN_ERR "failed to get GPIO_LOCO_DISP0_PWR: %d\n" , ret); +return ; + } +gpio_direction_output (LOCO_DISP0_PWR ,1 ); }static void __init mx53_loco_timer_init (void )
arch/arm/mach-mx5/clock-mx51-mx53.c +2 -0
@@ -1339,6 +1339,8 @@ static struct clk_lookup mx53_lookups[] = { _REGISTER_CLOCK("imx-ipuv3", "ipu", ipu_clk) _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk) _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk) + _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) + _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) };static void clk_tree_init (void )
arch/arm/mach-mx5/devices-imx53.h +2 -0
@@ -29,3 +29,5 @@ imx53_sdhci_esdhc_imx_data[] __initconst;extern const struct imx_spi_imx_data imx53_ecspi_data[]__initconst ;#define imx53_add_ecspi (id, pdata) \ imx_add_spi_imx(&imx53_ecspi_data[id], pdata) + +extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst ;
arch/arm/mach-mx5/devices.c +10 -0
@@ -120,6 +120,16 @@ struct platform_device mxc_usbh2_device = { }, }; +struct platform_device mxc_pwm1_backlight_device = { + .name ="pwm-backlight" , + .id =0 , +}; + +struct platform_device mxc_pwm2_backlight_device = { + .name ="pwm-backlight" , + .id =1 , +}; +static struct mxc_gpio_port mxc_gpio_ports[] = { { .chip.label ="gpio-0" ,
arch/arm/mach-mx5/devices.h +2 -0
@@ -3,3 +3,5 @@ extern struct platform_device mxc_usbh1_device;extern struct platform_device mxc_usbh2_device;extern struct platform_device mxc_usbdr_udc_device;extern struct platform_device mxc_hsi2c_device; +extern struct platform_device mxc_pwm1_backlight_device; +extern struct platform_device mxc_pwm2_backlight_device;
arch/arm/plat-mxc/devices/Kconfig +1 -0
@@ -58,6 +58,7 @@ config IMX_HAVE_PLATFORM_MXC_NAND config IMX_HAVE_PLATFORM_MXC_PWM bool + default y if HAVE_PWM config IMX_HAVE_PLATFORM_MXC_RNGA bool
arch/arm/plat-mxc/devices/platform-mxc_pwm.c +9 -0
@@ -49,6 +49,15 @@ const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { };#endif /* ifdef CONFIG_SOC_IMX51 */ +#ifdef CONFIG_SOC_IMX53 +const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst = { +#define imx53_mxc_pwm_data_entry(_id, _hwid) \ + imx_mxc_pwm_data_entry(MX53, _id, _hwid, SZ_16K) +imx53_mxc_pwm_data_entry (0 ,1 ), +imx53_mxc_pwm_data_entry (1 ,2 ), +}; +#endif /* ifdef CONFIG_SOC_IMX53 */ +struct platform_device *__init imx_add_mxc_pwm (const struct imx_mxc_pwm_data *data) {
arch/arm/plat-mxc/pwm.c +2 -1
@@ -57,7 +57,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)if (pwm ==NULL || period_ns ==0 || duty_ns > period_ns)return -EINVAL ; -if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 ()) { +if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 () || +cpu_is_mx53 ()) {unsigned long long c;unsigned long period_cycles, duty_cycles, prescale;u32 cr;
Signature · 1 line
1.7.1
Fabio Estevam
reviewerPATCH 1/3 IPUv3: Add i.MX53 IPU support
In reply to jason.chen at freescale.comHi Jason,
Quoted 12 lines · On Tue, Feb 15, 2011 at 6:56 AM, <[email protected]> wrote:
From: Jason Chen <[email protected]>
Signed-off-by Jason Chen <[email protected]>---
?arch/arm/mach-mx5/board-mx51_babbage.c ? ? ? ? ?| ? ?2 +- ?arch/arm/mach-mx5/devices-imx51.h ? ? ? ? ? ? ? | ? ?3 - ?arch/arm/plat-mxc/devices/platform-imx_ipuv3.c ?| ? 97 +++++++++++++++++++++-- ?arch/arm/plat-mxc/include/mach/devices-common.h | ? ?4 +- ?arch/arm/plat-mxc/include/mach/ipu-v3.h ? ? ? ? | ? ?1 + ?drivers/mfd/Kconfig ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?6 +- ?drivers/mfd/imx-ipu-v3/ipu-common.c ? ? ? ? ? ? | ? 66 +++------------ ?drivers/mfd/imx-ipu-v3/ipu-prv.h ? ? ? ? ? ? ? ?| ? 32 ++++----
Quoted 1 line
?8 files changed, 126 insertions(+), 85 deletions(-)
Which git tree did you use for these patches?
I can not see a git tree that contains both the MX51 IPU and MX53LOCO board support.
Regards,
Fabio Estevam
PATCH 1/3 IPUv3: Add i.MX53 IPU support
Hi, Fabio,
You need do some cherry-pick from Sascha's ipuv3 branch to for-next.
Jason Chen / Chen Jie
NMG / MAD
Freescale Semiconductor (China) Ltd.
2F, Building B, 177#, Bi Bo Rd
Pu Dong New District Shanghai?201203
Tel:???? 021-28937178?
Fax:???? 021-28937444
E-mail:??Jason.Chen at freescale.com
-----Original Message-----
From: Fabio Estevam [mailto:festevam at gmail.com]
Sent: Wednesday, February 16, 2011 12:12 AM
To: Chen Jie-B02280
Cc: s.hauer at pengutronix.de; linux-arm-kernel at lists.infradead.org; Chen Jie-B02280
Subject: Re: [PATCH 1/3] IPUv3: Add i.MX53 IPU support
Hi Jason,
Quoted 12 lines · On Tue, Feb 15, 2011 at 6:56 AM, <[email protected]> wrote:
From: Jason Chen <[email protected]>
Signed-off-by Jason Chen <[email protected]>---
?arch/arm/mach-mx5/board-mx51_babbage.c ? ? ? ? ?| ? ?2 +- ?arch/arm/mach-mx5/devices-imx51.h ? ? ? ? ? ? ? | ? ?3 - ?arch/arm/plat-mxc/devices/platform-imx_ipuv3.c ?| ? 97 +++++++++++++++++++++-- ?arch/arm/plat-mxc/include/mach/devices-common.h | ? ?4 +- ?arch/arm/plat-mxc/include/mach/ipu-v3.h ? ? ? ? | ? ?1 + ?drivers/mfd/Kconfig ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?6 +- ?drivers/mfd/imx-ipu-v3/ipu-common.c ? ? ? ? ? ? | ? 66
Quoted 3 lines
+++------------
?drivers/mfd/imx-ipu-v3/ipu-prv.h ? ? ? ? ? ? ? ?| ? 32 ++++---- ?8 files changed, 126 insertions(+), 85 deletions(-)
Which git tree did you use for these patches?
I can not see a git tree that contains both the MX51 IPU and MX53LOCO board support.
Regards,
Fabio Estevam