Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Staging board support for Armadillo 800 eva.
0004  * Enable not-yet-DT-capable devices here.
0005  *
0006  * Based on board-armadillo800eva.c
0007  *
0008  * Copyright (C) 2012 Renesas Solutions Corp.
0009  * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
0010  */
0011 
0012 #include <linux/dma-mapping.h>
0013 #include <linux/fb.h>
0014 #include <linux/kernel.h>
0015 #include <linux/platform_device.h>
0016 #include <linux/videodev2.h>
0017 
0018 #include <video/sh_mobile_lcdc.h>
0019 
0020 #include "board.h"
0021 
0022 static struct fb_videomode lcdc0_mode = {
0023     .name       = "AMPIER/AM-800480",
0024     .xres       = 800,
0025     .yres       = 480,
0026     .left_margin    = 88,
0027     .right_margin   = 40,
0028     .hsync_len  = 128,
0029     .upper_margin   = 20,
0030     .lower_margin   = 5,
0031     .vsync_len  = 5,
0032     .sync       = 0,
0033 };
0034 
0035 static struct sh_mobile_lcdc_info lcdc0_info = {
0036     .clock_source   = LCDC_CLK_BUS,
0037     .ch[0] = {
0038         .chan       = LCDC_CHAN_MAINLCD,
0039         .fourcc     = V4L2_PIX_FMT_RGB565,
0040         .interface_type = RGB24,
0041         .clock_divider  = 5,
0042         .flags      = 0,
0043         .lcd_modes  = &lcdc0_mode,
0044         .num_modes  = 1,
0045         .panel_cfg = {
0046             .width  = 111,
0047             .height = 68,
0048         },
0049     },
0050 };
0051 
0052 static struct resource lcdc0_resources[] = {
0053     DEFINE_RES_MEM_NAMED(0xfe940000, 0x4000, "LCD0"),
0054     DEFINE_RES_IRQ(177 + 32),
0055 };
0056 
0057 static struct platform_device lcdc0_device = {
0058     .name       = "sh_mobile_lcdc_fb",
0059     .num_resources  = ARRAY_SIZE(lcdc0_resources),
0060     .resource   = lcdc0_resources,
0061     .id     = 0,
0062     .dev    = {
0063         .platform_data  = &lcdc0_info,
0064         .coherent_dma_mask = DMA_BIT_MASK(32),
0065     },
0066 };
0067 
0068 static const struct board_staging_clk lcdc0_clocks[] __initconst = {
0069     { "lcdc0", NULL, "sh_mobile_lcdc_fb.0" },
0070 };
0071 
0072 static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
0073     {
0074         .pdev    = &lcdc0_device,
0075         .clocks  = lcdc0_clocks,
0076         .nclocks = ARRAY_SIZE(lcdc0_clocks),
0077         .domain  = "/system-controller@e6180000/pm-domains/c5/a4lc@1"
0078     },
0079 };
0080 
0081 static void __init armadillo800eva_init(void)
0082 {
0083     board_staging_gic_setup_xlate("arm,pl390", 32);
0084     board_staging_register_devices(armadillo800eva_devices,
0085                        ARRAY_SIZE(armadillo800eva_devices));
0086 }
0087 
0088 board_staging("renesas,armadillo800eva", armadillo800eva_init);