uniLoader/board/samsung/board-starlte.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

54 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2022, Markuss Broks <markuss.broks@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 0x16030000
#define HW_SW_TRIG_CONTROL 0x70
// Early initialization
int starlte_init(void)
{
/* Allow framebuffer to be written to */
*(int*) (DECON_F_BASE + HW_SW_TRIG_CONTROL) = 0x1281;
return 0;
}
// Late initialization
int starlte_late_init(void)
{
return 0;
}
#ifdef CONFIG_SIMPLE_FB
static struct video_info starlte_fb = {
.format = FB_FORMAT_ARGB8888,
.width = CONFIG_FRAMEBUFFER_WIDTH,
.height = CONFIG_FRAMEBUFFER_HEIGHT,
.stride = CONFIG_FRAMEBUFFER_STRIDE,
.address = (void *)CONFIG_FRAMEBUFFER_BASE
};
#endif
int starlte_drv(void)
{
#ifdef CONFIG_SIMPLE_FB
REGISTER_DRIVER("simplefb", simplefb_probe, &starlte_fb);
#endif
return 0;
}
struct board_data board_ops = {
.name = "samsung-starlte",
.ops = {
.early_init = starlte_init,
.drivers_init = starlte_drv,
.late_init = starlte_late_init,
},
.quirks = 0
};