ARM: S5P64X0: Add Framebuffer support
Subsystems (4)
v4 cover ARM: S5P64X0: Add Framebuffer support
The patches are created against "for-next" branch of Kukjin Kim's tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
Changes since V1:
- Remove mach/regs-fb.h, instead use plat/regs-fb.h.
- Add common pdata for FB and LCD in SMDK6440 and SMDK6450.
- Modify names(s5p-->smdk), max_bpp and refresh rate.
- Modify variable name(cfg-->chipid).
- Use __raw_readl, __raw_writel instead of readl and writel.
Changes since V2:
-Change name of the config-COMMON_FB to SMDK64X0_COMMON_FB. -Change filename common-fb.h to smdk64x0-common-fb.h. -Change filename common-fb.c to smdk64x0-common-fb.c.
Changes since V3:
-Add FB and LCD plat-data in corresponding machine files
instead of creating common file smdk64x0-common-fb.c.
-Modify name S5P64X0_SETUP_FB to S5P64X0_SETUP_FB_24BPP. -Modify file name setup-fb.c to setup-fb-24bpp.c. -Move SPCON settings to machine file.
-Use soc_is_s5p6440()/soc_is_s5p6450() to check CPU ID.
These patches have dependency on the patch
"ARM: S5P64X0: Fix mask value for S5P64X0 CPU IDs" at http://www.spinics.net/lists/arm-kernel/msg138990.html
o To Florian,
[PATCH RESEND V4 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata
o To Kukjin,
[PATCH RESEND V4 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer [PATCH RESEND V4 3/6] ARM: S5P64X0: Set s3c_device_fb name
[PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support [PATCH V4 6/6] ARM: S5P6450: Add LCD-LTE480 and enable Framebuffer support
arch/arm/mach-s5p64x0/Kconfig | 10 +++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/cpu.c | 3 + arch/arm/mach-s5p64x0/include/mach/irqs.h | 4 + arch/arm/mach-s5p64x0/include/mach/map.h | 3 + arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 + arch/arm/mach-s5p64x0/mach-smdk6440.c | 75 +++++++++++++++++++++++ arch/arm/mach-s5p64x0/mach-smdk6450.c | 76 ++++++++++++++++++++++++ arch/arm/mach-s5p64x0/setup-fb-24bpp.c | 29 +++++++++ arch/arm/plat-samsung/include/plat/fb.h | 7 ++ drivers/video/s3c-fb.c | 27 ++++++++ 11 files changed, 239 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-fb-24bpp.c
PATCH RESEND v4 1/6 video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata
This patch:
-- Adds s3c_fb_driverdata for S5P64X0, which supports 3 windows. -- Also, register "s5p64x0-fb" type driver_data.
--- drivers/video/s3c-fb.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
drivers/video/s3c-fb.c +27 -0
@@ -1859,6 +1859,30 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = { }, }; +static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = { + .variant = { + .nr_windows =3 , + .vidtcon =VIDTCON0 , + .wincon =WINCON (0 ), + .winmap =WINxMAP (0 ), + .keycon =WKEYCON , + .osd =VIDOSD_BASE , + .osd_stride =16 , + .buf_start =VIDW_BUF_START (0 ), + .buf_size =VIDW_BUF_SIZE (0 ), + .buf_end =VIDW_BUF_END (0 ), + + .palette = { + [0 ] =0x2400 , + [1 ] =0x2800 , + [2 ] =0x2c00 , + }, + }, + .win[0 ] = &s3c_fb_data_s5p_wins[0 ], + .win[1 ] = &s3c_fb_data_s5p_wins[1 ], + .win[2 ] = &s3c_fb_data_s5p_wins[2 ], +}; +static struct platform_device_id s3c_fb_driver_ids[] = { { .name ="s3c-fb" ,
@@ -1872,6 +1896,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = { }, { .name = "s3c2443-fb", .driver_data = (unsigned long)&s3c_fb_data_s3c2443, + }, { + .name = "s5p64x0-fb", + .driver_data = (unsigned long)&s3c_fb_data_s5p64x0, }, {}, };
Signature · 1 line
1.7.0.4
PATCH RESEND v4 2/6 ARM: S5P64X0: Add register base and IRQ for Framebuffer
In reply to Ajay KumarThis patch adds:
-- Framebuffer related register mappings and bit fields. -- IRQ number being used.
--- arch/arm/mach-s5p64x0/include/mach/irqs.h | 4 ++++ arch/arm/mach-s5p64x0/include/mach/map.h | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/include/mach/irqs.h +4 -0
@@ -87,6 +87,10 @@#define IRQ_I2S0 IRQ_I2SV40 +#define IRQ_LCD_FIFO IRQ_DISPCON0 +#define IRQ_LCD_VSYNC IRQ_DISPCON1 +#define IRQ_LCD_SYSTEM IRQ_DISPCON2 +/* S5P6450 EINT feature will be added */ /*
arch/arm/mach-s5p64x0/include/mach/map.h +3 -0
@@ -47,6 +47,8 @@#define S5P64X0_PA_HSMMC (x) (0xED800000 + ((x) * 0x100000)) +#define S5P64X0_PA_FB 0xEE000000 +#define S5P64X0_PA_I2S 0xF2000000#define S5P6450_PA_I2S1 0xF2800000#define S5P6450_PA_I2S2 0xF2900000
@@ -64,6 +66,7 @@#define S3C_PA_IIC1 S5P6440_PA_IIC1#define S3C_PA_RTC S5P64X0_PA_RTC#define S3C_PA_WDT S5P64X0_PA_WDT +#define S3C_PA_FB S5P64X0_PA_FB#define S5P_PA_CHIPID S5P64X0_PA_CHIPID#define S5P_PA_SROMC S5P64X0_PA_SROMC
Signature · 1 line
1.7.0.4
PATCH RESEND v4 3/6 ARM: S5P64X0: Set s3c_device_fb name
In reply to Ajay KumarSet s3c_device_fb name as "s5p64x0-fb" for S5P6440 and S5P6450.
--- arch/arm/mach-s5p64x0/cpu.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/cpu.c +3 -0
@@ -38,6 +38,7 @@#include <plat/s5p6440.h> #include <plat/s5p6450.h> #include <plat/adc-core.h> +#include <plat/fb-core.h> /* Initial IO mappings */
@@ -108,6 +109,7 @@ void __init s5p6440_map_io(void) {/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" ); +s3c_fb_setname ("s5p64x0-fb" );iotable_init (s5p64x0_iodesc,ARRAY_SIZE (s5p64x0_iodesc));iotable_init (s5p6440_iodesc,ARRAY_SIZE (s5p6440_iodesc));
@@ -117,6 +119,7 @@ void __init s5p6450_map_io(void) {/* initialize any device information early */ s3c_adc_setname ("s3c64xx-adc" ); +s3c_fb_setname ("s5p64x0-fb" );iotable_init (s5p64x0_iodesc,ARRAY_SIZE (s5p64x0_iodesc));iotable_init (s5p6450_iodesc,ARRAY_SIZE (s5p6450_iodesc));
Signature · 1 line
1.7.0.4
PATCH v4 4/6 ARM: S5P64X0: Add GPIO setup for LCD
In reply to Ajay KumarThis patch adds GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD.
--- arch/arm/mach-s5p64x0/Kconfig | 6 ++++++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/setup-fb-24bpp.c | 29 +++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/fb.h | 7 +++++++ 4 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-fb-24bpp.c
arch/arm/mach-s5p64x0/Kconfig +6 -0
@@ -21,6 +21,12 @@ config CPU_S5P6450 help Enable S5P6450 CPU support +config S5P64X0_SETUP_FB_24BPP + bool + help + Common setup code for S5P64X0 based boards with a LCD display + through RGB interface. + config S5P64X0_SETUP_I2C1 bool help
arch/arm/mach-s5p64x0/Makefile +1 -0
@@ -28,3 +28,4 @@ obj-y += dev-audio.o obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
arch/arm/mach-s5p64x0/setup-fb-24bpp.c new file +29 -0
@@ -0,0 +1,29 @@ +/* linux/arch/arm/mach-s5p64x0/setup-fb-24bpp.c +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* Base S5P64X0 GPIO setup information for LCD framebuffer +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/fb.h> +#include <linux/gpio.h> + +#include <plat/cpu.h> +#include <plat/fb.h> +#include <plat/gpio-cfg.h> + +void s5p64x0_fb_gpio_setup_24bpp (void ) +{ +if (soc_is_s5p6440 ()) { +s3c_gpio_cfgrange_nopull (S5P6440_GPI (0 ),16 ,S3C_GPIO_SFN (2 )); +s3c_gpio_cfgrange_nopull (S5P6440_GPJ (0 ),12 ,S3C_GPIO_SFN (2 )); + }else if (soc_is_s5p6450 ()) { +s3c_gpio_cfgrange_nopull (S5P6450_GPI (0 ),16 ,S3C_GPIO_SFN (2 )); +s3c_gpio_cfgrange_nopull (S5P6450_GPJ (0 ),12 ,S3C_GPIO_SFN (2 )); + } +}
arch/arm/plat-samsung/include/plat/fb.h +7 -0
@@ -109,4 +109,11 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);*/ extern void exynos4_fimd0_gpio_setup_24bpp (void ); +/** +* s5p64x0_fb_gpio_setup_24bpp() - S5P6440/S5P6450 setup function for 24bpp LCD +* +* Initialise the GPIO for an 24bpp LCD display on the RGB interface. +*/ +extern void s5p64x0_fb_gpio_setup_24bpp (void ); +#endif /* __PLAT_S3C_FB_H */
Signature · 1 line
1.7.0.4
PATCH v4 5/6 ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support
In reply to Ajay KumarThis patch:
-- Adds platform device support for LCD-LTE480. -- Adds platform data for FB with win_mode and default_bpp. -- Enables FB device support and platform-lcd support. -- Adds SPCON settings for LCD.
--- arch/arm/mach-s5p64x0/Kconfig | 2 + arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 + arch/arm/mach-s5p64x0/mach-smdk6440.c | 75 ++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/Kconfig +2 -0
@@ -37,6 +37,7 @@ config S5P64X0_SETUP_I2C1 config MACH_SMDK6440 bool "SMDK6440" select CPU_S5P6440 + select S3C_DEV_FB select S3C_DEV_I2C1 select S3C_DEV_RTC select S3C_DEV_WDT
@@ -45,6 +46,7 @@ config MACH_SMDK6440 select SAMSUNG_DEV_BACKLIGHT select SAMSUNG_DEV_PWM select SAMSUNG_DEV_TS + select S5P64X0_SETUP_FB_24BPP select S5P64X0_SETUP_I2C1 help Machine support for the Samsung SMDK6440
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +4 -0
@@ -34,6 +34,10 @@#define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180)#define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) +#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0) +#define S5P64X0_SPCON0_LCD_SEL_MASK (0x3 << 0) +#define S5P64X0_SPCON0_LCD_SEL_RGB (0x1 << 0) +/* External interrupt control registers for group0 */ #define EINT0CON0_OFFSET (0x900)
arch/arm/mach-s5p64x0/mach-smdk6440.c +75 -0
111 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v4 5/6 ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support
Quoted 15 lines · Ajay Kumar
This patch:
-- Adds platform device support for LCD-LTE480. -- Adds platform data for FB withwin_modeanddefault_bpp. -- Enables FB device support and platform-lcd support. -- Adds SPCON settings for LCD.Signed-off-by Ajay Kumar <[email protected]>--- arch/arm/mach-s5p64x0/Kconfig | 2 + arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 + arch/arm/mach-s5p64x0/mach-smdk6440.c | 75 ++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 0 deletions(-)
(snip)
Quoted 1 line
+#include <
plat/regs-fb.h>
Should be <plat/regs-fb-v4.h>?
(snip)
arch/arm/mach-s5p64x0/mach-smdk6440.c static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = { · line 111
Quoted 12 lines
arch/arm/mach-s5p64x0/mach-smdk6440.c +12
-0+/* Frame Buffer */ +static struct s3c_fb_pd_win smdk6440_fb_win0 = { + .win_mode = { + .left_margin =8 , + .right_margin =13 , + .upper_margin =7 , + .lower_margin =5 , + .hsync_len =3 , + .vsync_len =1 , + .xres =800 , + .yres =480 , + .refresh =60 ,
if its value is 60, we don't need .refresh here.
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v4 6/6 ARM: S5P6450: Add LCD-LTE480 and enable Framebuffer support
In reply to Ajay KumarThis patch:
-- Adds platform device support for LCD-LTE480. -- Adds platform data for FB with win_mode and default_bpp. -- Enables FB device support and platform-lcd support. -- Adds SPCON settings for LCD.
--- arch/arm/mach-s5p64x0/Kconfig | 2 + arch/arm/mach-s5p64x0/mach-smdk6450.c | 76 +++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/Kconfig +2 -0
@@ -54,6 +54,7 @@ config MACH_SMDK6440 config MACH_SMDK6450 bool "SMDK6450" select CPU_S5P6450 + select S3C_DEV_FB select S3C_DEV_I2C1 select S3C_DEV_RTC select S3C_DEV_WDT
@@ -62,6 +63,7 @@ config MACH_SMDK6450 select SAMSUNG_DEV_BACKLIGHT select SAMSUNG_DEV_PWM select SAMSUNG_DEV_TS + select S5P64X0_SETUP_FB_24BPP select S5P64X0_SETUP_I2C1 help Machine support for the Samsung SMDK6450
arch/arm/mach-s5p64x0/mach-smdk6450.c +76 -0
112 lines not on this page · raw message
Signature · 1 line
1.7.0.4