]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - patches/0092-ENGR000121601-FEC-not-work-in-mx28-u-boot.patch
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / patches / 0092-ENGR000121601-FEC-not-work-in-mx28-u-boot.patch
1 From 029aff138902466bdfc1e62c761e89f8d37e83ea Mon Sep 17 00:00:00 2001
2 From: Terry Lv <r65388@freescale.com>
3 Date: Tue, 16 Mar 2010 16:09:39 +0800
4 Subject: [PATCH] ENGR000121601: FEC not work in mx28 u-boot
5
6 FEC not work in mx28 u-boot.
7
8 Signed-off-by: Terry Lv <r65388@freescale.com>
9 ---
10  drivers/net/mxc_fec.c      |   11 ++++++++++-
11  include/asm-arm/fec.h      |   12 ++++++++++++
12  include/configs/mx28_evk.h |    1 +
13  3 files changed, 23 insertions(+), 1 deletions(-)
14
15 diff --git a/drivers/net/mxc_fec.c b/drivers/net/mxc_fec.c
16 index 1a9f53f..314496e 100644
17 --- a/drivers/net/mxc_fec.c
18 +++ b/drivers/net/mxc_fec.c
19 @@ -336,12 +336,21 @@ static void setFecDuplexSpeed(volatile fec_t *fecp, unsigned char addr,
20  
21         if ((dup_spd >> 16) == FULL) {
22                 /* Set maximum frame length */
23 +#ifdef CONFIG_RMII
24 +               fecp->rcr = FEC_RCR_MAX_FL(PKT_MAXBUF_SIZE) | FEC_RCR_RMII_MODE;
25 +#else
26                 fecp->rcr = FEC_RCR_MAX_FL(PKT_MAXBUF_SIZE) | FEC_RCR_MII_MODE;
27 +#endif
28                 fecp->tcr = FEC_TCR_FDEN;
29         } else {
30                 /* Half duplex mode */
31 +#ifdef CONFIG_RMII
32                 fecp->rcr = FEC_RCR_MAX_FL(PKT_MAXBUF_SIZE) |
33 -                   FEC_RCR_MII_MODE | FEC_RCR_DRT;
34 +                       FEC_RCR_RMII_MODE | FEC_RCR_DRT;
35 +#else
36 +               fecp->rcr = FEC_RCR_MAX_FL(PKT_MAXBUF_SIZE) |
37 +                       FEC_RCR_MII_MODE | FEC_RCR_DRT;
38 +#endif
39                 fecp->tcr &= ~FEC_TCR_FDEN;
40         }
41  
42 diff --git a/include/asm-arm/fec.h b/include/asm-arm/fec.h
43 index 226bb26..48da9c5 100644
44 --- a/include/asm-arm/fec.h
45 +++ b/include/asm-arm/fec.h
46 @@ -212,7 +212,19 @@ typedef struct fec {
47  #define FEC_MIBC_MIB_IDLE              (0x40000000)
48  
49  /* Bit definitions and macros for FEC_RCR */
50 +#define FEC_RCR_GRS                    (0x80000000)
51 +#define FEC_RCR_NO_LGTH_CHECK          (0x40000000)
52  #define FEC_RCR_MAX_FL(x)              (((x)&0x7FF)<<16)
53 +#define FEC_RCR_CNTL_FRM_ENA           (0x00008000)
54 +#define FEC_RCR_CRC_FWD                        (0x00004000)
55 +#define FEC_RCR_PAUSE_FWD              (0x00002000)
56 +#define FEC_RCR_PAD_EN                 (0x00001000)
57 +#define FEC_RCR_RMII_ECHO              (0x00000800)
58 +#define FEC_RCR_RMII_LOOP              (0x00000400)
59 +#define FEC_RCR_RMII_10T               (0x00000200)
60 +#define FEC_RCR_RMII_MODE              (0x00000100)
61 +#define FEC_RCR_SGMII_ENA              (0x00000080)
62 +#define FEC_RCR_RGMII_ENA              (0x00000040)
63  #define FEC_RCR_FCE                    (0x00000020)
64  #define FEC_RCR_BC_REJ                 (0x00000010)
65  #define FEC_RCR_PROM                   (0x00000008)
66 diff --git a/include/configs/mx28_evk.h b/include/configs/mx28_evk.h
67 index fa6069e..a1ca1aa 100644
68 --- a/include/configs/mx28_evk.h
69 +++ b/include/configs/mx28_evk.h
70 @@ -105,6 +105,7 @@
71  #define CONFIG_FEC0_PHY_ADDR           0
72  #define CONFIG_NET_MULTI
73  #define CONFIG_ETH_PRIME
74 +#define CONFIG_RMII
75  #define CONFIG_CMD_MII
76  #define CONFIG_CMD_DHCP
77  #define CONFIG_CMD_PING
78 -- 
79 1.5.4.4
80