diff options
author | Julien Masson <jmasson@baylibre.com> | 2023-12-04 11:48:55 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-19 10:09:06 -0500 |
commit | ee33f6539d3d17f9ffea57f785e8d4a936f9bac3 (patch) | |
tree | b389f38886e2da59d30bd508dc88d5830b5406d3 /arch/arm/mach-mediatek/mt8365/init.c | |
parent | 80cdb6df224a16506d766c625c7e14b0d83d9d5e (diff) |
arm: mediatek: add support for MediaTek MT8365 SoC
This patch adds basic support for MediaTek MT8365 SoC.
The dtsi has been copied from Linux source code tag v6.7-rc2.
(commit 9b5d64654ea8f51fe1e8e29ca1777b620be8fb7c)
Signed-off-by: Julien Masson <jmasson@baylibre.com>
Diffstat (limited to 'arch/arm/mach-mediatek/mt8365/init.c')
-rw-r--r-- | arch/arm/mach-mediatek/mt8365/init.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-mediatek/mt8365/init.c b/arch/arm/mach-mediatek/mt8365/init.c new file mode 100644 index 0000000000..8f03ed2876 --- /dev/null +++ b/arch/arm/mach-mediatek/mt8365/init.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 MediaTek Inc. + * Copyright (C) 2023 BayLibre, SAS + * Author: Julien Masson <jmasson@baylibre.com> + * Author: Fabien Parent <fparent@baylibre.com> + */ + +#include <asm/global_data.h> +#include <asm/system.h> +#include <dm/uclass.h> +#include <wdt.h> + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = gd->ram_base; + gd->bd->bi_dram[0].size = gd->ram_size; + + return 0; +} + +int mtk_soc_early_init(void) +{ + return 0; +} + +void reset_cpu(void) +{ + struct udevice *wdt; + + if (IS_ENABLED(CONFIG_PSCI_RESET)) { + psci_system_reset(); + } else { + uclass_first_device(UCLASS_WDT, &wdt); + if (wdt) + wdt_expire_now(wdt, 0); + } +} + +int print_cpuinfo(void) +{ + printf("CPU: MediaTek MT8365\n"); + return 0; +} |