lkml.org 
[lkml]   [2010]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 20/21] ARM: tegra: Allow overriding arch_reset
On Sun, Dec 05, 2010 at 03:09:07PM -0800, Colin Cross wrote:
> diff --git a/arch/arm/mach-tegra/include/mach/system.h b/arch/arm/mach-tegra/include/mach/system.h
> index 84d5d46..70c95ac 100644
> --- a/arch/arm/mach-tegra/include/mach/system.h
> +++ b/arch/arm/mach-tegra/include/mach/system.h
> @@ -24,16 +24,30 @@
> #include <mach/hardware.h>
> #include <mach/iomap.h>
>
> +extern void (*tegra_reset)(char mode, const char *cmd);
> +
> static inline void arch_idle(void)
> {
> }
>
> -static inline void arch_reset(char mode, const char *cmd)
> +static inline void tegra_assert_system_reset(void)
> {
> void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
> - u32 reg = readl(reset);
> + u32 reg;
> +
> + reg = readl(reset);
> reg |= 0x04;
> writel(reg, reset);
> }
>
> +static inline void arch_reset(char mode, const char *cmd)
> +{
> + if (tegra_reset)
> + tegra_reset(mode, cmd);
> + else
> + tegra_assert_system_reset();
> +
> + do { } while (1);
> +}
> +

How about:

extern void (*arch_reset)(char mode, const char *cmd);

and then in a tegra private .c file:

static void tegra_assert_system_reset(char mode, const char *cmd)
{
...
}

void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;


\
 
 \ /
  Last update: 2010-12-06 00:43    [W:0.027 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site