summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/pm9263/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/pm9263/init.c')
-rw-r--r--arch/arm/boards/pm9263/init.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c
index b17a90a7d1..14e821fd1b 100644
--- a/arch/arm/boards/pm9263/init.c
+++ b/arch/arm/boards/pm9263/init.c
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2009-2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
+ *
* Copyright (C) 2007 Sascha Hauer, Pengutronix
*
* This program is free software; you can redistribute it and/or
@@ -34,6 +36,13 @@
#include <mach/io.h>
#include <mach/at91sam9_smc.h>
#include <mach/sam9_smc.h>
+#include <linux/w1-gpio.h>
+#include <w1_mac_address.h>
+
+struct w1_gpio_platform_data w1_pdata = {
+ .pin = AT91_PIN_PB31,
+ .is_open_drain = 0,
+};
static struct atmel_nand_data nand_pdata = {
.ale = 21,
@@ -85,6 +94,24 @@ static struct at91_ether_platform_data macb_pdata = {
.phy_addr = 0,
};
+static void pm9263_phy_init(void)
+{
+ /*
+ * PB27 enables the 50MHz oscillator for Ethernet PHY
+ * 1 - enable
+ * 0 - disable
+ */
+ at91_set_gpio_output(AT91_PIN_PB27, 1);
+ at91_set_gpio_value(AT91_PIN_PB27, 1); /* 1- enable, 0 - disable */
+}
+
+static void pm9263_add_device_eth(void)
+{
+ w1_local_mac_address_register(0, "ron", "w1-1-0");
+ pm9263_phy_init();
+ at91_add_device_eth(0, &macb_pdata);
+}
+
static int pm9263_mem_init(void)
{
at91_add_device_sdram(64 * 1024 * 1024);
@@ -95,16 +122,11 @@ mem_initcall(pm9263_mem_init);
static int pm9263_devices_init(void)
{
- /*
- * PB27 enables the 50MHz oscillator for Ethernet PHY
- * 1 - enable
- * 0 - disable
- */
- at91_set_gpio_output(AT91_PIN_PB27, 1);
- at91_set_gpio_value(AT91_PIN_PB27, 1); /* 1- enable, 0 - disable */
+ at91_set_gpio_input(w1_pdata.pin, 0);
+ add_generic_device_res("w1-gpio", DEVICE_ID_SINGLE, NULL, 0, &w1_pdata);
pm_add_device_nand();
- at91_add_device_eth(0, &macb_pdata);
+ pm9263_add_device_eth();
add_cfi_flash_device(0, AT91_CHIPSELECT_0, 4 * 1024 * 1024, 0);
devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0");