tegra20: add Atrix 4G MB860 and Droid X2 MB870 support
Subsystems (5)
cover tegra20: 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).
This patchset brings full support for both devices along with DM drivers for special PMIC used in these devices, DSI panel, backlight and many more staff already supported by exising U-Boot code.
Svyatoslav Ryhel (6):
power: pmic: add the basic CPCAP PMIC support
power: regulator: add regulator support for CPCAP PMIC
input: add support for CPCAP power button
video: panel: add Motorola Atrix 4G and Droid X2 panel
video: backlight: add TI LM3532 led controller
board: motorola: add Atrix 4G MB860 and Droid X2 MB870 support
arch/arm/dts/Makefile | 2 + arch/arm/dts/tegra20-motorola-daytona.dts | 9 + arch/arm/dts/tegra20-motorola-mot.dtsi | 490 ++++++++++++++++++++++ arch/arm/dts/tegra20-motorola-olympus.dts | 9 + arch/arm/mach-tegra/tegra20/Kconfig | 5 + board/motorola/mot/Kconfig | 12 + board/motorola/mot/MAINTAINERS | 7 + board/motorola/mot/Makefile | 9 + board/motorola/mot/configs/daytona.config | 2 + board/motorola/mot/configs/olympus.config | 2 + board/motorola/mot/mot-spl.c | 58 +++ board/motorola/mot/mot.env | 15 + configs/mot_defconfig | 93 ++++ doc/board/index.rst | 1 + doc/board/motorola/index.rst | 9 + doc/board/motorola/mot.rst | 104 +++++ drivers/input/Kconfig | 6 + drivers/input/Makefile | 1 + drivers/input/cpcap_pwrbutton.c | 134 ++++++ drivers/power/pmic/Kconfig | 10 + drivers/power/pmic/Makefile | 1 + drivers/power/pmic/cpcap.c | 125 ++++++ drivers/power/regulator/Kconfig | 9 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/cpcap_regulator.c | 275 ++++++++++++ drivers/video/Kconfig | 19 + drivers/video/Makefile | 2 + drivers/video/lm3532_backlight.c | 380 +++++++++++++++++ drivers/video/mot-panel.c | 308 ++++++++++++++ include/configs/mot.h | 25 ++ include/power/cpcap.h | 373 ++++++++++++++++ 31 files changed, 2496 insertions(+) create mode 100644 arch/arm/dts/tegra20-motorola-daytona.dts create mode 100644 arch/arm/dts/tegra20-motorola-mot.dtsi create mode 100644 arch/arm/dts/tegra20-motorola-olympus.dts create mode 100644 board/motorola/mot/Kconfig create mode 100644 board/motorola/mot/MAINTAINERS create mode 100644 board/motorola/mot/Makefile create mode 100644 board/motorola/mot/configs/daytona.config create mode 100644 board/motorola/mot/configs/olympus.config create mode 100644 board/motorola/mot/mot-spl.c create mode 100644 board/motorola/mot/mot.env create mode 100644 configs/mot_defconfig create mode 100644 doc/board/motorola/index.rst create mode 100644 doc/board/motorola/mot.rst create mode 100644 drivers/input/cpcap_pwrbutton.c create mode 100644 drivers/power/pmic/cpcap.c create mode 100644 drivers/power/regulator/cpcap_regulator.c create mode 100644 drivers/video/lm3532_backlight.c create mode 100644 drivers/video/mot-panel.c create mode 100644 include/configs/mot.h create mode 100644 include/power/cpcap.h
Signature · 1 line
2.43.0
PATCH 1/6 power: pmic: add the basic CPCAP PMIC support
The CPCAP is a Motorola/ST-Ericsson creation, a multifunctional IC whose main purpose was power control. It was used in a wide variety of Motorola products, both Tegra and OMAP based. The most notable devices using this PMIC are the Motorola Droid 4, Atrix 4G, and Droid X2.
--- drivers/power/pmic/Kconfig | 10 ++ drivers/power/pmic/Makefile | 1 + drivers/power/pmic/cpcap.c | 90 ++++++++++++++ include/power/cpcap.h | 238 ++++++++++++++++++++++++++++++++++++ 4 files changed, 339 insertions(+) create mode 100644 drivers/power/pmic/cpcap.c create mode 100644 include/power/cpcap.h
drivers/power/pmic/Kconfig +10 -0
@@ -295,6 +295,16 @@ config DM_PMIC_SANDBOX Driver binding info: doc/device-tree-bindings/pmic/sandbox.txt +config DM_PMIC_CPCAP + bool "Enable Driver Model for Motorola CPCAP" + help + The CPCAP is a Motorola/ST-Ericsson creation, a multifunctional IC + whose main purpose is power control. It was used in a wide variety of + Motorola products, both Tegra and OMAP based. The most notable devices + using this PMIC are the Motorola Droid 4, Atrix 4G, and Droid X2. + Unlike most PMICs, this one is not I2C based; it uses the SPI bus. The + core driver provides both read and write access to the device registers. + config PMIC_S5M8767 bool "Enable Driver Model for the Samsung S5M8767 PMIC" ---help---
drivers/power/pmic/Makefile +1 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_PMIC_TPS65219) += tps65219.o obj-$(CONFIG_PMIC_TPS65941) += tps65941.o obj-$(CONFIG_PMIC_RAA215300) += raa215300.o obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o +obj-$(CONFIG_$(XPL_)DM_PMIC_CPCAP) += cpcap.o ifeq ($(CONFIG_$(XPL_)POWER_LEGACY),y) obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o
drivers/power/pmic/cpcap.c new file +90 -0
90 lines not on this page · raw message
include/power/cpcap.h new file +238 -0
238 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 2/6 power: regulator: add regulator support for CPCAP PMIC
In reply to Svyatoslav RyhelThe driver provides regulator set/get voltage and enable/disable functions for CPCAP PMIC.
--- drivers/power/pmic/cpcap.c | 35 +++ drivers/power/regulator/Kconfig | 9 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/cpcap_regulator.c | 275 ++++++++++++++++++++++ include/power/cpcap.h | 135 +++++++++++ 5 files changed, 455 insertions(+) create mode 100644 drivers/power/regulator/cpcap_regulator.c
drivers/power/pmic/cpcap.c +35 -0
@@ -12,6 +12,12 @@#include <linux/delay.h> #include <linux/err.h> +static const struct pmic_child_info pmic_children_info[] = { + { .prefix ="sw" , .driver =CPCAP_SW_DRIVER }, + { .prefix ="v" , .driver =CPCAP_LDO_DRIVER }, + { }, +}; +static int cpcap_write (struct udevice *dev,uint reg,const uint8_t *buff,int len) {u8 buf[4 ];
@@ -47,6 +53,34 @@ static int cpcap_read(struct udevice *dev, uint reg, uint8_t *buff, int len)return ret; } +static int cpcap_bind (struct udevice *dev) +{ +ofnode regulators_node; +int children; + +/* Regulator device node of PMIC */ + regulators_node =dev_read_subnode (dev,"regulator" ); +if (!ofnode_valid (regulators_node)) { +log_err ("%s regulator subnode not found!\n" , dev->name); +return -ENXIO ; + } + +/* Actual regulators container */ + regulators_node =ofnode_find_subnode (regulators_node,"regulators" ); +if (!ofnode_valid (regulators_node)) { +log_err ("%s regulators subnode not found!\n" , dev->name); +return -ENXIO ; + } + +debug ("%s: '%s' - found regulators subnode\n" , __func__, dev->name); + + children =pmic_bind_children (dev, regulators_node, pmic_children_info); +if (!children) +log_err ("%s - no child found\n" , dev->name); + +return dm_scan_fdt_dev (dev); +} +static int cpcap_probe (struct udevice *dev) {struct spi_slave *slave =dev_get_parent_priv (dev);
@@ -85,6 +119,7 @@ U_BOOT_DRIVER(pmic_cpcap) = { .name = "cpcap_pmic", .id = UCLASS_PMIC, .of_match = cpcap_ids, + .bind = cpcap_bind, .probe = cpcap_probe, .ops = &cpcap_ops, };
drivers/power/regulator/Kconfig +9 -0
@@ -486,3 +486,12 @@ config REGULATOR_RZG2L_USBPHY Enable this option to support controlling the VBUS supply in the USB PHY peripheral of the Renesas RZ/G2L SoC. This option is required in order to use the USB OTG port. + +config DM_REGULATOR_CPCAP + bool "Enable driver for CPCAP PMIC regulators" + depends on DM_REGULATOR && DM_PMIC_CPCAP + ---help--- + Enable implementation of driver-model regulator uclass features for + REGULATOR CPCAP. The driver supports both DC-to-DC Step-Down Switching + (SW) Regulators and Low-Dropout Linear (LDO) Regulators found in CPCAP + PMIC and implements get/set api for voltage and state.
drivers/power/regulator/Makefile +1 -0
@@ -43,3 +43,4 @@ obj-$(CONFIG_DM_REGULATOR_SCMI) += scmi_regulator.o obj-$(CONFIG_$(XPL_)DM_REGULATOR_ANATOP) += anatop_regulator.o obj-$(CONFIG_DM_REGULATOR_TPS65219) += tps65219_regulator.o obj-$(CONFIG_REGULATOR_RZG2L_USBPHY) += rzg2l-usbphy-regulator.o +obj-$(CONFIG_$(XPL_)DM_REGULATOR_CPCAP) += cpcap_regulator.o
drivers/power/regulator/cpcap_regulator.c new file +275 -0
275 lines not on this page · raw message
include/power/cpcap.h +135 -0
139 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 3/6 input: add support for CPCAP power button
In reply to Svyatoslav RyhelCPCAP has a dedicated interrupt for power button. Implement this to have more input control over the devices.
--- drivers/input/Kconfig | 6 ++ drivers/input/Makefile | 1 + drivers/input/cpcap_pwrbutton.c | 134 ++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 drivers/input/cpcap_pwrbutton.c
drivers/input/Kconfig +6 -0
@@ -55,6 +55,12 @@ config BUTTON_KEYBOARD dt node to define button-event mapping. For example, an arrows and enter may be implemented to navigate boot menu. +config CPCAP_POWER_BUTTON + bool "Enable power button of CPCAP PMIC support" + depends on DM_KEYBOARD && DM_PMIC_CPCAP + help + Enable support for a dedicated power button of the CPCAP PMIC. + config CROS_EC_KEYB bool "Enable Chrome OS EC keyboard support" depends on INPUT
drivers/input/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_$(PHASE_)CROS_EC_KEYB) += cros_ec_keyb.o obj-$(CONFIG_$(PHASE_)OF_CONTROL) += key_matrix.o obj-$(CONFIG_$(PHASE_)DM_KEYBOARD) += input.o keyboard-uclass.o obj-$(CONFIG_BUTTON_KEYBOARD) += button_kbd.o +obj-$(CONFIG_CPCAP_POWER_BUTTON) += cpcap_pwrbutton.o ifndef CONFIG_XPL_BUILD
drivers/input/cpcap_pwrbutton.c new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 4/6 video: panel: add Motorola Atrix 4G and Droid X2 panel
In reply to Svyatoslav RyhelAdd support for the LCD panel module used in Motorola Atrix 4G or Droid X2. Exact panel vendor and model are unknown. The panel has a 540x960 (qHD) resolution and uses 24 bit RGB per pixel.
--- drivers/video/Kconfig | 10 ++ drivers/video/Makefile | 1 + drivers/video/mot-panel.c | 308 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 319 insertions(+) create mode 100644 drivers/video/mot-panel.c
drivers/video/Kconfig +10 -0
@@ -529,6 +529,16 @@ config VIDEO_LCD_HIMAX_HX8394 Say Y here if you want to enable support for Himax HX8394 dsi 4dl panel. +config VIDEO_LCD_MOT + tristate "Atrix 4G and Droid X2 540x960 DSI video mode panel" + depends on PANEL && BACKLIGHT + select VIDEO_MIPI_DSI + help + Say Y here if you want to enable support for the LCD panel module for + Motorola Atrix 4G or Droid X2. Exact panel vendor and model are + unknown. The panel has a 540x960 resolution and uses 24 bit RGB per + pixel. + config VIDEO_LCD_ORISETECH_OTM8009A bool "OTM8009A DSI LCD panel support" select VIDEO_MIPI_DSI
drivers/video/Makefile +1 -0
@@ -59,6 +59,7 @@ obj-$(CONFIG_VIDEO_LCD_ENDEAVORU) += endeavoru-panel.o obj-$(CONFIG_VIDEO_LCD_HIMAX_HX8394) += himax-hx8394.o obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o obj-$(CONFIG_VIDEO_LCD_LG_LD070WX3) += lg-ld070wx3.o +obj-$(CONFIG_VIDEO_LCD_MOT) += mot-panel.o obj-$(CONFIG_VIDEO_LCD_ORISETECH_OTM8009A) += orisetech_otm8009a.o obj-$(CONFIG_VIDEO_LCD_RAYDIUM_RM68200) += raydium-rm68200.o obj-$(CONFIG_VIDEO_LCD_RENESAS_R61307) += renesas-r61307.o
drivers/video/mot-panel.c new file +308 -0
308 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/6 video: backlight: add TI LM3532 led controller
In reply to Svyatoslav RyhelThe LM3532 is a 500-kHz fixed frequency asynchronous boost converter which provides the power for 3 high-voltage, low-side current sinks. The device is programmable over an I2C-compatible interface and has independent current control for all three channels.
--- drivers/video/Kconfig | 9 + drivers/video/Makefile | 1 + drivers/video/lm3532_backlight.c | 380 +++++++++++++++++++++++++++++++ 3 files changed, 390 insertions(+) create mode 100644 drivers/video/lm3532_backlight.c
drivers/video/Kconfig +9 -0
@@ -738,6 +738,15 @@ config ATMEL_HLCD help HLCDC supports video output to an attached LCD panel. +config BACKLIGHT_LM3532 + bool "Backlight Driver for LM3532" + depends on BACKLIGHT + select DM_I2C + help + Say Y to enable the backlight driver for National Semiconductor / TI + LM3532 Lighting Power chip. Only backlight functions is supported as + for now. Supported backlight level range is from 1 to 255. + config BACKLIGHT_LM3533 bool "Backlight Driver for LM3533" depends on BACKLIGHT
drivers/video/Makefile +1 -0
@@ -29,6 +29,7 @@ obj-$(CONFIG_$(PHASE_)BMP) += bmp.o endif +obj-$(CONFIG_BACKLIGHT_LM3532) += lm3532_backlight.o obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_backlight.o obj-$(CONFIG_BACKLIGHT_LP855x) += lp855x_backlight.o obj-${CONFIG_EXYNOS_FB} += exynos/
drivers/video/lm3532_backlight.c new file +380 -0
380 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 6/6 board: motorola: add Atrix 4G MB860 and Droid X2 MB870 support
In reply to Svyatoslav RyhelThe 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).
--- arch/arm/dts/Makefile | 2 + arch/arm/dts/tegra20-motorola-daytona.dts | 9 + arch/arm/dts/tegra20-motorola-mot.dtsi | 490 ++++++++++++++++++++++ arch/arm/dts/tegra20-motorola-olympus.dts | 9 + arch/arm/mach-tegra/tegra20/Kconfig | 5 + board/motorola/mot/Kconfig | 12 + board/motorola/mot/MAINTAINERS | 7 + board/motorola/mot/Makefile | 9 + board/motorola/mot/configs/daytona.config | 2 + board/motorola/mot/configs/olympus.config | 2 + board/motorola/mot/mot-spl.c | 58 +++ board/motorola/mot/mot.env | 15 + configs/mot_defconfig | 93 ++++ doc/board/index.rst | 1 + doc/board/motorola/index.rst | 9 + doc/board/motorola/mot.rst | 104 +++++ include/configs/mot.h | 25 ++ 17 files changed, 852 insertions(+) create mode 100644 arch/arm/dts/tegra20-motorola-daytona.dts create mode 100644 arch/arm/dts/tegra20-motorola-mot.dtsi create mode 100644 arch/arm/dts/tegra20-motorola-olympus.dts create mode 100644 board/motorola/mot/Kconfig create mode 100644 board/motorola/mot/MAINTAINERS create mode 100644 board/motorola/mot/Makefile create mode 100644 board/motorola/mot/configs/daytona.config create mode 100644 board/motorola/mot/configs/olympus.config create mode 100644 board/motorola/mot/mot-spl.c create mode 100644 board/motorola/mot/mot.env create mode 100644 configs/mot_defconfig create mode 100644 doc/board/motorola/index.rst create mode 100644 doc/board/motorola/mot.rst create mode 100644 include/configs/mot.h
arch/arm/dts/Makefile +2 -0
@@ -87,6 +87,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += \ tegra20-asus-tf101g.dtb \ tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ + tegra20-motorola-daytona.dtb \ + tegra20-motorola-olympus.dtb \ tegra20-paz00.dtb \ tegra20-plutux.dtb \ tegra20-seaboard.dtb \
arch/arm/dts/tegra20-motorola-daytona.dts new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "tegra20-motorola-mot.dtsi" + +/ { + model = "Motorola Droid X2 (MB870)"; + compatible = "motorola,daytona", "nvidia,tegra20"; +};
arch/arm/dts/tegra20-motorola-mot.dtsi new file +490 -0
490 lines not on this page · raw message
arch/arm/dts/tegra20-motorola-olympus.dts new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "tegra20-motorola-mot.dtsi" + +/ { + model = "Motorola Atrix 4G (MB860)"; + compatible = "motorola,olympus", "nvidia,tegra20"; +};
arch/arm/mach-tegra/tegra20/Kconfig +5 -0
@@ -29,6 +29,10 @@ config TARGET_MEDCOM_WIDE bool "Avionic Design Medcom-Wide board" select BOARD_LATE_INIT +config TARGET_MOT + bool "Motorola Tegra20 board" + select BOARD_LATE_INIT + config TARGET_PAZ00 bool "Paz00 board" select BOARD_LATE_INIT
@@ -76,6 +80,7 @@ config SYS_SOC source "board/nvidia/harmony/Kconfig" source "board/avionic-design/medcom-wide/Kconfig" +source "board/motorola/mot/Kconfig" source "board/compal/paz00/Kconfig" source "board/acer/picasso/Kconfig" source "board/avionic-design/plutux/Kconfig"
board/motorola/mot/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_MOT + +config SYS_BOARD + default "mot" + +config SYS_VENDOR + default "motorola" + +config SYS_CONFIG_NAME + default "mot" + +endif
board/motorola/mot/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +MOT BOARD +M: Svyatoslav Ryhel <[email protected]> +S: Maintained +F: board/motorola/mot/ +F: configs/mot_defconfig +F: doc/board/motorola/mot.rst +F: include/configs/mot.h
board/motorola/mot/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2010-2012 +# NVIDIA Corporation <www.nvidia.com> +# +# (C) Copyright 2025 +# Svyatoslav Ryhel <[email protected]> + +obj-$(CONFIG_XPL_BUILD) += mot-spl.o
board/motorola/mot/configs/daytona.config new file +2 -0
@@ -0,0 +1,2 @@ +CONFIG_DEFAULT_DEVICE_TREE="tegra20-motorola-daytona" +CONFIG_SYS_PROMPT="Tegra20 (Daytona) # "
board/motorola/mot/configs/olympus.config new file +2 -0
@@ -0,0 +1,2 @@ +CONFIG_DEFAULT_DEVICE_TREE="tegra20-motorola-olympus" +CONFIG_SYS_PROMPT="Tegra20 (Olympus) # "
board/motorola/mot/mot-spl.c new file +58 -0
58 lines not on this page · raw message
board/motorola/mot/mot.env new file +15 -0
@@ -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
configs/mot_defconfig new file +93 -0
93 lines not on this page · raw message
doc/board/index.rst +1 -0
@@ -41,6 +41,7 @@ Board-specific doc mediatek/index microchip/index microsoft/index + motorola/index nxp/index openpiton/index ouya/index
doc/board/motorola/index.rst new file +9 -0
@@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Motorola +======== + +.. toctree:: + :maxdepth: 2 + + mot
doc/board/motorola/mot.rst new file +104 -0
104 lines not on this page · raw message
include/configs/mot.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2023 +* Svyatoslav Ryhel <[email protected]> +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <linux/sizes.h> +#include "tegra20-common.h" + +/* High-level configuration options */ +#define CFG_TEGRA_BOARD_STRING "Motorola Mot" + +/* Board-specific serial config */ +#define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTB_BASE + +/* Tegra common post configuration overwrites text env in the board */ +#define BOARD_EXTRA_ENV_SETTINGS \ + "stdin=serial,tegra-kbc,button-kbd,cpcap-pwrbutton\0" + +#include "tegra-common-post.h" + +#endif /* __CONFIG_H */
Signature · 1 line
2.43.0