@cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
@make --no-print-directory show_size
+gl-inet: export UBOOT_FILE_NAME=uboot_for_gl-inet
+gl-inet: export MAX_UBOOT_SIZE=64
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+gl-inet: export COMPRESSED_UBOOT=1
+endif
+gl-inet:
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) gl-inet_config
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
+ @make --no-print-directory show_size
+
ifdef CONFIG_SKIP_LOWLEVEL_INIT
show_size: export UBOOT_FILE_NAME_SUFFIX=__RAM
endif
@./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
+gl-inet_config : unconfig hornet_common_config
+ @/bin/echo -e '\e[32m> Configuring for GL.iNet at:' `date` '\e[0m'
+ @echo "#define CONFIG_FOR_GL_INET 1" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
+ @echo "#define GPIO_LAN_LED_BIT 13" >> include/config.h
+ @echo "#define GPIO_LAN_LED_ON 1" >> include/config.h
+ @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
+ @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
+ @echo "#define BOARD_CUSTOM_STRING \"AP121 (AR9331) U-Boot for GL.iNet\"" >> include/config.h
+
+ @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
+
wasp_common_config : common_config
@echo "#define CONFIG_AR7240 1" >> include/config.h
@echo "#define CONFIG_WASP 1" >> include/config.h
gpio ^= 1 << GPIO_WLAN_LED_BIT;
#elif defined(CONFIG_FOR_DRAGINO_V2)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
+#elif defined(CONFIG_FOR_GL_INET)
+ gpio ^= 1 << GPIO_WLAN_LED_BIT;
#else
#error "Custom GPIO in leg_toggle() not defined!"
#endif
SETBITVAL(gpio, GPIO_WAN_LED_BIT, GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, GPIO_LAN_LED_ON);
SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, GPIO_INTERNET_LED_ON);
+#elif defined(CONFIG_FOR_GL_INET)
+ SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);
+ SETBITVAL(gpio, GPIO_LAN_LED_BIT, GPIO_LAN_LED_ON);
#else
#error "Custom GPIO in all_led_on() not defined!"
#endif
SETBITVAL(gpio, GPIO_WAN_LED_BIT, !GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, !GPIO_LAN_LED_ON);
SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, !GPIO_INTERNET_LED_ON);
+#elif defined(CONFIG_FOR_GL_INET)
+ SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON);
+ SETBITVAL(gpio, GPIO_LAN_LED_BIT, !GPIO_LAN_LED_ON);
#else
#error "Custom GPIO in all_led_off() not defined!"
#endif
// turn on power on USB and turn off RED LEDs
ar7240_reg_wr(AR7240_GPIO_SET, 0x47D4103);
+#elif defined(CONFIG_FOR_GL_INET)
+
+ /* LED's GPIOs on GL.iNet:
+ *
+ * 0 => WLAN
+ * 13 => LAN
+ *
+ */
+
+ /* set GPIO_OE */
+ ar7240_reg_wr(AR7240_GPIO_OE, (ar7240_reg_rd(AR7240_GPIO_OE) | 0x2001));
+
#else
#error "Custom GPIO config in gpio_config() not defined!"
#endif
defined(CONFIG_FOR_TPLINK_MR10U_V1) || \
defined(CONFIG_FOR_TPLINK_WR740N_V4) || \
defined(CONFIG_FOR_TPLINK_MR3220_V2) || \
- defined(CONFIG_FOR_TPLINK_MR13U_V1)
+ defined(CONFIG_FOR_TPLINK_MR13U_V1) || \
+ defined(CONFIG_FOR_GL_INET)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(ART)"
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
!defined(CONFIG_FOR_GS_OOLITE_V1_DEV) && \
- !defined(CONFIG_FOR_DRAGINO_V2)
+ !defined(CONFIG_FOR_DRAGINO_V2) && \
+ !defined(CONFIG_FOR_GL_INET)
#define OFFSET_ROUTER_MODEL 0x00FD00
#endif