board: motorola: add Atrix 4G MB860 and Droid X2 MB870 support
The Motorola Atrix 4G (MB860) and Droid X2 (MB870) both featured a
dual-core NVIDIA Tegra 2 AP20H processor clocked at 1GHz, coupled with 1GB
of DDR2 RAM. Storage consisted of 16GB of internal flash memory, expandable
via microSD. The display was a 4.0-inch TFT LCD with a resolution of
960x540 pixels (qHD). The devices originally ran on Android up to 2.3
(Gingerbread).
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
diff --git a/board/motorola/mot/Kconfig b/board/motorola/mot/Kconfig
new file mode 100644
index 0000000..8b76165
--- /dev/null
+++ b/board/motorola/mot/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MOT
+
+config SYS_BOARD
+ default "mot"
+
+config SYS_VENDOR
+ default "motorola"
+
+config SYS_CONFIG_NAME
+ default "mot"
+
+endif
diff --git a/board/motorola/mot/MAINTAINERS b/board/motorola/mot/MAINTAINERS
new file mode 100644
index 0000000..2aff81a
--- /dev/null
+++ b/board/motorola/mot/MAINTAINERS
@@ -0,0 +1,7 @@
+MOT BOARD
+M: Svyatoslav Ryhel <clamor95@gmail.com>
+S: Maintained
+F: board/motorola/mot/
+F: configs/mot_defconfig
+F: doc/board/motorola/mot.rst
+F: include/configs/mot.h
diff --git a/board/motorola/mot/Makefile b/board/motorola/mot/Makefile
new file mode 100644
index 0000000..f1073c2
--- /dev/null
+++ b/board/motorola/mot/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2010-2012
+# NVIDIA Corporation <www.nvidia.com>
+#
+# (C) Copyright 2025
+# Svyatoslav Ryhel <clamor95@gmail.com>
+
+obj-$(CONFIG_XPL_BUILD) += mot-spl.o
diff --git a/board/motorola/mot/configs/daytona.config b/board/motorola/mot/configs/daytona.config
new file mode 100644
index 0000000..0b6131b
--- /dev/null
+++ b/board/motorola/mot/configs/daytona.config
@@ -0,0 +1,2 @@
+CONFIG_DEFAULT_DEVICE_TREE="tegra20-motorola-daytona"
+CONFIG_SYS_PROMPT="Tegra20 (Daytona) # "
diff --git a/board/motorola/mot/configs/olympus.config b/board/motorola/mot/configs/olympus.config
new file mode 100644
index 0000000..57aa601
--- /dev/null
+++ b/board/motorola/mot/configs/olympus.config
@@ -0,0 +1,2 @@
+CONFIG_DEFAULT_DEVICE_TREE="tegra20-motorola-olympus"
+CONFIG_SYS_PROMPT="Tegra20 (Olympus) # "
diff --git a/board/motorola/mot/mot-spl.c b/board/motorola/mot/mot-spl.c
new file mode 100644
index 0000000..a86e523
--- /dev/null
+++ b/board/motorola/mot/mot-spl.c
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * T20 Motorola Atrix 4G and Droid X2 SPL stage configuration
+ *
+ * (C) Copyright 2025
+ * Svyatoslav Ryhel <clamor95@gmail.com>
+ */
+
+#include <asm/gpio.h>
+#include <asm/arch/pinmux.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/pmc.h>
+#include <spl_gpio.h>
+#include <linux/delay.h>
+
+/*
+ * Unlike all other supported Tegra devices and most known Tegra devices, the
+ * both Atrix 4G and Droid X2 have no hardware way to enter APX/RCM mode, which
+ * may lead to a dangerous situation when, if BCT is set correctly and the
+ * bootloader is faulty, the device will hang in a permanent brick state.
+ * Exiting from this state can be done only by disassembling the device and
+ * shortening testpad to the ground.
+ *
+ * To prevent this or to minimize the probability of such an accident, it was
+ * proposed to add the RCM rebooting hook as early into SPL as possible since
+ * SPL is much more robust and has minimal changes that can break bootflow.
+ *
+ * gpio_early_init_uart() function was chosen as it is the earliest function
+ * exposed for setup by the device. Hook performs a check for volume up
+ * button state and triggers RCM if it is pressed.
+ */
+void gpio_early_init_uart(void)
+{
+ int value;
+
+ /* Configure pinmux for PR0 */
+ pinmux_set_func(PMUX_PINGRP_KBCA, PMUX_FUNC_KBC);
+ pinmux_set_pullupdown(PMUX_PINGRP_KBCA, PMUX_PULL_UP);
+ pinmux_tristate_disable(PMUX_PINGRP_KBCA);
+
+ /* Configure pinmux for PQ0 */
+ pinmux_set_func(PMUX_PINGRP_KBCC, PMUX_FUNC_KBC);
+ pinmux_set_pullupdown(PMUX_PINGRP_KBCC, PMUX_PULL_UP);
+ pinmux_tristate_disable(PMUX_PINGRP_KBCC);
+
+ /* Hog column 0 (PQ0) low - active */
+ spl_gpio_output(NULL, TEGRA_GPIO(Q, 0), 0);
+ udelay(500);
+
+ spl_gpio_input(NULL, TEGRA_GPIO(R, 0));
+ value = spl_gpio_get_value(NULL, TEGRA_GPIO(R, 0));
+
+ /* Enter RCM if button is pressed */
+ if (!value) {
+ tegra_pmc_writel(2, PMC_SCRATCH0);
+ tegra_pmc_writel(PMC_CNTRL_MAIN_RST, PMC_CNTRL);
+ }
+}
diff --git a/board/motorola/mot/mot.env b/board/motorola/mot/mot.env
new file mode 100644
index 0000000..f2bf298
--- /dev/null
+++ b/board/motorola/mot/mot.env
@@ -0,0 +1,15 @@
+#include <env/nvidia/prod_upd.env>
+
+button_cmd_0_name=Volume Down
+button_cmd_0=bootmenu
+partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}
+boot_dev=1
+
+bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu
+bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu
+bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu
+bootmenu_3=update bootloader=run flash_uboot
+bootmenu_4=reboot RCM=enterrcm
+bootmenu_5=reboot=reset
+bootmenu_6=power off=poweroff
+bootmenu_delay=-1