mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-28 12:09:26 +08:00
bsps/arm: Use handlers for PL111 set up/tear down
This commit is contained in:
@@ -15,6 +15,26 @@
|
||||
#include <bsp/arm-pl111-fb.h>
|
||||
#include <bsp.h>
|
||||
|
||||
static void fb_set_up(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void fb_pins_set_up(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void fb_pins_tear_down(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void fb_tear_down(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static const pl111_fb_config fb_config = {
|
||||
.regs = (volatile pl111 *) 0x10020000,
|
||||
|
||||
@@ -30,20 +50,14 @@ static const pl111_fb_config fb_config = {
|
||||
.timing3 = 0x0,
|
||||
.control = PL111_LCD_CONTROL_LCD_TFT
|
||||
| PL111_LCD_CONTROL_LCD_BPP(PL111_LCD_CONTROL_LCD_BPP_16),
|
||||
.power_delay_in_us = 100000
|
||||
.power_delay_in_us = 100000,
|
||||
.set_up = fb_set_up,
|
||||
.pins_set_up = fb_pins_set_up,
|
||||
.pins_tear_down = fb_pins_tear_down,
|
||||
.tear_down = fb_tear_down
|
||||
};
|
||||
|
||||
const pl111_fb_config *arm_pl111_fb_get_config(void)
|
||||
{
|
||||
return &fb_config;
|
||||
}
|
||||
|
||||
void arm_pl111_fb_pins_set_up(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
void arm_pl111_fb_pins_tear_down(const pl111_fb_config *cfg)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
@@ -80,6 +80,8 @@ static rtems_status_code pl111_fb_initialize(pl111_fb_context *ctx)
|
||||
if (ctx->frame_buffer != NULL) {
|
||||
volatile pl111 *regs = cfg->regs;
|
||||
|
||||
(*cfg->set_up)(cfg);
|
||||
|
||||
regs->lcd.upbase = (uint32_t) ctx->frame_buffer;
|
||||
|
||||
regs->lcd.timing0 = cfg->timing0;
|
||||
@@ -88,7 +90,7 @@ static rtems_status_code pl111_fb_initialize(pl111_fb_context *ctx)
|
||||
regs->lcd.timing3 = cfg->timing3;
|
||||
regs->lcd.control = cfg->control;
|
||||
|
||||
arm_pl111_fb_pins_set_up(cfg);
|
||||
(*cfg->pins_set_up)(cfg);
|
||||
|
||||
regs->lcd.control = cfg->control
|
||||
| PL111_LCD_CONTROL_LCD_EN;
|
||||
@@ -119,7 +121,8 @@ static void pl111_fb_destroy(const pl111_fb_context *ctx)
|
||||
|
||||
regs->lcd.control = cfg->control;
|
||||
|
||||
arm_pl111_fb_pins_tear_down(cfg);
|
||||
(*cfg->pins_tear_down)(cfg);
|
||||
(*cfg->tear_down)(cfg);
|
||||
}
|
||||
|
||||
static void pl111_fb_get_fix_screen_info(struct fb_fix_screeninfo *info)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <bsp/arm-pl111-regs.h>
|
||||
|
||||
typedef struct {
|
||||
typedef struct pl111_fb_config {
|
||||
volatile pl111 *regs;
|
||||
uint32_t timing0;
|
||||
uint32_t timing1;
|
||||
@@ -33,12 +33,12 @@ typedef struct {
|
||||
uint32_t timing3;
|
||||
uint32_t control;
|
||||
uint32_t power_delay_in_us;
|
||||
void (*set_up)(const struct pl111_fb_config *cfg);
|
||||
void (*pins_set_up)(const struct pl111_fb_config *cfg);
|
||||
void (*pins_tear_down)(const struct pl111_fb_config *cfg);
|
||||
void (*tear_down)(const struct pl111_fb_config *cfg);
|
||||
} pl111_fb_config;
|
||||
|
||||
const pl111_fb_config *arm_pl111_fb_get_config(void);
|
||||
|
||||
void arm_pl111_fb_pins_set_up(const pl111_fb_config *cfg);
|
||||
|
||||
void arm_pl111_fb_pins_tear_down(const pl111_fb_config *cfg);
|
||||
|
||||
#endif /* LIBBSP_ARM_SHARED_ARM_PL111_FB_H */
|
||||
|
||||
Reference in New Issue
Block a user