From 2c3c1048746a4622d8c89a29670120dc8fab93c4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:49:45 +0200 Subject: Adding upstream version 6.1.76. Signed-off-by: Daniel Baumann --- arch/arm/mach-mmp/Kconfig | 181 +++++++++++++++++ arch/arm/mach-mmp/Makefile | 33 ++++ arch/arm/mach-mmp/addr-map.h | 48 +++++ arch/arm/mach-mmp/aspenite.c | 284 +++++++++++++++++++++++++++ arch/arm/mach-mmp/avengers_lite.c | 55 ++++++ arch/arm/mach-mmp/brownstone.c | 237 +++++++++++++++++++++++ arch/arm/mach-mmp/common.c | 65 +++++++ arch/arm/mach-mmp/common.h | 9 + arch/arm/mach-mmp/devices.c | 359 ++++++++++++++++++++++++++++++++++ arch/arm/mach-mmp/devices.h | 57 ++++++ arch/arm/mach-mmp/flint.c | 131 +++++++++++++ arch/arm/mach-mmp/gplugd.c | 206 ++++++++++++++++++++ arch/arm/mach-mmp/irqs.h | 240 +++++++++++++++++++++++ arch/arm/mach-mmp/jasper.c | 185 ++++++++++++++++++ arch/arm/mach-mmp/mfp-mmp2.h | 396 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mmp/mfp-pxa168.h | 355 ++++++++++++++++++++++++++++++++++ arch/arm/mach-mmp/mfp-pxa910.h | 170 ++++++++++++++++ arch/arm/mach-mmp/mfp.h | 35 ++++ arch/arm/mach-mmp/mmp-dt.c | 48 +++++ arch/arm/mach-mmp/mmp2-dt.c | 38 ++++ arch/arm/mach-mmp/mmp2.c | 175 +++++++++++++++++ arch/arm/mach-mmp/mmp2.h | 104 ++++++++++ arch/arm/mach-mmp/mmp3.c | 29 +++ arch/arm/mach-mmp/platsmp.c | 32 +++ arch/arm/mach-mmp/pm-mmp2.c | 248 ++++++++++++++++++++++++ arch/arm/mach-mmp/pm-mmp2.h | 59 ++++++ arch/arm/mach-mmp/pm-pxa910.c | 272 ++++++++++++++++++++++++++ arch/arm/mach-mmp/pm-pxa910.h | 75 ++++++++ arch/arm/mach-mmp/pxa168.c | 175 +++++++++++++++++ arch/arm/mach-mmp/pxa168.h | 139 +++++++++++++ arch/arm/mach-mmp/pxa910.c | 190 ++++++++++++++++++ arch/arm/mach-mmp/pxa910.h | 90 +++++++++ arch/arm/mach-mmp/regs-apbc.h | 19 ++ arch/arm/mach-mmp/regs-apmu.h | 28 +++ arch/arm/mach-mmp/regs-icu.h | 69 +++++++ arch/arm/mach-mmp/regs-timers.h | 39 ++++ arch/arm/mach-mmp/regs-usb.h | 155 +++++++++++++++ arch/arm/mach-mmp/sram.c | 167 ++++++++++++++++ arch/arm/mach-mmp/teton_bga.c | 100 ++++++++++ arch/arm/mach-mmp/teton_bga.h | 22 +++ arch/arm/mach-mmp/time.c | 226 ++++++++++++++++++++++ arch/arm/mach-mmp/ttc_dkb.c | 315 ++++++++++++++++++++++++++++++ 42 files changed, 5860 insertions(+) create mode 100644 arch/arm/mach-mmp/Kconfig create mode 100644 arch/arm/mach-mmp/Makefile create mode 100644 arch/arm/mach-mmp/addr-map.h create mode 100644 arch/arm/mach-mmp/aspenite.c create mode 100644 arch/arm/mach-mmp/avengers_lite.c create mode 100644 arch/arm/mach-mmp/brownstone.c create mode 100644 arch/arm/mach-mmp/common.c create mode 100644 arch/arm/mach-mmp/common.h create mode 100644 arch/arm/mach-mmp/devices.c create mode 100644 arch/arm/mach-mmp/devices.h create mode 100644 arch/arm/mach-mmp/flint.c create mode 100644 arch/arm/mach-mmp/gplugd.c create mode 100644 arch/arm/mach-mmp/irqs.h create mode 100644 arch/arm/mach-mmp/jasper.c create mode 100644 arch/arm/mach-mmp/mfp-mmp2.h create mode 100644 arch/arm/mach-mmp/mfp-pxa168.h create mode 100644 arch/arm/mach-mmp/mfp-pxa910.h create mode 100644 arch/arm/mach-mmp/mfp.h create mode 100644 arch/arm/mach-mmp/mmp-dt.c create mode 100644 arch/arm/mach-mmp/mmp2-dt.c create mode 100644 arch/arm/mach-mmp/mmp2.c create mode 100644 arch/arm/mach-mmp/mmp2.h create mode 100644 arch/arm/mach-mmp/mmp3.c create mode 100644 arch/arm/mach-mmp/platsmp.c create mode 100644 arch/arm/mach-mmp/pm-mmp2.c create mode 100644 arch/arm/mach-mmp/pm-mmp2.h create mode 100644 arch/arm/mach-mmp/pm-pxa910.c create mode 100644 arch/arm/mach-mmp/pm-pxa910.h create mode 100644 arch/arm/mach-mmp/pxa168.c create mode 100644 arch/arm/mach-mmp/pxa168.h create mode 100644 arch/arm/mach-mmp/pxa910.c create mode 100644 arch/arm/mach-mmp/pxa910.h create mode 100644 arch/arm/mach-mmp/regs-apbc.h create mode 100644 arch/arm/mach-mmp/regs-apmu.h create mode 100644 arch/arm/mach-mmp/regs-icu.h create mode 100644 arch/arm/mach-mmp/regs-timers.h create mode 100644 arch/arm/mach-mmp/regs-usb.h create mode 100644 arch/arm/mach-mmp/sram.c create mode 100644 arch/arm/mach-mmp/teton_bga.c create mode 100644 arch/arm/mach-mmp/teton_bga.h create mode 100644 arch/arm/mach-mmp/time.c create mode 100644 arch/arm/mach-mmp/ttc_dkb.c (limited to 'arch/arm/mach-mmp') diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig new file mode 100644 index 000000000..d71417d57 --- /dev/null +++ b/arch/arm/mach-mmp/Kconfig @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig ARCH_MMP + bool "Marvell PXA168/910/MMP2/MMP3" + depends on (CPU_LITTLE_ENDIAN && ARCH_MULTI_V5) || ARCH_MULTI_V7 + select GPIO_PXA + select GPIOLIB + select PINCTRL + select PLAT_PXA + help + Support for Marvell's PXA168/PXA910(MMP), MMP2, and MMP3 processor lines. + +if ARCH_MMP + +menu "Marvell PXA168/910/MMP2 Implementations" + +if ATAGS + +config MACH_ASPENITE + bool "Marvell's PXA168 Aspenite Development Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA168 + help + Say 'Y' here if you want to support the Marvell PXA168-based + Aspenite Development Board. + +config MACH_ZYLONITE2 + bool "Marvell's PXA168 Zylonite2 Development Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA168 + help + Say 'Y' here if you want to support the Marvell PXA168-based + Zylonite2 Development Board. + +config MACH_AVENGERS_LITE + bool "Marvell's PXA168 Avengers Lite Development Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA168 + help + Say 'Y' here if you want to support the Marvell PXA168-based + Avengers Lite Development Board. + +config MACH_TTC_DKB + bool "Marvell's PXA910 TavorEVB/TTC_DKB Development Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA910 + help + Say 'Y' here if you want to support the Marvell PXA910-based + TTC_DKB Development Board. + +config MACH_BROWNSTONE + bool "Marvell's Brownstone Development Platform" + depends on ARCH_MULTI_V7 + depends on UNUSED_BOARD_FILES + select CPU_MMP2 + help + Say 'Y' here if you want to support the Marvell MMP2-based + Brown Development Platform. + MMP2-based board can't be co-existed with PXA168-based & + PXA910-based development board. Since MMP2 is compatible to + ARMv7 architecture. + +config MACH_FLINT + bool "Marvell's Flint Development Platform" + depends on ARCH_MULTI_V7 + depends on UNUSED_BOARD_FILES + select CPU_MMP2 + help + Say 'Y' here if you want to support the Marvell MMP2-based + Flint Development Platform. + MMP2-based board can't be co-existed with PXA168-based & + PXA910-based development board. Since MMP2 is compatible to + ARMv7 architecture. + +config MACH_MARVELL_JASPER + bool "Marvell's Jasper Development Platform" + depends on ARCH_MULTI_V7 + depends on UNUSED_BOARD_FILES + select CPU_MMP2 + help + Say 'Y' here if you want to support the Marvell MMP2-base + Jasper Development Platform. + MMP2-based board can't be co-existed with PXA168-based & + PXA910-based development board. Since MMP2 is compatible to + ARMv7 architecture. + +config MACH_TETON_BGA + bool "Marvell's PXA168 Teton BGA Development Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA168 + help + Say 'Y' here if you want to support the Marvell PXA168-based + Teton BGA Development Board. + +config MACH_GPLUGD + bool "Marvell's PXA168 GuruPlug Display (gplugD) Board" + depends on ARCH_MULTI_V5 + depends on UNUSED_BOARD_FILES + select CPU_PXA168 + help + Say 'Y' here if you want to support the Marvell PXA168-based + GuruPlug Display (gplugD) Board +endif + +config MACH_MMP_DT + bool "Support MMP (ARMv5) platforms from device tree" + depends on ARCH_MULTI_V5 + select PINCTRL + select PINCTRL_SINGLE + select ARCH_HAS_RESET_CONTROLLER + select CPU_MOHAWK + help + Include support for Marvell MMP2 based platforms using + the device tree. Needn't select any other machine while + MACH_MMP_DT is enabled. + +config MACH_MMP2_DT + bool "Support MMP2 (ARMv7) platforms from device tree" + depends on ARCH_MULTI_V7 + select PINCTRL + select PINCTRL_SINGLE + select ARCH_HAS_RESET_CONTROLLER + select CPU_PJ4 + select PM_GENERIC_DOMAINS if PM + select PM_GENERIC_DOMAINS_OF if PM && OF + help + Include support for Marvell MMP2 based platforms using + the device tree. + +config MACH_MMP3_DT + bool "Support MMP3 (ARMv7) platforms" + depends on ARCH_MULTI_V7 + select ARM_GIC + select HAVE_ARM_SCU if SMP + select HAVE_ARM_TWD if SMP + select CACHE_L2X0 + select PINCTRL + select PINCTRL_SINGLE + select ARCH_HAS_RESET_CONTROLLER + select CPU_PJ4B + select PM_GENERIC_DOMAINS if PM + select PM_GENERIC_DOMAINS_OF if PM && OF + help + Say 'Y' here if you want to include support for platforms + with Marvell MMP3 processor, also known as PXA2128 or + Armada 620. + +endmenu + +config CPU_PXA168 + bool + select CPU_MOHAWK + help + Select code specific to PXA168 + +config CPU_PXA910 + bool + select CPU_MOHAWK + help + Select code specific to PXA910 + +config CPU_MMP2 + bool + select CPU_PJ4 + help + Select code specific to MMP2. MMP2 is ARMv7 compatible. + +config USB_EHCI_MV_U2O + bool "EHCI support for PXA USB OTG controller" + depends on USB_EHCI_MV + help + Enables support for OTG controller which can be switched to host mode. + +config MMP_SRAM + bool + +endif diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile new file mode 100644 index 000000000..539d750aa --- /dev/null +++ b/arch/arm/mach-mmp/Makefile @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for Marvell's PXA168 processors line +# +obj-y += common.o devices.o time.o + +# SoC support +obj-$(CONFIG_CPU_PXA168) += pxa168.o +obj-$(CONFIG_CPU_PXA910) += pxa910.o +obj-$(CONFIG_CPU_MMP2) += mmp2.o +obj-$(CONFIG_MMP_SRAM) += sram.o + +ifeq ($(CONFIG_PM),y) +obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o +obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o +endif +ifeq ($(CONFIG_SMP),y) +obj-$(CONFIG_MACH_MMP3_DT) += platsmp.o +endif + +# board support +obj-$(CONFIG_MACH_ASPENITE) += aspenite.o +obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o +obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o +obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o +obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o +obj-$(CONFIG_MACH_FLINT) += flint.o +obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o +obj-$(CONFIG_MACH_MMP_DT) += mmp-dt.o +obj-$(CONFIG_MACH_MMP2_DT) += mmp2-dt.o +obj-$(CONFIG_MACH_MMP3_DT) += mmp3.o +obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o +obj-$(CONFIG_MACH_GPLUGD) += gplugd.o diff --git a/arch/arm/mach-mmp/addr-map.h b/arch/arm/mach-mmp/addr-map.h new file mode 100644 index 000000000..3dc2f0b0e --- /dev/null +++ b/arch/arm/mach-mmp/addr-map.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Common address map definitions + */ + +#ifndef __ASM_MACH_ADDR_MAP_H +#define __ASM_MACH_ADDR_MAP_H + +/* APB - Application Subsystem Peripheral Bus + * + * NOTE: the DMA controller registers are actually on the AXI fabric #1 + * slave port to AHB/APB bridge, due to its close relationship to those + * peripherals on APB, let's count it into the ABP mapping area. + */ +#define APB_PHYS_BASE 0xd4000000 +#define APB_VIRT_BASE IOMEM(0xfe000000) +#define APB_PHYS_SIZE 0x00200000 + +#define AXI_PHYS_BASE 0xd4200000 +#define AXI_VIRT_BASE IOMEM(0xfe200000) +#define AXI_PHYS_SIZE 0x00200000 + +#define PGU_PHYS_BASE 0xe0000000 +#define PGU_VIRT_BASE IOMEM(0xfe400000) +#define PGU_PHYS_SIZE 0x00100000 + +/* Static Memory Controller - Chip Select 0 and 1 */ +#define SMC_CS0_PHYS_BASE 0x80000000 +#define SMC_CS0_PHYS_SIZE 0x10000000 +#define SMC_CS1_PHYS_BASE 0x90000000 +#define SMC_CS1_PHYS_SIZE 0x10000000 + +#define APMU_VIRT_BASE (AXI_VIRT_BASE + 0x82800) +#define APMU_REG(x) (APMU_VIRT_BASE + (x)) + +#define APBC_VIRT_BASE (APB_VIRT_BASE + 0x015000) +#define APBC_REG(x) (APBC_VIRT_BASE + (x)) + +#define MPMU_VIRT_BASE (APB_VIRT_BASE + 0x50000) +#define MPMU_REG(x) (MPMU_VIRT_BASE + (x)) + +#define CIU_VIRT_BASE (AXI_VIRT_BASE + 0x82c00) +#define CIU_REG(x) (CIU_VIRT_BASE + (x)) + +#define SCU_VIRT_BASE (PGU_VIRT_BASE) +#define SCU_REG(x) (SCU_VIRT_BASE + (x)) + +#endif /* __ASM_MACH_ADDR_MAP_H */ diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c new file mode 100644 index 000000000..6314824b6 --- /dev/null +++ b/arch/arm/mach-mmp/aspenite.c @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * linux/arch/arm/mach-mmp/aspenite.c + * + * Support for the Marvell PXA168-based Aspenite and Zylonite2 + * Development Platform. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include