aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h
blob: b06232d0f8baa16cb7f6f88fb9fe5913425e97e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/******************************************************************************
**
** FILE NAME    : ifxmips_ptm_vdsl.h
** PROJECT      : UEIP
** MODULES      : PTM
**
** DATE         : 7 Jul 2009
** AUTHOR       : Xu Liang
** DESCRIPTION  : PTM driver header file (core functions for VR9)
** COPYRIGHT    :       Copyright (c) 2006
**                      Infineon Technologies AG
**                      Am Campeon 1-12, 85579 Neubiberg, Germany
**
**    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.
**
** HISTORY
** $Date        $Author         $Comment
** 07 JUL 2009  Xu Liang        Init Version
*******************************************************************************/

#ifndef IFXMIPS_PTM_VDSL_H
#define IFXMIPS_PTM_VDSL_H

#include <linux/version.h>
#include <linux/netdevice.h>
#include <lantiq_ptm.h>
#include "ifxmips_ptm_common.h"
#include "ifxmips_ptm_ppe_common.h"
#include "ifxmips_ptm_fw_regs_vdsl.h"

#define INT_NUM_IM2_IRL24	(INT_NUM_IM2_IRL0 + 24)

#define IFX_REG_W32(_v, _r)               __raw_writel((_v), (volatile unsigned int *)(_r))
#define IFX_REG_R32(_r)                    __raw_readl((volatile unsigned int *)(_r))
#define IFX_REG_W32_MASK(_clr, _set, _r)   IFX_REG_W32((IFX_REG_R32((_r)) & ~(_clr)) | (_set), (_r))
#define SET_BITS(x, msb, lsb, value)    (((x) & ~(((1 << ((msb) + 1)) - 1) ^ ((1 << (lsb)) - 1))) | (((value) & ((1 << (1 + (msb) - (lsb))) - 1)) << (lsb)))



/*
 * ####################################
 *              Definition
 * ####################################
 */

/*
 *  Constant Definition
 */
#define ETH_WATCHDOG_TIMEOUT            (10 * HZ)

/*
 *  DMA RX/TX Channel Parameters
 */
#define MAX_ITF_NUMBER                  1
#define MAX_RX_DMA_CHANNEL_NUMBER       1
#define MAX_TX_DMA_CHANNEL_NUMBER       1
#define DATA_BUFFER_ALIGNMENT           EMA_ALIGNMENT
#define DESC_ALIGNMENT                  8

/*
 *  Ethernet Frame Definitions
 */
#define ETH_MAC_HEADER_LENGTH           14
#define ETH_CRC_LENGTH                  4
#define ETH_MIN_FRAME_LENGTH            64
#define ETH_MAX_FRAME_LENGTH            (1518 + 4 * 2)

/*
 *  RX Frame Definitions
 */
#define RX_MAX_BUFFER_SIZE              (1600 + RX_HEAD_MAC_ADDR_ALIGNMENT)
#define RX_HEAD_MAC_ADDR_ALIGNMENT      2
#define RX_TAIL_CRC_LENGTH              0   //  PTM firmware does not have ethernet frame CRC
                                            //  The len in descriptor doesn't include ETH_CRC
                                            //  because ETH_CRC may not present in some configuration



/*
 * ####################################
 *              Data Type
 * ####################################
 */

struct ptm_itf {
    unsigned int                    rx_desc_pos;

    unsigned int                    tx_desc_pos;

    unsigned int                    tx_swap_desc_pos;

    struct net_device_stats         stats;

    struct napi_struct              napi;
};

struct ptm_priv_data {
    struct ptm_itf                  itf[MAX_ITF_NUMBER];
};



/*
 * ####################################
 *             Declaration
 * ####################################
 */

extern unsigned int ifx_ptm_dbg_enable;

extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor);

extern void ifx_ptm_init_chip(void);
extern void ifx_ptm_uninit_chip(void);

extern int ifx_pp32_start(int pp32);
extern void ifx_pp32_stop(int pp32);

extern void ifx_reset_ppe(void);



#endif  //  IFXMIPS_PTM_VDSL_H
" _type) @@ -32,7 +41,7 @@ static const char __UNIQUE_ID(name)[] /* One for each parameter, describing how to use it. Some files do multiple of these per line, so can't just use MODULE_INFO. */ #define MODULE_PARM_DESC(_parm, desc) \ - __MODULE_INFO(parm, _parm, #_parm ":" desc) + __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) struct kernel_param; --- a/init/Kconfig +++ b/init/Kconfig @@ -1835,6 +1835,13 @@ config MODULE_SIG_HASH default "sha384" if MODULE_SIG_SHA384 default "sha512" if MODULE_SIG_SHA512 +config MODULE_STRIPPED + bool "Reduce module size" + depends on MODULES + help + Remove module parameter descriptions, author info, version, aliases, + device tables, etc. + endif # MODULES config INIT_ALL_POSSIBLE --- a/kernel/module.c +++ b/kernel/module.c @@ -2666,6 +2666,7 @@ static struct module *setup_load_info(st static int check_modinfo(struct module *mod, struct load_info *info, int flags) { +#ifndef CONFIG_MODULE_STRIPPED const char *modmagic = get_modinfo(info, "vermagic"); int err; @@ -2691,6 +2692,7 @@ static int check_modinfo(struct module * pr_warn("%s: module is from the staging directory, the quality " "is unknown, you have been warned.\n", mod->name); } +#endif /* Set up license info based on the info section */ set_license(mod, get_modinfo(info, "license")); --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1717,7 +1717,9 @@ static void read_symbols(char *modname) symname = info.strtab + sym->st_name; handle_modversions(mod, &info, sym, symname); +#ifndef CONFIG_MODULE_STRIPPED handle_moddevtable(mod, &info, sym, symname); +#endif } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) @@ -1861,7 +1863,9 @@ static void add_header(struct buffer *b, buf_printf(b, "#include <linux/vermagic.h>\n"); buf_printf(b, "#include <linux/compiler.h>\n"); buf_printf(b, "\n"); +#ifndef CONFIG_MODULE_STRIPPED buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); +#endif buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); @@ -1878,16 +1882,20 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { +#ifndef CONFIG_MODULE_STRIPPED if (is_intree) buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); +#endif } static void add_staging_flag(struct buffer *b, const char *name) { +#ifndef CONFIG_MODULE_STRIPPED static const char *staging_dir = "drivers/staging"; if (strncmp(staging_dir, name, strlen(staging_dir)) == 0) buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); +#endif } /** @@ -1980,11 +1988,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { +#ifndef CONFIG_MODULE_STRIPPED if (mod->srcversion[0]) { buf_printf(b, "\n"); buf_printf(b, "MODULE_INFO(srcversion, \"%s\");\n", mod->srcversion); } +#endif } static void write_if_changed(struct buffer *b, const char *fname) @@ -2213,7 +2223,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); +#ifndef CONFIG_MODULE_STRIPPED add_moddevtable(&buf, mod); +#endif add_srcversion(&buf, mod); sprintf(fname, "%s.mod.c", mod->name);