uniLoader/board/samsung/board-c1s.c
Ivaylo Ivanov 579bbfa393 lib: break ABI by reworking simplefb and then fix it
Jokes aside, commit adds support for colored indexes based on the
loglevel, introduces a better simplefb probing that does not depend
on hardcoded config options. Implementing support for fdt should be
easier now.
2025-07-11 13:45:58 +03:00

52 lines
1.0 KiB
C
Executable File

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) BotchedRPR <thenxguy0@gmail.com>
* Copyright (c) 2024, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
*/
#include <board.h>
#include <drivers/framework.h>
#include <lib/simplefb.h>
#define DECON_F_BASE 0x19050000
#define HW_SW_TRIG_CONTROL 0x70
int c1s_init(void)
{
/* Allow framebuffer to be written to */
*(int*) (DECON_F_BASE + HW_SW_TRIG_CONTROL) = 0x1281;
return 0;
}
int c1s_late_init(void)
{
return 0;
}
#ifdef CONFIG_SIMPLE_FB
static struct video_info c1s_fb = {
.format = FB_FORMAT_ARGB8888,
.width = CONFIG_FRAMEBUFFER_WIDTH,
.height = CONFIG_FRAMEBUFFER_HEIGHT,
.stride = CONFIG_FRAMEBUFFER_STRIDE,
.address = (void *)CONFIG_FRAMEBUFFER_BASE
};
#endif
int c1s_drv(void)
{
#ifdef CONFIG_SIMPLE_FB
REGISTER_DRIVER("simplefb", simplefb_probe, &c1s_fb);
#endif
return 0;
}
struct board_data board_ops = {
.name = "samsung-c1s",
.ops = {
.early_init = c1s_init,
.drivers_init = c1s_drv,
.late_init = c1s_late_init,
},
.quirks = 0
};