1 /******************************************************************************
3 ** FILE NAME : ifxmips_ptm_adsl.h
9 ** DESCRIPTION : PTM driver header file (core functions for Danube/Amazon-SE/
11 ** COPYRIGHT : Copyright (c) 2006
12 ** Infineon Technologies AG
13 ** Am Campeon 1-12, 85579 Neubiberg, Germany
15 ** This program is free software; you can redistribute it and/or modify
16 ** it under the terms of the GNU General Public License as published by
17 ** the Free Software Foundation; either version 2 of the License, or
18 ** (at your option) any later version.
21 ** $Date $Author $Comment
22 ** 17 JUN 2009 Xu Liang Init Version
23 *******************************************************************************/
25 #ifndef IFXMIPS_PTM_ADSL_H
26 #define IFXMIPS_PTM_ADSL_H
30 #include <linux/version.h>
31 #include <linux/netdevice.h>
32 #include <lantiq_ptm.h>
33 #include "ifxmips_ptm_common.h"
34 #include "ifxmips_ptm_ppe_common.h"
35 #include "ifxmips_ptm_fw_regs_adsl.h"
37 #define CONFIG_IFXMIPS_DSL_CPE_MEI
39 #define IFX_REG_W32(_v, _r) __raw_writel((_v), (volatile unsigned int *)(_r))
40 #define IFX_REG_R32(_r) __raw_readl((volatile unsigned int *)(_r))
41 #define IFX_REG_W32_MASK(_clr, _set, _r) IFX_REG_W32((IFX_REG_R32((_r)) & ~(_clr)) | (_set), (_r))
42 #define SET_BITS(x, msb, lsb, value) (((x) & ~(((1 << ((msb) + 1)) - 1) ^ ((1 << (lsb)) - 1))) | (((value) & ((1 << (1 + (msb) - (lsb))) - 1)) << (lsb)))
48 * ####################################
50 * ####################################
56 #define ETH_WATCHDOG_TIMEOUT (2 * HZ)
59 * DMA RX/TX Channel Parameters
61 #define MAX_ITF_NUMBER 2
62 #define MAX_RX_DMA_CHANNEL_NUMBER MAX_ITF_NUMBER
63 #define MAX_TX_DMA_CHANNEL_NUMBER MAX_ITF_NUMBER
64 #define DATA_BUFFER_ALIGNMENT EMA_ALIGNMENT
65 #define DESC_ALIGNMENT 8
68 * Ethernet Frame Definitions
70 #define ETH_MAC_HEADER_LENGTH 14
71 #define ETH_CRC_LENGTH 4
72 #define ETH_MIN_FRAME_LENGTH 64
73 #define ETH_MAX_FRAME_LENGTH (1518 + 4 * 2)
76 * RX Frame Definitions
78 #define RX_HEAD_MAC_ADDR_ALIGNMENT 2
79 #define RX_TAIL_CRC_LENGTH 0 // PTM firmware does not have ethernet frame CRC
80 // The len in descriptor doesn't include ETH_CRC
81 // because ETH_CRC may not present in some configuration
86 * ####################################
88 * ####################################
92 volatile struct rx_descriptor
*rx_desc
;
93 unsigned int rx_desc_pos
;
95 volatile struct tx_descriptor
*tx_desc
;
96 unsigned int tx_desc_pos
;
97 struct sk_buff
**tx_skb
;
99 struct net_device_stats stats
;
101 struct napi_struct napi
;
104 struct ptm_priv_data
{
105 struct ptm_itf itf
[MAX_ITF_NUMBER
];
116 * ####################################
118 * ####################################
121 extern unsigned int ifx_ptm_dbg_enable
;
123 extern void ifx_ptm_get_fw_ver(unsigned int *major
, unsigned int *minor
);
125 extern void ifx_ptm_init_chip(struct platform_device
*pdev
);
126 extern void ifx_ptm_uninit_chip(void);
128 extern int ifx_pp32_start(int pp32
);
129 extern void ifx_pp32_stop(int pp32
);
131 extern void ifx_reset_ppe(void);
133 extern int ifx_ptm_proc_read_regs(char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
);
137 #endif // IFXMIPS_PTM_ADSL_H