[FS#986] ARV752DPW missing default switch config

LEDE Bugs lede-bugs at lists.infradead.org
Fri Sep 1 06:14:09 PDT 2017


The following task has a new comment added:

FS#986 - ARV752DPW missing default switch config
User who did this - Mathias Kresin (mkresin)

----------
For now I will use the ticket for this bug as well.

I'm now able to trigger the bug.

The whole rtl8306 configuration is done via mii. The rtl8306 has paging implemented to access different values via the same mii register. The precompiled u-boot doesn't have support for paging and expects the first page to be selected/active.

After running "swconfig dev switch0 show && reboot" a different page is active, the bootloader fails to read the chip id via mii (the selected register returns 0x0000) and fails to bring up the switch.

I have a commit (beside other rtl8306 fixes) in my [[https://git.lede-project.org/?p=lede/mkresin/staging.git|staging tree]] to workaround the issue. I do **not** intend to commit this workaround, since it is a bug/limitation of the precompiled u-boot.

I've still no real clue why the switch is in reset in case the precompiled u-boot fails to initialize the rtl8306 (and do the hard reset via GPIO). I'm not able to reproduce it with the current LEDE u-boot, even if I do not touch any GPIOs.

I can confirm that the danube SoCs reset value for GPIO#19 is input, which does **not** hold the rtl8306 in reset.

The GPIO#19 config with the current LEDE u-boot without any GPIO config (dumped during early kernel load):


DIR: input  | PULLING: down | PULL: disabled | DRAIN: open drain | ALTSEL0: 0 | ALTSEL1: 0 | OUT: 0 | IN: 1


And the GPIO#19 config with precompiled u-boot and failed rtl8306 init:


DIR: input  | PULLING: down | PULL: disabled | DRAIN: open drain | ALTSEL0: 0 | ALTSEL1: 0 | OUT: 0 | IN: 1

 
I'm able get the switch (and GPIO#19 values) to the same state by doing the following:


echo "499" > /sys/class/gpio/export

# reset
echo 1 > /sys/class/gpio/gpio499/value

# switch back to input
echo in > /sys/class/gpio/gpio499/direction

# switch to output (default reg value releases reset)
echo out > /sys/class/gpio/gpio499/direction


I've managed to compile the old u-boot code (commit id 0dd64c552d56d1d85e74a4adb54795eae7df0dcd) and will give the binary a try.

Might be that this version already shows the issue. Of course, it could be that the person who provides the precompiled u-boot has applied some local changes. A perfect explanation would be GPIO#19 is set as CONFIG_SWITCH_PIN (output + high) and CONFIG_BUTTON_PIN (input).
----------

More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=986#comment3394



More information about the lede-bugs mailing list