Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions board/lenovo/board-p1ma40.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
* Copyright (c) 2026, Kaloyan Donev <donevkaloyan@gmail.com>
*/

#include <main/main.h>
#include <board.h>
#include <util.h>
#include <drivers/framework.h>
#include <lib/simplefb.h>

#define TOPRGU_BASE 0x10212000

extern void mt6735_start_secondary_cpus(void *fdt);

int p1ma40_late_init(void)
{
void *dt = board_dtb;
mt6735_start_secondary_cpus(dt);

return 0;
}

static struct video_info p1ma40_fb = {
.format = FB_FORMAT_ABGR8888,
.width = 736,
Expand All @@ -24,8 +35,11 @@ static const struct device p1ma40_devices[] = {
};

struct board_data board_ops = {
.name = "lenovo-p1ma40",
.devices = p1ma40_devices,
.num_devices = ARRAY_SIZE(p1ma40_devices),
.quirks = 0
.name = "lenovo-p1ma40",
.ops = {
.late_init = p1ma40_late_init,
},
.devices = p1ma40_devices,
.num_devices = ARRAY_SIZE(p1ma40_devices),
.quirks = 0
};
2 changes: 2 additions & 0 deletions include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <stddef.h>
#include <drivers/framework.h>

extern void *board_dtb;

struct board_ops {
int (*early_init)(void);
int (*late_init)(void);
Expand Down
2 changes: 2 additions & 0 deletions include/main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright (c) 2022, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
*/

extern void *board_dtb;

#ifndef MAIN_H_ /* Include guard */
#define MAIN_H_

Expand Down
2 changes: 2 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <lib/debug.h>

extern struct board_data board_ops;
void *board_dtb;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: there has to be a better way to do this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean boards being able to access the dtb from early and late init is a good thing. What do you suggest as a better way, some function that returns the dtb or something else?


static void print_splash(void)
{
Expand All @@ -27,6 +28,7 @@ static void print_splash(void)

void main(void* dt, void* kernel, void* ramdisk)
{
board_dtb = dt;
early_console_init();
INITCALL(board_ops.ops.early_init);

Expand Down
1 change: 1 addition & 0 deletions soc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ lib-$(CONFIG_EXYNOS_9610) += exynos/exynos9610.o
lib-$(CONFIG_EXYNOS_9810) += exynos/exynos9810.o
lib-$(CONFIG_EXYNOS_990) += exynos/exynos990.o
lib-$(CONFIG_QC32_8916) += qualcomm/msm8916.o
lib-$(CONFIG_MT6735) += mediatek/mt6735-smp-fix.o
Loading
Loading