setup.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. /*
  2. * arch/xtensa/kernel/setup.c
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 1995 Linus Torvalds
  9. * Copyright (C) 2001 - 2005 Tensilica Inc.
  10. *
  11. * Chris Zankel <chris@zankel.net>
  12. * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com>
  13. * Kevin Chea
  14. * Marc Gauthier<marc@tensilica.com> <marc@alumni.uwaterloo.ca>
  15. */
  16. #include <linux/errno.h>
  17. #include <linux/init.h>
  18. #include <linux/mm.h>
  19. #include <linux/proc_fs.h>
  20. #include <linux/screen_info.h>
  21. #include <linux/bootmem.h>
  22. #include <linux/kernel.h>
  23. #include <linux/of_fdt.h>
  24. #include <linux/of_platform.h>
  25. #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
  26. # include <linux/console.h>
  27. #endif
  28. #ifdef CONFIG_RTC
  29. # include <linux/timex.h>
  30. #endif
  31. #ifdef CONFIG_PROC_FS
  32. # include <linux/seq_file.h>
  33. #endif
  34. #include <asm/bootparam.h>
  35. #include <asm/pgtable.h>
  36. #include <asm/processor.h>
  37. #include <asm/timex.h>
  38. #include <asm/platform.h>
  39. #include <asm/page.h>
  40. #include <asm/setup.h>
  41. #include <asm/param.h>
  42. #include <asm/traps.h>
  43. #include <platform/hardware.h>
  44. #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
  45. struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16};
  46. #endif
  47. #ifdef CONFIG_BLK_DEV_FD
  48. extern struct fd_ops no_fd_ops;
  49. struct fd_ops *fd_ops;
  50. #endif
  51. extern struct rtc_ops no_rtc_ops;
  52. struct rtc_ops *rtc_ops;
  53. #ifdef CONFIG_BLK_DEV_INITRD
  54. extern unsigned long initrd_start;
  55. extern unsigned long initrd_end;
  56. int initrd_is_mapped = 0;
  57. extern int initrd_below_start_ok;
  58. #endif
  59. #ifdef CONFIG_OF
  60. extern u32 __dtb_start[];
  61. void *dtb_start = __dtb_start;
  62. #endif
  63. unsigned char aux_device_present;
  64. extern unsigned long loops_per_jiffy;
  65. /* Command line specified as configuration option. */
  66. static char __initdata command_line[COMMAND_LINE_SIZE];
  67. #ifdef CONFIG_CMDLINE_BOOL
  68. static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
  69. #endif
  70. sysmem_info_t __initdata sysmem;
  71. #ifdef CONFIG_MMU
  72. extern void init_mmu(void);
  73. #else
  74. static inline void init_mmu(void) { }
  75. #endif
  76. extern int mem_reserve(unsigned long, unsigned long, int);
  77. extern void bootmem_init(void);
  78. extern void zones_init(void);
  79. /*
  80. * Boot parameter parsing.
  81. *
  82. * The Xtensa port uses a list of variable-sized tags to pass data to
  83. * the kernel. The first tag must be a BP_TAG_FIRST tag for the list
  84. * to be recognised. The list is terminated with a zero-sized
  85. * BP_TAG_LAST tag.
  86. */
  87. typedef struct tagtable {
  88. u32 tag;
  89. int (*parse)(const bp_tag_t*);
  90. } tagtable_t;
  91. #define __tagtable(tag, fn) static tagtable_t __tagtable_##fn \
  92. __attribute__((used, section(".taglist"))) = { tag, fn }
  93. /* parse current tag */
  94. static int __init add_sysmem_bank(unsigned long type, unsigned long start,
  95. unsigned long end)
  96. {
  97. if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) {
  98. printk(KERN_WARNING
  99. "Ignoring memory bank 0x%08lx size %ldKB\n",
  100. start, end - start);
  101. return -EINVAL;
  102. }
  103. sysmem.bank[sysmem.nr_banks].type = type;
  104. sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(start);
  105. sysmem.bank[sysmem.nr_banks].end = end & PAGE_MASK;
  106. sysmem.nr_banks++;
  107. return 0;
  108. }
  109. static int __init parse_tag_mem(const bp_tag_t *tag)
  110. {
  111. meminfo_t *mi = (meminfo_t *)(tag->data);
  112. if (mi->type != MEMORY_TYPE_CONVENTIONAL)
  113. return -1;
  114. return add_sysmem_bank(mi->type, mi->start, mi->end);
  115. }
  116. __tagtable(BP_TAG_MEMORY, parse_tag_mem);
  117. #ifdef CONFIG_BLK_DEV_INITRD
  118. static int __init parse_tag_initrd(const bp_tag_t* tag)
  119. {
  120. meminfo_t* mi;
  121. mi = (meminfo_t*)(tag->data);
  122. initrd_start = (unsigned long)__va(mi->start);
  123. initrd_end = (unsigned long)__va(mi->end);
  124. return 0;
  125. }
  126. __tagtable(BP_TAG_INITRD, parse_tag_initrd);
  127. #ifdef CONFIG_OF
  128. static int __init parse_tag_fdt(const bp_tag_t *tag)
  129. {
  130. dtb_start = __va(tag->data[0]);
  131. return 0;
  132. }
  133. __tagtable(BP_TAG_FDT, parse_tag_fdt);
  134. #endif /* CONFIG_OF */
  135. #endif /* CONFIG_BLK_DEV_INITRD */
  136. static int __init parse_tag_cmdline(const bp_tag_t* tag)
  137. {
  138. strlcpy(command_line, (char *)(tag->data), COMMAND_LINE_SIZE);
  139. return 0;
  140. }
  141. __tagtable(BP_TAG_COMMAND_LINE, parse_tag_cmdline);
  142. static int __init parse_bootparam(const bp_tag_t* tag)
  143. {
  144. extern tagtable_t __tagtable_begin, __tagtable_end;
  145. tagtable_t *t;
  146. /* Boot parameters must start with a BP_TAG_FIRST tag. */
  147. if (tag->id != BP_TAG_FIRST) {
  148. printk(KERN_WARNING "Invalid boot parameters!\n");
  149. return 0;
  150. }
  151. tag = (bp_tag_t*)((unsigned long)tag + sizeof(bp_tag_t) + tag->size);
  152. /* Parse all tags. */
  153. while (tag != NULL && tag->id != BP_TAG_LAST) {
  154. for (t = &__tagtable_begin; t < &__tagtable_end; t++) {
  155. if (tag->id == t->tag) {
  156. t->parse(tag);
  157. break;
  158. }
  159. }
  160. if (t == &__tagtable_end)
  161. printk(KERN_WARNING "Ignoring tag "
  162. "0x%08x\n", tag->id);
  163. tag = (bp_tag_t*)((unsigned long)(tag + 1) + tag->size);
  164. }
  165. return 0;
  166. }
  167. #ifdef CONFIG_OF
  168. bool __initdata dt_memory_scan = false;
  169. void __init early_init_dt_add_memory_arch(u64 base, u64 size)
  170. {
  171. if (!dt_memory_scan)
  172. return;
  173. size &= PAGE_MASK;
  174. add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size);
  175. }
  176. void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
  177. {
  178. return __alloc_bootmem(size, align, 0);
  179. }
  180. void __init early_init_devtree(void *params)
  181. {
  182. if (sysmem.nr_banks == 0)
  183. dt_memory_scan = true;
  184. early_init_dt_scan(params);
  185. if (!command_line[0])
  186. strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
  187. }
  188. static int __init xtensa_device_probe(void)
  189. {
  190. of_platform_populate(NULL, NULL, NULL, NULL);
  191. return 0;
  192. }
  193. device_initcall(xtensa_device_probe);
  194. #endif /* CONFIG_OF */
  195. /*
  196. * Initialize architecture. (Early stage)
  197. */
  198. void __init init_arch(bp_tag_t *bp_start)
  199. {
  200. sysmem.nr_banks = 0;
  201. /* Parse boot parameters */
  202. if (bp_start)
  203. parse_bootparam(bp_start);
  204. #ifdef CONFIG_OF
  205. early_init_devtree(dtb_start);
  206. #endif
  207. if (sysmem.nr_banks == 0) {
  208. sysmem.nr_banks = 1;
  209. sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START;
  210. sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START
  211. + PLATFORM_DEFAULT_MEM_SIZE;
  212. }
  213. #ifdef CONFIG_CMDLINE_BOOL
  214. if (!command_line[0])
  215. strlcpy(command_line, default_command_line, COMMAND_LINE_SIZE);
  216. #endif
  217. /* Early hook for platforms */
  218. platform_init(bp_start);
  219. /* Initialize MMU. */
  220. init_mmu();
  221. }
  222. /*
  223. * Initialize system. Setup memory and reserve regions.
  224. */
  225. extern char _end;
  226. extern char _stext;
  227. extern char _WindowVectors_text_start;
  228. extern char _WindowVectors_text_end;
  229. extern char _DebugInterruptVector_literal_start;
  230. extern char _DebugInterruptVector_text_end;
  231. extern char _KernelExceptionVector_literal_start;
  232. extern char _KernelExceptionVector_text_end;
  233. extern char _UserExceptionVector_literal_start;
  234. extern char _UserExceptionVector_text_end;
  235. extern char _DoubleExceptionVector_literal_start;
  236. extern char _DoubleExceptionVector_text_end;
  237. #if XCHAL_EXCM_LEVEL >= 2
  238. extern char _Level2InterruptVector_text_start;
  239. extern char _Level2InterruptVector_text_end;
  240. #endif
  241. #if XCHAL_EXCM_LEVEL >= 3
  242. extern char _Level3InterruptVector_text_start;
  243. extern char _Level3InterruptVector_text_end;
  244. #endif
  245. #if XCHAL_EXCM_LEVEL >= 4
  246. extern char _Level4InterruptVector_text_start;
  247. extern char _Level4InterruptVector_text_end;
  248. #endif
  249. #if XCHAL_EXCM_LEVEL >= 5
  250. extern char _Level5InterruptVector_text_start;
  251. extern char _Level5InterruptVector_text_end;
  252. #endif
  253. #if XCHAL_EXCM_LEVEL >= 6
  254. extern char _Level6InterruptVector_text_start;
  255. extern char _Level6InterruptVector_text_end;
  256. #endif
  257. #ifdef CONFIG_S32C1I_SELFTEST
  258. #if XCHAL_HAVE_S32C1I
  259. static int __initdata rcw_word, rcw_probe_pc, rcw_exc;
  260. /*
  261. * Basic atomic compare-and-swap, that records PC of S32C1I for probing.
  262. *
  263. * If *v == cmp, set *v = set. Return previous *v.
  264. */
  265. static inline int probed_compare_swap(int *v, int cmp, int set)
  266. {
  267. int tmp;
  268. __asm__ __volatile__(
  269. " movi %1, 1f\n"
  270. " s32i %1, %4, 0\n"
  271. " wsr %2, scompare1\n"
  272. "1: s32c1i %0, %3, 0\n"
  273. : "=a" (set), "=&a" (tmp)
  274. : "a" (cmp), "a" (v), "a" (&rcw_probe_pc), "0" (set)
  275. : "memory"
  276. );
  277. return set;
  278. }
  279. /* Handle probed exception */
  280. void __init do_probed_exception(struct pt_regs *regs, unsigned long exccause)
  281. {
  282. if (regs->pc == rcw_probe_pc) { /* exception on s32c1i ? */
  283. regs->pc += 3; /* skip the s32c1i instruction */
  284. rcw_exc = exccause;
  285. } else {
  286. do_unhandled(regs, exccause);
  287. }
  288. }
  289. /* Simple test of S32C1I (soc bringup assist) */
  290. void __init check_s32c1i(void)
  291. {
  292. int n, cause1, cause2;
  293. void *handbus, *handdata, *handaddr; /* temporarily saved handlers */
  294. rcw_probe_pc = 0;
  295. handbus = trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR,
  296. do_probed_exception);
  297. handdata = trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR,
  298. do_probed_exception);
  299. handaddr = trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR,
  300. do_probed_exception);
  301. /* First try an S32C1I that does not store: */
  302. rcw_exc = 0;
  303. rcw_word = 1;
  304. n = probed_compare_swap(&rcw_word, 0, 2);
  305. cause1 = rcw_exc;
  306. /* took exception? */
  307. if (cause1 != 0) {
  308. /* unclean exception? */
  309. if (n != 2 || rcw_word != 1)
  310. panic("S32C1I exception error");
  311. } else if (rcw_word != 1 || n != 1) {
  312. panic("S32C1I compare error");
  313. }
  314. /* Then an S32C1I that stores: */
  315. rcw_exc = 0;
  316. rcw_word = 0x1234567;
  317. n = probed_compare_swap(&rcw_word, 0x1234567, 0xabcde);
  318. cause2 = rcw_exc;
  319. if (cause2 != 0) {
  320. /* unclean exception? */
  321. if (n != 0xabcde || rcw_word != 0x1234567)
  322. panic("S32C1I exception error (b)");
  323. } else if (rcw_word != 0xabcde || n != 0x1234567) {
  324. panic("S32C1I store error");
  325. }
  326. /* Verify consistency of exceptions: */
  327. if (cause1 || cause2) {
  328. pr_warn("S32C1I took exception %d, %d\n", cause1, cause2);
  329. /* If emulation of S32C1I upon bus error gets implemented,
  330. we can get rid of this panic for single core (not SMP) */
  331. panic("S32C1I exceptions not currently supported");
  332. }
  333. if (cause1 != cause2)
  334. panic("inconsistent S32C1I exceptions");
  335. trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR, handbus);
  336. trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR, handdata);
  337. trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR, handaddr);
  338. }
  339. #else /* XCHAL_HAVE_S32C1I */
  340. /* This condition should not occur with a commercially deployed processor.
  341. Display reminder for early engr test or demo chips / FPGA bitstreams */
  342. void __init check_s32c1i(void)
  343. {
  344. pr_warn("Processor configuration lacks atomic compare-and-swap support!\n");
  345. }
  346. #endif /* XCHAL_HAVE_S32C1I */
  347. #else /* CONFIG_S32C1I_SELFTEST */
  348. void __init check_s32c1i(void)
  349. {
  350. }
  351. #endif /* CONFIG_S32C1I_SELFTEST */
  352. void __init setup_arch(char **cmdline_p)
  353. {
  354. strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
  355. *cmdline_p = command_line;
  356. check_s32c1i();
  357. /* Reserve some memory regions */
  358. #ifdef CONFIG_BLK_DEV_INITRD
  359. if (initrd_start < initrd_end) {
  360. initrd_is_mapped = mem_reserve(__pa(initrd_start),
  361. __pa(initrd_end), 0);
  362. initrd_below_start_ok = 1;
  363. } else {
  364. initrd_start = 0;
  365. }
  366. #endif
  367. mem_reserve(__pa(&_stext),__pa(&_end), 1);
  368. mem_reserve(__pa(&_WindowVectors_text_start),
  369. __pa(&_WindowVectors_text_end), 0);
  370. mem_reserve(__pa(&_DebugInterruptVector_literal_start),
  371. __pa(&_DebugInterruptVector_text_end), 0);
  372. mem_reserve(__pa(&_KernelExceptionVector_literal_start),
  373. __pa(&_KernelExceptionVector_text_end), 0);
  374. mem_reserve(__pa(&_UserExceptionVector_literal_start),
  375. __pa(&_UserExceptionVector_text_end), 0);
  376. mem_reserve(__pa(&_DoubleExceptionVector_literal_start),
  377. __pa(&_DoubleExceptionVector_text_end), 0);
  378. #if XCHAL_EXCM_LEVEL >= 2
  379. mem_reserve(__pa(&_Level2InterruptVector_text_start),
  380. __pa(&_Level2InterruptVector_text_end), 0);
  381. #endif
  382. #if XCHAL_EXCM_LEVEL >= 3
  383. mem_reserve(__pa(&_Level3InterruptVector_text_start),
  384. __pa(&_Level3InterruptVector_text_end), 0);
  385. #endif
  386. #if XCHAL_EXCM_LEVEL >= 4
  387. mem_reserve(__pa(&_Level4InterruptVector_text_start),
  388. __pa(&_Level4InterruptVector_text_end), 0);
  389. #endif
  390. #if XCHAL_EXCM_LEVEL >= 5
  391. mem_reserve(__pa(&_Level5InterruptVector_text_start),
  392. __pa(&_Level5InterruptVector_text_end), 0);
  393. #endif
  394. #if XCHAL_EXCM_LEVEL >= 6
  395. mem_reserve(__pa(&_Level6InterruptVector_text_start),
  396. __pa(&_Level6InterruptVector_text_end), 0);
  397. #endif
  398. bootmem_init();
  399. unflatten_and_copy_device_tree();
  400. platform_setup(cmdline_p);
  401. paging_init();
  402. zones_init();
  403. #ifdef CONFIG_VT
  404. # if defined(CONFIG_VGA_CONSOLE)
  405. conswitchp = &vga_con;
  406. # elif defined(CONFIG_DUMMY_CONSOLE)
  407. conswitchp = &dummy_con;
  408. # endif
  409. #endif
  410. #ifdef CONFIG_PCI
  411. platform_pcibios_init();
  412. #endif
  413. }
  414. void machine_restart(char * cmd)
  415. {
  416. platform_restart();
  417. }
  418. void machine_halt(void)
  419. {
  420. platform_halt();
  421. while (1);
  422. }
  423. void machine_power_off(void)
  424. {
  425. platform_power_off();
  426. while (1);
  427. }
  428. #ifdef CONFIG_PROC_FS
  429. /*
  430. * Display some core information through /proc/cpuinfo.
  431. */
  432. static int
  433. c_show(struct seq_file *f, void *slot)
  434. {
  435. /* high-level stuff */
  436. seq_printf(f,"processor\t: 0\n"
  437. "vendor_id\t: Tensilica\n"
  438. "model\t\t: Xtensa " XCHAL_HW_VERSION_NAME "\n"
  439. "core ID\t\t: " XCHAL_CORE_ID "\n"
  440. "build ID\t: 0x%x\n"
  441. "byte order\t: %s\n"
  442. "cpu MHz\t\t: %lu.%02lu\n"
  443. "bogomips\t: %lu.%02lu\n",
  444. XCHAL_BUILD_UNIQUE_ID,
  445. XCHAL_HAVE_BE ? "big" : "little",
  446. ccount_freq/1000000,
  447. (ccount_freq/10000) % 100,
  448. loops_per_jiffy/(500000/HZ),
  449. (loops_per_jiffy/(5000/HZ)) % 100);
  450. seq_printf(f,"flags\t\t: "
  451. #if XCHAL_HAVE_NMI
  452. "nmi "
  453. #endif
  454. #if XCHAL_HAVE_DEBUG
  455. "debug "
  456. # if XCHAL_HAVE_OCD
  457. "ocd "
  458. # endif
  459. #endif
  460. #if XCHAL_HAVE_DENSITY
  461. "density "
  462. #endif
  463. #if XCHAL_HAVE_BOOLEANS
  464. "boolean "
  465. #endif
  466. #if XCHAL_HAVE_LOOPS
  467. "loop "
  468. #endif
  469. #if XCHAL_HAVE_NSA
  470. "nsa "
  471. #endif
  472. #if XCHAL_HAVE_MINMAX
  473. "minmax "
  474. #endif
  475. #if XCHAL_HAVE_SEXT
  476. "sext "
  477. #endif
  478. #if XCHAL_HAVE_CLAMPS
  479. "clamps "
  480. #endif
  481. #if XCHAL_HAVE_MAC16
  482. "mac16 "
  483. #endif
  484. #if XCHAL_HAVE_MUL16
  485. "mul16 "
  486. #endif
  487. #if XCHAL_HAVE_MUL32
  488. "mul32 "
  489. #endif
  490. #if XCHAL_HAVE_MUL32_HIGH
  491. "mul32h "
  492. #endif
  493. #if XCHAL_HAVE_FP
  494. "fpu "
  495. #endif
  496. #if XCHAL_HAVE_S32C1I
  497. "s32c1i "
  498. #endif
  499. "\n");
  500. /* Registers. */
  501. seq_printf(f,"physical aregs\t: %d\n"
  502. "misc regs\t: %d\n"
  503. "ibreak\t\t: %d\n"
  504. "dbreak\t\t: %d\n",
  505. XCHAL_NUM_AREGS,
  506. XCHAL_NUM_MISC_REGS,
  507. XCHAL_NUM_IBREAK,
  508. XCHAL_NUM_DBREAK);
  509. /* Interrupt. */
  510. seq_printf(f,"num ints\t: %d\n"
  511. "ext ints\t: %d\n"
  512. "int levels\t: %d\n"
  513. "timers\t\t: %d\n"
  514. "debug level\t: %d\n",
  515. XCHAL_NUM_INTERRUPTS,
  516. XCHAL_NUM_EXTINTERRUPTS,
  517. XCHAL_NUM_INTLEVELS,
  518. XCHAL_NUM_TIMERS,
  519. XCHAL_DEBUGLEVEL);
  520. /* Cache */
  521. seq_printf(f,"icache line size: %d\n"
  522. "icache ways\t: %d\n"
  523. "icache size\t: %d\n"
  524. "icache flags\t: "
  525. #if XCHAL_ICACHE_LINE_LOCKABLE
  526. "lock "
  527. #endif
  528. "\n"
  529. "dcache line size: %d\n"
  530. "dcache ways\t: %d\n"
  531. "dcache size\t: %d\n"
  532. "dcache flags\t: "
  533. #if XCHAL_DCACHE_IS_WRITEBACK
  534. "writeback "
  535. #endif
  536. #if XCHAL_DCACHE_LINE_LOCKABLE
  537. "lock "
  538. #endif
  539. "\n",
  540. XCHAL_ICACHE_LINESIZE,
  541. XCHAL_ICACHE_WAYS,
  542. XCHAL_ICACHE_SIZE,
  543. XCHAL_DCACHE_LINESIZE,
  544. XCHAL_DCACHE_WAYS,
  545. XCHAL_DCACHE_SIZE);
  546. return 0;
  547. }
  548. /*
  549. * We show only CPU #0 info.
  550. */
  551. static void *
  552. c_start(struct seq_file *f, loff_t *pos)
  553. {
  554. return (void *) ((*pos == 0) ? (void *)1 : NULL);
  555. }
  556. static void *
  557. c_next(struct seq_file *f, void *v, loff_t *pos)
  558. {
  559. return NULL;
  560. }
  561. static void
  562. c_stop(struct seq_file *f, void *v)
  563. {
  564. }
  565. const struct seq_operations cpuinfo_op =
  566. {
  567. start: c_start,
  568. next: c_next,
  569. stop: c_stop,
  570. show: c_show
  571. };
  572. #endif /* CONFIG_PROC_FS */