100-dsl_compat.patch 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  1. Index: drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_device_danube.h
  2. ===================================================================
  3. --- drv_dsl_cpe_api-3.24.4.4.orig/src/include/drv_dsl_cpe_device_danube.h 2009-05-12 20:02:16.000000000 +0200
  4. +++ drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_device_danube.h 2012-11-29 19:47:21.060210322 +0100
  5. @@ -24,7 +24,7 @@
  6. #include "drv_dsl_cpe_simulator_danube.h"
  7. #else
  8. /* Include for the low level driver interface header file */
  9. -#include "asm/ifx/ifx_mei_bsp.h"
  10. +#include "ifxmips_mei_interface.h"
  11. #endif /* defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/
  12. #define DSL_MAX_LINE_NUMBER 1
  13. Index: drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c
  14. ===================================================================
  15. --- drv_dsl_cpe_api-3.24.4.4.orig/src/common/drv_dsl_cpe_os_linux.c 2009-07-13 11:33:43.000000000 +0200
  16. +++ drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c 2012-11-29 19:46:32.700209112 +0100
  17. @@ -11,6 +11,7 @@
  18. #ifdef __LINUX__
  19. #define DSL_INTERN
  20. +#include <linux/device.h>
  21. #include "drv_dsl_cpe_api.h"
  22. #include "drv_dsl_cpe_api_ioctl.h"
  23. @@ -34,9 +35,13 @@
  24. static DSL_ssize_t DSL_DRV_Write(DSL_DRV_file_t *pFile, const DSL_char_t * pBuf,
  25. DSL_DRV_size_t nSize, DSL_DRV_offset_t * pLoff);
  26. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  27. static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile,
  28. DSL_uint_t nCommand, unsigned long nArg);
  29. -
  30. +#else
  31. +static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_file_t * pFile,
  32. + DSL_uint_t nCommand, unsigned long nArg);
  33. +#endif
  34. static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
  35. static int DSL_DRV_Release(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
  36. @@ -72,7 +77,11 @@
  37. open: DSL_DRV_Open,
  38. release: DSL_DRV_Release,
  39. write: DSL_DRV_Write,
  40. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  41. ioctl: DSL_DRV_Ioctls,
  42. +#else
  43. + unlocked_ioctl: DSL_DRV_Ioctls,
  44. +#endif
  45. poll: DSL_DRV_Poll
  46. };
  47. #else
  48. @@ -168,10 +177,17 @@
  49. \return Success or failure.
  50. \ingroup Internal
  51. */
  52. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
  53. static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode,
  54. DSL_DRV_file_t * pFile,
  55. DSL_uint_t nCommand,
  56. unsigned long nArg)
  57. +#else
  58. +static DSL_int_t DSL_DRV_Ioctls(
  59. + DSL_DRV_file_t * pFile,
  60. + DSL_uint_t nCommand,
  61. + unsigned long nArg)
  62. +#endif
  63. {
  64. DSL_int_t nErr=0;
  65. DSL_boolean_t bIsInKernel;
  66. @@ -216,16 +232,7 @@
  67. }
  68. }
  69. }
  70. -
  71. - if (pINode == DSL_NULL)
  72. - {
  73. - bIsInKernel = DSL_TRUE;
  74. - }
  75. - else
  76. - {
  77. - bIsInKernel = DSL_FALSE;
  78. - }
  79. -
  80. + bIsInKernel = DSL_FALSE;
  81. if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) ||
  82. (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) ||
  83. (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_PM) ||
  84. @@ -1058,6 +1065,7 @@
  85. /* Entry point of driver */
  86. int __init DSL_ModuleInit(void)
  87. {
  88. + struct class *dsl_class;
  89. DSL_int_t i;
  90. printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
  91. @@ -1104,7 +1112,8 @@
  92. }
  93. DSL_DRV_DevNodeInit();
  94. -
  95. + dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
  96. + device_create(dsl_class, NULL, MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0), NULL, "dsl_cpe_api");
  97. return 0;
  98. }
  99. Index: drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_os_linux.h
  100. ===================================================================
  101. --- drv_dsl_cpe_api-3.24.4.4.orig/src/include/drv_dsl_cpe_os_linux.h 2009-07-03 17:04:51.000000000 +0200
  102. +++ drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_os_linux.h 2012-11-29 19:47:23.092210377 +0100
  103. @@ -17,17 +17,17 @@
  104. #endif
  105. #include <asm/ioctl.h>
  106. -#include <linux/autoconf.h>
  107. +#include <generated/autoconf.h>
  108. #include <linux/module.h>
  109. #include <linux/kernel.h>
  110. #include <linux/init.h>
  111. #include <linux/ctype.h>
  112. #include <linux/version.h>
  113. #include <linux/spinlock.h>
  114. -
  115. +#include <linux/sched.h>
  116. #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))
  117. - #include <linux/utsrelease.h>
  118. + #include <generated/utsrelease.h>
  119. #endif
  120. #include <linux/types.h>
  121. Index: drv_dsl_cpe_api-3.24.4.4/src/ifxmips_mei_interface.h
  122. ===================================================================
  123. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  124. +++ drv_dsl_cpe_api-3.24.4.4/src/ifxmips_mei_interface.h 2012-11-29 19:47:54.972211177 +0100
  125. @@ -0,0 +1,702 @@
  126. +/******************************************************************************
  127. +
  128. + Copyright (c) 2009
  129. + Infineon Technologies AG
  130. + Am Campeon 1-12; 81726 Munich, Germany
  131. +
  132. + For licensing information, see the file 'LICENSE' in the root folder of
  133. + this software module.
  134. +
  135. +******************************************************************************/
  136. +
  137. +#ifndef IFXMIPS_MEI_H
  138. +#define IFXMIPS_MEI_H
  139. +
  140. +//#define CONFIG_AMAZON_SE 1
  141. +//#define CONFIG_DANUBE 1
  142. +//#define CONFIG_AR9 1
  143. +
  144. +#if !defined(CONFIG_DANUBE) && !defined(CONFIG_AMAZON_SE) && !defined(CONFIG_AR9) && !defined(CONFIG_VR9)
  145. +#error Platform undefined!!!
  146. +#endif
  147. +
  148. +#ifdef IFX_MEI_BSP
  149. +/** This is the character datatype. */
  150. +typedef char DSL_char_t;
  151. +/** This is the unsigned 8-bit datatype. */
  152. +typedef unsigned char DSL_uint8_t;
  153. +/** This is the signed 8-bit datatype. */
  154. +typedef signed char DSL_int8_t;
  155. +/** This is the unsigned 16-bit datatype. */
  156. +typedef unsigned short DSL_uint16_t;
  157. +/** This is the signed 16-bit datatype. */
  158. +typedef signed short DSL_int16_t;
  159. +/** This is the unsigned 32-bit datatype. */
  160. +typedef unsigned long DSL_uint32_t;
  161. +/** This is the signed 32-bit datatype. */
  162. +typedef signed long DSL_int32_t;
  163. +/** This is the float datatype. */
  164. +typedef float DSL_float_t;
  165. +/** This is the void datatype. */
  166. +typedef void DSL_void_t;
  167. +/** integer type, width is depending on processor arch */
  168. +typedef int DSL_int_t;
  169. +/** unsigned integer type, width is depending on processor arch */
  170. +typedef unsigned int DSL_uint_t;
  171. +typedef struct file DSL_DRV_file_t;
  172. +typedef struct inode DSL_DRV_inode_t;
  173. +
  174. +/**
  175. + * Defines all possible CMV groups
  176. + * */
  177. +typedef enum {
  178. + DSL_CMV_GROUP_CNTL = 1,
  179. + DSL_CMV_GROUP_STAT = 2,
  180. + DSL_CMV_GROUP_INFO = 3,
  181. + DSL_CMV_GROUP_TEST = 4,
  182. + DSL_CMV_GROUP_OPTN = 5,
  183. + DSL_CMV_GROUP_RATE = 6,
  184. + DSL_CMV_GROUP_PLAM = 7,
  185. + DSL_CMV_GROUP_CNFG = 8
  186. +} DSL_CmvGroup_t;
  187. +/**
  188. + * Defines all opcode types
  189. + * */
  190. +typedef enum {
  191. + H2D_CMV_READ = 0x00,
  192. + H2D_CMV_WRITE = 0x04,
  193. + H2D_CMV_INDICATE_REPLY = 0x10,
  194. + H2D_ERROR_OPCODE_UNKNOWN =0x20,
  195. + H2D_ERROR_CMV_UNKNOWN =0x30,
  196. +
  197. + D2H_CMV_READ_REPLY =0x01,
  198. + D2H_CMV_WRITE_REPLY = 0x05,
  199. + D2H_CMV_INDICATE = 0x11,
  200. + D2H_ERROR_OPCODE_UNKNOWN = 0x21,
  201. + D2H_ERROR_CMV_UNKNOWN = 0x31,
  202. + D2H_ERROR_CMV_READ_NOT_AVAILABLE = 0x41,
  203. + D2H_ERROR_CMV_WRITE_ONLY = 0x51,
  204. + D2H_ERROR_CMV_READ_ONLY = 0x61,
  205. +
  206. + H2D_DEBUG_READ_DM = 0x02,
  207. + H2D_DEBUG_READ_PM = 0x06,
  208. + H2D_DEBUG_WRITE_DM = 0x0a,
  209. + H2D_DEBUG_WRITE_PM = 0x0e,
  210. +
  211. + D2H_DEBUG_READ_DM_REPLY = 0x03,
  212. + D2H_DEBUG_READ_FM_REPLY = 0x07,
  213. + D2H_DEBUG_WRITE_DM_REPLY = 0x0b,
  214. + D2H_DEBUG_WRITE_FM_REPLY = 0x0f,
  215. + D2H_ERROR_ADDR_UNKNOWN = 0x33,
  216. +
  217. + D2H_AUTONOMOUS_MODEM_READY_MSG = 0xf1
  218. +} DSL_CmvOpcode_t;
  219. +
  220. +/* mutex macros */
  221. +#define MEI_MUTEX_INIT(id,flag) \
  222. + sema_init(&id,flag)
  223. +#define MEI_MUTEX_LOCK(id) \
  224. + down_interruptible(&id)
  225. +#define MEI_MUTEX_UNLOCK(id) \
  226. + up(&id)
  227. +#define MEI_WAIT(ms) \
  228. + {\
  229. + set_current_state(TASK_INTERRUPTIBLE);\
  230. + schedule_timeout(ms);\
  231. + }
  232. +#define MEI_INIT_WAKELIST(name,queue) \
  233. + init_waitqueue_head(&queue)
  234. +
  235. +/* wait for an event, timeout is measured in ms */
  236. +#define MEI_WAIT_EVENT_TIMEOUT(ev,timeout)\
  237. + interruptible_sleep_on_timeout(&ev,timeout * HZ / 1000)
  238. +#define MEI_WAKEUP_EVENT(ev)\
  239. + wake_up_interruptible(&ev)
  240. +#endif /* IFX_MEI_BSP */
  241. +
  242. +/*** Register address offsets, relative to MEI_SPACE_ADDRESS ***/
  243. +#define ME_DX_DATA (0x0000)
  244. +#define ME_VERSION (0x0004)
  245. +#define ME_ARC_GP_STAT (0x0008)
  246. +#define ME_DX_STAT (0x000C)
  247. +#define ME_DX_AD (0x0010)
  248. +#define ME_DX_MWS (0x0014)
  249. +#define ME_ME2ARC_INT (0x0018)
  250. +#define ME_ARC2ME_STAT (0x001C)
  251. +#define ME_ARC2ME_MASK (0x0020)
  252. +#define ME_DBG_WR_AD (0x0024)
  253. +#define ME_DBG_RD_AD (0x0028)
  254. +#define ME_DBG_DATA (0x002C)
  255. +#define ME_DBG_DECODE (0x0030)
  256. +#define ME_CONFIG (0x0034)
  257. +#define ME_RST_CTRL (0x0038)
  258. +#define ME_DBG_MASTER (0x003C)
  259. +#define ME_CLK_CTRL (0x0040)
  260. +#define ME_BIST_CTRL (0x0044)
  261. +#define ME_BIST_STAT (0x0048)
  262. +#define ME_XDATA_BASE_SH (0x004c)
  263. +#define ME_XDATA_BASE (0x0050)
  264. +#define ME_XMEM_BAR_BASE (0x0054)
  265. +#define ME_XMEM_BAR0 (0x0054)
  266. +#define ME_XMEM_BAR1 (0x0058)
  267. +#define ME_XMEM_BAR2 (0x005C)
  268. +#define ME_XMEM_BAR3 (0x0060)
  269. +#define ME_XMEM_BAR4 (0x0064)
  270. +#define ME_XMEM_BAR5 (0x0068)
  271. +#define ME_XMEM_BAR6 (0x006C)
  272. +#define ME_XMEM_BAR7 (0x0070)
  273. +#define ME_XMEM_BAR8 (0x0074)
  274. +#define ME_XMEM_BAR9 (0x0078)
  275. +#define ME_XMEM_BAR10 (0x007C)
  276. +#define ME_XMEM_BAR11 (0x0080)
  277. +#define ME_XMEM_BAR12 (0x0084)
  278. +#define ME_XMEM_BAR13 (0x0088)
  279. +#define ME_XMEM_BAR14 (0x008C)
  280. +#define ME_XMEM_BAR15 (0x0090)
  281. +#define ME_XMEM_BAR16 (0x0094)
  282. +
  283. +#define WHILE_DELAY 20000
  284. +/*
  285. +** Define where in ME Processor's memory map the Stratify chip lives
  286. +*/
  287. +
  288. +#define MAXSWAPSIZE (8 * 1024) //8k *(32bits)
  289. +
  290. +// Mailboxes
  291. +#define MSG_LENGTH 16 // x16 bits
  292. +#define YES_REPLY 1
  293. +#define NO_REPLY 0
  294. +
  295. +#define CMV_TIMEOUT 1000 //jiffies
  296. +
  297. +// Block size per BAR
  298. +#define SDRAM_SEGMENT_SIZE (64*1024)
  299. +// Number of Bar registers
  300. +#define MAX_BAR_REGISTERS (17)
  301. +
  302. +#define XDATA_REGISTER (15)
  303. +
  304. +// ARC register addresss
  305. +#define ARC_STATUS 0x0
  306. +#define ARC_LP_START 0x2
  307. +#define ARC_LP_END 0x3
  308. +#define ARC_DEBUG 0x5
  309. +#define ARC_INT_MASK 0x10A
  310. +
  311. +#define IRAM0_BASE (0x00000)
  312. +#define IRAM1_BASE (0x04000)
  313. +#if defined(CONFIG_DANUBE)
  314. +#define BRAM_BASE (0x0A000)
  315. +#elif defined(CONFIG_AMAZON_SE) || defined(CONFIG_AR9) || defined(CONFIG_VR9)
  316. +#define BRAM_BASE (0x08000)
  317. +#endif
  318. +#define XRAM_BASE (0x18000)
  319. +#define YRAM_BASE (0x1A000)
  320. +#define EXT_MEM_BASE (0x80000)
  321. +#define ARC_GPIO_CTRL (0xC030)
  322. +#define ARC_GPIO_DATA (0xC034)
  323. +
  324. +#define IRAM0_SIZE (16*1024)
  325. +#define IRAM1_SIZE (16*1024)
  326. +#define BRAM_SIZE (12*1024)
  327. +#define XRAM_SIZE (8*1024)
  328. +#define YRAM_SIZE (8*1024)
  329. +#define EXT_MEM_SIZE (1536*1024)
  330. +
  331. +#define ADSL_BASE (0x20000)
  332. +#define CRI_BASE (ADSL_BASE + 0x11F00)
  333. +#define CRI_CCR0 (CRI_BASE + 0x00)
  334. +#define CRI_RST (CRI_BASE + 0x04*4)
  335. +#define ADSL_DILV_BASE (ADSL_BASE+0x20000)
  336. +
  337. +//
  338. +#define IRAM0_ADDR_BIT_MASK 0xFFF
  339. +#define IRAM1_ADDR_BIT_MASK 0xFFF
  340. +#define BRAM_ADDR_BIT_MASK 0xFFF
  341. +#define RX_DILV_ADDR_BIT_MASK 0x1FFF
  342. +
  343. +/*** Bit definitions ***/
  344. +#define ARC_AUX_HALT (1 << 25)
  345. +#define ARC_DEBUG_HALT (1 << 1)
  346. +#define FALSE 0
  347. +#define TRUE 1
  348. +#define BIT0 (1<<0)
  349. +#define BIT1 (1<<1)
  350. +#define BIT2 (1<<2)
  351. +#define BIT3 (1<<3)
  352. +#define BIT4 (1<<4)
  353. +#define BIT5 (1<<5)
  354. +#define BIT6 (1<<6)
  355. +#define BIT7 (1<<7)
  356. +#define BIT8 (1<<8)
  357. +#define BIT9 (1<<9)
  358. +#define BIT10 (1<<10)
  359. +#define BIT11 (1<<11)
  360. +#define BIT12 (1<<12)
  361. +#define BIT13 (1<<13)
  362. +#define BIT14 (1<<14)
  363. +#define BIT15 (1<<15)
  364. +#define BIT16 (1<<16)
  365. +#define BIT17 (1<<17)
  366. +#define BIT18 (1<<18)
  367. +#define BIT19 (1<<19)
  368. +#define BIT20 (1<<20)
  369. +#define BIT21 (1<<21)
  370. +#define BIT22 (1<<22)
  371. +#define BIT23 (1<<23)
  372. +#define BIT24 (1<<24)
  373. +#define BIT25 (1<<25)
  374. +#define BIT26 (1<<26)
  375. +#define BIT27 (1<<27)
  376. +#define BIT28 (1<<28)
  377. +#define BIT29 (1<<29)
  378. +#define BIT30 (1<<30)
  379. +#define BIT31 (1<<31)
  380. +
  381. +// CRI_CCR0 Register definitions
  382. +#define CLK_2M_MODE_ENABLE BIT6
  383. +#define ACL_CLK_MODE_ENABLE BIT4
  384. +#define FDF_CLK_MODE_ENABLE BIT2
  385. +#define STM_CLK_MODE_ENABLE BIT0
  386. +
  387. +// CRI_RST Register definitions
  388. +#define FDF_SRST BIT3
  389. +#define MTE_SRST BIT2
  390. +#define FCI_SRST BIT1
  391. +#define AAI_SRST BIT0
  392. +
  393. +// MEI_TO_ARC_INTERRUPT Register definitions
  394. +#define MEI_TO_ARC_INT1 BIT3
  395. +#define MEI_TO_ARC_INT0 BIT2
  396. +#define MEI_TO_ARC_CS_DONE BIT1 //need to check
  397. +#define MEI_TO_ARC_MSGAV BIT0
  398. +
  399. +// ARC_TO_MEI_INTERRUPT Register definitions
  400. +#define ARC_TO_MEI_INT1 BIT8
  401. +#define ARC_TO_MEI_INT0 BIT7
  402. +#define ARC_TO_MEI_CS_REQ BIT6
  403. +#define ARC_TO_MEI_DBG_DONE BIT5
  404. +#define ARC_TO_MEI_MSGACK BIT4
  405. +#define ARC_TO_MEI_NO_ACCESS BIT3
  406. +#define ARC_TO_MEI_CHECK_AAITX BIT2
  407. +#define ARC_TO_MEI_CHECK_AAIRX BIT1
  408. +#define ARC_TO_MEI_MSGAV BIT0
  409. +
  410. +// ARC_TO_MEI_INTERRUPT_MASK Register definitions
  411. +#define GP_INT1_EN BIT8
  412. +#define GP_INT0_EN BIT7
  413. +#define CS_REQ_EN BIT6
  414. +#define DBG_DONE_EN BIT5
  415. +#define MSGACK_EN BIT4
  416. +#define NO_ACC_EN BIT3
  417. +#define AAITX_EN BIT2
  418. +#define AAIRX_EN BIT1
  419. +#define MSGAV_EN BIT0
  420. +
  421. +#define MEI_SOFT_RESET BIT0
  422. +
  423. +#define HOST_MSTR BIT0
  424. +
  425. +#define JTAG_MASTER_MODE 0x0
  426. +#define MEI_MASTER_MODE HOST_MSTR
  427. +
  428. +// MEI_DEBUG_DECODE Register definitions
  429. +#define MEI_DEBUG_DEC_MASK (0x3)
  430. +#define MEI_DEBUG_DEC_AUX_MASK (0x0)
  431. +#define ME_DBG_DECODE_DMP1_MASK (0x1)
  432. +#define MEI_DEBUG_DEC_DMP2_MASK (0x2)
  433. +#define MEI_DEBUG_DEC_CORE_MASK (0x3)
  434. +
  435. +#define AUX_STATUS (0x0)
  436. +#define AUX_ARC_GPIO_CTRL (0x10C)
  437. +#define AUX_ARC_GPIO_DATA (0x10D)
  438. +// ARC_TO_MEI_MAILBOX[11] is a special location used to indicate
  439. +// page swap requests.
  440. +#if defined(CONFIG_DANUBE)
  441. +#define OMBOX_BASE 0xDF80
  442. +#define ARC_TO_MEI_MAILBOX 0xDFA0
  443. +#define IMBOX_BASE 0xDFC0
  444. +#define MEI_TO_ARC_MAILBOX 0xDFD0
  445. +#elif defined(CONFIG_AMAZON_SE) || defined(CONFIG_AR9) || defined(CONFIG_VR9)
  446. +#define OMBOX_BASE 0xAF80
  447. +#define ARC_TO_MEI_MAILBOX 0xAFA0
  448. +#define IMBOX_BASE 0xAFC0
  449. +#define MEI_TO_ARC_MAILBOX 0xAFD0
  450. +#endif
  451. +
  452. +#define MEI_TO_ARC_MAILBOXR (MEI_TO_ARC_MAILBOX + 0x2C)
  453. +#define ARC_MEI_MAILBOXR (ARC_TO_MEI_MAILBOX + 0x2C)
  454. +#define OMBOX1 (OMBOX_BASE+0x4)
  455. +
  456. +// Codeswap request messages are indicated by setting BIT31
  457. +#define OMB_CODESWAP_MESSAGE_MSG_TYPE_MASK (0x80000000)
  458. +
  459. +// Clear Eoc messages received are indicated by setting BIT17
  460. +#define OMB_CLEAREOC_INTERRUPT_CODE (0x00020000)
  461. +#define OMB_REBOOT_INTERRUPT_CODE (1 << 18)
  462. +
  463. +/*
  464. +** Swap page header
  465. +*/
  466. +// Page must be loaded at boot time if size field has BIT31 set
  467. +#define BOOT_FLAG (BIT31)
  468. +#define BOOT_FLAG_MASK ~BOOT_FLAG
  469. +
  470. +#define FREE_RELOAD 1
  471. +#define FREE_SHOWTIME 2
  472. +#define FREE_ALL 3
  473. +
  474. +// marcos
  475. +#define IFX_MEI_WRITE_REGISTER_L(data,addr) *((volatile u32*)(addr)) = (u32)(data)
  476. +#define IFX_MEI_READ_REGISTER_L(addr) (*((volatile u32*)(addr)))
  477. +#define SET_BIT(reg, mask) reg |= (mask)
  478. +#define CLEAR_BIT(reg, mask) reg &= (~mask)
  479. +#define CLEAR_BITS(reg, mask) CLEAR_BIT(reg, mask)
  480. +//#define SET_BITS(reg, mask) SET_BIT(reg, mask)
  481. +#define SET_BITFIELD(reg, mask, off, val) {reg &= (~mask); reg |= (val << off);}
  482. +
  483. +#define ALIGN_SIZE ( 1L<<10 ) //1K size align
  484. +#define MEM_ALIGN(addr) (((addr) + ALIGN_SIZE - 1) & ~ (ALIGN_SIZE -1) )
  485. +
  486. +// swap marco
  487. +#define MEI_HALF_WORD_SWAP(data) {data = ((data & 0xffff)<<16) + ((data & 0xffff0000)>>16);}
  488. +#define MEI_BYTE_SWAP(data) {data = ((data & 0xff)<<24) + ((data & 0xff00)<<8)+ ((data & 0xff0000)>>8)+ ((data & 0xff000000)>>24);}
  489. +
  490. +
  491. +#ifdef CONFIG_PROC_FS
  492. +typedef struct reg_entry
  493. +{
  494. + int *flag;
  495. + char name[30]; /* big enough to hold names */
  496. + char description[100]; /* big enough to hold description */
  497. + unsigned short low_ino;
  498. +} reg_entry_t;
  499. +#endif
  500. +// Swap page header describes size in 32-bit words, load location, and image offset
  501. +// for program and/or data segments
  502. +typedef struct _arc_swp_page_hdr {
  503. + u32 p_offset; //Offset bytes of progseg from beginning of image
  504. + u32 p_dest; //Destination addr of progseg on processor
  505. + u32 p_size; //Size in 32-bitwords of program segment
  506. + u32 d_offset; //Offset bytes of dataseg from beginning of image
  507. + u32 d_dest; //Destination addr of dataseg on processor
  508. + u32 d_size; //Size in 32-bitwords of data segment
  509. +} ARC_SWP_PAGE_HDR;
  510. +
  511. +/*
  512. +** Swap image header
  513. +*/
  514. +#define GET_PROG 0 // Flag used for program mem segment
  515. +#define GET_DATA 1 // Flag used for data mem segment
  516. +
  517. +// Image header contains size of image, checksum for image, and count of
  518. +// page headers. Following that are 'count' page headers followed by
  519. +// the code and/or data segments to be loaded
  520. +typedef struct _arc_img_hdr {
  521. + u32 size; // Size of binary image in bytes
  522. + u32 checksum; // Checksum for image
  523. + u32 count; // Count of swp pages in image
  524. + ARC_SWP_PAGE_HDR page[1]; // Should be "count" pages - '1' to make compiler happy
  525. +} ARC_IMG_HDR;
  526. +
  527. +typedef struct smmu_mem_info {
  528. + int type;
  529. + int boot;
  530. + unsigned long nCopy;
  531. + unsigned long size;
  532. + unsigned char *address;
  533. + unsigned char *org_address;
  534. +} smmu_mem_info_t;
  535. +
  536. +#ifdef __KERNEL__
  537. +typedef struct ifx_mei_device_private {
  538. + int modem_ready;
  539. + int arcmsgav;
  540. + int cmv_reply;
  541. + int cmv_waiting;
  542. + // Mei to ARC CMV count, reply count, ARC Indicator count
  543. + int modem_ready_cnt;
  544. + int cmv_count;
  545. + int reply_count;
  546. + unsigned long image_size;
  547. + int nBar;
  548. + u16 Recent_indicator[MSG_LENGTH];
  549. +
  550. + u16 CMV_RxMsg[MSG_LENGTH] __attribute__ ((aligned (4)));
  551. +
  552. + smmu_mem_info_t adsl_mem_info[MAX_BAR_REGISTERS];
  553. + ARC_IMG_HDR *img_hdr;
  554. + // to wait for arc cmv reply, sleep on wait_queue_arcmsgav;
  555. + wait_queue_head_t wait_queue_arcmsgav;
  556. + wait_queue_head_t wait_queue_modemready;
  557. + struct semaphore mei_cmv_sema;
  558. +} ifx_mei_device_private_t;
  559. +#endif
  560. +typedef struct winhost_message {
  561. + union {
  562. + u16 RxMessage[MSG_LENGTH] __attribute__ ((aligned (4)));
  563. + u16 TxMessage[MSG_LENGTH] __attribute__ ((aligned (4)));
  564. + } msg;
  565. +} DSL_DEV_WinHost_Message_t;
  566. +/********************************************************************************************************
  567. + * DSL CPE API Driver Stack Interface Definitions
  568. + * *****************************************************************************************************/
  569. +/** IOCTL codes for bsp driver */
  570. +#define DSL_IOC_MEI_BSP_MAGIC 's'
  571. +
  572. +#define DSL_FIO_BSP_DSL_START _IO (DSL_IOC_MEI_BSP_MAGIC, 0)
  573. +#define DSL_FIO_BSP_RUN _IO (DSL_IOC_MEI_BSP_MAGIC, 1)
  574. +#define DSL_FIO_BSP_FREE_RESOURCE _IO (DSL_IOC_MEI_BSP_MAGIC, 2)
  575. +#define DSL_FIO_BSP_RESET _IO (DSL_IOC_MEI_BSP_MAGIC, 3)
  576. +#define DSL_FIO_BSP_REBOOT _IO (DSL_IOC_MEI_BSP_MAGIC, 4)
  577. +#define DSL_FIO_BSP_HALT _IO (DSL_IOC_MEI_BSP_MAGIC, 5)
  578. +#define DSL_FIO_BSP_BOOTDOWNLOAD _IO (DSL_IOC_MEI_BSP_MAGIC, 6)
  579. +#define DSL_FIO_BSP_JTAG_ENABLE _IO (DSL_IOC_MEI_BSP_MAGIC, 7)
  580. +#define DSL_FIO_FREE_RESOURCE _IO (DSL_IOC_MEI_BSP_MAGIC, 8)
  581. +#define DSL_FIO_ARC_MUX_TEST _IO (DSL_IOC_MEI_BSP_MAGIC, 9)
  582. +#define DSL_FIO_BSP_REMOTE _IOW (DSL_IOC_MEI_BSP_MAGIC, 10, u32)
  583. +#define DSL_FIO_BSP_GET_BASE_ADDRESS _IOR (DSL_IOC_MEI_BSP_MAGIC, 11, u32)
  584. +#define DSL_FIO_BSP_IS_MODEM_READY _IOR (DSL_IOC_MEI_BSP_MAGIC, 12, u32)
  585. +#define DSL_FIO_BSP_GET_VERSION _IOR (DSL_IOC_MEI_BSP_MAGIC, 13, DSL_DEV_Version_t)
  586. +#define DSL_FIO_BSP_CMV_WINHOST _IOWR(DSL_IOC_MEI_BSP_MAGIC, 14, DSL_DEV_WinHost_Message_t)
  587. +#define DSL_FIO_BSP_CMV_READ _IOWR(DSL_IOC_MEI_BSP_MAGIC, 15, DSL_DEV_MeiReg_t)
  588. +#define DSL_FIO_BSP_CMV_WRITE _IOW (DSL_IOC_MEI_BSP_MAGIC, 16, DSL_DEV_MeiReg_t)
  589. +#define DSL_FIO_BSP_DEBUG_READ _IOWR(DSL_IOC_MEI_BSP_MAGIC, 17, DSL_DEV_MeiDebug_t)
  590. +#define DSL_FIO_BSP_DEBUG_WRITE _IOWR(DSL_IOC_MEI_BSP_MAGIC, 18, DSL_DEV_MeiDebug_t)
  591. +#define DSL_FIO_BSP_GET_CHIP_INFO _IOR (DSL_IOC_MEI_BSP_MAGIC, 19, DSL_DEV_HwVersion_t)
  592. +
  593. +#define DSL_DEV_MEIDEBUG_BUFFER_SIZES 512
  594. +
  595. +typedef struct DSL_DEV_MeiDebug
  596. +{
  597. + DSL_uint32_t iAddress;
  598. + DSL_uint32_t iCount;
  599. + DSL_uint32_t buffer[DSL_DEV_MEIDEBUG_BUFFER_SIZES];
  600. +} DSL_DEV_MeiDebug_t; /* meidebug */
  601. +
  602. +/**
  603. + * Structure is used for debug access only.
  604. + * Refer to configure option INCLUDE_ADSL_WINHOST_DEBUG */
  605. +typedef struct struct_meireg
  606. +{
  607. + /*
  608. + * Specifies that address for debug access */
  609. + unsigned long iAddress;
  610. + /*
  611. + * Specifies the pointer to the data that has to be written or returns a
  612. + * pointer to the data that has been read out*/
  613. + unsigned long iData;
  614. +} DSL_DEV_MeiReg_t; /* meireg */
  615. +
  616. +typedef struct DSL_DEV_Device
  617. +{
  618. + DSL_int_t nInUse; /* modem state, update by bsp driver, */
  619. + DSL_void_t *pPriv;
  620. + DSL_uint32_t base_address; /* mei base address */
  621. + DSL_int_t nIrq[2]; /* irq number */
  622. +#define IFX_DFEIR 0
  623. +#define IFX_DYING_GASP 1
  624. + DSL_DEV_MeiDebug_t lop_debugwr; /* dying gasp */
  625. +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
  626. + struct module *owner;
  627. +#endif
  628. +} DSL_DEV_Device_t; /* ifx_adsl_device_t */
  629. +
  630. +#define DSL_DEV_PRIVATE(dev) ((ifx_mei_device_private_t*)(dev->pPriv))
  631. +
  632. +typedef struct DSL_DEV_Version /* ifx_adsl_bsp_version */
  633. +{
  634. + unsigned long major;
  635. + unsigned long minor;
  636. + unsigned long revision;
  637. +} DSL_DEV_Version_t; /* ifx_adsl_bsp_version_t */
  638. +
  639. +typedef struct DSL_DEV_ChipInfo
  640. +{
  641. + unsigned long major;
  642. + unsigned long minor;
  643. +} DSL_DEV_HwVersion_t;
  644. +
  645. +typedef struct
  646. +{
  647. + DSL_uint8_t dummy;
  648. +} DSL_DEV_DeviceConfig_t;
  649. +
  650. +/** error code definitions */
  651. +typedef enum DSL_DEV_MeiError
  652. +{
  653. + DSL_DEV_MEI_ERR_SUCCESS = 0,
  654. + DSL_DEV_MEI_ERR_FAILURE = -1,
  655. + DSL_DEV_MEI_ERR_MAILBOX_FULL = -2,
  656. + DSL_DEV_MEI_ERR_MAILBOX_EMPTY = -3,
  657. + DSL_DEV_MEI_ERR_MAILBOX_TIMEOUT = -4
  658. +} DSL_DEV_MeiError_t; /* MEI_ERROR */
  659. +
  660. +typedef enum {
  661. + DSL_BSP_MEMORY_READ=0,
  662. + DSL_BSP_MEMORY_WRITE,
  663. +} DSL_BSP_MemoryAccessType_t; /* ifx_adsl_memory_access_type_t */
  664. +
  665. +typedef enum
  666. +{
  667. + DSL_LED_LINK_ID=0,
  668. + DSL_LED_DATA_ID
  669. +} DSL_DEV_LedId_t; /* ifx_adsl_led_id_t */
  670. +
  671. +typedef enum
  672. +{
  673. + DSL_LED_LINK_TYPE=0,
  674. + DSL_LED_DATA_TYPE
  675. +} DSL_DEV_LedType_t; /* ifx_adsl_led_type_t */
  676. +
  677. +typedef enum
  678. +{
  679. + DSL_LED_HD_CPU=0,
  680. + DSL_LED_HD_FW
  681. +} DSL_DEV_LedHandler_t; /* ifx_adsl_led_handler_t */
  682. +
  683. +typedef enum {
  684. + DSL_LED_ON=0,
  685. + DSL_LED_OFF,
  686. + DSL_LED_FLASH,
  687. +} DSL_DEV_LedMode_t; /* ifx_adsl_led_mode_t */
  688. +
  689. +typedef enum {
  690. + DSL_CPU_HALT=0,
  691. + DSL_CPU_RUN,
  692. + DSL_CPU_RESET,
  693. +} DSL_DEV_CpuMode_t; /* ifx_adsl_cpu_mode_t */
  694. +
  695. +#if 0
  696. +typedef enum {
  697. + DSL_BSP_EVENT_DYING_GASP = 0,
  698. + DSL_BSP_EVENT_CEOC_IRQ,
  699. +} DSL_BSP_Event_id_t; /* ifx_adsl_event_id_t */
  700. +
  701. +typedef union DSL_BSP_CB_Param
  702. +{
  703. + DSL_uint32_t nIrqMessage;
  704. +} DSL_BSP_CB_Param_t; /* ifx_adsl_cbparam_t */
  705. +
  706. +typedef struct DSL_BSP_CB_Event
  707. +{
  708. + DSL_BSP_Event_id_t nID;
  709. + DSL_DEV_Device_t *pDev;
  710. + DSL_BSP_CB_Param_t *pParam;
  711. +} DSL_BSP_CB_Event_t; /* ifx_adsl_cb_event_t */
  712. +#endif
  713. +
  714. +/* external functions (from the BSP Driver) */
  715. +extern DSL_DEV_Device_t* DSL_BSP_DriverHandleGet(int, int);
  716. +extern DSL_int_t DSL_BSP_DriverHandleDelete(DSL_DEV_Device_t *);
  717. +extern DSL_DEV_MeiError_t DSL_BSP_FWDownload(DSL_DEV_Device_t *, const DSL_char_t *, DSL_uint32_t, DSL_int32_t *, DSL_int32_t *);
  718. +extern int DSL_BSP_KernelIoctls(DSL_DEV_Device_t *, unsigned int, unsigned long);
  719. +extern DSL_DEV_MeiError_t DSL_BSP_SendCMV(DSL_DEV_Device_t *, DSL_uint16_t *, DSL_int_t, DSL_uint16_t *);
  720. +extern DSL_DEV_MeiError_t DSL_BSP_AdslLedInit(DSL_DEV_Device_t *, DSL_DEV_LedId_t, DSL_DEV_LedType_t, DSL_DEV_LedHandler_t);
  721. +extern DSL_DEV_MeiError_t DSL_BSP_Showtime(DSL_DEV_Device_t *, DSL_uint32_t, DSL_uint32_t);
  722. +extern int DSL_BSP_ATMLedCBRegister( int (*ifx_adsl_ledcallback)(void));
  723. +extern DSL_DEV_MeiError_t DSL_BSP_MemoryDebugAccess(DSL_DEV_Device_t *, DSL_BSP_MemoryAccessType_t, DSL_uint32_t, DSL_uint32_t *, DSL_uint32_t);
  724. +extern volatile DSL_DEV_Device_t *adsl_dev;
  725. +
  726. +/**
  727. + * Dummy structure by now to show mechanism of extended data that will be
  728. + * provided within event callback itself.
  729. + * */
  730. +typedef struct
  731. +{
  732. + /**
  733. + * Dummy value */
  734. + DSL_uint32_t nDummy1;
  735. +} DSL_BSP_CB_Event1DataDummy_t;
  736. +
  737. +/**
  738. + * Dummy structure by now to show mechanism of extended data that will be
  739. + * provided within event callback itself.
  740. + * */
  741. +typedef struct
  742. +{
  743. + /**
  744. + * Dummy value */
  745. + DSL_uint32_t nDummy2;
  746. +} DSL_BSP_CB_Event2DataDummy_t;
  747. +
  748. +/**
  749. + * encapsulate all data structures that are necessary for status event
  750. + * callbacks.
  751. + * */
  752. +typedef union
  753. +{
  754. + DSL_BSP_CB_Event1DataDummy_t dataEvent1;
  755. + DSL_BSP_CB_Event2DataDummy_t dataEvent2;
  756. +} DSL_BSP_CB_DATA_Union_t;
  757. +
  758. +
  759. +typedef enum
  760. +{
  761. + /**
  762. + * Informs the upper layer driver (DSL CPE API) about a reboot request from the
  763. + * firmware.
  764. + * \note This event does NOT include any additional data.
  765. + * More detailed information upon reboot reason has to be requested from
  766. + * upper layer software via CMV (INFO 109) if necessary. */
  767. + DSL_BSP_CB_FIRST = 0,
  768. + DSL_BSP_CB_DYING_GASP,
  769. + DSL_BSP_CB_CEOC_IRQ,
  770. + DSL_BSP_CB_FIRMWARE_REBOOT,
  771. + /**
  772. + * Delimiter only */
  773. + DSL_BSP_CB_LAST
  774. +} DSL_BSP_CB_Type_t;
  775. +
  776. +/**
  777. + * Specifies the common event type that has to be used for registering and
  778. + * signalling of interrupts/autonomous status events from MEI BSP Driver.
  779. + *
  780. + * \param pDev
  781. + * Context pointer from MEI BSP Driver.
  782. + *
  783. + * \param IFX_ADSL_BSP_CallbackType_t
  784. + * Specifies the event callback type (reason of callback). Regrading to the
  785. + * setting of this value the data which is included in the following union
  786. + * might have different meanings.
  787. + * Please refer to the description of the union to get information about the
  788. + * meaning of the included data.
  789. + *
  790. + * \param pData
  791. + * Data according to \ref DSL_BSP_CB_DATA_Union_t.
  792. + * If this pointer is NULL there is no additional data available.
  793. + *
  794. + * \return depending on event
  795. + */
  796. +typedef int (*DSL_BSP_EventCallback_t)
  797. +(
  798. + DSL_DEV_Device_t *pDev,
  799. + DSL_BSP_CB_Type_t nCallbackType,
  800. + DSL_BSP_CB_DATA_Union_t *pData
  801. +);
  802. +
  803. +typedef struct {
  804. + DSL_BSP_EventCallback_t function;
  805. + DSL_BSP_CB_Type_t event;
  806. + DSL_BSP_CB_DATA_Union_t *pData;
  807. +} DSL_BSP_EventCallBack_t;
  808. +
  809. +extern int DSL_BSP_EventCBRegister(DSL_BSP_EventCallBack_t *);
  810. +extern int DSL_BSP_EventCBUnregister(DSL_BSP_EventCallBack_t *);
  811. +
  812. +/** Modem states */
  813. +#define DSL_DEV_STAT_InitState 0x0000
  814. +#define DSL_DEV_STAT_ReadyState 0x0001
  815. +#define DSL_DEV_STAT_FailState 0x0002
  816. +#define DSL_DEV_STAT_IdleState 0x0003
  817. +#define DSL_DEV_STAT_QuietState 0x0004
  818. +#define DSL_DEV_STAT_GhsState 0x0005
  819. +#define DSL_DEV_STAT_FullInitState 0x0006
  820. +#define DSL_DEV_STAT_ShowTimeState 0x0007
  821. +#define DSL_DEV_STAT_FastRetrainState 0x0008
  822. +#define DSL_DEV_STAT_LoopDiagMode 0x0009
  823. +#define DSL_DEV_STAT_ShortInit 0x000A /* Bis short initialization */
  824. +
  825. +#define DSL_DEV_STAT_CODESWAP_COMPLETE 0x0002
  826. +
  827. +#endif //IFXMIPS_MEI_H
  828. --- a/configure.in
  829. +++ b/configure.in
  830. @@ -310,7 +310,7 @@
  831. AC_ARG_ENABLE(kernelbuild,
  832. AC_HELP_STRING(--enable-kernel-build=x,Set the target kernel build path),
  833. [
  834. - if test -e $enableval/include/linux/autoconf.h; then
  835. + if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
  836. AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
  837. else
  838. AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
  839. @@ -333,12 +333,12 @@
  840. echo Set the lib_ifxos include path $enableval
  841. AC_SUBST([IFXOS_INCLUDE_PATH],[$enableval])
  842. else
  843. - echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
  844. + echo Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
  845. AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH])
  846. fi
  847. ],
  848. [
  849. - echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
  850. + echo Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
  851. AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH])
  852. ]
  853. )
  854. @@ -1702,73 +1702,73 @@
  855. AC_SUBST([DISTCHECK_CONFIGURE_PARAMS],[$CONFIGURE_OPTIONS])
  856. AC_CONFIG_COMMANDS_PRE([
  857. -echo -e "------------------------------------------------------------------------"
  858. -echo -e " Configuration for drv_dsl_cpe_api:"
  859. -echo -e " Configure model type: $DSL_CONFIG_MODEL_TYPE"
  860. -echo -e " Source code location: $srcdir"
  861. -echo -e " Compiler: $CC"
  862. -echo -e " Compiler c-flags: $CFLAGS"
  863. -echo -e " Extra compiler c-flags: $EXTRA_DRV_CFLAGS"
  864. -echo -e " Host System Type: $host"
  865. -echo -e " Install path: $prefix"
  866. -echo -e " Linux kernel include path: $KERNEL_INCL_PATH"
  867. -echo -e " Linux kernel build path: $KERNEL_BUILD_PATH"
  868. -echo -e " Linux kernel architecture: $KERNEL_ARCH"
  869. -echo -e " Include IFXOS: $INCLUDE_DSL_CPE_API_IFXOS_SUPPORT"
  870. -echo -e " IFXOS include path: $IFXOS_INCLUDE_PATH"
  871. -echo -e " Driver Include Path $DSL_DRIVER_INCL_PATH"
  872. -echo -e " DSL device: $DSL_DEVICE_NAME"
  873. -echo -e " Max device number: $DSL_DRV_MAX_DEVICE_NUMBER"
  874. -echo -e " Channels per line: $DSL_CHANNELS_PER_LINE"
  875. -echo -e " Build lib (only for kernel 2.6) $DSL_CPE_API_LIBRARY_BUILD_2_6"
  876. -echo -e " DSL data led flash frequency: $DSL_DATA_LED_FLASH_FREQUENCY Hz"
  877. -echo -e " Disable debug prints: $DSL_DEBUG_DISABLE"
  878. -echo -e " Preselection of max. debug level: $DSL_DBG_MAX_LEVEL_SET"
  879. -echo -e " Preselected max. debug level: $DSL_DBG_MAX_LEVEL_PRE"
  880. -echo -e " Include deprecated functions: $INCLUDE_DEPRECATED"
  881. -echo -e " Include Device Exception Codes: $INCLUDE_DEVICE_EXCEPTION_CODES"
  882. -echo -e " Include FW request support: $INCLUDE_FW_REQUEST_SUPPORT"
  883. -echo -e " Include ADSL trace buffer: $INCLUDE_DSL_CPE_TRACE_BUFFER"
  884. -echo -e " Include ADSL MIB: $INCLUDE_DSL_ADSL_MIB"
  885. -echo -e " Include ADSL LED: $INCLUDE_ADSL_LED"
  886. -echo -e " Include CEOC: $INCLUDE_DSL_CEOC"
  887. -echo -e " Include config get support: $INCLUDE_DSL_CONFIG_GET"
  888. -echo -e " Include System i/f configuration: $INCLUDE_DSL_SYSTEM_INTERFACE"
  889. -echo -e " Include Resource Statistics: $INCLUDE_DSL_RESOURCE_STATISTICS"
  890. -echo -e " Include Framing Parameters: $INCLUDE_DSL_FRAMING_PARAMETERS"
  891. -echo -e " Include G997 Line Inventory: $INCLUDE_DSL_G997_LINE_INVENTORY"
  892. -echo -e " Include G997 Framing Parameters: $INCLUDE_DSL_G997_FRAMING_PARAMETERS"
  893. -echo -e " Include G997 per tone data: $INCLUDE_DSL_G997_PER_TONE"
  894. -echo -e " Include G997 status: $INCLUDE_DSL_G997_STATUS"
  895. -echo -e " Include G997 alarm: $INCLUDE_DSL_G997_ALARM"
  896. -echo -e " Include DSL Bonding: $INCLUDE_DSL_BONDING"
  897. -echo -e " Include Misc Line Status $INCLUDE_DSL_CPE_MISC_LINE_STATUS"
  898. -echo -e " Include DELT: $INCLUDE_DSL_DELT"
  899. -echo -e " Include DELT data static storage: $DSL_CPE_STATIC_DELT_DATA"
  900. -echo -e " Include PM: $INCLUDE_DSL_PM"
  901. -echo -e " Include PM config: $INCLUDE_DSL_CPE_PM_CONFIG"
  902. -echo -e " Include PM total: $INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS"
  903. -echo -e " Include PM history: $INCLUDE_DSL_CPE_PM_HISTORY"
  904. -echo -e " Include PM showtime: $INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS"
  905. -echo -e " Include PM optional: $INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS"
  906. -echo -e " Include PM line: $INCLUDE_DSL_CPE_PM_LINE_COUNTERS"
  907. -echo -e " Include PM line event showtime: $INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS"
  908. -echo -e " Include PM channel: $INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS"
  909. -echo -e " Include PM channel extended: $INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS"
  910. -echo -e " Include PM data path: $INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS"
  911. -echo -e " Include PM data path failure: $INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS"
  912. -echo -e " Include PM ReTx: $INCLUDE_DSL_CPE_PM_RETX_COUNTERS"
  913. -echo -e " Include PM line threshold: $INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS"
  914. -echo -e " Include PM channel threshold: $INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS"
  915. -echo -e " Include PM data path threshold: $INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS"
  916. -echo -e " Include PM ReTx threshold: $INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS"
  917. -echo -e " Include FW memory free support: $INCLUDE_DSL_FIRMWARE_MEMORY_FREE"
  918. -echo -e "----------------------- deprectated ! ----------------------------------"
  919. -echo -e " Include PM line failure: $INCLUDE_DSL_CPE_PM_LINE_FAILURE_COUNTERS"
  920. -echo -e ""
  921. -echo -e " Settings:"
  922. -echo -e " Configure options: $CONFIGURE_OPTIONS"
  923. -echo -e "------------------------------------------------------------------------"
  924. +echo "------------------------------------------------------------------------"
  925. +echo " Configuration for drv_dsl_cpe_api:"
  926. +echo " Configure model type: $DSL_CONFIG_MODEL_TYPE"
  927. +echo " Source code location: $srcdir"
  928. +echo " Compiler: $CC"
  929. +echo " Compiler c-flags: $CFLAGS"
  930. +echo " Extra compiler c-flags: $EXTRA_DRV_CFLAGS"
  931. +echo " Host System Type: $host"
  932. +echo " Install path: $prefix"
  933. +echo " Linux kernel include path: $KERNEL_INCL_PATH"
  934. +echo " Linux kernel build path: $KERNEL_BUILD_PATH"
  935. +echo " Linux kernel architecture: $KERNEL_ARCH"
  936. +echo " Include IFXOS: $INCLUDE_DSL_CPE_API_IFXOS_SUPPORT"
  937. +echo " IFXOS include path: $IFXOS_INCLUDE_PATH"
  938. +echo " Driver Include Path $DSL_DRIVER_INCL_PATH"
  939. +echo " DSL device: $DSL_DEVICE_NAME"
  940. +echo " Max device number: $DSL_DRV_MAX_DEVICE_NUMBER"
  941. +echo " Channels per line: $DSL_CHANNELS_PER_LINE"
  942. +echo " Build lib (only for kernel 2.6) $DSL_CPE_API_LIBRARY_BUILD_2_6"
  943. +echo " DSL data led flash frequency: $DSL_DATA_LED_FLASH_FREQUENCY Hz"
  944. +echo " Disable debug prints: $DSL_DEBUG_DISABLE"
  945. +echo " Preselection of max. debug level: $DSL_DBG_MAX_LEVEL_SET"
  946. +echo " Preselected max. debug level: $DSL_DBG_MAX_LEVEL_PRE"
  947. +echo " Include deprecated functions: $INCLUDE_DEPRECATED"
  948. +echo " Include Device Exception Codes: $INCLUDE_DEVICE_EXCEPTION_CODES"
  949. +echo " Include FW request support: $INCLUDE_FW_REQUEST_SUPPORT"
  950. +echo " Include ADSL trace buffer: $INCLUDE_DSL_CPE_TRACE_BUFFER"
  951. +echo " Include ADSL MIB: $INCLUDE_DSL_ADSL_MIB"
  952. +echo " Include ADSL LED: $INCLUDE_ADSL_LED"
  953. +echo " Include CEOC: $INCLUDE_DSL_CEOC"
  954. +echo " Include config get support: $INCLUDE_DSL_CONFIG_GET"
  955. +echo " Include System i/f configuration: $INCLUDE_DSL_SYSTEM_INTERFACE"
  956. +echo " Include Resource Statistics: $INCLUDE_DSL_RESOURCE_STATISTICS"
  957. +echo " Include Framing Parameters: $INCLUDE_DSL_FRAMING_PARAMETERS"
  958. +echo " Include G997 Line Inventory: $INCLUDE_DSL_G997_LINE_INVENTORY"
  959. +echo " Include G997 Framing Parameters: $INCLUDE_DSL_G997_FRAMING_PARAMETERS"
  960. +echo " Include G997 per tone data: $INCLUDE_DSL_G997_PER_TONE"
  961. +echo " Include G997 status: $INCLUDE_DSL_G997_STATUS"
  962. +echo " Include G997 alarm: $INCLUDE_DSL_G997_ALARM"
  963. +echo " Include DSL Bonding: $INCLUDE_DSL_BONDING"
  964. +echo " Include Misc Line Status $INCLUDE_DSL_CPE_MISC_LINE_STATUS"
  965. +echo " Include DELT: $INCLUDE_DSL_DELT"
  966. +echo " Include DELT data static storage: $DSL_CPE_STATIC_DELT_DATA"
  967. +echo " Include PM: $INCLUDE_DSL_PM"
  968. +echo " Include PM config: $INCLUDE_DSL_CPE_PM_CONFIG"
  969. +echo " Include PM total: $INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS"
  970. +echo " Include PM history: $INCLUDE_DSL_CPE_PM_HISTORY"
  971. +echo " Include PM showtime: $INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS"
  972. +echo " Include PM optional: $INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS"
  973. +echo " Include PM line: $INCLUDE_DSL_CPE_PM_LINE_COUNTERS"
  974. +echo " Include PM line event showtime: $INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS"
  975. +echo " Include PM channel: $INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS"
  976. +echo " Include PM channel extended: $INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS"
  977. +echo " Include PM data path: $INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS"
  978. +echo " Include PM data path failure: $INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS"
  979. +echo " Include PM ReTx: $INCLUDE_DSL_CPE_PM_RETX_COUNTERS"
  980. +echo " Include PM line threshold: $INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS"
  981. +echo " Include PM channel threshold: $INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS"
  982. +echo " Include PM data path threshold: $INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS"
  983. +echo " Include PM ReTx threshold: $INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS"
  984. +echo " Include FW memory free support: $INCLUDE_DSL_FIRMWARE_MEMORY_FREE"
  985. +echo "----------------------- deprectated ! ----------------------------------"
  986. +echo " Include PM line failure: $INCLUDE_DSL_CPE_PM_LINE_FAILURE_COUNTERS"
  987. +echo ""
  988. +echo " Settings:"
  989. +echo " Configure options: $CONFIGURE_OPTIONS"
  990. +echo "------------------------------------------------------------------------"
  991. ])
  992. AC_CONFIG_FILES([Makefile src/Makefile])
  993. --- a/src/Makefile.am
  994. +++ b/src/Makefile.am
  995. @@ -303,7 +303,7 @@
  996. drv_dsl_cpe_api_OBJS = "$(subst .c,.o,$(filter %.c,$(drv_dsl_cpe_api_SOURCES)))"
  997. drv_dsl_cpe_api.ko: $(drv_dsl_cpe_api_SOURCES)
  998. - @echo -e "drv_dsl_cpe_api: Making Linux 2.6.x kernel object"
  999. + @echo "drv_dsl_cpe_api: Making Linux 2.6.x kernel object"
  1000. if test ! -e common/drv_dsl_cpe_api.c ; then \
  1001. echo "copy source files (as links only!)"; \
  1002. for f in $(filter %.c,$(drv_dsl_cpe_api_SOURCES)); do \
  1003. @@ -311,10 +311,10 @@
  1004. cp -s $(addprefix @abs_srcdir@/,$$f) $(PWD)/`dirname $$f`/ ; \
  1005. done \
  1006. fi
  1007. - @echo -e "# drv_dsl_cpe_api: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
  1008. - @echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
  1009. - @echo -e "$(subst .ko,,$@)-y := $(drv_dsl_cpe_api_OBJS)" >> $(PWD)/Kbuild
  1010. - @echo -e "EXTRA_CFLAGS := $(CFLAGS) -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild
  1011. + @echo "# drv_dsl_cpe_api: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
  1012. + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
  1013. + @echo "$(subst .ko,,$@)-y := $(drv_dsl_cpe_api_OBJS)" >> $(PWD)/Kbuild
  1014. + @echo "EXTRA_CFLAGS := $(CFLAGS) -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild
  1015. $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
  1016. clean-generic:
  1017. --- a/src/include/drv_dsl_cpe_os_linux.h
  1018. +++ b/src/include/drv_dsl_cpe_os_linux.h
  1019. @@ -16,8 +16,6 @@
  1020. extern "C" {
  1021. #endif
  1022. -#include <asm/ioctl.h>
  1023. -#include <generated/autoconf.h>
  1024. #include <linux/module.h>
  1025. #include <linux/kernel.h>
  1026. #include <linux/init.h>
  1027. @@ -26,8 +24,10 @@
  1028. #include <linux/spinlock.h>
  1029. #include <linux/sched.h>
  1030. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))
  1031. - #include <generated/utsrelease.h>
  1032. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
  1033. +#include <linux/utsrelease.h>
  1034. +#else
  1035. +#include <generated/utsrelease.h>
  1036. #endif
  1037. #include <linux/types.h>
  1038. @@ -39,7 +39,8 @@
  1039. #include <linux/delay.h>
  1040. #include <linux/poll.h>
  1041. #include <asm/uaccess.h>
  1042. -#include <linux/smp_lock.h>
  1043. +//#include <linux/smp_lock.h>
  1044. +#include <asm/ioctl.h>
  1045. #ifdef INCLUDE_DSL_CPE_API_IFXOS_SUPPORT
  1046. /** IFXOS includes*/