2 * s6105 control routines
4 * Copyright (c) 2009 emlix GmbH
8 #include <linux/gpio.h>
10 #include <asm/bootparam.h>
12 #include <variant/hardware.h>
13 #include <platform/gpio.h>
15 void platform_halt(void)
22 void platform_power_off(void)
27 void platform_restart(void)
32 void __init platform_setup(char **cmdline)
36 reg = readl(S6_REG_GREG1 + S6_GREG1_CLKGATE);
37 reg &= ~(1 << S6_GREG1_BLOCK_SB);
38 writel(reg, S6_REG_GREG1 + S6_GREG1_CLKGATE);
40 reg = readl(S6_REG_GREG1 + S6_GREG1_BLOCKENA);
41 reg |= 1 << S6_GREG1_BLOCK_SB;
42 writel(reg, S6_REG_GREG1 + S6_GREG1_BLOCKENA);
44 printk(KERN_NOTICE "S6105 on Stretch S6000 - "
45 "Copyright (C) 2009 emlix GmbH <info@emlix.com>\n");
48 void __init platform_init(bp_tag_t *first)
50 gpio_request(GPIO_LED1_NGREEN, "led1_green");
51 gpio_request(GPIO_LED1_RED, "led1_red");
52 gpio_direction_output(GPIO_LED1_NGREEN, 1);
55 void platform_heartbeat(void)
57 static unsigned int c;
60 gpio_direction_output(GPIO_LED1_RED, !(c & 0x10));