Add support for 8devices Carambola dev board.

The Carambola is a small RT3050-based development board with two
ethernet ports, on-board chip antenna, usb and plenty of accessible
gpio ports, sold by 8devices.

Signed-off-by: Tobias Diedrich <ranma+open...@tdiedrich.de>


Index: 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
      2012-08-27 00:49:30.969049224 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
   2012-08-27 00:49:33.389052605 +0200
@@ -2,6 +2,11 @@
 
 menu "Ralink RT350x machine selection"
 
+config RT305X_MACH_CARAMBOLA
+       bool "8devices Carambola dev board support"
+       select RALINK_DEV_GPIO_BUTTONS
+       select RALINK_DEV_GPIO_LEDS
+
 config RT305X_MACH_3G_6200N
        bool "Edimax 3G-6200N board support"
        select RALINK_DEV_GPIO_BUTTONS
Index: 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
     2012-08-27 00:49:30.969049224 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
  2012-08-27 00:49:33.389052605 +0200
@@ -16,6 +16,7 @@
 obj-$(CONFIG_RT305X_MACH_BC2)          += mach-bc2.o
 obj-$(CONFIG_RT305X_MACH_ALL0256N)     += mach-all0256n.o
 obj-$(CONFIG_RT305X_MACH_ALL5002)      += mach-all5002.o
+obj-$(CONFIG_RT305X_MACH_CARAMBOLA)    += mach-carambola.o
 obj-$(CONFIG_RT305X_MACH_DIR_300_REVB) += mach-dir-300-revb.o
 obj-$(CONFIG_RT305X_MACH_DIR_615_H1)   += mach-dir-615-h1.o
 obj-$(CONFIG_RT305X_MACH_DAP_1350)     += mach-dap-1350.o
Index: 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-carambola.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-carambola.c
  2012-08-27 02:38:19.908168251 +0200
@@ -0,0 +1,42 @@
+/*
+ *  8devices Carambola dev board support
+ *
+ *  Copyright (C) 2012 Tobias Diedrich <ranma+open...@tdiedrich.de>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ralink/machine.h>
+#include <asm/mach-ralink/dev-gpio-buttons.h>
+#include <asm/mach-ralink/dev-gpio-leds.h>
+#include <asm/mach-ralink/rt305x.h>
+#include <asm/mach-ralink/rt305x_regs.h>
+
+#include "devices.h"
+
+static void __init carambola_init(void)
+{
+       /* Ugh, inverted logic...
+        * This actually puts the pins into GPIO mode rather I2C, SPI, ... */
+       rt305x_gpio_init(RT305X_GPIO_MODE_UART0(RT305X_GPIO_MODE_GPIO) |
+                        RT305X_GPIO_MODE_I2C |
+                        RT305X_GPIO_MODE_SPI |
+                        RT305X_GPIO_MODE_JTAG |
+                        RT305X_GPIO_MODE_MDIO);
+
+       rt305x_register_flash(0);
+
+       rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
+       rt305x_register_ethernet();
+       rt305x_register_wifi();
+       rt305x_register_wdt();
+       rt305x_register_usb();
+}
+
+MIPS_MACHINE(RAMIPS_MACH_CARAMBOLA, "CARAMBOLA", "8devices Carambola",
+            carambola_init);
Index: openwrt-ralink-swconfig/target/linux/ramips/image/Makefile
===================================================================
--- openwrt-ralink-swconfig.orig/target/linux/ramips/image/Makefile     
2012-08-27 00:49:30.969049224 +0200
+++ openwrt-ralink-swconfig/target/linux/ramips/image/Makefile  2012-08-27 
00:49:33.399052614 +0200
@@ -403,6 +403,10 @@
        $(call 
Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,bc2,BC2,ttyS1,57600,phys)
 endef
 
+define Image/Build/Profile/CARAMBOLA
+       $(call 
Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,carambola,CARAMBOLA,ttyS1,115200,phys)
+endef
+
 define Image/Build/Profile/DIR300B1
        $(call 
Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-300-b1,DIR-300-B1,wrgn23_dlwbr_dir300b)
        $(call 
Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b)
@@ -538,6 +542,7 @@
        $(call Image/Build/Profile/ALL5002,$(1))
        $(call Image/Build/Profile/ARGUS_ATP52B,$(1))
        $(call Image/Build/Profile/BC2,$(1))
+       $(call Image/Build/Profile/CARAMBOLA,$(1))
        $(call Image/Build/Profile/DIR300B1,$(1))
        $(call Image/Build/Profile/DIR615H1,$(1))
        $(call Image/Build/Profile/DAP1350,$(1))
Index: openwrt-ralink-swconfig/target/linux/ramips/rt305x/config-3.3
===================================================================
--- openwrt-ralink-swconfig.orig/target/linux/ramips/rt305x/config-3.3  
2012-08-25 18:51:50.068398900 +0200
+++ openwrt-ralink-swconfig/target/linux/ramips/rt305x/config-3.3       
2012-08-27 00:58:03.459765020 +0200
@@ -92,6 +92,7 @@
 CONFIG_RT305X_MACH_ALL5002=y
 CONFIG_RT305X_MACH_ARGUS_ATP52B=y
 CONFIG_RT305X_MACH_BC2=y
+CONFIG_RT305X_MACH_CARAMBOLA=y
 CONFIG_RT305X_MACH_DIR_300_REVB=y
 CONFIG_RT305X_MACH_DIR_615_H1=y
 CONFIG_RT305X_MACH_DAP_1350=y
Index: 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
  2012-08-25 18:51:50.058398881 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
       2012-08-27 01:03:09.040191828 +0200
@@ -23,6 +23,7 @@
        /* RT3050 based machines */
        RAMIPS_MACH_3G_6200N,           /* Edimax 3G-6200N */
        RAMIPS_MACH_ALL0256N,           /* Allnet ALL0256N */
+       RAMIPS_MACH_CARAMBOLA,          /* 8devices Carambola */
        RAMIPS_MACH_DIR_300_B1,         /* D-Link DIR-300 B1 */
        RAMIPS_MACH_DIR_600_B1,         /* D-Link DIR-600 B1 */
        RAMIPS_MACH_DIR_600_B2,         /* D-Link DIR-600 B2 */
Index: openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/ramips.sh
===================================================================
--- openwrt-ralink-swconfig.orig/target/linux/ramips/base-files/lib/ramips.sh   
2012-08-25 18:51:50.078398907 +0200
+++ openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/ramips.sh        
2012-08-27 01:24:27.701977746 +0200
@@ -47,6 +47,9 @@
        machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' 
/proc/cpuinfo)
 
        case "$machine" in
+       *"8devices Carambola")
+               name="carambola"
+               ;;
        *"Edimax 3g-6200n")
                name="3g-6200n"
                ;;
Index: 
openwrt-ralink-swconfig/target/linux/ramips/base-files/etc/uci-defaults/network
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/base-files/etc/uci-defaults/network
        2012-08-26 23:06:56.290452928 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/base-files/etc/uci-defaults/network 
    2012-08-27 01:31:36.212576252 +0200
@@ -178,6 +178,7 @@
                ;;
 
        all0239-3g | \
+       carambola | \
        w502u)
                lan_mac=$(ramips_get_mac_binary factory 40)
                wan_mac=$(ramips_get_mac_binary factory 46)
Index: 
openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
    2012-08-25 18:51:50.088398925 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
 2012-08-27 01:33:51.662765444 +0200
@@ -37,6 +37,7 @@
        all0239-3g |\
        all0256n |\
        all5002 |\
+       carambola |\
        dir-615-h1 |\
        fonera20n |\
        hw550-3g |\
Index: 
openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/upgrade/platform.sh
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/base-files/lib/upgrade/platform.sh
 2012-08-25 18:51:50.078398907 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/base-files/lib/upgrade/platform.sh  
    2012-08-27 01:56:39.804676339 +0200
@@ -19,6 +19,7 @@
        all0256n | \
        all5002 | \
        bc2 | \
+       carambola | \
        dir-300-b1 | \
        dir-600-b1 | \
        dir-600-b2 | \
Index: 
openwrt-ralink-swconfig/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
===================================================================
--- 
openwrt-ralink-swconfig.orig/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
 2012-08-25 18:51:50.088398925 +0200
+++ 
openwrt-ralink-swconfig/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
      2012-08-27 02:20:20.466660588 +0200
@@ -58,6 +58,7 @@
        all5002 | \
        argus-atp52b | \
        bc2 | \
+       carambola | \
        dir-615-h1 | \
        dir-620-a1 | \
        esr-9753 | \
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to