diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-05 12:59:54 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-05 12:59:54 +0200 |
commit | 6662e16dbbe426933a09d0564943b43fa10b9457 (patch) | |
tree | db85d5358cfc50a3941b6a5a26e3b536e4092b92 /arch/ppc/mach-mpc85xx | |
parent | bed1a6ffab6ba8f59146af07ccbdc7a625b6496f (diff) | |
parent | fa345fa012fda102e6e0f428f45bbe5c0bfcff66 (diff) | |
download | barebox-6662e16dbbe426933a09d0564943b43fa10b9457.tar.gz barebox-6662e16dbbe426933a09d0564943b43fa10b9457.tar.xz |
Merge branch 'for-next/ppc'
Conflicts:
arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
arch/ppc/configs/p2020rdb_defconfig
arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h
Diffstat (limited to 'arch/ppc/mach-mpc85xx')
-rw-r--r-- | arch/ppc/mach-mpc85xx/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/mach-mpc85xx/eth-devices.c | 49 | ||||
-rw-r--r-- | arch/ppc/mach-mpc85xx/include/mach/gianfar.h | 31 | ||||
-rw-r--r-- | arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h | 8 |
4 files changed, 89 insertions, 0 deletions
diff --git a/arch/ppc/mach-mpc85xx/Makefile b/arch/ppc/mach-mpc85xx/Makefile index 03addaf47b..af9be29271 100644 --- a/arch/ppc/mach-mpc85xx/Makefile +++ b/arch/ppc/mach-mpc85xx/Makefile @@ -6,3 +6,4 @@ obj-y += fsl_law.o obj-y += speed.o obj-y +=time.o obj-$(CONFIG_MP) += mp.o +obj-$(CONFIG_DRIVER_NET_GIANFAR) += eth-devices.o diff --git a/arch/ppc/mach-mpc85xx/eth-devices.c b/arch/ppc/mach-mpc85xx/eth-devices.c new file mode 100644 index 0000000000..02a3722136 --- /dev/null +++ b/arch/ppc/mach-mpc85xx/eth-devices.c @@ -0,0 +1,49 @@ +/* + * Copyright 2012 GE Intelligent Platforms, Inc + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <driver.h> +#include <mach/immap_85xx.h> +#include <mach/gianfar.h> + +int fsl_eth_init(int num, struct gfar_info_struct *gf) +{ + 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, gf); + + return 0; +} diff --git a/arch/ppc/mach-mpc85xx/include/mach/gianfar.h b/arch/ppc/mach-mpc85xx/include/mach/gianfar.h new file mode 100644 index 0000000000..ae3163865c --- /dev/null +++ b/arch/ppc/mach-mpc85xx/include/mach/gianfar.h @@ -0,0 +1,31 @@ +/* + * Copyright 2012 GE Intelligent Platforms, Inc. + * Copyright 2004, 2007, 2009 Freescale Semiconductor, Inc. + * (C) Copyright 2003, Motorola, Inc. + * based on tsec.h by Xianghua Xiao and Andy Fleming 2003-2009 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * Platform data for the Motorola Triple Speed Ethernet Controller + */ + +struct gfar_info_struct { + unsigned int phyaddr; + unsigned int tbiana; + unsigned int tbicr; +}; + +int fsl_eth_init(int num, struct gfar_info_struct *gf); diff --git a/arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h b/arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h index b686a09b6a..cd43023259 100644 --- a/arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h +++ b/arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h @@ -39,6 +39,11 @@ #define MPC85xx_GPIO_OFFSET 0xf000 #define MPC85xx_L2_OFFSET 0x20000 +#ifdef CONFIG_TSECV2 +#define TSEC1_OFFSET 0xB0000 +#else +#define TSEC1_OFFSET 0x24000 +#endif #define MPC85xx_PIC_OFFSET 0x40000 #define MPC85xx_GUTS_OFFSET 0xe0000 @@ -129,6 +134,9 @@ #define MPC85xx_DEVDISR_TB1 0x00001000 #define MPC85xx_GUTS_RSTCR_OFFSET 0xb0 +#define GFAR_BASE_ADDR (CFG_IMMR + TSEC1_OFFSET) +#define MDIO_BASE_ADDR (CFG_IMMR + 0x24000) + #define I2C1_BASE_ADDR (CFG_IMMR + 0x3000) #define I2C2_BASE_ADDR (CFG_IMMR + 0x3100) |