From f82e939fb75ad01da8f0d3024fc678111ddb4ac7 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Wed, 4 Mar 2009 16:21:33 +0100 Subject: xtensa: platform: s6105 Support for the S6105 IP Camera Reference Design Kit. Signed-off-by: Johannes Weiner Signed-off-by: Oskar Schirmer Signed-off-by: Chris Zankel --- arch/xtensa/platforms/s6105/setup.c | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 arch/xtensa/platforms/s6105/setup.c (limited to 'arch/xtensa/platforms/s6105/setup.c') diff --git a/arch/xtensa/platforms/s6105/setup.c b/arch/xtensa/platforms/s6105/setup.c new file mode 100644 index 00000000000..ae041d5027a --- /dev/null +++ b/arch/xtensa/platforms/s6105/setup.c @@ -0,0 +1,61 @@ +/* + * s6105 control routines + * + * Copyright (c) 2009 emlix GmbH + */ +#include +#include +#include + +#include + +#include +#include + +void platform_halt(void) +{ + local_irq_disable(); + while (1) + ; +} + +void platform_power_off(void) +{ + platform_halt(); +} + +void platform_restart(void) +{ + platform_halt(); +} + +void __init platform_setup(char **cmdline) +{ + unsigned long reg; + + reg = readl(S6_REG_GREG1 + S6_GREG1_CLKGATE); + reg &= ~(1 << S6_GREG1_BLOCK_SB); + writel(reg, S6_REG_GREG1 + S6_GREG1_CLKGATE); + + reg = readl(S6_REG_GREG1 + S6_GREG1_BLOCKENA); + reg |= 1 << S6_GREG1_BLOCK_SB; + writel(reg, S6_REG_GREG1 + S6_GREG1_BLOCKENA); + + printk(KERN_NOTICE "S6105 on Stretch S6000 - " + "Copyright (C) 2009 emlix GmbH \n"); +} + +void __init platform_init(bp_tag_t *first) +{ + gpio_request(GPIO_LED1_NGREEN, "led1_green"); + gpio_request(GPIO_LED1_RED, "led1_red"); + gpio_direction_output(GPIO_LED1_NGREEN, 1); +} + +void platform_heartbeat(void) +{ + static unsigned int c; + + if (!(++c & 0x4F)) + gpio_direction_output(GPIO_LED1_RED, !(c & 0x10)); +} -- cgit v1.2.3