9
0
Fork 0

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:
Harald Welte 2016-04-10 12:49:04 +02:00 committed by Holger Hans Peter Freyther
parent ad57125cc8
commit 6c5793a62d
1 changed files with 11 additions and 3 deletions

View File

@ -34,6 +34,7 @@
#include <mach/bbu.h>
#include <net.h>
#include <gpio.h>
#include <reset_source.h>
#include "sob_odu_eeprom.h"
@ -108,9 +109,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 {