board: Add support for Xiaomi Moon devices

Signed-off-by: Ryo "evilMyQueen" Yamada <evilMyQueen@mainlining.org>
This commit is contained in:
Ryo evilMyQueen Yamada authored and Ивайло Иванов committed 2026-07-25 11:25:11 +03:00
1 parent 8345d226c8
commit 5bb3813027
5 files changed
+62

No files matched your search

+8
View File
@@ -331,6 +331,14 @@ menu "Device Support"
help
Say Y if you want to include support for Poco M3 Pro 5G
config XIAOMI_MOON
bool "Support for Xiaomi Moon devices"
default n
depends on MT6768
help
Say Y if you want to include support for Xiaomi Moon devices:
Xiaomi Poco M6 4G, Xiaomi Redmi 13 4G.
config XIAOMI_NEZHA
bool "Support for Xiaomi 17 Ultra"
default n
+1
View File
@@ -43,4 +43,5 @@ lib-$(CONFIG_VOLLA_ALGIZ) += volla/board-algiz.o
lib-$(CONFIG_XIAOMI_BEGONIA) += xiaomi/board-begonia.o
lib-$(CONFIG_XIAOMI_BLOSSOM) += xiaomi/board-blossom.o
lib-$(CONFIG_XIAOMI_CAMELLIA) += xiaomi/board-camellia.o
lib-$(CONFIG_XIAOMI_MOON) += xiaomi/board-moon.o
lib-$(CONFIG_XIAOMI_NEZHA) += xiaomi/board-nezha.o
+40
View File
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2026 Ryo "evilMyQueen" Yamada <evilMyQueen@mainlining.org>
*/
#include <board.h>
#include <util.h>
#include <string.h>
#include <drivers/framework.h>
#include <lib/debug.h>
#define UART_BASE 0x11002000
#define UART_LSR_BASE 0x14
#define UART_LSR_DR 0x01 /* Data ready */
#define UART_LSR_THRE 0x20 /* TX holding register empty */
#ifdef CONFIG_EARLYCON
void uart_putc(char ch)
{
while (!(readl((void *)(UART_BASE + UART_LSR_BASE)) & UART_LSR_THRE))
;
writel(ch, (void *)UART_BASE);
}
void uart_puts(const char *s)
{
while (*s != '\0') {
uart_putc(*s);
s++;
}
}
#endif
struct board_data board_ops = {
.name = "xiaomi-moon",
.devices = NULL,
.num_devices = 0,
.quirks = 0
};
+7
View File
@@ -0,0 +1,7 @@
CONFIG_COMPRESS_GZIP=y
CONFIG_EARLYCON=y
CONFIG_MT6768=y
CONFIG_XIAOMI_MOON=y
CONFIG_TEXT_BASE=0x40080000
CONFIG_RAMDISK_ENTRY=0x47c80000
CONFIG_PAYLOAD_ENTRY=0x60000000
+6
View File
@@ -146,6 +146,12 @@ config SONY
select MEDIATEK
help
Say Y if your device uses Mediatek MT6765 SoC
config MT6768
bool "Support for Mediatek MT6768"
select MEDIATEK
help
Say Y if your device uses Mediatek MT6768 SoC
config MT6785
bool "Support for Mediatek MT6785"