toshiba_rbtx4927_setup.c 29 KB

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