sh_mobile_meram: MERAM platform data for LCDC

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>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Damian 2011-05-24 07:01:22 +00:00 committed by Paul Mundt
parent eae9b85b5f
commit 1c7fcbed1a
2 changed files with 114 additions and 0 deletions

View File

@ -249,6 +249,29 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
{ {
return !gpio_get_value(GPIO_PORT41); return !gpio_get_value(GPIO_PORT41);
} }
/* 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,
},
};
/* SH_MMCIF */ /* SH_MMCIF */
static struct resource sh_mmcif_resources[] = { static struct resource sh_mmcif_resources[] = {
@ -431,13 +454,29 @@ const static struct fb_videomode ap4evb_lcdc_modes[] = {
#endif #endif
}, },
}; };
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,
},
};
static struct sh_mobile_lcdc_info lcdc_info = { static struct sh_mobile_lcdc_info lcdc_info = {
.meram_dev = &meram_info,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
.bpp = 16, .bpp = 16,
.lcd_cfg = ap4evb_lcdc_modes, .lcd_cfg = ap4evb_lcdc_modes,
.num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
.meram_cfg = &lcd_meram_cfg,
} }
}; };
@ -708,15 +747,31 @@ static struct platform_device fsi_device = {
static struct platform_device fsi_ak4643_device = { static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643", .name = "sh_fsi2_a_ak4643",
}; };
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,
},
};
static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
.clock_source = LCDC_CLK_EXTERNAL, .clock_source = LCDC_CLK_EXTERNAL,
.meram_dev = &meram_info,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
.bpp = 16, .bpp = 16,
.interface_type = RGB24, .interface_type = RGB24,
.clock_divider = 1, .clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL, .flags = LCDC_FLAGS_DWPOL,
.meram_cfg = &hdmi_meram_cfg,
} }
}; };
@ -945,6 +1000,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
&csi2_device, &csi2_device,
&ceu_device, &ceu_device,
&ap4evb_camera, &ap4evb_camera,
&meram_device,
}; };
static void __init hdmi_init_pm_clock(void) static void __init hdmi_init_pm_clock(void)

View File

@ -279,6 +279,30 @@ static struct platform_device smc911x_device = {
}, },
}; };
/* 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,
},
};
/* LCDC */ /* LCDC */
static struct fb_videomode mackerel_lcdc_modes[] = { static struct fb_videomode mackerel_lcdc_modes[] = {
{ {
@ -307,7 +331,23 @@ static int mackerel_get_brightness(void *board_data)
return gpio_get_value(GPIO_PORT31); return gpio_get_value(GPIO_PORT31);
} }
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,
},
};
static struct sh_mobile_lcdc_info lcdc_info = { static struct sh_mobile_lcdc_info lcdc_info = {
.meram_dev = &mackerel_meram_info,
.clock_source = LCDC_CLK_BUS, .clock_source = LCDC_CLK_BUS,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
@ -327,6 +367,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
.name = "sh_mobile_lcdc_bl", .name = "sh_mobile_lcdc_bl",
.max_brightness = 1, .max_brightness = 1,
}, },
.meram_cfg = &lcd_meram_cfg,
} }
}; };
@ -353,8 +394,23 @@ static struct platform_device lcdc_device = {
}, },
}; };
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,
},
};
/* HDMI */ /* HDMI */
static struct sh_mobile_lcdc_info hdmi_lcdc_info = { static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.meram_dev = &mackerel_meram_info,
.clock_source = LCDC_CLK_EXTERNAL, .clock_source = LCDC_CLK_EXTERNAL,
.ch[0] = { .ch[0] = {
.chan = LCDC_CHAN_MAINLCD, .chan = LCDC_CHAN_MAINLCD,
@ -362,6 +418,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.interface_type = RGB24, .interface_type = RGB24,
.clock_divider = 1, .clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL, .flags = LCDC_FLAGS_DWPOL,
.meram_cfg = &hdmi_meram_cfg,
} }
}; };
@ -949,6 +1006,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
&mackerel_camera, &mackerel_camera,
&hdmi_lcdc_device, &hdmi_lcdc_device,
&hdmi_device, &hdmi_device,
&meram_device,
}; };
/* Keypad Initialization */ /* Keypad Initialization */