armadillo800eva.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Staging board support for Armadillo 800 eva.
  3. * Enable not-yet-DT-capable devices here.
  4. *
  5. * Based on board-armadillo800eva.c
  6. *
  7. * Copyright (C) 2012 Renesas Solutions Corp.
  8. * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; version 2 of the License.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. */
  19. #include <linux/dma-mapping.h>
  20. #include <linux/fb.h>
  21. #include <linux/kernel.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/videodev2.h>
  24. #include <video/sh_mobile_lcdc.h>
  25. #include "board.h"
  26. static struct fb_videomode lcdc0_mode = {
  27. .name = "AMPIER/AM-800480",
  28. .xres = 800,
  29. .yres = 480,
  30. .left_margin = 88,
  31. .right_margin = 40,
  32. .hsync_len = 128,
  33. .upper_margin = 20,
  34. .lower_margin = 5,
  35. .vsync_len = 5,
  36. .sync = 0,
  37. };
  38. static struct sh_mobile_lcdc_info lcdc0_info = {
  39. .clock_source = LCDC_CLK_BUS,
  40. .ch[0] = {
  41. .chan = LCDC_CHAN_MAINLCD,
  42. .fourcc = V4L2_PIX_FMT_RGB565,
  43. .interface_type = RGB24,
  44. .clock_divider = 5,
  45. .flags = 0,
  46. .lcd_modes = &lcdc0_mode,
  47. .num_modes = 1,
  48. .panel_cfg = {
  49. .width = 111,
  50. .height = 68,
  51. },
  52. },
  53. };
  54. static struct resource lcdc0_resources[] = {
  55. [0] = {
  56. .name = "LCD0",
  57. .start = 0xfe940000,
  58. .end = 0xfe943fff,
  59. .flags = IORESOURCE_MEM,
  60. },
  61. [1] = {
  62. .start = 177 + 32,
  63. .flags = IORESOURCE_IRQ,
  64. },
  65. };
  66. static struct platform_device lcdc0_device = {
  67. .name = "sh_mobile_lcdc_fb",
  68. .num_resources = ARRAY_SIZE(lcdc0_resources),
  69. .resource = lcdc0_resources,
  70. .id = 0,
  71. .dev = {
  72. .platform_data = &lcdc0_info,
  73. .coherent_dma_mask = DMA_BIT_MASK(32),
  74. },
  75. };
  76. static const struct board_staging_clk lcdc0_clocks[] __initconst = {
  77. { "lcdc0", NULL, "sh_mobile_lcdc_fb.0" },
  78. };
  79. static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
  80. {
  81. .pdev = &lcdc0_device,
  82. .clocks = lcdc0_clocks,
  83. .nclocks = ARRAY_SIZE(lcdc0_clocks),
  84. .domain = "/system-controller@e6180000/pm-domains/c5/a4lc@1"
  85. },
  86. };
  87. static void __init armadillo800eva_init(void)
  88. {
  89. board_staging_gic_setup_xlate("arm,cortex-a9-gic", 32);
  90. board_staging_register_devices(armadillo800eva_devices,
  91. ARRAY_SIZE(armadillo800eva_devices));
  92. }
  93. board_staging("renesas,armadillo800eva", armadillo800eva_init);