1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 5<book id="sh-drivers"> 6 <bookinfo> 7 <title>SuperH Interfaces Guide</title> 8 9 <authorgroup> 10 <author> 11 <firstname>Paul</firstname> 12 <surname>Mundt</surname> 13 <affiliation> 14 <address> 15 <email>lethal@linux-sh.org</email> 16 </address> 17 </affiliation> 18 </author> 19 </authorgroup> 20 21 <copyright> 22 <year>2008-2010</year> 23 <holder>Paul Mundt</holder> 24 </copyright> 25 <copyright> 26 <year>2008-2010</year> 27 <holder>Renesas Technology Corp.</holder> 28 </copyright> 29 <copyright> 30 <year>2010</year> 31 <holder>Renesas Electronics Corp.</holder> 32 </copyright> 33 34 <legalnotice> 35 <para> 36 This documentation is free software; you can redistribute 37 it and/or modify it under the terms of the GNU General Public 38 License version 2 as published by the Free Software Foundation. 39 </para> 40 41 <para> 42 This program is distributed in the hope that it will be 43 useful, but WITHOUT ANY WARRANTY; without even the implied 44 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 45 See the GNU General Public License for more details. 46 </para> 47 48 <para> 49 You should have received a copy of the GNU General Public 50 License along with this program; if not, write to the Free 51 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 52 MA 02111-1307 USA 53 </para> 54 55 <para> 56 For more details see the file COPYING in the source 57 distribution of Linux. 58 </para> 59 </legalnotice> 60 </bookinfo> 61 62<toc></toc> 63 64 <chapter id="mm"> 65 <title>Memory Management</title> 66 <sect1 id="sh4"> 67 <title>SH-4</title> 68 <sect2 id="sq"> 69 <title>Store Queue API</title> 70<!-- arch/sh/kernel/cpu/sh4/sq.c --> 71<refentry id="API-sq-flush-range"> 72<refentryinfo> 73 <title>LINUX</title> 74 <productname>Kernel Hackers Manual</productname> 75 <date>July 2017</date> 76</refentryinfo> 77<refmeta> 78 <refentrytitle><phrase>sq_flush_range</phrase></refentrytitle> 79 <manvolnum>9</manvolnum> 80 <refmiscinfo class="version">4.1.27</refmiscinfo> 81</refmeta> 82<refnamediv> 83 <refname>sq_flush_range</refname> 84 <refpurpose> 85 Flush (prefetch) a specific SQ range 86 </refpurpose> 87</refnamediv> 88<refsynopsisdiv> 89 <title>Synopsis</title> 90 <funcsynopsis><funcprototype> 91 <funcdef>void <function>sq_flush_range </function></funcdef> 92 <paramdef>unsigned long <parameter>start</parameter></paramdef> 93 <paramdef>unsigned int <parameter>len</parameter></paramdef> 94 </funcprototype></funcsynopsis> 95</refsynopsisdiv> 96<refsect1> 97 <title>Arguments</title> 98 <variablelist> 99 <varlistentry> 100 <term><parameter>start</parameter></term> 101 <listitem> 102 <para> 103 the store queue address to start flushing from 104 </para> 105 </listitem> 106 </varlistentry> 107 <varlistentry> 108 <term><parameter>len</parameter></term> 109 <listitem> 110 <para> 111 the length to flush 112 </para> 113 </listitem> 114 </varlistentry> 115 </variablelist> 116</refsect1> 117<refsect1> 118<title>Description</title> 119<para> 120 Flushes the store queue cache from <parameter>start</parameter> to <parameter>start</parameter> + <parameter>len</parameter> in a 121 linear fashion. 122</para> 123</refsect1> 124</refentry> 125 126<refentry id="API-sq-remap"> 127<refentryinfo> 128 <title>LINUX</title> 129 <productname>Kernel Hackers Manual</productname> 130 <date>July 2017</date> 131</refentryinfo> 132<refmeta> 133 <refentrytitle><phrase>sq_remap</phrase></refentrytitle> 134 <manvolnum>9</manvolnum> 135 <refmiscinfo class="version">4.1.27</refmiscinfo> 136</refmeta> 137<refnamediv> 138 <refname>sq_remap</refname> 139 <refpurpose> 140 Map a physical address through the Store Queues 141 </refpurpose> 142</refnamediv> 143<refsynopsisdiv> 144 <title>Synopsis</title> 145 <funcsynopsis><funcprototype> 146 <funcdef>unsigned long <function>sq_remap </function></funcdef> 147 <paramdef>unsigned long <parameter>phys</parameter></paramdef> 148 <paramdef>unsigned int <parameter>size</parameter></paramdef> 149 <paramdef>const char * <parameter>name</parameter></paramdef> 150 <paramdef>pgprot_t <parameter>prot</parameter></paramdef> 151 </funcprototype></funcsynopsis> 152</refsynopsisdiv> 153<refsect1> 154 <title>Arguments</title> 155 <variablelist> 156 <varlistentry> 157 <term><parameter>phys</parameter></term> 158 <listitem> 159 <para> 160 Physical address of mapping. 161 </para> 162 </listitem> 163 </varlistentry> 164 <varlistentry> 165 <term><parameter>size</parameter></term> 166 <listitem> 167 <para> 168 Length of mapping. 169 </para> 170 </listitem> 171 </varlistentry> 172 <varlistentry> 173 <term><parameter>name</parameter></term> 174 <listitem> 175 <para> 176 User invoking mapping. 177 </para> 178 </listitem> 179 </varlistentry> 180 <varlistentry> 181 <term><parameter>prot</parameter></term> 182 <listitem> 183 <para> 184 Protection bits. 185 </para> 186 </listitem> 187 </varlistentry> 188 </variablelist> 189</refsect1> 190<refsect1> 191<title>Description</title> 192<para> 193 Remaps the physical address <parameter>phys</parameter> through the next available store queue 194 address of <parameter>size</parameter> length. <parameter>name</parameter> is logged at boot time as well as through 195 the sysfs interface. 196</para> 197</refsect1> 198</refentry> 199 200<refentry id="API-sq-unmap"> 201<refentryinfo> 202 <title>LINUX</title> 203 <productname>Kernel Hackers Manual</productname> 204 <date>July 2017</date> 205</refentryinfo> 206<refmeta> 207 <refentrytitle><phrase>sq_unmap</phrase></refentrytitle> 208 <manvolnum>9</manvolnum> 209 <refmiscinfo class="version">4.1.27</refmiscinfo> 210</refmeta> 211<refnamediv> 212 <refname>sq_unmap</refname> 213 <refpurpose> 214 Unmap a Store Queue allocation 215 </refpurpose> 216</refnamediv> 217<refsynopsisdiv> 218 <title>Synopsis</title> 219 <funcsynopsis><funcprototype> 220 <funcdef>void <function>sq_unmap </function></funcdef> 221 <paramdef>unsigned long <parameter>vaddr</parameter></paramdef> 222 </funcprototype></funcsynopsis> 223</refsynopsisdiv> 224<refsect1> 225 <title>Arguments</title> 226 <variablelist> 227 <varlistentry> 228 <term><parameter>vaddr</parameter></term> 229 <listitem> 230 <para> 231 Pre-allocated Store Queue mapping. 232 </para> 233 </listitem> 234 </varlistentry> 235 </variablelist> 236</refsect1> 237<refsect1> 238<title>Description</title> 239<para> 240 Unmaps the store queue allocation <parameter>map</parameter> that was previously created by 241 <function>sq_remap</function>. Also frees up the pte that was previously inserted into 242 the kernel page table and discards the UTLB translation. 243</para> 244</refsect1> 245</refentry> 246 247 </sect2> 248 </sect1> 249 <sect1 id="sh5"> 250 <title>SH-5</title> 251 <sect2 id="tlb"> 252 <title>TLB Interfaces</title> 253<!-- arch/sh/mm/tlb-sh5.c --> 254<refentry id="API-sh64-tlb-init"> 255<refentryinfo> 256 <title>LINUX</title> 257 <productname>Kernel Hackers Manual</productname> 258 <date>July 2017</date> 259</refentryinfo> 260<refmeta> 261 <refentrytitle><phrase>sh64_tlb_init</phrase></refentrytitle> 262 <manvolnum>9</manvolnum> 263 <refmiscinfo class="version">4.1.27</refmiscinfo> 264</refmeta> 265<refnamediv> 266 <refname>sh64_tlb_init</refname> 267 <refpurpose> 268 Perform initial setup for the DTLB and ITLB. 269 </refpurpose> 270</refnamediv> 271<refsynopsisdiv> 272 <title>Synopsis</title> 273 <funcsynopsis><funcprototype> 274 <funcdef>int <function>sh64_tlb_init </function></funcdef> 275 <paramdef> <parameter>void</parameter></paramdef> 276 </funcprototype></funcsynopsis> 277</refsynopsisdiv> 278<refsect1> 279 <title>Arguments</title> 280 <variablelist> 281 <varlistentry> 282 <term><parameter>void</parameter></term> 283 <listitem> 284 <para> 285 no arguments 286 </para> 287 </listitem> 288 </varlistentry> 289 </variablelist> 290</refsect1> 291</refentry> 292 293<refentry id="API-sh64-next-free-dtlb-entry"> 294<refentryinfo> 295 <title>LINUX</title> 296 <productname>Kernel Hackers Manual</productname> 297 <date>July 2017</date> 298</refentryinfo> 299<refmeta> 300 <refentrytitle><phrase>sh64_next_free_dtlb_entry</phrase></refentrytitle> 301 <manvolnum>9</manvolnum> 302 <refmiscinfo class="version">4.1.27</refmiscinfo> 303</refmeta> 304<refnamediv> 305 <refname>sh64_next_free_dtlb_entry</refname> 306 <refpurpose> 307 Find the next available DTLB entry 308 </refpurpose> 309</refnamediv> 310<refsynopsisdiv> 311 <title>Synopsis</title> 312 <funcsynopsis><funcprototype> 313 <funcdef>unsigned long long <function>sh64_next_free_dtlb_entry </function></funcdef> 314 <paramdef> <parameter>void</parameter></paramdef> 315 </funcprototype></funcsynopsis> 316</refsynopsisdiv> 317<refsect1> 318 <title>Arguments</title> 319 <variablelist> 320 <varlistentry> 321 <term><parameter>void</parameter></term> 322 <listitem> 323 <para> 324 no arguments 325 </para> 326 </listitem> 327 </varlistentry> 328 </variablelist> 329</refsect1> 330</refentry> 331 332<refentry id="API-sh64-get-wired-dtlb-entry"> 333<refentryinfo> 334 <title>LINUX</title> 335 <productname>Kernel Hackers Manual</productname> 336 <date>July 2017</date> 337</refentryinfo> 338<refmeta> 339 <refentrytitle><phrase>sh64_get_wired_dtlb_entry</phrase></refentrytitle> 340 <manvolnum>9</manvolnum> 341 <refmiscinfo class="version">4.1.27</refmiscinfo> 342</refmeta> 343<refnamediv> 344 <refname>sh64_get_wired_dtlb_entry</refname> 345 <refpurpose> 346 Allocate a wired (locked-in) entry in the DTLB 347 </refpurpose> 348</refnamediv> 349<refsynopsisdiv> 350 <title>Synopsis</title> 351 <funcsynopsis><funcprototype> 352 <funcdef>unsigned long long <function>sh64_get_wired_dtlb_entry </function></funcdef> 353 <paramdef> <parameter>void</parameter></paramdef> 354 </funcprototype></funcsynopsis> 355</refsynopsisdiv> 356<refsect1> 357 <title>Arguments</title> 358 <variablelist> 359 <varlistentry> 360 <term><parameter>void</parameter></term> 361 <listitem> 362 <para> 363 no arguments 364 </para> 365 </listitem> 366 </varlistentry> 367 </variablelist> 368</refsect1> 369</refentry> 370 371<refentry id="API-sh64-put-wired-dtlb-entry"> 372<refentryinfo> 373 <title>LINUX</title> 374 <productname>Kernel Hackers Manual</productname> 375 <date>July 2017</date> 376</refentryinfo> 377<refmeta> 378 <refentrytitle><phrase>sh64_put_wired_dtlb_entry</phrase></refentrytitle> 379 <manvolnum>9</manvolnum> 380 <refmiscinfo class="version">4.1.27</refmiscinfo> 381</refmeta> 382<refnamediv> 383 <refname>sh64_put_wired_dtlb_entry</refname> 384 <refpurpose> 385 Free a wired (locked-in) entry in the DTLB. 386 </refpurpose> 387</refnamediv> 388<refsynopsisdiv> 389 <title>Synopsis</title> 390 <funcsynopsis><funcprototype> 391 <funcdef>int <function>sh64_put_wired_dtlb_entry </function></funcdef> 392 <paramdef>unsigned long long <parameter>entry</parameter></paramdef> 393 </funcprototype></funcsynopsis> 394</refsynopsisdiv> 395<refsect1> 396 <title>Arguments</title> 397 <variablelist> 398 <varlistentry> 399 <term><parameter>entry</parameter></term> 400 <listitem> 401 <para> 402 Address of TLB slot. 403 </para> 404 </listitem> 405 </varlistentry> 406 </variablelist> 407</refsect1> 408<refsect1> 409<title>Description</title> 410<para> 411 Works like a stack, last one to allocate must be first one to free. 412</para> 413</refsect1> 414</refentry> 415 416<refentry id="API-sh64-setup-tlb-slot"> 417<refentryinfo> 418 <title>LINUX</title> 419 <productname>Kernel Hackers Manual</productname> 420 <date>July 2017</date> 421</refentryinfo> 422<refmeta> 423 <refentrytitle><phrase>sh64_setup_tlb_slot</phrase></refentrytitle> 424 <manvolnum>9</manvolnum> 425 <refmiscinfo class="version">4.1.27</refmiscinfo> 426</refmeta> 427<refnamediv> 428 <refname>sh64_setup_tlb_slot</refname> 429 <refpurpose> 430 Load up a translation in a wired slot. 431 </refpurpose> 432</refnamediv> 433<refsynopsisdiv> 434 <title>Synopsis</title> 435 <funcsynopsis><funcprototype> 436 <funcdef>void <function>sh64_setup_tlb_slot </function></funcdef> 437 <paramdef>unsigned long long <parameter>config_addr</parameter></paramdef> 438 <paramdef>unsigned long <parameter>eaddr</parameter></paramdef> 439 <paramdef>unsigned long <parameter>asid</parameter></paramdef> 440 <paramdef>unsigned long <parameter>paddr</parameter></paramdef> 441 </funcprototype></funcsynopsis> 442</refsynopsisdiv> 443<refsect1> 444 <title>Arguments</title> 445 <variablelist> 446 <varlistentry> 447 <term><parameter>config_addr</parameter></term> 448 <listitem> 449 <para> 450 Address of TLB slot. 451 </para> 452 </listitem> 453 </varlistentry> 454 <varlistentry> 455 <term><parameter>eaddr</parameter></term> 456 <listitem> 457 <para> 458 Virtual address. 459 </para> 460 </listitem> 461 </varlistentry> 462 <varlistentry> 463 <term><parameter>asid</parameter></term> 464 <listitem> 465 <para> 466 Address Space Identifier. 467 </para> 468 </listitem> 469 </varlistentry> 470 <varlistentry> 471 <term><parameter>paddr</parameter></term> 472 <listitem> 473 <para> 474 Physical address. 475 </para> 476 </listitem> 477 </varlistentry> 478 </variablelist> 479</refsect1> 480<refsect1> 481<title>Description</title> 482<para> 483 Load up a virtual<->physical translation for <parameter>eaddr</parameter><-><parameter>paddr</parameter> in the 484 pre-allocated TLB slot <parameter>config_addr</parameter> (see sh64_get_wired_dtlb_entry). 485</para> 486</refsect1> 487</refentry> 488 489<refentry id="API-sh64-teardown-tlb-slot"> 490<refentryinfo> 491 <title>LINUX</title> 492 <productname>Kernel Hackers Manual</productname> 493 <date>July 2017</date> 494</refentryinfo> 495<refmeta> 496 <refentrytitle><phrase>sh64_teardown_tlb_slot</phrase></refentrytitle> 497 <manvolnum>9</manvolnum> 498 <refmiscinfo class="version">4.1.27</refmiscinfo> 499</refmeta> 500<refnamediv> 501 <refname>sh64_teardown_tlb_slot</refname> 502 <refpurpose> 503 Teardown a translation. 504 </refpurpose> 505</refnamediv> 506<refsynopsisdiv> 507 <title>Synopsis</title> 508 <funcsynopsis><funcprototype> 509 <funcdef>void <function>sh64_teardown_tlb_slot </function></funcdef> 510 <paramdef>unsigned long long <parameter>config_addr</parameter></paramdef> 511 </funcprototype></funcsynopsis> 512</refsynopsisdiv> 513<refsect1> 514 <title>Arguments</title> 515 <variablelist> 516 <varlistentry> 517 <term><parameter>config_addr</parameter></term> 518 <listitem> 519 <para> 520 Address of TLB slot. 521 </para> 522 </listitem> 523 </varlistentry> 524 </variablelist> 525</refsect1> 526<refsect1> 527<title>Description</title> 528<para> 529 Teardown any existing mapping in the TLB slot <parameter>config_addr</parameter>. 530</para> 531</refsect1> 532</refentry> 533 534<!-- arch/sh/include/asm/tlb_64.h --> 535<refentry id="API-for-each-dtlb-entry"> 536<refentryinfo> 537 <title>LINUX</title> 538 <productname>Kernel Hackers Manual</productname> 539 <date>July 2017</date> 540</refentryinfo> 541<refmeta> 542 <refentrytitle><phrase>for_each_dtlb_entry</phrase></refentrytitle> 543 <manvolnum>9</manvolnum> 544 <refmiscinfo class="version">4.1.27</refmiscinfo> 545</refmeta> 546<refnamediv> 547 <refname>for_each_dtlb_entry</refname> 548 <refpurpose> 549 Iterate over free (non-wired) DTLB entries 550 </refpurpose> 551</refnamediv> 552<refsynopsisdiv> 553 <title>Synopsis</title> 554 <funcsynopsis><funcprototype> 555 <funcdef> <function>for_each_dtlb_entry </function></funcdef> 556 <paramdef> <parameter>tlb</parameter></paramdef> 557 </funcprototype></funcsynopsis> 558</refsynopsisdiv> 559<refsect1> 560 <title>Arguments</title> 561 <variablelist> 562 <varlistentry> 563 <term><parameter>tlb</parameter></term> 564 <listitem> 565 <para> 566 TLB entry 567 </para> 568 </listitem> 569 </varlistentry> 570 </variablelist> 571</refsect1> 572</refentry> 573 574<refentry id="API-for-each-itlb-entry"> 575<refentryinfo> 576 <title>LINUX</title> 577 <productname>Kernel Hackers Manual</productname> 578 <date>July 2017</date> 579</refentryinfo> 580<refmeta> 581 <refentrytitle><phrase>for_each_itlb_entry</phrase></refentrytitle> 582 <manvolnum>9</manvolnum> 583 <refmiscinfo class="version">4.1.27</refmiscinfo> 584</refmeta> 585<refnamediv> 586 <refname>for_each_itlb_entry</refname> 587 <refpurpose> 588 Iterate over free (non-wired) ITLB entries 589 </refpurpose> 590</refnamediv> 591<refsynopsisdiv> 592 <title>Synopsis</title> 593 <funcsynopsis><funcprototype> 594 <funcdef> <function>for_each_itlb_entry </function></funcdef> 595 <paramdef> <parameter>tlb</parameter></paramdef> 596 </funcprototype></funcsynopsis> 597</refsynopsisdiv> 598<refsect1> 599 <title>Arguments</title> 600 <variablelist> 601 <varlistentry> 602 <term><parameter>tlb</parameter></term> 603 <listitem> 604 <para> 605 TLB entry 606 </para> 607 </listitem> 608 </varlistentry> 609 </variablelist> 610</refsect1> 611</refentry> 612 613<refentry id="API---flush-tlb-slot"> 614<refentryinfo> 615 <title>LINUX</title> 616 <productname>Kernel Hackers Manual</productname> 617 <date>July 2017</date> 618</refentryinfo> 619<refmeta> 620 <refentrytitle><phrase>__flush_tlb_slot</phrase></refentrytitle> 621 <manvolnum>9</manvolnum> 622 <refmiscinfo class="version">4.1.27</refmiscinfo> 623</refmeta> 624<refnamediv> 625 <refname>__flush_tlb_slot</refname> 626 <refpurpose> 627 Flushes TLB slot <parameter>slot</parameter>. 628 </refpurpose> 629</refnamediv> 630<refsynopsisdiv> 631 <title>Synopsis</title> 632 <funcsynopsis><funcprototype> 633 <funcdef>void <function>__flush_tlb_slot </function></funcdef> 634 <paramdef>unsigned long long <parameter>slot</parameter></paramdef> 635 </funcprototype></funcsynopsis> 636</refsynopsisdiv> 637<refsect1> 638 <title>Arguments</title> 639 <variablelist> 640 <varlistentry> 641 <term><parameter>slot</parameter></term> 642 <listitem> 643 <para> 644 Address of TLB slot. 645 </para> 646 </listitem> 647 </varlistentry> 648 </variablelist> 649</refsect1> 650</refentry> 651 652 </sect2> 653 </sect1> 654 </chapter> 655 <chapter id="mach"> 656 <title>Machine Specific Interfaces</title> 657 <sect1 id="dreamcast"> 658 <title>mach-dreamcast</title> 659<!-- arch/sh/boards/mach-dreamcast/rtc.c --> 660<refentry id="API-aica-rtc-gettimeofday"> 661<refentryinfo> 662 <title>LINUX</title> 663 <productname>Kernel Hackers Manual</productname> 664 <date>July 2017</date> 665</refentryinfo> 666<refmeta> 667 <refentrytitle><phrase>aica_rtc_gettimeofday</phrase></refentrytitle> 668 <manvolnum>9</manvolnum> 669 <refmiscinfo class="version">4.1.27</refmiscinfo> 670</refmeta> 671<refnamediv> 672 <refname>aica_rtc_gettimeofday</refname> 673 <refpurpose> 674 Get the time from the AICA RTC 675 </refpurpose> 676</refnamediv> 677<refsynopsisdiv> 678 <title>Synopsis</title> 679 <funcsynopsis><funcprototype> 680 <funcdef>void <function>aica_rtc_gettimeofday </function></funcdef> 681 <paramdef>struct timespec * <parameter>ts</parameter></paramdef> 682 </funcprototype></funcsynopsis> 683</refsynopsisdiv> 684<refsect1> 685 <title>Arguments</title> 686 <variablelist> 687 <varlistentry> 688 <term><parameter>ts</parameter></term> 689 <listitem> 690 <para> 691 pointer to resulting timespec 692 </para> 693 </listitem> 694 </varlistentry> 695 </variablelist> 696</refsect1> 697<refsect1> 698<title>Description</title> 699<para> 700 Grabs the current RTC seconds counter and adjusts it to the Unix Epoch. 701</para> 702</refsect1> 703</refentry> 704 705<refentry id="API-aica-rtc-settimeofday"> 706<refentryinfo> 707 <title>LINUX</title> 708 <productname>Kernel Hackers Manual</productname> 709 <date>July 2017</date> 710</refentryinfo> 711<refmeta> 712 <refentrytitle><phrase>aica_rtc_settimeofday</phrase></refentrytitle> 713 <manvolnum>9</manvolnum> 714 <refmiscinfo class="version">4.1.27</refmiscinfo> 715</refmeta> 716<refnamediv> 717 <refname>aica_rtc_settimeofday</refname> 718 <refpurpose> 719 Set the AICA RTC to the current time 720 </refpurpose> 721</refnamediv> 722<refsynopsisdiv> 723 <title>Synopsis</title> 724 <funcsynopsis><funcprototype> 725 <funcdef>int <function>aica_rtc_settimeofday </function></funcdef> 726 <paramdef>const time_t <parameter>secs</parameter></paramdef> 727 </funcprototype></funcsynopsis> 728</refsynopsisdiv> 729<refsect1> 730 <title>Arguments</title> 731 <variablelist> 732 <varlistentry> 733 <term><parameter>secs</parameter></term> 734 <listitem> 735 <para> 736 contains the time_t to set 737 </para> 738 </listitem> 739 </varlistentry> 740 </variablelist> 741</refsect1> 742<refsect1> 743<title>Description</title> 744<para> 745 Adjusts the given <parameter>tv</parameter> to the AICA Epoch and sets the RTC seconds counter. 746</para> 747</refsect1> 748</refentry> 749 750 </sect1> 751 <sect1 id="x3proto"> 752 <title>mach-x3proto</title> 753<!-- arch/sh/boards/mach-x3proto/ilsel.c --> 754<refentry id="API-ilsel-enable"> 755<refentryinfo> 756 <title>LINUX</title> 757 <productname>Kernel Hackers Manual</productname> 758 <date>July 2017</date> 759</refentryinfo> 760<refmeta> 761 <refentrytitle><phrase>ilsel_enable</phrase></refentrytitle> 762 <manvolnum>9</manvolnum> 763 <refmiscinfo class="version">4.1.27</refmiscinfo> 764</refmeta> 765<refnamediv> 766 <refname>ilsel_enable</refname> 767 <refpurpose> 768 Enable an ILSEL set. 769 </refpurpose> 770</refnamediv> 771<refsynopsisdiv> 772 <title>Synopsis</title> 773 <funcsynopsis><funcprototype> 774 <funcdef>int <function>ilsel_enable </function></funcdef> 775 <paramdef>ilsel_source_t <parameter>set</parameter></paramdef> 776 </funcprototype></funcsynopsis> 777</refsynopsisdiv> 778<refsect1> 779 <title>Arguments</title> 780 <variablelist> 781 <varlistentry> 782 <term><parameter>set</parameter></term> 783 <listitem> 784 <para> 785 ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). 786 </para> 787 </listitem> 788 </varlistentry> 789 </variablelist> 790</refsect1> 791<refsect1> 792<title>Description</title> 793<para> 794 Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest 795 available interrupt level. Callers should take care to order callsites 796 noting descending interrupt levels. Aliasing FPGA and external board 797 IRQs need to use <function>ilsel_enable_fixed</function>. 798 </para><para> 799 800 The return value is an IRQ number that can later be taken down with 801 <function>ilsel_disable</function>. 802</para> 803</refsect1> 804</refentry> 805 806<refentry id="API-ilsel-enable-fixed"> 807<refentryinfo> 808 <title>LINUX</title> 809 <productname>Kernel Hackers Manual</productname> 810 <date>July 2017</date> 811</refentryinfo> 812<refmeta> 813 <refentrytitle><phrase>ilsel_enable_fixed</phrase></refentrytitle> 814 <manvolnum>9</manvolnum> 815 <refmiscinfo class="version">4.1.27</refmiscinfo> 816</refmeta> 817<refnamediv> 818 <refname>ilsel_enable_fixed</refname> 819 <refpurpose> 820 Enable an ILSEL set at a fixed interrupt level 821 </refpurpose> 822</refnamediv> 823<refsynopsisdiv> 824 <title>Synopsis</title> 825 <funcsynopsis><funcprototype> 826 <funcdef>int <function>ilsel_enable_fixed </function></funcdef> 827 <paramdef>ilsel_source_t <parameter>set</parameter></paramdef> 828 <paramdef>unsigned int <parameter>level</parameter></paramdef> 829 </funcprototype></funcsynopsis> 830</refsynopsisdiv> 831<refsect1> 832 <title>Arguments</title> 833 <variablelist> 834 <varlistentry> 835 <term><parameter>set</parameter></term> 836 <listitem> 837 <para> 838 ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). 839 </para> 840 </listitem> 841 </varlistentry> 842 <varlistentry> 843 <term><parameter>level</parameter></term> 844 <listitem> 845 <para> 846 Interrupt level (1 - 15) 847 </para> 848 </listitem> 849 </varlistentry> 850 </variablelist> 851</refsect1> 852<refsect1> 853<title>Description</title> 854<para> 855 Enables a given ILSEL source at a fixed interrupt level. Necessary 856 both for level reservation as well as for aliased sources that only 857 exist on special ILSEL#s. 858 </para><para> 859 860 Returns an IRQ number (as <function>ilsel_enable</function>). 861</para> 862</refsect1> 863</refentry> 864 865<refentry id="API-ilsel-disable"> 866<refentryinfo> 867 <title>LINUX</title> 868 <productname>Kernel Hackers Manual</productname> 869 <date>July 2017</date> 870</refentryinfo> 871<refmeta> 872 <refentrytitle><phrase>ilsel_disable</phrase></refentrytitle> 873 <manvolnum>9</manvolnum> 874 <refmiscinfo class="version">4.1.27</refmiscinfo> 875</refmeta> 876<refnamediv> 877 <refname>ilsel_disable</refname> 878 <refpurpose> 879 Disable an ILSEL set 880 </refpurpose> 881</refnamediv> 882<refsynopsisdiv> 883 <title>Synopsis</title> 884 <funcsynopsis><funcprototype> 885 <funcdef>void <function>ilsel_disable </function></funcdef> 886 <paramdef>unsigned int <parameter>irq</parameter></paramdef> 887 </funcprototype></funcsynopsis> 888</refsynopsisdiv> 889<refsect1> 890 <title>Arguments</title> 891 <variablelist> 892 <varlistentry> 893 <term><parameter>irq</parameter></term> 894 <listitem> 895 <para> 896 Bit position for ILSEL set value (retval from enable routines) 897 </para> 898 </listitem> 899 </varlistentry> 900 </variablelist> 901</refsect1> 902<refsect1> 903<title>Description</title> 904<para> 905 Disable a previously enabled ILSEL set. 906</para> 907</refsect1> 908</refentry> 909 910 </sect1> 911 </chapter> 912 <chapter id="busses"> 913 <title>Busses</title> 914 <sect1 id="superhyway"> 915 <title>SuperHyway</title> 916<!-- drivers/sh/superhyway/superhyway.c --> 917<refentry id="API-superhyway-add-device"> 918<refentryinfo> 919 <title>LINUX</title> 920 <productname>Kernel Hackers Manual</productname> 921 <date>July 2017</date> 922</refentryinfo> 923<refmeta> 924 <refentrytitle><phrase>superhyway_add_device</phrase></refentrytitle> 925 <manvolnum>9</manvolnum> 926 <refmiscinfo class="version">4.1.27</refmiscinfo> 927</refmeta> 928<refnamediv> 929 <refname>superhyway_add_device</refname> 930 <refpurpose> 931 Add a SuperHyway module 932 </refpurpose> 933</refnamediv> 934<refsynopsisdiv> 935 <title>Synopsis</title> 936 <funcsynopsis><funcprototype> 937 <funcdef>int <function>superhyway_add_device </function></funcdef> 938 <paramdef>unsigned long <parameter>base</parameter></paramdef> 939 <paramdef>struct superhyway_device * <parameter>sdev</parameter></paramdef> 940 <paramdef>struct superhyway_bus * <parameter>bus</parameter></paramdef> 941 </funcprototype></funcsynopsis> 942</refsynopsisdiv> 943<refsect1> 944 <title>Arguments</title> 945 <variablelist> 946 <varlistentry> 947 <term><parameter>base</parameter></term> 948 <listitem> 949 <para> 950 Physical address where module is mapped. 951 </para> 952 </listitem> 953 </varlistentry> 954 <varlistentry> 955 <term><parameter>sdev</parameter></term> 956 <listitem> 957 <para> 958 SuperHyway device to add, or NULL to allocate a new one. 959 </para> 960 </listitem> 961 </varlistentry> 962 <varlistentry> 963 <term><parameter>bus</parameter></term> 964 <listitem> 965 <para> 966 Bus where SuperHyway module resides. 967 </para> 968 </listitem> 969 </varlistentry> 970 </variablelist> 971</refsect1> 972<refsect1> 973<title>Description</title> 974<para> 975 This is responsible for adding a new SuperHyway module. This sets up a new 976 struct superhyway_device for the module being added if <parameter>sdev</parameter> == NULL. 977 </para><para> 978 979 Devices are initially added in the order that they are scanned (from the 980 top-down of the memory map), and are assigned an ID based on the order that 981 they are added. Any manual addition of a module will thus get the ID after 982 the devices already discovered regardless of where it resides in memory. 983 </para><para> 984 985 Further work can and should be done in <function>superhyway_scan_bus</function>, to be sure 986 that any new modules are properly discovered and subsequently registered. 987</para> 988</refsect1> 989</refentry> 990 991<refentry id="API-superhyway-register-driver"> 992<refentryinfo> 993 <title>LINUX</title> 994 <productname>Kernel Hackers Manual</productname> 995 <date>July 2017</date> 996</refentryinfo> 997<refmeta> 998 <refentrytitle><phrase>superhyway_register_driver</phrase></refentrytitle> 999 <manvolnum>9</manvolnum> 1000 <refmiscinfo class="version">4.1.27</refmiscinfo> 1001</refmeta> 1002<refnamediv> 1003 <refname>superhyway_register_driver</refname> 1004 <refpurpose> 1005 Register a new SuperHyway driver 1006 </refpurpose> 1007</refnamediv> 1008<refsynopsisdiv> 1009 <title>Synopsis</title> 1010 <funcsynopsis><funcprototype> 1011 <funcdef>int <function>superhyway_register_driver </function></funcdef> 1012 <paramdef>struct superhyway_driver * <parameter>drv</parameter></paramdef> 1013 </funcprototype></funcsynopsis> 1014</refsynopsisdiv> 1015<refsect1> 1016 <title>Arguments</title> 1017 <variablelist> 1018 <varlistentry> 1019 <term><parameter>drv</parameter></term> 1020 <listitem> 1021 <para> 1022 SuperHyway driver to register. 1023 </para> 1024 </listitem> 1025 </varlistentry> 1026 </variablelist> 1027</refsect1> 1028<refsect1> 1029<title>Description</title> 1030<para> 1031 This registers the passed in <parameter>drv</parameter>. Any devices matching the id table will 1032 automatically be populated and handed off to the driver's specified probe 1033 routine. 1034</para> 1035</refsect1> 1036</refentry> 1037 1038<refentry id="API-superhyway-unregister-driver"> 1039<refentryinfo> 1040 <title>LINUX</title> 1041 <productname>Kernel Hackers Manual</productname> 1042 <date>July 2017</date> 1043</refentryinfo> 1044<refmeta> 1045 <refentrytitle><phrase>superhyway_unregister_driver</phrase></refentrytitle> 1046 <manvolnum>9</manvolnum> 1047 <refmiscinfo class="version">4.1.27</refmiscinfo> 1048</refmeta> 1049<refnamediv> 1050 <refname>superhyway_unregister_driver</refname> 1051 <refpurpose> 1052 Unregister a SuperHyway driver 1053 </refpurpose> 1054</refnamediv> 1055<refsynopsisdiv> 1056 <title>Synopsis</title> 1057 <funcsynopsis><funcprototype> 1058 <funcdef>void <function>superhyway_unregister_driver </function></funcdef> 1059 <paramdef>struct superhyway_driver * <parameter>drv</parameter></paramdef> 1060 </funcprototype></funcsynopsis> 1061</refsynopsisdiv> 1062<refsect1> 1063 <title>Arguments</title> 1064 <variablelist> 1065 <varlistentry> 1066 <term><parameter>drv</parameter></term> 1067 <listitem> 1068 <para> 1069 SuperHyway driver to unregister. 1070 </para> 1071 </listitem> 1072 </varlistentry> 1073 </variablelist> 1074</refsect1> 1075<refsect1> 1076<title>Description</title> 1077<para> 1078 This cleans up after <function>superhyway_register_driver</function>, and should be invoked in 1079 the exit path of any module drivers. 1080</para> 1081</refsect1> 1082</refentry> 1083 1084 </sect1> 1085 1086 <sect1 id="maple"> 1087 <title>Maple</title> 1088<!-- drivers/sh/maple/maple.c --> 1089<refentry id="API-maple-driver-register"> 1090<refentryinfo> 1091 <title>LINUX</title> 1092 <productname>Kernel Hackers Manual</productname> 1093 <date>July 2017</date> 1094</refentryinfo> 1095<refmeta> 1096 <refentrytitle><phrase>maple_driver_register</phrase></refentrytitle> 1097 <manvolnum>9</manvolnum> 1098 <refmiscinfo class="version">4.1.27</refmiscinfo> 1099</refmeta> 1100<refnamediv> 1101 <refname>maple_driver_register</refname> 1102 <refpurpose> 1103 register a maple driver 1104 </refpurpose> 1105</refnamediv> 1106<refsynopsisdiv> 1107 <title>Synopsis</title> 1108 <funcsynopsis><funcprototype> 1109 <funcdef>int <function>maple_driver_register </function></funcdef> 1110 <paramdef>struct maple_driver * <parameter>drv</parameter></paramdef> 1111 </funcprototype></funcsynopsis> 1112</refsynopsisdiv> 1113<refsect1> 1114 <title>Arguments</title> 1115 <variablelist> 1116 <varlistentry> 1117 <term><parameter>drv</parameter></term> 1118 <listitem> 1119 <para> 1120 maple driver to be registered. 1121 </para> 1122 </listitem> 1123 </varlistentry> 1124 </variablelist> 1125</refsect1> 1126<refsect1> 1127<title>Description</title> 1128<para> 1129 Registers the passed in <parameter>drv</parameter>, while updating the bus type. 1130 Devices with matching function IDs will be automatically probed. 1131</para> 1132</refsect1> 1133</refentry> 1134 1135<refentry id="API-maple-driver-unregister"> 1136<refentryinfo> 1137 <title>LINUX</title> 1138 <productname>Kernel Hackers Manual</productname> 1139 <date>July 2017</date> 1140</refentryinfo> 1141<refmeta> 1142 <refentrytitle><phrase>maple_driver_unregister</phrase></refentrytitle> 1143 <manvolnum>9</manvolnum> 1144 <refmiscinfo class="version">4.1.27</refmiscinfo> 1145</refmeta> 1146<refnamediv> 1147 <refname>maple_driver_unregister</refname> 1148 <refpurpose> 1149 unregister a maple driver. 1150 </refpurpose> 1151</refnamediv> 1152<refsynopsisdiv> 1153 <title>Synopsis</title> 1154 <funcsynopsis><funcprototype> 1155 <funcdef>void <function>maple_driver_unregister </function></funcdef> 1156 <paramdef>struct maple_driver * <parameter>drv</parameter></paramdef> 1157 </funcprototype></funcsynopsis> 1158</refsynopsisdiv> 1159<refsect1> 1160 <title>Arguments</title> 1161 <variablelist> 1162 <varlistentry> 1163 <term><parameter>drv</parameter></term> 1164 <listitem> 1165 <para> 1166 maple driver to unregister. 1167 </para> 1168 </listitem> 1169 </varlistentry> 1170 </variablelist> 1171</refsect1> 1172<refsect1> 1173<title>Description</title> 1174<para> 1175 Cleans up after <function>maple_driver_register</function>. To be invoked in the exit 1176 path of any module drivers. 1177</para> 1178</refsect1> 1179</refentry> 1180 1181<refentry id="API-maple-getcond-callback"> 1182<refentryinfo> 1183 <title>LINUX</title> 1184 <productname>Kernel Hackers Manual</productname> 1185 <date>July 2017</date> 1186</refentryinfo> 1187<refmeta> 1188 <refentrytitle><phrase>maple_getcond_callback</phrase></refentrytitle> 1189 <manvolnum>9</manvolnum> 1190 <refmiscinfo class="version">4.1.27</refmiscinfo> 1191</refmeta> 1192<refnamediv> 1193 <refname>maple_getcond_callback</refname> 1194 <refpurpose> 1195 setup handling MAPLE_COMMAND_GETCOND 1196 </refpurpose> 1197</refnamediv> 1198<refsynopsisdiv> 1199 <title>Synopsis</title> 1200 <funcsynopsis><funcprototype> 1201 <funcdef>void <function>maple_getcond_callback </function></funcdef> 1202 <paramdef>struct maple_device * <parameter>dev</parameter></paramdef> 1203 <paramdef>void (*<parameter>callback</parameter>) 1204 <funcparams>struct mapleq *mq</funcparams></paramdef> 1205 <paramdef>unsigned long <parameter>interval</parameter></paramdef> 1206 <paramdef>unsigned long <parameter>function</parameter></paramdef> 1207 </funcprototype></funcsynopsis> 1208</refsynopsisdiv> 1209<refsect1> 1210 <title>Arguments</title> 1211 <variablelist> 1212 <varlistentry> 1213 <term><parameter>dev</parameter></term> 1214 <listitem> 1215 <para> 1216 device responding 1217 </para> 1218 </listitem> 1219 </varlistentry> 1220 <varlistentry> 1221 <term><parameter>callback</parameter></term> 1222 <listitem> 1223 <para> 1224 handler callback 1225 </para> 1226 </listitem> 1227 </varlistentry> 1228 <varlistentry> 1229 <term><parameter>interval</parameter></term> 1230 <listitem> 1231 <para> 1232 interval in jiffies between callbacks 1233 </para> 1234 </listitem> 1235 </varlistentry> 1236 <varlistentry> 1237 <term><parameter>function</parameter></term> 1238 <listitem> 1239 <para> 1240 the function code for the device 1241 </para> 1242 </listitem> 1243 </varlistentry> 1244 </variablelist> 1245</refsect1> 1246</refentry> 1247 1248<refentry id="API-maple-add-packet"> 1249<refentryinfo> 1250 <title>LINUX</title> 1251 <productname>Kernel Hackers Manual</productname> 1252 <date>July 2017</date> 1253</refentryinfo> 1254<refmeta> 1255 <refentrytitle><phrase>maple_add_packet</phrase></refentrytitle> 1256 <manvolnum>9</manvolnum> 1257 <refmiscinfo class="version">4.1.27</refmiscinfo> 1258</refmeta> 1259<refnamediv> 1260 <refname>maple_add_packet</refname> 1261 <refpurpose> 1262 add a single instruction to the maple bus queue 1263 </refpurpose> 1264</refnamediv> 1265<refsynopsisdiv> 1266 <title>Synopsis</title> 1267 <funcsynopsis><funcprototype> 1268 <funcdef>int <function>maple_add_packet </function></funcdef> 1269 <paramdef>struct maple_device * <parameter>mdev</parameter></paramdef> 1270 <paramdef>u32 <parameter>function</parameter></paramdef> 1271 <paramdef>u32 <parameter>command</parameter></paramdef> 1272 <paramdef>size_t <parameter>length</parameter></paramdef> 1273 <paramdef>void * <parameter>data</parameter></paramdef> 1274 </funcprototype></funcsynopsis> 1275</refsynopsisdiv> 1276<refsect1> 1277 <title>Arguments</title> 1278 <variablelist> 1279 <varlistentry> 1280 <term><parameter>mdev</parameter></term> 1281 <listitem> 1282 <para> 1283 maple device 1284 </para> 1285 </listitem> 1286 </varlistentry> 1287 <varlistentry> 1288 <term><parameter>function</parameter></term> 1289 <listitem> 1290 <para> 1291 function on device being queried 1292 </para> 1293 </listitem> 1294 </varlistentry> 1295 <varlistentry> 1296 <term><parameter>command</parameter></term> 1297 <listitem> 1298 <para> 1299 maple command to add 1300 </para> 1301 </listitem> 1302 </varlistentry> 1303 <varlistentry> 1304 <term><parameter>length</parameter></term> 1305 <listitem> 1306 <para> 1307 length of command string (in 32 bit words) 1308 </para> 1309 </listitem> 1310 </varlistentry> 1311 <varlistentry> 1312 <term><parameter>data</parameter></term> 1313 <listitem> 1314 <para> 1315 remainder of command string 1316 </para> 1317 </listitem> 1318 </varlistentry> 1319 </variablelist> 1320</refsect1> 1321</refentry> 1322 1323 </sect1> 1324 </chapter> 1325</book> 1326