diff --git a/iopsys-brcm63xx-arm/base-files/etc/board-db/boards/DNA0332TLS b/iopsys-brcm63xx-arm/base-files/etc/board-db/boards/DNA0332TLS new file mode 100644 index 0000000000000000000000000000000000000000..68b6276bf98ed61efc1eb4b50ae146f45212dd50 --- /dev/null +++ b/iopsys-brcm63xx-arm/base-files/etc/board-db/boards/DNA0332TLS @@ -0,0 +1,183 @@ +config board 'board' + # Specs + option hasAdsl '1' + option hasVdsl '1' + option hasVoice '1' + option hasDect '0' + option hasUsb '1' + option hasCatv '0' + option hasSfp '1' + option hasWifi '1' + # Voice + option VoicePorts '2' + option VoicePortNames 'Tel_1 Tel_2' + option VoicePortOrder 'brcm0 brcm1' + # Ethernet + option ethernetPorts '4' + option ethernetPortNames 'LAN1 LAN2 LAN3 LAN4 WAN' + option ethernetPortOrder 'eth0 eth1 eth2 eth3 eth4' + option ethernetLanPorts 'eth0 eth1 eth2 eth3' + option ethernetWanPort 'eth4' + # DSL + option adslWanPort 'atm0' + option vdslWanPort 'ptm0' + +############################################################################### +# +# Button config, start +# +############### gpio buttons, driver config +config gpio_button gpio_buttons + list buttons gpio_reset + list buttons gpio_wps + list buttons gpio_wifi + +config gpio_button gpio_reset + option addr 63 + option active low + +config gpio_button gpio_wps + option addr 62 + option active low + +config gpio_button gpio_wifi + option addr 8 + option active low + +############### mapping function button to driver button +config button reset + list button gpio_reset + option minpress 5000 + option hotplug resetbutton +# +# Button config , end +# +############################################################################### + +############################################################################### +# +# Led config, start +# +############### gpio led, driver config + +config gpio_led gpio_leds + list leds green_power + list leds red_power + list leds blue_power + list leds green_wan + list leds green_mobile + list leds red_mobile + list leds green_phone + list leds red_phone + list leds green_wifi + +config gpio_led green_power + option sysfs_attr led_9 + option active hi + option mode led_linux + +config gpio_led red_power + option sysfs_attr led_7 + option active hi + option mode led_linux + +config gpio_led blue_power + option sysfs_attr led_4 + option active hi + option mode led_linux + +config gpio_led green_wan + option sysfs_attr led_11 + option active hi + option mode led_linux + +config gpio_led green_mobile + option sysfs_attr led_5 + option active hi + option mode led_linux + +config gpio_led red_mobile + option sysfs_attr led_16 + option active hi + option mode led_linux + +config gpio_led green_phone + option sysfs_attr led_15 + option active hi + option mode led_linux + +config gpio_led red_phone + option sysfs_attr led_1 + option active hi + option mode led_linux + +config gpio_led green_wifi + option sysfs_attr led_3 + option active hi + option mode led_linux + +################ mapping led function to driver led +config led_map led_map + list functions status + list functions internet + list functions wan + list functions mobile + list functions voice + list functions wifi + +config led_map led_status + list led_action_ok 'green_power = ON' + list led_action_ok 'red_power = OFF' + list led_action_off 'green_power = OFF' + list led_action_off 'red_power = OFF' + list led_action_notice 'green_power = FLASH_SLOW' + list led_action_notice 'red_power = FLASH_SLOW' + list led_action_alert 'green_power = OFF' + list led_action_alert 'red_power = FLASH_SLOW' + list led_action_error 'green_power = OFF' + list led_action_error 'red_power = FLASH_FAST' + +config led_map led_internet + list led_action_ok 'blue_power = ON' + list led_action_off 'blue_power = OFF' + list led_action_notice 'blue_power = OFF' + list led_action_alert 'blue_power = OFF' + list led_action_error 'blue_power = OFF' + +config led_map led_wan + list led_action_ok 'green_wan = ON' + list led_action_off 'green_wan = OFF' + list led_action_notice 'green_wan = FLASH_SLOW' + list led_action_alert 'green_wan = FLASH_FAST' + list led_action_error 'green_wan = OFF' + +config led_map led_mobile + list led_action_ok 'green_mobile = ON' + list led_action_ok 'red_mobile = OFF' + list led_action_off 'green_mobile = OFF' + list led_action_off 'red_mobile = OFF' + list led_action_notice 'green_mobile = FLASH_SLOW' + list led_action_notice 'red_mobile = OFF' + list led_action_alert 'green_mobile = OFF' + list led_action_alert 'red_mobile = FLASH_FAST' + list led_action_error 'green_mobile = OFF' + list led_action_error 'red_mobile = ON' + +config led_map led_voice + list led_action_ok 'green_phone = ON' + list led_action_ok 'red_phone = OFF' + list led_action_off 'green_phone = OFF' + list led_action_off 'red_phone = OFF' + list led_action_notice 'green_phone = FLASH_SLOW' + list led_action_notice 'red_phone = OFF' + list led_action_alert 'green_phone = OFF' + list led_action_alert 'red_phone = FLASH_FAST' + list led_action_error 'green_phone = OFF' + list led_action_error 'red_phone = ON' + +config led_map led_wifi + list led_action_ok 'green_wifi = ON' + list led_action_off 'green_wifi = OFF' + list led_action_notice 'green_wifi = FLASH_SLOW' + list led_action_alert 'green_wifi = FLASH_FAST' + list led_action_error 'green_wifi = OFF' diff --git a/iopsys-brcm63xx-arm/base-files/etc/system_layout/DNA0332TLS.json b/iopsys-brcm63xx-arm/base-files/etc/system_layout/DNA0332TLS.json new file mode 100644 index 0000000000000000000000000000000000000000..904500db8a7ac7a1921e470f1b9a58f9ebcddc53 --- /dev/null +++ b/iopsys-brcm63xx-arm/base-files/etc/system_layout/DNA0332TLS.json @@ -0,0 +1,22 @@ +{ + "type": "nand", + "banks": [ + { + "id": 0, + "name": "A", + "rootfs": "/dev/ubiblock0_4", + "overlay": "ubi0:defaults" + }, + { + "id": 1, + "name": "B", + "rootfs": "/dev/ubiblock0_6", + "overlay": "ubi0:defaults" + } + ], + "overlay_scope": [ + "/" + ], + "mounts": [ + ] +} diff --git a/iopsys-brcm63xx-arm/config/dna0332tls/config b/iopsys-brcm63xx-arm/config/dna0332tls/config new file mode 100644 index 0000000000000000000000000000000000000000..e6de4eddc9c3f2b76d6bef8916c4077101f72e1f --- /dev/null +++ b/iopsys-brcm63xx-arm/config/dna0332tls/config @@ -0,0 +1,10 @@ +CONFIG_TARGET_FAMILY="DNA0332" +CONFIG_BCM_KERNEL_PROFILE="DNA0332" +CONFIG_BCM_CHIP_ID="63146" + +CONFIG_BCM_VOICE=y + +CONFIG_BCM_FIRMWARE_TYPE_NAND_SQUASHFS=y + +CONFIG_BCM_FLASH_LAYOUT_OPTIONS="options_63146_dna0332_nand" +CONFIG_BCM_SECURE_BOOT_SUPPORT=y diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/config/buttons b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/config/buttons new file mode 100644 index 0000000000000000000000000000000000000000..5adb755ca6fb003c86964477dfa1e33253fd9c7e --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/config/buttons @@ -0,0 +1,10 @@ +config button wps + list button gpio_wps + option minpress 1000 + option hotplug wpsbutton + +config button wifi + list button gpio_wifi + option minpress 1000 + option hotplug wifibutton + diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/dsl/20-leds b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/dsl/20-leds new file mode 100644 index 0000000000000000000000000000000000000000..27b6a825a8917bb5c58c19da9814b010bf145ce8 --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/dsl/20-leds @@ -0,0 +1,10 @@ +. /lib/network/utils.sh + +if [ "$STATUS" == "up" ]; then + ubus call led.wan set '{"state":"ok"}' +elif [ "$STATUS" == "down" ]; then + $(uplink_phy_connected) || ubus call led.wan set '{"state":"off"}' +elif [ "$STATUS" == "training" ]; then + ubus call led.wan set '{"state":"alert"}' +fi + diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/ethernet/10-wan-led b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/ethernet/10-wan-led new file mode 100644 index 0000000000000000000000000000000000000000..b15aaa2a388ed74d3a5834dd7b5d39ea0ae1e463 --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/hotplug.d/ethernet/10-wan-led @@ -0,0 +1,10 @@ +[ "$PORT" == "eth4" ] || exit 0 + +. /lib/network/utils.sh + +if [ "$LINK" == "up" ]; then + ubus call led.wan set '{"state":"ok"}' +elif [ "$LINK" == "down" ]; then + $(uplink_phy_connected) || ubus call led.wan set '{"state":"off"}' +fi + diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/ruleng/wifi.json b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/ruleng/wifi.json new file mode 100644 index 0000000000000000000000000000000000000000..e226c5de8489137b5d725c6d4cb4bc24f3fb2ba9 --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/ruleng/wifi.json @@ -0,0 +1,140 @@ +{ + "wifi_down": { + "if_operator" : "AND", + "if_event_period": 2, + "if" : [ + { + "event": "wifi.radio", + "match": { + "ifname":"wl0", + "event":"ap-disabled" + } + }, + { + "event": "wifi.radio", + "match": { + "ifname":"wl1", + "event":"ap-disabled" + } + } + ], + "then" : [ + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "off" + }, + "timeout": 1 + } + ] + }, + "wifi_up": { + "if_operator" : "OR", + "if" : [ + { + "event": "wifi.radio", + "match": { + "ifname":"wl0", + "event":"ap-enabled" + } + }, + { + "event": "wifi.radio", + "match": { + "ifname":"wl1", + "event":"ap-enabled" + } + } + ], + "then" : [ + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "ok" + }, + "timeout": 1 + } + ] + }, + "wps_active": { + "if_operator" : "OR", + "if" : [ + { + "event": "wifi.ap", + "match": { + "event":"wps-pbc-active" + } + } + ], + "then" : [ + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "notice" + }, + "timeout": 1 + } + ] + }, + "wps_success_timeout": { + "if_operator" : "OR", + "if" : [ + { + "event": "wifi.ap", + "match": { + "event":"wps-reg-success" + } + }, + { + "event": "wifi.ap", + "match": { + "event":"wps-timeout" + } + } + ], + "then" : [ + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "ok" + }, + "timeout": 1 + } + ] + }, + "wps_overlap": { + "if_operator" : "OR", + "if" : [ + { + "event": "wifi.ap", + "match": { + "event":"wps-overlap" + } + } + ], + "then_exec_interval" : 5, + "then" : [ + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "alert", + "timeout": 120 + }, + "timeout": 1 + }, + { + "object": "led.wifi", + "method":"set", + "args" : { + "state": "ok" + }, + "timeout": 1 + } + ] + } +} diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/uci-defaults/DNA0332tls-workarounds b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/uci-defaults/DNA0332tls-workarounds new file mode 100644 index 0000000000000000000000000000000000000000..535b0cca612e174d21c0ac0973acd1c3fc08385d --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/uci-defaults/DNA0332tls-workarounds @@ -0,0 +1,4 @@ +# WPS states will be handled by ruleng.wifi +uci -q delete ruleng.wps +uci -q set ruleng.wifi=rule +uci -q set ruleng.wifi.recipe='/etc/ruleng/wifi.json' diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/wlan/nvram/DNA0332TLS.nvm b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/wlan/nvram/DNA0332TLS.nvm new file mode 100644 index 0000000000000000000000000000000000000000..f2a0a53cc7c806e435937fc29dc3c8cfa1b50e92 Binary files /dev/null and b/iopsys-brcm63xx-arm/dna0332tls/base-files/etc/wlan/nvram/DNA0332TLS.nvm differ diff --git a/iopsys-brcm63xx-arm/dna0332tls/base-files/lib/preinit/70_flash_layout_fixup b/iopsys-brcm63xx-arm/dna0332tls/base-files/lib/preinit/70_flash_layout_fixup new file mode 100644 index 0000000000000000000000000000000000000000..e67cecbbd164a32d49b63cf485d193b269a3fd19 --- /dev/null +++ b/iopsys-brcm63xx-arm/dna0332tls/base-files/lib/preinit/70_flash_layout_fixup @@ -0,0 +1,12 @@ +#!/bin/sh + +OVERLAY_LEBS_COUNT=300 + +flash_layout_fixup () { + vol_name="overlay1" + ubinfo /dev/ubi0 -N $vol_name >/dev/null 2>&1 || ubimkvol /dev/ubi0 -N $vol_name -S $OVERLAY_LEBS_COUNT + vol_name="overlay2" + ubinfo /dev/ubi0 -N $vol_name >/dev/null 2>&1 || ubimkvol /dev/ubi0 -N $vol_name -S $OVERLAY_LEBS_COUNT +} + +boot_hook_add preinit_main flash_layout_fixup diff --git a/iopsys-brcm63xx-arm/profiles/iopsys.mk b/iopsys-brcm63xx-arm/profiles/iopsys.mk index 6ecefd1dc138b8068c004492cfe810589f51173a..b2fc03a6a1b2cdbdaa1100b623e8e9fe4df9cb23 100644 --- a/iopsys-brcm63xx-arm/profiles/iopsys.mk +++ b/iopsys-brcm63xx-arm/profiles/iopsys.mk @@ -132,3 +132,15 @@ define Profile/disc/Description endef $(eval $(call Profile,disc)) + +#################### dna0332 +define Profile/dna0332tls + NAME:=dna0332 + PACKAGES:=$(VOICE_SUPPORT) +endef + +define Profile/dna0332tls/Description + dna0332tls profile +endef + +$(eval $(call Profile,dna0332tls))