Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / board / bluewater / gurnard / gurnard.c
index 08b1401372c9fb2034db9e2f47d44b9bc3a88c56..2bbb20354888ec82b87db6348aced7e4636ac27b 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Bluewater Systems Snapper 9260/9G20 modules
  *
  * (C) Copyright 2011 Bluewater Systems
  *   Author: Andre Renaud <andre@bluewatersys.com>
  *   Author: Ryan Mallon <ryan@bluewatersys.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <atmel_lcdc.h>
 #include <atmel_mci.h>
 #include <dm.h>
+#include <env.h>
+#include <init.h>
 #include <lcd.h>
 #include <net.h>
 #ifndef CONFIG_DM_ETH
 #include <netdev.h>
 #endif
-#include <spi.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <asm/mach-types.h>
 #include <asm/arch/at91sam9g45_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
@@ -32,6 +33,7 @@
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <dm/uclass-internal.h>
+#include <linux/delay.h>
 
 #ifdef CONFIG_GURNARD_SPLASH
 #include "splash_logo.h"
@@ -340,7 +342,7 @@ int board_init(void)
        at91_set_A_periph(AT91_PIN_PE6, 1);     /* power up */
 
        /* Select the second timing index for board rev 2 */
-       rev_str = getenv("board_rev");
+       rev_str = env_get("board_rev");
        if (rev_str && !strncmp(rev_str, "2", 1)) {
                struct udevice *dev;
 
@@ -367,7 +369,7 @@ int board_late_init(void)
         * Set MAC address so we do not need to init Ethernet before Linux
         * boot
         */
-       env_str = getenv("ethaddr");
+       env_str = env_get("ethaddr");
        if (env_str) {
                struct at91_emac *emac = (struct at91_emac *)ATMEL_BASE_EMAC;
                /* Parse MAC address */
@@ -384,7 +386,7 @@ int board_late_init(void)
                       &emac->sa2l);
                writel((env_enetaddr[4] | env_enetaddr[5] << 8), &emac->sa2h);
 
-               printf("MAC:   %s\n", getenv("ethaddr"));
+               printf("MAC:   %s\n", env_get("ethaddr"));
        } else {
                /* Not set in environment */
                printf("MAC:   not set\n");
@@ -414,25 +416,6 @@ void reset_phy(void)
 {
 }
 
-/* SPI chip select control - only used for FPGA programming */
-#ifdef CONFIG_ATMEL_SPI
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       return bus == 0 && cs == 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-       /* We don't use chipselects for FPGA programming */
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-       /* We don't use chipselects for FPGA programming */
-}
-#endif /* CONFIG_ATMEL_SPI */
-
 static struct atmel_serial_platdata at91sam9260_serial_plat = {
        .base_addr = ATMEL_BASE_DBGU,
 };