drm/pl111: Enable PL110 variant

We detect and enable the use of the PL110 variant, an earlier
incarnation of PL111. The only real difference is that the
control and interrupt enable registers have swapped place.
The Versatile AB and Versatile PB have a variant inbetween
PL110 and PL111, it is PL110 but they have already swapped the
two registers so those two need a bit of special handling.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-4-linus.walleij@linaro.org
This commit is contained in:
Linus Walleij
2017-09-08 14:47:06 +02:00
parent 001485d525
commit fa83306cd1
3 changed files with 108 additions and 25 deletions

View File

@@ -31,6 +31,20 @@
struct drm_minor;
/**
* struct pl111_variant_data - encodes IP differences
* @name: the name of this variant
* @is_pl110: this is the early PL110 variant
* @formats: array of supported pixel formats on this variant
* @nformats: the length of the array of supported pixel formats
*/
struct pl111_variant_data {
const char *name;
bool is_pl110;
const u32 *formats;
unsigned int nformats;
};
struct pl111_drm_dev_private {
struct drm_device *drm;
@@ -41,6 +55,8 @@ struct pl111_drm_dev_private {
struct drm_fbdev_cma *fbdev;
void *regs;
u32 ienb;
u32 ctrl;
/* The pixel clock (a reference to our clock divider off of CLCDCLK). */
struct clk *clk;
/* pl111's internal clock divider. */
@@ -49,6 +65,7 @@ struct pl111_drm_dev_private {
* subsystem and pl111_display_enable().
*/
spinlock_t tim2_lock;
const struct pl111_variant_data *variant;
};
int pl111_display_init(struct drm_device *dev);