MiFI GPIO UBoot


#1

We are using MiFi along with several of the GPIOs for a project and noticed something strange recently. On power up, the Mifi will turn on GPIO 15 for a few seconds, and then once UBoot hands off to OpenWRT to boot the GPIO goes off again.

Now I swear MiFis that we ordered 6 months ago did not do this, but perhaps I just never noticed it… anyway I downloaded the AR150/MiFi/Domino UBoot from GL-Inet github to see what was going on, and after some digging finally found these lines in “u-boot/common/main.c”:

        all_led_off();
        //add start by gl-inet_xiaoxin
        gpio_control(GPIO_13_INDICATE_POWER,GPIO_13_ON);// This led is indicate power on
        gpio_control(GPIO_6_ENABLE_USB,GPIO_6_ON);// This gpio is enable usb
        //add end by gl-inet_xiaoxin

The definition pulled in from the Makefile for domino sets:

#define GPIO_6_ENABLE_USB                    6
#define GPIO_6_ON                            1
#define GPIO_13_INDICATE_POWER              15
#define GPIO_13_ON                           1

On the AR150 GPIO 15 is used for the the Power LED, so this makes sense; however on MiFi this GPIO is left available for user access.

So I have rebuilt Uboot with GPIO_13_ON set to 0, so that uBoot will not turn the GPIO on. The build looks OK, but I am nervous that something may not be right and I will end up bricking my unit… so:
a) Does MiFi have any kind of JTAG interface/support in case my build is bad??
b) Does anyone have such a JTAG interface hooked up and willing to test my uboot build???


#2

MiFi uses the same uboot as AR150 so this is the problem.

MiFi doesn’t have jtag. So if you flash the wrong uboot it will brick your device.


#3

@alzhao That’s what I was afraid of.

Any chance that a GL Staff member could rebuilt a u-boot image for MiFi specifically that has GPIO_13_ON set to 0 instead of 1? Only a single line of code needs to be changed:
Line 516 in “https://github.com/gl-inet/uboot-source-for_ar150_mifi_domino/u-boot/Makefile

        @echo "#define GPIO_13_ON                           0" >> include/config.h

then make clean; make domino and should be all good. You guys already have 3 binary images in the bin/ folder of that repository, so it would be easy enough to simply replace the existing uboot-gl-mifi.bin with the newly generated one, and leave the AR150 image alone…

Let me know if that is feasable… otherwise I will have to just close my eyes and potentially sacrifice 1 MiFi in the name of testing…


#4

Well what you can do is get one of those eeprom clamps, dump the eeprom using it as a backup. Then if you brick the device you can restore the uboot.


#5

@kyson-lok pls help to get a working uboot for mifi.


#6

The system led for MIFI isn’t user controllable, it isn’t use GPIO15, while GPIO15 is user controllable. What you do is correct. I rebuilt a u-boot for you without turn on GPIO15. Please unzip the attachment.

uboot-gl-mifi.zip (59.5 KB)


#7

@kyson-lok Awesome thank you, this solved the problem for us and lets GPIO 15 remain for use by our application without worrying about bootloader doing strange things to it!