From 6c5793a62d9dc4e2ea850393fa27b3c09faac15b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 10 Apr 2016 12:49:04 +0200 Subject: [PATCH] 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. --- arch/arm/boards/phytec-som-am335x/board.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/boards/phytec-som-am335x/board.c b/arch/arm/boards/phytec-som-am335x/board.c index b270e5de5..0a61b7493 100644 --- a/arch/arm/boards/phytec-som-am335x/board.c +++ b/arch/arm/boards/phytec-som-am335x/board.c @@ -34,6 +34,7 @@ #include #include #include +#include #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 {