toshiba_rbtx4927_setup.c 29 KB

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