Skip to content
Merged
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
7 changes: 7 additions & 0 deletions board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,13 @@ menu "Device Support"
Redmi 9A, Redmi 9I, Redmi 9AT, Redmi 10A, Redmi 9A Sport, Redmi 9I Sport,
Poco C3, Poco C31, Redmi 9C, Redmi 9C NFC, Redmi 9 India, Redmi 9 Active.

config XIAOMI_MERLINX
bool "Support for Redmi Note 9"
default n
depends on MT6768
help
Say Y if you want to include support for Redmi Note 9

config XIAOMI_CAMELLIA
bool "Support for Xiaomi Poco M3 Pro 5G"
default n
Expand Down
1 change: 1 addition & 0 deletions board/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ 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_GINKGO) += xiaomi/board-ginkgo.o
lib-$(CONFIG_XIAOMI_MERLINX) += xiaomi/board-merlinx.o
lib-$(CONFIG_XIAOMI_MOON) += xiaomi/board-moon.o
lib-$(CONFIG_XIAOMI_NEZHA) += xiaomi/board-nezha.o
lib-$(CONFIG_XIAOMI_SHENNONG) += xiaomi/board-shennong.o
Expand Down
63 changes: 63 additions & 0 deletions board/xiaomi/board-merlinx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2026 Ryo "evilMyQueen" Yamada <evilMyQueen@mainlining.org>
* Copyright (c) 2026 knukima <knukima@proton.me>
*/

/*
* This is a uniLoader board for xiaomi-merlinx (Redmi Note 9)
* Tested on engineering fw (Android 10) and on V13.0.2.0.SJOMIXM (Android 12)
*
* Based on the xiaomi-blossom board
*/

#include <board.h>
#include <util.h>
#include <string.h>
#include <drivers/framework.h>
#include <lib/simplefb.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)
Comment thread
BotchedRPR marked this conversation as resolved.
Resolved
{
while (!(readl((void *)(UART_BASE + UART_LSR_BASE)) & UART_LSR_THRE))
;

writel((unsigned int)(unsigned char)ch, (void *)UART_BASE);
}

void uart_puts(const char *s)
{
while (*s != '\0') {
if (*s == '\n')
uart_putc('\r');
uart_putc(*s);
s++;
}
}
#endif

static struct video_info merlinx_fb = {
.format = FB_FORMAT_ARGB8888,
.width = 1088, // the screen width is 1080px. Use 1088 for lines so they align to 4352 bytes
.height = 2340,
.stride = 4,
.address = (void *)0x7dcb0000
};

static const struct device merlinx_devices[] = {
{ "simplefb", &merlinx_fb, "fb" },
};

struct board_data board_ops = {
.name = "xiaomi-merlinx",
.devices = merlinx_devices,
.num_devices = ARRAY_SIZE(merlinx_devices),
.quirks = 0
};
8 changes: 8 additions & 0 deletions configs/merlinx_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_COMPRESS_GZIP=n
CONFIG_EARLYCON=y
CONFIG_SIMPLE_FB=y
CONFIG_MT6768=y
CONFIG_XIAOMI_MERLINX=y
CONFIG_TEXT_BASE=0x40080000
CONFIG_RAMDISK_ENTRY=0x51100000
CONFIG_PAYLOAD_ENTRY=0x60000000
Loading