linux/drivers/gpu/drm/pl111/pl111_versatile.c

// SPDX-License-Identifier: GPL-2.0-only

/*
 * Versatile family (ARM reference designs) handling for the PL11x.
 * This is based on code and know-how in the previous frame buffer
 * driver in drivers/video/fbdev/amba-clcd.c:
 * Copyright (C) 2001 ARM Limited, by David A Rusling
 * Updated to 2.5 by Deep Blue Solutions Ltd.
 * Major contributions and discoveries by Russell King.
 */

#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/vexpress.h>

#include <drm/drm_fourcc.h>

#include "pl111_versatile.h"
#include "pl111_drm.h"

static struct regmap *versatile_syscon_map;

/*
 * We detect the different syscon types from the compatible strings.
 */
enum versatile_clcd {};

static const struct of_device_id versatile_clcd_of_match[] =;

static const struct of_device_id impd1_clcd_of_match[] =;

/*
 * Core module CLCD control on the Integrator/CP, bits
 * 8 thru 19 of the CM_CONTROL register controls a bunch
 * of CLCD settings.
 */
#define INTEGRATOR_HDR_CTRL_OFFSET
#define INTEGRATOR_CLCD_LCDBIASEN
#define INTEGRATOR_CLCD_LCDBIASUP
#define INTEGRATOR_CLCD_LCDBIASDN
/* Bits 11,12,13 controls the LCD or VGA bridge type */
#define INTEGRATOR_CLCD_LCDMUX_LCD24
#define INTEGRATOR_CLCD_LCDMUX_SHARP
#define INTEGRATOR_CLCD_LCDMUX_VGA555
#define INTEGRATOR_CLCD_LCDMUX_VGA24
#define INTEGRATOR_CLCD_LCD0_EN
#define INTEGRATOR_CLCD_LCD1_EN
/* R/L flip on Sharp */
#define INTEGRATOR_CLCD_LCD_STATIC1
/* U/D flip on Sharp */
#define INTEGRATOR_CLCD_LCD_STATIC2
/* No connection on Sharp */
#define INTEGRATOR_CLCD_LCD_STATIC
/* 0 = 24bit VGA, 1 = 18bit VGA */
#define INTEGRATOR_CLCD_LCD_N24BITEN

#define INTEGRATOR_CLCD_MASK

static void pl111_integrator_enable(struct drm_device *drm, u32 format)
{}

#define IMPD1_CTRL_OFFSET
#define IMPD1_CTRL_DISP_LCD
#define IMPD1_CTRL_DISP_VGA
#define IMPD1_CTRL_DISP_LCD1
#define IMPD1_CTRL_DISP_ENABLE
#define IMPD1_CTRL_DISP_MASK

static void pl111_impd1_enable(struct drm_device *drm, u32 format)
{}

static void pl111_impd1_disable(struct drm_device *drm)
{}

/*
 * This configuration register in the Versatile and RealView
 * family is uniformly present but appears more and more
 * unutilized starting with the RealView series.
 */
#define SYS_CLCD
#define SYS_CLCD_MODE_MASK
#define SYS_CLCD_MODE_888
#define SYS_CLCD_MODE_5551
#define SYS_CLCD_MODE_565_R_LSB
#define SYS_CLCD_MODE_565_B_LSB
#define SYS_CLCD_CONNECTOR_MASK
#define SYS_CLCD_NLCDIOON
#define SYS_CLCD_VDDPOSSWITCH
#define SYS_CLCD_PWR3V5SWITCH
#define SYS_CLCD_VDDNEGSWITCH

static void pl111_versatile_disable(struct drm_device *drm)
{}

static void pl111_versatile_enable(struct drm_device *drm, u32 format)
{}

static void pl111_realview_clcd_disable(struct drm_device *drm)
{}

static void pl111_realview_clcd_enable(struct drm_device *drm, u32 format)
{}

/* PL110 pixel formats for Integrator, vanilla PL110 */
static const u32 pl110_integrator_pixel_formats[] =;

/* Extended PL110 pixel formats for Integrator and Versatile */
static const u32 pl110_versatile_pixel_formats[] =;

static const u32 pl111_realview_pixel_formats[] =;

/*
 * The Integrator variant is a PL110 with a bunch of broken, or not
 * yet implemented features
 */
static const struct pl111_variant_data pl110_integrator =;

/*
 * The IM-PD1 variant is a PL110 with a bunch of broken, or not
 * yet implemented features
 */
static const struct pl111_variant_data pl110_impd1 =;

/*
 * This is the in-between PL110 variant found in the ARM Versatile,
 * supporting RGB565/BGR565
 */
static const struct pl111_variant_data pl110_versatile =;

/*
 * RealView PL111 variant, the only real difference from the vanilla
 * PL111 is that we select 16bpp framebuffer by default to be able
 * to get 1024x768 without saturating the memory bus.
 */
static const struct pl111_variant_data pl111_realview =;

/*
 * Versatile Express PL111 variant, again we just push the maximum
 * BPP to 16 to be able to get 1024x768 without saturating the memory
 * bus. The clockdivider also seems broken on the Versatile Express.
 */
static const struct pl111_variant_data pl111_vexpress =;

#define VEXPRESS_FPGAMUX_MOTHERBOARD
#define VEXPRESS_FPGAMUX_DAUGHTERBOARD_1
#define VEXPRESS_FPGAMUX_DAUGHTERBOARD_2

static int pl111_vexpress_clcd_init(struct device *dev, struct device_node *np,
				    struct pl111_drm_dev_private *priv)
{}

int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
{}
EXPORT_SYMBOL_GPL();