* [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC
@ 2011-05-18 11:10 Damian Hobson-Garcia
2011-05-19 0:42 ` Magnus Damm
2011-05-19 1:18 ` Damian Hobson-Garcia
0 siblings, 2 replies; 3+ messages in thread
From: Damian Hobson-Garcia @ 2011-05-18 11:10 UTC (permalink / raw)
To: linux-sh
Based on the patch by Takanari Hayama <taki@igel.co.jp>
Add the necessary platform data to add MERAM functionality to LCDC
Includes platform data for both the AP4EVB and mackerel
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
Changed from V1
==* Changed .id from -1 to 0 in platform data
* Added mackerel platform data
arch/arm/mach-shmobile/board-ap4evb.c | 73 ++++++++++++++++++++++++++++++
arch/arm/mach-shmobile/board-mackerel.c | 74 +++++++++++++++++++++++++++++++
2 files changed, 147 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 1e35fa9..d7bbca9 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -249,6 +249,31 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
{
return !gpio_get_value(GPIO_PORT41);
}
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+/* MERAM */
+static struct sh_mobile_meram_info meram_info = {
+ .addr_mode = SH_MOBILE_MERAM_MODE1,
+};
+
+static struct resource meram_resources[] = {
+ [0] = {
+ .name = "MERAM",
+ .start = 0xe8000000,
+ .end = 0xe81fffff,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device meram_device = {
+ .name = "sh_mobile_meram",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(meram_resources),
+ .resource = meram_resources,
+ .dev = {
+ .platform_data = &meram_info,
+ },
+};
+#endif
/* SH_MMCIF */
static struct resource sh_mmcif_resources[] = {
@@ -431,13 +456,35 @@ const static struct fb_videomode ap4evb_lcdc_modes[] = {
#endif
},
};
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+static struct sh_mobile_meram_cfg lcd_meram_cfg = {
+ .icb[0] = {
+ .marker_icb = 28,
+ .cache_icb = 24,
+ .meram_offset = 0x0,
+ .meram_size = 0x40,
+ },
+ .icb[1] = {
+ .marker_icb = 29,
+ .cache_icb = 25,
+ .meram_offset = 0x40,
+ .meram_size = 0x40,
+ },
+};
+#endif
static struct sh_mobile_lcdc_info lcdc_info = {
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_dev = &meram_info,
+#endif
.ch[0] = {
.chan = LCDC_CHAN_MAINLCD,
.bpp = 16,
.lcd_cfg = ap4evb_lcdc_modes,
.num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_cfg = &lcd_meram_cfg,
+#endif
}
};
@@ -708,15 +755,38 @@ static struct platform_device fsi_device = {
static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643",
};
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
+ .icb[0] = {
+ .marker_icb = 30,
+ .cache_icb = 26,
+ .meram_offset = 0x80,
+ .meram_size = 0x100,
+ },
+ .icb[1] = {
+ .marker_icb = 31,
+ .cache_icb = 27,
+ .meram_offset = 0x180,
+ .meram_size = 0x100,
+ },
+};
+#endif
static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
.clock_source = LCDC_CLK_EXTERNAL,
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_dev = &meram_info,
+#endif
.ch[0] = {
.chan = LCDC_CHAN_MAINLCD,
.bpp = 16,
.interface_type = RGB24,
.clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL,
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_cfg = &hdmi_meram_cfg,
+#endif
+
}
};
@@ -945,6 +1015,9 @@ static struct platform_device *ap4evb_devices[] __initdata = {
&csi2_device,
&ceu_device,
&ap4evb_camera,
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ &meram_device,
+#endif
};
static void __init hdmi_init_pm_clock(void)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 7da2ca2..1117ca5 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -279,6 +279,32 @@ static struct platform_device smc911x_device = {
},
};
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+/* MERAM */
+static struct sh_mobile_meram_info mackerel_meram_info = {
+ .addr_mode = SH_MOBILE_MERAM_MODE1,
+};
+
+static struct resource meram_resources[] = {
+ [0] = {
+ .name = "MERAM",
+ .start = 0xe8000000,
+ .end = 0xe81fffff,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device meram_device = {
+ .name = "sh_mobile_meram",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(meram_resources),
+ .resource = meram_resources,
+ .dev = {
+ .platform_data = &mackerel_meram_info,
+ },
+};
+#endif
+
/* LCDC */
static struct fb_videomode mackerel_lcdc_modes[] = {
{
@@ -307,7 +333,27 @@ static int mackerel_get_brightness(void *board_data)
return gpio_get_value(GPIO_PORT31);
}
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+static struct sh_mobile_meram_cfg lcd_meram_cfg = {
+ .icb[0] = {
+ .marker_icb = 28,
+ .cache_icb = 24,
+ .meram_offset = 0x0,
+ .meram_size = 0x40,
+ },
+ .icb[1] = {
+ .marker_icb = 29,
+ .cache_icb = 25,
+ .meram_offset = 0x40,
+ .meram_size = 0x40,
+ },
+};
+#endif
+
static struct sh_mobile_lcdc_info lcdc_info = {
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_dev = &mackerel_meram_info,
+#endif
.clock_source = LCDC_CLK_BUS,
.ch[0] = {
.chan = LCDC_CHAN_MAINLCD,
@@ -327,6 +373,9 @@ static struct sh_mobile_lcdc_info lcdc_info = {
.name = "sh_mobile_lcdc_bl",
.max_brightness = 1,
},
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_cfg = &lcd_meram_cfg,
+#endif
}
};
@@ -353,8 +402,27 @@ static struct platform_device lcdc_device = {
},
};
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
+ .icb[0] = {
+ .marker_icb = 30,
+ .cache_icb = 26,
+ .meram_offset = 0x80,
+ .meram_size = 0x100,
+ },
+ .icb[1] = {
+ .marker_icb = 31,
+ .cache_icb = 27,
+ .meram_offset = 0x180,
+ .meram_size = 0x100,
+ },
+};
+#endif
/* HDMI */
static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_dev = &mackerel_meram_info,
+#endif
.clock_source = LCDC_CLK_EXTERNAL,
.ch[0] = {
.chan = LCDC_CHAN_MAINLCD,
@@ -362,6 +430,9 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.interface_type = RGB24,
.clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL,
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ .meram_cfg = &hdmi_meram_cfg,
+#endif
}
};
@@ -949,6 +1020,9 @@ static struct platform_device *mackerel_devices[] __initdata = {
&mackerel_camera,
&hdmi_lcdc_device,
&hdmi_device,
+#ifdef CONFIG_FB_SH_MOBILE_MERAM
+ &meram_device,
+#endif
};
/* Keypad Initialization */
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC
2011-05-18 11:10 [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC Damian Hobson-Garcia
@ 2011-05-19 0:42 ` Magnus Damm
2011-05-19 1:18 ` Damian Hobson-Garcia
1 sibling, 0 replies; 3+ messages in thread
From: Magnus Damm @ 2011-05-19 0:42 UTC (permalink / raw)
To: linux-sh
Hi Damian,
On Wed, May 18, 2011 at 8:10 PM, Damian Hobson-Garcia
<dhobsong@igel.co.jp> wrote:
> Based on the patch by Takanari Hayama <taki@igel.co.jp>
>
> Add the necessary platform data to add MERAM functionality to LCDC
>
> Includes platform data for both the AP4EVB and mackerel
>
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> ---
> Changed from V1
> ==> * Changed .id from -1 to 0 in platform data
> * Added mackerel platform data
Thanks for your work on this!
> arch/arm/mach-shmobile/board-ap4evb.c | 73 ++++++++++++++++++++++++++++++
> arch/arm/mach-shmobile/board-mackerel.c | 74 +++++++++++++++++++++++++++++++
> 2 files changed, 147 insertions(+), 0 deletions(-)
>
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
> +#endif
Uhm, hate to interfer with your #ifdef party, but... =)
Could you please update the code to always define the platform data
regardless of if CONFIG_FB_SH_MOBILE_MERAM is selected or not. That's
the way we do it for almost all platform devices today.
The exception is for some SDHI/MMC devices that can be driven from one
out of multiple drivers. In such case we configure the pinmux /
platform data depending on which drivers that are available.
Thanks,
/ magnus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC
2011-05-18 11:10 [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC Damian Hobson-Garcia
2011-05-19 0:42 ` Magnus Damm
@ 2011-05-19 1:18 ` Damian Hobson-Garcia
1 sibling, 0 replies; 3+ messages in thread
From: Damian Hobson-Garcia @ 2011-05-19 1:18 UTC (permalink / raw)
To: linux-sh
On 2011/05/19 9:42, Magnus Damm wrote:
> Hi Damian,
>
> On Wed, May 18, 2011 at 8:10 PM, Damian Hobson-Garcia
> <dhobsong@igel.co.jp> wrote:
>> Based on the patch by Takanari Hayama <taki@igel.co.jp>
>>
>> Add the necessary platform data to add MERAM functionality to LCDC
>>
>> Includes platform data for both the AP4EVB and mackerel
>>
>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>> ---
>> Changed from V1
>> ==>> * Changed .id from -1 to 0 in platform data
>> * Added mackerel platform data
>
> Thanks for your work on this!
>
>> arch/arm/mach-shmobile/board-ap4evb.c | 73 ++++++++++++++++++++++++++++++
>> arch/arm/mach-shmobile/board-mackerel.c | 74 +++++++++++++++++++++++++++++++
>> 2 files changed, 147 insertions(+), 0 deletions(-)
>>
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>> +#ifdef CONFIG_FB_SH_MOBILE_MERAM
>> +#endif
>
> Uhm, hate to interfer with your #ifdef party, but... =)
>
> Could you please update the code to always define the platform data
> regardless of if CONFIG_FB_SH_MOBILE_MERAM is selected or not. That's
> the way we do it for almost all platform devices today.
Ok that's not a problem. I can rework that.
>
> The exception is for some SDHI/MMC devices that can be driven from one
> out of multiple drivers. In such case we configure the pinmux /
> platform data depending on which drivers that are available.
>
> Thanks,
>
> / magnus
--
Damian Hobson-Garcia
IGEL Co.,Ltd
http://www.igel.co.jp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-19 1:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18 11:10 [PATCH 4/6 v2] sh_mobile_meram: MERAM platform data for LCDC Damian Hobson-Garcia
2011-05-19 0:42 ` Magnus Damm
2011-05-19 1:18 ` Damian Hobson-Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).