summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-06-10 09:41:00 -0400
committerTom Rini <trini@konsulko.com>2019-06-10 09:41:00 -0400
commiteb53a18c9e903e35e8e8d52da96c33b63822881c (patch)
treed16ce6e74188cec829be799e76caa1a744e12a25 /board
parent5973901826c73462306fbe4051bc3643dca6b88f (diff)
parent9ed91550d548f76f40e22f0562ff3c4ba15f85c7 (diff)
Merge tag 'u-boot-atmel-fixes-2019.07-a' of git://git.denx.de/u-boot-atmel
First set of u-boot-atmel fixes for 2019.07 cycle
Diffstat (limited to 'board')
-rw-r--r--board/atmel/sama5d2_icp/sama5d2_icp.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/board/atmel/sama5d2_icp/sama5d2_icp.c b/board/atmel/sama5d2_icp/sama5d2_icp.c
index 807cfcdb19..1593e2bd4e 100644
--- a/board/atmel/sama5d2_icp/sama5d2_icp.c
+++ b/board/atmel/sama5d2_icp/sama5d2_icp.c
@@ -73,6 +73,36 @@ 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);
+}
+
+static void board_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 0, 0); /* RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 1, 1); /* GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 31, 0); /* BLUE */
+}
+
+/* deassert reset lines for external periph in case of warm reboot */
+static void board_reset_additional_periph(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 16, 0); /* LAN9252_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTC, 2, 0); /* HSIC_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTC, 17, 0); /* USB2534_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTD, 4, 0); /* KSZ8563_RST */
+}
+
+static void board_start_additional_periph(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 16, 1); /* LAN9252_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTC, 2, 1); /* HSIC_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTC, 17, 1); /* USB2534_RST */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTD, 4, 1); /* KSZ8563_RST */
+}
+
#ifdef CONFIG_SD_BOOT
void spl_mmc_init(void)
{
@@ -93,12 +123,20 @@ void spl_board_init(void)
#ifdef CONFIG_SD_BOOT
spl_mmc_init();
#endif
+ board_reset_additional_periph();
+ board_can_stdby_dis();
+ board_leds_init();
}
void spl_display_print(void)
{
}
+void spl_board_prepare_for_boot(void)
+{
+ board_start_additional_periph();
+}
+
static void ddrc_conf(struct atmel_mpddrc_config *ddrc)
{
ddrc->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR3_SDRAM);