From 20f759082d918c0ae7550efe856c14060a1678cc Mon Sep 17 00:00:00 2001 From: Muhammad Date: Fri, 4 Apr 2025 16:43:32 +0300 Subject: [PATCH] board: Add support for Samsung Galaxy A33 Adds basic support for the Exynos 1280 SoC in the Galaxy A33 --- board/Kconfig | 13 +++++++++ board/samsung/board-a336b.c | 55 +++++++++++++++++++++++++++++++++++++ include/soc/exynos1280.h | 12 ++++++++ soc/Kconfig | 7 +++++ 4 files changed, 87 insertions(+) create mode 100644 board/samsung/board-a336b.c create mode 100644 include/soc/exynos1280.h diff --git a/board/Kconfig b/board/Kconfig index fbe6fcd..8592c43 100644 --- a/board/Kconfig +++ b/board/Kconfig @@ -20,6 +20,13 @@ menu "Device Support" help Say Y if you want to include support for Samsung Galaxy A12 Nacho + config SAMSUNG_A336B + bool "Support for Samsung Galaxy A33" + default n + depends on EXYNOS_1280 + help + Say Y if you want to include support for Samsung Galaxy A33 + config SAMSUNG_C1S bool "Support for Samsung Galaxy Note20" default n @@ -123,6 +130,7 @@ menu "Device Specific Addresses" default 0x830000000 if APPLE_N61AP default 0x090000000 if SAMSUNG_A105F default 0x090008000 if SAMSUNG_A127F + default 0x090000000 if SAMSUNG_A336B default 0x090000000 if SAMSUNG_C1S default 0x090000000 if SAMSUNG_G0S default 0x050000000 if SAMSUNG_NOBLELTE @@ -141,6 +149,7 @@ menu "Device Specific Addresses" hex "Ramdisk Entry Address" default 0x084000000 if SAMSUNG_A105F default 0x082000000 if SAMSUNG_A127F + default 0x084000000 if SAMSUNG_A336B default 0x082000000 if SAMSUNG_DREAMLTE default 0x084000000 if SAMSUNG_C1S default 0x084000000 if SAMSUNG_G0S @@ -155,6 +164,7 @@ menu "Device Specific Addresses" default 0x83e900000 if APPLE_N61AP default 0x0ec000000 if SAMSUNG_A105F default 0x0fa000000 if SAMSUNG_A127F + default 0x0fa200000 if SAMSUNG_A336B default 0x0f1000000 if SAMSUNG_C1S default 0x0f6200000 if SAMSUNG_G0S default 0x0e2a00000 if SAMSUNG_NOBLELTE @@ -175,6 +185,7 @@ menu "Device Specific Addresses" default 752 if APPLE_N61AP default 720 if SAMSUNG_A105F default 720 if SAMSUNG_A127F + default 1080 if SAMSUNG_A336B default 1080 if SAMSUNG_C1S default 1080 if SAMSUNG_G0S default 1440 if SAMSUNG_NOBLELTE @@ -195,6 +206,7 @@ menu "Device Specific Addresses" default 1334 if APPLE_N61AP default 1520 if SAMSUNG_A105F default 1600 if SAMSUNG_A127F + default 2400 if SAMSUNG_A336B default 2400 if SAMSUNG_C1S default 2340 if SAMSUNG_G0S default 2560 if SAMSUNG_NOBLELTE @@ -215,6 +227,7 @@ menu "Device Specific Addresses" default 4 if APPLE_N61AP default 4 if SAMSUNG_A105F default 4 if SAMSUNG_A127F + default 4 if SAMSUNG_A336B default 4 if SAMSUNG_C1S default 4 if SAMSUNG_G0S default 4 if SAMSUNG_NOBLELTE diff --git a/board/samsung/board-a336b.c b/board/samsung/board-a336b.c new file mode 100644 index 0000000..1e6087f --- /dev/null +++ b/board/samsung/board-a336b.c @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2025, Muhammad + */ +#include +#include +#include +#include + +void init_board_funcs(void *board) +{ + /* + * Parsing the struct directly without restructing is + * broken as of Sep 29 2024 + */ + struct { + const char *name; + int ops[BOARD_OP_EXIT]; + } *board_restruct = board; + + board_restruct->name = "A33x"; +} + +// Early initialization +int board_init(void) +{ + /* Allow framebuffer to be written to */ + *(int*) (DECON_F_BASE + HW_SW_TRIG_CONTROL) = 0x1281; + + return 0; +} + +// Late initialization +int board_late_init(void) +{ + return 0; +} + +int board_driver_setup(void) +{ + struct { + int width; + int height; + int stride; + void *address; + } simplefb_data = { + .width = 1080, + .height = 2400, + .stride = 4, + .address = (void *)0x0fa200000, + }; + + REGISTER_DRIVER("simplefb", simplefb_probe, &simplefb_data); + return 0; +} diff --git a/include/soc/exynos1280.h b/include/soc/exynos1280.h new file mode 100644 index 0000000..308af2b --- /dev/null +++ b/include/soc/exynos1280.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2025, Muhammad + */ + +#ifndef EXYNOS1280_H_ /* Include guard */ +#define EXYNOS1280_H_ + +#define DECON_F_BASE 0x14940000 +#define HW_SW_TRIG_CONTROL 0x30 + +#endif // EXYNOS1280_H_ diff --git a/soc/Kconfig b/soc/Kconfig index 827d0e0..aa93820 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -31,6 +31,13 @@ config QUALCOMM help Say Y if your device uses Apple T8010 SoC + config EXYNOS_1280 + bool "Support for Exynos 1280" + default n + select EXYNOS + help + Say Y if your device uses Samsung Exynos1280 SoC + config EXYNOS_2200 bool "Support for Exynos 2200" default n