[OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support

Stijn Segers francesco.borromini at inventati.org
Wed Aug 12 14:28:34 EDT 2015


Hi Karl,

Thanks for your time.

I have reworked the patch and re-ordered where possible (files like 
ar71xx.sh and diag.sh lack any alphabetical
order). I have removed the code that set the led to status_led_off. 
What file should I be looking at, when you talk
about the board file? Is it the minibox-v1.mk file? I diffed from the 
vendor's code (and added a profile by comparing
with other devices) but that was it.

I don't have the hardware myself but I have found a tester willing to 
run the image (and see how the LED behaves with
the default OpenWrt settings).


The new patch can be found here:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch

If that doesn't work, a backup: http://sprunge.us/AUbX


And for those wanting to try on 15.05:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-15.05.patch

Thanks

Stijn



Op ma, 10 aug 2015 om 3:12 , schreef Karl Palsson <karlp at tweak.net.au>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> This has many cases where you have added the board out of order.  The
> lists are generally alphabetically sorted, and should be maintained 
> that
> way, even though a few boards escaped this.
> 
> More comments inline.
> 
> 
> Stijn Segers <francesco.borromini at inventati.org> wrote:
>>  Hello,
>> 
>>  The patch below adds support for the Gainstrong Minibox v1.0 mini
>>  router into trunk. This is based off the Barrier Breaker based 
>> source
>>  code at http://ooioe.com/miniboxv1/Sourcecode/.
>> 
>>  Patch applies cleanly, has been compile-tested on a 15.05 tree (the
>>  patch below is for the trunk ar17xx target with kernel 4.1). For 
>> those
>>  interested, I can provide the 15.05 patch as well.
>> 
>>  Any questions, let me know.
>> 
>>  Thank you
>> 
>>  Stijn
>> 
>> 
>> 
>> 
>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  @@ -222,6 +222,9 @@ get_status_led() {
>>   	qihoo-c301)
>>   		status_led="qihoo:green:status"
>>   		;;
>>  +	minibox-v1)
>>  +		status_led="minibox-v1:green:system"
>>  +		;;
>>   	tew-632brp)
>>   		status_led="tew-632brp:green:status"
>>   		;;
>>  @@ -366,7 +369,7 @@ set_state() {
>>   		status_led_blink_preinit_regular
>>   		;;
>>   	done)
>>  -		status_led_on
>>  +		status_led_off
> 
> Pretty sure you can't just change this for everyone.  If you have an
> active low/active high issue, you should fix that in your board file.
> 
>>   		case $(ar71xx_board_name) in
>>   		qihoo-c301)
>>   			local n=$(fw_printenv activeregion | cut -d = -f 2)
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  ===================================================================
>>  ---
>>  
>> openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  @@ -419,6 +419,7 @@ ja76pf |\
>>   mc-mac1200r|\
>>   mynet-n600 |\
>>   oolite |\
>>  +minibox-v1 |\
> 
> 
> I know gainstrong makes the oolite too, but at this point in this 
> file,
> that's irrelevant, keep the alphabetical sorting.
> 
>>   qihoo-c301 |\
>>   rb-750 |\
>>   rb-751 |\
>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  @@ -119,6 +119,9 @@ tplink_board_detect() {
>>   	"3C0001"*)
>>   		model="OOLITE"
>>   		;;
>>  +	"3C0002"*)
>>  +		model="MINIBOX_V1"
>>  +		;;
>>   	"070300"*)
>>   		model="TP-Link TL-WR703N"
>>   		;;
>>  @@ -320,6 +323,9 @@ ar71xx_board_detect() {
>>   	*"AC1750DB")
>>   		name="f9k1115v2"
>>   		;;
>>  +	*"MiniBox V1.0")
>>  +		name="minibox-v1"
>>  +		;;
> 
> Bad sort.
> 
>>   	*"AirGateway")
>>   		name="airgateway"
>>   		;;
>>  Index:
>>  openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  ===================================================================
>>  ---
>>  
>> openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  +++ 
>> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  @@ -315,6 +315,7 @@ platform_check_image() {
>>   	mc-mac1200r | \
>>   	onion-omega | \
>>   	oolite | \
>>  +	minibox-v1 |\
> 
> Bad sort.
> 
>>   	smart-300 | \
>>   	tl-mr10u | \
>>   	tl-mr11u | \
>>  Index: openwrt/trunk/target/linux/ar71xx/config-4.1
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
>>  +++ openwrt/trunk/target/linux/ar71xx/config-4.1
>>  @@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
>>   CONFIG_ATH79_MACH_F9K1115V2=y
>>   CONFIG_ATH79_MACH_GL_INET=y
>>   CONFIG_ATH79_MACH_GS_OOLITE=y
>>  +CONFIG_ATH79_MACH_MINIBOX_V1=y
> 
> 
> very bad sort.  config files have even strong sorting requirements.
> 
>>   CONFIG_ATH79_MACH_HIWIFI_HC6361=y
>>   CONFIG_ATH79_MACH_HORNET_UB=y
>>   CONFIG_ATH79_MACH_JA76PF=y
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>  ===================================================================
>>  --- /dev/null
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>  @@ -0,0 +1,85 @@
>>  +/*
>>  + *  Oolite board support
> 
> 
> Wrong.  Oolite is the board you copied.  This file should be 
> accurately
> describe what it does, not what it used to do at some point.
> 
>>  + *
>>  + *
>>  + *  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/gpio.h>
>>  +
>>  +#include <asm/mach-ath79/ath79.h>
>>  +#include <asm/mach-ath79/ar71xx_regs.h>
>>  +
>>  +#include "common.h"
>>  +#include "dev-eth.h"
>>  +#include "dev-gpio-buttons.h"
>>  +#include "dev-leds-gpio.h"
>>  +#include "dev-m25p80.h"
>>  +#include "dev-wmac.h"
>>  +#include "machtypes.h"
>>  +#include "dev-usb.h"
> 
> 
> It's a matter of taste, but you didn't think of putting all the dev-
> includes together?
> 
>>  +
>>  +#define MINIBOX_V1_GPIO_BTN_RESET	11
>>  +
>>  +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
>>  +
>>  +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
>>  +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 *
>>  MINIBOX_V1_KEYS_POLL_INTERVAL)
>>  +
>>  +static const char *MINIBOX_V1_part_probes[] = {
>>  +	"tp-link",
>>  +	NULL,
>>  +};
>>  +
>>  +static struct flash_platform_data MINIBOX_V1_flash_data = {
>>  +	.part_probes	= MINIBOX_V1_part_probes,
>>  +};
>>  +
>>  +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>>  +	{
>>  +		.name		= "minibox-v1:green:system",
>>  +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
>>  +		.active_low	= 0,
>>  +	},
>>  +};
>>  +
>>  +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = 
>> {
>>  +	{
>>  +		.desc		= "reset",
>>  +		.type		= EV_KEY,
>>  +		.code		= KEY_RESTART,
>>  +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
>>  +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
>>  +		.active_low	= 0,
>>  +	},
>>  +};
>>  +
>>  +static void __init MINIBOX_V1_setup(void)
>>  +{
>>  +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
>>  +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>>  +
>>  +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
>>  +				 MINIBOX_V1_leds_gpio);
>>  +
>>  +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
>>  +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
>>  +					MINIBOX_V1_gpio_keys);
>>  +
>>  +	ath79_register_usb();
>>  +
>>  +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
>>  +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
>>  +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
>>  +
>>  +	ath79_register_mdio(0, 0x0);
>>  +	ath79_register_eth(1);
>>  +	ath79_register_eth(0);
>>  +
>>  +	ath79_register_wmac(ee, mac);
>>  +}
>>  +
>>  +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
>>  +	     "MiniBox V1.0", MINIBOX_V1_setup);
>>  Index: 
>> openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>  ===================================================================
>>  --- /dev/null
>>  +++ openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>  @@ -0,0 +1,17 @@
>>  +#
>>  +# Copyright (C) 2015 OpenWrt.org
>>  +#
>>  +# This is free software, licensed under the GNU General Public 
>> License
>>  v2.
>>  +# See /LICENSE for more information.
>>  +#
>>  +
>>  +define Profile/MINIBOXV1
>>  +	NAME:=MINIBOX V1.0
>>  +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
>>  +endef
>>  +
>>  +
>>  +define Profile/MINIBOXV1/Description
>>  +	Package set optimized for the MINIBOX V1.0
>>  +endef
>>  +$(eval $(call Profile,MINIBOXV1))
>>  Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
>>  +++ openwrt/trunk/target/linux/ar71xx/image/Makefile
>>  @@ -902,6 +902,15 @@ endef
>> 
>>   TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
>> 
>>  +define Device/minibox-v1
>>  +    $(Device/tplink-16mlzma)
>>  +    BOARDNAME := MINIBOX-V1
>>  +    DEVICE_PROFILE := MINIBOXV1
>>  +    TPLINK_HWID := 0x3C000201
>>  +    CONSOLE := ttyATH0,115200
>>  +endef
>>  +TARGET_DEVICES += minibox-v1
>>  +
>>   rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst
>>  squashfs-%,squashfs,$(1)))
>> 
>>   # $(1): rootfs type.
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>  ===================================================================
>>  --- /dev/null
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>  @@ -0,0 +1,39 @@
>>  +--- a/arch/mips/ath79/machtypes.h
>>  ++++ b/arch/mips/ath79/machtypes.h
>>  +@@ -61,6 +61,7 @@ enum ath79_mach_type {
>>  +	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
>>  +	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
>>  +	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
>>  ++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
>>  +	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
>>  +	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
>>  +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>>  +--- a/arch/mips/ath79/Kconfig
>>  ++++ b/arch/mips/ath79/Kconfig
>>  +@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
>>  +       select ATH79_DEV_USB
>>  +       select ATH79_DEV_WMAC
>>  +
>>  ++config ATH79_MACH_MINIBOX_V1
>>  ++       bool "OOLITE BOX V1.0 support"
> 
> wrong board name again.
> 
> 
>>  ++       select SOC_AR933X
>>  ++       select ARH79_DEV_ETH
>>  ++       select ARH79_DEV_GPIO_BUTTONS
>>  ++       select ATH79_DEV_LEDS_GPIO
>>  ++       select ATH79_DEV_M25P80
>>  ++       select ATH79_DEV_USB
>>  ++       select ATH79_DEV_WMAC
>>  ++
>>  + config ATH79_MACH_HIWIFI_HC6361
>>  +	bool "HiWiFi HC6361 board support"
>>  +	select SOC_AR933X
>>  +--- a/arch/mips/ath79/Makefile
>>  ++++ b/arch/mips/ath79/Makefile
>>  +@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
>>  + obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
>>  + obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
>>  + obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
>>  ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
>>  + obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
>>  + obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
>>  + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
>> 
>> 
>>  _______________________________________________
>>  openwrt-devel mailing list
>>  openwrt-devel at lists.openwrt.org
>>  https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
> - --
> Sent using Mailpile, Free Software from www.mailpile.is
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> 
> iQIcBAEBAgAGBQJVyKMrAAoJEBmotQ/U1cr2eTgQAMCTCTW+tAdMfbstFBud1M7U
> MqsY2mZWQODU24pCQg4eJX5jskj5zXbxQCPBwZ8xwAfbZ/DBOQH23xauPfFDCqi2
> U1mxC60GqS6C5bm0ZF8+kJeSRWnlwOX3vckwpZAnQYvyZUemGWef2JIUc7glS2kn
> NvQxCkwhl4PYWMl+Nox1De5NgOi0Ft1dUdXVAdLBm3abZMIYMcijWhR0iMjS3Snt
> SAzReHPr0v3XCXwQ+bc7aN1el1KeXhT+Bkv1WPKDrfvACjB6kZup8WKtXGYUy15L
> 7tMdOeiyHHfZZOaKg+qUzRCj+9g4DQpDqsQVtu/f5eicfOHjDZRA7kyZnxrcUJy1
> 6v3L8/2vNDxZY/z5gz7ilPl9k+EPECn56GtepWKjE9yzOSgRg1enlmfXh4g2SJgF
> +G1GSKsoyO4FuhzGMJ0xd5UMNE93nncK05vYHmUs3+OXoTj+eA8QGnIzByVJT197
> NL7Ared98MpB6SenOQVnwKoi8YtPHWqjK2lnjplu0Jxb0ULdAVVa7SlV8Cmyd+89
> +KtINxWxKdokzQKPus17YaSdJtcKVtExfaadCqA2HGbIwNCAx+KS7UxGESA/iSaD
> XMSAPyCXQCqg9eznZGtZEwq7q0PRvyw98UbdyYG9AMUtO2XdCgxHImxfbb9RMo6p
> 0EUe8DdJPkWLEXxHd21D
> =saX1
> -----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/50742ee0/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list