Repository navigation
board: Add support for Redmi Note 9 (merlinx) #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| { | ||
| 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 | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.