Commit 38206c24 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC platform updates from Olof Johansson:
 "Most of these are for MMP (seeing a bunch of cleanups and refactorings
  for the first time in a while), and for OMAP (a bunch of cleanups and
  added support for voltage controller on OMAP4430)"

* tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (51 commits)
  ARM: OMAP2+: Add missing put_device() call in omapdss_init_of()
  OMAP2: fixup doc comments in omap_device
  ARM: OMAP1: drop duplicated dependency on ARCH_OMAP1
  ARM: ASPEED: update default ARCH_NR_GPIO for ARCH_ASPEED
  ARM: imx: use generic function to exit coherency
  ARM: tegra: Use WFE for power-gating on Tegra30
  ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
  ARM: exynos: Enable exynos-asv driver for ARCH_EXYNOS
  ARM: s3c: Rename s5p_usb_phy functions
  ARM: s3c: Rename s3c64xx_spi_setname() function
  ARM: imx: Add serial number support for i.MX6/7 SoCs
  ARM: imx: Drop imx_anatop_usb_chrg_detect_disable()
  arm64: Introduce config for S32
  ARM: hisi: drop useless depend on ARCH_MULTI_V7
  arm64: realtek: Select reset controller
  ARM: shmobile: rcar-gen2: Drop legacy DT clock support
  ARM: OMAP2+: Remove duplicated include from pmic-cpcap.c
  ARM: OMAP1: ams-delta FIQ: Fix a typo ("Initiaize")
  MAINTAINERS: Add logicpd-som-lv and logicpd-torpedo to OMAP TREE
  ARM: OMAP2+: pdata-quirks: drop TI_ST/KIM support
  ...
parents d9e48dc2 ab818f09
...@@ -2200,6 +2200,7 @@ F: Documentation/devicetree/bindings/timer/rda,8810pl-timer.txt ...@@ -2200,6 +2200,7 @@ F: Documentation/devicetree/bindings/timer/rda,8810pl-timer.txt
ARM/REALTEK ARCHITECTURE ARM/REALTEK ARCHITECTURE
M: Andreas Färber <afaerber@suse.de> M: Andreas Färber <afaerber@suse.de>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L: linux-realtek-soc@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: arch/arm64/boot/dts/realtek/ F: arch/arm64/boot/dts/realtek/
F: Documentation/devicetree/bindings/arm/realtek.yaml F: Documentation/devicetree/bindings/arm/realtek.yaml
...@@ -11059,9 +11060,11 @@ F: drivers/media/radio/radio-miropcm20* ...@@ -11059,9 +11060,11 @@ F: drivers/media/radio/radio-miropcm20*
MMP SUPPORT MMP SUPPORT
R: Lubomir Rintel <lkundrak@v3.sk> R: Lubomir Rintel <lkundrak@v3.sk>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git
S: Odd Fixes S: Odd Fixes
F: arch/arm/boot/dts/mmp* F: arch/arm/boot/dts/mmp*
F: arch/arm/mach-mmp/ F: arch/arm/mach-mmp/
F: linux/soc/mmp/
MMU GATHER AND TLB INVALIDATION MMU GATHER AND TLB INVALIDATION
M: Will Deacon <will@kernel.org> M: Will Deacon <will@kernel.org>
...@@ -11908,6 +11911,8 @@ F: arch/arm/boot/dts/*am3* ...@@ -11908,6 +11911,8 @@ F: arch/arm/boot/dts/*am3*
F: arch/arm/boot/dts/*am4* F: arch/arm/boot/dts/*am4*
F: arch/arm/boot/dts/*am5* F: arch/arm/boot/dts/*am5*
F: arch/arm/boot/dts/*dra7* F: arch/arm/boot/dts/*dra7*
F: arch/arm/boot/dts/logicpd-som-lv*
F: arch/arm/boot/dts/logicpd-torpedo*
OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2) OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2)
L: linux-omap@vger.kernel.org L: linux-omap@vger.kernel.org
......
...@@ -1357,7 +1357,7 @@ config ARCH_NR_GPIO ...@@ -1357,7 +1357,7 @@ config ARCH_NR_GPIO
int int
default 2048 if ARCH_SOCFPGA default 2048 if ARCH_SOCFPGA
default 1024 if ARCH_BRCMSTB || ARCH_RENESAS || ARCH_TEGRA || \ default 1024 if ARCH_BRCMSTB || ARCH_RENESAS || ARCH_TEGRA || \
ARCH_ZYNQ ARCH_ZYNQ || ARCH_ASPEED
default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \ default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \
SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210
default 416 if ARCH_SUNXI default 416 if ARCH_SUNXI
......
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
#define L310_AUX_CTRL_STORE_LIMITATION BIT(11) /* R2P0+ */ #define L310_AUX_CTRL_STORE_LIMITATION BIT(11) /* R2P0+ */
#define L310_AUX_CTRL_EXCLUSIVE_CACHE BIT(12) #define L310_AUX_CTRL_EXCLUSIVE_CACHE BIT(12)
#define L310_AUX_CTRL_ASSOCIATIVITY_16 BIT(16) #define L310_AUX_CTRL_ASSOCIATIVITY_16 BIT(16)
#define L310_AUX_CTRL_FWA_SHIFT 23
#define L310_AUX_CTRL_FWA_MASK (3 << 23)
#define L310_AUX_CTRL_CACHE_REPLACE_RR BIT(25) /* R2P0+ */ #define L310_AUX_CTRL_CACHE_REPLACE_RR BIT(25) /* R2P0+ */
#define L310_AUX_CTRL_NS_LOCKDOWN BIT(26) #define L310_AUX_CTRL_NS_LOCKDOWN BIT(26)
#define L310_AUX_CTRL_NS_INT_CTRL BIT(27) #define L310_AUX_CTRL_NS_INT_CTRL BIT(27)
......
...@@ -161,6 +161,8 @@ config ARCH_BCM2835 ...@@ -161,6 +161,8 @@ config ARCH_BCM2835
select GPIOLIB select GPIOLIB
select ARM_AMBA select ARM_AMBA
select ARM_ERRATA_411920 if ARCH_MULTI_V6 select ARM_ERRATA_411920 if ARCH_MULTI_V6
select ARM_GIC if ARCH_MULTI_V7
select ZONE_DMA if ARCH_MULTI_V7
select ARM_TIMER_SP804 select ARM_TIMER_SP804
select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
select TIMER_OF select TIMER_OF
...@@ -169,7 +171,7 @@ config ARCH_BCM2835 ...@@ -169,7 +171,7 @@ config ARCH_BCM2835
select PINCTRL_BCM2835 select PINCTRL_BCM2835
select MFD_CORE select MFD_CORE
help help
This enables support for the Broadcom BCM2835 and BCM2836 SoCs. This enables support for the Broadcom BCM2711 and BCM283x SoCs.
This SoC is used in the Raspberry Pi and Roku 2 devices. This SoC is used in the Raspberry Pi and Roku 2 devices.
config ARCH_BCM_53573 config ARCH_BCM_53573
......
...@@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o ...@@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o
obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o
# BCM2835 # BCM2835
obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o
ifeq ($(CONFIG_ARCH_BCM2835),y) ifeq ($(CONFIG_ARCH_BCM2835),y)
obj-y += board_bcm2835.o
obj-y += bcm2711.o
ifeq ($(CONFIG_ARM),y) ifeq ($(CONFIG_ARM),y)
obj-$(CONFIG_SMP) += platsmp.o obj-$(CONFIG_SMP) += platsmp.o
endif endif
......
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2019 Stefan Wahren
*/
#include <linux/of_address.h>
#include <asm/mach/arch.h>
#include "platsmp.h"
static const char * const bcm2711_compat[] = {
#ifdef CONFIG_ARCH_MULTI_V7
"brcm,bcm2711",
#endif
};
DT_MACHINE_START(BCM2711, "BCM2711")
#ifdef CONFIG_ZONE_DMA
.dma_zone_size = SZ_1G,
#endif
.dt_compat = bcm2711_compat,
.smp = smp_ops(bcm2836_smp_ops),
MACHINE_END
...@@ -140,7 +140,7 @@ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) ...@@ -140,7 +140,7 @@ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys)
static void __bcm_kona_smc(void *info) static void __bcm_kona_smc(void *info)
{ {
struct bcm_kona_smc_data *data = info; struct bcm_kona_smc_data *data = info;
u32 *args = bcm_smc_buffer; u32 __iomem *args = bcm_smc_buffer;
BUG_ON(smp_processor_id() != 0); BUG_ON(smp_processor_id() != 0);
BUG_ON(!args); BUG_ON(!args);
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <asm/smp_scu.h> #include <asm/smp_scu.h>
#include "platsmp.h"
/* Size of mapped Cortex A9 SCU address space */ /* Size of mapped Cortex A9 SCU address space */
#define CORTEX_A9_SCU_SIZE 0x58 #define CORTEX_A9_SCU_SIZE 0x58
......
...@@ -13,6 +13,7 @@ menuconfig ARCH_EXYNOS ...@@ -13,6 +13,7 @@ menuconfig ARCH_EXYNOS
select ARM_AMBA select ARM_AMBA
select ARM_GIC select ARM_GIC
select COMMON_CLK_SAMSUNG select COMMON_CLK_SAMSUNG
select EXYNOS_ASV
select EXYNOS_CHIPID select EXYNOS_CHIPID
select EXYNOS_THERMAL select EXYNOS_THERMAL
select EXYNOS_PMU select EXYNOS_PMU
......
...@@ -15,7 +15,6 @@ menu "Hisilicon platform type" ...@@ -15,7 +15,6 @@ menu "Hisilicon platform type"
config ARCH_HI3xxx config ARCH_HI3xxx
bool "Hisilicon Hi36xx family" bool "Hisilicon Hi36xx family"
depends on ARCH_MULTI_V7
select CACHE_L2X0 select CACHE_L2X0
select HAVE_ARM_SCU if SMP select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP select HAVE_ARM_TWD if SMP
...@@ -25,17 +24,15 @@ config ARCH_HI3xxx ...@@ -25,17 +24,15 @@ config ARCH_HI3xxx
Support for Hisilicon Hi36xx SoC family Support for Hisilicon Hi36xx SoC family
config ARCH_HIP01 config ARCH_HIP01
bool "Hisilicon HIP01 family" bool "Hisilicon HIP01 family"
depends on ARCH_MULTI_V7 select HAVE_ARM_SCU if SMP
select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP
select HAVE_ARM_TWD if SMP select ARM_GLOBAL_TIMER
select ARM_GLOBAL_TIMER help
help Support for Hisilicon HIP01 SoC family
Support for Hisilicon HIP01 SoC family
config ARCH_HIP04 config ARCH_HIP04
bool "Hisilicon HiP04 Cortex A15 family" bool "Hisilicon HiP04 Cortex A15 family"
depends on ARCH_MULTI_V7
select ARM_ERRATA_798181 if SMP select ARM_ERRATA_798181 if SMP
select HAVE_ARM_ARCH_TIMER select HAVE_ARM_ARCH_TIMER
select MCPM if SMP select MCPM if SMP
...@@ -46,7 +43,6 @@ config ARCH_HIP04 ...@@ -46,7 +43,6 @@ config ARCH_HIP04
config ARCH_HIX5HD2 config ARCH_HIX5HD2
bool "Hisilicon X5HD2 family" bool "Hisilicon X5HD2 family"
depends on ARCH_MULTI_V7
select CACHE_L2X0 select CACHE_L2X0
select HAVE_ARM_SCU if SMP select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP select HAVE_ARM_TWD if SMP
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#define ANADIG_REG_2P5 0x130 #define ANADIG_REG_2P5 0x130
#define ANADIG_REG_CORE 0x140 #define ANADIG_REG_CORE 0x140
#define ANADIG_ANA_MISC0 0x150 #define ANADIG_ANA_MISC0 0x150
#define ANADIG_USB1_CHRG_DETECT 0x1b0
#define ANADIG_USB2_CHRG_DETECT 0x210
#define ANADIG_DIGPROG 0x260 #define ANADIG_DIGPROG 0x260
#define ANADIG_DIGPROG_IMX6SL 0x280 #define ANADIG_DIGPROG_IMX6SL 0x280
#define ANADIG_DIGPROG_IMX7D 0x800 #define ANADIG_DIGPROG_IMX7D 0x800
...@@ -33,8 +31,6 @@ ...@@ -33,8 +31,6 @@
#define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000 #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000
/* Below MISC0_DISCON_HIGH_SNVS is only for i.MX6SL */ /* Below MISC0_DISCON_HIGH_SNVS is only for i.MX6SL */
#define BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS 0x2000 #define BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS 0x2000
#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000
#define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000
static struct regmap *anatop; static struct regmap *anatop;
...@@ -96,16 +92,6 @@ void imx_anatop_post_resume(void) ...@@ -96,16 +92,6 @@ void imx_anatop_post_resume(void)
} }
static void imx_anatop_usb_chrg_detect_disable(void)
{
regmap_write(anatop, ANADIG_USB1_CHRG_DETECT,
BM_ANADIG_USB_CHRG_DETECT_EN_B
| BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B);
regmap_write(anatop, ANADIG_USB2_CHRG_DETECT,
BM_ANADIG_USB_CHRG_DETECT_EN_B |
BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B);
}
void __init imx_init_revision_from_anatop(void) void __init imx_init_revision_from_anatop(void)
{ {
struct device_node *np; struct device_node *np;
...@@ -171,10 +157,6 @@ void __init imx_init_revision_from_anatop(void) ...@@ -171,10 +157,6 @@ void __init imx_init_revision_from_anatop(void)
void __init imx_anatop_init(void) void __init imx_anatop_init(void)
{ {
anatop = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop"); anatop = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop");
if (IS_ERR(anatop)) { if (IS_ERR(anatop))
pr_err("%s: failed to find imx6q-anatop regmap!\n", __func__); pr_err("%s: failed to find imx6q-anatop regmap!\n", __func__);
return;
}
imx_anatop_usb_chrg_detect_disable();
} }
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/err.h> #include <linux/err.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/regmap.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sys_soc.h> #include <linux/sys_soc.h>
#include "hardware.h" #include "hardware.h"
#include "common.h" #include "common.h"
#define OCOTP_UID_H 0x420
#define OCOTP_UID_L 0x410
unsigned int __mxc_cpu_type; unsigned int __mxc_cpu_type;
static unsigned int imx_soc_revision; static unsigned int imx_soc_revision;
...@@ -76,9 +81,13 @@ void __init imx_aips_allow_unprivileged_access( ...@@ -76,9 +81,13 @@ void __init imx_aips_allow_unprivileged_access(
struct device * __init imx_soc_device_init(void) struct device * __init imx_soc_device_init(void)
{ {
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
const char *ocotp_compat = NULL;
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct device_node *root; struct device_node *root;
struct regmap *ocotp;
const char *soc_id; const char *soc_id;
u64 soc_uid = 0;
u32 val;
int ret; int ret;
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
...@@ -119,30 +128,39 @@ struct device * __init imx_soc_device_init(void) ...@@ -119,30 +128,39 @@ struct device * __init imx_soc_device_init(void)
soc_id = "i.MX53"; soc_id = "i.MX53";
break; break;
case MXC_CPU_IMX6SL: case MXC_CPU_IMX6SL:
ocotp_compat = "fsl,imx6sl-ocotp";
soc_id = "i.MX6SL"; soc_id = "i.MX6SL";
break; break;
case MXC_CPU_IMX6DL: case MXC_CPU_IMX6DL:
ocotp_compat = "fsl,imx6q-ocotp";
soc_id = "i.MX6DL"; soc_id = "i.MX6DL";
break; break;
case MXC_CPU_IMX6SX: case MXC_CPU_IMX6SX:
ocotp_compat = "fsl,imx6sx-ocotp";
soc_id = "i.MX6SX"; soc_id = "i.MX6SX";
break; break;
case MXC_CPU_IMX6Q: case MXC_CPU_IMX6Q:
ocotp_compat = "fsl,imx6q-ocotp";
soc_id = "i.MX6Q"; soc_id = "i.MX6Q";
break; break;
case MXC_CPU_IMX6UL: case MXC_CPU_IMX6UL:
ocotp_compat = "fsl,imx6ul-ocotp";
soc_id = "i.MX6UL"; soc_id = "i.MX6UL";
break; break;
case MXC_CPU_IMX6ULL: case MXC_CPU_IMX6ULL:
ocotp_compat = "fsl,imx6ul-ocotp";
soc_id = "i.MX6ULL"; soc_id = "i.MX6ULL";
break; break;
case MXC_CPU_IMX6ULZ: case MXC_CPU_IMX6ULZ:
ocotp_compat = "fsl,imx6ul-ocotp";
soc_id = "i.MX6ULZ"; soc_id = "i.MX6ULZ";
break; break;
case MXC_CPU_IMX6SLL: case MXC_CPU_IMX6SLL:
ocotp_compat = "fsl,imx6sll-ocotp";
soc_id = "i.MX6SLL"; soc_id = "i.MX6SLL";
break; break;
case MXC_CPU_IMX7D: case MXC_CPU_IMX7D:
ocotp_compat = "fsl,imx7d-ocotp";
soc_id = "i.MX7D"; soc_id = "i.MX7D";
break; break;
case MXC_CPU_IMX7ULP: case MXC_CPU_IMX7ULP:
...@@ -153,18 +171,36 @@ struct device * __init imx_soc_device_init(void) ...@@ -153,18 +171,36 @@ struct device * __init imx_soc_device_init(void)
} }
soc_dev_attr->soc_id = soc_id; soc_dev_attr->soc_id = soc_id;
if (ocotp_compat) {
ocotp = syscon_regmap_lookup_by_compatible(ocotp_compat);
if (IS_ERR(ocotp))
pr_err("%s: failed to find %s regmap!\n", __func__, ocotp_compat);
regmap_read(ocotp, OCOTP_UID_H, &val);
soc_uid = val;
regmap_read(ocotp, OCOTP_UID_L, &val);
soc_uid <<= 32;
soc_uid |= val;
}
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d", soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d",
(imx_soc_revision >> 4) & 0xf, (imx_soc_revision >> 4) & 0xf,
imx_soc_revision & 0xf); imx_soc_revision & 0xf);
if (!soc_dev_attr->revision) if (!soc_dev_attr->revision)
goto free_soc; goto free_soc;
soc_dev_attr->serial_number = kasprintf(GFP_KERNEL, "%016llX", soc_uid);
if (!soc_dev_attr->serial_number)
goto free_rev;
soc_dev = soc_device_register(soc_dev_attr); soc_dev = soc_device_register(soc_dev_attr);
if (IS_ERR(soc_dev)) if (IS_ERR(soc_dev))
goto free_rev; goto free_serial_number;
return soc_device_to_device(soc_dev); return soc_device_to_device(soc_dev);
free_serial_number:
kfree(soc_dev_attr->serial_number);
free_rev: free_rev:
kfree(soc_dev_attr->revision); kfree(soc_dev_attr->revision);
free_soc: free_soc:
......
...@@ -6,32 +6,12 @@ ...@@ -6,32 +6,12 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h> #include <asm/cp15.h>
#include <asm/proc-fns.h> #include <asm/proc-fns.h>
#include "common.h" #include "common.h"
static inline void cpu_enter_lowpower(void)
{
unsigned int v;
asm volatile(
"mcr p15, 0, %1, c7, c5, 0\n"
" mcr p15, 0, %1, c7, c10, 4\n"
/*
* Turn off coherency
*/
" mrc p15, 0, %0, c1, c0, 1\n"
" bic %0, %0, %3\n"
" mcr p15, 0, %0, c1, c0, 1\n"
" mrc p15, 0, %0, c1, c0, 0\n"
" bic %0, %0, %2\n"
" mcr p15, 0, %0, c1, c0, 0\n"
: "=&r" (v)
: "r" (0), "Ir" (CR_C), "Ir" (0x40)
: "cc");
}
/* /*
* platform-specific code to shutdown a CPU * platform-specific code to shutdown a CPU
* *
...@@ -39,7 +19,7 @@ static inline void cpu_enter_lowpower(void) ...@@ -39,7 +19,7 @@ static inline void cpu_enter_lowpower(void)
*/ */
void imx_cpu_die(unsigned int cpu) void imx_cpu_die(unsigned int cpu)
{ {
cpu_enter_lowpower(); v7_exit_coherency_flush(louis);
/* /*
* We use the cpu jumping argument register to sync with * We use the cpu jumping argument register to sync with
* imx_cpu_kill() which is running on cpu0 and waiting for * imx_cpu_kill() which is running on cpu0 and waiting for
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
menuconfig ARCH_MMP menuconfig ARCH_MMP
bool "Marvell PXA168/910/MMP2" bool "Marvell PXA168/910/MMP2/MMP3"
depends on ARCH_MULTI_V5 || ARCH_MULTI_V7 depends on ARCH_MULTI_V5 || ARCH_MULTI_V7
select GPIO_PXA select GPIO_PXA
select GPIOLIB select GPIOLIB
select PINCTRL select PINCTRL
select PLAT_PXA select PLAT_PXA
help help
Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. Support for Marvell's PXA168/PXA910(MMP), MMP2, and MMP3 processor lines.
if ARCH_MMP if ARCH_MMP
...@@ -129,6 +129,24 @@ config MACH_MMP2_DT ...@@ -129,6 +129,24 @@ config MACH_MMP2_DT
Include support for Marvell MMP2 based platforms using Include support for Marvell MMP2 based platforms using
the device tree. 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 endmenu
config CPU_PXA168 config CPU_PXA168
......
...@@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y) ...@@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y)
obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o
obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o
endif endif
ifeq ($(CONFIG_SMP),y)
obj-$(CONFIG_MACH_MMP3_DT) += platsmp.o
endif
# board support # board support
obj-$(CONFIG_MACH_ASPENITE) += aspenite.o obj-$(CONFIG_MACH_ASPENITE) += aspenite.o
...@@ -34,5 +37,6 @@ obj-$(CONFIG_MACH_FLINT) += flint.o ...@@ -34,5 +37,6 @@ obj-$(CONFIG_MACH_FLINT) += flint.o
obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
obj-$(CONFIG_MACH_MMP_DT) += mmp-dt.o obj-$(CONFIG_MACH_MMP_DT) += mmp-dt.o
obj-$(CONFIG_MACH_MMP2_DT) += mmp2-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_TETON_BGA) += teton_bga.o
obj-$(CONFIG_MACH_GPLUGD) += gplugd.o obj-$(CONFIG_MACH_GPLUGD) += gplugd.o
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#define AXI_VIRT_BASE IOMEM(0xfe200000) #define AXI_VIRT_BASE IOMEM(0xfe200000)
#define AXI_PHYS_SIZE 0x00200000 #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 */ /* Static Memory Controller - Chip Select 0 and 1 */
#define SMC_CS0_PHYS_BASE 0x80000000 #define SMC_CS0_PHYS_BASE 0x80000000
#define SMC_CS0_PHYS_SIZE 0x10000000 #define SMC_CS0_PHYS_SIZE 0x10000000
...@@ -38,4 +42,7 @@ ...@@ -38,4 +42,7 @@
#define CIU_VIRT_BASE (AXI_VIRT_BASE + 0x82c00) #define CIU_VIRT_BASE (AXI_VIRT_BASE + 0x82c00)
#define CIU_REG(x) (CIU_VIRT_BASE + (x)) #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 */ #endif /* __ASM_MACH_ADDR_MAP_H */
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/system_misc.h> #include <asm/system_misc.h>
#include "addr-map.h" #include "addr-map.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "common.h" #include "common.h"
#define MMP_CHIPID (AXI_VIRT_BASE + 0x82c00) #define MMP_CHIPID CIU_REG(0x00)
unsigned int mmp_chip_id; unsigned int mmp_chip_id;
EXPORT_SYMBOL(mmp_chip_id); EXPORT_SYMBOL(mmp_chip_id);
...@@ -36,6 +36,15 @@ static struct map_desc standard_io_desc[] __initdata = { ...@@ -36,6 +36,15 @@ static struct map_desc standard_io_desc[] __initdata = {
}, },
}; };
static struct map_desc mmp2_io_desc[] __initdata = {
{
.pfn = __phys_to_pfn(PGU_PHYS_BASE),
.virtual = (unsigned long)PGU_VIRT_BASE,
.length = PGU_PHYS_SIZE,
.type = MT_DEVICE,
},
};
void __init mmp_map_io(void) void __init mmp_map_io(void)
{ {
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
...@@ -44,6 +53,12 @@ void __init mmp_map_io(void) ...@@ -44,6 +53,12 @@ void __init mmp_map_io(void)
mmp_chip_id = __raw_readl(MMP_CHIPID); mmp_chip_id = __raw_readl(MMP_CHIPID);
} }
void __init mmp2_map_io(void)
{
mmp_map_io();
iotable_init(mmp2_io_desc, ARRAY_SIZE(mmp2_io_desc));
}
void mmp_restart(enum reboot_mode mode, const char *cmd) void mmp_restart(enum reboot_mode mode, const char *cmd)
{ {
soft_restart(0); soft_restart(0);
......
...@@ -5,4 +5,5 @@ ...@@ -5,4 +5,5 @@
extern void mmp_timer_init(int irq, unsigned long rate); extern void mmp_timer_init(int irq, unsigned long rate);
extern void __init mmp_map_io(void); extern void __init mmp_map_io(void);
extern void __init mmp2_map_io(void);
extern void mmp_restart(enum reboot_mode, const char *); extern void mmp_restart(enum reboot_mode, const char *);
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <asm/irq.h> #include <asm/irq.h>
#include "irqs.h" #include "irqs.h"
#include "devices.h" #include "devices.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "regs-usb.h" #include "regs-usb.h"
int __init pxa_register_device(struct pxa_device_desc *desc, int __init pxa_register_device(struct pxa_device_desc *desc,
......
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/hardware/cache-tauros2.h> #include <asm/hardware/cache-tauros2.h>
#include "common.h" #include "common.h"
extern void __init mmp_dt_init_timer(void);
static const char *const pxa168_dt_board_compat[] __initconst = { static const char *const pxa168_dt_board_compat[] __initconst = {
"mrvl,pxa168-aspenite", "mrvl,pxa168-aspenite",
NULL, NULL,
...@@ -32,8 +31,8 @@ static void __init mmp_init_time(void) ...@@ -32,8 +31,8 @@ static void __init mmp_init_time(void)
#ifdef CONFIG_CACHE_TAUROS2 #ifdef CONFIG_CACHE_TAUROS2
tauros2_init(0); tauros2_init(0);
#endif #endif
mmp_dt_init_timer();
of_clk_init(NULL); of_clk_init(NULL);
timer_probe();
} }
DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
......
...@@ -10,21 +10,20 @@ ...@@ -10,21 +10,20 @@
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/hardware/cache-tauros2.h> #include <asm/hardware/cache-tauros2.h>
#include "common.h" #include "common.h"
extern void __init mmp_dt_init_timer(void);
static void __init mmp_init_time(void) static void __init mmp_init_time(void)
{ {
#ifdef CONFIG_CACHE_TAUROS2 #ifdef CONFIG_CACHE_TAUROS2
tauros2_init(0); tauros2_init(0);
#endif #endif
of_clk_init(NULL); of_clk_init(NULL);
mmp_dt_init_timer(); timer_probe();
} }
static const char *const mmp2_dt_board_compat[] __initconst = { static const char *const mmp2_dt_board_compat[] __initconst = {
...@@ -33,7 +32,7 @@ static const char *const mmp2_dt_board_compat[] __initconst = { ...@@ -33,7 +32,7 @@ static const char *const mmp2_dt_board_compat[] __initconst = {
}; };
DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)")
.map_io = mmp_map_io, .map_io = mmp2_map_io,
.init_time = mmp_init_time, .init_time = mmp_init_time,
.dt_compat = mmp2_dt_board_compat, .dt_compat = mmp2_dt_board_compat,
MACHINE_END MACHINE_END
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include "addr-map.h" #include "addr-map.h"
#include "regs-apbc.h" #include "regs-apbc.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "irqs.h" #include "irqs.h"
#include "mfp.h" #include "mfp.h"
#include "devices.h" #include "devices.h"
......
// SPDX-License-Identifier: GPL-2.0-only
/*
* Marvell MMP3 aka PXA2128 aka 88AP2128 support
*
* Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
*/
#include <linux/io.h>
#include <linux/irqchip.h>
#include <linux/of_platform.h>
#include <linux/clk-provider.h>
#include <asm/mach/arch.h>
#include <asm/hardware/cache-l2x0.h>
#include "common.h"
static const char *const mmp3_dt_board_compat[] __initconst = {
"marvell,mmp3",
NULL,
};
DT_MACHINE_START(MMP2_DT, "Marvell MMP3")
.map_io = mmp2_map_io,
.dt_compat = mmp3_dt_board_compat,
.l2c_aux_val = 1 << L310_AUX_CTRL_FWA_SHIFT |
L310_AUX_CTRL_DATA_PREFETCH |
L310_AUX_CTRL_INSTR_PREFETCH,
.l2c_aux_mask = 0xc20fffff,
MACHINE_END
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
*/
#include <linux/io.h>
#include <asm/smp_scu.h>
#include <asm/smp.h>
#include "addr-map.h"
#define SW_BRANCH_VIRT_ADDR CIU_REG(0x24)
static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
/*
* Apparently, the boot ROM on the second core spins on this
* register becoming non-zero and then jumps to the address written
* there. No IPIs involved.
*/
__raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
return 0;
}
static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
{
scu_enable(SCU_VIRT_BASE);
}
static const struct smp_operations mmp3_smp_ops __initconst = {
.smp_prepare_cpus = mmp3_smp_prepare_cpus,
.smp_boot_secondary = mmp3_boot_secondary,
};
CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "addr-map.h" #include "addr-map.h"
#include "pm-mmp2.h" #include "pm-mmp2.h"
#include "regs-icu.h" #include "regs-icu.h"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/outercache.h> #include <asm/outercache.h>
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "addr-map.h" #include "addr-map.h"
#include "pm-pxa910.h" #include "pm-pxa910.h"
#include "regs-icu.h" #include "regs-icu.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "addr-map.h" #include "addr-map.h"
#include "clock.h" #include "clock.h"
#include "common.h" #include "common.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "devices.h" #include "devices.h"
#include "irqs.h" #include "irqs.h"
#include "mfp.h" #include "mfp.h"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include "addr-map.h" #include "addr-map.h"
#include "regs-apbc.h" #include "regs-apbc.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "irqs.h" #include "irqs.h"
#include "mfp.h" #include "mfp.h"
#include "devices.h" #include "devices.h"
......
...@@ -121,100 +121,6 @@ ...@@ -121,100 +121,6 @@
#define UTMI_OTG_ADDON_OTG_ON (1 << 0) #define UTMI_OTG_ADDON_OTG_ON (1 << 0)
/* For MMP3 USB Phy */
#define USB2_PLL_REG0 0x4
#define USB2_PLL_REG1 0x8
#define USB2_TX_REG0 0x10
#define USB2_TX_REG1 0x14
#define USB2_TX_REG2 0x18
#define USB2_RX_REG0 0x20
#define USB2_RX_REG1 0x24
#define USB2_RX_REG2 0x28
#define USB2_ANA_REG0 0x30
#define USB2_ANA_REG1 0x34
#define USB2_ANA_REG2 0x38
#define USB2_DIG_REG0 0x3C
#define USB2_DIG_REG1 0x40
#define USB2_DIG_REG2 0x44
#define USB2_DIG_REG3 0x48
#define USB2_TEST_REG0 0x4C
#define USB2_TEST_REG1 0x50
#define USB2_TEST_REG2 0x54
#define USB2_CHARGER_REG0 0x58
#define USB2_OTG_REG0 0x5C
#define USB2_PHY_MON0 0x60
#define USB2_RESETVE_REG0 0x64
#define USB2_ICID_REG0 0x78
#define USB2_ICID_REG1 0x7C
/* USB2_PLL_REG0 */
/* This is for Ax stepping */
#define USB2_PLL_FBDIV_SHIFT_MMP3 0
#define USB2_PLL_FBDIV_MASK_MMP3 (0xFF << 0)
#define USB2_PLL_REFDIV_SHIFT_MMP3 8
#define USB2_PLL_REFDIV_MASK_MMP3 (0xF << 8)
#define USB2_PLL_VDD12_SHIFT_MMP3 12
#define USB2_PLL_VDD18_SHIFT_MMP3 14
/* This is for B0 stepping */
#define USB2_PLL_FBDIV_SHIFT_MMP3_B0 0
#define USB2_PLL_REFDIV_SHIFT_MMP3_B0 9
#define USB2_PLL_VDD18_SHIFT_MMP3_B0 14
#define USB2_PLL_FBDIV_MASK_MMP3_B0 0x01FF
#define USB2_PLL_REFDIV_MASK_MMP3_B0 0x3E00
#define USB2_PLL_CAL12_SHIFT_MMP3 0
#define USB2_PLL_CALI12_MASK_MMP3 (0x3 << 0)
#define USB2_PLL_VCOCAL_START_SHIFT_MMP3 2
#define USB2_PLL_KVCO_SHIFT_MMP3 4
#define USB2_PLL_KVCO_MASK_MMP3 (0x7<<4)
#define USB2_PLL_ICP_SHIFT_MMP3 8
#define USB2_PLL_ICP_MASK_MMP3 (0x7<<8)
#define USB2_PLL_LOCK_BYPASS_SHIFT_MMP3 12
#define USB2_PLL_PU_PLL_SHIFT_MMP3 13
#define USB2_PLL_PU_PLL_MASK (0x1 << 13)
#define USB2_PLL_READY_MASK_MMP3 (0x1 << 15)
/* USB2_TX_REG0 */
#define USB2_TX_IMPCAL_VTH_SHIFT_MMP3 8
#define USB2_TX_IMPCAL_VTH_MASK_MMP3 (0x7 << 8)
#define USB2_TX_RCAL_START_SHIFT_MMP3 13
/* USB2_TX_REG1 */
#define USB2_TX_CK60_PHSEL_SHIFT_MMP3 0
#define USB2_TX_CK60_PHSEL_MASK_MMP3 (0xf << 0)
#define USB2_TX_AMP_SHIFT_MMP3 4
#define USB2_TX_AMP_MASK_MMP3 (0x7 << 4)
#define USB2_TX_VDD12_SHIFT_MMP3 8
#define USB2_TX_VDD12_MASK_MMP3 (0x3 << 8)
/* USB2_TX_REG2 */
#define USB2_TX_DRV_SLEWRATE_SHIFT 10
/* USB2_RX_REG0 */
#define USB2_RX_SQ_THRESH_SHIFT_MMP3 4
#define USB2_RX_SQ_THRESH_MASK_MMP3 (0xf << 4)
#define USB2_RX_SQ_LENGTH_SHIFT_MMP3 10
#define USB2_RX_SQ_LENGTH_MASK_MMP3 (0x3 << 10)
/* USB2_ANA_REG1*/
#define USB2_ANA_PU_ANA_SHIFT_MMP3 14
/* USB2_OTG_REG0 */
#define USB2_OTG_PU_OTG_SHIFT_MMP3 3
/* fsic registers */ /* fsic registers */
#define FSIC_MISC 0x4 #define FSIC_MISC 0x4
#define FSIC_INT 0x28 #define FSIC_INT 0x28
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "regs-timers.h" #include "regs-timers.h"
#include "regs-apbc.h" #include "regs-apbc.h"
#include "irqs.h" #include "irqs.h"
#include "cputype.h" #include <linux/soc/mmp/cputype.h>
#include "clock.h" #include "clock.h"
#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE #define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE
...@@ -155,7 +155,8 @@ static void __init timer_config(void) ...@@ -155,7 +155,8 @@ static void __init timer_config(void)
__raw_writel(0x0, mmp_timer_base + TMR_CER); /* disable */ __raw_writel(0x0, mmp_timer_base + TMR_CER); /* disable */
ccr &= (cpu_is_mmp2()) ? (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) : ccr &= (cpu_is_mmp2() || cpu_is_mmp3()) ?
(TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) :
(TMR_CCR_CS_0(3) | TMR_CCR_CS_1(3)); (TMR_CCR_CS_0(3) | TMR_CCR_CS_1(3));
__raw_writel(ccr, mmp_timer_base + TMR_CCR); __raw_writel(ccr, mmp_timer_base + TMR_CCR);
...@@ -195,30 +196,17 @@ void __init mmp_timer_init(int irq, unsigned long rate) ...@@ -195,30 +196,17 @@ void __init mmp_timer_init(int irq, unsigned long rate)
clockevents_config_and_register(&ckevt, rate, MIN_DELTA, MAX_DELTA); clockevents_config_and_register(&ckevt, rate, MIN_DELTA, MAX_DELTA);
} }
#ifdef CONFIG_OF static int __init mmp_dt_init_timer(struct device_node *np)
static const struct of_device_id mmp_timer_dt_ids[] = {
{ .compatible = "mrvl,mmp-timer", },
{}
};
void __init mmp_dt_init_timer(void)
{ {
struct device_node *np;
struct clk *clk; struct clk *clk;
int irq, ret; int irq, ret;
unsigned long rate; unsigned long rate;
np = of_find_matching_node(NULL, mmp_timer_dt_ids);
if (!np) {
ret = -ENODEV;
goto out;
}
clk = of_clk_get(np, 0); clk = of_clk_get(np, 0);
if (!IS_ERR(clk)) { if (!IS_ERR(clk)) {
ret = clk_prepare_enable(clk); ret = clk_prepare_enable(clk);
if (ret) if (ret)
goto out; return ret;
rate = clk_get_rate(clk) / 2; rate = clk_get_rate(clk) / 2;
} else if (cpu_is_pj4()) { } else if (cpu_is_pj4()) {
rate = 6500000; rate = 6500000;
...@@ -227,18 +215,15 @@ void __init mmp_dt_init_timer(void) ...@@ -227,18 +215,15 @@ void __init mmp_dt_init_timer(void)
} }
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (!irq) { if (!irq)
ret = -EINVAL; return -EINVAL;
goto out;
}
mmp_timer_base = of_iomap(np, 0); mmp_timer_base = of_iomap(np, 0);
if (!mmp_timer_base) { if (!mmp_timer_base)
ret = -ENOMEM; return -ENOMEM;
goto out;
}
mmp_timer_init(irq, rate); mmp_timer_init(irq, rate);
return; return 0;
out:
pr_err("Failed to get timer from device tree with error:%d\n", ret);
} }
#endif
TIMER_OF_DECLARE(mmp_timer, "mrvl,mmp-timer", mmp_dt_init_timer);
...@@ -4,30 +4,25 @@ if ARCH_OMAP1 ...@@ -4,30 +4,25 @@ if ARCH_OMAP1
menu "TI OMAP1 specific features" menu "TI OMAP1 specific features"
comment "OMAP Core Type" comment "OMAP Core Type"
depends on ARCH_OMAP1
config ARCH_OMAP730 config ARCH_OMAP730
depends on ARCH_OMAP1
bool "OMAP730 Based System" bool "OMAP730 Based System"
select ARCH_OMAP_OTG select ARCH_OMAP_OTG
select CPU_ARM926T select CPU_ARM926T
select OMAP_MPU_TIMER select OMAP_MPU_TIMER
config ARCH_OMAP850 config ARCH_OMAP850
depends on ARCH_OMAP1
bool "OMAP850 Based System" bool "OMAP850 Based System"
select ARCH_OMAP_OTG select ARCH_OMAP_OTG
select CPU_ARM926T select CPU_ARM926T
config ARCH_OMAP15XX config ARCH_OMAP15XX
depends on ARCH_OMAP1
default y default y
bool "OMAP15xx Based System" bool "OMAP15xx Based System"
select CPU_ARM925T select CPU_ARM925T
select OMAP_MPU_TIMER select OMAP_MPU_TIMER
config ARCH_OMAP16XX config ARCH_OMAP16XX
depends on ARCH_OMAP1
bool "OMAP16xx Based System" bool "OMAP16xx Based System"
select ARCH_OMAP_OTG select ARCH_OMAP_OTG
select CPU_ARM926T select CPU_ARM926T
...@@ -35,7 +30,6 @@ config ARCH_OMAP16XX ...@@ -35,7 +30,6 @@ config ARCH_OMAP16XX
config OMAP_MUX config OMAP_MUX
bool "OMAP multiplexing support" bool "OMAP multiplexing support"
depends on ARCH_OMAP
default y default y
help help
Pin multiplexing support for OMAP boards. If your bootloader Pin multiplexing support for OMAP boards. If your bootloader
...@@ -60,25 +54,24 @@ config OMAP_MUX_WARNINGS ...@@ -60,25 +54,24 @@ config OMAP_MUX_WARNINGS
printed, it's safe to deselect OMAP_MUX for your product. printed, it's safe to deselect OMAP_MUX for your product.
comment "OMAP Board Type" comment "OMAP Board Type"
depends on ARCH_OMAP1
config MACH_OMAP_INNOVATOR config MACH_OMAP_INNOVATOR
bool "TI Innovator" bool "TI Innovator"
depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX) depends on ARCH_OMAP15XX || ARCH_OMAP16XX
help help
TI OMAP 1510 or 1610 Innovator board support. Say Y here if you TI OMAP 1510 or 1610 Innovator board support. Say Y here if you
have such a board. have such a board.
config MACH_OMAP_H2 config MACH_OMAP_H2
bool "TI H2 Support" bool "TI H2 Support"
depends on ARCH_OMAP1 && ARCH_OMAP16XX depends on ARCH_OMAP16XX
help help
TI OMAP 1610/1611B H2 board support. Say Y here if you have such TI OMAP 1610/1611B H2 board support. Say Y here if you have such
a board. a board.
config MACH_OMAP_H3 config MACH_OMAP_H3
bool "TI H3 Support" bool "TI H3 Support"
depends on ARCH_OMAP1 && ARCH_OMAP16XX depends on ARCH_OMAP16XX
help help
TI OMAP 1710 H3 board support. Say Y here if you have such TI OMAP 1710 H3 board support. Say Y here if you have such
a board. a board.
...@@ -91,7 +84,7 @@ config MACH_HERALD ...@@ -91,7 +84,7 @@ config MACH_HERALD
config MACH_OMAP_OSK config MACH_OMAP_OSK
bool "TI OSK Support" bool "TI OSK Support"
depends on ARCH_OMAP1 && ARCH_OMAP16XX depends on ARCH_OMAP16XX
help help
TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
if you have such a board. if you have such a board.
...@@ -106,21 +99,21 @@ config OMAP_OSK_MISTRAL ...@@ -106,21 +99,21 @@ config OMAP_OSK_MISTRAL
config MACH_OMAP_PERSEUS2 config MACH_OMAP_PERSEUS2
bool "TI Perseus2" bool "TI Perseus2"
depends on ARCH_OMAP1 && ARCH_OMAP730 depends on ARCH_OMAP730
help help
Support for TI OMAP 730 Perseus2 board. Say Y here if you have such Support for TI OMAP 730 Perseus2 board. Say Y here if you have such
a board. a board.
config MACH_OMAP_FSAMPLE config MACH_OMAP_FSAMPLE
bool "TI F-Sample" bool "TI F-Sample"
depends on ARCH_OMAP1 && ARCH_OMAP730 depends on ARCH_OMAP730
help help
Support for TI OMAP 850 F-Sample board. Say Y here if you have such Support for TI OMAP 850 F-Sample board. Say Y here if you have such
a board. a board.
config MACH_OMAP_PALMTE config MACH_OMAP_PALMTE
bool "Palm Tungsten E" bool "Palm Tungsten E"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP15XX
help help
Support for the Palm Tungsten E PDA. To boot the kernel, you'll Support for the Palm Tungsten E PDA. To boot the kernel, you'll
need a PalmOS compatible bootloader; check out need a PalmOS compatible bootloader; check out
...@@ -129,7 +122,7 @@ config MACH_OMAP_PALMTE ...@@ -129,7 +122,7 @@ config MACH_OMAP_PALMTE
config MACH_OMAP_PALMZ71 config MACH_OMAP_PALMZ71
bool "Palm Zire71" bool "Palm Zire71"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP15XX
help help
Support for the Palm Zire71 PDA. To boot the kernel, Support for the Palm Zire71 PDA. To boot the kernel,
you'll need a PalmOS compatible bootloader; check out you'll need a PalmOS compatible bootloader; check out
...@@ -138,7 +131,7 @@ config MACH_OMAP_PALMZ71 ...@@ -138,7 +131,7 @@ config MACH_OMAP_PALMZ71
config MACH_OMAP_PALMTT config MACH_OMAP_PALMTT
bool "Palm Tungsten|T" bool "Palm Tungsten|T"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP15XX
help help
Support for the Palm Tungsten|T PDA. To boot the kernel, you'll Support for the Palm Tungsten|T PDA. To boot the kernel, you'll
need a PalmOS compatible bootloader (Garux); check out need a PalmOS compatible bootloader (Garux); check out
...@@ -147,7 +140,7 @@ config MACH_OMAP_PALMTT ...@@ -147,7 +140,7 @@ config MACH_OMAP_PALMTT
config MACH_SX1 config MACH_SX1
bool "Siemens SX1" bool "Siemens SX1"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP15XX
select I2C select I2C
help help
Support for the Siemens SX1 phone. To boot the kernel, Support for the Siemens SX1 phone. To boot the kernel,
...@@ -159,14 +152,14 @@ config MACH_SX1 ...@@ -159,14 +152,14 @@ config MACH_SX1
config MACH_NOKIA770 config MACH_NOKIA770
bool "Nokia 770" bool "Nokia 770"
depends on ARCH_OMAP1 && ARCH_OMAP16XX depends on ARCH_OMAP16XX
help help
Support for the Nokia 770 Internet Tablet. Say Y here if you Support for the Nokia 770 Internet Tablet. Say Y here if you
have such a device. have such a device.
config MACH_AMS_DELTA config MACH_AMS_DELTA
bool "Amstrad E3 (Delta)" bool "Amstrad E3 (Delta)"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP15XX
select FIQ select FIQ
select GPIO_GENERIC_PLATFORM select GPIO_GENERIC_PLATFORM
select LEDS_GPIO_REGISTER select LEDS_GPIO_REGISTER
...@@ -178,7 +171,7 @@ config MACH_AMS_DELTA ...@@ -178,7 +171,7 @@ config MACH_AMS_DELTA
config MACH_OMAP_GENERIC config MACH_OMAP_GENERIC
bool "Generic OMAP board" bool "Generic OMAP board"
depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX) depends on ARCH_OMAP15XX || ARCH_OMAP16XX
help help
Support for generic OMAP-1510, 1610 or 1710 board with Support for generic OMAP-1510, 1610 or 1710 board with
no FPGA. Can be used as template for porting Linux to no FPGA. Can be used as template for porting Linux to
......
...@@ -110,7 +110,7 @@ void __init ams_delta_init_fiq(struct gpio_chip *chip, ...@@ -110,7 +110,7 @@ void __init ams_delta_init_fiq(struct gpio_chip *chip,
/* /*
* FIQ handler takes full control over serio data and clk GPIO * FIQ handler takes full control over serio data and clk GPIO
* pins. Initiaize them and keep requested so nobody can * pins. Initialize them and keep requested so nobody can
* interfere. Fail if any of those two couldn't be requested. * interfere. Fail if any of those two couldn't be requested.
*/ */
switch (i) { switch (i) {
......
...@@ -29,6 +29,11 @@ obj-y += mcbsp.o ...@@ -29,6 +29,11 @@ obj-y += mcbsp.o
endif endif
obj-$(CONFIG_TWL4030_CORE) += omap_twl.o obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
ifneq ($(CONFIG_MFD_CPCAP),)
obj-y += pmic-cpcap.o
endif
obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o
# SMP support ONLY available for OMAP4 # SMP support ONLY available for OMAP4
......
...@@ -1147,7 +1147,21 @@ void clkdm_del_autodeps(struct clockdomain *clkdm) ...@@ -1147,7 +1147,21 @@ void clkdm_del_autodeps(struct clockdomain *clkdm)
/* Clockdomain-to-clock/hwmod framework interface code */ /* Clockdomain-to-clock/hwmod framework interface code */
static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) /**
* clkdm_clk_enable - add an enabled downstream clock to this clkdm
* @clkdm: struct clockdomain *
* @clk: struct clk * of the enabled downstream clock
*
* Increment the usecount of the clockdomain @clkdm and ensure that it
* is awake before @clk is enabled. Intended to be called by
* clk_enable() code. If the clockdomain is in software-supervised
* idle mode, force the clockdomain to wake. If the clockdomain is in
* hardware-supervised idle mode, add clkdm-pwrdm autodependencies, to
* ensure that devices in the clockdomain can be read from/written to
* by on-chip processors. Returns -EINVAL if passed null pointers;
* returns 0 upon success or if the clockdomain is in hwsup idle mode.
*/
int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *unused)
{ {
if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_enable) if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_enable)
return -EINVAL; return -EINVAL;
...@@ -1174,33 +1188,6 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) ...@@ -1174,33 +1188,6 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
return 0; return 0;
} }
/**
* clkdm_clk_enable - add an enabled downstream clock to this clkdm
* @clkdm: struct clockdomain *
* @clk: struct clk * of the enabled downstream clock
*
* Increment the usecount of the clockdomain @clkdm and ensure that it
* is awake before @clk is enabled. Intended to be called by
* clk_enable() code. If the clockdomain is in software-supervised
* idle mode, force the clockdomain to wake. If the clockdomain is in
* hardware-supervised idle mode, add clkdm-pwrdm autodependencies, to
* ensure that devices in the clockdomain can be read from/written to
* by on-chip processors. Returns -EINVAL if passed null pointers;
* returns 0 upon success or if the clockdomain is in hwsup idle mode.
*/
int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
{
/*
* XXX Rewrite this code to maintain a list of enabled
* downstream clocks for debugging purposes?
*/
if (!clk)
return -EINVAL;
return _clkdm_clk_hwmod_enable(clkdm);
}
/** /**
* clkdm_clk_disable - remove an enabled downstream clock from this clkdm * clkdm_clk_disable - remove an enabled downstream clock from this clkdm
* @clkdm: struct clockdomain * * @clkdm: struct clockdomain *
...@@ -1216,13 +1203,13 @@ int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) ...@@ -1216,13 +1203,13 @@ int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
*/ */
int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
{ {
if (!clkdm || !clk || !arch_clkdm || !arch_clkdm->clkdm_clk_disable) if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_disable)
return -EINVAL; return -EINVAL;
pwrdm_lock(clkdm->pwrdm.ptr); pwrdm_lock(clkdm->pwrdm.ptr);
/* corner case: disabling unused clocks */ /* corner case: disabling unused clocks */
if ((__clk_get_enable_count(clk) == 0) && clkdm->usecount == 0) if (clk && (__clk_get_enable_count(clk) == 0) && clkdm->usecount == 0)
goto ccd_exit; goto ccd_exit;
if (clkdm->usecount == 0) { if (clkdm->usecount == 0) {
...@@ -1277,7 +1264,7 @@ int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh) ...@@ -1277,7 +1264,7 @@ int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh)
if (!oh) if (!oh)
return -EINVAL; return -EINVAL;
return _clkdm_clk_hwmod_enable(clkdm); return clkdm_clk_enable(clkdm, NULL);
} }
/** /**
...@@ -1300,35 +1287,10 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh) ...@@ -1300,35 +1287,10 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh)
if (cpu_is_omap24xx() || cpu_is_omap34xx()) if (cpu_is_omap24xx() || cpu_is_omap34xx())
return 0; return 0;
/* if (!oh)
* XXX Rewrite this code to maintain a list of enabled
* downstream hwmods for debugging purposes?
*/
if (!clkdm || !oh || !arch_clkdm || !arch_clkdm->clkdm_clk_disable)
return -EINVAL; return -EINVAL;
pwrdm_lock(clkdm->pwrdm.ptr); return clkdm_clk_disable(clkdm, NULL);
if (clkdm->usecount == 0) {
pwrdm_unlock(clkdm->pwrdm.ptr);
WARN_ON(1); /* underflow */
return -ERANGE;
}
clkdm->usecount--;
if (clkdm->usecount > 0) {
pwrdm_unlock(clkdm->pwrdm.ptr);
return 0;
}
arch_clkdm->clkdm_clk_disable(clkdm);
pwrdm_state_switch_nolock(clkdm->pwrdm.ptr);
pwrdm_unlock(clkdm->pwrdm.ptr);
pr_debug("clockdomain: %s: disabled\n", clkdm->name);
return 0;
} }
/** /**
......
...@@ -684,7 +684,7 @@ static u32 am33xx_control_vals[ARRAY_SIZE(am43xx_control_reg_offsets)]; ...@@ -684,7 +684,7 @@ static u32 am33xx_control_vals[ARRAY_SIZE(am43xx_control_reg_offsets)];
* *
* Save the wkup domain registers * Save the wkup domain registers
*/ */
void am43xx_control_save_context(void) static void am43xx_control_save_context(void)
{ {
int i; int i;
...@@ -698,7 +698,7 @@ void am43xx_control_save_context(void) ...@@ -698,7 +698,7 @@ void am43xx_control_save_context(void)
* *
* Restore the wkup domain registers * Restore the wkup domain registers
*/ */
void am43xx_control_restore_context(void) static void am43xx_control_restore_context(void)
{ {
int i; int i;
......
...@@ -195,6 +195,7 @@ ...@@ -195,6 +195,7 @@
#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243 #define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243
#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246 #define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246
#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249 #define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249
#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITROSB 0x24C
#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254 #define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254
#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257 #define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257
#define OMAP44XX_CONTROL_FUSE_CORE_OPP100OV 0x25A #define OMAP44XX_CONTROL_FUSE_CORE_OPP100OV 0x25A
......
...@@ -265,6 +265,7 @@ static int __init omapdss_init_of(void) ...@@ -265,6 +265,7 @@ static int __init omapdss_init_of(void)
r = of_platform_populate(node, NULL, NULL, &pdev->dev); r = of_platform_populate(node, NULL, NULL, &pdev->dev);
if (r) { if (r) {
pr_err("Unable to populate DSS submodule devices\n"); pr_err("Unable to populate DSS submodule devices\n");
put_device(&pdev->dev);
return r; return r;
} }
......
...@@ -227,7 +227,6 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) ...@@ -227,7 +227,6 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
{ {
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu); struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu);
unsigned int save_state = 0, cpu_logic_state = PWRDM_POWER_RET; unsigned int save_state = 0, cpu_logic_state = PWRDM_POWER_RET;
unsigned int wakeup_cpu;
if (omap_rev() == OMAP4430_REV_ES1_0) if (omap_rev() == OMAP4430_REV_ES1_0)
return -ENXIO; return -ENXIO;
...@@ -292,7 +291,6 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) ...@@ -292,7 +291,6 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
* secure devices, CPUx does WFI which can result in * secure devices, CPUx does WFI which can result in
* domain transition * domain transition
*/ */
wakeup_cpu = smp_processor_id();
pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON); pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
pwrdm_post_transition(NULL); pwrdm_post_transition(NULL);
......
...@@ -119,11 +119,7 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od, ...@@ -119,11 +119,7 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od,
/** /**
* omap_device_build_from_dt - build an omap_device with multiple hwmods * omap_device_build_from_dt - build an omap_device with multiple hwmods
* @pdev_name: name of the platform_device driver to use * @pdev: The platform device to update.
* @pdev_id: this platform_device's connection ID
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
* @pdata_len: amount of memory pointed to by @pdata
* *
* Function for building an omap_device already registered from device-tree * Function for building an omap_device already registered from device-tree
* *
...@@ -292,7 +288,7 @@ static int _omap_device_idle_hwmods(struct omap_device *od) ...@@ -292,7 +288,7 @@ static int _omap_device_idle_hwmods(struct omap_device *od)
/** /**
* omap_device_get_context_loss_count - get lost context count * omap_device_get_context_loss_count - get lost context count
* @od: struct omap_device * * @pdev: The platform device to update.
* *
* Using the primary hwmod, query the context loss count for this * Using the primary hwmod, query the context loss count for this
* device. * device.
...@@ -321,9 +317,8 @@ int omap_device_get_context_loss_count(struct platform_device *pdev) ...@@ -321,9 +317,8 @@ int omap_device_get_context_loss_count(struct platform_device *pdev)
/** /**
* omap_device_alloc - allocate an omap_device * omap_device_alloc - allocate an omap_device
* @pdev: platform_device that will be included in this omap_device * @pdev: platform_device that will be included in this omap_device
* @oh: ptr to the single omap_hwmod that backs this omap_device * @ohs: ptr to the omap_hwmod for this omap_device
* @pdata: platform_data ptr to associate with the platform_device * @oh_cnt: the size of the ohs list
* @pdata_len: amount of memory pointed to by @pdata
* *
* Convenience function for allocating an omap_device structure and filling * Convenience function for allocating an omap_device structure and filling
* hwmods, and resources. * hwmods, and resources.
...@@ -649,7 +644,7 @@ struct dev_pm_domain omap_device_pm_domain = { ...@@ -649,7 +644,7 @@ struct dev_pm_domain omap_device_pm_domain = {
/** /**
* omap_device_register - register an omap_device with one omap_hwmod * omap_device_register - register an omap_device with one omap_hwmod
* @od: struct omap_device * to register * @pdev: the platform device (omap_device) to register.
* *
* Register the omap_device structure. This currently just calls * Register the omap_device structure. This currently just calls
* platform_device_register() on the underlying platform_device. * platform_device_register() on the underlying platform_device.
...@@ -668,7 +663,7 @@ int omap_device_register(struct platform_device *pdev) ...@@ -668,7 +663,7 @@ int omap_device_register(struct platform_device *pdev)
/** /**
* omap_device_enable - fully activate an omap_device * omap_device_enable - fully activate an omap_device
* @od: struct omap_device * to activate * @pdev: the platform device to activate
* *
* Do whatever is necessary for the hwmods underlying omap_device @od * Do whatever is necessary for the hwmods underlying omap_device @od
* to be accessible and ready to operate. This generally involves * to be accessible and ready to operate. This generally involves
...@@ -702,7 +697,7 @@ int omap_device_enable(struct platform_device *pdev) ...@@ -702,7 +697,7 @@ int omap_device_enable(struct platform_device *pdev)
/** /**
* omap_device_idle - idle an omap_device * omap_device_idle - idle an omap_device
* @od: struct omap_device * to idle * @pdev: The platform_device (omap_device) to idle
* *
* Idle omap_device @od. Device drivers call this function indirectly * Idle omap_device @od. Device drivers call this function indirectly
* via pm_runtime_put*(). Returns -EINVAL if the omap_device is not * via pm_runtime_put*(). Returns -EINVAL if the omap_device is not
......
...@@ -623,39 +623,6 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) ...@@ -623,39 +623,6 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
return 0; return 0;
} }
/**
* _disable_wakeup: clear OCP_SYSCONFIG.ENAWAKEUP bit in the hardware
* @oh: struct omap_hwmod *
*
* Prevent the hardware module @oh to send wakeups. Returns -EINVAL
* upon error or 0 upon success.
*/
static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
{
if (!oh->class->sysc ||
!((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
(oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) ||
(oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)))
return -EINVAL;
if (!oh->class->sysc->sysc_fields) {
WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name);
return -EINVAL;
}
if (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)
*v &= ~(0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
_set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v);
if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
_set_master_standbymode(oh, HWMOD_IDLEMODE_SMART, v);
/* XXX test pwrdm_get_wken for this hwmod's subsystem */
return 0;
}
static struct clockdomain *_get_clkdm(struct omap_hwmod *oh) static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
{ {
struct clk_hw_omap *clk; struct clk_hw_omap *clk;
...@@ -3867,70 +3834,6 @@ void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh) ...@@ -3867,70 +3834,6 @@ void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh)
* for context save/restore operations? * for context save/restore operations?
*/ */
/**
* omap_hwmod_enable_wakeup - allow device to wake up the system
* @oh: struct omap_hwmod *
*
* Sets the module OCP socket ENAWAKEUP bit to allow the module to
* send wakeups to the PRCM, and enable I/O ring wakeup events for
* this IP block if it has dynamic mux entries. Eventually this
* should set PRCM wakeup registers to cause the PRCM to receive
* wakeup events from the module. Does not set any wakeup routing
* registers beyond this point - if the module is to wake up any other
* module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
{
unsigned long flags;
u32 v;
spin_lock_irqsave(&oh->_lock, flags);
if (oh->class->sysc &&
(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_enable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
/**
* omap_hwmod_disable_wakeup - prevent device from waking the system
* @oh: struct omap_hwmod *
*
* Clears the module OCP socket ENAWAKEUP bit to prevent the module
* from sending wakeups to the PRCM, and disable I/O ring wakeup
* events for this IP block if it has dynamic mux entries. Eventually
* this should clear PRCM wakeup registers to cause the PRCM to ignore
* wakeup events from the module. Does not set any wakeup routing
* registers beyond this point - if the module is to wake up any other
* module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
{
unsigned long flags;
u32 v;
spin_lock_irqsave(&oh->_lock, flags);
if (oh->class->sysc &&
(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_disable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
/** /**
* omap_hwmod_assert_hardreset - assert the HW reset line of submodules * omap_hwmod_assert_hardreset - assert the HW reset line of submodules
* contained in the hwmod module. * contained in the hwmod module.
......
...@@ -646,9 +646,6 @@ int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type, ...@@ -646,9 +646,6 @@ int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh); struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh); void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
int omap_hwmod_for_each_by_class(const char *classname, int omap_hwmod_for_each_by_class(const char *classname,
int (*fn)(struct omap_hwmod *oh, int (*fn)(struct omap_hwmod *oh,
void *user), void *user),
......
...@@ -790,7 +790,7 @@ static struct omap_hwmod_class omap44xx_sha0_hwmod_class = { ...@@ -790,7 +790,7 @@ static struct omap_hwmod_class omap44xx_sha0_hwmod_class = {
.sysc = &omap44xx_sha0_sysc, .sysc = &omap44xx_sha0_sysc,
}; };
struct omap_hwmod omap44xx_sha0_hwmod = { static struct omap_hwmod omap44xx_sha0_hwmod = {
.name = "sham", .name = "sham",
.class = &omap44xx_sha0_hwmod_class, .class = &omap44xx_sha0_hwmod_class,
.clkdm_name = "l4_secure_clkdm", .clkdm_name = "l4_secure_clkdm",
...@@ -974,7 +974,7 @@ static struct omap_hwmod omap44xx_des_hwmod = { ...@@ -974,7 +974,7 @@ static struct omap_hwmod omap44xx_des_hwmod = {
}, },
}; };
struct omap_hwmod_ocp_if omap44xx_l3_main_2__des = { static struct omap_hwmod_ocp_if omap44xx_l3_main_2__des = {
.master = &omap44xx_l3_main_2_hwmod, .master = &omap44xx_l3_main_2_hwmod,
.slave = &omap44xx_des_hwmod, .slave = &omap44xx_des_hwmod,
.clk = "l3_div_ck", .clk = "l3_div_ck",
......
...@@ -683,7 +683,7 @@ static struct omap_hwmod_class dra7xx_sha0_hwmod_class = { ...@@ -683,7 +683,7 @@ static struct omap_hwmod_class dra7xx_sha0_hwmod_class = {
.sysc = &dra7xx_sha0_sysc, .sysc = &dra7xx_sha0_sysc,
}; };
struct omap_hwmod dra7xx_sha0_hwmod = { static struct omap_hwmod dra7xx_sha0_hwmod = {
.name = "sham", .name = "sham",
.class = &dra7xx_sha0_hwmod_class, .class = &dra7xx_sha0_hwmod_class,
.clkdm_name = "l4sec_clkdm", .clkdm_name = "l4sec_clkdm",
......
...@@ -36,11 +36,6 @@ ...@@ -36,11 +36,6 @@
#define OMAP4_VDD_CORE_SR_VOLT_REG 0x61 #define OMAP4_VDD_CORE_SR_VOLT_REG 0x61
#define OMAP4_VDD_CORE_SR_CMD_REG 0x62 #define OMAP4_VDD_CORE_SR_CMD_REG 0x62
#define OMAP4_VP_CONFIG_ERROROFFSET 0x00
#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01
#define OMAP4_VP_VSTEPMAX_VSTEPMAX 0x04
#define OMAP4_VP_VLIMITTO_TIMEOUT_US 200
static bool is_offset_valid; static bool is_offset_valid;
static u8 smps_offset; static u8 smps_offset;
...@@ -219,7 +214,8 @@ int __init omap4_twl_init(void) ...@@ -219,7 +214,8 @@ int __init omap4_twl_init(void)
{ {
struct voltagedomain *voltdm; struct voltagedomain *voltdm;
if (!cpu_is_omap44xx()) if (!cpu_is_omap44xx() ||
of_find_compatible_node(NULL, NULL, "motorola,cpcap"))
return -ENODEV; return -ENODEV;
voltdm = voltdm_lookup("mpu"); voltdm = voltdm_lookup("mpu");
......
...@@ -32,20 +32,22 @@ ...@@ -32,20 +32,22 @@
#define OMAP4430_VDD_MPU_OPP50_UV 1025000 #define OMAP4430_VDD_MPU_OPP50_UV 1025000
#define OMAP4430_VDD_MPU_OPP100_UV 1200000 #define OMAP4430_VDD_MPU_OPP100_UV 1200000
#define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000 #define OMAP4430_VDD_MPU_OPPTURBO_UV 1325000
#define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000 #define OMAP4430_VDD_MPU_OPPNITRO_UV 1388000
#define OMAP4430_VDD_MPU_OPPNITROSB_UV 1398000
struct omap_volt_data omap443x_vdd_mpu_volt_data[] = { struct omap_volt_data omap443x_vdd_mpu_volt_data[] = {
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c), VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16), VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23), VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27), VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITROSB_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITROSB, 0xfa, 0x27),
VOLT_DATA_DEFINE(0, 0, 0, 0), VOLT_DATA_DEFINE(0, 0, 0, 0),
}; };
#define OMAP4430_VDD_IVA_OPP50_UV 1013000 #define OMAP4430_VDD_IVA_OPP50_UV 950000
#define OMAP4430_VDD_IVA_OPP100_UV 1188000 #define OMAP4430_VDD_IVA_OPP100_UV 1114000
#define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000 #define OMAP4430_VDD_IVA_OPPTURBO_UV 1291000
struct omap_volt_data omap443x_vdd_iva_volt_data[] = { struct omap_volt_data omap443x_vdd_iva_volt_data[] = {
VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c), VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
...@@ -54,8 +56,8 @@ struct omap_volt_data omap443x_vdd_iva_volt_data[] = { ...@@ -54,8 +56,8 @@ struct omap_volt_data omap443x_vdd_iva_volt_data[] = {
VOLT_DATA_DEFINE(0, 0, 0, 0), VOLT_DATA_DEFINE(0, 0, 0, 0),
}; };
#define OMAP4430_VDD_CORE_OPP50_UV 1025000 #define OMAP4430_VDD_CORE_OPP50_UV 962000
#define OMAP4430_VDD_CORE_OPP100_UV 1200000 #define OMAP4430_VDD_CORE_OPP100_UV 1127000
struct omap_volt_data omap443x_vdd_core_volt_data[] = { struct omap_volt_data omap443x_vdd_core_volt_data[] = {
VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c), VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/ti_wilink_st.h>
#include <linux/wl12xx.h> #include <linux/wl12xx.h>
#include <linux/mmc/card.h> #include <linux/mmc/card.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
...@@ -144,53 +143,6 @@ static void __init omap3_sbc_t3530_legacy_init(void) ...@@ -144,53 +143,6 @@ static void __init omap3_sbc_t3530_legacy_init(void)
omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub"); omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
} }
static struct ti_st_plat_data wilink_pdata = {
.nshutdown_gpio = 137,
.dev_name = "/dev/ttyO1",
.flow_cntrl = 1,
.baud_rate = 300000,
};
static struct platform_device wl18xx_device = {
.name = "kim",
.id = -1,
.dev = {
.platform_data = &wilink_pdata,
}
};
static struct ti_st_plat_data wilink7_pdata = {
.nshutdown_gpio = 162,
.dev_name = "/dev/ttyO1",
.flow_cntrl = 1,
.baud_rate = 3000000,
};
static struct platform_device wl128x_device = {
.name = "kim",
.id = -1,
.dev = {
.platform_data = &wilink7_pdata,
}
};
static struct platform_device btwilink_device = {
.name = "btwilink",
.id = -1,
};
static void __init omap3_igep0020_rev_f_legacy_init(void)
{
platform_device_register(&wl18xx_device);
platform_device_register(&btwilink_device);
}
static void __init omap3_igep0030_rev_g_legacy_init(void)
{
platform_device_register(&wl18xx_device);
platform_device_register(&btwilink_device);
}
static void __init omap3_evm_legacy_init(void) static void __init omap3_evm_legacy_init(void)
{ {
hsmmc2_internal_input_clk(); hsmmc2_internal_input_clk();
...@@ -293,8 +245,6 @@ static void __init omap3_tao3530_legacy_init(void) ...@@ -293,8 +245,6 @@ static void __init omap3_tao3530_legacy_init(void)
static void __init omap3_logicpd_torpedo_init(void) static void __init omap3_logicpd_torpedo_init(void)
{ {
omap3_gpio126_127_129(); omap3_gpio126_127_129();
platform_device_register(&wl128x_device);
platform_device_register(&btwilink_device);
} }
/* omap3pandora legacy devices */ /* omap3pandora legacy devices */
...@@ -575,8 +525,6 @@ static struct pdata_init pdata_quirks[] __initdata = { ...@@ -575,8 +525,6 @@ static struct pdata_init pdata_quirks[] __initdata = {
{ "nokia,omap3-n900", nokia_n900_legacy_init, }, { "nokia,omap3-n900", nokia_n900_legacy_init, },
{ "nokia,omap3-n9", hsmmc2_internal_input_clk, }, { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
{ "nokia,omap3-n950", hsmmc2_internal_input_clk, }, { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
{ "logicpd,dm3730-torpedo-devkit", omap3_logicpd_torpedo_init, }, { "logicpd,dm3730-torpedo-devkit", omap3_logicpd_torpedo_init, },
{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
{ "ti,am3517-evm", am3517_evm_legacy_init, }, { "ti,am3517-evm", am3517_evm_legacy_init, },
......
...@@ -148,6 +148,7 @@ int __init omap2_common_pm_late_init(void) ...@@ -148,6 +148,7 @@ int __init omap2_common_pm_late_init(void)
/* Init the voltage layer */ /* Init the voltage layer */
omap3_twl_init(); omap3_twl_init();
omap4_twl_init(); omap4_twl_init();
omap4_cpcap_init();
omap_voltage_late_init(); omap_voltage_late_init();
/* Smartreflex device init */ /* Smartreflex device init */
......
...@@ -107,6 +107,11 @@ extern u16 pm44xx_errata; ...@@ -107,6 +107,11 @@ extern u16 pm44xx_errata;
#define IS_PM44XX_ERRATUM(id) 0 #define IS_PM44XX_ERRATUM(id) 0
#endif #endif
#define OMAP4_VP_CONFIG_ERROROFFSET 0x00
#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01
#define OMAP4_VP_VSTEPMAX_VSTEPMAX 0x04
#define OMAP4_VP_VLIMITTO_TIMEOUT_US 200
#ifdef CONFIG_POWER_AVS_OMAP #ifdef CONFIG_POWER_AVS_OMAP
extern int omap_devinit_smartreflex(void); extern int omap_devinit_smartreflex(void);
extern void omap_enable_smartreflex_on_init(void); extern void omap_enable_smartreflex_on_init(void);
...@@ -134,6 +139,15 @@ static inline int omap4_twl_init(void) ...@@ -134,6 +139,15 @@ static inline int omap4_twl_init(void)
} }
#endif #endif
#if IS_ENABLED(CONFIG_MFD_CPCAP)
extern int omap4_cpcap_init(void);
#else
static inline int omap4_cpcap_init(void)
{
return -EINVAL;
}
#endif
#ifdef CONFIG_PM #ifdef CONFIG_PM
extern void omap_pm_setup_oscillator(u32 tstart, u32 tshut); extern void omap_pm_setup_oscillator(u32 tstart, u32 tshut);
extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut); extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut);
......
...@@ -128,18 +128,9 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) ...@@ -128,18 +128,9 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
return 0; return 0;
} }
/*
* Bootloader or kexec boot may have LOGICRETSTATE cleared
* for some domains. This is the case when kexec booting from
* Android kernels that support off mode for example.
* Make sure it's set at least for core and per, otherwise
* we currently will see lost GPIO interrupts for wlcore and
* smsc911x at least if per hits retention during idle.
*/
if (!strncmp(pwrdm->name, "core", 4) || if (!strncmp(pwrdm->name, "core", 4) ||
!strncmp(pwrdm->name, "l4per", 5) || !strncmp(pwrdm->name, "l4per", 5))
!strncmp(pwrdm->name, "wkup", 4)) pwrdm_set_logic_retst(pwrdm, PWRDM_POWER_OFF);
pwrdm_set_logic_retst(pwrdm, PWRDM_POWER_RET);
pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
if (!pwrst) if (!pwrst)
......
// SPDX-License-Identifier: GPL-2.0-only
/*
* pmic-cpcap.c - CPCAP-specific functions for the OPP code
*
* Adapted from Motorola Mapphone Android Linux kernel
* Copyright (C) 2011 Motorola, Inc.
*/
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include "soc.h"
#include "pm.h"
#include "voltage.h"
#include <linux/init.h>
#include "vc.h"
/**
* omap_cpcap_vsel_to_vdc - convert CPCAP VSEL value to microvolts DC
* @vsel: CPCAP VSEL value to convert
*
* Returns the microvolts DC that the CPCAP PMIC should generate when
* programmed with @vsel.
*/
static unsigned long omap_cpcap_vsel_to_uv(unsigned char vsel)
{
if (vsel > 0x44)
vsel = 0x44;
return (((vsel * 125) + 6000)) * 100;
}
/**
* omap_cpcap_uv_to_vsel - convert microvolts DC to CPCAP VSEL value
* @uv: microvolts DC to convert
*
* Returns the VSEL value necessary for the CPCAP PMIC to
* generate an output voltage equal to or greater than @uv microvolts DC.
*/
static unsigned char omap_cpcap_uv_to_vsel(unsigned long uv)
{
if (uv < 600000)
uv = 600000;
else if (uv > 1450000)
uv = 1450000;
return DIV_ROUND_UP(uv - 600000, 12500);
}
static struct omap_voltdm_pmic omap_cpcap_core = {
.slew_rate = 4000,
.step_size = 12500,
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
.vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
.vddmin = 900000,
.vddmax = 1350000,
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
.i2c_slave_addr = 0x02,
.volt_reg_addr = 0x00,
.cmd_reg_addr = 0x01,
.i2c_high_speed = false,
.vsel_to_uv = omap_cpcap_vsel_to_uv,
.uv_to_vsel = omap_cpcap_uv_to_vsel,
};
static struct omap_voltdm_pmic omap_cpcap_iva = {
.slew_rate = 4000,
.step_size = 12500,
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
.vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
.vddmin = 900000,
.vddmax = 1350000,
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
.i2c_slave_addr = 0x44,
.volt_reg_addr = 0x0,
.cmd_reg_addr = 0x01,
.i2c_high_speed = false,
.vsel_to_uv = omap_cpcap_vsel_to_uv,
.uv_to_vsel = omap_cpcap_uv_to_vsel,
};
/**
* omap_max8952_vsel_to_vdc - convert MAX8952 VSEL value to microvolts DC
* @vsel: MAX8952 VSEL value to convert
*
* Returns the microvolts DC that the MAX8952 Regulator should generate when
* programmed with @vsel.
*/
static unsigned long omap_max8952_vsel_to_uv(unsigned char vsel)
{
if (vsel > 0x3F)
vsel = 0x3F;
return (((vsel * 100) + 7700)) * 100;
}
/**
* omap_max8952_uv_to_vsel - convert microvolts DC to MAX8952 VSEL value
* @uv: microvolts DC to convert
*
* Returns the VSEL value necessary for the MAX8952 Regulator to
* generate an output voltage equal to or greater than @uv microvolts DC.
*/
static unsigned char omap_max8952_uv_to_vsel(unsigned long uv)
{
if (uv < 770000)
uv = 770000;
else if (uv > 1400000)
uv = 1400000;
return DIV_ROUND_UP(uv - 770000, 10000);
}
static struct omap_voltdm_pmic omap443x_max8952_mpu = {
.slew_rate = 16000,
.step_size = 10000,
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
.vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
.vddmin = 900000,
.vddmax = 1400000,
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
.i2c_slave_addr = 0x60,
.volt_reg_addr = 0x03,
.cmd_reg_addr = 0x03,
.i2c_high_speed = false,
.vsel_to_uv = omap_max8952_vsel_to_uv,
.uv_to_vsel = omap_max8952_uv_to_vsel,
};
/**
* omap_fan5355_vsel_to_vdc - convert FAN535503 VSEL value to microvolts DC
* @vsel: FAN535503 VSEL value to convert
*
* Returns the microvolts DC that the FAN535503 Regulator should generate when
* programmed with @vsel.
*/
static unsigned long omap_fan535503_vsel_to_uv(unsigned char vsel)
{
/* Extract bits[5:0] */
vsel &= 0x3F;
return (((vsel * 125) + 7500)) * 100;
}
/**
* omap_fan535508_vsel_to_vdc - convert FAN535508 VSEL value to microvolts DC
* @vsel: FAN535508 VSEL value to convert
*
* Returns the microvolts DC that the FAN535508 Regulator should generate when
* programmed with @vsel.
*/
static unsigned long omap_fan535508_vsel_to_uv(unsigned char vsel)
{
/* Extract bits[5:0] */
vsel &= 0x3F;
if (vsel > 0x37)
vsel = 0x37;
return (((vsel * 125) + 7500)) * 100;
}
/**
* omap_fan535503_uv_to_vsel - convert microvolts DC to FAN535503 VSEL value
* @uv: microvolts DC to convert
*
* Returns the VSEL value necessary for the MAX8952 Regulator to
* generate an output voltage equal to or greater than @uv microvolts DC.
*/
static unsigned char omap_fan535503_uv_to_vsel(unsigned long uv)
{
unsigned char vsel;
if (uv < 750000)
uv = 750000;
else if (uv > 1537500)
uv = 1537500;
vsel = DIV_ROUND_UP(uv - 750000, 12500);
return vsel | 0xC0;
}
/**
* omap_fan535508_uv_to_vsel - convert microvolts DC to FAN535508 VSEL value
* @uv: microvolts DC to convert
*
* Returns the VSEL value necessary for the MAX8952 Regulator to
* generate an output voltage equal to or greater than @uv microvolts DC.
*/
static unsigned char omap_fan535508_uv_to_vsel(unsigned long uv)
{
unsigned char vsel;
if (uv < 750000)
uv = 750000;
else if (uv > 1437500)
uv = 1437500;
vsel = DIV_ROUND_UP(uv - 750000, 12500);
return vsel | 0xC0;
}
/* fan5335-core */
static struct omap_voltdm_pmic omap4_fan_core = {
.slew_rate = 4000,
.step_size = 12500,
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
.vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
.vddmin = 850000,
.vddmax = 1375000,
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
.i2c_slave_addr = 0x4A,
.i2c_high_speed = false,
.volt_reg_addr = 0x01,
.cmd_reg_addr = 0x01,
.vsel_to_uv = omap_fan535508_vsel_to_uv,
.uv_to_vsel = omap_fan535508_uv_to_vsel,
};
/* fan5335 iva */
static struct omap_voltdm_pmic omap4_fan_iva = {
.slew_rate = 4000,
.step_size = 12500,
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
.vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
.vddmin = 850000,
.vddmax = 1375000,
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
.i2c_slave_addr = 0x48,
.volt_reg_addr = 0x01,
.cmd_reg_addr = 0x01,
.i2c_high_speed = false,
.vsel_to_uv = omap_fan535503_vsel_to_uv,
.uv_to_vsel = omap_fan535503_uv_to_vsel,
};
int __init omap4_cpcap_init(void)
{
struct voltagedomain *voltdm;
if (!of_find_compatible_node(NULL, NULL, "motorola,cpcap"))
return -ENODEV;
voltdm = voltdm_lookup("mpu");
omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu);
if (of_machine_is_compatible("motorola,droid-bionic")) {
voltdm = voltdm_lookup("mpu");
omap_voltage_register_pmic(voltdm, &omap_cpcap_core);
voltdm = voltdm_lookup("mpu");
omap_voltage_register_pmic(voltdm, &omap_cpcap_iva);
} else {
voltdm = voltdm_lookup("core");
omap_voltage_register_pmic(voltdm, &omap4_fan_core);
voltdm = voltdm_lookup("iva");
omap_voltage_register_pmic(voltdm, &omap4_fan_iva);
}
return 0;
}
static int __init cpcap_late_init(void)
{
omap4_vc_set_pmic_signaling(PWRDM_POWER_RET);
return 0;
}
omap_late_initcall(cpcap_late_init);
...@@ -745,7 +745,7 @@ struct pwrdm_ops omap4_pwrdm_operations = { ...@@ -745,7 +745,7 @@ struct pwrdm_ops omap4_pwrdm_operations = {
static int omap44xx_prm_late_init(void); static int omap44xx_prm_late_init(void);
void prm_save_context(void) static void prm_save_context(void)
{ {
omap_prm_context.irq_enable = omap_prm_context.irq_enable =
omap4_prm_read_inst_reg(AM43XX_PRM_OCP_SOCKET_INST, omap4_prm_read_inst_reg(AM43XX_PRM_OCP_SOCKET_INST,
...@@ -756,7 +756,7 @@ void prm_save_context(void) ...@@ -756,7 +756,7 @@ void prm_save_context(void)
omap4_prcm_irq_setup.pm_ctrl); omap4_prcm_irq_setup.pm_ctrl);
} }
void prm_restore_context(void) static void prm_restore_context(void)
{ {
omap4_prm_write_inst_reg(omap_prm_context.irq_enable, omap4_prm_write_inst_reg(omap_prm_context.irq_enable,
OMAP4430_PRM_OCP_SOCKET_INST, OMAP4430_PRM_OCP_SOCKET_INST,
......
...@@ -26,6 +26,31 @@ ...@@ -26,6 +26,31 @@
#include "scrm44xx.h" #include "scrm44xx.h"
#include "control.h" #include "control.h"
#define OMAP4430_VDD_IVA_I2C_DISABLE BIT(14)
#define OMAP4430_VDD_MPU_I2C_DISABLE BIT(13)
#define OMAP4430_VDD_CORE_I2C_DISABLE BIT(12)
#define OMAP4430_VDD_IVA_PRESENCE BIT(9)
#define OMAP4430_VDD_MPU_PRESENCE BIT(8)
#define OMAP4430_AUTO_CTRL_VDD_IVA(x) ((x) << 4)
#define OMAP4430_AUTO_CTRL_VDD_MPU(x) ((x) << 2)
#define OMAP4430_AUTO_CTRL_VDD_CORE(x) ((x) << 0)
#define OMAP4430_AUTO_CTRL_VDD_RET 2
#define OMAP4430_VDD_I2C_DISABLE_MASK \
(OMAP4430_VDD_IVA_I2C_DISABLE | \
OMAP4430_VDD_MPU_I2C_DISABLE | \
OMAP4430_VDD_CORE_I2C_DISABLE)
#define OMAP4_VDD_DEFAULT_VAL \
(OMAP4430_VDD_I2C_DISABLE_MASK | \
OMAP4430_VDD_IVA_PRESENCE | OMAP4430_VDD_MPU_PRESENCE | \
OMAP4430_AUTO_CTRL_VDD_IVA(OMAP4430_AUTO_CTRL_VDD_RET) | \
OMAP4430_AUTO_CTRL_VDD_MPU(OMAP4430_AUTO_CTRL_VDD_RET) | \
OMAP4430_AUTO_CTRL_VDD_CORE(OMAP4430_AUTO_CTRL_VDD_RET))
#define OMAP4_VDD_RET_VAL \
(OMAP4_VDD_DEFAULT_VAL & ~OMAP4430_VDD_I2C_DISABLE_MASK)
/** /**
* struct omap_vc_channel_cfg - describe the cfg_channel bitfield * struct omap_vc_channel_cfg - describe the cfg_channel bitfield
* @sa: bit for slave address * @sa: bit for slave address
...@@ -280,6 +305,26 @@ void omap3_vc_set_pmic_signaling(int core_next_state) ...@@ -280,6 +305,26 @@ void omap3_vc_set_pmic_signaling(int core_next_state)
} }
} }
void omap4_vc_set_pmic_signaling(int core_next_state)
{
struct voltagedomain *vd = vc.vd;
u32 val;
if (!vd)
return;
switch (core_next_state) {
case PWRDM_POWER_RET:
val = OMAP4_VDD_RET_VAL;
break;
default:
val = OMAP4_VDD_DEFAULT_VAL;
break;
}
vd->write(val, OMAP4_PRM_VOLTCTRL_OFFSET);
}
/* /*
* Configure signal polarity for sys_clkreq and sys_off_mode pins * Configure signal polarity for sys_clkreq and sys_off_mode pins
* as the default values are wrong and can cause the system to hang * as the default values are wrong and can cause the system to hang
...@@ -542,9 +587,19 @@ static void omap4_set_timings(struct voltagedomain *voltdm, bool off_mode) ...@@ -542,9 +587,19 @@ static void omap4_set_timings(struct voltagedomain *voltdm, bool off_mode)
writel_relaxed(val, OMAP4_SCRM_CLKSETUPTIME); writel_relaxed(val, OMAP4_SCRM_CLKSETUPTIME);
} }
static void __init omap4_vc_init_pmic_signaling(struct voltagedomain *voltdm)
{
if (vc.vd)
return;
vc.vd = voltdm;
voltdm->write(OMAP4_VDD_DEFAULT_VAL, OMAP4_PRM_VOLTCTRL_OFFSET);
}
/* OMAP4 specific voltage init functions */ /* OMAP4 specific voltage init functions */
static void __init omap4_vc_init_channel(struct voltagedomain *voltdm) static void __init omap4_vc_init_channel(struct voltagedomain *voltdm)
{ {
omap4_vc_init_pmic_signaling(voltdm);
omap4_set_timings(voltdm, true); omap4_set_timings(voltdm, true);
omap4_set_timings(voltdm, false); omap4_set_timings(voltdm, false);
} }
...@@ -615,7 +670,7 @@ static void __init omap4_vc_i2c_timing_init(struct voltagedomain *voltdm) ...@@ -615,7 +670,7 @@ static void __init omap4_vc_i2c_timing_init(struct voltagedomain *voltdm)
const struct i2c_init_data *i2c_data; const struct i2c_init_data *i2c_data;
if (!voltdm->pmic->i2c_high_speed) { if (!voltdm->pmic->i2c_high_speed) {
pr_warn("%s: only high speed supported!\n", __func__); pr_info("%s: using bootloader low-speed timings\n", __func__);
return; return;
} }
......
...@@ -117,7 +117,7 @@ extern struct omap_vc_param omap4_iva_vc_data; ...@@ -117,7 +117,7 @@ extern struct omap_vc_param omap4_iva_vc_data;
extern struct omap_vc_param omap4_core_vc_data; extern struct omap_vc_param omap4_core_vc_data;
void omap3_vc_set_pmic_signaling(int core_next_state); void omap3_vc_set_pmic_signaling(int core_next_state);
void omap4_vc_set_pmic_signaling(int core_next_state);
void omap_vc_init_channel(struct voltagedomain *voltdm); void omap_vc_init_channel(struct voltagedomain *voltdm);
int omap_vc_pre_scale(struct voltagedomain *voltdm, int omap_vc_pre_scale(struct voltagedomain *voltdm,
......
...@@ -113,7 +113,7 @@ void __init s3c2416_map_io(void) ...@@ -113,7 +113,7 @@ void __init s3c2416_map_io(void)
/* initialize device information early */ /* initialize device information early */
s3c2416_default_sdhci0(); s3c2416_default_sdhci0();
s3c2416_default_sdhci1(); s3c2416_default_sdhci1();
s3c64xx_spi_setname("s3c2443-spi"); s3c24xx_spi_setname("s3c2443-spi");
iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
} }
......
...@@ -91,7 +91,7 @@ void __init s3c2443_map_io(void) ...@@ -91,7 +91,7 @@ void __init s3c2443_map_io(void)
s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
/* initialize device information early */ /* initialize device information early */
s3c64xx_spi_setname("s3c2443-spi"); s3c24xx_spi_setname("s3c2443-spi");
iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
/* re-define device name depending on support. */ /* re-define device name depending on support. */
static inline void s3c64xx_spi_setname(char *name) static inline void s3c24xx_spi_setname(char *name)
{ {
#ifdef CONFIG_S3C64XX_DEV_SPI0 #ifdef CONFIG_S3C64XX_DEV_SPI0
s3c64xx_device_spi0.name = name; s3c64xx_device_spi0.name = name;
......
...@@ -73,7 +73,7 @@ static int s3c_usb_otgphy_exit(struct platform_device *pdev) ...@@ -73,7 +73,7 @@ static int s3c_usb_otgphy_exit(struct platform_device *pdev)
return 0; return 0;
} }
int s5p_usb_phy_init(struct platform_device *pdev, int type) int s3c_usb_phy_init(struct platform_device *pdev, int type)
{ {
if (type == USB_PHY_TYPE_DEVICE) if (type == USB_PHY_TYPE_DEVICE)
return s3c_usb_otgphy_init(pdev); return s3c_usb_otgphy_init(pdev);
...@@ -81,7 +81,7 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type) ...@@ -81,7 +81,7 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type)
return -EINVAL; return -EINVAL;
} }
int s5p_usb_phy_exit(struct platform_device *pdev, int type) int s3c_usb_phy_exit(struct platform_device *pdev, int type)
{ {
if (type == USB_PHY_TYPE_DEVICE) if (type == USB_PHY_TYPE_DEVICE)
return s3c_usb_otgphy_exit(pdev); return s3c_usb_otgphy_exit(pdev);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "rcar-gen2.h" #include "rcar-gen2.h"
static const struct of_device_id cpg_matches[] __initconst = { static const struct of_device_id cpg_matches[] __initconst = {
{ .compatible = "renesas,rcar-gen2-cpg-clocks", },
{ .compatible = "renesas,r8a7743-cpg-mssr", .data = "extal" }, { .compatible = "renesas,r8a7743-cpg-mssr", .data = "extal" },
{ .compatible = "renesas,r8a7744-cpg-mssr", .data = "extal" }, { .compatible = "renesas,r8a7744-cpg-mssr", .data = "extal" },
{ .compatible = "renesas,r8a7790-cpg-mssr", .data = "extal" }, { .compatible = "renesas,r8a7790-cpg-mssr", .data = "extal" },
......
...@@ -44,16 +44,16 @@ ENTRY(tegra_resume) ...@@ -44,16 +44,16 @@ ENTRY(tegra_resume)
cmp r6, #TEGRA20 cmp r6, #TEGRA20
beq 1f @ Yes beq 1f @ Yes
/* Clear the flow controller flags for this CPU. */ /* Clear the flow controller flags for this CPU. */
cpu_to_csr_reg r1, r0 cpu_to_csr_reg r3, r0
mov32 r2, TEGRA_FLOW_CTRL_BASE mov32 r2, TEGRA_FLOW_CTRL_BASE
ldr r1, [r2, r1] ldr r1, [r2, r3]
/* Clear event & intr flag */ /* Clear event & intr flag */
orr r1, r1, \ orr r1, r1, \
#FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
movw r0, #0x3FFD @ enable, cluster_switch, immed, bitmaps movw r0, #0x3FFD @ enable, cluster_switch, immed, bitmaps
@ & ext flags for CPU power mgnt @ & ext flags for CPU power mgnt
bic r1, r1, r0 bic r1, r1, r0
str r1, [r2] str r1, [r2, r3]
1: 1:
mov32 r9, 0xc09 mov32 r9, 0xc09
......
...@@ -682,10 +682,12 @@ tegra30_enter_sleep: ...@@ -682,10 +682,12 @@ tegra30_enter_sleep:
dsb dsb
ldr r0, [r6, r2] /* memory barrier */ ldr r0, [r6, r2] /* memory barrier */
cmp r10, #TEGRA30
halted: halted:
isb isb
dsb dsb
wfi /* CPU should be power gated here */ wfine /* CPU should be power gated here */
wfeeq
/* !!!FIXME!!! Implement halt failure handler */ /* !!!FIXME!!! Implement halt failure handler */
b halted b halted
......
...@@ -1044,7 +1044,7 @@ endif ...@@ -1044,7 +1044,7 @@ endif
config CACHE_TAUROS2 config CACHE_TAUROS2
bool "Enable the Tauros2 L2 cache controller" bool "Enable the Tauros2 L2 cache controller"
depends on (ARCH_DOVE || ARCH_MMP || CPU_PJ4) depends on (CPU_MOHAWK || CPU_PJ4)
default y default y
select OUTER_CACHE select OUTER_CACHE
help help
......
...@@ -1010,9 +1010,9 @@ void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd) ...@@ -1010,9 +1010,9 @@ void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd)
npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg); npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg);
if (!npd->phy_init) if (!npd->phy_init)
npd->phy_init = s5p_usb_phy_init; npd->phy_init = s3c_usb_phy_init;
if (!npd->phy_exit) if (!npd->phy_exit)
npd->phy_exit = s5p_usb_phy_exit; npd->phy_exit = s3c_usb_phy_exit;
} }
#endif /* CONFIG_S3C_DEV_USB_HSOTG */ #endif /* CONFIG_S3C_DEV_USB_HSOTG */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef __PLAT_SAMSUNG_USB_PHY_H #ifndef __PLAT_SAMSUNG_USB_PHY_H
#define __PLAT_SAMSUNG_USB_PHY_H __FILE__ #define __PLAT_SAMSUNG_USB_PHY_H __FILE__
extern int s5p_usb_phy_init(struct platform_device *pdev, int type); extern int s3c_usb_phy_init(struct platform_device *pdev, int type);
extern int s5p_usb_phy_exit(struct platform_device *pdev, int type); extern int s3c_usb_phy_exit(struct platform_device *pdev, int type);
#endif /* __PLAT_SAMSUNG_USB_PHY_H */ #endif /* __PLAT_SAMSUNG_USB_PHY_H */
...@@ -37,11 +37,12 @@ config ARCH_BCM2835 ...@@ -37,11 +37,12 @@ config ARCH_BCM2835
select PINCTRL select PINCTRL
select PINCTRL_BCM2835 select PINCTRL_BCM2835
select ARM_AMBA select ARM_AMBA
select ARM_GIC
select ARM_TIMER_SP804 select ARM_TIMER_SP804
select HAVE_ARM_ARCH_TIMER select HAVE_ARM_ARCH_TIMER
help help
This enables support for the Broadcom BCM2837 SoC. This enables support for the Broadcom BCM2837 and BCM2711 SoC.
This SoC is used in the Raspberry Pi 3 device. These SoCs are used in the Raspberry Pi 3 and 4 devices.
config ARCH_BCM_IPROC config ARCH_BCM_IPROC
bool "Broadcom iProc SoC Family" bool "Broadcom iProc SoC Family"
...@@ -188,6 +189,7 @@ config ARCH_QCOM ...@@ -188,6 +189,7 @@ config ARCH_QCOM
config ARCH_REALTEK config ARCH_REALTEK
bool "Realtek Platforms" bool "Realtek Platforms"
select RESET_CONTROLLER
help help
This enables support for the ARMv8 based Realtek chipsets, This enables support for the ARMv8 based Realtek chipsets,
like the RTD1295. like the RTD1295.
...@@ -212,6 +214,11 @@ config ARCH_ROCKCHIP ...@@ -212,6 +214,11 @@ config ARCH_ROCKCHIP
This enables support for the ARMv8 based Rockchip chipsets, This enables support for the ARMv8 based Rockchip chipsets,
like the RK3368. like the RK3368.
config ARCH_S32
bool "NXP S32 SoC Family"
help
This enables support for the NXP S32 family of processors.
config ARCH_SEATTLE config ARCH_SEATTLE
bool "AMD Seattle SoC Family" bool "AMD Seattle SoC Family"
help help
......
...@@ -299,6 +299,11 @@ config COMMON_CLK_STM32H7 ...@@ -299,6 +299,11 @@ config COMMON_CLK_STM32H7
help help
Support for stm32h7 SoC family clocks Support for stm32h7 SoC family clocks
config COMMON_CLK_MMP2
def_bool COMMON_CLK && (MACH_MMP2_DT || MACH_MMP3_DT)
help
Support for Marvell MMP2 and MMP3 SoC clocks
config COMMON_CLK_BD718XX config COMMON_CLK_BD718XX
tristate "Clock driver for ROHM BD718x7 PMIC" tristate "Clock driver for ROHM BD718x7 PMIC"
depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528 depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528
......
...@@ -8,7 +8,7 @@ obj-y += clk-apbc.o clk-apmu.o clk-frac.o clk-mix.o clk-gate.o clk.o ...@@ -8,7 +8,7 @@ obj-y += clk-apbc.o clk-apmu.o clk-frac.o clk-mix.o clk-gate.o clk.o
obj-$(CONFIG_RESET_CONTROLLER) += reset.o obj-$(CONFIG_RESET_CONTROLLER) += reset.o
obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
obj-$(CONFIG_MACH_MMP2_DT) += clk-of-mmp2.o obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o
obj-$(CONFIG_CPU_PXA168) += clk-pxa168.o obj-$(CONFIG_CPU_PXA168) += clk-pxa168.o
obj-$(CONFIG_CPU_PXA910) += clk-pxa910.o obj-$(CONFIG_CPU_PXA910) += clk-pxa910.o
......
...@@ -91,8 +91,23 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid) ...@@ -91,8 +91,23 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
/* clear wfi bitmap */ /* clear wfi bitmap */
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
/* pwr gating on wfi */
reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid; if (tegra_get_chip_id() == TEGRA30) {
/*
* The wfi doesn't work well on Tegra30 because
* CPU hangs under some odd circumstances after
* power-gating (like memory running off PLLP),
* hence use wfe that is working perfectly fine.
* Note that Tegra30 TRM doc clearly stands that
* wfi should be used for the "Cluster Switching",
* while wfe for the power-gating, just like it
* is done on Tegra20.
*/
reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
} else {
/* pwr gating on wfi */
reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
}
break; break;
} }
reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* MMP2 Z0 0x560f5811 0x00F00410 * MMP2 Z0 0x560f5811 0x00F00410
* MMP2 Z1 0x560f5811 0x00E00410 * MMP2 Z1 0x560f5811 0x00E00410
* MMP2 A0 0x560f5811 0x00A0A610 * MMP2 A0 0x560f5811 0x00A0A610
* MMP3 A0 0x562f5842 0x00A02128
* MMP3 B0 0x562f5842 0x00B02128
*/ */
extern unsigned int mmp_chip_id; extern unsigned int mmp_chip_id;
...@@ -55,4 +57,29 @@ static inline int cpu_is_mmp2(void) ...@@ -55,4 +57,29 @@ static inline int cpu_is_mmp2(void)
#define cpu_is_mmp2() (0) #define cpu_is_mmp2() (0)
#endif #endif
#ifdef CONFIG_MACH_MMP3_DT
static inline int cpu_is_mmp3(void)
{
return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
((mmp_chip_id & 0xffff) == 0x2128);
}
static inline int cpu_is_mmp3_a0(void)
{
return (cpu_is_mmp3() &&
((mmp_chip_id & 0x00ff0000) == 0x00a00000));
}
static inline int cpu_is_mmp3_b0(void)
{
return (cpu_is_mmp3() &&
((mmp_chip_id & 0x00ff0000) == 0x00b00000));
}
#else
#define cpu_is_mmp3() (0)
#define cpu_is_mmp3_a0() (0)
#define cpu_is_mmp3_b0() (0)
#endif
#endif /* __ASM_MACH_CPUTYPE_H */ #endif /* __ASM_MACH_CPUTYPE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment