diff --git a/board/Kconfig b/board/Kconfig index b03c001..7f6c231 100644 --- a/board/Kconfig +++ b/board/Kconfig @@ -28,6 +28,13 @@ menu "Device Support" help Say Y if you want to include support for CMF Phone 1 + config NOKIA_ESSENTIAL + bool "Support for Nokia 3" + default n + depends on MT6735 + help + Say Y if you want to include support for Nokia 3 + config NOTHING_TETRIS_DISABLE_WDT bool "Disable the watchdog timer on startup" default y diff --git a/board/Makefile b/board/Makefile index ec8f607..b967d3b 100644 --- a/board/Makefile +++ b/board/Makefile @@ -1,6 +1,7 @@ lib-$(CONFIG_APPLE_N61AP) += apple/board-n61ap.o lib-$(CONFIG_AMAZON_PW3) += amazon/board-pw3.o lib-$(CONFIG_GOOGLE_TAIMEN) += google/board-taimen.o +lib-$(CONFIG_NOKIA_ESSENTIAL) += nokia/board-essential.o lib-$(CONFIG_NOTHING_TETRIS) += nothing/board-tetris.o lib-$(CONFIG_QEMU_BOARD_VIRT) += qemu/board-virt.o lib-$(CONFIG_SAMSUNG_A105F) += samsung/board-a105f.o diff --git a/board/nokia/board-essential.c b/board/nokia/board-essential.c new file mode 100644 index 0000000..0bc11c4 --- /dev/null +++ b/board/nokia/board-essential.c @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2025, Alexandru Chimac + */ +#include +#include +#include +#include + +#define TOPRGU_BASE 0x10212000 +#define WDT_MODE_KEY 0x22000000 +#define WDT_MODE_EN (1 << 0) + +// Early initialization +int essential_init(void) +{ + unsigned long wdg_reg; + + // Disable watchdog + wdg_reg = readl((volatile unsigned int *) TOPRGU_BASE); + wdg_reg &= ~WDT_MODE_EN; + wdg_reg |= WDT_MODE_KEY; + writel(wdg_reg, (void *) TOPRGU_BASE); + + return 0; +} + +#ifdef CONFIG_SIMPLE_FB +static struct video_info essential_fb = { + .format = FB_FORMAT_ARGB8888, + .width = 736, + .height = 1280, + .stride = 4, + .address = (void *)0xbf370000 +}; +#endif + +int essential_drv(void) +{ +#ifdef CONFIG_SIMPLE_FB + REGISTER_DRIVER("simplefb", simplefb_probe, &essential_fb); +#endif + return 0; +} + +// Late initialization +int essential_late_init(void) +{ + return 0; +} + +struct board_data board_ops = { + .name = "nokia-essential", + .ops = { + .early_init = essential_init, + .drivers_init = essential_drv, + .late_init = essential_late_init, + }, + .quirks = 0 +}; diff --git a/configs/essential_defconfig b/configs/essential_defconfig new file mode 100644 index 0000000..2220d21 --- /dev/null +++ b/configs/essential_defconfig @@ -0,0 +1,5 @@ +CONFIG_MT6735=y +CONFIG_NOKIA_ESSENTIAL=y +CONFIG_TEXT_BASE=0x40080000 +CONFIG_PAYLOAD_ENTRY=0x50000000 +CONFIG_RAMDISK_ENTRY=0x44000000 diff --git a/soc/Kconfig b/soc/Kconfig index ce108fa..a7b28e1 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -123,6 +123,13 @@ config QUALCOMM help Say Y if your device uses Samsung Exynos990 SoC + config MT6735 + bool "Support for Mediatek MT6735" + default n + select MEDIATEK + help + Say Y if your device uses Mediatek MT6735 SoC + config MT6877 bool "Support for Mediatek MT6877" default n