From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from exprod5og102.obsmtp.com ([64.18.0.143]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Su41X-0001Jr-QL for barebox@lists.infradead.org; Wed, 25 Jul 2012 16:01:22 +0000 From: Renaud Barbier Date: Wed, 25 Jul 2012 17:01:01 +0100 Message-Id: <1343232061-1789-4-git-send-email-renaud.barbier@ge.com> In-Reply-To: <1343232061-1789-1-git-send-email-renaud.barbier@ge.com> References: <1343232061-1789-1-git-send-email-renaud.barbier@ge.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/3] ppc: P2020RDB Ethernet configuration To: barebox@lists.infradead.org Minimal support of the Ethernet interface on the P2020RDB board. Only the eTSEC3 interface is supported. Signed-off-by: Renaud Barbier --- arch/ppc/boards/freescale-p2020rdb/p2020rdb.c | 38 +++++++++++++++++++++++++ arch/ppc/configs/p2020rdb_defconfig | 6 ++++ 2 files changed, 44 insertions(+), 0 deletions(-) diff --git a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c index 20897cb..201220f 100644 --- a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c +++ b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #define VSC7385_RST_SET 0x00080000 @@ -61,10 +62,47 @@ #define SYSCLK_50 50000000 #define SYSCLK_100 100000000 +/* Ethernet. Use eTSEC3 */ +static struct gfar_info_struct gfar_info[] = { + { + .phyaddr = 1, + .tbiana = 0, + .tbicr = 0, + .flags = 0, + }, +}; + +static int board_eth_init(int num, int idx) +{ + struct resource *res; + + res = xzalloc(3 * sizeof(struct resource)); + /* TSEC interface registers */ + res[0].start = GFAR_BASE_ADDR + ((num - 1) * 0x1000); + res[0].end = res[0].start + 0x1000; + res[0].flags = IORESOURCE_MEM; + /* External PHY access always through eTSEC1 */ + res[1].start = MDIO_BASE_ADDR; + res[1].end = res[1].start + 0x1000; + res[1].flags = IORESOURCE_MEM; + /* Access to TBI/RTBI interface. */ + res[2].start = MDIO_BASE_ADDR + ((num - 1) * 0x1000); + res[2].end = res[2].start + 0x1000; + res[2].flags = IORESOURCE_MEM; + + add_generic_device_res("gfar", DEVICE_ID_DYNAMIC, res, 3, + &gfar_info[idx]); + + return 0; +} + static int devices_init(void) { add_cfi_flash_device(-1, CFG_FLASH_BASE, 16 << 20, 0); + /* eTSEC3 */ + board_eth_init(3, 0); + devfs_add_partition("nor0", 0xf80000, 0x80000, DEVFS_PARTITION_FIXED, "self0"); return 0; diff --git a/arch/ppc/configs/p2020rdb_defconfig b/arch/ppc/configs/p2020rdb_defconfig index f8a0687..d025a40 100644 --- a/arch/ppc/configs/p2020rdb_defconfig +++ b/arch/ppc/configs/p2020rdb_defconfig @@ -21,3 +21,9 @@ CONFIG_MALLOC_SIZE=0x200000 CONFIG_BAUDRATE=115200 CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_RELOCATABLE=y +CONFIG_DRIVER_NET_GIANFAR=y +CONFIG_NET=y +CONFIG_NET_PING=y +CONFIG_NET_TFTP=y +CONFIG_PING=y +CONFIG_TFTP=y -- 1.7.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox