toshiba_rbtx4927_setup.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  1. /*
  2. * Toshiba rbtx4927 specific setup
  3. *
  4. * Author: MontaVista Software, Inc.
  5. * source@mvista.com
  6. *
  7. * Copyright 2001-2002 MontaVista Software Inc.
  8. *
  9. * Copyright (C) 1996, 97, 2001, 04 Ralf Baechle (ralf@linux-mips.org)
  10. * Copyright (C) 2000 RidgeRun, Inc.
  11. * Author: RidgeRun, Inc.
  12. * glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
  13. *
  14. * Copyright 2001 MontaVista Software Inc.
  15. * Author: jsun@mvista.com or jsun@junsun.net
  16. *
  17. * Copyright 2002 MontaVista Software Inc.
  18. * Author: Michael Pruznick, michael_pruznick@mvista.com
  19. *
  20. * Copyright (C) 2000-2001 Toshiba Corporation
  21. *
  22. * Copyright (C) 2004 MontaVista Software Inc.
  23. * Author: Manish Lachwani, mlachwani@mvista.com
  24. *
  25. * This program is free software; you can redistribute it and/or modify it
  26. * under the terms of the GNU General Public License as published by the
  27. * Free Software Foundation; either version 2 of the License, or (at your
  28. * option) any later version.
  29. *
  30. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  31. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  32. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  33. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  34. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  35. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  36. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  37. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  38. * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  39. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. * You should have received a copy of the GNU General Public License along
  42. * with this program; if not, write to the Free Software Foundation, Inc.,
  43. * 675 Mass Ave, Cambridge, MA 02139, USA.
  44. */
  45. #include <linux/init.h>
  46. #include <linux/kernel.h>
  47. #include <linux/types.h>
  48. #include <linux/mm.h>
  49. #include <linux/swap.h>
  50. #include <linux/ioport.h>
  51. #include <linux/sched.h>
  52. #include <linux/interrupt.h>
  53. #include <linux/pci.h>
  54. #include <linux/timex.h>
  55. #include <linux/pm.h>
  56. #include <linux/platform_device.h>
  57. #include <asm/bootinfo.h>
  58. #include <asm/page.h>
  59. #include <asm/io.h>
  60. #include <asm/irq.h>
  61. #include <asm/irq_regs.h>
  62. #include <asm/processor.h>
  63. #include <asm/reboot.h>
  64. #include <asm/time.h>
  65. #include <asm/txx9tmr.h>
  66. #include <linux/bootmem.h>
  67. #include <linux/blkdev.h>
  68. #ifdef CONFIG_TOSHIBA_FPCIB0
  69. #include <asm/tx4927/smsc_fdc37m81x.h>
  70. #endif
  71. #include <asm/tx4927/toshiba_rbtx4927.h>
  72. #ifdef CONFIG_PCI
  73. #include <asm/tx4927/tx4927_pci.h>
  74. #endif
  75. #ifdef CONFIG_BLK_DEV_IDEPCI
  76. #include <linux/hdreg.h>
  77. #include <linux/ide.h>
  78. #endif
  79. #ifdef CONFIG_SERIAL_TXX9
  80. #include <linux/tty.h>
  81. #include <linux/serial.h>
  82. #include <linux/serial_core.h>
  83. #endif
  84. #undef TOSHIBA_RBTX4927_SETUP_DEBUG
  85. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  86. #define TOSHIBA_RBTX4927_SETUP_NONE 0x00000000
  87. #define TOSHIBA_RBTX4927_SETUP_INFO ( 1 << 0 )
  88. #define TOSHIBA_RBTX4927_SETUP_WARN ( 1 << 1 )
  89. #define TOSHIBA_RBTX4927_SETUP_EROR ( 1 << 2 )
  90. #define TOSHIBA_RBTX4927_SETUP_EFWFU ( 1 << 3 )
  91. #define TOSHIBA_RBTX4927_SETUP_SETUP ( 1 << 4 )
  92. #define TOSHIBA_RBTX4927_SETUP_PCIBIOS ( 1 << 7 )
  93. #define TOSHIBA_RBTX4927_SETUP_PCI1 ( 1 << 8 )
  94. #define TOSHIBA_RBTX4927_SETUP_PCI2 ( 1 << 9 )
  95. #define TOSHIBA_RBTX4927_SETUP_PCI66 ( 1 << 10 )
  96. #define TOSHIBA_RBTX4927_SETUP_ALL 0xffffffff
  97. #endif
  98. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  99. static const u32 toshiba_rbtx4927_setup_debug_flag =
  100. (TOSHIBA_RBTX4927_SETUP_NONE | TOSHIBA_RBTX4927_SETUP_INFO |
  101. TOSHIBA_RBTX4927_SETUP_WARN | TOSHIBA_RBTX4927_SETUP_EROR |
  102. TOSHIBA_RBTX4927_SETUP_EFWFU | TOSHIBA_RBTX4927_SETUP_SETUP |
  103. | TOSHIBA_RBTX4927_SETUP_PCIBIOS | TOSHIBA_RBTX4927_SETUP_PCI1 |
  104. TOSHIBA_RBTX4927_SETUP_PCI2 | TOSHIBA_RBTX4927_SETUP_PCI66);
  105. #endif
  106. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  107. #define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag,str...) \
  108. if ( (toshiba_rbtx4927_setup_debug_flag) & (flag) ) \
  109. { \
  110. char tmp[100]; \
  111. sprintf( tmp, str ); \
  112. printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \
  113. }
  114. #else
  115. #define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag, str...)
  116. #endif
  117. /* These functions are used for rebooting or halting the machine*/
  118. extern void toshiba_rbtx4927_restart(char *command);
  119. extern void toshiba_rbtx4927_halt(void);
  120. extern void toshiba_rbtx4927_power_off(void);
  121. int tx4927_using_backplane = 0;
  122. extern void toshiba_rbtx4927_irq_setup(void);
  123. char *prom_getcmdline(void);
  124. #ifdef CONFIG_PCI
  125. #undef TX4927_SUPPORT_COMMAND_IO
  126. #undef TX4927_SUPPORT_PCI_66
  127. int tx4927_cpu_clock = 100000000; /* 100MHz */
  128. unsigned long mips_pci_io_base;
  129. unsigned long mips_pci_io_size;
  130. unsigned long mips_pci_mem_base;
  131. unsigned long mips_pci_mem_size;
  132. /* for legacy I/O, PCI I/O PCI Bus address must be 0 */
  133. unsigned long mips_pci_io_pciaddr = 0;
  134. unsigned long mips_memory_upper;
  135. static int tx4927_ccfg_toeon = 1;
  136. static int tx4927_pcic_trdyto = 0; /* default: disabled */
  137. unsigned long tx4927_ce_base[8];
  138. void tx4927_reset_pci_pcic(void);
  139. int tx4927_pci66 = 0; /* 0:auto */
  140. #endif
  141. char *toshiba_name = "";
  142. #ifdef CONFIG_PCI
  143. extern struct pci_controller tx4927_controller;
  144. static struct pci_dev *fake_pci_dev(struct pci_controller *hose,
  145. int top_bus, int busnr, int devfn)
  146. {
  147. static struct pci_dev dev;
  148. static struct pci_bus bus;
  149. dev.sysdata = (void *)hose;
  150. dev.devfn = devfn;
  151. bus.number = busnr;
  152. bus.ops = hose->pci_ops;
  153. bus.parent = NULL;
  154. dev.bus = &bus;
  155. return &dev;
  156. }
  157. #define EARLY_PCI_OP(rw, size, type) \
  158. static int early_##rw##_config_##size(struct pci_controller *hose, \
  159. int top_bus, int bus, int devfn, int offset, type value) \
  160. { \
  161. return pci_##rw##_config_##size( \
  162. fake_pci_dev(hose, top_bus, bus, devfn), \
  163. offset, value); \
  164. }
  165. EARLY_PCI_OP(read, byte, u8 *)
  166. EARLY_PCI_OP(read, dword, u32 *)
  167. EARLY_PCI_OP(write, byte, u8)
  168. EARLY_PCI_OP(write, dword, u32)
  169. static int __init tx4927_pcibios_init(void)
  170. {
  171. unsigned int id;
  172. u32 pci_devfn;
  173. int devfn_start = 0;
  174. int devfn_stop = 0xff;
  175. int busno = 0; /* One bus on the Toshiba */
  176. struct pci_controller *hose = &tx4927_controller;
  177. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  178. "-\n");
  179. for (pci_devfn = devfn_start; pci_devfn < devfn_stop; pci_devfn++) {
  180. early_read_config_dword(hose, busno, busno, pci_devfn,
  181. PCI_VENDOR_ID, &id);
  182. if (id == 0xffffffff) {
  183. continue;
  184. }
  185. if (id == 0x94601055) {
  186. u8 v08_64;
  187. u32 v32_b0;
  188. u8 v08_e1;
  189. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  190. char *s = " sb/isa --";
  191. #endif
  192. TOSHIBA_RBTX4927_SETUP_DPRINTK
  193. (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s beg\n",
  194. s);
  195. early_read_config_byte(hose, busno, busno,
  196. pci_devfn, 0x64, &v08_64);
  197. early_read_config_dword(hose, busno, busno,
  198. pci_devfn, 0xb0, &v32_b0);
  199. early_read_config_byte(hose, busno, busno,
  200. pci_devfn, 0xe1, &v08_e1);
  201. TOSHIBA_RBTX4927_SETUP_DPRINTK
  202. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  203. ":%s beg 0x64 = 0x%02x\n", s, v08_64);
  204. TOSHIBA_RBTX4927_SETUP_DPRINTK
  205. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  206. ":%s beg 0xb0 = 0x%02x\n", s, v32_b0);
  207. TOSHIBA_RBTX4927_SETUP_DPRINTK
  208. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  209. ":%s beg 0xe1 = 0x%02x\n", s, v08_e1);
  210. /* serial irq control */
  211. v08_64 = 0xd0;
  212. /* serial irq pin */
  213. v32_b0 |= 0x00010000;
  214. /* ide irq on isa14 */
  215. v08_e1 &= 0xf0;
  216. v08_e1 |= 0x0d;
  217. TOSHIBA_RBTX4927_SETUP_DPRINTK
  218. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  219. ":%s mid 0x64 = 0x%02x\n", s, v08_64);
  220. TOSHIBA_RBTX4927_SETUP_DPRINTK
  221. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  222. ":%s mid 0xb0 = 0x%02x\n", s, v32_b0);
  223. TOSHIBA_RBTX4927_SETUP_DPRINTK
  224. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  225. ":%s mid 0xe1 = 0x%02x\n", s, v08_e1);
  226. early_write_config_byte(hose, busno, busno,
  227. pci_devfn, 0x64, v08_64);
  228. early_write_config_dword(hose, busno, busno,
  229. pci_devfn, 0xb0, v32_b0);
  230. early_write_config_byte(hose, busno, busno,
  231. pci_devfn, 0xe1, v08_e1);
  232. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  233. {
  234. early_read_config_byte(hose, busno, busno,
  235. pci_devfn, 0x64,
  236. &v08_64);
  237. early_read_config_dword(hose, busno, busno,
  238. pci_devfn, 0xb0,
  239. &v32_b0);
  240. early_read_config_byte(hose, busno, busno,
  241. pci_devfn, 0xe1,
  242. &v08_e1);
  243. TOSHIBA_RBTX4927_SETUP_DPRINTK
  244. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  245. ":%s end 0x64 = 0x%02x\n", s, v08_64);
  246. TOSHIBA_RBTX4927_SETUP_DPRINTK
  247. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  248. ":%s end 0xb0 = 0x%02x\n", s, v32_b0);
  249. TOSHIBA_RBTX4927_SETUP_DPRINTK
  250. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  251. ":%s end 0xe1 = 0x%02x\n", s, v08_e1);
  252. }
  253. #endif
  254. TOSHIBA_RBTX4927_SETUP_DPRINTK
  255. (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s end\n",
  256. s);
  257. }
  258. if (id == 0x91301055) {
  259. u8 v08_04;
  260. u8 v08_09;
  261. u8 v08_41;
  262. u8 v08_43;
  263. u8 v08_5c;
  264. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  265. char *s = " sb/ide --";
  266. #endif
  267. TOSHIBA_RBTX4927_SETUP_DPRINTK
  268. (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s beg\n",
  269. s);
  270. early_read_config_byte(hose, busno, busno,
  271. pci_devfn, 0x04, &v08_04);
  272. early_read_config_byte(hose, busno, busno,
  273. pci_devfn, 0x09, &v08_09);
  274. early_read_config_byte(hose, busno, busno,
  275. pci_devfn, 0x41, &v08_41);
  276. early_read_config_byte(hose, busno, busno,
  277. pci_devfn, 0x43, &v08_43);
  278. early_read_config_byte(hose, busno, busno,
  279. pci_devfn, 0x5c, &v08_5c);
  280. TOSHIBA_RBTX4927_SETUP_DPRINTK
  281. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  282. ":%s beg 0x04 = 0x%02x\n", s, v08_04);
  283. TOSHIBA_RBTX4927_SETUP_DPRINTK
  284. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  285. ":%s beg 0x09 = 0x%02x\n", s, v08_09);
  286. TOSHIBA_RBTX4927_SETUP_DPRINTK
  287. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  288. ":%s beg 0x41 = 0x%02x\n", s, v08_41);
  289. TOSHIBA_RBTX4927_SETUP_DPRINTK
  290. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  291. ":%s beg 0x43 = 0x%02x\n", s, v08_43);
  292. TOSHIBA_RBTX4927_SETUP_DPRINTK
  293. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  294. ":%s beg 0x5c = 0x%02x\n", s, v08_5c);
  295. /* enable ide master/io */
  296. v08_04 |= (PCI_COMMAND_MASTER | PCI_COMMAND_IO);
  297. /* enable ide native mode */
  298. v08_09 |= 0x05;
  299. /* enable primary ide */
  300. v08_41 |= 0x80;
  301. /* enable secondary ide */
  302. v08_43 |= 0x80;
  303. /*
  304. * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!!
  305. *
  306. * This line of code is intended to provide the user with a work
  307. * around solution to the anomalies cited in SMSC's anomaly sheet
  308. * entitled, "SLC90E66 Functional Rev.J_0.1 Anomalies"".
  309. *
  310. * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!!
  311. */
  312. v08_5c |= 0x01;
  313. TOSHIBA_RBTX4927_SETUP_DPRINTK
  314. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  315. ":%s mid 0x04 = 0x%02x\n", s, v08_04);
  316. TOSHIBA_RBTX4927_SETUP_DPRINTK
  317. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  318. ":%s mid 0x09 = 0x%02x\n", s, v08_09);
  319. TOSHIBA_RBTX4927_SETUP_DPRINTK
  320. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  321. ":%s mid 0x41 = 0x%02x\n", s, v08_41);
  322. TOSHIBA_RBTX4927_SETUP_DPRINTK
  323. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  324. ":%s mid 0x43 = 0x%02x\n", s, v08_43);
  325. TOSHIBA_RBTX4927_SETUP_DPRINTK
  326. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  327. ":%s mid 0x5c = 0x%02x\n", s, v08_5c);
  328. early_write_config_byte(hose, busno, busno,
  329. pci_devfn, 0x5c, v08_5c);
  330. early_write_config_byte(hose, busno, busno,
  331. pci_devfn, 0x04, v08_04);
  332. early_write_config_byte(hose, busno, busno,
  333. pci_devfn, 0x09, v08_09);
  334. early_write_config_byte(hose, busno, busno,
  335. pci_devfn, 0x41, v08_41);
  336. early_write_config_byte(hose, busno, busno,
  337. pci_devfn, 0x43, v08_43);
  338. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  339. {
  340. early_read_config_byte(hose, busno, busno,
  341. pci_devfn, 0x04,
  342. &v08_04);
  343. early_read_config_byte(hose, busno, busno,
  344. pci_devfn, 0x09,
  345. &v08_09);
  346. early_read_config_byte(hose, busno, busno,
  347. pci_devfn, 0x41,
  348. &v08_41);
  349. early_read_config_byte(hose, busno, busno,
  350. pci_devfn, 0x43,
  351. &v08_43);
  352. early_read_config_byte(hose, busno, busno,
  353. pci_devfn, 0x5c,
  354. &v08_5c);
  355. TOSHIBA_RBTX4927_SETUP_DPRINTK
  356. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  357. ":%s end 0x04 = 0x%02x\n", s, v08_04);
  358. TOSHIBA_RBTX4927_SETUP_DPRINTK
  359. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  360. ":%s end 0x09 = 0x%02x\n", s, v08_09);
  361. TOSHIBA_RBTX4927_SETUP_DPRINTK
  362. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  363. ":%s end 0x41 = 0x%02x\n", s, v08_41);
  364. TOSHIBA_RBTX4927_SETUP_DPRINTK
  365. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  366. ":%s end 0x43 = 0x%02x\n", s, v08_43);
  367. TOSHIBA_RBTX4927_SETUP_DPRINTK
  368. (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  369. ":%s end 0x5c = 0x%02x\n", s, v08_5c);
  370. }
  371. #endif
  372. TOSHIBA_RBTX4927_SETUP_DPRINTK
  373. (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s end\n",
  374. s);
  375. }
  376. }
  377. register_pci_controller(&tx4927_controller);
  378. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS,
  379. "+\n");
  380. return 0;
  381. }
  382. arch_initcall(tx4927_pcibios_init);
  383. extern struct resource pci_io_resource;
  384. extern struct resource pci_mem_resource;
  385. void __init tx4927_pci_setup(void)
  386. {
  387. static int called = 0;
  388. extern unsigned int tx4927_get_mem_size(void);
  389. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "-\n");
  390. mips_memory_upper = tx4927_get_mem_size() << 20;
  391. mips_memory_upper += KSEG0;
  392. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  393. "0x%08lx=mips_memory_upper\n",
  394. mips_memory_upper);
  395. mips_pci_io_base = TX4927_PCIIO;
  396. mips_pci_io_size = TX4927_PCIIO_SIZE;
  397. mips_pci_mem_base = TX4927_PCIMEM;
  398. mips_pci_mem_size = TX4927_PCIMEM_SIZE;
  399. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  400. "0x%08lx=mips_pci_io_base\n",
  401. mips_pci_io_base);
  402. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  403. "0x%08lx=mips_pci_io_size\n",
  404. mips_pci_io_size);
  405. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  406. "0x%08lx=mips_pci_mem_base\n",
  407. mips_pci_mem_base);
  408. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  409. "0x%08lx=mips_pci_mem_size\n",
  410. mips_pci_mem_size);
  411. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  412. "0x%08lx=pci_io_resource.start\n",
  413. pci_io_resource.start);
  414. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  415. "0x%08lx=pci_io_resource.end\n",
  416. pci_io_resource.end);
  417. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  418. "0x%08lx=pci_mem_resource.start\n",
  419. pci_mem_resource.start);
  420. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  421. "0x%08lx=pci_mem_resource.end\n",
  422. pci_mem_resource.end);
  423. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  424. "0x%08lx=mips_io_port_base",
  425. mips_io_port_base);
  426. if (!called) {
  427. printk
  428. ("%s PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
  429. toshiba_name,
  430. (unsigned short) (tx4927_pcicptr->pciid >> 16),
  431. (unsigned short) (tx4927_pcicptr->pciid & 0xffff),
  432. (unsigned short) (tx4927_pcicptr->pciccrev & 0xff),
  433. (!(tx4927_ccfgptr->
  434. ccfg & TX4927_CCFG_PCIXARB)) ? "External" :
  435. "Internal");
  436. called = 1;
  437. }
  438. printk("%s PCIC --%s PCICLK:", toshiba_name,
  439. (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) ? " PCI66" : "");
  440. if (tx4927_ccfgptr->pcfg & TX4927_PCFG_PCICLKEN_ALL) {
  441. int pciclk = 0;
  442. if (mips_machtype == MACH_TOSHIBA_RBTX4937)
  443. switch ((unsigned long) tx4927_ccfgptr->
  444. ccfg & TX4937_CCFG_PCIDIVMODE_MASK) {
  445. case TX4937_CCFG_PCIDIVMODE_4:
  446. pciclk = tx4927_cpu_clock / 4;
  447. break;
  448. case TX4937_CCFG_PCIDIVMODE_4_5:
  449. pciclk = tx4927_cpu_clock * 2 / 9;
  450. break;
  451. case TX4937_CCFG_PCIDIVMODE_5:
  452. pciclk = tx4927_cpu_clock / 5;
  453. break;
  454. case TX4937_CCFG_PCIDIVMODE_5_5:
  455. pciclk = tx4927_cpu_clock * 2 / 11;
  456. break;
  457. case TX4937_CCFG_PCIDIVMODE_8:
  458. pciclk = tx4927_cpu_clock / 8;
  459. break;
  460. case TX4937_CCFG_PCIDIVMODE_9:
  461. pciclk = tx4927_cpu_clock / 9;
  462. break;
  463. case TX4937_CCFG_PCIDIVMODE_10:
  464. pciclk = tx4927_cpu_clock / 10;
  465. break;
  466. case TX4937_CCFG_PCIDIVMODE_11:
  467. pciclk = tx4927_cpu_clock / 11;
  468. break;
  469. }
  470. else
  471. switch ((unsigned long) tx4927_ccfgptr->
  472. ccfg & TX4927_CCFG_PCIDIVMODE_MASK) {
  473. case TX4927_CCFG_PCIDIVMODE_2_5:
  474. pciclk = tx4927_cpu_clock * 2 / 5;
  475. break;
  476. case TX4927_CCFG_PCIDIVMODE_3:
  477. pciclk = tx4927_cpu_clock / 3;
  478. break;
  479. case TX4927_CCFG_PCIDIVMODE_5:
  480. pciclk = tx4927_cpu_clock / 5;
  481. break;
  482. case TX4927_CCFG_PCIDIVMODE_6:
  483. pciclk = tx4927_cpu_clock / 6;
  484. break;
  485. }
  486. printk("Internal(%dMHz)", pciclk / 1000000);
  487. } else {
  488. int pciclk = 0;
  489. int pciclk_setting = *tx4927_pci_clk_ptr;
  490. switch (pciclk_setting & TX4927_PCI_CLK_MASK) {
  491. case TX4927_PCI_CLK_33:
  492. pciclk = 33333333;
  493. break;
  494. case TX4927_PCI_CLK_25:
  495. pciclk = 25000000;
  496. break;
  497. case TX4927_PCI_CLK_66:
  498. pciclk = 66666666;
  499. break;
  500. case TX4927_PCI_CLK_50:
  501. pciclk = 50000000;
  502. break;
  503. }
  504. printk("External(%dMHz)", pciclk / 1000000);
  505. }
  506. printk("\n");
  507. /* GB->PCI mappings */
  508. tx4927_pcicptr->g2piomask = (mips_pci_io_size - 1) >> 4;
  509. tx4927_pcicptr->g2piogbase = mips_pci_io_base |
  510. #ifdef __BIG_ENDIAN
  511. TX4927_PCIC_G2PIOGBASE_ECHG
  512. #else
  513. TX4927_PCIC_G2PIOGBASE_BSDIS
  514. #endif
  515. ;
  516. tx4927_pcicptr->g2piopbase = 0;
  517. tx4927_pcicptr->g2pmmask[0] = (mips_pci_mem_size - 1) >> 4;
  518. tx4927_pcicptr->g2pmgbase[0] = mips_pci_mem_base |
  519. #ifdef __BIG_ENDIAN
  520. TX4927_PCIC_G2PMnGBASE_ECHG
  521. #else
  522. TX4927_PCIC_G2PMnGBASE_BSDIS
  523. #endif
  524. ;
  525. tx4927_pcicptr->g2pmpbase[0] = mips_pci_mem_base;
  526. tx4927_pcicptr->g2pmmask[1] = 0;
  527. tx4927_pcicptr->g2pmgbase[1] = 0;
  528. tx4927_pcicptr->g2pmpbase[1] = 0;
  529. tx4927_pcicptr->g2pmmask[2] = 0;
  530. tx4927_pcicptr->g2pmgbase[2] = 0;
  531. tx4927_pcicptr->g2pmpbase[2] = 0;
  532. /* PCI->GB mappings (I/O 256B) */
  533. tx4927_pcicptr->p2giopbase = 0; /* 256B */
  534. /* PCI->GB mappings (MEM 512MB) M0 gets all of memory */
  535. tx4927_pcicptr->p2gm0plbase = 0;
  536. tx4927_pcicptr->p2gm0pubase = 0;
  537. tx4927_pcicptr->p2gmgbase[0] = 0 | TX4927_PCIC_P2GMnGBASE_TMEMEN |
  538. #ifdef __BIG_ENDIAN
  539. TX4927_PCIC_P2GMnGBASE_TECHG
  540. #else
  541. TX4927_PCIC_P2GMnGBASE_TBSDIS
  542. #endif
  543. ;
  544. /* PCI->GB mappings (MEM 16MB) -not used */
  545. tx4927_pcicptr->p2gm1plbase = 0xffffffff;
  546. tx4927_pcicptr->p2gm1pubase = 0xffffffff;
  547. tx4927_pcicptr->p2gmgbase[1] = 0;
  548. /* PCI->GB mappings (MEM 1MB) -not used */
  549. tx4927_pcicptr->p2gm2pbase = 0xffffffff;
  550. tx4927_pcicptr->p2gmgbase[2] = 0;
  551. /* Enable Initiator Memory 0 Space, I/O Space, Config */
  552. tx4927_pcicptr->pciccfg &= TX4927_PCIC_PCICCFG_LBWC_MASK;
  553. tx4927_pcicptr->pciccfg |=
  554. TX4927_PCIC_PCICCFG_IMSE0 | TX4927_PCIC_PCICCFG_IISE |
  555. TX4927_PCIC_PCICCFG_ICAE | TX4927_PCIC_PCICCFG_ATR;
  556. /* Do not use MEMMUL, MEMINF: YMFPCI card causes M_ABORT. */
  557. tx4927_pcicptr->pcicfg1 = 0;
  558. if (tx4927_pcic_trdyto >= 0) {
  559. tx4927_pcicptr->g2ptocnt &= ~0xff;
  560. tx4927_pcicptr->g2ptocnt |= (tx4927_pcic_trdyto & 0xff);
  561. }
  562. /* Clear All Local Bus Status */
  563. tx4927_pcicptr->pcicstatus = TX4927_PCIC_PCICSTATUS_ALL;
  564. /* Enable All Local Bus Interrupts */
  565. tx4927_pcicptr->pcicmask = TX4927_PCIC_PCICSTATUS_ALL;
  566. /* Clear All Initiator Status */
  567. tx4927_pcicptr->g2pstatus = TX4927_PCIC_G2PSTATUS_ALL;
  568. /* Enable All Initiator Interrupts */
  569. tx4927_pcicptr->g2pmask = TX4927_PCIC_G2PSTATUS_ALL;
  570. /* Clear All PCI Status Error */
  571. tx4927_pcicptr->pcistatus =
  572. (tx4927_pcicptr->pcistatus & 0x0000ffff) |
  573. (TX4927_PCIC_PCISTATUS_ALL << 16);
  574. /* Enable All PCI Status Error Interrupts */
  575. tx4927_pcicptr->pcimask = TX4927_PCIC_PCISTATUS_ALL;
  576. /* PCIC Int => IRC IRQ16 */
  577. tx4927_pcicptr->pcicfg2 =
  578. (tx4927_pcicptr->pcicfg2 & 0xffffff00) | TX4927_IR_PCIC;
  579. if (!(tx4927_ccfgptr->ccfg & TX4927_CCFG_PCIXARB)) {
  580. /* XXX */
  581. } else {
  582. /* Reset Bus Arbiter */
  583. tx4927_pcicptr->pbacfg = TX4927_PCIC_PBACFG_RPBA;
  584. /* Enable Bus Arbiter */
  585. tx4927_pcicptr->pbacfg = TX4927_PCIC_PBACFG_PBAEN;
  586. }
  587. tx4927_pcicptr->pcistatus = PCI_COMMAND_MASTER |
  588. PCI_COMMAND_MEMORY |
  589. PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
  590. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
  591. ":pci setup complete:\n");
  592. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "+\n");
  593. }
  594. #endif /* CONFIG_PCI */
  595. static void __noreturn wait_forever(void)
  596. {
  597. while (1)
  598. if (cpu_wait)
  599. (*cpu_wait)();
  600. }
  601. void toshiba_rbtx4927_restart(char *command)
  602. {
  603. printk(KERN_NOTICE "System Rebooting...\n");
  604. /* enable the s/w reset register */
  605. writeb(RBTX4927_SW_RESET_ENABLE_SET, RBTX4927_SW_RESET_ENABLE);
  606. /* wait for enable to be seen */
  607. while ((readb(RBTX4927_SW_RESET_ENABLE) &
  608. RBTX4927_SW_RESET_ENABLE_SET) == 0x00);
  609. /* do a s/w reset */
  610. writeb(RBTX4927_SW_RESET_DO_SET, RBTX4927_SW_RESET_DO);
  611. /* do something passive while waiting for reset */
  612. local_irq_disable();
  613. wait_forever();
  614. /* no return */
  615. }
  616. void toshiba_rbtx4927_halt(void)
  617. {
  618. printk(KERN_NOTICE "System Halted\n");
  619. local_irq_disable();
  620. wait_forever();
  621. /* no return */
  622. }
  623. void toshiba_rbtx4927_power_off(void)
  624. {
  625. toshiba_rbtx4927_halt();
  626. /* no return */
  627. }
  628. void __init toshiba_rbtx4927_setup(void)
  629. {
  630. int i;
  631. u32 cp0_config;
  632. char *argptr;
  633. printk("CPU is %s\n", toshiba_name);
  634. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  635. "-\n");
  636. /* f/w leaves this on at startup */
  637. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  638. ":Clearing STO_ERL.\n");
  639. clear_c0_status(ST0_ERL);
  640. /* enable caches -- HCP5 does this, pmon does not */
  641. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  642. ":Enabling TX49_CONF_IC,TX49_CONF_DC.\n");
  643. cp0_config = read_c0_config();
  644. cp0_config = cp0_config & ~(TX49_CONF_IC | TX49_CONF_DC);
  645. write_c0_config(cp0_config);
  646. #ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
  647. {
  648. extern void dump_cp0(char *);
  649. dump_cp0("toshiba_rbtx4927_early_fw_fixup");
  650. }
  651. #endif
  652. set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET);
  653. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  654. ":mips_io_port_base=0x%08lx\n",
  655. mips_io_port_base);
  656. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  657. ":Resource\n");
  658. ioport_resource.end = 0xffffffff;
  659. iomem_resource.end = 0xffffffff;
  660. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  661. ":ResetRoutines\n");
  662. _machine_restart = toshiba_rbtx4927_restart;
  663. _machine_halt = toshiba_rbtx4927_halt;
  664. pm_power_off = toshiba_rbtx4927_power_off;
  665. for (i = 0; i < TX4927_NR_TMR; i++)
  666. txx9_tmr_init(TX4927_TMR_REG(0) & 0xfffffffffULL);
  667. #ifdef CONFIG_PCI
  668. /* PCIC */
  669. /*
  670. * ASSUMPTION: PCIDIVMODE is configured for PCI 33MHz or 66MHz.
  671. *
  672. * For TX4927:
  673. * PCIDIVMODE[12:11]'s initial value is given by S9[4:3] (ON:0, OFF:1).
  674. * CPU 166MHz: PCI 66MHz : PCIDIVMODE: 00 (1/2.5)
  675. * CPU 200MHz: PCI 66MHz : PCIDIVMODE: 01 (1/3)
  676. * CPU 166MHz: PCI 33MHz : PCIDIVMODE: 10 (1/5)
  677. * CPU 200MHz: PCI 33MHz : PCIDIVMODE: 11 (1/6)
  678. * i.e. S9[3]: ON (83MHz), OFF (100MHz)
  679. *
  680. * For TX4937:
  681. * PCIDIVMODE[12:11]'s initial value is given by S1[5:4] (ON:0, OFF:1)
  682. * PCIDIVMODE[10] is 0.
  683. * CPU 266MHz: PCI 33MHz : PCIDIVMODE: 000 (1/8)
  684. * CPU 266MHz: PCI 66MHz : PCIDIVMODE: 001 (1/4)
  685. * CPU 300MHz: PCI 33MHz : PCIDIVMODE: 010 (1/9)
  686. * CPU 300MHz: PCI 66MHz : PCIDIVMODE: 011 (1/4.5)
  687. * CPU 333MHz: PCI 33MHz : PCIDIVMODE: 100 (1/10)
  688. * CPU 333MHz: PCI 66MHz : PCIDIVMODE: 101 (1/5)
  689. *
  690. */
  691. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI1,
  692. "ccfg is %lx, PCIDIVMODE is %x\n",
  693. (unsigned long) tx4927_ccfgptr->ccfg,
  694. (unsigned long) tx4927_ccfgptr->ccfg &
  695. (mips_machtype == MACH_TOSHIBA_RBTX4937 ?
  696. TX4937_CCFG_PCIDIVMODE_MASK :
  697. TX4927_CCFG_PCIDIVMODE_MASK));
  698. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI1,
  699. "PCI66 mode is %lx, PCI mode is %lx, pci arb is %lx\n",
  700. (unsigned long) tx4927_ccfgptr->
  701. ccfg & TX4927_CCFG_PCI66,
  702. (unsigned long) tx4927_ccfgptr->
  703. ccfg & TX4927_CCFG_PCIMIDE,
  704. (unsigned long) tx4927_ccfgptr->
  705. ccfg & TX4927_CCFG_PCIXARB);
  706. if (mips_machtype == MACH_TOSHIBA_RBTX4937)
  707. switch ((unsigned long)tx4927_ccfgptr->
  708. ccfg & TX4937_CCFG_PCIDIVMODE_MASK) {
  709. case TX4937_CCFG_PCIDIVMODE_8:
  710. case TX4937_CCFG_PCIDIVMODE_4:
  711. tx4927_cpu_clock = 266666666; /* 266MHz */
  712. break;
  713. case TX4937_CCFG_PCIDIVMODE_9:
  714. case TX4937_CCFG_PCIDIVMODE_4_5:
  715. tx4927_cpu_clock = 300000000; /* 300MHz */
  716. break;
  717. default:
  718. tx4927_cpu_clock = 333333333; /* 333MHz */
  719. }
  720. else
  721. switch ((unsigned long)tx4927_ccfgptr->
  722. ccfg & TX4927_CCFG_PCIDIVMODE_MASK) {
  723. case TX4927_CCFG_PCIDIVMODE_2_5:
  724. case TX4927_CCFG_PCIDIVMODE_5:
  725. tx4927_cpu_clock = 166666666; /* 166MHz */
  726. break;
  727. default:
  728. tx4927_cpu_clock = 200000000; /* 200MHz */
  729. }
  730. /* CCFG */
  731. /* enable Timeout BusError */
  732. if (tx4927_ccfg_toeon)
  733. tx4927_ccfgptr->ccfg |= TX4927_CCFG_TOE;
  734. tx4927_pci_setup();
  735. if (tx4927_using_backplane == 1)
  736. printk("backplane board IS installed\n");
  737. else
  738. printk("No Backplane \n");
  739. /* this is on ISA bus behind PCI bus, so need PCI up first */
  740. #ifdef CONFIG_TOSHIBA_FPCIB0
  741. {
  742. if (tx4927_using_backplane) {
  743. TOSHIBA_RBTX4927_SETUP_DPRINTK
  744. (TOSHIBA_RBTX4927_SETUP_SETUP,
  745. ":fpcibo=yes\n");
  746. TOSHIBA_RBTX4927_SETUP_DPRINTK
  747. (TOSHIBA_RBTX4927_SETUP_SETUP,
  748. ":smsc_fdc37m81x_init()\n");
  749. smsc_fdc37m81x_init(0x3f0);
  750. TOSHIBA_RBTX4927_SETUP_DPRINTK
  751. (TOSHIBA_RBTX4927_SETUP_SETUP,
  752. ":smsc_fdc37m81x_config_beg()\n");
  753. smsc_fdc37m81x_config_beg();
  754. TOSHIBA_RBTX4927_SETUP_DPRINTK
  755. (TOSHIBA_RBTX4927_SETUP_SETUP,
  756. ":smsc_fdc37m81x_config_set(KBD)\n");
  757. smsc_fdc37m81x_config_set(SMSC_FDC37M81X_DNUM,
  758. SMSC_FDC37M81X_KBD);
  759. smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT, 1);
  760. smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT2, 12);
  761. smsc_fdc37m81x_config_set(SMSC_FDC37M81X_ACTIVE,
  762. 1);
  763. smsc_fdc37m81x_config_end();
  764. TOSHIBA_RBTX4927_SETUP_DPRINTK
  765. (TOSHIBA_RBTX4927_SETUP_SETUP,
  766. ":smsc_fdc37m81x_config_end()\n");
  767. } else {
  768. TOSHIBA_RBTX4927_SETUP_DPRINTK
  769. (TOSHIBA_RBTX4927_SETUP_SETUP,
  770. ":fpcibo=not_found\n");
  771. }
  772. }
  773. #else
  774. {
  775. TOSHIBA_RBTX4927_SETUP_DPRINTK
  776. (TOSHIBA_RBTX4927_SETUP_SETUP, ":fpcibo=no\n");
  777. }
  778. #endif
  779. #endif /* CONFIG_PCI */
  780. #ifdef CONFIG_SERIAL_TXX9
  781. {
  782. extern int early_serial_txx9_setup(struct uart_port *port);
  783. struct uart_port req;
  784. for(i = 0; i < 2; i++) {
  785. memset(&req, 0, sizeof(req));
  786. req.line = i;
  787. req.iotype = UPIO_MEM;
  788. req.membase = (char *)(0xff1ff300 + i * 0x100);
  789. req.mapbase = 0xff1ff300 + i * 0x100;
  790. req.irq = TX4927_IRQ_PIC_BEG + 8 + i;
  791. req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
  792. req.uartclk = 50000000;
  793. early_serial_txx9_setup(&req);
  794. }
  795. }
  796. #ifdef CONFIG_SERIAL_TXX9_CONSOLE
  797. argptr = prom_getcmdline();
  798. if (strstr(argptr, "console=") == NULL) {
  799. strcat(argptr, " console=ttyS0,38400");
  800. }
  801. #endif
  802. #endif
  803. #ifdef CONFIG_ROOT_NFS
  804. argptr = prom_getcmdline();
  805. if (strstr(argptr, "root=") == NULL) {
  806. strcat(argptr, " root=/dev/nfs rw");
  807. }
  808. #endif
  809. #ifdef CONFIG_IP_PNP
  810. argptr = prom_getcmdline();
  811. if (strstr(argptr, "ip=") == NULL) {
  812. strcat(argptr, " ip=any");
  813. }
  814. #endif
  815. TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
  816. "+\n");
  817. }
  818. void __init
  819. toshiba_rbtx4927_time_init(void)
  820. {
  821. mips_hpt_frequency = tx4927_cpu_clock / 2;
  822. if (tx4927_ccfgptr->ccfg & TX4927_CCFG_TINTDIS)
  823. txx9_clockevent_init(TX4927_TMR_REG(0) & 0xfffffffffULL,
  824. TXX9_IRQ_BASE + 17,
  825. 50000000);
  826. }
  827. static int __init toshiba_rbtx4927_rtc_init(void)
  828. {
  829. static struct resource __initdata res = {
  830. .start = 0x1c010000,
  831. .end = 0x1c010000 + 0x800 - 1,
  832. .flags = IORESOURCE_MEM,
  833. };
  834. struct platform_device *dev =
  835. platform_device_register_simple("rtc-ds1742", -1, &res, 1);
  836. return IS_ERR(dev) ? PTR_ERR(dev) : 0;
  837. }
  838. device_initcall(toshiba_rbtx4927_rtc_init);
  839. static int __init rbtx4927_ne_init(void)
  840. {
  841. static struct resource __initdata res[] = {
  842. {
  843. .start = RBTX4927_RTL_8019_BASE,
  844. .end = RBTX4927_RTL_8019_BASE + 0x20 - 1,
  845. .flags = IORESOURCE_IO,
  846. }, {
  847. .start = RBTX4927_RTL_8019_IRQ,
  848. .flags = IORESOURCE_IRQ,
  849. }
  850. };
  851. struct platform_device *dev =
  852. platform_device_register_simple("ne", -1,
  853. res, ARRAY_SIZE(res));
  854. return IS_ERR(dev) ? PTR_ERR(dev) : 0;
  855. }
  856. device_initcall(rbtx4927_ne_init);