summaryrefslogtreecommitdiff
path: root/board/bluewater/snapper9260/snapper9260.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-29 13:09:01 -0600
committerSimon Glass <sjg@chromium.org>2014-11-21 08:10:03 +0100
commit1a1927f3a3c6cf0a0bfb51c0d9b3139ed2cb7a31 (patch)
tree9829ac6bd151fbafbcadbb799e339c25c34331b4 /board/bluewater/snapper9260/snapper9260.c
parent0f65f48b6480ea18497675b30e5463dfd0c60cbe (diff)
downloadu-boot-imx-1a1927f3a3c6cf0a0bfb51c0d9b3139ed2cb7a31.zip
u-boot-imx-1a1927f3a3c6cf0a0bfb51c0d9b3139ed2cb7a31.tar.gz
u-boot-imx-1a1927f3a3c6cf0a0bfb51c0d9b3139ed2cb7a31.tar.bz2
dm: at91: Convert snapper9260 to use driver model
Convert this at91sam9260-based board to use driver model. This should serve as an example for other similar boards. Serial and GPIO are supported so far. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Diffstat (limited to 'board/bluewater/snapper9260/snapper9260.c')
-rw-r--r--board/bluewater/snapper9260/snapper9260.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/board/bluewater/snapper9260/snapper9260.c b/board/bluewater/snapper9260/snapper9260.c
index bfde129..95633b0 100644
--- a/board/bluewater/snapper9260/snapper9260.c
+++ b/board/bluewater/snapper9260/snapper9260.c
@@ -9,12 +9,15 @@
*/
#include <common.h>
+#include <dm.h>
#include <asm/io.h>
+#include <asm/gpio.h>
#include <asm/arch/at91sam9260_matrix.h>
#include <asm/arch/at91sam9_smc.h>
#include <asm/arch/at91_common.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/gpio.h>
+#include <asm/arch/atmel_serial.h>
#include <net.h>
#include <netdev.h>
#include <i2c.h>
@@ -95,10 +98,12 @@ static void nand_hw_init(void)
&smc->cs[3].mode);
/* Configure RDY/BSY */
- at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+ gpio_request(CONFIG_SYS_NAND_READY_PIN, "nand_rdy");
+ gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
/* Enable NandFlash */
- at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+ gpio_request(CONFIG_SYS_NAND_ENABLE_PIN, "nand_ce");
+ gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
}
int board_init(void)
@@ -140,3 +145,12 @@ int dram_init(void)
void reset_phy(void)
{
}
+
+static struct atmel_serial_platdata at91sam9260_serial_plat = {
+ .base_addr = ATMEL_BASE_DBGU,
+};
+
+U_BOOT_DEVICE(at91sam9260_serial) = {
+ .name = "serial_atmel",
+ .platdata = &at91sam9260_serial_plat,
+};