]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: OMAP2+: control: new APIs to configure boot address and mode
authorOmar Ramirez Luna <omar.luna@linaro.org>
Mon, 18 Jun 2012 22:18:09 +0000 (16:18 -0600)
committerPaul Walmsley <paul@pwsan.com>
Mon, 18 Jun 2012 22:18:09 +0000 (16:18 -0600)
SCM contains boot addr and boot mode registers to control
other processors on different OMAP versions. It controls the
boot address and mode for DSP based subsystems like: IVA 2.1
(OMAP2430), IVA 2.2 (OMAP3) and DSP (OMAP4).

If contained within SCM registers, when a processor is
booting it uses BOOTADDR to start running the code at that
location. BOOTMOD register specifies a different set of
modes for the processor to execute when booting (from direct,
idle, self-loop, user and default).

Since there was no offset associated with OMAP4, this patch
defines it.

Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/control.h
arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h

index 08e674bb04171c2e6b81d97be51a7cab6e697d0c..3223b81e75327afb3af4ca47f88e69a744ac372e 100644 (file)
@@ -241,6 +241,49 @@ void omap3_ctrl_write_boot_mode(u8 bootmode)
 
 #endif
 
+/**
+ * omap_ctrl_write_dsp_boot_addr - set boot address for a remote processor
+ * @bootaddr: physical address of the boot loader
+ *
+ * Set boot address for the boot loader of a supported processor
+ * when a power ON sequence occurs.
+ */
+void omap_ctrl_write_dsp_boot_addr(u32 bootaddr)
+{
+       u32 offset = cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTADDR :
+                    cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTADDR :
+                    cpu_is_omap44xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR :
+                    0;
+
+       if (!offset) {
+               pr_err("%s: unsupported omap type\n", __func__);
+               return;
+       }
+
+       omap_ctrl_writel(bootaddr, offset);
+}
+
+/**
+ * omap_ctrl_write_dsp_boot_mode - set boot mode for a remote processor
+ * @bootmode: 8-bit value to pass to some boot code
+ *
+ * Sets boot mode for the boot loader of a supported processor
+ * when a power ON sequence occurs.
+ */
+void omap_ctrl_write_dsp_boot_mode(u8 bootmode)
+{
+       u32 offset = cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTMOD :
+                    cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTMOD :
+                    0;
+
+       if (!offset) {
+               pr_err("%s: unsupported omap type\n", __func__);
+               return;
+       }
+
+       omap_ctrl_writel(bootmode, offset);
+}
+
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 /*
  * Clears the scratchpad contents in case of cold boot-
index a406fd045ce13e18649b488a663cc21c6520a415..fcc98f822d9d3e932c03521ab9c8a107c960b0c8 100644 (file)
@@ -397,6 +397,8 @@ extern u32 omap3_arm_context[128];
 extern void omap3_control_save_context(void);
 extern void omap3_control_restore_context(void);
 extern void omap3_ctrl_write_boot_mode(u8 bootmode);
+extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
+extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
 extern void omap3630_ctrl_disable_rta(void);
 extern int omap3_ctrl_save_padconf(void);
 #else
index 2f7ac70a20d8f8ae8df8094ee75f818d0bf596e5..01970824e0e5d7a7773b49fd321b406d42c971dd 100644 (file)
@@ -42,6 +42,7 @@
 #define OMAP4_CTRL_MODULE_CORE_STD_FUSE_OPP_DPLL_1             0x0268
 #define OMAP4_CTRL_MODULE_CORE_STATUS                          0x02c4
 #define OMAP4_CTRL_MODULE_CORE_DEV_CONF                                0x0300
+#define OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR                    0x0304
 #define OMAP4_CTRL_MODULE_CORE_LDOVBB_IVA_VOLTAGE_CTRL         0x0314
 #define OMAP4_CTRL_MODULE_CORE_LDOVBB_MPU_VOLTAGE_CTRL         0x0318
 #define OMAP4_CTRL_MODULE_CORE_LDOSRAM_IVA_VOLTAGE_CTRL                0x0320