All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenyou Yang <wenyou.yang@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/3] board: at91sam9m10g45ek: Clean up code
Date: Wed, 12 Apr 2017 17:03:41 +0800	[thread overview]
Message-ID: <20170412090342.19543-3-wenyou.yang@atmel.com> (raw)
In-Reply-To: <20170412090342.19543-1-wenyou.yang@atmel.com>

Since the introduction of the pinctrl and clk drivers and the
device tree files, remove unneeded hard coded related code from
the board file.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

Changes in v2: None

 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 102 ------------------------
 1 file changed, 102 deletions(-)

diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
index 6871916865..2e8ea053fc 100644
--- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
@@ -17,11 +17,6 @@
 #include <lcd.h>
 #include <linux/mtd/nand.h>
 #include <atmel_lcdc.h>
-#include <atmel_mci.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
-#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -149,39 +144,6 @@ static void at91sam9m10g45ek_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_MACB
-static void at91sam9m10g45ek_macb_hw_init(void)
-{
-	struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-
-	at91_periph_clk_enable(ATMEL_ID_EMAC);
-
-	/*
-	 * Disable pull-up on:
-	 *      RXDV (PA15) => PHY normal mode (not Test mode)
-	 *      ERX0 (PA12) => PHY ADDR0
-	 *      ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0
-	 *
-	 * PHY has internal pull-down
-	 */
-	writel(pin_to_mask(AT91_PIN_PA15) |
-	       pin_to_mask(AT91_PIN_PA12) |
-	       pin_to_mask(AT91_PIN_PA13),
-	       &pioa->pudr);
-
-	at91_phy_reset();
-
-	/* Re-enable pull-up */
-	writel(pin_to_mask(AT91_PIN_PA15) |
-	       pin_to_mask(AT91_PIN_PA12) |
-	       pin_to_mask(AT91_PIN_PA13),
-	       &pioa->puer);
-
-	/* And the pins. */
-	at91_macb_hw_init();
-}
-#endif
-
 #ifdef CONFIG_LCD
 
 vidinfo_t panel_info = {
@@ -280,18 +242,8 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-int board_mmc_init(bd_t *bis)
-{
-	at91_mci_hw_init();
-
-	return atmel_mci_init((void *)ATMEL_BASE_MCI0);
-}
-#endif
-
 int board_early_init_f(void)
 {
-	at91_seriald_hw_init();
 	return 0;
 }
 
@@ -313,15 +265,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_USB
 	at91sam9m10g45ek_usb_hw_init();
 #endif
-#ifdef CONFIG_HAS_DATAFLASH
-	at91_spi0_hw_init(1 << 0);
-#endif
-#ifdef CONFIG_ATMEL_SPI
-	at91_spi0_hw_init(1 << 4);
-#endif
-#ifdef CONFIG_MACB
-	at91sam9m10g45ek_macb_hw_init();
-#endif
 #ifdef CONFIG_LCD
 	at91sam9m10g45ek_lcd_hw_init();
 #endif
@@ -340,48 +283,3 @@ void reset_phy(void)
 {
 }
 #endif
-
-int board_eth_init(bd_t *bis)
-{
-	int rc = 0;
-#ifdef CONFIG_MACB
-	rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
-#endif
-	return rc;
-}
-
-/* SPI chip select control */
-#ifdef CONFIG_ATMEL_SPI
-#include <spi.h>
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs < 2;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	switch(slave->cs) {
-		case 1:
-			at91_set_gpio_output(AT91_PIN_PB18, 0);
-			break;
-		case 0:
-		default:
-			at91_set_gpio_output(AT91_PIN_PB3, 0);
-			break;
-	}
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	switch(slave->cs) {
-		case 1:
-			at91_set_gpio_output(AT91_PIN_PB18, 1);
-			break;
-		case 0:
-		default:
-			at91_set_gpio_output(AT91_PIN_PB3, 1);
-		break;
-	}
-}
-#endif /* CONFIG_ATMEL_SPI */
-- 
2.11.0

  parent reply	other threads:[~2017-04-12  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  9:03 [U-Boot] [PATCH v2 0/3] board: at91sam9m10g45ek: Convert to support DM and DT Wenyou Yang
2017-04-12  9:03 ` [U-Boot] [PATCH v2 1/3] configs: at91sam9m10g45ek: Update to support DM/DT Wenyou Yang
2017-04-16 19:30   ` Simon Glass
2017-04-12  9:03 ` Wenyou Yang [this message]
2017-04-16 19:30   ` [U-Boot] [PATCH v2 2/3] board: at91sam9m10g45ek: Clean up code Simon Glass
2017-04-12  9:03 ` [U-Boot] [PATCH v2 3/3] board: at91sam9m10g45ek: Enable early debug UART Wenyou Yang
2017-04-16 19:31   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170412090342.19543-3-wenyou.yang@atmel.com \
    --to=wenyou.yang@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.