From 9dc5cea2b278ff544d3bb436008f867ec2eae2a5 Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Tue, 21 Dec 2010 20:01:21 -0700 Subject: [PATCH] --- yaml --- r: 226601 b: refs/heads/master c: 166353bd75587a2158d713af1b9489a79e0ce297 h: refs/heads/master i: 226599: 58e2d2397a9793ddb3a8ea154c40983086dacda6 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-omap2/control.c | 31 +++++++++++++++++++++++++++++ trunk/arch/arm/mach-omap2/control.h | 1 + trunk/arch/arm/mach-omap2/prcm.c | 10 +--------- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 3393c237ca95..5c07b15cee45 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dc0b3a701499bb7727314d7a9c764f7486db4802 +refs/heads/master: 166353bd75587a2158d713af1b9489a79e0ce297 diff --git a/trunk/arch/arm/mach-omap2/control.c b/trunk/arch/arm/mach-omap2/control.c index 0269bb055b69..d058f7c3ec6a 100644 --- a/trunk/arch/arm/mach-omap2/control.c +++ b/trunk/arch/arm/mach-omap2/control.c @@ -209,6 +209,37 @@ void omap4_ctrl_pad_writel(u32 val, u16 offset) __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset)); } +#ifdef CONFIG_ARCH_OMAP3 + +/** + * omap3_ctrl_write_boot_mode - set scratchpad boot mode for the next boot + * @bootmode: 8-bit value to pass to some boot code + * + * Set the bootmode in the scratchpad RAM. This is used after the + * system restarts. Not sure what actually uses this - it may be the + * bootloader, rather than the boot ROM - contrary to the preserved + * comment below. No return value. + */ +void omap3_ctrl_write_boot_mode(u8 bootmode) +{ + u32 l; + + l = ('B' << 24) | ('M' << 16) | bootmode; + + /* + * Reserve the first word in scratchpad for communicating + * with the boot ROM. A pointer to a data structure + * describing the boot process can be stored there, + * cf. OMAP34xx TRM, Initialization / Software Booting + * Configuration. + * + * XXX This should use some omap_ctrl_writel()-type function + */ + __raw_writel(l, OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD + 4)); +} + +#endif + #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) /* * Clears the scratchpad contents in case of cold boot- diff --git a/trunk/arch/arm/mach-omap2/control.h b/trunk/arch/arm/mach-omap2/control.h index 6e5f7e512ff7..4bfc1f0d974c 100644 --- a/trunk/arch/arm/mach-omap2/control.h +++ b/trunk/arch/arm/mach-omap2/control.h @@ -357,6 +357,7 @@ extern u32 *get_omap3630_restore_pointer(void); 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 omap3630_ctrl_disable_rta(void); #else #define omap_ctrl_base_get() 0 diff --git a/trunk/arch/arm/mach-omap2/prcm.c b/trunk/arch/arm/mach-omap2/prcm.c index a51846e3a6fa..2eca8475d396 100644 --- a/trunk/arch/arm/mach-omap2/prcm.c +++ b/trunk/arch/arm/mach-omap2/prcm.c @@ -143,16 +143,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd) prcm_offs = WKUP_MOD; } else if (cpu_is_omap34xx()) { - u32 l; - prcm_offs = OMAP3430_GR_MOD; - l = ('B' << 24) | ('M' << 16) | (cmd ? (u8)*cmd : 0); - /* Reserve the first word in scratchpad for communicating - * with the boot ROM. A pointer to a data structure - * describing the boot process can be stored there, - * cf. OMAP34xx TRM, Initialization / Software Booting - * Configuration. */ - omap_writel(l, OMAP343X_SCRATCHPAD + 4); + omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0)); } else if (cpu_is_omap44xx()) prcm_offs = OMAP4430_PRM_DEVICE_MOD; else