OWHW: Reset the switch only at power-up
We use the AM335x-provided reset reason to issue the SWITCH_RESET only on actual power-up reset, andn ot at subsequent (soft) reboots.
This commit is contained in:
parent
ccbf22a14b
commit
ec82959f05
|
@ -34,6 +34,7 @@
|
|||
#include <mach/bbu.h>
|
||||
#include <net.h>
|
||||
#include <gpio.h>
|
||||
#include <reset_source.h>
|
||||
|
||||
#include "sob_odu_eeprom.h"
|
||||
|
||||
|
@ -98,9 +99,16 @@ static int physom_devices_init(void)
|
|||
/* claim + initialize the switch_reset GPIO */
|
||||
gpio_request(OWHW_GPIO_SWITCH_RESET, "switch-reset");
|
||||
gpio_direction_output(OWHW_GPIO_SWITCH_RESET, 1);
|
||||
/* actually perform a switch reset, as we cannot rely on
|
||||
* the power-up reset to properly rest it */
|
||||
owhw_switch_reset();
|
||||
switch (reset_source_get()) {
|
||||
case RESET_POR:
|
||||
case RESET_UKWN:
|
||||
/* actually perform a switch reset, as we cannot rely
|
||||
* on the power-up reset to properly rest it */
|
||||
owhw_switch_reset();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (of_machine_is_compatible("sysmocom,odu")) {
|
||||
defaultenv_append_directory(defaultenv_sysmocom_odu);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue