aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-mackerel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 448ddbe43335..776f20560e72 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -39,6 +39,7 @@
39#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
40#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
41#include <linux/mtd/physmap.h> 41#include <linux/mtd/physmap.h>
42#include <linux/pm_runtime.h>
42#include <linux/smsc911x.h> 43#include <linux/smsc911x.h>
43#include <linux/sh_intc.h> 44#include <linux/sh_intc.h>
44#include <linux/tca6416_keypad.h> 45#include <linux/tca6416_keypad.h>
@@ -314,6 +315,30 @@ static struct platform_device smc911x_device = {
314 }, 315 },
315}; 316};
316 317
318/* MERAM */
319static struct sh_mobile_meram_info mackerel_meram_info = {
320 .addr_mode = SH_MOBILE_MERAM_MODE1,
321};
322
323static struct resource meram_resources[] = {
324 [0] = {
325 .name = "MERAM",
326 .start = 0xe8000000,
327 .end = 0xe81fffff,
328 .flags = IORESOURCE_MEM,
329 },
330};
331
332static struct platform_device meram_device = {
333 .name = "sh_mobile_meram",
334 .id = 0,
335 .num_resources = ARRAY_SIZE(meram_resources),
336 .resource = meram_resources,
337 .dev = {
338 .platform_data = &mackerel_meram_info,
339 },
340};
341
317/* LCDC */ 342/* LCDC */
318static struct fb_videomode mackerel_lcdc_modes[] = { 343static struct fb_videomode mackerel_lcdc_modes[] = {
319 { 344 {
@@ -342,7 +367,23 @@ static int mackerel_get_brightness(void *board_data)
342 return gpio_get_value(GPIO_PORT31); 367 return gpio_get_value(GPIO_PORT31);
343} 368}
344 369
370static struct sh_mobile_meram_cfg lcd_meram_cfg = {
371 .icb[0] = {
372 .marker_icb = 28,
373 .cache_icb = 24,
374 .meram_offset = 0x0,
375 .meram_size = 0x40,
376 },
377 .icb[1] = {
378 .marker_icb = 29,
379 .cache_icb = 25,
380 .meram_offset = 0x40,
381 .meram_size = 0x40,
382 },
383};
384
345static struct sh_mobile_lcdc_info lcdc_info = { 385static struct sh_mobile_lcdc_info lcdc_info = {
386 .meram_dev = &mackerel_meram_info,
346 .clock_source = LCDC_CLK_BUS, 387 .clock_source = LCDC_CLK_BUS,
347 .ch[0] = { 388 .ch[0] = {
348 .chan = LCDC_CHAN_MAINLCD, 389 .chan = LCDC_CHAN_MAINLCD,
@@ -362,6 +403,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
362 .name = "sh_mobile_lcdc_bl", 403 .name = "sh_mobile_lcdc_bl",
363 .max_brightness = 1, 404 .max_brightness = 1,
364 }, 405 },
406 .meram_cfg = &lcd_meram_cfg,
365 } 407 }
366}; 408};
367 409
@@ -388,8 +430,23 @@ static struct platform_device lcdc_device = {
388 }, 430 },
389}; 431};
390 432
433static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
434 .icb[0] = {
435 .marker_icb = 30,
436 .cache_icb = 26,
437 .meram_offset = 0x80,
438 .meram_size = 0x100,
439 },
440 .icb[1] = {
441 .marker_icb = 31,
442 .cache_icb = 27,
443 .meram_offset = 0x180,
444 .meram_size = 0x100,
445 },
446};
391/* HDMI */ 447/* HDMI */
392static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 448static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
449 .meram_dev = &mackerel_meram_info,
393 .clock_source = LCDC_CLK_EXTERNAL, 450 .clock_source = LCDC_CLK_EXTERNAL,
394 .ch[0] = { 451 .ch[0] = {
395 .chan = LCDC_CHAN_MAINLCD, 452 .chan = LCDC_CHAN_MAINLCD,
@@ -397,6 +454,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
397 .interface_type = RGB24, 454 .interface_type = RGB24,
398 .clock_divider = 1, 455 .clock_divider = 1,
399 .flags = LCDC_FLAGS_DWPOL, 456 .flags = LCDC_FLAGS_DWPOL,
457 .meram_cfg = &hdmi_meram_cfg,
400 } 458 }
401}; 459};
402 460
@@ -856,6 +914,17 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
856} 914}
857 915
858/* SDHI0 */ 916/* SDHI0 */
917static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg)
918{
919 struct device *dev = arg;
920 struct sh_mobile_sdhi_info *info = dev->platform_data;
921 struct tmio_mmc_data *pdata = info->pdata;
922
923 tmio_mmc_cd_wakeup(pdata);
924
925 return IRQ_HANDLED;
926}
927
859static struct sh_mobile_sdhi_info sdhi0_info = { 928static struct sh_mobile_sdhi_info sdhi0_info = {
860 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 929 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
861 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 930 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
@@ -1150,6 +1219,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
1150 &mackerel_camera, 1219 &mackerel_camera,
1151 &hdmi_lcdc_device, 1220 &hdmi_lcdc_device,
1152 &hdmi_device, 1221 &hdmi_device,
1222 &meram_device,
1153}; 1223};
1154 1224
1155/* Keypad Initialization */ 1225/* Keypad Initialization */
@@ -1238,6 +1308,7 @@ static void __init mackerel_init(void)
1238{ 1308{
1239 u32 srcr4; 1309 u32 srcr4;
1240 struct clk *clk; 1310 struct clk *clk;
1311 int ret;
1241 1312
1242 sh7372_pinmux_init(); 1313 sh7372_pinmux_init();
1243 1314
@@ -1343,6 +1414,13 @@ static void __init mackerel_init(void)
1343 gpio_request(GPIO_FN_SDHID0_1, NULL); 1414 gpio_request(GPIO_FN_SDHID0_1, NULL);
1344 gpio_request(GPIO_FN_SDHID0_0, NULL); 1415 gpio_request(GPIO_FN_SDHID0_0, NULL);
1345 1416
1417 ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd,
1418 IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev);
1419 if (!ret)
1420 sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
1421 else
1422 pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret);
1423
1346#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1424#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1347 /* enable SDHI1 */ 1425 /* enable SDHI1 */
1348 gpio_request(GPIO_FN_SDHICMD1, NULL); 1426 gpio_request(GPIO_FN_SDHICMD1, NULL);