ramips: Add support for 8devices Carambola dev board.
[openwrt/openwrt.git] / target / linux / ramips / files / arch / mips / ralink / rt305x / mach-carambola.c
1 /*
2 * 8devices Carambola dev board support
3 *
4 * Copyright (C) 2012 Tobias Diedrich <ranma+openwrt@tdiedrich.de>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13
14 #include <asm/mach-ralink/machine.h>
15 #include <asm/mach-ralink/dev-gpio-buttons.h>
16 #include <asm/mach-ralink/dev-gpio-leds.h>
17 #include <asm/mach-ralink/rt305x.h>
18 #include <asm/mach-ralink/rt305x_regs.h>
19
20 #include "devices.h"
21
22 static void __init carambola_init(void)
23 {
24 /* Ugh, inverted logic...
25 * This actually puts the pins into GPIO mode rather I2C, SPI, ... */
26 rt305x_gpio_init(RT305X_GPIO_MODE_UART0(RT305X_GPIO_MODE_GPIO) |
27 RT305X_GPIO_MODE_I2C |
28 RT305X_GPIO_MODE_SPI |
29 RT305X_GPIO_MODE_JTAG |
30 RT305X_GPIO_MODE_MDIO);
31
32 rt305x_register_flash(0);
33
34 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
35 rt305x_register_ethernet();
36 rt305x_register_wifi();
37 rt305x_register_wdt();
38 rt305x_register_usb();
39 }
40
41 MIPS_MACHINE(RAMIPS_MACH_CARAMBOLA, "CARAMBOLA", "8devices Carambola",
42 carambola_init);