pfc-r8a779f0.c 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * R8A779F0 processor support - PFC hardware block.
  4. *
  5. * Copyright (C) 2021 Renesas Electronics Corp.
  6. *
  7. * This file is based on the drivers/pinctrl/renesas/pfc-r8a779a0.c
  8. */
  9. #include <linux/errno.h>
  10. #include <linux/io.h>
  11. #include <linux/kernel.h>
  12. #include "sh_pfc.h"
  13. #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN)
  14. #define CPU_ALL_GP(fn, sfx) \
  15. PORT_GP_CFG_21(0, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33), \
  16. PORT_GP_CFG_25(1, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33), \
  17. PORT_GP_CFG_17(2, fn, sfx, CFG_FLAGS), \
  18. PORT_GP_CFG_19(3, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33)
  19. #define CPU_ALL_NOGP(fn) \
  20. PIN_NOGP_CFG(PRESETOUT0_N, "PRESETOUT0#", fn, SH_PFC_PIN_CFG_PULL_DOWN), \
  21. PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN)
  22. /*
  23. * F_() : just information
  24. * FM() : macro for FN_xxx / xxx_MARK
  25. */
  26. /* GPSR0 */
  27. #define GPSR0_20 F_(IRQ3, IP2SR0_19_16)
  28. #define GPSR0_19 F_(IRQ2, IP2SR0_15_12)
  29. #define GPSR0_18 F_(IRQ1, IP2SR0_11_8)
  30. #define GPSR0_17 F_(IRQ0, IP2SR0_7_4)
  31. #define GPSR0_16 F_(MSIOF0_SS2, IP2SR0_3_0)
  32. #define GPSR0_15 F_(MSIOF0_SS1, IP1SR0_31_28)
  33. #define GPSR0_14 F_(MSIOF0_SCK, IP1SR0_27_24)
  34. #define GPSR0_13 F_(MSIOF0_TXD, IP1SR0_23_20)
  35. #define GPSR0_12 F_(MSIOF0_RXD, IP1SR0_19_16)
  36. #define GPSR0_11 F_(MSIOF0_SYNC, IP1SR0_15_12)
  37. #define GPSR0_10 F_(CTS0_N, IP1SR0_11_8)
  38. #define GPSR0_9 F_(RTS0_N, IP1SR0_7_4)
  39. #define GPSR0_8 F_(SCK0, IP1SR0_3_0)
  40. #define GPSR0_7 F_(TX0, IP0SR0_31_28)
  41. #define GPSR0_6 F_(RX0, IP0SR0_27_24)
  42. #define GPSR0_5 F_(HRTS0_N, IP0SR0_23_20)
  43. #define GPSR0_4 F_(HCTS0_N, IP0SR0_19_16)
  44. #define GPSR0_3 F_(HTX0, IP0SR0_15_12)
  45. #define GPSR0_2 F_(HRX0, IP0SR0_11_8)
  46. #define GPSR0_1 F_(HSCK0, IP0SR0_7_4)
  47. #define GPSR0_0 F_(SCIF_CLK, IP0SR0_3_0)
  48. /* GPSR1 */
  49. #define GPSR1_24 FM(SD_WP)
  50. #define GPSR1_23 FM(SD_CD)
  51. #define GPSR1_22 FM(MMC_SD_CMD)
  52. #define GPSR1_21 FM(MMC_D7)
  53. #define GPSR1_20 FM(MMC_DS)
  54. #define GPSR1_19 FM(MMC_D6)
  55. #define GPSR1_18 FM(MMC_D4)
  56. #define GPSR1_17 FM(MMC_D5)
  57. #define GPSR1_16 FM(MMC_SD_D3)
  58. #define GPSR1_15 FM(MMC_SD_D2)
  59. #define GPSR1_14 FM(MMC_SD_D1)
  60. #define GPSR1_13 FM(MMC_SD_D0)
  61. #define GPSR1_12 FM(MMC_SD_CLK)
  62. #define GPSR1_11 FM(GP1_11)
  63. #define GPSR1_10 FM(GP1_10)
  64. #define GPSR1_9 FM(GP1_09)
  65. #define GPSR1_8 FM(GP1_08)
  66. #define GPSR1_7 F_(GP1_07, IP0SR1_31_28)
  67. #define GPSR1_6 F_(GP1_06, IP0SR1_27_24)
  68. #define GPSR1_5 F_(GP1_05, IP0SR1_23_20)
  69. #define GPSR1_4 F_(GP1_04, IP0SR1_19_16)
  70. #define GPSR1_3 F_(GP1_03, IP0SR1_15_12)
  71. #define GPSR1_2 F_(GP1_02, IP0SR1_11_8)
  72. #define GPSR1_1 F_(GP1_01, IP0SR1_7_4)
  73. #define GPSR1_0 F_(GP1_00, IP0SR1_3_0)
  74. /* GPSR2 */
  75. #define GPSR2_16 FM(PCIE1_CLKREQ_N)
  76. #define GPSR2_15 FM(PCIE0_CLKREQ_N)
  77. #define GPSR2_14 FM(QSPI0_IO3)
  78. #define GPSR2_13 FM(QSPI0_SSL)
  79. #define GPSR2_12 FM(QSPI0_MISO_IO1)
  80. #define GPSR2_11 FM(QSPI0_IO2)
  81. #define GPSR2_10 FM(QSPI0_SPCLK)
  82. #define GPSR2_9 FM(QSPI0_MOSI_IO0)
  83. #define GPSR2_8 FM(QSPI1_SPCLK)
  84. #define GPSR2_7 FM(QSPI1_MOSI_IO0)
  85. #define GPSR2_6 FM(QSPI1_IO2)
  86. #define GPSR2_5 FM(QSPI1_MISO_IO1)
  87. #define GPSR2_4 FM(QSPI1_IO3)
  88. #define GPSR2_3 FM(QSPI1_SSL)
  89. #define GPSR2_2 FM(RPC_RESET_N)
  90. #define GPSR2_1 FM(RPC_WP_N)
  91. #define GPSR2_0 FM(RPC_INT_N)
  92. /* GPSR3 */
  93. #define GPSR3_18 FM(TSN0_AVTP_CAPTURE_B)
  94. #define GPSR3_17 FM(TSN0_AVTP_MATCH_B)
  95. #define GPSR3_16 FM(TSN0_AVTP_PPS)
  96. #define GPSR3_15 FM(TSN1_AVTP_CAPTURE_B)
  97. #define GPSR3_14 FM(TSN1_AVTP_MATCH_B)
  98. #define GPSR3_13 FM(TSN1_AVTP_PPS)
  99. #define GPSR3_12 FM(TSN0_MAGIC_B)
  100. #define GPSR3_11 FM(TSN1_PHY_INT_B)
  101. #define GPSR3_10 FM(TSN0_PHY_INT_B)
  102. #define GPSR3_9 FM(TSN2_PHY_INT_B)
  103. #define GPSR3_8 FM(TSN0_LINK_B)
  104. #define GPSR3_7 FM(TSN2_LINK_B)
  105. #define GPSR3_6 FM(TSN1_LINK_B)
  106. #define GPSR3_5 FM(TSN1_MDC_B)
  107. #define GPSR3_4 FM(TSN0_MDC_B)
  108. #define GPSR3_3 FM(TSN2_MDC_B)
  109. #define GPSR3_2 FM(TSN0_MDIO_B)
  110. #define GPSR3_1 FM(TSN2_MDIO_B)
  111. #define GPSR3_0 FM(TSN1_MDIO_B)
  112. /* IP0SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
  113. #define IP0SR0_3_0 FM(SCIF_CLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  114. #define IP0SR0_7_4 FM(HSCK0) FM(SCK3) FM(MSIOF3_SCK) F_(0, 0) F_(0, 0) FM(TSN0_AVTP_CAPTURE_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  115. #define IP0SR0_11_8 FM(HRX0) FM(RX3) FM(MSIOF3_RXD) F_(0, 0) F_(0, 0) FM(TSN0_AVTP_MATCH_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  116. #define IP0SR0_15_12 FM(HTX0) FM(TX3) FM(MSIOF3_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  117. #define IP0SR0_19_16 FM(HCTS0_N) FM(CTS3_N) FM(MSIOF3_SS1) F_(0, 0) F_(0, 0) FM(TSN0_MDC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  118. #define IP0SR0_23_20 FM(HRTS0_N) FM(RTS3_N) FM(MSIOF3_SS2) F_(0, 0) F_(0, 0) FM(TSN0_MDIO_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  119. #define IP0SR0_27_24 FM(RX0) FM(HRX1) F_(0, 0) FM(MSIOF1_RXD) F_(0, 0) FM(TSN1_AVTP_MATCH_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  120. #define IP0SR0_31_28 FM(TX0) FM(HTX1) F_(0, 0) FM(MSIOF1_TXD) F_(0, 0) FM(TSN1_AVTP_CAPTURE_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  121. /* IP1SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
  122. #define IP1SR0_3_0 FM(SCK0) FM(HSCK1) F_(0, 0) FM(MSIOF1_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  123. #define IP1SR0_7_4 FM(RTS0_N) FM(HRTS1_N) FM(MSIOF3_SYNC) F_(0, 0) F_(0, 0) FM(TSN1_MDIO_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  124. #define IP1SR0_11_8 FM(CTS0_N) FM(HCTS1_N) F_(0, 0) FM(MSIOF1_SYNC) F_(0, 0) FM(TSN1_MDC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  125. #define IP1SR0_15_12 FM(MSIOF0_SYNC) FM(HCTS3_N) FM(CTS1_N) FM(IRQ4) F_(0, 0) FM(TSN0_LINK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  126. #define IP1SR0_19_16 FM(MSIOF0_RXD) FM(HRX3) FM(RX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  127. #define IP1SR0_23_20 FM(MSIOF0_TXD) FM(HTX3) FM(TX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  128. #define IP1SR0_27_24 FM(MSIOF0_SCK) FM(HSCK3) FM(SCK1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  129. #define IP1SR0_31_28 FM(MSIOF0_SS1) FM(HRTS3_N) FM(RTS1_N) FM(IRQ5) F_(0, 0) FM(TSN1_LINK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  130. /* IP2SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
  131. #define IP2SR0_3_0 FM(MSIOF0_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN2_LINK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  132. #define IP2SR0_7_4 FM(IRQ0) F_(0, 0) F_(0, 0) FM(MSIOF1_SS1) F_(0, 0) FM(TSN0_MAGIC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  133. #define IP2SR0_11_8 FM(IRQ1) F_(0, 0) F_(0, 0) FM(MSIOF1_SS2) F_(0, 0) FM(TSN0_PHY_INT_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  134. #define IP2SR0_15_12 FM(IRQ2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN1_PHY_INT_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  135. #define IP2SR0_19_16 FM(IRQ3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN2_PHY_INT_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  136. /* IP0SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
  137. #define IP0SR1_3_0 FM(GP1_00) FM(TCLK1) FM(HSCK2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  138. #define IP0SR1_7_4 FM(GP1_01) FM(TCLK4) FM(HRX2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  139. #define IP0SR1_11_8 FM(GP1_02) F_(0, 0) FM(HTX2) FM(MSIOF2_SS1) F_(0, 0) FM(TSN2_MDC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  140. #define IP0SR1_15_12 FM(GP1_03) FM(TCLK2) FM(HCTS2_N) FM(MSIOF2_SS2) FM(CTS4_N) FM(TSN2_MDIO_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  141. #define IP0SR1_19_16 FM(GP1_04) FM(TCLK3) FM(HRTS2_N) FM(MSIOF2_SYNC) FM(RTS4_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  142. #define IP0SR1_23_20 FM(GP1_05) FM(MSIOF2_SCK) FM(SCK4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  143. #define IP0SR1_27_24 FM(GP1_06) FM(MSIOF2_RXD) FM(RX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  144. #define IP0SR1_31_28 FM(GP1_07) FM(MSIOF2_TXD) FM(TX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
  145. #define PINMUX_GPSR \
  146. GPSR1_24 \
  147. GPSR1_23 \
  148. GPSR1_22 \
  149. GPSR1_21 \
  150. GPSR0_20 GPSR1_20 \
  151. GPSR0_19 GPSR1_19 \
  152. GPSR0_18 GPSR1_18 GPSR3_18 \
  153. GPSR0_17 GPSR1_17 GPSR3_17 \
  154. GPSR0_16 GPSR1_16 GPSR2_16 GPSR3_16 \
  155. GPSR0_15 GPSR1_15 GPSR2_15 GPSR3_15 \
  156. GPSR0_14 GPSR1_14 GPSR2_14 GPSR3_14 \
  157. GPSR0_13 GPSR1_13 GPSR2_13 GPSR3_13 \
  158. GPSR0_12 GPSR1_12 GPSR2_12 GPSR3_12 \
  159. GPSR0_11 GPSR1_11 GPSR2_11 GPSR3_11 \
  160. GPSR0_10 GPSR1_10 GPSR2_10 GPSR3_10 \
  161. GPSR0_9 GPSR1_9 GPSR2_9 GPSR3_9 \
  162. GPSR0_8 GPSR1_8 GPSR2_8 GPSR3_8 \
  163. GPSR0_7 GPSR1_7 GPSR2_7 GPSR3_7 \
  164. GPSR0_6 GPSR1_6 GPSR2_6 GPSR3_6 \
  165. GPSR0_5 GPSR1_5 GPSR2_5 GPSR3_5 \
  166. GPSR0_4 GPSR1_4 GPSR2_4 GPSR3_4 \
  167. GPSR0_3 GPSR1_3 GPSR2_3 GPSR3_3 \
  168. GPSR0_2 GPSR1_2 GPSR2_2 GPSR3_2 \
  169. GPSR0_1 GPSR1_1 GPSR2_1 GPSR3_1 \
  170. GPSR0_0 GPSR1_0 GPSR2_0 GPSR3_0
  171. #define PINMUX_IPSR \
  172. \
  173. FM(IP0SR0_3_0) IP0SR0_3_0 FM(IP1SR0_3_0) IP1SR0_3_0 FM(IP2SR0_3_0) IP2SR0_3_0 \
  174. FM(IP0SR0_7_4) IP0SR0_7_4 FM(IP1SR0_7_4) IP1SR0_7_4 FM(IP2SR0_7_4) IP2SR0_7_4 \
  175. FM(IP0SR0_11_8) IP0SR0_11_8 FM(IP1SR0_11_8) IP1SR0_11_8 FM(IP2SR0_11_8) IP2SR0_11_8 \
  176. FM(IP0SR0_15_12) IP0SR0_15_12 FM(IP1SR0_15_12) IP1SR0_15_12 FM(IP2SR0_15_12) IP2SR0_15_12 \
  177. FM(IP0SR0_19_16) IP0SR0_19_16 FM(IP1SR0_19_16) IP1SR0_19_16 FM(IP2SR0_19_16) IP2SR0_19_16 \
  178. FM(IP0SR0_23_20) IP0SR0_23_20 FM(IP1SR0_23_20) IP1SR0_23_20 \
  179. FM(IP0SR0_27_24) IP0SR0_27_24 FM(IP1SR0_27_24) IP1SR0_27_24 \
  180. FM(IP0SR0_31_28) IP0SR0_31_28 FM(IP1SR0_31_28) IP1SR0_31_28 \
  181. \
  182. FM(IP0SR1_3_0) IP0SR1_3_0 \
  183. FM(IP0SR1_7_4) IP0SR1_7_4 \
  184. FM(IP0SR1_11_8) IP0SR1_11_8 \
  185. FM(IP0SR1_15_12) IP0SR1_15_12 \
  186. FM(IP0SR1_19_16) IP0SR1_19_16 \
  187. FM(IP0SR1_23_20) IP0SR1_23_20 \
  188. FM(IP0SR1_27_24) IP0SR1_27_24 \
  189. FM(IP0SR1_31_28) IP0SR1_31_28
  190. /* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */
  191. #define MOD_SEL1_11_10 FM(SEL_I2C5_0) F_(0, 0) F_(0, 0) FM(SEL_I2C5_3)
  192. #define MOD_SEL1_9_8 FM(SEL_I2C4_0) F_(0, 0) F_(0, 0) FM(SEL_I2C4_3)
  193. #define MOD_SEL1_7_6 FM(SEL_I2C3_0) F_(0, 0) F_(0, 0) FM(SEL_I2C3_3)
  194. #define MOD_SEL1_5_4 FM(SEL_I2C2_0) F_(0, 0) F_(0, 0) FM(SEL_I2C2_3)
  195. #define MOD_SEL1_3_2 FM(SEL_I2C1_0) F_(0, 0) F_(0, 0) FM(SEL_I2C1_3)
  196. #define MOD_SEL1_1_0 FM(SEL_I2C0_0) F_(0, 0) F_(0, 0) FM(SEL_I2C0_3)
  197. #define PINMUX_MOD_SELS \
  198. \
  199. MOD_SEL1_11_10 \
  200. MOD_SEL1_9_8 \
  201. MOD_SEL1_7_6 \
  202. MOD_SEL1_5_4 \
  203. MOD_SEL1_3_2 \
  204. MOD_SEL1_1_0
  205. #define PINMUX_PHYS \
  206. FM(SCL0) FM(SDA0) FM(SCL1) FM(SDA1) FM(SCL2) FM(SDA2) FM(SCL3) FM(SDA3) \
  207. FM(SCL4) FM(SDA4) FM(SCL5) FM(SDA5)
  208. enum {
  209. PINMUX_RESERVED = 0,
  210. PINMUX_DATA_BEGIN,
  211. GP_ALL(DATA),
  212. PINMUX_DATA_END,
  213. #define F_(x, y)
  214. #define FM(x) FN_##x,
  215. PINMUX_FUNCTION_BEGIN,
  216. GP_ALL(FN),
  217. PINMUX_GPSR
  218. PINMUX_IPSR
  219. PINMUX_MOD_SELS
  220. PINMUX_FUNCTION_END,
  221. #undef F_
  222. #undef FM
  223. #define F_(x, y)
  224. #define FM(x) x##_MARK,
  225. PINMUX_MARK_BEGIN,
  226. PINMUX_GPSR
  227. PINMUX_IPSR
  228. PINMUX_MOD_SELS
  229. PINMUX_PHYS
  230. PINMUX_MARK_END,
  231. #undef F_
  232. #undef FM
  233. };
  234. static const u16 pinmux_data[] = {
  235. /* Using GP_1_[0-9] requires disabling I2C in MOD_SEL1 */
  236. #define GP_1_0_FN GP_1_0_FN, FN_SEL_I2C0_0
  237. #define GP_1_1_FN GP_1_1_FN, FN_SEL_I2C0_0
  238. #define GP_1_2_FN GP_1_2_FN, FN_SEL_I2C1_0
  239. #define GP_1_3_FN GP_1_3_FN, FN_SEL_I2C1_0
  240. #define GP_1_4_FN GP_1_4_FN, FN_SEL_I2C2_0
  241. #define GP_1_5_FN GP_1_5_FN, FN_SEL_I2C2_0
  242. #define GP_1_6_FN GP_1_6_FN, FN_SEL_I2C3_0
  243. #define GP_1_7_FN GP_1_7_FN, FN_SEL_I2C3_0
  244. #define GP_1_8_FN GP_1_8_FN, FN_SEL_I2C4_0
  245. #define GP_1_9_FN GP_1_9_FN, FN_SEL_I2C4_0
  246. PINMUX_DATA_GP_ALL(),
  247. #undef GP_1_0_FN
  248. #undef GP_1_1_FN
  249. #undef GP_1_2_FN
  250. #undef GP_1_3_FN
  251. #undef GP_1_4_FN
  252. #undef GP_1_5_FN
  253. #undef GP_1_6_FN
  254. #undef GP_1_7_FN
  255. #undef GP_1_8_FN
  256. #undef GP_1_9_FN
  257. PINMUX_SINGLE(SD_WP),
  258. PINMUX_SINGLE(SD_CD),
  259. PINMUX_SINGLE(MMC_SD_CMD),
  260. PINMUX_SINGLE(MMC_D7),
  261. PINMUX_SINGLE(MMC_DS),
  262. PINMUX_SINGLE(MMC_D6),
  263. PINMUX_SINGLE(MMC_D4),
  264. PINMUX_SINGLE(MMC_D5),
  265. PINMUX_SINGLE(MMC_SD_D3),
  266. PINMUX_SINGLE(MMC_SD_D2),
  267. PINMUX_SINGLE(MMC_SD_D1),
  268. PINMUX_SINGLE(MMC_SD_D0),
  269. PINMUX_SINGLE(MMC_SD_CLK),
  270. PINMUX_SINGLE(PCIE1_CLKREQ_N),
  271. PINMUX_SINGLE(PCIE0_CLKREQ_N),
  272. PINMUX_SINGLE(QSPI0_IO3),
  273. PINMUX_SINGLE(QSPI0_SSL),
  274. PINMUX_SINGLE(QSPI0_MISO_IO1),
  275. PINMUX_SINGLE(QSPI0_IO2),
  276. PINMUX_SINGLE(QSPI0_SPCLK),
  277. PINMUX_SINGLE(QSPI0_MOSI_IO0),
  278. PINMUX_SINGLE(QSPI1_SPCLK),
  279. PINMUX_SINGLE(QSPI1_MOSI_IO0),
  280. PINMUX_SINGLE(QSPI1_IO2),
  281. PINMUX_SINGLE(QSPI1_MISO_IO1),
  282. PINMUX_SINGLE(QSPI1_IO3),
  283. PINMUX_SINGLE(QSPI1_SSL),
  284. PINMUX_SINGLE(RPC_RESET_N),
  285. PINMUX_SINGLE(RPC_WP_N),
  286. PINMUX_SINGLE(RPC_INT_N),
  287. PINMUX_SINGLE(TSN0_AVTP_CAPTURE_B),
  288. PINMUX_SINGLE(TSN0_AVTP_MATCH_B),
  289. PINMUX_SINGLE(TSN0_AVTP_PPS),
  290. PINMUX_SINGLE(TSN1_AVTP_CAPTURE_B),
  291. PINMUX_SINGLE(TSN1_AVTP_MATCH_B),
  292. PINMUX_SINGLE(TSN1_AVTP_PPS),
  293. PINMUX_SINGLE(TSN0_MAGIC_B),
  294. PINMUX_SINGLE(TSN1_PHY_INT_B),
  295. PINMUX_SINGLE(TSN0_PHY_INT_B),
  296. PINMUX_SINGLE(TSN2_PHY_INT_B),
  297. PINMUX_SINGLE(TSN0_LINK_B),
  298. PINMUX_SINGLE(TSN2_LINK_B),
  299. PINMUX_SINGLE(TSN1_LINK_B),
  300. PINMUX_SINGLE(TSN1_MDC_B),
  301. PINMUX_SINGLE(TSN0_MDC_B),
  302. PINMUX_SINGLE(TSN2_MDC_B),
  303. PINMUX_SINGLE(TSN0_MDIO_B),
  304. PINMUX_SINGLE(TSN2_MDIO_B),
  305. PINMUX_SINGLE(TSN1_MDIO_B),
  306. /* IP0SR0 */
  307. PINMUX_IPSR_GPSR(IP0SR0_3_0, SCIF_CLK),
  308. PINMUX_IPSR_GPSR(IP0SR0_7_4, HSCK0),
  309. PINMUX_IPSR_GPSR(IP0SR0_7_4, SCK3),
  310. PINMUX_IPSR_GPSR(IP0SR0_7_4, MSIOF3_SCK),
  311. PINMUX_IPSR_GPSR(IP0SR0_7_4, TSN0_AVTP_CAPTURE_A),
  312. PINMUX_IPSR_GPSR(IP0SR0_11_8, HRX0),
  313. PINMUX_IPSR_GPSR(IP0SR0_11_8, RX3),
  314. PINMUX_IPSR_GPSR(IP0SR0_11_8, MSIOF3_RXD),
  315. PINMUX_IPSR_GPSR(IP0SR0_11_8, TSN0_AVTP_MATCH_A),
  316. PINMUX_IPSR_GPSR(IP0SR0_15_12, HTX0),
  317. PINMUX_IPSR_GPSR(IP0SR0_15_12, TX3),
  318. PINMUX_IPSR_GPSR(IP0SR0_15_12, MSIOF3_TXD),
  319. PINMUX_IPSR_GPSR(IP0SR0_19_16, HCTS0_N),
  320. PINMUX_IPSR_GPSR(IP0SR0_19_16, CTS3_N),
  321. PINMUX_IPSR_GPSR(IP0SR0_19_16, MSIOF3_SS1),
  322. PINMUX_IPSR_GPSR(IP0SR0_19_16, TSN0_MDC_A),
  323. PINMUX_IPSR_GPSR(IP0SR0_23_20, HRTS0_N),
  324. PINMUX_IPSR_GPSR(IP0SR0_23_20, RTS3_N),
  325. PINMUX_IPSR_GPSR(IP0SR0_23_20, MSIOF3_SS2),
  326. PINMUX_IPSR_GPSR(IP0SR0_23_20, TSN0_MDIO_A),
  327. PINMUX_IPSR_GPSR(IP0SR0_27_24, RX0),
  328. PINMUX_IPSR_GPSR(IP0SR0_27_24, HRX1),
  329. PINMUX_IPSR_GPSR(IP0SR0_27_24, MSIOF1_RXD),
  330. PINMUX_IPSR_GPSR(IP0SR0_27_24, TSN1_AVTP_MATCH_A),
  331. PINMUX_IPSR_GPSR(IP0SR0_31_28, TX0),
  332. PINMUX_IPSR_GPSR(IP0SR0_31_28, HTX1),
  333. PINMUX_IPSR_GPSR(IP0SR0_31_28, MSIOF1_TXD),
  334. PINMUX_IPSR_GPSR(IP0SR0_31_28, TSN1_AVTP_CAPTURE_A),
  335. /* IP1SR0 */
  336. PINMUX_IPSR_GPSR(IP1SR0_3_0, SCK0),
  337. PINMUX_IPSR_GPSR(IP1SR0_3_0, HSCK1),
  338. PINMUX_IPSR_GPSR(IP1SR0_3_0, MSIOF1_SCK),
  339. PINMUX_IPSR_GPSR(IP1SR0_7_4, RTS0_N),
  340. PINMUX_IPSR_GPSR(IP1SR0_7_4, HRTS1_N),
  341. PINMUX_IPSR_GPSR(IP1SR0_7_4, MSIOF3_SYNC),
  342. PINMUX_IPSR_GPSR(IP1SR0_7_4, TSN1_MDIO_A),
  343. PINMUX_IPSR_GPSR(IP1SR0_11_8, CTS0_N),
  344. PINMUX_IPSR_GPSR(IP1SR0_11_8, HCTS1_N),
  345. PINMUX_IPSR_GPSR(IP1SR0_11_8, MSIOF1_SYNC),
  346. PINMUX_IPSR_GPSR(IP1SR0_11_8, TSN1_MDC_A),
  347. PINMUX_IPSR_GPSR(IP1SR0_15_12, MSIOF0_SYNC),
  348. PINMUX_IPSR_GPSR(IP1SR0_15_12, HCTS3_N),
  349. PINMUX_IPSR_GPSR(IP1SR0_15_12, CTS1_N),
  350. PINMUX_IPSR_GPSR(IP1SR0_15_12, IRQ4),
  351. PINMUX_IPSR_GPSR(IP1SR0_15_12, TSN0_LINK_A),
  352. PINMUX_IPSR_GPSR(IP1SR0_19_16, MSIOF0_RXD),
  353. PINMUX_IPSR_GPSR(IP1SR0_19_16, HRX3),
  354. PINMUX_IPSR_GPSR(IP1SR0_19_16, RX1),
  355. PINMUX_IPSR_GPSR(IP1SR0_23_20, MSIOF0_TXD),
  356. PINMUX_IPSR_GPSR(IP1SR0_23_20, HTX3),
  357. PINMUX_IPSR_GPSR(IP1SR0_23_20, TX1),
  358. PINMUX_IPSR_GPSR(IP1SR0_27_24, MSIOF0_SCK),
  359. PINMUX_IPSR_GPSR(IP1SR0_27_24, HSCK3),
  360. PINMUX_IPSR_GPSR(IP1SR0_27_24, SCK1),
  361. PINMUX_IPSR_GPSR(IP1SR0_31_28, MSIOF0_SS1),
  362. PINMUX_IPSR_GPSR(IP1SR0_31_28, HRTS3_N),
  363. PINMUX_IPSR_GPSR(IP1SR0_31_28, RTS1_N),
  364. PINMUX_IPSR_GPSR(IP1SR0_31_28, IRQ5),
  365. PINMUX_IPSR_GPSR(IP1SR0_31_28, TSN1_LINK_A),
  366. /* IP2SR0 */
  367. PINMUX_IPSR_GPSR(IP2SR0_3_0, MSIOF0_SS2),
  368. PINMUX_IPSR_GPSR(IP2SR0_3_0, TSN2_LINK_A),
  369. PINMUX_IPSR_GPSR(IP2SR0_7_4, IRQ0),
  370. PINMUX_IPSR_GPSR(IP2SR0_7_4, MSIOF1_SS1),
  371. PINMUX_IPSR_GPSR(IP2SR0_7_4, TSN0_MAGIC_A),
  372. PINMUX_IPSR_GPSR(IP2SR0_11_8, IRQ1),
  373. PINMUX_IPSR_GPSR(IP2SR0_11_8, MSIOF1_SS2),
  374. PINMUX_IPSR_GPSR(IP2SR0_11_8, TSN0_PHY_INT_A),
  375. PINMUX_IPSR_GPSR(IP2SR0_15_12, IRQ2),
  376. PINMUX_IPSR_GPSR(IP2SR0_15_12, TSN1_PHY_INT_A),
  377. PINMUX_IPSR_GPSR(IP2SR0_19_16, IRQ3),
  378. PINMUX_IPSR_GPSR(IP2SR0_19_16, TSN2_PHY_INT_A),
  379. /* IP0SR1 */
  380. /* GP1_00 = SCL0 */
  381. PINMUX_IPSR_MSEL(IP0SR1_3_0, GP1_00, SEL_I2C0_0),
  382. PINMUX_IPSR_MSEL(IP0SR1_3_0, TCLK1, SEL_I2C0_0),
  383. PINMUX_IPSR_MSEL(IP0SR1_3_0, HSCK2, SEL_I2C0_0),
  384. PINMUX_IPSR_PHYS(IP0SR1_3_0, SCL0, SEL_I2C0_3),
  385. /* GP1_01 = SDA0 */
  386. PINMUX_IPSR_MSEL(IP0SR1_7_4, GP1_01, SEL_I2C0_0),
  387. PINMUX_IPSR_MSEL(IP0SR1_7_4, TCLK4, SEL_I2C0_0),
  388. PINMUX_IPSR_MSEL(IP0SR1_7_4, HRX2, SEL_I2C0_0),
  389. PINMUX_IPSR_PHYS(IP0SR1_7_4, SDA0, SEL_I2C0_3),
  390. /* GP1_02 = SCL1 */
  391. PINMUX_IPSR_MSEL(IP0SR1_11_8, GP1_02, SEL_I2C1_0),
  392. PINMUX_IPSR_MSEL(IP0SR1_11_8, HTX2, SEL_I2C1_0),
  393. PINMUX_IPSR_MSEL(IP0SR1_11_8, MSIOF2_SS1, SEL_I2C1_0),
  394. PINMUX_IPSR_MSEL(IP0SR1_11_8, TSN2_MDC_A, SEL_I2C1_0),
  395. PINMUX_IPSR_PHYS(IP0SR1_11_8, SCL1, SEL_I2C1_3),
  396. /* GP1_03 = SDA1 */
  397. PINMUX_IPSR_MSEL(IP0SR1_15_12, GP1_03, SEL_I2C1_0),
  398. PINMUX_IPSR_MSEL(IP0SR1_15_12, TCLK2, SEL_I2C1_0),
  399. PINMUX_IPSR_MSEL(IP0SR1_15_12, HCTS2_N, SEL_I2C1_0),
  400. PINMUX_IPSR_MSEL(IP0SR1_15_12, MSIOF2_SS2, SEL_I2C1_0),
  401. PINMUX_IPSR_MSEL(IP0SR1_15_12, CTS4_N, SEL_I2C1_0),
  402. PINMUX_IPSR_MSEL(IP0SR1_15_12, TSN2_MDIO_A, SEL_I2C1_0),
  403. PINMUX_IPSR_PHYS(IP0SR1_15_12, SDA1, SEL_I2C1_3),
  404. /* GP1_04 = SCL2 */
  405. PINMUX_IPSR_MSEL(IP0SR1_19_16, GP1_04, SEL_I2C2_0),
  406. PINMUX_IPSR_MSEL(IP0SR1_19_16, TCLK3, SEL_I2C2_0),
  407. PINMUX_IPSR_MSEL(IP0SR1_19_16, HRTS2_N, SEL_I2C2_0),
  408. PINMUX_IPSR_MSEL(IP0SR1_19_16, MSIOF2_SYNC, SEL_I2C2_0),
  409. PINMUX_IPSR_MSEL(IP0SR1_19_16, RTS4_N, SEL_I2C2_0),
  410. PINMUX_IPSR_PHYS(IP0SR1_19_16, SCL2, SEL_I2C2_3),
  411. /* GP1_05 = SDA2 */
  412. PINMUX_IPSR_MSEL(IP0SR1_23_20, GP1_05, SEL_I2C2_0),
  413. PINMUX_IPSR_MSEL(IP0SR1_23_20, MSIOF2_SCK, SEL_I2C2_0),
  414. PINMUX_IPSR_MSEL(IP0SR1_23_20, SCK4, SEL_I2C2_0),
  415. PINMUX_IPSR_PHYS(IP0SR1_23_20, SDA2, SEL_I2C2_3),
  416. /* GP1_06 = SCL3 */
  417. PINMUX_IPSR_MSEL(IP0SR1_27_24, GP1_06, SEL_I2C3_0),
  418. PINMUX_IPSR_MSEL(IP0SR1_27_24, MSIOF2_RXD, SEL_I2C3_0),
  419. PINMUX_IPSR_MSEL(IP0SR1_27_24, RX4, SEL_I2C3_0),
  420. PINMUX_IPSR_PHYS(IP0SR1_27_24, SCL3, SEL_I2C3_3),
  421. /* GP1_07 = SDA3 */
  422. PINMUX_IPSR_MSEL(IP0SR1_31_28, GP1_07, SEL_I2C3_0),
  423. PINMUX_IPSR_MSEL(IP0SR1_31_28, MSIOF2_TXD, SEL_I2C3_0),
  424. PINMUX_IPSR_MSEL(IP0SR1_31_28, TX4, SEL_I2C3_0),
  425. PINMUX_IPSR_PHYS(IP0SR1_31_28, SDA3, SEL_I2C3_3),
  426. /* GP1_08 = SCL4 */
  427. PINMUX_IPSR_NOGM(0, GP1_08, SEL_I2C4_0),
  428. PINMUX_IPSR_NOFN(GP1_08, SCL4, SEL_I2C4_3),
  429. /* GP1_09 = SDA4 */
  430. PINMUX_IPSR_NOGM(0, GP1_09, SEL_I2C4_0),
  431. PINMUX_IPSR_NOFN(GP1_09, SDA4, SEL_I2C4_3),
  432. /* GP1_10 = SCL5 */
  433. PINMUX_IPSR_NOGM(0, GP1_10, SEL_I2C5_0),
  434. PINMUX_IPSR_NOFN(GP1_10, SCL5, SEL_I2C5_3),
  435. /* GP1_11 = SDA5 */
  436. PINMUX_IPSR_NOGM(0, GP1_11, SEL_I2C5_0),
  437. PINMUX_IPSR_NOFN(GP1_11, SDA5, SEL_I2C5_3),
  438. };
  439. /*
  440. * Pins not associated with a GPIO port.
  441. */
  442. enum {
  443. GP_ASSIGN_LAST(),
  444. NOGP_ALL(),
  445. };
  446. static const struct sh_pfc_pin pinmux_pins[] = {
  447. PINMUX_GPIO_GP_ALL(),
  448. };
  449. /* - HSCIF0 ----------------------------------------------------------------- */
  450. static const unsigned int hscif0_data_pins[] = {
  451. /* HRX0, HTX0 */
  452. RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
  453. };
  454. static const unsigned int hscif0_data_mux[] = {
  455. HRX0_MARK, HTX0_MARK,
  456. };
  457. static const unsigned int hscif0_clk_pins[] = {
  458. /* HSCK0 */
  459. RCAR_GP_PIN(0, 1),
  460. };
  461. static const unsigned int hscif0_clk_mux[] = {
  462. HSCK0_MARK,
  463. };
  464. static const unsigned int hscif0_ctrl_pins[] = {
  465. /* HRTS0#, HCTS0# */
  466. RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 4),
  467. };
  468. static const unsigned int hscif0_ctrl_mux[] = {
  469. HRTS0_N_MARK, HCTS0_N_MARK,
  470. };
  471. /* - HSCIF1 ----------------------------------------------------------------- */
  472. static const unsigned int hscif1_data_pins[] = {
  473. /* HRX1, HTX1 */
  474. RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
  475. };
  476. static const unsigned int hscif1_data_mux[] = {
  477. HRX1_MARK, HTX1_MARK,
  478. };
  479. static const unsigned int hscif1_clk_pins[] = {
  480. /* HSCK1 */
  481. RCAR_GP_PIN(0, 8),
  482. };
  483. static const unsigned int hscif1_clk_mux[] = {
  484. HSCK1_MARK,
  485. };
  486. static const unsigned int hscif1_ctrl_pins[] = {
  487. /* HRTS1#, HCTS1# */
  488. RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 10),
  489. };
  490. static const unsigned int hscif1_ctrl_mux[] = {
  491. HRTS1_N_MARK, HCTS1_N_MARK,
  492. };
  493. /* - HSCIF2 ----------------------------------------------------------------- */
  494. static const unsigned int hscif2_data_pins[] = {
  495. /* HRX2, HTX2 */
  496. RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 2),
  497. };
  498. static const unsigned int hscif2_data_mux[] = {
  499. HRX2_MARK, HTX2_MARK,
  500. };
  501. static const unsigned int hscif2_clk_pins[] = {
  502. /* HSCK2 */
  503. RCAR_GP_PIN(1, 0),
  504. };
  505. static const unsigned int hscif2_clk_mux[] = {
  506. HSCK2_MARK,
  507. };
  508. static const unsigned int hscif2_ctrl_pins[] = {
  509. /* HRTS2#, HCTS2# */
  510. RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3),
  511. };
  512. static const unsigned int hscif2_ctrl_mux[] = {
  513. HRTS2_N_MARK, HCTS2_N_MARK,
  514. };
  515. /* - HSCIF3 ----------------------------------------------------------------- */
  516. static const unsigned int hscif3_data_pins[] = {
  517. /* HRX3, HTX3 */
  518. RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
  519. };
  520. static const unsigned int hscif3_data_mux[] = {
  521. HRX3_MARK, HTX3_MARK,
  522. };
  523. static const unsigned int hscif3_clk_pins[] = {
  524. /* HSCK3 */
  525. RCAR_GP_PIN(0, 14),
  526. };
  527. static const unsigned int hscif3_clk_mux[] = {
  528. HSCK3_MARK,
  529. };
  530. static const unsigned int hscif3_ctrl_pins[] = {
  531. /* HRTS3#, HCTS3# */
  532. RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 11),
  533. };
  534. static const unsigned int hscif3_ctrl_mux[] = {
  535. HRTS3_N_MARK, HCTS3_N_MARK,
  536. };
  537. /* - I2C0 ------------------------------------------------------------------- */
  538. static const unsigned int i2c0_pins[] = {
  539. /* SDA0, SCL0 */
  540. RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 0),
  541. };
  542. static const unsigned int i2c0_mux[] = {
  543. SDA0_MARK, SCL0_MARK,
  544. };
  545. /* - I2C1 ------------------------------------------------------------------- */
  546. static const unsigned int i2c1_pins[] = {
  547. /* SDA1, SCL1 */
  548. RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2),
  549. };
  550. static const unsigned int i2c1_mux[] = {
  551. SDA1_MARK, SCL1_MARK,
  552. };
  553. /* - I2C2 ------------------------------------------------------------------- */
  554. static const unsigned int i2c2_pins[] = {
  555. /* SDA2, SCL2 */
  556. RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 4),
  557. };
  558. static const unsigned int i2c2_mux[] = {
  559. SDA2_MARK, SCL2_MARK,
  560. };
  561. /* - I2C3 ------------------------------------------------------------------- */
  562. static const unsigned int i2c3_pins[] = {
  563. /* SDA3, SCL3 */
  564. RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6),
  565. };
  566. static const unsigned int i2c3_mux[] = {
  567. SDA3_MARK, SCL3_MARK,
  568. };
  569. /* - I2C4 ------------------------------------------------------------------- */
  570. static const unsigned int i2c4_pins[] = {
  571. /* SDA4, SCL4 */
  572. RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 8),
  573. };
  574. static const unsigned int i2c4_mux[] = {
  575. SDA4_MARK, SCL4_MARK,
  576. };
  577. /* - I2C5 ------------------------------------------------------------------- */
  578. static const unsigned int i2c5_pins[] = {
  579. /* SDA5, SCL5 */
  580. RCAR_GP_PIN(1, 11), RCAR_GP_PIN(1, 10),
  581. };
  582. static const unsigned int i2c5_mux[] = {
  583. SDA5_MARK, SCL5_MARK,
  584. };
  585. /* - INTC-EX ---------------------------------------------------------------- */
  586. static const unsigned int intc_ex_irq0_pins[] = {
  587. /* IRQ0 */
  588. RCAR_GP_PIN(0, 17),
  589. };
  590. static const unsigned int intc_ex_irq0_mux[] = {
  591. IRQ0_MARK,
  592. };
  593. static const unsigned int intc_ex_irq1_pins[] = {
  594. /* IRQ1 */
  595. RCAR_GP_PIN(0, 18),
  596. };
  597. static const unsigned int intc_ex_irq1_mux[] = {
  598. IRQ1_MARK,
  599. };
  600. static const unsigned int intc_ex_irq2_pins[] = {
  601. /* IRQ2 */
  602. RCAR_GP_PIN(0, 19),
  603. };
  604. static const unsigned int intc_ex_irq2_mux[] = {
  605. IRQ2_MARK,
  606. };
  607. static const unsigned int intc_ex_irq3_pins[] = {
  608. /* IRQ3 */
  609. RCAR_GP_PIN(0, 20),
  610. };
  611. static const unsigned int intc_ex_irq3_mux[] = {
  612. IRQ3_MARK,
  613. };
  614. static const unsigned int intc_ex_irq4_pins[] = {
  615. /* IRQ4 */
  616. RCAR_GP_PIN(0, 11),
  617. };
  618. static const unsigned int intc_ex_irq4_mux[] = {
  619. IRQ4_MARK,
  620. };
  621. static const unsigned int intc_ex_irq5_pins[] = {
  622. /* IRQ5 */
  623. RCAR_GP_PIN(0, 15),
  624. };
  625. static const unsigned int intc_ex_irq5_mux[] = {
  626. IRQ5_MARK,
  627. };
  628. /* - MMC -------------------------------------------------------------------- */
  629. static const unsigned int mmc_data_pins[] = {
  630. /* MMC_SD_D[0:3], MMC_D[4:7] */
  631. RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
  632. RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
  633. RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 17),
  634. RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 21),
  635. };
  636. static const unsigned int mmc_data_mux[] = {
  637. MMC_SD_D0_MARK, MMC_SD_D1_MARK,
  638. MMC_SD_D2_MARK, MMC_SD_D3_MARK,
  639. MMC_D4_MARK, MMC_D5_MARK,
  640. MMC_D6_MARK, MMC_D7_MARK,
  641. };
  642. static const unsigned int mmc_ctrl_pins[] = {
  643. /* MMC_SD_CLK, MMC_SD_CMD */
  644. RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 22),
  645. };
  646. static const unsigned int mmc_ctrl_mux[] = {
  647. MMC_SD_CLK_MARK, MMC_SD_CMD_MARK,
  648. };
  649. static const unsigned int mmc_cd_pins[] = {
  650. /* SD_CD */
  651. RCAR_GP_PIN(1, 23),
  652. };
  653. static const unsigned int mmc_cd_mux[] = {
  654. SD_CD_MARK,
  655. };
  656. static const unsigned int mmc_wp_pins[] = {
  657. /* SD_WP */
  658. RCAR_GP_PIN(1, 24),
  659. };
  660. static const unsigned int mmc_wp_mux[] = {
  661. SD_WP_MARK,
  662. };
  663. static const unsigned int mmc_ds_pins[] = {
  664. /* MMC_DS */
  665. RCAR_GP_PIN(1, 20),
  666. };
  667. static const unsigned int mmc_ds_mux[] = {
  668. MMC_DS_MARK,
  669. };
  670. /* - MSIOF0 ----------------------------------------------------------------- */
  671. static const unsigned int msiof0_clk_pins[] = {
  672. /* MSIOF0_SCK */
  673. RCAR_GP_PIN(0, 14),
  674. };
  675. static const unsigned int msiof0_clk_mux[] = {
  676. MSIOF0_SCK_MARK,
  677. };
  678. static const unsigned int msiof0_sync_pins[] = {
  679. /* MSIOF0_SYNC */
  680. RCAR_GP_PIN(0, 11),
  681. };
  682. static const unsigned int msiof0_sync_mux[] = {
  683. MSIOF0_SYNC_MARK,
  684. };
  685. static const unsigned int msiof0_ss1_pins[] = {
  686. /* MSIOF0_SS1 */
  687. RCAR_GP_PIN(0, 15),
  688. };
  689. static const unsigned int msiof0_ss1_mux[] = {
  690. MSIOF0_SS1_MARK,
  691. };
  692. static const unsigned int msiof0_ss2_pins[] = {
  693. /* MSIOF0_SS2 */
  694. RCAR_GP_PIN(0, 16),
  695. };
  696. static const unsigned int msiof0_ss2_mux[] = {
  697. MSIOF0_SS2_MARK,
  698. };
  699. static const unsigned int msiof0_txd_pins[] = {
  700. /* MSIOF0_TXD */
  701. RCAR_GP_PIN(0, 13),
  702. };
  703. static const unsigned int msiof0_txd_mux[] = {
  704. MSIOF0_TXD_MARK,
  705. };
  706. static const unsigned int msiof0_rxd_pins[] = {
  707. /* MSIOF0_RXD */
  708. RCAR_GP_PIN(0, 12),
  709. };
  710. static const unsigned int msiof0_rxd_mux[] = {
  711. MSIOF0_RXD_MARK,
  712. };
  713. /* - MSIOF1 ----------------------------------------------------------------- */
  714. static const unsigned int msiof1_clk_pins[] = {
  715. /* MSIOF1_SCK */
  716. RCAR_GP_PIN(0, 8),
  717. };
  718. static const unsigned int msiof1_clk_mux[] = {
  719. MSIOF1_SCK_MARK,
  720. };
  721. static const unsigned int msiof1_sync_pins[] = {
  722. /* MSIOF1_SYNC */
  723. RCAR_GP_PIN(0, 10),
  724. };
  725. static const unsigned int msiof1_sync_mux[] = {
  726. MSIOF1_SYNC_MARK,
  727. };
  728. static const unsigned int msiof1_ss1_pins[] = {
  729. /* MSIOF1_SS1 */
  730. RCAR_GP_PIN(0, 17),
  731. };
  732. static const unsigned int msiof1_ss1_mux[] = {
  733. MSIOF1_SS1_MARK,
  734. };
  735. static const unsigned int msiof1_ss2_pins[] = {
  736. /* MSIOF1_SS2 */
  737. RCAR_GP_PIN(0, 18),
  738. };
  739. static const unsigned int msiof1_ss2_mux[] = {
  740. MSIOF1_SS2_MARK,
  741. };
  742. static const unsigned int msiof1_txd_pins[] = {
  743. /* MSIOF1_TXD */
  744. RCAR_GP_PIN(0, 7),
  745. };
  746. static const unsigned int msiof1_txd_mux[] = {
  747. MSIOF1_TXD_MARK,
  748. };
  749. static const unsigned int msiof1_rxd_pins[] = {
  750. /* MSIOF1_RXD */
  751. RCAR_GP_PIN(0, 6),
  752. };
  753. static const unsigned int msiof1_rxd_mux[] = {
  754. MSIOF1_RXD_MARK,
  755. };
  756. /* - MSIOF2 ----------------------------------------------------------------- */
  757. static const unsigned int msiof2_clk_pins[] = {
  758. /* MSIOF2_SCK */
  759. RCAR_GP_PIN(1, 5),
  760. };
  761. static const unsigned int msiof2_clk_mux[] = {
  762. MSIOF2_SCK_MARK,
  763. };
  764. static const unsigned int msiof2_sync_pins[] = {
  765. /* MSIOF2_SYNC */
  766. RCAR_GP_PIN(1, 4),
  767. };
  768. static const unsigned int msiof2_sync_mux[] = {
  769. MSIOF2_SYNC_MARK,
  770. };
  771. static const unsigned int msiof2_ss1_pins[] = {
  772. /* MSIOF2_SS1 */
  773. RCAR_GP_PIN(1, 2),
  774. };
  775. static const unsigned int msiof2_ss1_mux[] = {
  776. MSIOF2_SS1_MARK,
  777. };
  778. static const unsigned int msiof2_ss2_pins[] = {
  779. /* MSIOF2_SS2 */
  780. RCAR_GP_PIN(1, 3),
  781. };
  782. static const unsigned int msiof2_ss2_mux[] = {
  783. MSIOF2_SS2_MARK,
  784. };
  785. static const unsigned int msiof2_txd_pins[] = {
  786. /* MSIOF2_TXD */
  787. RCAR_GP_PIN(1, 7),
  788. };
  789. static const unsigned int msiof2_txd_mux[] = {
  790. MSIOF2_TXD_MARK,
  791. };
  792. static const unsigned int msiof2_rxd_pins[] = {
  793. /* MSIOF2_RXD */
  794. RCAR_GP_PIN(1, 6),
  795. };
  796. static const unsigned int msiof2_rxd_mux[] = {
  797. MSIOF2_RXD_MARK,
  798. };
  799. /* - MSIOF3 ----------------------------------------------------------------- */
  800. static const unsigned int msiof3_clk_pins[] = {
  801. /* MSIOF3_SCK */
  802. RCAR_GP_PIN(0, 1),
  803. };
  804. static const unsigned int msiof3_clk_mux[] = {
  805. MSIOF3_SCK_MARK,
  806. };
  807. static const unsigned int msiof3_sync_pins[] = {
  808. /* MSIOF3_SYNC */
  809. RCAR_GP_PIN(0, 9),
  810. };
  811. static const unsigned int msiof3_sync_mux[] = {
  812. MSIOF3_SYNC_MARK,
  813. };
  814. static const unsigned int msiof3_ss1_pins[] = {
  815. /* MSIOF3_SS1 */
  816. RCAR_GP_PIN(0, 4),
  817. };
  818. static const unsigned int msiof3_ss1_mux[] = {
  819. MSIOF3_SS1_MARK,
  820. };
  821. static const unsigned int msiof3_ss2_pins[] = {
  822. /* MSIOF3_SS2 */
  823. RCAR_GP_PIN(0, 5),
  824. };
  825. static const unsigned int msiof3_ss2_mux[] = {
  826. MSIOF3_SS2_MARK,
  827. };
  828. static const unsigned int msiof3_txd_pins[] = {
  829. /* MSIOF3_TXD */
  830. RCAR_GP_PIN(0, 3),
  831. };
  832. static const unsigned int msiof3_txd_mux[] = {
  833. MSIOF3_TXD_MARK,
  834. };
  835. static const unsigned int msiof3_rxd_pins[] = {
  836. /* MSIOF3_RXD */
  837. RCAR_GP_PIN(0, 2),
  838. };
  839. static const unsigned int msiof3_rxd_mux[] = {
  840. MSIOF3_RXD_MARK,
  841. };
  842. /* - PCIE ------------------------------------------------------------------- */
  843. static const unsigned int pcie0_clkreq_n_pins[] = {
  844. /* PCIE0_CLKREQ# */
  845. RCAR_GP_PIN(2, 15),
  846. };
  847. static const unsigned int pcie0_clkreq_n_mux[] = {
  848. PCIE0_CLKREQ_N_MARK,
  849. };
  850. static const unsigned int pcie1_clkreq_n_pins[] = {
  851. /* PCIE1_CLKREQ# */
  852. RCAR_GP_PIN(2, 16),
  853. };
  854. static const unsigned int pcie1_clkreq_n_mux[] = {
  855. PCIE1_CLKREQ_N_MARK,
  856. };
  857. /* - QSPI0 ------------------------------------------------------------------ */
  858. static const unsigned int qspi0_ctrl_pins[] = {
  859. /* SPCLK, SSL */
  860. RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 13),
  861. };
  862. static const unsigned int qspi0_ctrl_mux[] = {
  863. QSPI0_SPCLK_MARK, QSPI0_SSL_MARK,
  864. };
  865. static const unsigned int qspi0_data_pins[] = {
  866. /* MOSI_IO0, MISO_IO1, IO2, IO3 */
  867. RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 12),
  868. RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 14),
  869. };
  870. static const unsigned int qspi0_data_mux[] = {
  871. QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
  872. QSPI0_IO2_MARK, QSPI0_IO3_MARK
  873. };
  874. /* - QSPI1 ------------------------------------------------------------------ */
  875. static const unsigned int qspi1_ctrl_pins[] = {
  876. /* SPCLK, SSL */
  877. RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 3),
  878. };
  879. static const unsigned int qspi1_ctrl_mux[] = {
  880. QSPI1_SPCLK_MARK, QSPI1_SSL_MARK,
  881. };
  882. static const unsigned int qspi1_data_pins[] = {
  883. /* MOSI_IO0, MISO_IO1, IO2, IO3 */
  884. RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 5),
  885. RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 4),
  886. };
  887. static const unsigned int qspi1_data_mux[] = {
  888. QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
  889. QSPI1_IO2_MARK, QSPI1_IO3_MARK
  890. };
  891. /* - SCIF0 ------------------------------------------------------------------ */
  892. static const unsigned int scif0_data_pins[] = {
  893. /* RX0, TX0 */
  894. RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
  895. };
  896. static const unsigned int scif0_data_mux[] = {
  897. RX0_MARK, TX0_MARK,
  898. };
  899. static const unsigned int scif0_clk_pins[] = {
  900. /* SCK0 */
  901. RCAR_GP_PIN(0, 8),
  902. };
  903. static const unsigned int scif0_clk_mux[] = {
  904. SCK0_MARK,
  905. };
  906. static const unsigned int scif0_ctrl_pins[] = {
  907. /* RTS0#, CTS0# */
  908. RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 10),
  909. };
  910. static const unsigned int scif0_ctrl_mux[] = {
  911. RTS0_N_MARK, CTS0_N_MARK,
  912. };
  913. /* - SCIF1 ------------------------------------------------------------------ */
  914. static const unsigned int scif1_data_pins[] = {
  915. /* RX1, TX1 */
  916. RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
  917. };
  918. static const unsigned int scif1_data_mux[] = {
  919. RX1_MARK, TX1_MARK,
  920. };
  921. static const unsigned int scif1_clk_pins[] = {
  922. /* SCK1 */
  923. RCAR_GP_PIN(0, 14),
  924. };
  925. static const unsigned int scif1_clk_mux[] = {
  926. SCK1_MARK,
  927. };
  928. static const unsigned int scif1_ctrl_pins[] = {
  929. /* RTS1#, CTS1# */
  930. RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 11),
  931. };
  932. static const unsigned int scif1_ctrl_mux[] = {
  933. RTS1_N_MARK, CTS1_N_MARK,
  934. };
  935. /* - SCIF3 ------------------------------------------------------------------ */
  936. static const unsigned int scif3_data_pins[] = {
  937. /* RX3, TX3 */
  938. RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
  939. };
  940. static const unsigned int scif3_data_mux[] = {
  941. RX3_MARK, TX3_MARK,
  942. };
  943. static const unsigned int scif3_clk_pins[] = {
  944. /* SCK3 */
  945. RCAR_GP_PIN(0, 1),
  946. };
  947. static const unsigned int scif3_clk_mux[] = {
  948. SCK3_MARK,
  949. };
  950. static const unsigned int scif3_ctrl_pins[] = {
  951. /* RTS3#, CTS3# */
  952. RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 4),
  953. };
  954. static const unsigned int scif3_ctrl_mux[] = {
  955. RTS3_N_MARK, CTS3_N_MARK,
  956. };
  957. /* - SCIF4 ------------------------------------------------------------------ */
  958. static const unsigned int scif4_data_pins[] = {
  959. /* RX4, TX4 */
  960. RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
  961. };
  962. static const unsigned int scif4_data_mux[] = {
  963. RX4_MARK, TX4_MARK,
  964. };
  965. static const unsigned int scif4_clk_pins[] = {
  966. /* SCK4 */
  967. RCAR_GP_PIN(1, 5),
  968. };
  969. static const unsigned int scif4_clk_mux[] = {
  970. SCK4_MARK,
  971. };
  972. static const unsigned int scif4_ctrl_pins[] = {
  973. /* RTS4#, CTS4# */
  974. RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3),
  975. };
  976. static const unsigned int scif4_ctrl_mux[] = {
  977. RTS4_N_MARK, CTS4_N_MARK,
  978. };
  979. /* - SCIF Clock ------------------------------------------------------------- */
  980. static const unsigned int scif_clk_pins[] = {
  981. /* SCIF_CLK */
  982. RCAR_GP_PIN(0, 0),
  983. };
  984. static const unsigned int scif_clk_mux[] = {
  985. SCIF_CLK_MARK,
  986. };
  987. /* - TSN0 ------------------------------------------------ */
  988. static const unsigned int tsn0_link_a_pins[] = {
  989. /* TSN0_LINK_A */
  990. RCAR_GP_PIN(0, 11),
  991. };
  992. static const unsigned int tsn0_link_a_mux[] = {
  993. TSN0_LINK_A_MARK,
  994. };
  995. static const unsigned int tsn0_magic_a_pins[] = {
  996. /* TSN0_MAGIC_A */
  997. RCAR_GP_PIN(0, 17),
  998. };
  999. static const unsigned int tsn0_magic_a_mux[] = {
  1000. TSN0_MAGIC_A_MARK,
  1001. };
  1002. static const unsigned int tsn0_phy_int_a_pins[] = {
  1003. /* TSN0_PHY_INT_A */
  1004. RCAR_GP_PIN(0, 18),
  1005. };
  1006. static const unsigned int tsn0_phy_int_a_mux[] = {
  1007. TSN0_PHY_INT_A_MARK,
  1008. };
  1009. static const unsigned int tsn0_mdio_a_pins[] = {
  1010. /* TSN0_MDC_A, TSN0_MDIO_A */
  1011. RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
  1012. };
  1013. static const unsigned int tsn0_mdio_a_mux[] = {
  1014. TSN0_MDC_A_MARK, TSN0_MDIO_A_MARK,
  1015. };
  1016. static const unsigned int tsn0_link_b_pins[] = {
  1017. /* TSN0_LINK_B */
  1018. RCAR_GP_PIN(3, 8),
  1019. };
  1020. static const unsigned int tsn0_link_b_mux[] = {
  1021. TSN0_LINK_B_MARK,
  1022. };
  1023. static const unsigned int tsn0_magic_b_pins[] = {
  1024. /* TSN0_MAGIC_B */
  1025. RCAR_GP_PIN(3, 12),
  1026. };
  1027. static const unsigned int tsn0_magic_b_mux[] = {
  1028. TSN0_MAGIC_B_MARK,
  1029. };
  1030. static const unsigned int tsn0_phy_int_b_pins[] = {
  1031. /* TSN0_PHY_INT_B */
  1032. RCAR_GP_PIN(3, 10),
  1033. };
  1034. static const unsigned int tsn0_phy_int_b_mux[] = {
  1035. TSN0_PHY_INT_B_MARK,
  1036. };
  1037. static const unsigned int tsn0_mdio_b_pins[] = {
  1038. /* TSN0_MDC_B, TSN0_MDIO_B */
  1039. RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 2),
  1040. };
  1041. static const unsigned int tsn0_mdio_b_mux[] = {
  1042. TSN0_MDC_B_MARK, TSN0_MDIO_B_MARK,
  1043. };
  1044. static const unsigned int tsn0_avtp_pps_pins[] = {
  1045. /* TSN0_AVTP_PPS */
  1046. RCAR_GP_PIN(3, 16),
  1047. };
  1048. static const unsigned int tsn0_avtp_pps_mux[] = {
  1049. TSN0_AVTP_PPS_MARK,
  1050. };
  1051. static const unsigned int tsn0_avtp_capture_a_pins[] = {
  1052. /* TSN0_AVTP_CAPTURE_A */
  1053. RCAR_GP_PIN(0, 1),
  1054. };
  1055. static const unsigned int tsn0_avtp_capture_a_mux[] = {
  1056. TSN0_AVTP_CAPTURE_A_MARK,
  1057. };
  1058. static const unsigned int tsn0_avtp_match_a_pins[] = {
  1059. /* TSN0_AVTP_MATCH_A */
  1060. RCAR_GP_PIN(0, 2),
  1061. };
  1062. static const unsigned int tsn0_avtp_match_a_mux[] = {
  1063. TSN0_AVTP_MATCH_A_MARK,
  1064. };
  1065. static const unsigned int tsn0_avtp_capture_b_pins[] = {
  1066. /* TSN0_AVTP_CAPTURE_B */
  1067. RCAR_GP_PIN(3, 18),
  1068. };
  1069. static const unsigned int tsn0_avtp_capture_b_mux[] = {
  1070. TSN0_AVTP_CAPTURE_B_MARK,
  1071. };
  1072. static const unsigned int tsn0_avtp_match_b_pins[] = {
  1073. /* TSN0_AVTP_MATCH_B */
  1074. RCAR_GP_PIN(3, 17),
  1075. };
  1076. static const unsigned int tsn0_avtp_match_b_mux[] = {
  1077. TSN0_AVTP_MATCH_B_MARK,
  1078. };
  1079. /* - TSN1 ------------------------------------------------ */
  1080. static const unsigned int tsn1_link_a_pins[] = {
  1081. /* TSN1_LINK_A */
  1082. RCAR_GP_PIN(0, 15),
  1083. };
  1084. static const unsigned int tsn1_link_a_mux[] = {
  1085. TSN1_LINK_A_MARK,
  1086. };
  1087. static const unsigned int tsn1_phy_int_a_pins[] = {
  1088. /* TSN1_PHY_INT_A */
  1089. RCAR_GP_PIN(0, 19),
  1090. };
  1091. static const unsigned int tsn1_phy_int_a_mux[] = {
  1092. TSN1_PHY_INT_A_MARK,
  1093. };
  1094. static const unsigned int tsn1_mdio_a_pins[] = {
  1095. /* TSN1_MDC_A, TSN1_MDIO_A */
  1096. RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 9),
  1097. };
  1098. static const unsigned int tsn1_mdio_a_mux[] = {
  1099. TSN1_MDC_A_MARK, TSN1_MDIO_A_MARK,
  1100. };
  1101. static const unsigned int tsn1_link_b_pins[] = {
  1102. /* TSN1_LINK_B */
  1103. RCAR_GP_PIN(3, 6),
  1104. };
  1105. static const unsigned int tsn1_link_b_mux[] = {
  1106. TSN1_LINK_B_MARK,
  1107. };
  1108. static const unsigned int tsn1_phy_int_b_pins[] = {
  1109. /* TSN1_PHY_INT_B */
  1110. RCAR_GP_PIN(3, 11),
  1111. };
  1112. static const unsigned int tsn1_phy_int_b_mux[] = {
  1113. TSN1_PHY_INT_B_MARK,
  1114. };
  1115. static const unsigned int tsn1_mdio_b_pins[] = {
  1116. /* TSN1_MDC_B, TSN1_MDIO_B */
  1117. RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 0),
  1118. };
  1119. static const unsigned int tsn1_mdio_b_mux[] = {
  1120. TSN1_MDC_B_MARK, TSN1_MDIO_B_MARK,
  1121. };
  1122. static const unsigned int tsn1_avtp_pps_pins[] = {
  1123. /* TSN1_AVTP_PPS */
  1124. RCAR_GP_PIN(3, 13),
  1125. };
  1126. static const unsigned int tsn1_avtp_pps_mux[] = {
  1127. TSN1_AVTP_PPS_MARK,
  1128. };
  1129. static const unsigned int tsn1_avtp_capture_a_pins[] = {
  1130. /* TSN1_AVTP_CAPTURE_A */
  1131. RCAR_GP_PIN(0, 7),
  1132. };
  1133. static const unsigned int tsn1_avtp_capture_a_mux[] = {
  1134. TSN1_AVTP_CAPTURE_A_MARK,
  1135. };
  1136. static const unsigned int tsn1_avtp_match_a_pins[] = {
  1137. /* TSN1_AVTP_MATCH_A */
  1138. RCAR_GP_PIN(0, 6),
  1139. };
  1140. static const unsigned int tsn1_avtp_match_a_mux[] = {
  1141. TSN1_AVTP_MATCH_A_MARK,
  1142. };
  1143. static const unsigned int tsn1_avtp_capture_b_pins[] = {
  1144. /* TSN1_AVTP_CAPTURE_B */
  1145. RCAR_GP_PIN(3, 15),
  1146. };
  1147. static const unsigned int tsn1_avtp_capture_b_mux[] = {
  1148. TSN1_AVTP_CAPTURE_B_MARK,
  1149. };
  1150. static const unsigned int tsn1_avtp_match_b_pins[] = {
  1151. /* TSN1_AVTP_MATCH_B */
  1152. RCAR_GP_PIN(3, 14),
  1153. };
  1154. static const unsigned int tsn1_avtp_match_b_mux[] = {
  1155. TSN1_AVTP_MATCH_B_MARK,
  1156. };
  1157. /* - TSN2 ------------------------------------------------ */
  1158. static const unsigned int tsn2_link_a_pins[] = {
  1159. /* TSN2_LINK_A */
  1160. RCAR_GP_PIN(0, 16),
  1161. };
  1162. static const unsigned int tsn2_link_a_mux[] = {
  1163. TSN2_LINK_A_MARK,
  1164. };
  1165. static const unsigned int tsn2_phy_int_a_pins[] = {
  1166. /* TSN2_PHY_INT_A */
  1167. RCAR_GP_PIN(0, 20),
  1168. };
  1169. static const unsigned int tsn2_phy_int_a_mux[] = {
  1170. TSN2_PHY_INT_A_MARK,
  1171. };
  1172. static const unsigned int tsn2_mdio_a_pins[] = {
  1173. /* TSN2_MDC_A, TSN2_MDIO_A */
  1174. RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
  1175. };
  1176. static const unsigned int tsn2_mdio_a_mux[] = {
  1177. TSN2_MDC_A_MARK, TSN2_MDIO_A_MARK,
  1178. };
  1179. static const unsigned int tsn2_link_b_pins[] = {
  1180. /* TSN2_LINK_B */
  1181. RCAR_GP_PIN(3, 7),
  1182. };
  1183. static const unsigned int tsn2_link_b_mux[] = {
  1184. TSN2_LINK_B_MARK,
  1185. };
  1186. static const unsigned int tsn2_phy_int_b_pins[] = {
  1187. /* TSN2_PHY_INT_B */
  1188. RCAR_GP_PIN(3, 9),
  1189. };
  1190. static const unsigned int tsn2_phy_int_b_mux[] = {
  1191. TSN2_PHY_INT_B_MARK,
  1192. };
  1193. static const unsigned int tsn2_mdio_b_pins[] = {
  1194. /* TSN2_MDC_B, TSN2_MDIO_B */
  1195. RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 1),
  1196. };
  1197. static const unsigned int tsn2_mdio_b_mux[] = {
  1198. TSN2_MDC_B_MARK, TSN2_MDIO_B_MARK,
  1199. };
  1200. static const struct sh_pfc_pin_group pinmux_groups[] = {
  1201. SH_PFC_PIN_GROUP(hscif0_data),
  1202. SH_PFC_PIN_GROUP(hscif0_clk),
  1203. SH_PFC_PIN_GROUP(hscif0_ctrl),
  1204. SH_PFC_PIN_GROUP(hscif1_data),
  1205. SH_PFC_PIN_GROUP(hscif1_clk),
  1206. SH_PFC_PIN_GROUP(hscif1_ctrl),
  1207. SH_PFC_PIN_GROUP(hscif2_data),
  1208. SH_PFC_PIN_GROUP(hscif2_clk),
  1209. SH_PFC_PIN_GROUP(hscif2_ctrl),
  1210. SH_PFC_PIN_GROUP(hscif3_data),
  1211. SH_PFC_PIN_GROUP(hscif3_clk),
  1212. SH_PFC_PIN_GROUP(hscif3_ctrl),
  1213. SH_PFC_PIN_GROUP(i2c0),
  1214. SH_PFC_PIN_GROUP(i2c1),
  1215. SH_PFC_PIN_GROUP(i2c2),
  1216. SH_PFC_PIN_GROUP(i2c3),
  1217. SH_PFC_PIN_GROUP(i2c4),
  1218. SH_PFC_PIN_GROUP(i2c5),
  1219. SH_PFC_PIN_GROUP(intc_ex_irq0),
  1220. SH_PFC_PIN_GROUP(intc_ex_irq1),
  1221. SH_PFC_PIN_GROUP(intc_ex_irq2),
  1222. SH_PFC_PIN_GROUP(intc_ex_irq3),
  1223. SH_PFC_PIN_GROUP(intc_ex_irq4),
  1224. SH_PFC_PIN_GROUP(intc_ex_irq5),
  1225. BUS_DATA_PIN_GROUP(mmc_data, 1),
  1226. BUS_DATA_PIN_GROUP(mmc_data, 4),
  1227. BUS_DATA_PIN_GROUP(mmc_data, 8),
  1228. SH_PFC_PIN_GROUP(mmc_ctrl),
  1229. SH_PFC_PIN_GROUP(mmc_cd),
  1230. SH_PFC_PIN_GROUP(mmc_wp),
  1231. SH_PFC_PIN_GROUP(mmc_ds),
  1232. SH_PFC_PIN_GROUP(msiof0_clk),
  1233. SH_PFC_PIN_GROUP(msiof0_sync),
  1234. SH_PFC_PIN_GROUP(msiof0_ss1),
  1235. SH_PFC_PIN_GROUP(msiof0_ss2),
  1236. SH_PFC_PIN_GROUP(msiof0_txd),
  1237. SH_PFC_PIN_GROUP(msiof0_rxd),
  1238. SH_PFC_PIN_GROUP(msiof1_clk),
  1239. SH_PFC_PIN_GROUP(msiof1_sync),
  1240. SH_PFC_PIN_GROUP(msiof1_ss1),
  1241. SH_PFC_PIN_GROUP(msiof1_ss2),
  1242. SH_PFC_PIN_GROUP(msiof1_txd),
  1243. SH_PFC_PIN_GROUP(msiof1_rxd),
  1244. SH_PFC_PIN_GROUP(msiof2_clk),
  1245. SH_PFC_PIN_GROUP(msiof2_sync),
  1246. SH_PFC_PIN_GROUP(msiof2_ss1),
  1247. SH_PFC_PIN_GROUP(msiof2_ss2),
  1248. SH_PFC_PIN_GROUP(msiof2_txd),
  1249. SH_PFC_PIN_GROUP(msiof2_rxd),
  1250. SH_PFC_PIN_GROUP(msiof3_clk),
  1251. SH_PFC_PIN_GROUP(msiof3_sync),
  1252. SH_PFC_PIN_GROUP(msiof3_ss1),
  1253. SH_PFC_PIN_GROUP(msiof3_ss2),
  1254. SH_PFC_PIN_GROUP(msiof3_txd),
  1255. SH_PFC_PIN_GROUP(msiof3_rxd),
  1256. SH_PFC_PIN_GROUP(pcie0_clkreq_n),
  1257. SH_PFC_PIN_GROUP(pcie1_clkreq_n),
  1258. SH_PFC_PIN_GROUP(qspi0_ctrl),
  1259. BUS_DATA_PIN_GROUP(qspi0_data, 2),
  1260. BUS_DATA_PIN_GROUP(qspi0_data, 4),
  1261. SH_PFC_PIN_GROUP(qspi1_ctrl),
  1262. BUS_DATA_PIN_GROUP(qspi1_data, 2),
  1263. BUS_DATA_PIN_GROUP(qspi1_data, 4),
  1264. SH_PFC_PIN_GROUP(scif0_data),
  1265. SH_PFC_PIN_GROUP(scif0_clk),
  1266. SH_PFC_PIN_GROUP(scif0_ctrl),
  1267. SH_PFC_PIN_GROUP(scif1_data),
  1268. SH_PFC_PIN_GROUP(scif1_clk),
  1269. SH_PFC_PIN_GROUP(scif1_ctrl),
  1270. SH_PFC_PIN_GROUP(scif3_data),
  1271. SH_PFC_PIN_GROUP(scif3_clk),
  1272. SH_PFC_PIN_GROUP(scif3_ctrl),
  1273. SH_PFC_PIN_GROUP(scif4_data),
  1274. SH_PFC_PIN_GROUP(scif4_clk),
  1275. SH_PFC_PIN_GROUP(scif4_ctrl),
  1276. SH_PFC_PIN_GROUP(scif_clk),
  1277. SH_PFC_PIN_GROUP(tsn0_link_a),
  1278. SH_PFC_PIN_GROUP(tsn0_magic_a),
  1279. SH_PFC_PIN_GROUP(tsn0_phy_int_a),
  1280. SH_PFC_PIN_GROUP(tsn0_mdio_a),
  1281. SH_PFC_PIN_GROUP(tsn0_link_b),
  1282. SH_PFC_PIN_GROUP(tsn0_magic_b),
  1283. SH_PFC_PIN_GROUP(tsn0_phy_int_b),
  1284. SH_PFC_PIN_GROUP(tsn0_mdio_b),
  1285. SH_PFC_PIN_GROUP(tsn0_avtp_pps),
  1286. SH_PFC_PIN_GROUP(tsn0_avtp_capture_a),
  1287. SH_PFC_PIN_GROUP(tsn0_avtp_match_a),
  1288. SH_PFC_PIN_GROUP(tsn0_avtp_capture_b),
  1289. SH_PFC_PIN_GROUP(tsn0_avtp_match_b),
  1290. SH_PFC_PIN_GROUP(tsn1_link_a),
  1291. SH_PFC_PIN_GROUP(tsn1_phy_int_a),
  1292. SH_PFC_PIN_GROUP(tsn1_mdio_a),
  1293. SH_PFC_PIN_GROUP(tsn1_link_b),
  1294. SH_PFC_PIN_GROUP(tsn1_phy_int_b),
  1295. SH_PFC_PIN_GROUP(tsn1_mdio_b),
  1296. SH_PFC_PIN_GROUP(tsn1_avtp_pps),
  1297. SH_PFC_PIN_GROUP(tsn1_avtp_capture_a),
  1298. SH_PFC_PIN_GROUP(tsn1_avtp_match_a),
  1299. SH_PFC_PIN_GROUP(tsn1_avtp_capture_b),
  1300. SH_PFC_PIN_GROUP(tsn1_avtp_match_b),
  1301. SH_PFC_PIN_GROUP(tsn2_link_a),
  1302. SH_PFC_PIN_GROUP(tsn2_phy_int_a),
  1303. SH_PFC_PIN_GROUP(tsn2_mdio_a),
  1304. SH_PFC_PIN_GROUP(tsn2_link_b),
  1305. SH_PFC_PIN_GROUP(tsn2_phy_int_b),
  1306. SH_PFC_PIN_GROUP(tsn2_mdio_b),
  1307. };
  1308. static const char * const hscif0_groups[] = {
  1309. "hscif0_data",
  1310. "hscif0_clk",
  1311. "hscif0_ctrl",
  1312. };
  1313. static const char * const hscif1_groups[] = {
  1314. "hscif1_data",
  1315. "hscif1_clk",
  1316. "hscif1_ctrl",
  1317. };
  1318. static const char * const hscif2_groups[] = {
  1319. "hscif2_data",
  1320. "hscif2_clk",
  1321. "hscif2_ctrl",
  1322. };
  1323. static const char * const hscif3_groups[] = {
  1324. "hscif3_data",
  1325. "hscif3_clk",
  1326. "hscif3_ctrl",
  1327. };
  1328. static const char * const i2c0_groups[] = {
  1329. "i2c0",
  1330. };
  1331. static const char * const i2c1_groups[] = {
  1332. "i2c1",
  1333. };
  1334. static const char * const i2c2_groups[] = {
  1335. "i2c2",
  1336. };
  1337. static const char * const i2c3_groups[] = {
  1338. "i2c3",
  1339. };
  1340. static const char * const i2c4_groups[] = {
  1341. "i2c4",
  1342. };
  1343. static const char * const i2c5_groups[] = {
  1344. "i2c5",
  1345. };
  1346. static const char * const intc_ex_groups[] = {
  1347. "intc_ex_irq0",
  1348. "intc_ex_irq1",
  1349. "intc_ex_irq2",
  1350. "intc_ex_irq3",
  1351. "intc_ex_irq4",
  1352. "intc_ex_irq5",
  1353. };
  1354. static const char * const mmc_groups[] = {
  1355. "mmc_data1",
  1356. "mmc_data4",
  1357. "mmc_data8",
  1358. "mmc_ctrl",
  1359. "mmc_cd",
  1360. "mmc_wp",
  1361. "mmc_ds",
  1362. };
  1363. static const char * const msiof0_groups[] = {
  1364. "msiof0_clk",
  1365. "msiof0_sync",
  1366. "msiof0_ss1",
  1367. "msiof0_ss2",
  1368. "msiof0_txd",
  1369. "msiof0_rxd",
  1370. };
  1371. static const char * const msiof1_groups[] = {
  1372. "msiof1_clk",
  1373. "msiof1_sync",
  1374. "msiof1_ss1",
  1375. "msiof1_ss2",
  1376. "msiof1_txd",
  1377. "msiof1_rxd",
  1378. };
  1379. static const char * const msiof2_groups[] = {
  1380. "msiof2_clk",
  1381. "msiof2_sync",
  1382. "msiof2_ss1",
  1383. "msiof2_ss2",
  1384. "msiof2_txd",
  1385. "msiof2_rxd",
  1386. };
  1387. static const char * const msiof3_groups[] = {
  1388. "msiof3_clk",
  1389. "msiof3_sync",
  1390. "msiof3_ss1",
  1391. "msiof3_ss2",
  1392. "msiof3_txd",
  1393. "msiof3_rxd",
  1394. };
  1395. static const char * const pcie_groups[] = {
  1396. "pcie0_clkreq_n",
  1397. "pcie1_clkreq_n",
  1398. };
  1399. static const char * const qspi0_groups[] = {
  1400. "qspi0_ctrl",
  1401. "qspi0_data2",
  1402. "qspi0_data4",
  1403. };
  1404. static const char * const qspi1_groups[] = {
  1405. "qspi1_ctrl",
  1406. "qspi1_data2",
  1407. "qspi1_data4",
  1408. };
  1409. static const char * const scif0_groups[] = {
  1410. "scif0_data",
  1411. "scif0_clk",
  1412. "scif0_ctrl",
  1413. };
  1414. static const char * const scif1_groups[] = {
  1415. "scif1_data",
  1416. "scif1_clk",
  1417. "scif1_ctrl",
  1418. };
  1419. static const char * const scif3_groups[] = {
  1420. "scif3_data",
  1421. "scif3_clk",
  1422. "scif3_ctrl",
  1423. };
  1424. static const char * const scif4_groups[] = {
  1425. "scif4_data",
  1426. "scif4_clk",
  1427. "scif4_ctrl",
  1428. };
  1429. static const char * const scif_clk_groups[] = {
  1430. "scif_clk",
  1431. };
  1432. static const char * const tsn0_groups[] = {
  1433. "tsn0_link_a",
  1434. "tsn0_magic_a",
  1435. "tsn0_phy_int_a",
  1436. "tsn0_mdio_a",
  1437. "tsn0_link_b",
  1438. "tsn0_magic_b",
  1439. "tsn0_phy_int_b",
  1440. "tsn0_mdio_b",
  1441. "tsn0_avtp_pps",
  1442. "tsn0_avtp_capture_a",
  1443. "tsn0_avtp_match_a",
  1444. "tsn0_avtp_capture_b",
  1445. "tsn0_avtp_match_b",
  1446. };
  1447. static const char * const tsn1_groups[] = {
  1448. "tsn1_link_a",
  1449. "tsn1_phy_int_a",
  1450. "tsn1_mdio_a",
  1451. "tsn1_link_b",
  1452. "tsn1_phy_int_b",
  1453. "tsn1_mdio_b",
  1454. "tsn1_avtp_pps",
  1455. "tsn1_avtp_capture_a",
  1456. "tsn1_avtp_match_a",
  1457. "tsn1_avtp_capture_b",
  1458. "tsn1_avtp_match_b",
  1459. };
  1460. static const char * const tsn2_groups[] = {
  1461. "tsn2_link_a",
  1462. "tsn2_phy_int_a",
  1463. "tsn2_mdio_a",
  1464. "tsn2_link_b",
  1465. "tsn2_phy_int_b",
  1466. "tsn2_mdio_b",
  1467. };
  1468. static const struct sh_pfc_function pinmux_functions[] = {
  1469. SH_PFC_FUNCTION(hscif0),
  1470. SH_PFC_FUNCTION(hscif1),
  1471. SH_PFC_FUNCTION(hscif2),
  1472. SH_PFC_FUNCTION(hscif3),
  1473. SH_PFC_FUNCTION(i2c0),
  1474. SH_PFC_FUNCTION(i2c1),
  1475. SH_PFC_FUNCTION(i2c2),
  1476. SH_PFC_FUNCTION(i2c3),
  1477. SH_PFC_FUNCTION(i2c4),
  1478. SH_PFC_FUNCTION(i2c5),
  1479. SH_PFC_FUNCTION(intc_ex),
  1480. SH_PFC_FUNCTION(mmc),
  1481. SH_PFC_FUNCTION(msiof0),
  1482. SH_PFC_FUNCTION(msiof1),
  1483. SH_PFC_FUNCTION(msiof2),
  1484. SH_PFC_FUNCTION(msiof3),
  1485. SH_PFC_FUNCTION(pcie),
  1486. SH_PFC_FUNCTION(qspi0),
  1487. SH_PFC_FUNCTION(qspi1),
  1488. SH_PFC_FUNCTION(scif0),
  1489. SH_PFC_FUNCTION(scif1),
  1490. SH_PFC_FUNCTION(scif3),
  1491. SH_PFC_FUNCTION(scif4),
  1492. SH_PFC_FUNCTION(scif_clk),
  1493. SH_PFC_FUNCTION(tsn0),
  1494. SH_PFC_FUNCTION(tsn1),
  1495. SH_PFC_FUNCTION(tsn2),
  1496. };
  1497. static const struct pinmux_cfg_reg pinmux_config_regs[] = {
  1498. #define F_(x, y) FN_##y
  1499. #define FM(x) FN_##x
  1500. { PINMUX_CFG_REG_VAR("GPSR0", 0xe6050040, 32,
  1501. GROUP(-11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1502. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  1503. GROUP(
  1504. /* GP0_31_21 RESERVED */
  1505. GP_0_20_FN, GPSR0_20,
  1506. GP_0_19_FN, GPSR0_19,
  1507. GP_0_18_FN, GPSR0_18,
  1508. GP_0_17_FN, GPSR0_17,
  1509. GP_0_16_FN, GPSR0_16,
  1510. GP_0_15_FN, GPSR0_15,
  1511. GP_0_14_FN, GPSR0_14,
  1512. GP_0_13_FN, GPSR0_13,
  1513. GP_0_12_FN, GPSR0_12,
  1514. GP_0_11_FN, GPSR0_11,
  1515. GP_0_10_FN, GPSR0_10,
  1516. GP_0_9_FN, GPSR0_9,
  1517. GP_0_8_FN, GPSR0_8,
  1518. GP_0_7_FN, GPSR0_7,
  1519. GP_0_6_FN, GPSR0_6,
  1520. GP_0_5_FN, GPSR0_5,
  1521. GP_0_4_FN, GPSR0_4,
  1522. GP_0_3_FN, GPSR0_3,
  1523. GP_0_2_FN, GPSR0_2,
  1524. GP_0_1_FN, GPSR0_1,
  1525. GP_0_0_FN, GPSR0_0, ))
  1526. },
  1527. { PINMUX_CFG_REG_VAR("GPSR1", 0xe6050840, 32,
  1528. GROUP(-7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1529. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  1530. GROUP(
  1531. /* GP1_31_25 RESERVED */
  1532. GP_1_24_FN, GPSR1_24,
  1533. GP_1_23_FN, GPSR1_23,
  1534. GP_1_22_FN, GPSR1_22,
  1535. GP_1_21_FN, GPSR1_21,
  1536. GP_1_20_FN, GPSR1_20,
  1537. GP_1_19_FN, GPSR1_19,
  1538. GP_1_18_FN, GPSR1_18,
  1539. GP_1_17_FN, GPSR1_17,
  1540. GP_1_16_FN, GPSR1_16,
  1541. GP_1_15_FN, GPSR1_15,
  1542. GP_1_14_FN, GPSR1_14,
  1543. GP_1_13_FN, GPSR1_13,
  1544. GP_1_12_FN, GPSR1_12,
  1545. GP_1_11_FN, GPSR1_11,
  1546. GP_1_10_FN, GPSR1_10,
  1547. GP_1_9_FN, GPSR1_9,
  1548. GP_1_8_FN, GPSR1_8,
  1549. GP_1_7_FN, GPSR1_7,
  1550. GP_1_6_FN, GPSR1_6,
  1551. GP_1_5_FN, GPSR1_5,
  1552. GP_1_4_FN, GPSR1_4,
  1553. GP_1_3_FN, GPSR1_3,
  1554. GP_1_2_FN, GPSR1_2,
  1555. GP_1_1_FN, GPSR1_1,
  1556. GP_1_0_FN, GPSR1_0, ))
  1557. },
  1558. { PINMUX_CFG_REG_VAR("GPSR2", 0xe6051040, 32,
  1559. GROUP(-15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1560. 1, 1, 1, 1, 1, 1),
  1561. GROUP(
  1562. /* GP2_31_17 RESERVED */
  1563. GP_2_16_FN, GPSR2_16,
  1564. GP_2_15_FN, GPSR2_15,
  1565. GP_2_14_FN, GPSR2_14,
  1566. GP_2_13_FN, GPSR2_13,
  1567. GP_2_12_FN, GPSR2_12,
  1568. GP_2_11_FN, GPSR2_11,
  1569. GP_2_10_FN, GPSR2_10,
  1570. GP_2_9_FN, GPSR2_9,
  1571. GP_2_8_FN, GPSR2_8,
  1572. GP_2_7_FN, GPSR2_7,
  1573. GP_2_6_FN, GPSR2_6,
  1574. GP_2_5_FN, GPSR2_5,
  1575. GP_2_4_FN, GPSR2_4,
  1576. GP_2_3_FN, GPSR2_3,
  1577. GP_2_2_FN, GPSR2_2,
  1578. GP_2_1_FN, GPSR2_1,
  1579. GP_2_0_FN, GPSR2_0, ))
  1580. },
  1581. { PINMUX_CFG_REG_VAR("GPSR3", 0xe6051840, 32,
  1582. GROUP(-13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1583. 1, 1, 1, 1, 1, 1, 1, 1),
  1584. GROUP(
  1585. /* GP3_31_19 RESERVED */
  1586. GP_3_18_FN, GPSR3_18,
  1587. GP_3_17_FN, GPSR3_17,
  1588. GP_3_16_FN, GPSR3_16,
  1589. GP_3_15_FN, GPSR3_15,
  1590. GP_3_14_FN, GPSR3_14,
  1591. GP_3_13_FN, GPSR3_13,
  1592. GP_3_12_FN, GPSR3_12,
  1593. GP_3_11_FN, GPSR3_11,
  1594. GP_3_10_FN, GPSR3_10,
  1595. GP_3_9_FN, GPSR3_9,
  1596. GP_3_8_FN, GPSR3_8,
  1597. GP_3_7_FN, GPSR3_7,
  1598. GP_3_6_FN, GPSR3_6,
  1599. GP_3_5_FN, GPSR3_5,
  1600. GP_3_4_FN, GPSR3_4,
  1601. GP_3_3_FN, GPSR3_3,
  1602. GP_3_2_FN, GPSR3_2,
  1603. GP_3_1_FN, GPSR3_1,
  1604. GP_3_0_FN, GPSR3_0, ))
  1605. },
  1606. #undef F_
  1607. #undef FM
  1608. #define F_(x, y) x,
  1609. #define FM(x) FN_##x,
  1610. { PINMUX_CFG_REG("IP0SR0", 0xe6050060, 32, 4, GROUP(
  1611. IP0SR0_31_28
  1612. IP0SR0_27_24
  1613. IP0SR0_23_20
  1614. IP0SR0_19_16
  1615. IP0SR0_15_12
  1616. IP0SR0_11_8
  1617. IP0SR0_7_4
  1618. IP0SR0_3_0))
  1619. },
  1620. { PINMUX_CFG_REG("IP1SR0", 0xe6050064, 32, 4, GROUP(
  1621. IP1SR0_31_28
  1622. IP1SR0_27_24
  1623. IP1SR0_23_20
  1624. IP1SR0_19_16
  1625. IP1SR0_15_12
  1626. IP1SR0_11_8
  1627. IP1SR0_7_4
  1628. IP1SR0_3_0))
  1629. },
  1630. { PINMUX_CFG_REG_VAR("IP2SR0", 0xe6050068, 32,
  1631. GROUP(-12, 4, 4, 4, 4, 4),
  1632. GROUP(
  1633. /* IP2SR0_31_20 RESERVED */
  1634. IP2SR0_19_16
  1635. IP2SR0_15_12
  1636. IP2SR0_11_8
  1637. IP2SR0_7_4
  1638. IP2SR0_3_0))
  1639. },
  1640. { PINMUX_CFG_REG("IP0SR1", 0xe6050860, 32, 4, GROUP(
  1641. IP0SR1_31_28
  1642. IP0SR1_27_24
  1643. IP0SR1_23_20
  1644. IP0SR1_19_16
  1645. IP0SR1_15_12
  1646. IP0SR1_11_8
  1647. IP0SR1_7_4
  1648. IP0SR1_3_0))
  1649. },
  1650. #undef F_
  1651. #undef FM
  1652. #define F_(x, y) x,
  1653. #define FM(x) FN_##x,
  1654. { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6050900, 32,
  1655. GROUP(-20, 2, 2, 2, 2, 2, 2),
  1656. GROUP(
  1657. /* RESERVED 31-12 */
  1658. MOD_SEL1_11_10
  1659. MOD_SEL1_9_8
  1660. MOD_SEL1_7_6
  1661. MOD_SEL1_5_4
  1662. MOD_SEL1_3_2
  1663. MOD_SEL1_1_0))
  1664. },
  1665. { /* sentinel */ },
  1666. };
  1667. static const struct pinmux_drive_reg pinmux_drive_regs[] = {
  1668. { PINMUX_DRIVE_REG("DRV0CTRL0", 0xe6050080) {
  1669. { RCAR_GP_PIN(0, 7), 28, 3 }, /* TX0 */
  1670. { RCAR_GP_PIN(0, 6), 24, 3 }, /* RX0 */
  1671. { RCAR_GP_PIN(0, 5), 20, 3 }, /* HRTS0_N */
  1672. { RCAR_GP_PIN(0, 4), 16, 3 }, /* HCTS0_N */
  1673. { RCAR_GP_PIN(0, 3), 12, 3 }, /* HTX0 */
  1674. { RCAR_GP_PIN(0, 2), 8, 3 }, /* HRX0 */
  1675. { RCAR_GP_PIN(0, 1), 4, 3 }, /* HSCK0 */
  1676. { RCAR_GP_PIN(0, 0), 0, 3 }, /* SCIF_CLK */
  1677. } },
  1678. { PINMUX_DRIVE_REG("DRV1CTRL0", 0xe6050084) {
  1679. { RCAR_GP_PIN(0, 15), 28, 3 }, /* MSIOF0_SS1 */
  1680. { RCAR_GP_PIN(0, 14), 24, 3 }, /* MSIOF0_SCK */
  1681. { RCAR_GP_PIN(0, 13), 20, 3 }, /* MSIOF0_TXD */
  1682. { RCAR_GP_PIN(0, 12), 16, 3 }, /* MSIOF0_RXD */
  1683. { RCAR_GP_PIN(0, 11), 12, 3 }, /* MSIOF0_SYNC */
  1684. { RCAR_GP_PIN(0, 10), 8, 3 }, /* CTS0_N */
  1685. { RCAR_GP_PIN(0, 9), 4, 3 }, /* RTS0_N */
  1686. { RCAR_GP_PIN(0, 8), 0, 3 }, /* SCK0 */
  1687. } },
  1688. { PINMUX_DRIVE_REG("DRV2CTRL0", 0xe6050088) {
  1689. { RCAR_GP_PIN(0, 20), 16, 3 }, /* IRQ3 */
  1690. { RCAR_GP_PIN(0, 19), 12, 3 }, /* IRQ2 */
  1691. { RCAR_GP_PIN(0, 18), 8, 3 }, /* IRQ1 */
  1692. { RCAR_GP_PIN(0, 17), 4, 3 }, /* IRQ0 */
  1693. { RCAR_GP_PIN(0, 16), 0, 3 }, /* MSIOF0_SS2 */
  1694. } },
  1695. { PINMUX_DRIVE_REG("DRV0CTRL1", 0xe6050880) {
  1696. { RCAR_GP_PIN(1, 7), 28, 3 }, /* GP1_07 */
  1697. { RCAR_GP_PIN(1, 6), 24, 3 }, /* GP1_06 */
  1698. { RCAR_GP_PIN(1, 5), 20, 3 }, /* GP1_05 */
  1699. { RCAR_GP_PIN(1, 4), 16, 3 }, /* GP1_04 */
  1700. { RCAR_GP_PIN(1, 3), 12, 3 }, /* GP1_03 */
  1701. { RCAR_GP_PIN(1, 2), 8, 3 }, /* GP1_02 */
  1702. { RCAR_GP_PIN(1, 1), 4, 3 }, /* GP1_01 */
  1703. { RCAR_GP_PIN(1, 0), 0, 3 }, /* GP1_00 */
  1704. } },
  1705. { PINMUX_DRIVE_REG("DRV1CTRL1", 0xe6050884) {
  1706. { RCAR_GP_PIN(1, 15), 28, 3 }, /* MMC_SD_D2 */
  1707. { RCAR_GP_PIN(1, 14), 24, 3 }, /* MMC_SD_D1 */
  1708. { RCAR_GP_PIN(1, 13), 20, 3 }, /* MMC_SD_D0 */
  1709. { RCAR_GP_PIN(1, 12), 16, 3 }, /* MMC_SD_CLK */
  1710. { RCAR_GP_PIN(1, 11), 12, 3 }, /* GP1_11 */
  1711. { RCAR_GP_PIN(1, 10), 8, 3 }, /* GP1_10 */
  1712. { RCAR_GP_PIN(1, 9), 4, 3 }, /* GP1_09 */
  1713. { RCAR_GP_PIN(1, 8), 0, 3 }, /* GP1_08 */
  1714. } },
  1715. { PINMUX_DRIVE_REG("DRV2CTRL1", 0xe6050888) {
  1716. { RCAR_GP_PIN(1, 23), 28, 3 }, /* SD_CD */
  1717. { RCAR_GP_PIN(1, 22), 24, 3 }, /* MMC_SD_CMD */
  1718. { RCAR_GP_PIN(1, 21), 20, 3 }, /* MMC_D7 */
  1719. { RCAR_GP_PIN(1, 20), 16, 3 }, /* MMC_DS */
  1720. { RCAR_GP_PIN(1, 19), 12, 3 }, /* MMC_D6 */
  1721. { RCAR_GP_PIN(1, 18), 8, 3 }, /* MMC_D4 */
  1722. { RCAR_GP_PIN(1, 17), 4, 3 }, /* MMC_D5 */
  1723. { RCAR_GP_PIN(1, 16), 0, 3 }, /* MMC_SD_D3 */
  1724. } },
  1725. { PINMUX_DRIVE_REG("DRV3CTRL1", 0xe605088c) {
  1726. { RCAR_GP_PIN(1, 24), 0, 3 }, /* SD_WP */
  1727. } },
  1728. { PINMUX_DRIVE_REG("DRV0CTRL2", 0xe6051080) {
  1729. { RCAR_GP_PIN(2, 7), 28, 2 }, /* QSPI1_MOSI_IO0 */
  1730. { RCAR_GP_PIN(2, 6), 24, 2 }, /* QSPI1_IO2 */
  1731. { RCAR_GP_PIN(2, 5), 20, 2 }, /* QSPI1_MISO_IO1 */
  1732. { RCAR_GP_PIN(2, 4), 16, 2 }, /* QSPI1_IO3 */
  1733. { RCAR_GP_PIN(2, 3), 12, 2 }, /* QSPI1_SSL */
  1734. { RCAR_GP_PIN(2, 2), 8, 2 }, /* RPC_RESET_N */
  1735. { RCAR_GP_PIN(2, 1), 4, 2 }, /* RPC_WP_N */
  1736. { RCAR_GP_PIN(2, 0), 0, 2 }, /* RPC_INT_N */
  1737. } },
  1738. { PINMUX_DRIVE_REG("DRV1CTRL2", 0xe6051084) {
  1739. { RCAR_GP_PIN(2, 15), 28, 3 }, /* PCIE0_CLKREQ_N */
  1740. { RCAR_GP_PIN(2, 14), 24, 2 }, /* QSPI0_IO3 */
  1741. { RCAR_GP_PIN(2, 13), 20, 2 }, /* QSPI0_SSL */
  1742. { RCAR_GP_PIN(2, 12), 16, 2 }, /* QSPI0_MISO_IO1 */
  1743. { RCAR_GP_PIN(2, 11), 12, 2 }, /* QSPI0_IO2 */
  1744. { RCAR_GP_PIN(2, 10), 8, 2 }, /* QSPI0_SPCLK */
  1745. { RCAR_GP_PIN(2, 9), 4, 2 }, /* QSPI0_MOSI_IO0 */
  1746. { RCAR_GP_PIN(2, 8), 0, 2 }, /* QSPI1_SPCLK */
  1747. } },
  1748. { PINMUX_DRIVE_REG("DRV2CTRL2", 0xe6051088) {
  1749. { RCAR_GP_PIN(2, 16), 0, 3 }, /* PCIE1_CLKREQ_N */
  1750. } },
  1751. { PINMUX_DRIVE_REG("DRV0CTRL3", 0xe6051880) {
  1752. { RCAR_GP_PIN(3, 7), 28, 3 }, /* TSN2_LINK_B */
  1753. { RCAR_GP_PIN(3, 6), 24, 3 }, /* TSN1_LINK_B */
  1754. { RCAR_GP_PIN(3, 5), 20, 3 }, /* TSN1_MDC_B */
  1755. { RCAR_GP_PIN(3, 4), 16, 3 }, /* TSN0_MDC_B */
  1756. { RCAR_GP_PIN(3, 3), 12, 3 }, /* TSN2_MDC_B */
  1757. { RCAR_GP_PIN(3, 2), 8, 3 }, /* TSN0_MDIO_B */
  1758. { RCAR_GP_PIN(3, 1), 4, 3 }, /* TSN2_MDIO_B */
  1759. { RCAR_GP_PIN(3, 0), 0, 3 }, /* TSN1_MDIO_B */
  1760. } },
  1761. { PINMUX_DRIVE_REG("DRV1CTRL3", 0xe6051884) {
  1762. { RCAR_GP_PIN(3, 15), 28, 3 }, /* TSN1_AVTP_CAPTURE_B */
  1763. { RCAR_GP_PIN(3, 14), 24, 3 }, /* TSN1_AVTP_MATCH_B */
  1764. { RCAR_GP_PIN(3, 13), 20, 3 }, /* TSN1_AVTP_PPS */
  1765. { RCAR_GP_PIN(3, 12), 16, 3 }, /* TSN0_MAGIC_B */
  1766. { RCAR_GP_PIN(3, 11), 12, 3 }, /* TSN1_PHY_INT_B */
  1767. { RCAR_GP_PIN(3, 10), 8, 3 }, /* TSN0_PHY_INT_B */
  1768. { RCAR_GP_PIN(3, 9), 4, 3 }, /* TSN2_PHY_INT_B */
  1769. { RCAR_GP_PIN(3, 8), 0, 3 }, /* TSN0_LINK_B */
  1770. } },
  1771. { PINMUX_DRIVE_REG("DRV2CTRL3", 0xe6051888) {
  1772. { RCAR_GP_PIN(3, 18), 8, 3 }, /* TSN0_AVTP_CAPTURE_B */
  1773. { RCAR_GP_PIN(3, 17), 4, 3 }, /* TSN0_AVTP_MATCH_B */
  1774. { RCAR_GP_PIN(3, 16), 0, 3 }, /* TSN0_AVTP_PPS */
  1775. } },
  1776. { /* sentinel */ },
  1777. };
  1778. enum ioctrl_regs {
  1779. POC0,
  1780. POC1,
  1781. POC3,
  1782. TD0SEL1,
  1783. };
  1784. static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
  1785. [POC0] = { 0xe60500a0, },
  1786. [POC1] = { 0xe60508a0, },
  1787. [POC3] = { 0xe60518a0, },
  1788. [TD0SEL1] = { 0xe6050920, },
  1789. { /* sentinel */ },
  1790. };
  1791. static int r8a779f0_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
  1792. {
  1793. int bit = pin & 0x1f;
  1794. *pocctrl = pinmux_ioctrl_regs[POC0].reg;
  1795. if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 20))
  1796. return bit;
  1797. *pocctrl = pinmux_ioctrl_regs[POC1].reg;
  1798. if (pin >= RCAR_GP_PIN(1, 0) && pin <= RCAR_GP_PIN(1, 24))
  1799. return bit;
  1800. *pocctrl = pinmux_ioctrl_regs[POC3].reg;
  1801. if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 18))
  1802. return bit;
  1803. return -EINVAL;
  1804. }
  1805. static const struct pinmux_bias_reg pinmux_bias_regs[] = {
  1806. { PINMUX_BIAS_REG("PUEN0", 0xe60500c0, "PUD0", 0xe60500e0) {
  1807. [ 0] = RCAR_GP_PIN(0, 0), /* SCIF_CLK */
  1808. [ 1] = RCAR_GP_PIN(0, 1), /* HSCK0 */
  1809. [ 2] = RCAR_GP_PIN(0, 2), /* HRX0 */
  1810. [ 3] = RCAR_GP_PIN(0, 3), /* HTX0 */
  1811. [ 4] = RCAR_GP_PIN(0, 4), /* HCTS0_N */
  1812. [ 5] = RCAR_GP_PIN(0, 5), /* HRTS0_N */
  1813. [ 6] = RCAR_GP_PIN(0, 6), /* RX0 */
  1814. [ 7] = RCAR_GP_PIN(0, 7), /* TX0 */
  1815. [ 8] = RCAR_GP_PIN(0, 8), /* SCK0 */
  1816. [ 9] = RCAR_GP_PIN(0, 9), /* RTS0_N */
  1817. [10] = RCAR_GP_PIN(0, 10), /* CTS0_N */
  1818. [11] = RCAR_GP_PIN(0, 11), /* MSIOF0_SYNC */
  1819. [12] = RCAR_GP_PIN(0, 12), /* MSIOF0_RXD */
  1820. [13] = RCAR_GP_PIN(0, 13), /* MSIOF0_TXD */
  1821. [14] = RCAR_GP_PIN(0, 14), /* MSIOF0_SCK */
  1822. [15] = RCAR_GP_PIN(0, 15), /* MSIOF0_SS1 */
  1823. [16] = RCAR_GP_PIN(0, 16), /* MSIOF0_SS2 */
  1824. [17] = RCAR_GP_PIN(0, 17), /* IRQ0 */
  1825. [18] = RCAR_GP_PIN(0, 18), /* IRQ1 */
  1826. [19] = RCAR_GP_PIN(0, 19), /* IRQ2 */
  1827. [20] = RCAR_GP_PIN(0, 20), /* IRQ3 */
  1828. [21] = SH_PFC_PIN_NONE,
  1829. [22] = SH_PFC_PIN_NONE,
  1830. [23] = SH_PFC_PIN_NONE,
  1831. [24] = SH_PFC_PIN_NONE,
  1832. [25] = SH_PFC_PIN_NONE,
  1833. [26] = SH_PFC_PIN_NONE,
  1834. [27] = SH_PFC_PIN_NONE,
  1835. [28] = SH_PFC_PIN_NONE,
  1836. [29] = SH_PFC_PIN_NONE,
  1837. [30] = SH_PFC_PIN_NONE,
  1838. [31] = SH_PFC_PIN_NONE,
  1839. } },
  1840. { PINMUX_BIAS_REG("PUEN1", 0xe60508c0, "PUD1", 0xe60508e0) {
  1841. [ 0] = RCAR_GP_PIN(1, 0), /* GP1_00 */
  1842. [ 1] = RCAR_GP_PIN(1, 1), /* GP1_01 */
  1843. [ 2] = RCAR_GP_PIN(1, 2), /* GP1_02 */
  1844. [ 3] = RCAR_GP_PIN(1, 3), /* GP1_03 */
  1845. [ 4] = RCAR_GP_PIN(1, 4), /* GP1_04 */
  1846. [ 5] = RCAR_GP_PIN(1, 5), /* GP1_05 */
  1847. [ 6] = RCAR_GP_PIN(1, 6), /* GP1_06 */
  1848. [ 7] = RCAR_GP_PIN(1, 7), /* GP1_07 */
  1849. [ 8] = RCAR_GP_PIN(1, 8), /* GP1_08 */
  1850. [ 9] = RCAR_GP_PIN(1, 9), /* GP1_09 */
  1851. [10] = RCAR_GP_PIN(1, 10), /* GP1_10 */
  1852. [11] = RCAR_GP_PIN(1, 11), /* GP1_11 */
  1853. [12] = RCAR_GP_PIN(1, 12), /* MMC_SD_CLK */
  1854. [13] = RCAR_GP_PIN(1, 13), /* MMC_SD_D0 */
  1855. [14] = RCAR_GP_PIN(1, 14), /* MMC_SD_D1 */
  1856. [15] = RCAR_GP_PIN(1, 15), /* MMC_SD_D2 */
  1857. [16] = RCAR_GP_PIN(1, 16), /* MMC_SD_D3 */
  1858. [17] = RCAR_GP_PIN(1, 17), /* MMC_D5 */
  1859. [18] = RCAR_GP_PIN(1, 18), /* MMC_D4 */
  1860. [19] = RCAR_GP_PIN(1, 19), /* MMC_D6 */
  1861. [20] = RCAR_GP_PIN(1, 20), /* MMC_DS */
  1862. [21] = RCAR_GP_PIN(1, 21), /* MMC_D7 */
  1863. [22] = RCAR_GP_PIN(1, 22), /* MMC_SD_CMD */
  1864. [23] = RCAR_GP_PIN(1, 23), /* SD_CD */
  1865. [24] = RCAR_GP_PIN(1, 24), /* SD_WP */
  1866. [25] = SH_PFC_PIN_NONE,
  1867. [26] = SH_PFC_PIN_NONE,
  1868. [27] = SH_PFC_PIN_NONE,
  1869. [28] = SH_PFC_PIN_NONE,
  1870. [29] = SH_PFC_PIN_NONE,
  1871. [30] = SH_PFC_PIN_NONE,
  1872. [31] = SH_PFC_PIN_NONE,
  1873. } },
  1874. { PINMUX_BIAS_REG("PUEN2", 0xe60510c0, "PUD2", 0xe60510e0) {
  1875. [ 0] = RCAR_GP_PIN(2, 0), /* RPC_INT_N */
  1876. [ 1] = RCAR_GP_PIN(2, 1), /* RPC_WP_N */
  1877. [ 2] = RCAR_GP_PIN(2, 2), /* RPC_RESET_N */
  1878. [ 3] = RCAR_GP_PIN(2, 3), /* QSPI1_SSL */
  1879. [ 4] = RCAR_GP_PIN(2, 4), /* QSPI1_IO3 */
  1880. [ 5] = RCAR_GP_PIN(2, 5), /* QSPI1_MISO_IO1 */
  1881. [ 6] = RCAR_GP_PIN(2, 6), /* QSPI1_IO2 */
  1882. [ 7] = RCAR_GP_PIN(2, 7), /* QSPI1_MOSI_IO0 */
  1883. [ 8] = RCAR_GP_PIN(2, 8), /* QSPI1_SPCLK */
  1884. [ 9] = RCAR_GP_PIN(2, 9), /* QSPI0_MOSI_IO0 */
  1885. [10] = RCAR_GP_PIN(2, 10), /* QSPI0_SPCLK */
  1886. [11] = RCAR_GP_PIN(2, 11), /* QSPI0_IO2 */
  1887. [12] = RCAR_GP_PIN(2, 12), /* QSPI0_MISO_IO1 */
  1888. [13] = RCAR_GP_PIN(2, 13), /* QSPI0_SSL */
  1889. [14] = RCAR_GP_PIN(2, 14), /* QSPI0_IO3 */
  1890. [15] = RCAR_GP_PIN(2, 15), /* PCIE0_CLKREQ_N */
  1891. [16] = RCAR_GP_PIN(2, 16), /* PCIE1_CLKREQ_N */
  1892. [17] = SH_PFC_PIN_NONE,
  1893. [18] = SH_PFC_PIN_NONE,
  1894. [19] = SH_PFC_PIN_NONE,
  1895. [20] = SH_PFC_PIN_NONE,
  1896. [21] = SH_PFC_PIN_NONE,
  1897. [22] = SH_PFC_PIN_NONE,
  1898. [23] = SH_PFC_PIN_NONE,
  1899. [24] = SH_PFC_PIN_NONE,
  1900. [25] = SH_PFC_PIN_NONE,
  1901. [26] = SH_PFC_PIN_NONE,
  1902. [27] = SH_PFC_PIN_NONE,
  1903. [28] = SH_PFC_PIN_NONE,
  1904. [29] = SH_PFC_PIN_NONE,
  1905. [30] = SH_PFC_PIN_NONE,
  1906. [31] = SH_PFC_PIN_NONE,
  1907. } },
  1908. { PINMUX_BIAS_REG("PUEN3", 0xe60518c0, "PUD3", 0xe60518e0) {
  1909. [ 0] = RCAR_GP_PIN(3, 0), /* TSN1_MDIO_B */
  1910. [ 1] = RCAR_GP_PIN(3, 1), /* TSN2_MDIO_B */
  1911. [ 2] = RCAR_GP_PIN(3, 2), /* TSN0_MDIO_B */
  1912. [ 3] = RCAR_GP_PIN(3, 3), /* TSN2_MDC_B */
  1913. [ 4] = RCAR_GP_PIN(3, 4), /* TSN0_MDC_B */
  1914. [ 5] = RCAR_GP_PIN(3, 5), /* TSN1_MDC_B */
  1915. [ 6] = RCAR_GP_PIN(3, 6), /* TSN1_LINK_B */
  1916. [ 7] = RCAR_GP_PIN(3, 7), /* TSN2_LINK_B */
  1917. [ 8] = RCAR_GP_PIN(3, 8), /* TSN0_LINK_B */
  1918. [ 9] = RCAR_GP_PIN(3, 9), /* TSN2_PHY_INT_B */
  1919. [10] = RCAR_GP_PIN(3, 10), /* TSN0_PHY_INT_B */
  1920. [11] = RCAR_GP_PIN(3, 11), /* TSN1_PHY_INT_B */
  1921. [12] = RCAR_GP_PIN(3, 12), /* TSN0_MAGIC_B */
  1922. [13] = RCAR_GP_PIN(3, 13), /* TSN1_AVTP_PPS */
  1923. [14] = RCAR_GP_PIN(3, 14), /* TSN1_AVTP_MATCH_B */
  1924. [15] = RCAR_GP_PIN(3, 15), /* TSN1_AVTP_CAPTURE_B */
  1925. [16] = RCAR_GP_PIN(3, 16), /* TSN0_AVTP_PPS */
  1926. [17] = RCAR_GP_PIN(3, 17), /* TSN0_AVTP_MATCH_B */
  1927. [18] = RCAR_GP_PIN(3, 18), /* TSN0_AVTP_CAPTURE_B */
  1928. [19] = SH_PFC_PIN_NONE,
  1929. [20] = SH_PFC_PIN_NONE,
  1930. [21] = SH_PFC_PIN_NONE,
  1931. [22] = SH_PFC_PIN_NONE,
  1932. [23] = SH_PFC_PIN_NONE,
  1933. [24] = SH_PFC_PIN_NONE,
  1934. [25] = SH_PFC_PIN_NONE,
  1935. [26] = SH_PFC_PIN_NONE,
  1936. [27] = SH_PFC_PIN_NONE,
  1937. [28] = SH_PFC_PIN_NONE,
  1938. [29] = SH_PFC_PIN_NONE,
  1939. [30] = SH_PFC_PIN_NONE,
  1940. [31] = SH_PFC_PIN_NONE,
  1941. } },
  1942. { /* sentinel */ },
  1943. };
  1944. static const struct sh_pfc_soc_operations r8a779f0_pfc_ops = {
  1945. .pin_to_pocctrl = r8a779f0_pin_to_pocctrl,
  1946. .get_bias = rcar_pinmux_get_bias,
  1947. .set_bias = rcar_pinmux_set_bias,
  1948. };
  1949. const struct sh_pfc_soc_info r8a779f0_pinmux_info = {
  1950. .name = "r8a779f0_pfc",
  1951. .ops = &r8a779f0_pfc_ops,
  1952. .unlock_reg = 0x1ff, /* PMMRn mask */
  1953. .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
  1954. .pins = pinmux_pins,
  1955. .nr_pins = ARRAY_SIZE(pinmux_pins),
  1956. .groups = pinmux_groups,
  1957. .nr_groups = ARRAY_SIZE(pinmux_groups),
  1958. .functions = pinmux_functions,
  1959. .nr_functions = ARRAY_SIZE(pinmux_functions),
  1960. .cfg_regs = pinmux_config_regs,
  1961. .drive_regs = pinmux_drive_regs,
  1962. .bias_regs = pinmux_bias_regs,
  1963. .ioctrl_regs = pinmux_ioctrl_regs,
  1964. .pinmux_data = pinmux_data,
  1965. .pinmux_data_size = ARRAY_SIZE(pinmux_data),
  1966. };