diff options
author | Haiying Wang <Haiying.Wang@freescale.com> | 2009-06-04 16:12:41 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-06-12 17:17:02 -0500 |
commit | 8e55258f144764de8902e9f078a7ad4c6c022c2f (patch) | |
tree | c5571e534bb60e01ba69f8eab774f0d5abf417f4 /drivers/qe/uec.h | |
parent | 9a6110897fc9282ade598bbba70ad72b940436e3 (diff) | |
download | u-boot-imx-8e55258f144764de8902e9f078a7ad4c6c022c2f.zip u-boot-imx-8e55258f144764de8902e9f078a7ad4c6c022c2f.tar.gz u-boot-imx-8e55258f144764de8902e9f078a7ad4c6c022c2f.tar.bz2 |
qe: Pass in uec_info struct through uec_initialize
The uec driver contains code to hard code configuration information for the uec
ethernet controllers. This patch creates an array of uec_info structures, which
are then parsed by the corresponding driver instance to determine configuration.
It also creates function uec_standard_init() to initialize all UEC interfaces
for 83xx and 85xx.
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/qe/uec.h')
-rw-r--r-- | drivers/qe/uec.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/qe/uec.h b/drivers/qe/uec.h index 4fd1096..6c408d1 100644 --- a/drivers/qe/uec.h +++ b/drivers/qe/uec.h @@ -650,6 +650,24 @@ typedef enum enet_interface { /* UEC initialization info struct */ +#define STD_UEC_INFO(num) \ +{ \ + .uf_info = { \ + .ucc_num = CONFIG_SYS_UEC##num##_UCC_NUM,\ + .rx_clock = CONFIG_SYS_UEC##num##_RX_CLK, \ + .tx_clock = CONFIG_SYS_UEC##num##_TX_CLK, \ + .eth_type = CONFIG_SYS_UEC##num##_ETH_TYPE,\ + }, \ + .num_threads_tx = UEC_NUM_OF_THREADS_1, \ + .num_threads_rx = UEC_NUM_OF_THREADS_1, \ + .risc_tx = QE_RISC_ALLOCATION_RISC1_AND_RISC2, \ + .risc_rx = QE_RISC_ALLOCATION_RISC1_AND_RISC2, \ + .tx_bd_ring_len = 16, \ + .rx_bd_ring_len = 16, \ + .phy_address = CONFIG_SYS_UEC##num##_PHY_ADDR, \ + .enet_interface = CONFIG_SYS_UEC##num##_INTERFACE_MODE, \ +} + typedef struct uec_info { ucc_fast_info_t uf_info; uec_num_of_threads_e num_threads_tx; @@ -716,4 +734,7 @@ typedef struct uec_private { int oldlink; } uec_private_t; +int uec_initialize(bd_t *bis, uec_info_t *uec_info); +int uec_eth_init(bd_t *bis, uec_info_t *uecs, int num); +int uec_standard_init(bd_t *bis); #endif /* __UEC_H__ */ |