[PATCH 2/2] ramips: mt7621: Add support for ZyXEL LTE3301-Plus

Adrian Schmutzler mail at adrianschmutzler.de
Mon May 17 13:43:08 PDT 2021


Hi,

> >
> > What's in 0x2000000 to 0x2140000? Or did I miscalculate?
> 
> No, no miscalculation. This was taken from factory.
> 
> But please wait, I'm working on an alternative!

If this stays empty please just add a brief comment about that fact into the DTS.

> > That's a very unusual location. Nothing in 0x4, 0x8004, 0x28, 0x2e, 0xe000 or
> 0xe006?
> Yepp. I verified it before. But it's correct.

Please provide details about mac assignment in the commit message...

> > Wrong indent. Use tabs.
> Thanks, fixed!
> >
> > "link tx rx" should be standard and can be removed.
> Thanks, fixed!
> >
> >> +        ucidef_set_led_usbport "usb" "USB" "$boardname:white:usb"
> >> + "usb1-
> >> port2"
> >
> > This can probably replaced by a DT trigger.
> You you give me a hint?

https://github.com/openwrt/openwrt/blob/master/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi#L52

> >
> >> +        ;;
> >>  esac
> >>
> >>  board_config_flush
> >> diff --git
> >> a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> >> b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> >> index cde3cba9bc..01a4faf3cc 100644
> >> --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> >> +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
> >> @@ -63,6 +63,9 @@ ramips_setup_interfaces()
> >>  	ubnt,edgerouter-x-sfp)
> >>  		ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5"
> >> "eth0"
> >>  		;;
> >> +        zyxel,lte3301-plus)
> >> +                ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
> >> +		;;
> >
> > This can be merged with linksys,re6500 etc. Note that indent is wrong here,
> too.
> Thanks, fixed!
> >
> >>  	zyxel,nr7101)
> >>  		ucidef_set_interfaces_lan_wan "lan" "wan"
> >>  		;;
> >> diff --git a/target/linux/ramips/mt7621/base-
> >> files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-
> >> files/etc/board.d/03_gpio_switches
> >> index ed728b07c4..1959d8c9d2 100644
> >> ---
> >> a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches
> >> +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switc
> >> +++ hes
> >> @@ -22,6 +22,9 @@ ubnt,edgerouter-x-sfp)
> >>  	ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3"
> >> "403"
> >>  	ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4"
> >> "404"
> >>  	;;
> >> +zyxel,lte3301-plus)
> >> +	ucidef_add_gpio_switch "lte_power" "Power LTE modem" "507"
> >> +	;;
> >
> > Is this redundant with the lte_power hog? If yes, please decide for one of
> the two settings.
> I've got some questions here.
> Personnally I use a special scripts for this modem, taking use of the
> lte_power line.
> I.E., reset the modem if it does not work anymore.
> 
> So I do not want to set the GPIO alway to on. It should default to on, but be
> changable from userspace.
> What would be the correct implementation?

gpio-hogs cannot be changed be the user.

Other options are gpio-export (in DTS) and 03_gpio_switches. If you want to set the default value, just add a fourth parameter:

ucidef_add_gpio_switch "lte_power" "Power LTE modem" "507" "1"

There is not an obvious best choice, so you have some kind of liberty here. But you should not use more than one for the same parameter.

Best

Adrian

> 
> 
> >
> > Best
> >
> > Adrian
> >
> >>  zyxel,nr7101)
> >>  	ucidef_add_gpio_switch "lte_reset" "Reset LTE/5G modem" "483"
> >>  	;;
> >> diff --git
> >> a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
> >> b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
> >> index a155458d3f..03c6d8eea7 100755
> >> --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
> >> +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
> >> @@ -16,6 +16,7 @@ boot() {
> >>  	samknows,whitebox-v8)
> >>  		fw_setenv bootcount 0
> >>  		;;
> >> +	zyxel,lte3301-plus|\
> >>  	zyxel,nr7101)
> >>  		[ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] ||
> fw_setenv
> >> DebugFlag 0x1
> >>  		[ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] ||
> fw_setenv
> >> Image1Stable 1 diff --git a/target/linux/ramips/mt7621/base-
> >> files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-
> >> files/lib/upgrade/platform.sh
> >> index d30bc3db2e..88a92cf624 100755
> >> --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
> >> +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
> >> @@ -82,6 +82,7 @@ platform_do_upgrade() {
> >>  	ubnt,edgerouter-x-sfp)
> >>  		platform_upgrade_ubnt_erx
> 
> Thank you very much for taking a look at this.
> 
> Kind regards,
> 
> André
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210517/fc51ae6f/attachment-0001.sig>


More information about the openwrt-devel mailing list