setup_opsput.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /*
  2. * linux/arch/m32r/kernel/setup_opsput.c
  3. *
  4. * Setup routines for Renesas OPSPUT Board
  5. *
  6. * Copyright (c) 2002-2005
  7. * Hiroyuki Kondo, Hirokazu Takata,
  8. * Hitoshi Yamamoto, Takeo Takahashi, Mamoru Sakugawa
  9. *
  10. * This file is subject to the terms and conditions of the GNU General
  11. * Public License. See the file "COPYING" in the main directory of this
  12. * archive for more details.
  13. */
  14. #include <linux/config.h>
  15. #include <linux/irq.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/device.h>
  19. #include <asm/system.h>
  20. #include <asm/m32r.h>
  21. #include <asm/io.h>
  22. /*
  23. * OPSP Interrupt Control Unit (Level 1)
  24. */
  25. #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
  26. #ifndef CONFIG_SMP
  27. typedef struct {
  28. unsigned long icucr; /* ICU Control Register */
  29. } icu_data_t;
  30. static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
  31. #else
  32. icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
  33. #endif /* CONFIG_SMP */
  34. static void disable_opsput_irq(unsigned int irq)
  35. {
  36. unsigned long port, data;
  37. port = irq2port(irq);
  38. data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
  39. outl(data, port);
  40. }
  41. static void enable_opsput_irq(unsigned int irq)
  42. {
  43. unsigned long port, data;
  44. port = irq2port(irq);
  45. data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
  46. outl(data, port);
  47. }
  48. static void mask_and_ack_opsput(unsigned int irq)
  49. {
  50. disable_opsput_irq(irq);
  51. }
  52. static void end_opsput_irq(unsigned int irq)
  53. {
  54. enable_opsput_irq(irq);
  55. }
  56. static unsigned int startup_opsput_irq(unsigned int irq)
  57. {
  58. enable_opsput_irq(irq);
  59. return (0);
  60. }
  61. static void shutdown_opsput_irq(unsigned int irq)
  62. {
  63. unsigned long port;
  64. port = irq2port(irq);
  65. outl(M32R_ICUCR_ILEVEL7, port);
  66. }
  67. static struct hw_interrupt_type opsput_irq_type =
  68. {
  69. .typename = "OPSPUT-IRQ",
  70. .startup = startup_opsput_irq,
  71. .shutdown = shutdown_opsput_irq,
  72. .enable = enable_opsput_irq,
  73. .disable = disable_opsput_irq,
  74. .ack = mask_and_ack_opsput,
  75. .end = end_opsput_irq
  76. };
  77. /*
  78. * Interrupt Control Unit of PLD on OPSPUT (Level 2)
  79. */
  80. #define irq2pldirq(x) ((x) - OPSPUT_PLD_IRQ_BASE)
  81. #define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \
  82. (((x) - 1) * sizeof(unsigned short)))
  83. typedef struct {
  84. unsigned short icucr; /* ICU Control Register */
  85. } pld_icu_data_t;
  86. static pld_icu_data_t pld_icu_data[OPSPUT_NUM_PLD_IRQ];
  87. static void disable_opsput_pld_irq(unsigned int irq)
  88. {
  89. unsigned long port, data;
  90. unsigned int pldirq;
  91. pldirq = irq2pldirq(irq);
  92. // disable_opsput_irq(M32R_IRQ_INT1);
  93. port = pldirq2port(pldirq);
  94. data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
  95. outw(data, port);
  96. }
  97. static void enable_opsput_pld_irq(unsigned int irq)
  98. {
  99. unsigned long port, data;
  100. unsigned int pldirq;
  101. pldirq = irq2pldirq(irq);
  102. // enable_opsput_irq(M32R_IRQ_INT1);
  103. port = pldirq2port(pldirq);
  104. data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
  105. outw(data, port);
  106. }
  107. static void mask_and_ack_opsput_pld(unsigned int irq)
  108. {
  109. disable_opsput_pld_irq(irq);
  110. // mask_and_ack_opsput(M32R_IRQ_INT1);
  111. }
  112. static void end_opsput_pld_irq(unsigned int irq)
  113. {
  114. enable_opsput_pld_irq(irq);
  115. end_opsput_irq(M32R_IRQ_INT1);
  116. }
  117. static unsigned int startup_opsput_pld_irq(unsigned int irq)
  118. {
  119. enable_opsput_pld_irq(irq);
  120. return (0);
  121. }
  122. static void shutdown_opsput_pld_irq(unsigned int irq)
  123. {
  124. unsigned long port;
  125. unsigned int pldirq;
  126. pldirq = irq2pldirq(irq);
  127. // shutdown_opsput_irq(M32R_IRQ_INT1);
  128. port = pldirq2port(pldirq);
  129. outw(PLD_ICUCR_ILEVEL7, port);
  130. }
  131. static struct hw_interrupt_type opsput_pld_irq_type =
  132. {
  133. .typename = "OPSPUT-PLD-IRQ",
  134. .startup = startup_opsput_pld_irq,
  135. .shutdown = shutdown_opsput_pld_irq,
  136. .enable = enable_opsput_pld_irq,
  137. .disable = disable_opsput_pld_irq,
  138. .ack = mask_and_ack_opsput_pld,
  139. .end = end_opsput_pld_irq
  140. };
  141. /*
  142. * Interrupt Control Unit of PLD on OPSPUT-LAN (Level 2)
  143. */
  144. #define irq2lanpldirq(x) ((x) - OPSPUT_LAN_PLD_IRQ_BASE)
  145. #define lanpldirq2port(x) (unsigned long)((int)OPSPUT_LAN_ICUCR1 + \
  146. (((x) - 1) * sizeof(unsigned short)))
  147. static pld_icu_data_t lanpld_icu_data[OPSPUT_NUM_LAN_PLD_IRQ];
  148. static void disable_opsput_lanpld_irq(unsigned int irq)
  149. {
  150. unsigned long port, data;
  151. unsigned int pldirq;
  152. pldirq = irq2lanpldirq(irq);
  153. port = lanpldirq2port(pldirq);
  154. data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
  155. outw(data, port);
  156. }
  157. static void enable_opsput_lanpld_irq(unsigned int irq)
  158. {
  159. unsigned long port, data;
  160. unsigned int pldirq;
  161. pldirq = irq2lanpldirq(irq);
  162. port = lanpldirq2port(pldirq);
  163. data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
  164. outw(data, port);
  165. }
  166. static void mask_and_ack_opsput_lanpld(unsigned int irq)
  167. {
  168. disable_opsput_lanpld_irq(irq);
  169. }
  170. static void end_opsput_lanpld_irq(unsigned int irq)
  171. {
  172. enable_opsput_lanpld_irq(irq);
  173. end_opsput_irq(M32R_IRQ_INT0);
  174. }
  175. static unsigned int startup_opsput_lanpld_irq(unsigned int irq)
  176. {
  177. enable_opsput_lanpld_irq(irq);
  178. return (0);
  179. }
  180. static void shutdown_opsput_lanpld_irq(unsigned int irq)
  181. {
  182. unsigned long port;
  183. unsigned int pldirq;
  184. pldirq = irq2lanpldirq(irq);
  185. port = lanpldirq2port(pldirq);
  186. outw(PLD_ICUCR_ILEVEL7, port);
  187. }
  188. static struct hw_interrupt_type opsput_lanpld_irq_type =
  189. {
  190. "OPSPUT-PLD-LAN-IRQ",
  191. startup_opsput_lanpld_irq,
  192. shutdown_opsput_lanpld_irq,
  193. enable_opsput_lanpld_irq,
  194. disable_opsput_lanpld_irq,
  195. mask_and_ack_opsput_lanpld,
  196. end_opsput_lanpld_irq
  197. };
  198. /*
  199. * Interrupt Control Unit of PLD on OPSPUT-LCD (Level 2)
  200. */
  201. #define irq2lcdpldirq(x) ((x) - OPSPUT_LCD_PLD_IRQ_BASE)
  202. #define lcdpldirq2port(x) (unsigned long)((int)OPSPUT_LCD_ICUCR1 + \
  203. (((x) - 1) * sizeof(unsigned short)))
  204. static pld_icu_data_t lcdpld_icu_data[OPSPUT_NUM_LCD_PLD_IRQ];
  205. static void disable_opsput_lcdpld_irq(unsigned int irq)
  206. {
  207. unsigned long port, data;
  208. unsigned int pldirq;
  209. pldirq = irq2lcdpldirq(irq);
  210. port = lcdpldirq2port(pldirq);
  211. data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
  212. outw(data, port);
  213. }
  214. static void enable_opsput_lcdpld_irq(unsigned int irq)
  215. {
  216. unsigned long port, data;
  217. unsigned int pldirq;
  218. pldirq = irq2lcdpldirq(irq);
  219. port = lcdpldirq2port(pldirq);
  220. data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
  221. outw(data, port);
  222. }
  223. static void mask_and_ack_opsput_lcdpld(unsigned int irq)
  224. {
  225. disable_opsput_lcdpld_irq(irq);
  226. }
  227. static void end_opsput_lcdpld_irq(unsigned int irq)
  228. {
  229. enable_opsput_lcdpld_irq(irq);
  230. end_opsput_irq(M32R_IRQ_INT2);
  231. }
  232. static unsigned int startup_opsput_lcdpld_irq(unsigned int irq)
  233. {
  234. enable_opsput_lcdpld_irq(irq);
  235. return (0);
  236. }
  237. static void shutdown_opsput_lcdpld_irq(unsigned int irq)
  238. {
  239. unsigned long port;
  240. unsigned int pldirq;
  241. pldirq = irq2lcdpldirq(irq);
  242. port = lcdpldirq2port(pldirq);
  243. outw(PLD_ICUCR_ILEVEL7, port);
  244. }
  245. static struct hw_interrupt_type opsput_lcdpld_irq_type =
  246. {
  247. "OPSPUT-PLD-LCD-IRQ",
  248. startup_opsput_lcdpld_irq,
  249. shutdown_opsput_lcdpld_irq,
  250. enable_opsput_lcdpld_irq,
  251. disable_opsput_lcdpld_irq,
  252. mask_and_ack_opsput_lcdpld,
  253. end_opsput_lcdpld_irq
  254. };
  255. void __init init_IRQ(void)
  256. {
  257. #if defined(CONFIG_SMC91X)
  258. /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/
  259. irq_desc[OPSPUT_LAN_IRQ_LAN].status = IRQ_DISABLED;
  260. irq_desc[OPSPUT_LAN_IRQ_LAN].handler = &opsput_lanpld_irq_type;
  261. irq_desc[OPSPUT_LAN_IRQ_LAN].action = 0;
  262. irq_desc[OPSPUT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */
  263. lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */
  264. disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN);
  265. #endif /* CONFIG_SMC91X */
  266. /* MFT2 : system timer */
  267. irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
  268. irq_desc[M32R_IRQ_MFT2].handler = &opsput_irq_type;
  269. irq_desc[M32R_IRQ_MFT2].action = 0;
  270. irq_desc[M32R_IRQ_MFT2].depth = 1;
  271. icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
  272. disable_opsput_irq(M32R_IRQ_MFT2);
  273. /* SIO0 : receive */
  274. irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
  275. irq_desc[M32R_IRQ_SIO0_R].handler = &opsput_irq_type;
  276. irq_desc[M32R_IRQ_SIO0_R].action = 0;
  277. irq_desc[M32R_IRQ_SIO0_R].depth = 1;
  278. icu_data[M32R_IRQ_SIO0_R].icucr = 0;
  279. disable_opsput_irq(M32R_IRQ_SIO0_R);
  280. /* SIO0 : send */
  281. irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
  282. irq_desc[M32R_IRQ_SIO0_S].handler = &opsput_irq_type;
  283. irq_desc[M32R_IRQ_SIO0_S].action = 0;
  284. irq_desc[M32R_IRQ_SIO0_S].depth = 1;
  285. icu_data[M32R_IRQ_SIO0_S].icucr = 0;
  286. disable_opsput_irq(M32R_IRQ_SIO0_S);
  287. /* SIO1 : receive */
  288. irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
  289. irq_desc[M32R_IRQ_SIO1_R].handler = &opsput_irq_type;
  290. irq_desc[M32R_IRQ_SIO1_R].action = 0;
  291. irq_desc[M32R_IRQ_SIO1_R].depth = 1;
  292. icu_data[M32R_IRQ_SIO1_R].icucr = 0;
  293. disable_opsput_irq(M32R_IRQ_SIO1_R);
  294. /* SIO1 : send */
  295. irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
  296. irq_desc[M32R_IRQ_SIO1_S].handler = &opsput_irq_type;
  297. irq_desc[M32R_IRQ_SIO1_S].action = 0;
  298. irq_desc[M32R_IRQ_SIO1_S].depth = 1;
  299. icu_data[M32R_IRQ_SIO1_S].icucr = 0;
  300. disable_opsput_irq(M32R_IRQ_SIO1_S);
  301. /* DMA1 : */
  302. irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED;
  303. irq_desc[M32R_IRQ_DMA1].handler = &opsput_irq_type;
  304. irq_desc[M32R_IRQ_DMA1].action = 0;
  305. irq_desc[M32R_IRQ_DMA1].depth = 1;
  306. icu_data[M32R_IRQ_DMA1].icucr = 0;
  307. disable_opsput_irq(M32R_IRQ_DMA1);
  308. #ifdef CONFIG_SERIAL_M32R_PLDSIO
  309. /* INT#1: SIO0 Receive on PLD */
  310. irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED;
  311. irq_desc[PLD_IRQ_SIO0_RCV].handler = &opsput_pld_irq_type;
  312. irq_desc[PLD_IRQ_SIO0_RCV].action = 0;
  313. irq_desc[PLD_IRQ_SIO0_RCV].depth = 1; /* disable nested irq */
  314. pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
  315. disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV);
  316. /* INT#1: SIO0 Send on PLD */
  317. irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED;
  318. irq_desc[PLD_IRQ_SIO0_SND].handler = &opsput_pld_irq_type;
  319. irq_desc[PLD_IRQ_SIO0_SND].action = 0;
  320. irq_desc[PLD_IRQ_SIO0_SND].depth = 1; /* disable nested irq */
  321. pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
  322. disable_opsput_pld_irq(PLD_IRQ_SIO0_SND);
  323. #endif /* CONFIG_SERIAL_M32R_PLDSIO */
  324. #if defined(CONFIG_M32R_CFC)
  325. /* INT#1: CFC IREQ on PLD */
  326. irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
  327. irq_desc[PLD_IRQ_CFIREQ].handler = &opsput_pld_irq_type;
  328. irq_desc[PLD_IRQ_CFIREQ].action = 0;
  329. irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */
  330. pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */
  331. disable_opsput_pld_irq(PLD_IRQ_CFIREQ);
  332. /* INT#1: CFC Insert on PLD */
  333. irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
  334. irq_desc[PLD_IRQ_CFC_INSERT].handler = &opsput_pld_irq_type;
  335. irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
  336. irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
  337. pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */
  338. disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT);
  339. /* INT#1: CFC Eject on PLD */
  340. irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
  341. irq_desc[PLD_IRQ_CFC_EJECT].handler = &opsput_pld_irq_type;
  342. irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
  343. irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */
  344. pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */
  345. disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT);
  346. #endif /* CONFIG_M32R_CFC */
  347. /*
  348. * INT0# is used for LAN, DIO
  349. * We enable it here.
  350. */
  351. icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11;
  352. enable_opsput_irq(M32R_IRQ_INT0);
  353. /*
  354. * INT1# is used for UART, MMC, CF Controller in FPGA.
  355. * We enable it here.
  356. */
  357. icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11;
  358. enable_opsput_irq(M32R_IRQ_INT1);
  359. #if defined(CONFIG_USB)
  360. outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */
  361. irq_desc[OPSPUT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED;
  362. irq_desc[OPSPUT_LCD_IRQ_USB_INT1].handler = &opsput_lcdpld_irq_type;
  363. irq_desc[OPSPUT_LCD_IRQ_USB_INT1].action = 0;
  364. irq_desc[OPSPUT_LCD_IRQ_USB_INT1].depth = 1;
  365. lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */
  366. disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1);
  367. #endif
  368. /*
  369. * INT2# is used for BAT, USB, AUDIO
  370. * We enable it here.
  371. */
  372. icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
  373. enable_opsput_irq(M32R_IRQ_INT2);
  374. #if defined(CONFIG_VIDEO_M32R_AR)
  375. /*
  376. * INT3# is used for AR
  377. */
  378. irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED;
  379. irq_desc[M32R_IRQ_INT3].handler = &opsput_irq_type;
  380. irq_desc[M32R_IRQ_INT3].action = 0;
  381. irq_desc[M32R_IRQ_INT3].depth = 1;
  382. icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
  383. disable_opsput_irq(M32R_IRQ_INT3);
  384. #endif /* CONFIG_VIDEO_M32R_AR */
  385. }
  386. #if defined(CONFIG_SMC91X)
  387. #define LAN_IOSTART 0x300
  388. #define LAN_IOEND 0x320
  389. static struct resource smc91x_resources[] = {
  390. [0] = {
  391. .start = (LAN_IOSTART),
  392. .end = (LAN_IOEND),
  393. .flags = IORESOURCE_MEM,
  394. },
  395. [1] = {
  396. .start = OPSPUT_LAN_IRQ_LAN,
  397. .end = OPSPUT_LAN_IRQ_LAN,
  398. .flags = IORESOURCE_IRQ,
  399. }
  400. };
  401. static struct platform_device smc91x_device = {
  402. .name = "smc91x",
  403. .id = 0,
  404. .num_resources = ARRAY_SIZE(smc91x_resources),
  405. .resource = smc91x_resources,
  406. };
  407. #endif
  408. #if defined(CONFIG_FB_S1D13XXX)
  409. #include <video/s1d13xxxfb.h>
  410. #include <asm/s1d13806.h>
  411. static struct s1d13xxxfb_pdata s1d13xxxfb_data = {
  412. .initregs = s1d13xxxfb_initregs,
  413. .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs),
  414. .platform_init_video = NULL,
  415. #ifdef CONFIG_PM
  416. .platform_suspend_video = NULL,
  417. .platform_resume_video = NULL,
  418. #endif
  419. };
  420. static struct resource s1d13xxxfb_resources[] = {
  421. [0] = {
  422. .start = 0x10600000UL,
  423. .end = 0x1073FFFFUL,
  424. .flags = IORESOURCE_MEM,
  425. },
  426. [1] = {
  427. .start = 0x10400000UL,
  428. .end = 0x104001FFUL,
  429. .flags = IORESOURCE_MEM,
  430. }
  431. };
  432. static struct platform_device s1d13xxxfb_device = {
  433. .name = S1D_DEVICENAME,
  434. .id = 0,
  435. .dev = {
  436. .platform_data = &s1d13xxxfb_data,
  437. },
  438. .num_resources = ARRAY_SIZE(s1d13xxxfb_resources),
  439. .resource = s1d13xxxfb_resources,
  440. };
  441. #endif
  442. static int __init platform_init(void)
  443. {
  444. #if defined(CONFIG_SMC91X)
  445. platform_device_register(&smc91x_device);
  446. #endif
  447. #if defined(CONFIG_FB_S1D13XXX)
  448. platform_device_register(&s1d13xxxfb_device);
  449. #endif
  450. return 0;
  451. }
  452. arch_initcall(platform_init);