summaryrefslogtreecommitdiff
path: root/board/atmel
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2019-05-03 16:24:21 +0300
committerEugen Hristev <eugen.hristev@microchip.com>2019-05-15 09:34:22 +0300
commit2950c514e8fc2c9d6a48cd7187521bc648dc679e (patch)
treecc707dd99982e542f2ea64afb89a71f1c0ffffcf /board/atmel
parent57fbd36c668dfe0bff7eb2bca9c0d3d625f84185 (diff)
board: atmel: sama5d2_icp: standby disable on CAN transceivers in SPL
The 2 CAN transceivers have a STBDY pin which must be low in order to operate. This pin is tied to PB25. Set it to 0 in bootstrap. At a later time, this needs to be controlled by Linux power management system, or requested by some driver as a gpio and tied to 0 during CAN link up. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Diffstat (limited to 'board/atmel')
-rw-r--r--board/atmel/sama5d2_icp/sama5d2_icp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/atmel/sama5d2_icp/sama5d2_icp.c b/board/atmel/sama5d2_icp/sama5d2_icp.c
index 1c28aaba85..f55ea2c6f8 100644
--- a/board/atmel/sama5d2_icp/sama5d2_icp.c
+++ b/board/atmel/sama5d2_icp/sama5d2_icp.c
@@ -73,6 +73,12 @@ int misc_init_r(void)
/* SPL */
#ifdef CONFIG_SPL_BUILD
+/* must set PB25 low to enable the CAN transceivers */
+static void board_can_stdby_dis(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 25, 0);
+}
+
/* deassert reset lines for external periph in case of warm reboot */
static void board_reset_additional_periph(void)
{
@@ -111,6 +117,7 @@ void spl_board_init(void)
spl_mmc_init();
#endif
board_reset_additional_periph();
+ board_can_stdby_dis();
}
void spl_display_print(void)