9
0
Fork 0

OWHW: Issue SWITCH_RESET during boot

The hardware timings for SWITCH_RESET at power-up might not be
sufficient for a proper reset, so let's make sure we put the switch into
reset for at least 10ms (80E6063 requirement) during the boot-up
sequence.
This commit is contained in:
Harald Welte 2016-04-10 12:39:40 +02:00 committed by Holger Hans Peter Freyther
parent 5c237290e9
commit ad57125cc8
1 changed files with 19 additions and 0 deletions

View File

@ -33,6 +33,7 @@
#include <mach/am33xx-silicon.h>
#include <mach/bbu.h>
#include <net.h>
#include <gpio.h>
#include "sob_odu_eeprom.h"
@ -68,6 +69,18 @@ static char *nandslots[] = {
"/dev/nand0.barebox_backup.bb",
};
#define OWHW_GPIO_SWITCH_RESET 56
static void owhw_switch_reset(void)
{
pr_info("Resetting OWHW switch\n");
gpio_set_value(OWHW_GPIO_SWITCH_RESET, 0);
/* spec states at least 10ms; using 20 here actualy results in
* something like 16ms as measured by the scope */
mdelay(20);
gpio_set_value(OWHW_GPIO_SWITCH_RESET, 1);
}
static int physom_devices_init(void)
{
if (!of_machine_is_compatible("phytec,am335x-som"))
@ -92,6 +105,12 @@ static int physom_devices_init(void)
if (of_machine_is_compatible("gsmk,owhw")) {
defaultenv_append_directory(defaultenv_gsmk_owhw);
/* 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();
} else if (of_machine_is_compatible("sysmocom,odu")) {
defaultenv_append_directory(defaultenv_sysmocom_odu);
} else {