]> git.sur5r.net Git - u-boot/commitdiff
tegra: tegra124: Add a PMC syscon driver
authorSimon Glass <sjg@chromium.org>
Tue, 25 Jul 2017 14:29:58 +0000 (08:29 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 28 Jul 2017 18:02:47 +0000 (12:02 -0600)
The PMC can be modelled as a syscon peripheral. Add a driver for this
so that it can be accessed by drivers when needed. Enable it for tegra124
boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1
Tested-by: Stephen Warren <swarren@nvidia.com>
arch/arm/include/asm/arch-tegra/tegra.h
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/tegra124/Makefile
arch/arm/mach-tegra/tegra124/pmc.c [new file with mode: 0644]

index 3add1b3c09bbdf63b8508e584a467c44340bc2a3..3b9711d28ef1088868cd3964d8924f4e8605266b 100644 (file)
@@ -97,6 +97,11 @@ enum {
        TEGRA_SOC_UNKNOWN       = -1,
 };
 
+/* Tegra system controller (SYSCON) devices */
+enum {
+       TEGRA_SYSCON_PMC,
+};
+
 #else  /* __ASSEMBLY__ */
 #define PRM_RSTCTRL            NV_PA_PMC_BASE
 #endif
index 48387589d5de0e050fcb23b9352a0b1040aa9238..58085dc0a36b8f5eec3fe276db78f23eaa3a5dd1 100644 (file)
@@ -88,6 +88,8 @@ config TEGRA124
        bool "Tegra124 family"
        select TEGRA_ARMV7_COMMON
        imply ENV_IS_IN_MMC
+       imply REGMAP
+       imply SYSCON
 
 config TEGRA210
        bool "Tegra210 family"
index c00de6151e2d97d4d39302b646c908871caa63e5..d275dafdc4f85a5f754d23bd70be1f230e7f09b0 100644 (file)
@@ -10,6 +10,7 @@ obj-$(CONFIG_SPL_BUILD) += cpu.o
 obj-y  += clock.o
 obj-y  += funcmux.o
 obj-y  += pinmux.o
+obj-y  += pmc.o
 obj-y  += xusb-padctl.o
 obj-y  += ../xusb-padctl-common.o
 
diff --git a/arch/arm/mach-tegra/tegra124/pmc.c b/arch/arm/mach-tegra/tegra124/pmc.c
new file mode 100644 (file)
index 0000000..be82acf
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <syscon.h>
+
+static const struct udevice_id tegra124_syscon_ids[] = {
+       { .compatible = "nvidia,tegra124-pmc", .data = TEGRA_SYSCON_PMC },
+};
+
+U_BOOT_DRIVER(syscon_tegra124) = {
+       .name = "tegra124_syscon",
+       .id = UCLASS_SYSCON,
+       .of_match = tegra124_syscon_ids,
+};