pfc-r8a77970.c 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * R8A77970 processor support - PFC hardware block.
  4. *
  5. * Copyright (C) 2016 Renesas Electronics Corp.
  6. * Copyright (C) 2017 Cogent Embedded, Inc. <[email protected]>
  7. *
  8. * This file is based on the drivers/pinctrl/renesas/pfc-r8a7795.c
  9. *
  10. * R-Car Gen3 processor support - PFC hardware block.
  11. *
  12. * Copyright (C) 2015 Renesas Electronics Corporation
  13. */
  14. #include <linux/errno.h>
  15. #include <linux/io.h>
  16. #include <linux/kernel.h>
  17. #include "sh_pfc.h"
  18. #define CPU_ALL_GP(fn, sfx) \
  19. PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE | SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  20. PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  21. PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE | SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  22. PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE | SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  23. PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  24. PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_PULL_UP_DOWN)
  25. #define CPU_ALL_NOGP(fn) \
  26. PIN_NOGP_CFG(DU_DOTCLKIN, "DU_DOTCLKIN", fn, SH_PFC_PIN_CFG_PULL_DOWN), \
  27. PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_DOWN), \
  28. PIN_NOGP_CFG(FSCLKST_N, "FSCLKST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  29. PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
  30. PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP), \
  31. PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP), \
  32. PIN_NOGP_CFG(TMS, "TMS", fn, SH_PFC_PIN_CFG_PULL_UP), \
  33. PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP)
  34. /*
  35. * F_() : just information
  36. * FM() : macro for FN_xxx / xxx_MARK
  37. */
  38. /* GPSR0 */
  39. #define GPSR0_21 F_(DU_EXODDF_DU_ODDF_DISP_CDE, IP2_23_20)
  40. #define GPSR0_20 F_(DU_EXVSYNC_DU_VSYNC, IP2_19_16)
  41. #define GPSR0_19 F_(DU_EXHSYNC_DU_HSYNC, IP2_15_12)
  42. #define GPSR0_18 F_(DU_DOTCLKOUT, IP2_11_8)
  43. #define GPSR0_17 F_(DU_DB7, IP2_7_4)
  44. #define GPSR0_16 F_(DU_DB6, IP2_3_0)
  45. #define GPSR0_15 F_(DU_DB5, IP1_31_28)
  46. #define GPSR0_14 F_(DU_DB4, IP1_27_24)
  47. #define GPSR0_13 F_(DU_DB3, IP1_23_20)
  48. #define GPSR0_12 F_(DU_DB2, IP1_19_16)
  49. #define GPSR0_11 F_(DU_DG7, IP1_15_12)
  50. #define GPSR0_10 F_(DU_DG6, IP1_11_8)
  51. #define GPSR0_9 F_(DU_DG5, IP1_7_4)
  52. #define GPSR0_8 F_(DU_DG4, IP1_3_0)
  53. #define GPSR0_7 F_(DU_DG3, IP0_31_28)
  54. #define GPSR0_6 F_(DU_DG2, IP0_27_24)
  55. #define GPSR0_5 F_(DU_DR7, IP0_23_20)
  56. #define GPSR0_4 F_(DU_DR6, IP0_19_16)
  57. #define GPSR0_3 F_(DU_DR5, IP0_15_12)
  58. #define GPSR0_2 F_(DU_DR4, IP0_11_8)
  59. #define GPSR0_1 F_(DU_DR3, IP0_7_4)
  60. #define GPSR0_0 F_(DU_DR2, IP0_3_0)
  61. /* GPSR1 */
  62. #define GPSR1_27 F_(DIGRF_CLKOUT, IP8_27_24)
  63. #define GPSR1_26 F_(DIGRF_CLKIN, IP8_23_20)
  64. #define GPSR1_25 F_(CANFD_CLK_A, IP8_19_16)
  65. #define GPSR1_24 F_(CANFD1_RX, IP8_15_12)
  66. #define GPSR1_23 F_(CANFD1_TX, IP8_11_8)
  67. #define GPSR1_22 F_(CANFD0_RX_A, IP8_7_4)
  68. #define GPSR1_21 F_(CANFD0_TX_A, IP8_3_0)
  69. #define GPSR1_20 F_(AVB0_AVTP_CAPTURE, IP7_31_28)
  70. #define GPSR1_19 FM(AVB0_AVTP_MATCH)
  71. #define GPSR1_18 FM(AVB0_LINK)
  72. #define GPSR1_17 FM(AVB0_PHY_INT)
  73. #define GPSR1_16 FM(AVB0_MAGIC)
  74. #define GPSR1_15 FM(AVB0_MDC)
  75. #define GPSR1_14 FM(AVB0_MDIO)
  76. #define GPSR1_13 FM(AVB0_TXCREFCLK)
  77. #define GPSR1_12 FM(AVB0_TD3)
  78. #define GPSR1_11 FM(AVB0_TD2)
  79. #define GPSR1_10 FM(AVB0_TD1)
  80. #define GPSR1_9 FM(AVB0_TD0)
  81. #define GPSR1_8 FM(AVB0_TXC)
  82. #define GPSR1_7 FM(AVB0_TX_CTL)
  83. #define GPSR1_6 FM(AVB0_RD3)
  84. #define GPSR1_5 FM(AVB0_RD2)
  85. #define GPSR1_4 FM(AVB0_RD1)
  86. #define GPSR1_3 FM(AVB0_RD0)
  87. #define GPSR1_2 FM(AVB0_RXC)
  88. #define GPSR1_1 FM(AVB0_RX_CTL)
  89. #define GPSR1_0 F_(IRQ0, IP2_27_24)
  90. /* GPSR2 */
  91. #define GPSR2_16 F_(VI0_FIELD, IP4_31_28)
  92. #define GPSR2_15 F_(VI0_DATA11, IP4_27_24)
  93. #define GPSR2_14 F_(VI0_DATA10, IP4_23_20)
  94. #define GPSR2_13 F_(VI0_DATA9, IP4_19_16)
  95. #define GPSR2_12 F_(VI0_DATA8, IP4_15_12)
  96. #define GPSR2_11 F_(VI0_DATA7, IP4_11_8)
  97. #define GPSR2_10 F_(VI0_DATA6, IP4_7_4)
  98. #define GPSR2_9 F_(VI0_DATA5, IP4_3_0)
  99. #define GPSR2_8 F_(VI0_DATA4, IP3_31_28)
  100. #define GPSR2_7 F_(VI0_DATA3, IP3_27_24)
  101. #define GPSR2_6 F_(VI0_DATA2, IP3_23_20)
  102. #define GPSR2_5 F_(VI0_DATA1, IP3_19_16)
  103. #define GPSR2_4 F_(VI0_DATA0, IP3_15_12)
  104. #define GPSR2_3 F_(VI0_VSYNC_N, IP3_11_8)
  105. #define GPSR2_2 F_(VI0_HSYNC_N, IP3_7_4)
  106. #define GPSR2_1 F_(VI0_CLKENB, IP3_3_0)
  107. #define GPSR2_0 F_(VI0_CLK, IP2_31_28)
  108. /* GPSR3 */
  109. #define GPSR3_16 F_(VI1_FIELD, IP7_3_0)
  110. #define GPSR3_15 F_(VI1_DATA11, IP6_31_28)
  111. #define GPSR3_14 F_(VI1_DATA10, IP6_27_24)
  112. #define GPSR3_13 F_(VI1_DATA9, IP6_23_20)
  113. #define GPSR3_12 F_(VI1_DATA8, IP6_19_16)
  114. #define GPSR3_11 F_(VI1_DATA7, IP6_15_12)
  115. #define GPSR3_10 F_(VI1_DATA6, IP6_11_8)
  116. #define GPSR3_9 F_(VI1_DATA5, IP6_7_4)
  117. #define GPSR3_8 F_(VI1_DATA4, IP6_3_0)
  118. #define GPSR3_7 F_(VI1_DATA3, IP5_31_28)
  119. #define GPSR3_6 F_(VI1_DATA2, IP5_27_24)
  120. #define GPSR3_5 F_(VI1_DATA1, IP5_23_20)
  121. #define GPSR3_4 F_(VI1_DATA0, IP5_19_16)
  122. #define GPSR3_3 F_(VI1_VSYNC_N, IP5_15_12)
  123. #define GPSR3_2 F_(VI1_HSYNC_N, IP5_11_8)
  124. #define GPSR3_1 F_(VI1_CLKENB, IP5_7_4)
  125. #define GPSR3_0 F_(VI1_CLK, IP5_3_0)
  126. /* GPSR4 */
  127. #define GPSR4_5 F_(SDA2, IP7_27_24)
  128. #define GPSR4_4 F_(SCL2, IP7_23_20)
  129. #define GPSR4_3 F_(SDA1, IP7_19_16)
  130. #define GPSR4_2 F_(SCL1, IP7_15_12)
  131. #define GPSR4_1 F_(SDA0, IP7_11_8)
  132. #define GPSR4_0 F_(SCL0, IP7_7_4)
  133. /* GPSR5 */
  134. #define GPSR5_14 FM(RPC_INT_N)
  135. #define GPSR5_13 FM(RPC_WP_N)
  136. #define GPSR5_12 FM(RPC_RESET_N)
  137. #define GPSR5_11 FM(QSPI1_SSL)
  138. #define GPSR5_10 FM(QSPI1_IO3)
  139. #define GPSR5_9 FM(QSPI1_IO2)
  140. #define GPSR5_8 FM(QSPI1_MISO_IO1)
  141. #define GPSR5_7 FM(QSPI1_MOSI_IO0)
  142. #define GPSR5_6 FM(QSPI1_SPCLK)
  143. #define GPSR5_5 FM(QSPI0_SSL)
  144. #define GPSR5_4 FM(QSPI0_IO3)
  145. #define GPSR5_3 FM(QSPI0_IO2)
  146. #define GPSR5_2 FM(QSPI0_MISO_IO1)
  147. #define GPSR5_1 FM(QSPI0_MOSI_IO0)
  148. #define GPSR5_0 FM(QSPI0_SPCLK)
  149. /* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */
  150. #define IP0_3_0 FM(DU_DR2) FM(HSCK0) F_(0, 0) FM(A0) 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)
  151. #define IP0_7_4 FM(DU_DR3) FM(HRTS0_N) F_(0, 0) FM(A1) 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)
  152. #define IP0_11_8 FM(DU_DR4) FM(HCTS0_N) F_(0, 0) FM(A2) 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)
  153. #define IP0_15_12 FM(DU_DR5) FM(HTX0) F_(0, 0) FM(A3) 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)
  154. #define IP0_19_16 FM(DU_DR6) FM(MSIOF3_RXD) F_(0, 0) FM(A4) 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)
  155. #define IP0_23_20 FM(DU_DR7) FM(MSIOF3_TXD) F_(0, 0) FM(A5) 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)
  156. #define IP0_27_24 FM(DU_DG2) FM(MSIOF3_SS1) F_(0, 0) FM(A6) 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)
  157. #define IP0_31_28 FM(DU_DG3) FM(MSIOF3_SS2) F_(0, 0) FM(A7) FM(PWMFSW0) 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)
  158. #define IP1_3_0 FM(DU_DG4) F_(0, 0) F_(0, 0) FM(A8) FM(FSO_CFE_0_N_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) F_(0, 0)
  159. #define IP1_7_4 FM(DU_DG5) F_(0, 0) F_(0, 0) FM(A9) FM(FSO_CFE_1_N_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) F_(0, 0)
  160. #define IP1_11_8 FM(DU_DG6) F_(0, 0) F_(0, 0) FM(A10) FM(FSO_TOE_N_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) F_(0, 0)
  161. #define IP1_15_12 FM(DU_DG7) F_(0, 0) F_(0, 0) FM(A11) FM(IRQ1) 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)
  162. #define IP1_19_16 FM(DU_DB2) F_(0, 0) F_(0, 0) FM(A12) FM(IRQ2) 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)
  163. #define IP1_23_20 FM(DU_DB3) F_(0, 0) F_(0, 0) FM(A13) FM(FXR_CLKOUT1) 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)
  164. #define IP1_27_24 FM(DU_DB4) F_(0, 0) F_(0, 0) FM(A14) FM(FXR_CLKOUT2) 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)
  165. #define IP1_31_28 FM(DU_DB5) F_(0, 0) F_(0, 0) FM(A15) FM(FXR_TXENA_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)
  166. #define IP2_3_0 FM(DU_DB6) F_(0, 0) F_(0, 0) FM(A16) FM(FXR_TXENB_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)
  167. #define IP2_7_4 FM(DU_DB7) F_(0, 0) F_(0, 0) FM(A17) 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)
  168. #define IP2_11_8 FM(DU_DOTCLKOUT) FM(SCIF_CLK_A) F_(0, 0) FM(A18) 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)
  169. #define IP2_15_12 FM(DU_EXHSYNC_DU_HSYNC) FM(HRX0) F_(0, 0) FM(A19) FM(IRQ3) 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)
  170. #define IP2_19_16 FM(DU_EXVSYNC_DU_VSYNC) FM(MSIOF3_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) F_(0, 0) F_(0, 0)
  171. #define IP2_23_20 FM(DU_EXODDF_DU_ODDF_DISP_CDE) FM(MSIOF3_SYNC) 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)
  172. #define IP2_27_24 FM(IRQ0) 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)
  173. #define IP2_31_28 FM(VI0_CLK) FM(MSIOF2_SCK) FM(SCK3) F_(0, 0) FM(HSCK3) 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)
  174. #define IP3_3_0 FM(VI0_CLKENB) FM(MSIOF2_RXD) FM(RX3) FM(RD_WR_N) FM(HCTS3_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)
  175. #define IP3_7_4 FM(VI0_HSYNC_N) FM(MSIOF2_TXD) FM(TX3) F_(0, 0) FM(HRTS3_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)
  176. #define IP3_11_8 FM(VI0_VSYNC_N) FM(MSIOF2_SYNC) FM(CTS3_N) F_(0, 0) FM(HTX3) 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)
  177. #define IP3_15_12 FM(VI0_DATA0) FM(MSIOF2_SS1) FM(RTS3_N) F_(0, 0) FM(HRX3) 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)
  178. #define IP3_19_16 FM(VI0_DATA1) FM(MSIOF2_SS2) FM(SCK1) F_(0, 0) FM(SPEEDIN_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) F_(0, 0)
  179. #define IP3_23_20 FM(VI0_DATA2) FM(AVB0_AVTP_PPS) FM(SDA3_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) F_(0, 0) F_(0, 0) F_(0, 0)
  180. #define IP3_27_24 FM(VI0_DATA3) FM(HSCK1) FM(SCL3_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) F_(0, 0) F_(0, 0) F_(0, 0)
  181. #define IP3_31_28 FM(VI0_DATA4) FM(HRTS1_N) FM(RX1_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) F_(0, 0) F_(0, 0) F_(0, 0)
  182. #define IP4_3_0 FM(VI0_DATA5) FM(HCTS1_N) FM(TX1_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) F_(0, 0) F_(0, 0) F_(0, 0)
  183. #define IP4_7_4 FM(VI0_DATA6) FM(HTX1) FM(CTS1_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) F_(0, 0) F_(0, 0)
  184. #define IP4_11_8 FM(VI0_DATA7) FM(HRX1) FM(RTS1_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) F_(0, 0) F_(0, 0)
  185. #define IP4_15_12 FM(VI0_DATA8) FM(HSCK2) FM(PWM0_A) FM(A22) 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)
  186. #define IP4_19_16 FM(VI0_DATA9) FM(HCTS2_N) FM(PWM1_A) FM(A23) FM(FSO_CFE_0_N_B) 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)
  187. #define IP4_23_20 FM(VI0_DATA10) FM(HRTS2_N) FM(PWM2_A) FM(A24) FM(FSO_CFE_1_N_B) 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)
  188. #define IP4_27_24 FM(VI0_DATA11) FM(HTX2) FM(PWM3_A) FM(A25) FM(FSO_TOE_N_B) 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)
  189. #define IP4_31_28 FM(VI0_FIELD) FM(HRX2) FM(PWM4_A) FM(CS1_N) FM(FSCLKST2_N_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) F_(0, 0)
  190. #define IP5_3_0 FM(VI1_CLK) FM(MSIOF1_RXD) F_(0, 0) FM(CS0_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) F_(0, 0)
  191. #define IP5_7_4 FM(VI1_CLKENB) FM(MSIOF1_TXD) F_(0, 0) FM(D0) 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)
  192. #define IP5_11_8 FM(VI1_HSYNC_N) FM(MSIOF1_SCK) F_(0, 0) FM(D1) 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)
  193. #define IP5_15_12 FM(VI1_VSYNC_N) FM(MSIOF1_SYNC) F_(0, 0) FM(D2) 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)
  194. #define IP5_19_16 FM(VI1_DATA0) FM(MSIOF1_SS1) F_(0, 0) FM(D3) 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)
  195. #define IP5_23_20 FM(VI1_DATA1) FM(MSIOF1_SS2) F_(0, 0) FM(D4) FM(MMC_CMD) 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)
  196. #define IP5_27_24 FM(VI1_DATA2) FM(CANFD0_TX_B) F_(0, 0) FM(D5) FM(MMC_D0) 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)
  197. #define IP5_31_28 FM(VI1_DATA3) FM(CANFD0_RX_B) F_(0, 0) FM(D6) FM(MMC_D1) 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)
  198. #define IP6_3_0 FM(VI1_DATA4) FM(CANFD_CLK_B) F_(0, 0) FM(D7) FM(MMC_D2) 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)
  199. #define IP6_7_4 FM(VI1_DATA5) F_(0, 0) FM(SCK4) FM(D8) FM(MMC_D3) 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)
  200. #define IP6_11_8 FM(VI1_DATA6) F_(0, 0) FM(RX4) FM(D9) FM(MMC_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)
  201. #define IP6_15_12 FM(VI1_DATA7) F_(0, 0) FM(TX4) FM(D10) FM(MMC_D4) 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)
  202. #define IP6_19_16 FM(VI1_DATA8) F_(0, 0) FM(CTS4_N) FM(D11) FM(MMC_D5) 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)
  203. #define IP6_23_20 FM(VI1_DATA9) F_(0, 0) FM(RTS4_N) FM(D12) FM(MMC_D6) FM(SCL3_B) 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)
  204. #define IP6_27_24 FM(VI1_DATA10) F_(0, 0) F_(0, 0) FM(D13) FM(MMC_D7) FM(SDA3_B) 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)
  205. #define IP6_31_28 FM(VI1_DATA11) FM(SCL4) FM(IRQ4) FM(D14) 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)
  206. #define IP7_3_0 FM(VI1_FIELD) FM(SDA4) FM(IRQ5) FM(D15) 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)
  207. #define IP7_7_4 FM(SCL0) FM(DU_DR0) FM(TPU0TO0) FM(CLKOUT) F_(0, 0) FM(MSIOF0_RXD) 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)
  208. #define IP7_11_8 FM(SDA0) FM(DU_DR1) FM(TPU0TO1) FM(BS_N) FM(SCK0) FM(MSIOF0_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)
  209. #define IP7_15_12 FM(SCL1) FM(DU_DG0) FM(TPU0TO2) FM(RD_N) FM(CTS0_N) FM(MSIOF0_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)
  210. #define IP7_19_16 FM(SDA1) FM(DU_DG1) FM(TPU0TO3) FM(WE0_N) FM(RTS0_N) FM(MSIOF0_SYNC) 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)
  211. #define IP7_23_20 FM(SCL2) FM(DU_DB0) FM(TCLK1_A) FM(WE1_N) FM(RX0) FM(MSIOF0_SS1) 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)
  212. #define IP7_27_24 FM(SDA2) FM(DU_DB1) FM(TCLK2_A) FM(EX_WAIT0) FM(TX0) FM(MSIOF0_SS2) 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)
  213. #define IP7_31_28 FM(AVB0_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) FM(FSCLKST2_N_B) 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)
  214. #define IP8_3_0 FM(CANFD0_TX_A) FM(FXR_TXDA) FM(PWM0_B) FM(DU_DISP) FM(FSCLKST2_N_C) 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)
  215. #define IP8_7_4 FM(CANFD0_RX_A) FM(RXDA_EXTFXR) FM(PWM1_B) FM(DU_CDE) 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)
  216. #define IP8_11_8 FM(CANFD1_TX) FM(FXR_TXDB) FM(PWM2_B) FM(TCLK1_B) FM(TX1_B) 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)
  217. #define IP8_15_12 FM(CANFD1_RX) FM(RXDB_EXTFXR) FM(PWM3_B) FM(TCLK2_B) FM(RX1_B) 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)
  218. #define IP8_19_16 FM(CANFD_CLK_A) FM(CLK_EXTFXR) FM(PWM4_B) FM(SPEEDIN_B) FM(SCIF_CLK_B) 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)
  219. #define IP8_23_20 FM(DIGRF_CLKIN) FM(DIGRF_CLKEN_IN) 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)
  220. #define IP8_27_24 FM(DIGRF_CLKOUT) FM(DIGRF_CLKEN_OUT) 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)
  221. #define PINMUX_GPSR \
  222. \
  223. GPSR1_27 \
  224. GPSR1_26 \
  225. GPSR1_25 \
  226. GPSR1_24 \
  227. GPSR1_23 \
  228. GPSR1_22 \
  229. GPSR0_21 GPSR1_21 \
  230. GPSR0_20 GPSR1_20 \
  231. GPSR0_19 GPSR1_19 \
  232. GPSR0_18 GPSR1_18 \
  233. GPSR0_17 GPSR1_17 \
  234. GPSR0_16 GPSR1_16 GPSR2_16 GPSR3_16 \
  235. GPSR0_15 GPSR1_15 GPSR2_15 GPSR3_15 \
  236. GPSR0_14 GPSR1_14 GPSR2_14 GPSR3_14 GPSR5_14 \
  237. GPSR0_13 GPSR1_13 GPSR2_13 GPSR3_13 GPSR5_13 \
  238. GPSR0_12 GPSR1_12 GPSR2_12 GPSR3_12 GPSR5_12 \
  239. GPSR0_11 GPSR1_11 GPSR2_11 GPSR3_11 GPSR5_11 \
  240. GPSR0_10 GPSR1_10 GPSR2_10 GPSR3_10 GPSR5_10 \
  241. GPSR0_9 GPSR1_9 GPSR2_9 GPSR3_9 GPSR5_9 \
  242. GPSR0_8 GPSR1_8 GPSR2_8 GPSR3_8 GPSR5_8 \
  243. GPSR0_7 GPSR1_7 GPSR2_7 GPSR3_7 GPSR5_7 \
  244. GPSR0_6 GPSR1_6 GPSR2_6 GPSR3_6 GPSR5_6 \
  245. GPSR0_5 GPSR1_5 GPSR2_5 GPSR3_5 GPSR4_5 GPSR5_5 \
  246. GPSR0_4 GPSR1_4 GPSR2_4 GPSR3_4 GPSR4_4 GPSR5_4 \
  247. GPSR0_3 GPSR1_3 GPSR2_3 GPSR3_3 GPSR4_3 GPSR5_3 \
  248. GPSR0_2 GPSR1_2 GPSR2_2 GPSR3_2 GPSR4_2 GPSR5_2 \
  249. GPSR0_1 GPSR1_1 GPSR2_1 GPSR3_1 GPSR4_1 GPSR5_1 \
  250. GPSR0_0 GPSR1_0 GPSR2_0 GPSR3_0 GPSR4_0 GPSR5_0
  251. #define PINMUX_IPSR \
  252. \
  253. FM(IP0_3_0) IP0_3_0 FM(IP1_3_0) IP1_3_0 FM(IP2_3_0) IP2_3_0 FM(IP3_3_0) IP3_3_0 \
  254. FM(IP0_7_4) IP0_7_4 FM(IP1_7_4) IP1_7_4 FM(IP2_7_4) IP2_7_4 FM(IP3_7_4) IP3_7_4 \
  255. FM(IP0_11_8) IP0_11_8 FM(IP1_11_8) IP1_11_8 FM(IP2_11_8) IP2_11_8 FM(IP3_11_8) IP3_11_8 \
  256. FM(IP0_15_12) IP0_15_12 FM(IP1_15_12) IP1_15_12 FM(IP2_15_12) IP2_15_12 FM(IP3_15_12) IP3_15_12 \
  257. FM(IP0_19_16) IP0_19_16 FM(IP1_19_16) IP1_19_16 FM(IP2_19_16) IP2_19_16 FM(IP3_19_16) IP3_19_16 \
  258. FM(IP0_23_20) IP0_23_20 FM(IP1_23_20) IP1_23_20 FM(IP2_23_20) IP2_23_20 FM(IP3_23_20) IP3_23_20 \
  259. FM(IP0_27_24) IP0_27_24 FM(IP1_27_24) IP1_27_24 FM(IP2_27_24) IP2_27_24 FM(IP3_27_24) IP3_27_24 \
  260. FM(IP0_31_28) IP0_31_28 FM(IP1_31_28) IP1_31_28 FM(IP2_31_28) IP2_31_28 FM(IP3_31_28) IP3_31_28 \
  261. \
  262. FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \
  263. FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \
  264. FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \
  265. FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 FM(IP7_15_12) IP7_15_12 \
  266. FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \
  267. FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \
  268. FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \
  269. FM(IP4_31_28) IP4_31_28 FM(IP5_31_28) IP5_31_28 FM(IP6_31_28) IP6_31_28 FM(IP7_31_28) IP7_31_28 \
  270. \
  271. FM(IP8_3_0) IP8_3_0 \
  272. FM(IP8_7_4) IP8_7_4 \
  273. FM(IP8_11_8) IP8_11_8 \
  274. FM(IP8_15_12) IP8_15_12 \
  275. FM(IP8_19_16) IP8_19_16 \
  276. FM(IP8_23_20) IP8_23_20 \
  277. FM(IP8_27_24) IP8_27_24
  278. /* MOD_SEL0 */ /* 0 */ /* 1 */
  279. #define MOD_SEL0_11 FM(SEL_I2C3_0) FM(SEL_I2C3_1)
  280. #define MOD_SEL0_10 FM(SEL_HSCIF0_0) FM(SEL_HSCIF0_1)
  281. #define MOD_SEL0_9 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1)
  282. #define MOD_SEL0_8 FM(SEL_CANFD0_0) FM(SEL_CANFD0_1)
  283. #define MOD_SEL0_7 FM(SEL_PWM4_0) FM(SEL_PWM4_1)
  284. #define MOD_SEL0_6 FM(SEL_PWM3_0) FM(SEL_PWM3_1)
  285. #define MOD_SEL0_5 FM(SEL_PWM2_0) FM(SEL_PWM2_1)
  286. #define MOD_SEL0_4 FM(SEL_PWM1_0) FM(SEL_PWM1_1)
  287. #define MOD_SEL0_3 FM(SEL_PWM0_0) FM(SEL_PWM0_1)
  288. #define MOD_SEL0_2 FM(SEL_RFSO_0) FM(SEL_RFSO_1)
  289. #define MOD_SEL0_1 FM(SEL_RSP_0) FM(SEL_RSP_1)
  290. #define MOD_SEL0_0 FM(SEL_TMU_0) FM(SEL_TMU_1)
  291. #define PINMUX_MOD_SELS \
  292. \
  293. MOD_SEL0_11 \
  294. MOD_SEL0_10 \
  295. MOD_SEL0_9 \
  296. MOD_SEL0_8 \
  297. MOD_SEL0_7 \
  298. MOD_SEL0_6 \
  299. MOD_SEL0_5 \
  300. MOD_SEL0_4 \
  301. MOD_SEL0_3 \
  302. MOD_SEL0_2 \
  303. MOD_SEL0_1 \
  304. MOD_SEL0_0
  305. enum {
  306. PINMUX_RESERVED = 0,
  307. PINMUX_DATA_BEGIN,
  308. GP_ALL(DATA),
  309. PINMUX_DATA_END,
  310. #define F_(x, y)
  311. #define FM(x) FN_##x,
  312. PINMUX_FUNCTION_BEGIN,
  313. GP_ALL(FN),
  314. PINMUX_GPSR
  315. PINMUX_IPSR
  316. PINMUX_MOD_SELS
  317. PINMUX_FUNCTION_END,
  318. #undef F_
  319. #undef FM
  320. #define F_(x, y)
  321. #define FM(x) x##_MARK,
  322. PINMUX_MARK_BEGIN,
  323. PINMUX_GPSR
  324. PINMUX_IPSR
  325. PINMUX_MOD_SELS
  326. PINMUX_MARK_END,
  327. #undef F_
  328. #undef FM
  329. };
  330. static const u16 pinmux_data[] = {
  331. PINMUX_DATA_GP_ALL(),
  332. PINMUX_SINGLE(AVB0_RX_CTL),
  333. PINMUX_SINGLE(AVB0_RXC),
  334. PINMUX_SINGLE(AVB0_RD0),
  335. PINMUX_SINGLE(AVB0_RD1),
  336. PINMUX_SINGLE(AVB0_RD2),
  337. PINMUX_SINGLE(AVB0_RD3),
  338. PINMUX_SINGLE(AVB0_TX_CTL),
  339. PINMUX_SINGLE(AVB0_TXC),
  340. PINMUX_SINGLE(AVB0_TD0),
  341. PINMUX_SINGLE(AVB0_TD1),
  342. PINMUX_SINGLE(AVB0_TD2),
  343. PINMUX_SINGLE(AVB0_TD3),
  344. PINMUX_SINGLE(AVB0_TXCREFCLK),
  345. PINMUX_SINGLE(AVB0_MDIO),
  346. PINMUX_SINGLE(AVB0_MDC),
  347. PINMUX_SINGLE(AVB0_MAGIC),
  348. PINMUX_SINGLE(AVB0_PHY_INT),
  349. PINMUX_SINGLE(AVB0_LINK),
  350. PINMUX_SINGLE(AVB0_AVTP_MATCH),
  351. PINMUX_SINGLE(QSPI0_SPCLK),
  352. PINMUX_SINGLE(QSPI0_MOSI_IO0),
  353. PINMUX_SINGLE(QSPI0_MISO_IO1),
  354. PINMUX_SINGLE(QSPI0_IO2),
  355. PINMUX_SINGLE(QSPI0_IO3),
  356. PINMUX_SINGLE(QSPI0_SSL),
  357. PINMUX_SINGLE(QSPI1_SPCLK),
  358. PINMUX_SINGLE(QSPI1_MOSI_IO0),
  359. PINMUX_SINGLE(QSPI1_MISO_IO1),
  360. PINMUX_SINGLE(QSPI1_IO2),
  361. PINMUX_SINGLE(QSPI1_IO3),
  362. PINMUX_SINGLE(QSPI1_SSL),
  363. PINMUX_SINGLE(RPC_RESET_N),
  364. PINMUX_SINGLE(RPC_WP_N),
  365. PINMUX_SINGLE(RPC_INT_N),
  366. /* IPSR0 */
  367. PINMUX_IPSR_GPSR(IP0_3_0, DU_DR2),
  368. PINMUX_IPSR_GPSR(IP0_3_0, HSCK0),
  369. PINMUX_IPSR_GPSR(IP0_3_0, A0),
  370. PINMUX_IPSR_GPSR(IP0_7_4, DU_DR3),
  371. PINMUX_IPSR_GPSR(IP0_7_4, HRTS0_N),
  372. PINMUX_IPSR_GPSR(IP0_7_4, A1),
  373. PINMUX_IPSR_GPSR(IP0_11_8, DU_DR4),
  374. PINMUX_IPSR_GPSR(IP0_11_8, HCTS0_N),
  375. PINMUX_IPSR_GPSR(IP0_11_8, A2),
  376. PINMUX_IPSR_GPSR(IP0_15_12, DU_DR5),
  377. PINMUX_IPSR_GPSR(IP0_15_12, HTX0),
  378. PINMUX_IPSR_GPSR(IP0_15_12, A3),
  379. PINMUX_IPSR_GPSR(IP0_19_16, DU_DR6),
  380. PINMUX_IPSR_GPSR(IP0_19_16, MSIOF3_RXD),
  381. PINMUX_IPSR_GPSR(IP0_19_16, A4),
  382. PINMUX_IPSR_GPSR(IP0_23_20, DU_DR7),
  383. PINMUX_IPSR_GPSR(IP0_23_20, MSIOF3_TXD),
  384. PINMUX_IPSR_GPSR(IP0_23_20, A5),
  385. PINMUX_IPSR_GPSR(IP0_27_24, DU_DG2),
  386. PINMUX_IPSR_GPSR(IP0_27_24, MSIOF3_SS1),
  387. PINMUX_IPSR_GPSR(IP0_27_24, A6),
  388. PINMUX_IPSR_GPSR(IP0_31_28, DU_DG3),
  389. PINMUX_IPSR_GPSR(IP0_31_28, MSIOF3_SS2),
  390. PINMUX_IPSR_GPSR(IP0_31_28, A7),
  391. PINMUX_IPSR_GPSR(IP0_31_28, PWMFSW0),
  392. /* IPSR1 */
  393. PINMUX_IPSR_GPSR(IP1_3_0, DU_DG4),
  394. PINMUX_IPSR_GPSR(IP1_3_0, A8),
  395. PINMUX_IPSR_MSEL(IP1_3_0, FSO_CFE_0_N_A, SEL_RFSO_0),
  396. PINMUX_IPSR_GPSR(IP1_7_4, DU_DG5),
  397. PINMUX_IPSR_GPSR(IP1_7_4, A9),
  398. PINMUX_IPSR_MSEL(IP1_7_4, FSO_CFE_1_N_A, SEL_RFSO_0),
  399. PINMUX_IPSR_GPSR(IP1_11_8, DU_DG6),
  400. PINMUX_IPSR_GPSR(IP1_11_8, A10),
  401. PINMUX_IPSR_MSEL(IP1_11_8, FSO_TOE_N_A, SEL_RFSO_0),
  402. PINMUX_IPSR_GPSR(IP1_15_12, DU_DG7),
  403. PINMUX_IPSR_GPSR(IP1_15_12, A11),
  404. PINMUX_IPSR_GPSR(IP1_15_12, IRQ1),
  405. PINMUX_IPSR_GPSR(IP1_19_16, DU_DB2),
  406. PINMUX_IPSR_GPSR(IP1_19_16, A12),
  407. PINMUX_IPSR_GPSR(IP1_19_16, IRQ2),
  408. PINMUX_IPSR_GPSR(IP1_23_20, DU_DB3),
  409. PINMUX_IPSR_GPSR(IP1_23_20, A13),
  410. PINMUX_IPSR_GPSR(IP1_23_20, FXR_CLKOUT1),
  411. PINMUX_IPSR_GPSR(IP1_27_24, DU_DB4),
  412. PINMUX_IPSR_GPSR(IP1_27_24, A14),
  413. PINMUX_IPSR_GPSR(IP1_27_24, FXR_CLKOUT2),
  414. PINMUX_IPSR_GPSR(IP1_31_28, DU_DB5),
  415. PINMUX_IPSR_GPSR(IP1_31_28, A15),
  416. PINMUX_IPSR_GPSR(IP1_31_28, FXR_TXENA_N),
  417. /* IPSR2 */
  418. PINMUX_IPSR_GPSR(IP2_3_0, DU_DB6),
  419. PINMUX_IPSR_GPSR(IP2_3_0, A16),
  420. PINMUX_IPSR_GPSR(IP2_3_0, FXR_TXENB_N),
  421. PINMUX_IPSR_GPSR(IP2_7_4, DU_DB7),
  422. PINMUX_IPSR_GPSR(IP2_7_4, A17),
  423. PINMUX_IPSR_GPSR(IP2_11_8, DU_DOTCLKOUT),
  424. PINMUX_IPSR_MSEL(IP2_11_8, SCIF_CLK_A, SEL_HSCIF0_0),
  425. PINMUX_IPSR_GPSR(IP2_11_8, A18),
  426. PINMUX_IPSR_GPSR(IP2_15_12, DU_EXHSYNC_DU_HSYNC),
  427. PINMUX_IPSR_GPSR(IP2_15_12, HRX0),
  428. PINMUX_IPSR_GPSR(IP2_15_12, A19),
  429. PINMUX_IPSR_GPSR(IP2_15_12, IRQ3),
  430. PINMUX_IPSR_GPSR(IP2_19_16, DU_EXVSYNC_DU_VSYNC),
  431. PINMUX_IPSR_GPSR(IP2_19_16, MSIOF3_SCK),
  432. PINMUX_IPSR_GPSR(IP2_23_20, DU_EXODDF_DU_ODDF_DISP_CDE),
  433. PINMUX_IPSR_GPSR(IP2_23_20, MSIOF3_SYNC),
  434. PINMUX_IPSR_GPSR(IP2_27_24, IRQ0),
  435. PINMUX_IPSR_GPSR(IP2_31_28, VI0_CLK),
  436. PINMUX_IPSR_GPSR(IP2_31_28, MSIOF2_SCK),
  437. PINMUX_IPSR_GPSR(IP2_31_28, SCK3),
  438. PINMUX_IPSR_GPSR(IP2_31_28, HSCK3),
  439. /* IPSR3 */
  440. PINMUX_IPSR_GPSR(IP3_3_0, VI0_CLKENB),
  441. PINMUX_IPSR_GPSR(IP3_3_0, MSIOF2_RXD),
  442. PINMUX_IPSR_GPSR(IP3_3_0, RX3),
  443. PINMUX_IPSR_GPSR(IP3_3_0, RD_WR_N),
  444. PINMUX_IPSR_GPSR(IP3_3_0, HCTS3_N),
  445. PINMUX_IPSR_GPSR(IP3_7_4, VI0_HSYNC_N),
  446. PINMUX_IPSR_GPSR(IP3_7_4, MSIOF2_TXD),
  447. PINMUX_IPSR_GPSR(IP3_7_4, TX3),
  448. PINMUX_IPSR_GPSR(IP3_7_4, HRTS3_N),
  449. PINMUX_IPSR_GPSR(IP3_11_8, VI0_VSYNC_N),
  450. PINMUX_IPSR_GPSR(IP3_11_8, MSIOF2_SYNC),
  451. PINMUX_IPSR_GPSR(IP3_11_8, CTS3_N),
  452. PINMUX_IPSR_GPSR(IP3_11_8, HTX3),
  453. PINMUX_IPSR_GPSR(IP3_15_12, VI0_DATA0),
  454. PINMUX_IPSR_GPSR(IP3_15_12, MSIOF2_SS1),
  455. PINMUX_IPSR_GPSR(IP3_15_12, RTS3_N),
  456. PINMUX_IPSR_GPSR(IP3_15_12, HRX3),
  457. PINMUX_IPSR_GPSR(IP3_19_16, VI0_DATA1),
  458. PINMUX_IPSR_GPSR(IP3_19_16, MSIOF2_SS2),
  459. PINMUX_IPSR_GPSR(IP3_19_16, SCK1),
  460. PINMUX_IPSR_MSEL(IP3_19_16, SPEEDIN_A, SEL_RSP_0),
  461. PINMUX_IPSR_GPSR(IP3_23_20, VI0_DATA2),
  462. PINMUX_IPSR_GPSR(IP3_23_20, AVB0_AVTP_PPS),
  463. PINMUX_IPSR_MSEL(IP3_23_20, SDA3_A, SEL_I2C3_0),
  464. PINMUX_IPSR_GPSR(IP3_27_24, VI0_DATA3),
  465. PINMUX_IPSR_GPSR(IP3_27_24, HSCK1),
  466. PINMUX_IPSR_MSEL(IP3_27_24, SCL3_A, SEL_I2C3_0),
  467. PINMUX_IPSR_GPSR(IP3_31_28, VI0_DATA4),
  468. PINMUX_IPSR_GPSR(IP3_31_28, HRTS1_N),
  469. PINMUX_IPSR_MSEL(IP3_31_28, RX1_A, SEL_SCIF1_0),
  470. /* IPSR4 */
  471. PINMUX_IPSR_GPSR(IP4_3_0, VI0_DATA5),
  472. PINMUX_IPSR_GPSR(IP4_3_0, HCTS1_N),
  473. PINMUX_IPSR_MSEL(IP4_3_0, TX1_A, SEL_SCIF1_0),
  474. PINMUX_IPSR_GPSR(IP4_7_4, VI0_DATA6),
  475. PINMUX_IPSR_GPSR(IP4_7_4, HTX1),
  476. PINMUX_IPSR_GPSR(IP4_7_4, CTS1_N),
  477. PINMUX_IPSR_GPSR(IP4_11_8, VI0_DATA7),
  478. PINMUX_IPSR_GPSR(IP4_11_8, HRX1),
  479. PINMUX_IPSR_GPSR(IP4_11_8, RTS1_N),
  480. PINMUX_IPSR_GPSR(IP4_15_12, VI0_DATA8),
  481. PINMUX_IPSR_GPSR(IP4_15_12, HSCK2),
  482. PINMUX_IPSR_MSEL(IP4_15_12, PWM0_A, SEL_PWM0_0),
  483. PINMUX_IPSR_GPSR(IP4_19_16, VI0_DATA9),
  484. PINMUX_IPSR_GPSR(IP4_19_16, HCTS2_N),
  485. PINMUX_IPSR_MSEL(IP4_19_16, PWM1_A, SEL_PWM1_0),
  486. PINMUX_IPSR_MSEL(IP4_19_16, FSO_CFE_0_N_B, SEL_RFSO_1),
  487. PINMUX_IPSR_GPSR(IP4_23_20, VI0_DATA10),
  488. PINMUX_IPSR_GPSR(IP4_23_20, HRTS2_N),
  489. PINMUX_IPSR_MSEL(IP4_23_20, PWM2_A, SEL_PWM2_0),
  490. PINMUX_IPSR_MSEL(IP4_23_20, FSO_CFE_1_N_B, SEL_RFSO_1),
  491. PINMUX_IPSR_GPSR(IP4_27_24, VI0_DATA11),
  492. PINMUX_IPSR_GPSR(IP4_27_24, HTX2),
  493. PINMUX_IPSR_MSEL(IP4_27_24, PWM3_A, SEL_PWM3_0),
  494. PINMUX_IPSR_MSEL(IP4_27_24, FSO_TOE_N_B, SEL_RFSO_1),
  495. PINMUX_IPSR_GPSR(IP4_31_28, VI0_FIELD),
  496. PINMUX_IPSR_GPSR(IP4_31_28, HRX2),
  497. PINMUX_IPSR_MSEL(IP4_31_28, PWM4_A, SEL_PWM4_0),
  498. PINMUX_IPSR_GPSR(IP4_31_28, CS1_N),
  499. PINMUX_IPSR_GPSR(IP4_31_28, FSCLKST2_N_A),
  500. /* IPSR5 */
  501. PINMUX_IPSR_GPSR(IP5_3_0, VI1_CLK),
  502. PINMUX_IPSR_GPSR(IP5_3_0, MSIOF1_RXD),
  503. PINMUX_IPSR_GPSR(IP5_3_0, CS0_N),
  504. PINMUX_IPSR_GPSR(IP5_7_4, VI1_CLKENB),
  505. PINMUX_IPSR_GPSR(IP5_7_4, MSIOF1_TXD),
  506. PINMUX_IPSR_GPSR(IP5_7_4, D0),
  507. PINMUX_IPSR_GPSR(IP5_11_8, VI1_HSYNC_N),
  508. PINMUX_IPSR_GPSR(IP5_11_8, MSIOF1_SCK),
  509. PINMUX_IPSR_GPSR(IP5_11_8, D1),
  510. PINMUX_IPSR_GPSR(IP5_15_12, VI1_VSYNC_N),
  511. PINMUX_IPSR_GPSR(IP5_15_12, MSIOF1_SYNC),
  512. PINMUX_IPSR_GPSR(IP5_15_12, D2),
  513. PINMUX_IPSR_GPSR(IP5_19_16, VI1_DATA0),
  514. PINMUX_IPSR_GPSR(IP5_19_16, MSIOF1_SS1),
  515. PINMUX_IPSR_GPSR(IP5_19_16, D3),
  516. PINMUX_IPSR_GPSR(IP5_23_20, VI1_DATA1),
  517. PINMUX_IPSR_GPSR(IP5_23_20, MSIOF1_SS2),
  518. PINMUX_IPSR_GPSR(IP5_23_20, D4),
  519. PINMUX_IPSR_GPSR(IP5_23_20, MMC_CMD),
  520. PINMUX_IPSR_GPSR(IP5_27_24, VI1_DATA2),
  521. PINMUX_IPSR_MSEL(IP5_27_24, CANFD0_TX_B, SEL_CANFD0_1),
  522. PINMUX_IPSR_GPSR(IP5_27_24, D5),
  523. PINMUX_IPSR_GPSR(IP5_27_24, MMC_D0),
  524. PINMUX_IPSR_GPSR(IP5_31_28, VI1_DATA3),
  525. PINMUX_IPSR_MSEL(IP5_31_28, CANFD0_RX_B, SEL_CANFD0_1),
  526. PINMUX_IPSR_GPSR(IP5_31_28, D6),
  527. PINMUX_IPSR_GPSR(IP5_31_28, MMC_D1),
  528. /* IPSR6 */
  529. PINMUX_IPSR_GPSR(IP6_3_0, VI1_DATA4),
  530. PINMUX_IPSR_MSEL(IP6_3_0, CANFD_CLK_B, SEL_CANFD0_1),
  531. PINMUX_IPSR_GPSR(IP6_3_0, D7),
  532. PINMUX_IPSR_GPSR(IP6_3_0, MMC_D2),
  533. PINMUX_IPSR_GPSR(IP6_7_4, VI1_DATA5),
  534. PINMUX_IPSR_GPSR(IP6_7_4, SCK4),
  535. PINMUX_IPSR_GPSR(IP6_7_4, D8),
  536. PINMUX_IPSR_GPSR(IP6_7_4, MMC_D3),
  537. PINMUX_IPSR_GPSR(IP6_11_8, VI1_DATA6),
  538. PINMUX_IPSR_GPSR(IP6_11_8, RX4),
  539. PINMUX_IPSR_GPSR(IP6_11_8, D9),
  540. PINMUX_IPSR_GPSR(IP6_11_8, MMC_CLK),
  541. PINMUX_IPSR_GPSR(IP6_15_12, VI1_DATA7),
  542. PINMUX_IPSR_GPSR(IP6_15_12, TX4),
  543. PINMUX_IPSR_GPSR(IP6_15_12, D10),
  544. PINMUX_IPSR_GPSR(IP6_15_12, MMC_D4),
  545. PINMUX_IPSR_GPSR(IP6_19_16, VI1_DATA8),
  546. PINMUX_IPSR_GPSR(IP6_19_16, CTS4_N),
  547. PINMUX_IPSR_GPSR(IP6_19_16, D11),
  548. PINMUX_IPSR_GPSR(IP6_19_16, MMC_D5),
  549. PINMUX_IPSR_GPSR(IP6_23_20, VI1_DATA9),
  550. PINMUX_IPSR_GPSR(IP6_23_20, RTS4_N),
  551. PINMUX_IPSR_GPSR(IP6_23_20, D12),
  552. PINMUX_IPSR_GPSR(IP6_23_20, MMC_D6),
  553. PINMUX_IPSR_MSEL(IP6_23_20, SCL3_B, SEL_I2C3_1),
  554. PINMUX_IPSR_GPSR(IP6_27_24, VI1_DATA10),
  555. PINMUX_IPSR_GPSR(IP6_27_24, D13),
  556. PINMUX_IPSR_GPSR(IP6_27_24, MMC_D7),
  557. PINMUX_IPSR_MSEL(IP6_27_24, SDA3_B, SEL_I2C3_1),
  558. PINMUX_IPSR_GPSR(IP6_31_28, VI1_DATA11),
  559. PINMUX_IPSR_GPSR(IP6_31_28, SCL4),
  560. PINMUX_IPSR_GPSR(IP6_31_28, IRQ4),
  561. PINMUX_IPSR_GPSR(IP6_31_28, D14),
  562. /* IPSR7 */
  563. PINMUX_IPSR_GPSR(IP7_3_0, VI1_FIELD),
  564. PINMUX_IPSR_GPSR(IP7_3_0, SDA4),
  565. PINMUX_IPSR_GPSR(IP7_3_0, IRQ5),
  566. PINMUX_IPSR_GPSR(IP7_3_0, D15),
  567. PINMUX_IPSR_GPSR(IP7_7_4, SCL0),
  568. PINMUX_IPSR_GPSR(IP7_7_4, DU_DR0),
  569. PINMUX_IPSR_GPSR(IP7_7_4, TPU0TO0),
  570. PINMUX_IPSR_GPSR(IP7_7_4, CLKOUT),
  571. PINMUX_IPSR_GPSR(IP7_7_4, MSIOF0_RXD),
  572. PINMUX_IPSR_GPSR(IP7_11_8, SDA0),
  573. PINMUX_IPSR_GPSR(IP7_11_8, DU_DR1),
  574. PINMUX_IPSR_GPSR(IP7_11_8, TPU0TO1),
  575. PINMUX_IPSR_GPSR(IP7_11_8, BS_N),
  576. PINMUX_IPSR_GPSR(IP7_11_8, SCK0),
  577. PINMUX_IPSR_GPSR(IP7_11_8, MSIOF0_TXD),
  578. PINMUX_IPSR_GPSR(IP7_15_12, SCL1),
  579. PINMUX_IPSR_GPSR(IP7_15_12, DU_DG0),
  580. PINMUX_IPSR_GPSR(IP7_15_12, TPU0TO2),
  581. PINMUX_IPSR_GPSR(IP7_15_12, RD_N),
  582. PINMUX_IPSR_GPSR(IP7_15_12, CTS0_N),
  583. PINMUX_IPSR_GPSR(IP7_15_12, MSIOF0_SCK),
  584. PINMUX_IPSR_GPSR(IP7_19_16, SDA1),
  585. PINMUX_IPSR_GPSR(IP7_19_16, DU_DG1),
  586. PINMUX_IPSR_GPSR(IP7_19_16, TPU0TO3),
  587. PINMUX_IPSR_GPSR(IP7_19_16, WE0_N),
  588. PINMUX_IPSR_GPSR(IP7_19_16, RTS0_N),
  589. PINMUX_IPSR_GPSR(IP7_19_16, MSIOF0_SYNC),
  590. PINMUX_IPSR_GPSR(IP7_23_20, SCL2),
  591. PINMUX_IPSR_GPSR(IP7_23_20, DU_DB0),
  592. PINMUX_IPSR_MSEL(IP7_23_20, TCLK1_A, SEL_TMU_0),
  593. PINMUX_IPSR_GPSR(IP7_23_20, WE1_N),
  594. PINMUX_IPSR_GPSR(IP7_23_20, RX0),
  595. PINMUX_IPSR_GPSR(IP7_23_20, MSIOF0_SS1),
  596. PINMUX_IPSR_GPSR(IP7_27_24, SDA2),
  597. PINMUX_IPSR_GPSR(IP7_27_24, DU_DB1),
  598. PINMUX_IPSR_MSEL(IP7_27_24, TCLK2_A, SEL_TMU_0),
  599. PINMUX_IPSR_GPSR(IP7_27_24, EX_WAIT0),
  600. PINMUX_IPSR_GPSR(IP7_27_24, TX0),
  601. PINMUX_IPSR_GPSR(IP7_27_24, MSIOF0_SS2),
  602. PINMUX_IPSR_GPSR(IP7_31_28, AVB0_AVTP_CAPTURE),
  603. PINMUX_IPSR_GPSR(IP7_31_28, FSCLKST2_N_B),
  604. /* IPSR8 */
  605. PINMUX_IPSR_MSEL(IP8_3_0, CANFD0_TX_A, SEL_CANFD0_0),
  606. PINMUX_IPSR_GPSR(IP8_3_0, FXR_TXDA),
  607. PINMUX_IPSR_MSEL(IP8_3_0, PWM0_B, SEL_PWM0_1),
  608. PINMUX_IPSR_GPSR(IP8_3_0, DU_DISP),
  609. PINMUX_IPSR_GPSR(IP8_3_0, FSCLKST2_N_C),
  610. PINMUX_IPSR_MSEL(IP8_7_4, CANFD0_RX_A, SEL_CANFD0_0),
  611. PINMUX_IPSR_GPSR(IP8_7_4, RXDA_EXTFXR),
  612. PINMUX_IPSR_MSEL(IP8_7_4, PWM1_B, SEL_PWM1_1),
  613. PINMUX_IPSR_GPSR(IP8_7_4, DU_CDE),
  614. PINMUX_IPSR_GPSR(IP8_11_8, CANFD1_TX),
  615. PINMUX_IPSR_GPSR(IP8_11_8, FXR_TXDB),
  616. PINMUX_IPSR_MSEL(IP8_11_8, PWM2_B, SEL_PWM2_1),
  617. PINMUX_IPSR_MSEL(IP8_11_8, TCLK1_B, SEL_TMU_1),
  618. PINMUX_IPSR_MSEL(IP8_11_8, TX1_B, SEL_SCIF1_1),
  619. PINMUX_IPSR_GPSR(IP8_15_12, CANFD1_RX),
  620. PINMUX_IPSR_GPSR(IP8_15_12, RXDB_EXTFXR),
  621. PINMUX_IPSR_MSEL(IP8_15_12, PWM3_B, SEL_PWM3_1),
  622. PINMUX_IPSR_MSEL(IP8_15_12, TCLK2_B, SEL_TMU_1),
  623. PINMUX_IPSR_MSEL(IP8_15_12, RX1_B, SEL_SCIF1_1),
  624. PINMUX_IPSR_MSEL(IP8_19_16, CANFD_CLK_A, SEL_CANFD0_0),
  625. PINMUX_IPSR_GPSR(IP8_19_16, CLK_EXTFXR),
  626. PINMUX_IPSR_MSEL(IP8_19_16, PWM4_B, SEL_PWM4_1),
  627. PINMUX_IPSR_MSEL(IP8_19_16, SPEEDIN_B, SEL_RSP_1),
  628. PINMUX_IPSR_MSEL(IP8_19_16, SCIF_CLK_B, SEL_HSCIF0_1),
  629. PINMUX_IPSR_GPSR(IP8_23_20, DIGRF_CLKIN),
  630. PINMUX_IPSR_GPSR(IP8_23_20, DIGRF_CLKEN_IN),
  631. PINMUX_IPSR_GPSR(IP8_27_24, DIGRF_CLKOUT),
  632. PINMUX_IPSR_GPSR(IP8_27_24, DIGRF_CLKEN_OUT),
  633. };
  634. /*
  635. * Pins not associated with a GPIO port.
  636. */
  637. enum {
  638. GP_ASSIGN_LAST(),
  639. NOGP_ALL(),
  640. };
  641. static const struct sh_pfc_pin pinmux_pins[] = {
  642. PINMUX_GPIO_GP_ALL(),
  643. PINMUX_NOGP_ALL(),
  644. };
  645. /* - AVB0 ------------------------------------------------------------------- */
  646. static const unsigned int avb0_link_pins[] = {
  647. /* AVB0_LINK */
  648. RCAR_GP_PIN(1, 18),
  649. };
  650. static const unsigned int avb0_link_mux[] = {
  651. AVB0_LINK_MARK,
  652. };
  653. static const unsigned int avb0_magic_pins[] = {
  654. /* AVB0_MAGIC */
  655. RCAR_GP_PIN(1, 16),
  656. };
  657. static const unsigned int avb0_magic_mux[] = {
  658. AVB0_MAGIC_MARK,
  659. };
  660. static const unsigned int avb0_phy_int_pins[] = {
  661. /* AVB0_PHY_INT */
  662. RCAR_GP_PIN(1, 17),
  663. };
  664. static const unsigned int avb0_phy_int_mux[] = {
  665. AVB0_PHY_INT_MARK,
  666. };
  667. static const unsigned int avb0_mdio_pins[] = {
  668. /* AVB0_MDC, AVB0_MDIO */
  669. RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14),
  670. };
  671. static const unsigned int avb0_mdio_mux[] = {
  672. AVB0_MDC_MARK, AVB0_MDIO_MARK,
  673. };
  674. static const unsigned int avb0_rgmii_pins[] = {
  675. /*
  676. * AVB0_TX_CTL, AVB0_TXC, AVB0_TD0, AVB0_TD1, AVB0_TD2, AVB0_TD3,
  677. * AVB0_RX_CTL, AVB0_RXC, AVB0_RD0, AVB0_RD1, AVB0_RD2, AVB0_RD3
  678. */
  679. RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 8),
  680. RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 10),
  681. RCAR_GP_PIN(1, 11), RCAR_GP_PIN(1, 12),
  682. RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 2),
  683. RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 4),
  684. RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6),
  685. };
  686. static const unsigned int avb0_rgmii_mux[] = {
  687. AVB0_TX_CTL_MARK, AVB0_TXC_MARK,
  688. AVB0_TD0_MARK, AVB0_TD1_MARK, AVB0_TD2_MARK, AVB0_TD3_MARK,
  689. AVB0_RX_CTL_MARK, AVB0_RXC_MARK,
  690. AVB0_RD0_MARK, AVB0_RD1_MARK, AVB0_RD2_MARK, AVB0_RD3_MARK,
  691. };
  692. static const unsigned int avb0_txcrefclk_pins[] = {
  693. /* AVB0_TXCREFCLK */
  694. RCAR_GP_PIN(1, 13),
  695. };
  696. static const unsigned int avb0_txcrefclk_mux[] = {
  697. AVB0_TXCREFCLK_MARK,
  698. };
  699. static const unsigned int avb0_avtp_pps_pins[] = {
  700. /* AVB0_AVTP_PPS */
  701. RCAR_GP_PIN(2, 6),
  702. };
  703. static const unsigned int avb0_avtp_pps_mux[] = {
  704. AVB0_AVTP_PPS_MARK,
  705. };
  706. static const unsigned int avb0_avtp_capture_pins[] = {
  707. /* AVB0_AVTP_CAPTURE */
  708. RCAR_GP_PIN(1, 20),
  709. };
  710. static const unsigned int avb0_avtp_capture_mux[] = {
  711. AVB0_AVTP_CAPTURE_MARK,
  712. };
  713. static const unsigned int avb0_avtp_match_pins[] = {
  714. /* AVB0_AVTP_MATCH */
  715. RCAR_GP_PIN(1, 19),
  716. };
  717. static const unsigned int avb0_avtp_match_mux[] = {
  718. AVB0_AVTP_MATCH_MARK,
  719. };
  720. /* - CANFD Clock ------------------------------------------------------------ */
  721. static const unsigned int canfd_clk_a_pins[] = {
  722. /* CANFD_CLK */
  723. RCAR_GP_PIN(1, 25),
  724. };
  725. static const unsigned int canfd_clk_a_mux[] = {
  726. CANFD_CLK_A_MARK,
  727. };
  728. static const unsigned int canfd_clk_b_pins[] = {
  729. /* CANFD_CLK */
  730. RCAR_GP_PIN(3, 8),
  731. };
  732. static const unsigned int canfd_clk_b_mux[] = {
  733. CANFD_CLK_B_MARK,
  734. };
  735. /* - CANFD0 ----------------------------------------------------------------- */
  736. static const unsigned int canfd0_data_a_pins[] = {
  737. /* TX, RX */
  738. RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
  739. };
  740. static const unsigned int canfd0_data_a_mux[] = {
  741. CANFD0_TX_A_MARK, CANFD0_RX_A_MARK,
  742. };
  743. static const unsigned int canfd0_data_b_pins[] = {
  744. /* TX, RX */
  745. RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
  746. };
  747. static const unsigned int canfd0_data_b_mux[] = {
  748. CANFD0_TX_B_MARK, CANFD0_RX_B_MARK,
  749. };
  750. /* - CANFD1 ----------------------------------------------------------------- */
  751. static const unsigned int canfd1_data_pins[] = {
  752. /* TX, RX */
  753. RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24),
  754. };
  755. static const unsigned int canfd1_data_mux[] = {
  756. CANFD1_TX_MARK, CANFD1_RX_MARK,
  757. };
  758. /* - DU --------------------------------------------------------------------- */
  759. static const unsigned int du_rgb666_pins[] = {
  760. /* R[7:2], G[7:2], B[7:2] */
  761. RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 3),
  762. RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 1), RCAR_GP_PIN(0, 0),
  763. RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 9),
  764. RCAR_GP_PIN(0, 8), RCAR_GP_PIN(0, 7), RCAR_GP_PIN(0, 6),
  765. RCAR_GP_PIN(0, 17), RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 15),
  766. RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 12),
  767. };
  768. static const unsigned int du_rgb666_mux[] = {
  769. DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK,
  770. DU_DR4_MARK, DU_DR3_MARK, DU_DR2_MARK,
  771. DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK,
  772. DU_DG4_MARK, DU_DG3_MARK, DU_DG2_MARK,
  773. DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK,
  774. DU_DB4_MARK, DU_DB3_MARK, DU_DB2_MARK,
  775. };
  776. static const unsigned int du_clk_out_pins[] = {
  777. /* DOTCLKOUT */
  778. RCAR_GP_PIN(0, 18),
  779. };
  780. static const unsigned int du_clk_out_mux[] = {
  781. DU_DOTCLKOUT_MARK,
  782. };
  783. static const unsigned int du_sync_pins[] = {
  784. /* EXVSYNC/VSYNC, EXHSYNC/HSYNC */
  785. RCAR_GP_PIN(0, 20), RCAR_GP_PIN(0, 19),
  786. };
  787. static const unsigned int du_sync_mux[] = {
  788. DU_EXVSYNC_DU_VSYNC_MARK, DU_EXHSYNC_DU_HSYNC_MARK
  789. };
  790. static const unsigned int du_oddf_pins[] = {
  791. /* EXODDF/ODDF/DISP/CDE */
  792. RCAR_GP_PIN(0, 21),
  793. };
  794. static const unsigned int du_oddf_mux[] = {
  795. DU_EXODDF_DU_ODDF_DISP_CDE_MARK,
  796. };
  797. static const unsigned int du_cde_pins[] = {
  798. /* CDE */
  799. RCAR_GP_PIN(1, 22),
  800. };
  801. static const unsigned int du_cde_mux[] = {
  802. DU_CDE_MARK,
  803. };
  804. static const unsigned int du_disp_pins[] = {
  805. /* DISP */
  806. RCAR_GP_PIN(1, 21),
  807. };
  808. static const unsigned int du_disp_mux[] = {
  809. DU_DISP_MARK,
  810. };
  811. /* - HSCIF0 ----------------------------------------------------------------- */
  812. static const unsigned int hscif0_data_pins[] = {
  813. /* HRX, HTX */
  814. RCAR_GP_PIN(0, 19), RCAR_GP_PIN(0, 3),
  815. };
  816. static const unsigned int hscif0_data_mux[] = {
  817. HRX0_MARK, HTX0_MARK,
  818. };
  819. static const unsigned int hscif0_clk_pins[] = {
  820. /* HSCK */
  821. RCAR_GP_PIN(0, 0),
  822. };
  823. static const unsigned int hscif0_clk_mux[] = {
  824. HSCK0_MARK,
  825. };
  826. static const unsigned int hscif0_ctrl_pins[] = {
  827. /* HRTS#, HCTS# */
  828. RCAR_GP_PIN(0, 1), RCAR_GP_PIN(0, 2),
  829. };
  830. static const unsigned int hscif0_ctrl_mux[] = {
  831. HRTS0_N_MARK, HCTS0_N_MARK,
  832. };
  833. /* - HSCIF1 ----------------------------------------------------------------- */
  834. static const unsigned int hscif1_data_pins[] = {
  835. /* HRX, HTX */
  836. RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 10),
  837. };
  838. static const unsigned int hscif1_data_mux[] = {
  839. HRX1_MARK, HTX1_MARK,
  840. };
  841. static const unsigned int hscif1_clk_pins[] = {
  842. /* HSCK */
  843. RCAR_GP_PIN(2, 7),
  844. };
  845. static const unsigned int hscif1_clk_mux[] = {
  846. HSCK1_MARK,
  847. };
  848. static const unsigned int hscif1_ctrl_pins[] = {
  849. /* HRTS#, HCTS# */
  850. RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
  851. };
  852. static const unsigned int hscif1_ctrl_mux[] = {
  853. HRTS1_N_MARK, HCTS1_N_MARK,
  854. };
  855. /* - HSCIF2 ----------------------------------------------------------------- */
  856. static const unsigned int hscif2_data_pins[] = {
  857. /* HRX, HTX */
  858. RCAR_GP_PIN(2, 16), RCAR_GP_PIN(2, 15),
  859. };
  860. static const unsigned int hscif2_data_mux[] = {
  861. HRX2_MARK, HTX2_MARK,
  862. };
  863. static const unsigned int hscif2_clk_pins[] = {
  864. /* HSCK */
  865. RCAR_GP_PIN(2, 12),
  866. };
  867. static const unsigned int hscif2_clk_mux[] = {
  868. HSCK2_MARK,
  869. };
  870. static const unsigned int hscif2_ctrl_pins[] = {
  871. /* HRTS#, HCTS# */
  872. RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 13),
  873. };
  874. static const unsigned int hscif2_ctrl_mux[] = {
  875. HRTS2_N_MARK, HCTS2_N_MARK,
  876. };
  877. /* - HSCIF3 ----------------------------------------------------------------- */
  878. static const unsigned int hscif3_data_pins[] = {
  879. /* HRX, HTX */
  880. RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 3),
  881. };
  882. static const unsigned int hscif3_data_mux[] = {
  883. HRX3_MARK, HTX3_MARK,
  884. };
  885. static const unsigned int hscif3_clk_pins[] = {
  886. /* HSCK */
  887. RCAR_GP_PIN(2, 0),
  888. };
  889. static const unsigned int hscif3_clk_mux[] = {
  890. HSCK3_MARK,
  891. };
  892. static const unsigned int hscif3_ctrl_pins[] = {
  893. /* HRTS#, HCTS# */
  894. RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 1),
  895. };
  896. static const unsigned int hscif3_ctrl_mux[] = {
  897. HRTS3_N_MARK, HCTS3_N_MARK,
  898. };
  899. /* - I2C0 ------------------------------------------------------------------- */
  900. static const unsigned int i2c0_pins[] = {
  901. /* SDA, SCL */
  902. RCAR_GP_PIN(4, 1), RCAR_GP_PIN(4, 0),
  903. };
  904. static const unsigned int i2c0_mux[] = {
  905. SDA0_MARK, SCL0_MARK,
  906. };
  907. /* - I2C1 ------------------------------------------------------------------- */
  908. static const unsigned int i2c1_pins[] = {
  909. /* SDA, SCL */
  910. RCAR_GP_PIN(4, 3), RCAR_GP_PIN(4, 2),
  911. };
  912. static const unsigned int i2c1_mux[] = {
  913. SDA1_MARK, SCL1_MARK,
  914. };
  915. /* - I2C2 ------------------------------------------------------------------- */
  916. static const unsigned int i2c2_pins[] = {
  917. /* SDA, SCL */
  918. RCAR_GP_PIN(4, 5), RCAR_GP_PIN(4, 4),
  919. };
  920. static const unsigned int i2c2_mux[] = {
  921. SDA2_MARK, SCL2_MARK,
  922. };
  923. /* - I2C3 ------------------------------------------------------------------- */
  924. static const unsigned int i2c3_a_pins[] = {
  925. /* SDA, SCL */
  926. RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
  927. };
  928. static const unsigned int i2c3_a_mux[] = {
  929. SDA3_A_MARK, SCL3_A_MARK,
  930. };
  931. static const unsigned int i2c3_b_pins[] = {
  932. /* SDA, SCL */
  933. RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 13),
  934. };
  935. static const unsigned int i2c3_b_mux[] = {
  936. SDA3_B_MARK, SCL3_B_MARK,
  937. };
  938. /* - I2C4 ------------------------------------------------------------------- */
  939. static const unsigned int i2c4_pins[] = {
  940. /* SDA, SCL */
  941. RCAR_GP_PIN(3, 16), RCAR_GP_PIN(3, 15),
  942. };
  943. static const unsigned int i2c4_mux[] = {
  944. SDA4_MARK, SCL4_MARK,
  945. };
  946. /* - INTC-EX ---------------------------------------------------------------- */
  947. static const unsigned int intc_ex_irq0_pins[] = {
  948. /* IRQ0 */
  949. RCAR_GP_PIN(1, 0),
  950. };
  951. static const unsigned int intc_ex_irq0_mux[] = {
  952. IRQ0_MARK,
  953. };
  954. static const unsigned int intc_ex_irq1_pins[] = {
  955. /* IRQ1 */
  956. RCAR_GP_PIN(0, 11),
  957. };
  958. static const unsigned int intc_ex_irq1_mux[] = {
  959. IRQ1_MARK,
  960. };
  961. static const unsigned int intc_ex_irq2_pins[] = {
  962. /* IRQ2 */
  963. RCAR_GP_PIN(0, 12),
  964. };
  965. static const unsigned int intc_ex_irq2_mux[] = {
  966. IRQ2_MARK,
  967. };
  968. static const unsigned int intc_ex_irq3_pins[] = {
  969. /* IRQ3 */
  970. RCAR_GP_PIN(0, 19),
  971. };
  972. static const unsigned int intc_ex_irq3_mux[] = {
  973. IRQ3_MARK,
  974. };
  975. static const unsigned int intc_ex_irq4_pins[] = {
  976. /* IRQ4 */
  977. RCAR_GP_PIN(3, 15),
  978. };
  979. static const unsigned int intc_ex_irq4_mux[] = {
  980. IRQ4_MARK,
  981. };
  982. static const unsigned int intc_ex_irq5_pins[] = {
  983. /* IRQ5 */
  984. RCAR_GP_PIN(3, 16),
  985. };
  986. static const unsigned int intc_ex_irq5_mux[] = {
  987. IRQ5_MARK,
  988. };
  989. /* - MMC -------------------------------------------------------------------- */
  990. static const unsigned int mmc_data_pins[] = {
  991. /* D[0:7] */
  992. RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
  993. RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
  994. RCAR_GP_PIN(3, 11), RCAR_GP_PIN(3, 12),
  995. RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
  996. };
  997. static const unsigned int mmc_data_mux[] = {
  998. MMC_D0_MARK, MMC_D1_MARK,
  999. MMC_D2_MARK, MMC_D3_MARK,
  1000. MMC_D4_MARK, MMC_D5_MARK,
  1001. MMC_D6_MARK, MMC_D7_MARK,
  1002. };
  1003. static const unsigned int mmc_ctrl_pins[] = {
  1004. /* CLK, CMD */
  1005. RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 5),
  1006. };
  1007. static const unsigned int mmc_ctrl_mux[] = {
  1008. MMC_CLK_MARK, MMC_CMD_MARK,
  1009. };
  1010. /* - MSIOF0 ----------------------------------------------------------------- */
  1011. static const unsigned int msiof0_clk_pins[] = {
  1012. /* SCK */
  1013. RCAR_GP_PIN(4, 2),
  1014. };
  1015. static const unsigned int msiof0_clk_mux[] = {
  1016. MSIOF0_SCK_MARK,
  1017. };
  1018. static const unsigned int msiof0_sync_pins[] = {
  1019. /* SYNC */
  1020. RCAR_GP_PIN(4, 3),
  1021. };
  1022. static const unsigned int msiof0_sync_mux[] = {
  1023. MSIOF0_SYNC_MARK,
  1024. };
  1025. static const unsigned int msiof0_ss1_pins[] = {
  1026. /* SS1 */
  1027. RCAR_GP_PIN(4, 4),
  1028. };
  1029. static const unsigned int msiof0_ss1_mux[] = {
  1030. MSIOF0_SS1_MARK,
  1031. };
  1032. static const unsigned int msiof0_ss2_pins[] = {
  1033. /* SS2 */
  1034. RCAR_GP_PIN(4, 5),
  1035. };
  1036. static const unsigned int msiof0_ss2_mux[] = {
  1037. MSIOF0_SS2_MARK,
  1038. };
  1039. static const unsigned int msiof0_txd_pins[] = {
  1040. /* TXD */
  1041. RCAR_GP_PIN(4, 1),
  1042. };
  1043. static const unsigned int msiof0_txd_mux[] = {
  1044. MSIOF0_TXD_MARK,
  1045. };
  1046. static const unsigned int msiof0_rxd_pins[] = {
  1047. /* RXD */
  1048. RCAR_GP_PIN(4, 0),
  1049. };
  1050. static const unsigned int msiof0_rxd_mux[] = {
  1051. MSIOF0_RXD_MARK,
  1052. };
  1053. /* - MSIOF1 ----------------------------------------------------------------- */
  1054. static const unsigned int msiof1_clk_pins[] = {
  1055. /* SCK */
  1056. RCAR_GP_PIN(3, 2),
  1057. };
  1058. static const unsigned int msiof1_clk_mux[] = {
  1059. MSIOF1_SCK_MARK,
  1060. };
  1061. static const unsigned int msiof1_sync_pins[] = {
  1062. /* SYNC */
  1063. RCAR_GP_PIN(3, 3),
  1064. };
  1065. static const unsigned int msiof1_sync_mux[] = {
  1066. MSIOF1_SYNC_MARK,
  1067. };
  1068. static const unsigned int msiof1_ss1_pins[] = {
  1069. /* SS1 */
  1070. RCAR_GP_PIN(3, 4),
  1071. };
  1072. static const unsigned int msiof1_ss1_mux[] = {
  1073. MSIOF1_SS1_MARK,
  1074. };
  1075. static const unsigned int msiof1_ss2_pins[] = {
  1076. /* SS2 */
  1077. RCAR_GP_PIN(3, 5),
  1078. };
  1079. static const unsigned int msiof1_ss2_mux[] = {
  1080. MSIOF1_SS2_MARK,
  1081. };
  1082. static const unsigned int msiof1_txd_pins[] = {
  1083. /* TXD */
  1084. RCAR_GP_PIN(3, 1),
  1085. };
  1086. static const unsigned int msiof1_txd_mux[] = {
  1087. MSIOF1_TXD_MARK,
  1088. };
  1089. static const unsigned int msiof1_rxd_pins[] = {
  1090. /* RXD */
  1091. RCAR_GP_PIN(3, 0),
  1092. };
  1093. static const unsigned int msiof1_rxd_mux[] = {
  1094. MSIOF1_RXD_MARK,
  1095. };
  1096. /* - MSIOF2 ----------------------------------------------------------------- */
  1097. static const unsigned int msiof2_clk_pins[] = {
  1098. /* SCK */
  1099. RCAR_GP_PIN(2, 0),
  1100. };
  1101. static const unsigned int msiof2_clk_mux[] = {
  1102. MSIOF2_SCK_MARK,
  1103. };
  1104. static const unsigned int msiof2_sync_pins[] = {
  1105. /* SYNC */
  1106. RCAR_GP_PIN(2, 3),
  1107. };
  1108. static const unsigned int msiof2_sync_mux[] = {
  1109. MSIOF2_SYNC_MARK,
  1110. };
  1111. static const unsigned int msiof2_ss1_pins[] = {
  1112. /* SS1 */
  1113. RCAR_GP_PIN(2, 4),
  1114. };
  1115. static const unsigned int msiof2_ss1_mux[] = {
  1116. MSIOF2_SS1_MARK,
  1117. };
  1118. static const unsigned int msiof2_ss2_pins[] = {
  1119. /* SS2 */
  1120. RCAR_GP_PIN(2, 5),
  1121. };
  1122. static const unsigned int msiof2_ss2_mux[] = {
  1123. MSIOF2_SS2_MARK,
  1124. };
  1125. static const unsigned int msiof2_txd_pins[] = {
  1126. /* TXD */
  1127. RCAR_GP_PIN(2, 2),
  1128. };
  1129. static const unsigned int msiof2_txd_mux[] = {
  1130. MSIOF2_TXD_MARK,
  1131. };
  1132. static const unsigned int msiof2_rxd_pins[] = {
  1133. /* RXD */
  1134. RCAR_GP_PIN(2, 1),
  1135. };
  1136. static const unsigned int msiof2_rxd_mux[] = {
  1137. MSIOF2_RXD_MARK,
  1138. };
  1139. /* - MSIOF3 ----------------------------------------------------------------- */
  1140. static const unsigned int msiof3_clk_pins[] = {
  1141. /* SCK */
  1142. RCAR_GP_PIN(0, 20),
  1143. };
  1144. static const unsigned int msiof3_clk_mux[] = {
  1145. MSIOF3_SCK_MARK,
  1146. };
  1147. static const unsigned int msiof3_sync_pins[] = {
  1148. /* SYNC */
  1149. RCAR_GP_PIN(0, 21),
  1150. };
  1151. static const unsigned int msiof3_sync_mux[] = {
  1152. MSIOF3_SYNC_MARK,
  1153. };
  1154. static const unsigned int msiof3_ss1_pins[] = {
  1155. /* SS1 */
  1156. RCAR_GP_PIN(0, 6),
  1157. };
  1158. static const unsigned int msiof3_ss1_mux[] = {
  1159. MSIOF3_SS1_MARK,
  1160. };
  1161. static const unsigned int msiof3_ss2_pins[] = {
  1162. /* SS2 */
  1163. RCAR_GP_PIN(0, 7),
  1164. };
  1165. static const unsigned int msiof3_ss2_mux[] = {
  1166. MSIOF3_SS2_MARK,
  1167. };
  1168. static const unsigned int msiof3_txd_pins[] = {
  1169. /* TXD */
  1170. RCAR_GP_PIN(0, 5),
  1171. };
  1172. static const unsigned int msiof3_txd_mux[] = {
  1173. MSIOF3_TXD_MARK,
  1174. };
  1175. static const unsigned int msiof3_rxd_pins[] = {
  1176. /* RXD */
  1177. RCAR_GP_PIN(0, 4),
  1178. };
  1179. static const unsigned int msiof3_rxd_mux[] = {
  1180. MSIOF3_RXD_MARK,
  1181. };
  1182. /* - PWM0 ------------------------------------------------------------------- */
  1183. static const unsigned int pwm0_a_pins[] = {
  1184. RCAR_GP_PIN(2, 12),
  1185. };
  1186. static const unsigned int pwm0_a_mux[] = {
  1187. PWM0_A_MARK,
  1188. };
  1189. static const unsigned int pwm0_b_pins[] = {
  1190. RCAR_GP_PIN(1, 21),
  1191. };
  1192. static const unsigned int pwm0_b_mux[] = {
  1193. PWM0_B_MARK,
  1194. };
  1195. /* - PWM1 ------------------------------------------------------------------- */
  1196. static const unsigned int pwm1_a_pins[] = {
  1197. RCAR_GP_PIN(2, 13),
  1198. };
  1199. static const unsigned int pwm1_a_mux[] = {
  1200. PWM1_A_MARK,
  1201. };
  1202. static const unsigned int pwm1_b_pins[] = {
  1203. RCAR_GP_PIN(1, 22),
  1204. };
  1205. static const unsigned int pwm1_b_mux[] = {
  1206. PWM1_B_MARK,
  1207. };
  1208. /* - PWM2 ------------------------------------------------------------------- */
  1209. static const unsigned int pwm2_a_pins[] = {
  1210. RCAR_GP_PIN(2, 14),
  1211. };
  1212. static const unsigned int pwm2_a_mux[] = {
  1213. PWM2_A_MARK,
  1214. };
  1215. static const unsigned int pwm2_b_pins[] = {
  1216. RCAR_GP_PIN(1, 23),
  1217. };
  1218. static const unsigned int pwm2_b_mux[] = {
  1219. PWM2_B_MARK,
  1220. };
  1221. /* - PWM3 ------------------------------------------------------------------- */
  1222. static const unsigned int pwm3_a_pins[] = {
  1223. RCAR_GP_PIN(2, 15),
  1224. };
  1225. static const unsigned int pwm3_a_mux[] = {
  1226. PWM3_A_MARK,
  1227. };
  1228. static const unsigned int pwm3_b_pins[] = {
  1229. RCAR_GP_PIN(1, 24),
  1230. };
  1231. static const unsigned int pwm3_b_mux[] = {
  1232. PWM3_B_MARK,
  1233. };
  1234. /* - PWM4 ------------------------------------------------------------------- */
  1235. static const unsigned int pwm4_a_pins[] = {
  1236. RCAR_GP_PIN(2, 16),
  1237. };
  1238. static const unsigned int pwm4_a_mux[] = {
  1239. PWM4_A_MARK,
  1240. };
  1241. static const unsigned int pwm4_b_pins[] = {
  1242. RCAR_GP_PIN(1, 25),
  1243. };
  1244. static const unsigned int pwm4_b_mux[] = {
  1245. PWM4_B_MARK,
  1246. };
  1247. /* - QSPI0 ------------------------------------------------------------------ */
  1248. static const unsigned int qspi0_ctrl_pins[] = {
  1249. /* SPCLK, SSL */
  1250. RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 5),
  1251. };
  1252. static const unsigned int qspi0_ctrl_mux[] = {
  1253. QSPI0_SPCLK_MARK, QSPI0_SSL_MARK,
  1254. };
  1255. /* - QSPI1 ------------------------------------------------------------------ */
  1256. static const unsigned int qspi1_ctrl_pins[] = {
  1257. /* SPCLK, SSL */
  1258. RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 11),
  1259. };
  1260. static const unsigned int qspi1_ctrl_mux[] = {
  1261. QSPI1_SPCLK_MARK, QSPI1_SSL_MARK,
  1262. };
  1263. /* - RPC -------------------------------------------------------------------- */
  1264. static const unsigned int rpc_clk_pins[] = {
  1265. /* Octal-SPI flash: C/SCLK */
  1266. /* HyperFlash: CK, CK# */
  1267. RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 6),
  1268. };
  1269. static const unsigned int rpc_clk_mux[] = {
  1270. QSPI0_SPCLK_MARK, QSPI1_SPCLK_MARK,
  1271. };
  1272. static const unsigned int rpc_ctrl_pins[] = {
  1273. /* Octal-SPI flash: S#/CS, DQS */
  1274. /* HyperFlash: CS#, RDS */
  1275. RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 11),
  1276. };
  1277. static const unsigned int rpc_ctrl_mux[] = {
  1278. QSPI0_SSL_MARK, QSPI1_SSL_MARK,
  1279. };
  1280. static const unsigned int rpc_data_pins[] = {
  1281. /* DQ[0:7] */
  1282. RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
  1283. RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4),
  1284. RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8),
  1285. RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 10),
  1286. };
  1287. static const unsigned int rpc_data_mux[] = {
  1288. QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
  1289. QSPI0_IO2_MARK, QSPI0_IO3_MARK,
  1290. QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
  1291. QSPI1_IO2_MARK, QSPI1_IO3_MARK,
  1292. };
  1293. static const unsigned int rpc_reset_pins[] = {
  1294. /* RPC_RESET# */
  1295. RCAR_GP_PIN(5, 12),
  1296. };
  1297. static const unsigned int rpc_reset_mux[] = {
  1298. RPC_RESET_N_MARK,
  1299. };
  1300. static const unsigned int rpc_int_pins[] = {
  1301. /* RPC_INT# */
  1302. RCAR_GP_PIN(5, 14),
  1303. };
  1304. static const unsigned int rpc_int_mux[] = {
  1305. RPC_INT_N_MARK,
  1306. };
  1307. static const unsigned int rpc_wp_pins[] = {
  1308. /* RPC_WP# */
  1309. RCAR_GP_PIN(5, 13),
  1310. };
  1311. static const unsigned int rpc_wp_mux[] = {
  1312. RPC_WP_N_MARK,
  1313. };
  1314. /* - SCIF Clock ------------------------------------------------------------- */
  1315. static const unsigned int scif_clk_a_pins[] = {
  1316. /* SCIF_CLK */
  1317. RCAR_GP_PIN(0, 18),
  1318. };
  1319. static const unsigned int scif_clk_a_mux[] = {
  1320. SCIF_CLK_A_MARK,
  1321. };
  1322. static const unsigned int scif_clk_b_pins[] = {
  1323. /* SCIF_CLK */
  1324. RCAR_GP_PIN(1, 25),
  1325. };
  1326. static const unsigned int scif_clk_b_mux[] = {
  1327. SCIF_CLK_B_MARK,
  1328. };
  1329. /* - SCIF0 ------------------------------------------------------------------ */
  1330. static const unsigned int scif0_data_pins[] = {
  1331. /* RX, TX */
  1332. RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5),
  1333. };
  1334. static const unsigned int scif0_data_mux[] = {
  1335. RX0_MARK, TX0_MARK,
  1336. };
  1337. static const unsigned int scif0_clk_pins[] = {
  1338. /* SCK */
  1339. RCAR_GP_PIN(4, 1),
  1340. };
  1341. static const unsigned int scif0_clk_mux[] = {
  1342. SCK0_MARK,
  1343. };
  1344. static const unsigned int scif0_ctrl_pins[] = {
  1345. /* RTS#, CTS# */
  1346. RCAR_GP_PIN(4, 3), RCAR_GP_PIN(4, 2),
  1347. };
  1348. static const unsigned int scif0_ctrl_mux[] = {
  1349. RTS0_N_MARK, CTS0_N_MARK,
  1350. };
  1351. /* - SCIF1 ------------------------------------------------------------------ */
  1352. static const unsigned int scif1_data_a_pins[] = {
  1353. /* RX, TX */
  1354. RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
  1355. };
  1356. static const unsigned int scif1_data_a_mux[] = {
  1357. RX1_A_MARK, TX1_A_MARK,
  1358. };
  1359. static const unsigned int scif1_clk_pins[] = {
  1360. /* SCK */
  1361. RCAR_GP_PIN(2, 5),
  1362. };
  1363. static const unsigned int scif1_clk_mux[] = {
  1364. SCK1_MARK,
  1365. };
  1366. static const unsigned int scif1_ctrl_pins[] = {
  1367. /* RTS#, CTS# */
  1368. RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 10),
  1369. };
  1370. static const unsigned int scif1_ctrl_mux[] = {
  1371. RTS1_N_MARK, CTS1_N_MARK,
  1372. };
  1373. static const unsigned int scif1_data_b_pins[] = {
  1374. /* RX, TX */
  1375. RCAR_GP_PIN(1, 24), RCAR_GP_PIN(1, 23),
  1376. };
  1377. static const unsigned int scif1_data_b_mux[] = {
  1378. RX1_B_MARK, TX1_B_MARK,
  1379. };
  1380. /* - SCIF3 ------------------------------------------------------------------ */
  1381. static const unsigned int scif3_data_pins[] = {
  1382. /* RX, TX */
  1383. RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
  1384. };
  1385. static const unsigned int scif3_data_mux[] = {
  1386. RX3_MARK, TX3_MARK,
  1387. };
  1388. static const unsigned int scif3_clk_pins[] = {
  1389. /* SCK */
  1390. RCAR_GP_PIN(2, 0),
  1391. };
  1392. static const unsigned int scif3_clk_mux[] = {
  1393. SCK3_MARK,
  1394. };
  1395. static const unsigned int scif3_ctrl_pins[] = {
  1396. /* RTS#, CTS# */
  1397. RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 3),
  1398. };
  1399. static const unsigned int scif3_ctrl_mux[] = {
  1400. RTS3_N_MARK, CTS3_N_MARK,
  1401. };
  1402. /* - SCIF4 ------------------------------------------------------------------ */
  1403. static const unsigned int scif4_data_pins[] = {
  1404. /* RX, TX */
  1405. RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
  1406. };
  1407. static const unsigned int scif4_data_mux[] = {
  1408. RX4_MARK, TX4_MARK,
  1409. };
  1410. static const unsigned int scif4_clk_pins[] = {
  1411. /* SCK */
  1412. RCAR_GP_PIN(3, 9),
  1413. };
  1414. static const unsigned int scif4_clk_mux[] = {
  1415. SCK4_MARK,
  1416. };
  1417. static const unsigned int scif4_ctrl_pins[] = {
  1418. /* RTS#, CTS# */
  1419. RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12),
  1420. };
  1421. static const unsigned int scif4_ctrl_mux[] = {
  1422. RTS4_N_MARK, CTS4_N_MARK,
  1423. };
  1424. /* - TMU -------------------------------------------------------------------- */
  1425. static const unsigned int tmu_tclk1_a_pins[] = {
  1426. /* TCLK1 */
  1427. RCAR_GP_PIN(4, 4),
  1428. };
  1429. static const unsigned int tmu_tclk1_a_mux[] = {
  1430. TCLK1_A_MARK,
  1431. };
  1432. static const unsigned int tmu_tclk1_b_pins[] = {
  1433. /* TCLK1 */
  1434. RCAR_GP_PIN(1, 23),
  1435. };
  1436. static const unsigned int tmu_tclk1_b_mux[] = {
  1437. TCLK1_B_MARK,
  1438. };
  1439. static const unsigned int tmu_tclk2_a_pins[] = {
  1440. /* TCLK2 */
  1441. RCAR_GP_PIN(4, 5),
  1442. };
  1443. static const unsigned int tmu_tclk2_a_mux[] = {
  1444. TCLK2_A_MARK,
  1445. };
  1446. static const unsigned int tmu_tclk2_b_pins[] = {
  1447. /* TCLK2 */
  1448. RCAR_GP_PIN(1, 24),
  1449. };
  1450. static const unsigned int tmu_tclk2_b_mux[] = {
  1451. TCLK2_B_MARK,
  1452. };
  1453. /* - VIN0 ------------------------------------------------------------------- */
  1454. static const unsigned int vin0_data_pins[] = {
  1455. RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
  1456. RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
  1457. RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
  1458. RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
  1459. RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
  1460. RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
  1461. };
  1462. static const unsigned int vin0_data_mux[] = {
  1463. VI0_DATA0_MARK, VI0_DATA1_MARK,
  1464. VI0_DATA2_MARK, VI0_DATA3_MARK,
  1465. VI0_DATA4_MARK, VI0_DATA5_MARK,
  1466. VI0_DATA6_MARK, VI0_DATA7_MARK,
  1467. VI0_DATA8_MARK, VI0_DATA9_MARK,
  1468. VI0_DATA10_MARK, VI0_DATA11_MARK,
  1469. };
  1470. static const unsigned int vin0_sync_pins[] = {
  1471. /* HSYNC#, VSYNC# */
  1472. RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
  1473. };
  1474. static const unsigned int vin0_sync_mux[] = {
  1475. VI0_HSYNC_N_MARK, VI0_VSYNC_N_MARK,
  1476. };
  1477. static const unsigned int vin0_field_pins[] = {
  1478. /* FIELD */
  1479. RCAR_GP_PIN(2, 16),
  1480. };
  1481. static const unsigned int vin0_field_mux[] = {
  1482. VI0_FIELD_MARK,
  1483. };
  1484. static const unsigned int vin0_clkenb_pins[] = {
  1485. /* CLKENB */
  1486. RCAR_GP_PIN(2, 1),
  1487. };
  1488. static const unsigned int vin0_clkenb_mux[] = {
  1489. VI0_CLKENB_MARK,
  1490. };
  1491. static const unsigned int vin0_clk_pins[] = {
  1492. /* CLK */
  1493. RCAR_GP_PIN(2, 0),
  1494. };
  1495. static const unsigned int vin0_clk_mux[] = {
  1496. VI0_CLK_MARK,
  1497. };
  1498. /* - VIN1 ------------------------------------------------------------------- */
  1499. static const unsigned int vin1_data_pins[] = {
  1500. RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
  1501. RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
  1502. RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
  1503. RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
  1504. RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
  1505. RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
  1506. };
  1507. static const unsigned int vin1_data_mux[] = {
  1508. VI1_DATA0_MARK, VI1_DATA1_MARK,
  1509. VI1_DATA2_MARK, VI1_DATA3_MARK,
  1510. VI1_DATA4_MARK, VI1_DATA5_MARK,
  1511. VI1_DATA6_MARK, VI1_DATA7_MARK,
  1512. VI1_DATA8_MARK, VI1_DATA9_MARK,
  1513. VI1_DATA10_MARK, VI1_DATA11_MARK,
  1514. };
  1515. static const unsigned int vin1_sync_pins[] = {
  1516. /* HSYNC#, VSYNC# */
  1517. RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3),
  1518. };
  1519. static const unsigned int vin1_sync_mux[] = {
  1520. VI1_HSYNC_N_MARK, VI1_VSYNC_N_MARK,
  1521. };
  1522. static const unsigned int vin1_field_pins[] = {
  1523. RCAR_GP_PIN(3, 16),
  1524. };
  1525. static const unsigned int vin1_field_mux[] = {
  1526. /* FIELD */
  1527. VI1_FIELD_MARK,
  1528. };
  1529. static const unsigned int vin1_clkenb_pins[] = {
  1530. RCAR_GP_PIN(3, 1),
  1531. };
  1532. static const unsigned int vin1_clkenb_mux[] = {
  1533. /* CLKENB */
  1534. VI1_CLKENB_MARK,
  1535. };
  1536. static const unsigned int vin1_clk_pins[] = {
  1537. RCAR_GP_PIN(3, 0),
  1538. };
  1539. static const unsigned int vin1_clk_mux[] = {
  1540. /* CLK */
  1541. VI1_CLK_MARK,
  1542. };
  1543. static const struct sh_pfc_pin_group pinmux_groups[] = {
  1544. SH_PFC_PIN_GROUP(avb0_link),
  1545. SH_PFC_PIN_GROUP(avb0_magic),
  1546. SH_PFC_PIN_GROUP(avb0_phy_int),
  1547. SH_PFC_PIN_GROUP(avb0_mdio),
  1548. SH_PFC_PIN_GROUP(avb0_rgmii),
  1549. SH_PFC_PIN_GROUP(avb0_txcrefclk),
  1550. SH_PFC_PIN_GROUP(avb0_avtp_pps),
  1551. SH_PFC_PIN_GROUP(avb0_avtp_capture),
  1552. SH_PFC_PIN_GROUP(avb0_avtp_match),
  1553. SH_PFC_PIN_GROUP(canfd_clk_a),
  1554. SH_PFC_PIN_GROUP(canfd_clk_b),
  1555. SH_PFC_PIN_GROUP(canfd0_data_a),
  1556. SH_PFC_PIN_GROUP(canfd0_data_b),
  1557. SH_PFC_PIN_GROUP(canfd1_data),
  1558. SH_PFC_PIN_GROUP(du_rgb666),
  1559. SH_PFC_PIN_GROUP(du_clk_out),
  1560. SH_PFC_PIN_GROUP(du_sync),
  1561. SH_PFC_PIN_GROUP(du_oddf),
  1562. SH_PFC_PIN_GROUP(du_cde),
  1563. SH_PFC_PIN_GROUP(du_disp),
  1564. SH_PFC_PIN_GROUP(hscif0_data),
  1565. SH_PFC_PIN_GROUP(hscif0_clk),
  1566. SH_PFC_PIN_GROUP(hscif0_ctrl),
  1567. SH_PFC_PIN_GROUP(hscif1_data),
  1568. SH_PFC_PIN_GROUP(hscif1_clk),
  1569. SH_PFC_PIN_GROUP(hscif1_ctrl),
  1570. SH_PFC_PIN_GROUP(hscif2_data),
  1571. SH_PFC_PIN_GROUP(hscif2_clk),
  1572. SH_PFC_PIN_GROUP(hscif2_ctrl),
  1573. SH_PFC_PIN_GROUP(hscif3_data),
  1574. SH_PFC_PIN_GROUP(hscif3_clk),
  1575. SH_PFC_PIN_GROUP(hscif3_ctrl),
  1576. SH_PFC_PIN_GROUP(i2c0),
  1577. SH_PFC_PIN_GROUP(i2c1),
  1578. SH_PFC_PIN_GROUP(i2c2),
  1579. SH_PFC_PIN_GROUP(i2c3_a),
  1580. SH_PFC_PIN_GROUP(i2c3_b),
  1581. SH_PFC_PIN_GROUP(i2c4),
  1582. SH_PFC_PIN_GROUP(intc_ex_irq0),
  1583. SH_PFC_PIN_GROUP(intc_ex_irq1),
  1584. SH_PFC_PIN_GROUP(intc_ex_irq2),
  1585. SH_PFC_PIN_GROUP(intc_ex_irq3),
  1586. SH_PFC_PIN_GROUP(intc_ex_irq4),
  1587. SH_PFC_PIN_GROUP(intc_ex_irq5),
  1588. BUS_DATA_PIN_GROUP(mmc_data, 1),
  1589. BUS_DATA_PIN_GROUP(mmc_data, 4),
  1590. BUS_DATA_PIN_GROUP(mmc_data, 8),
  1591. SH_PFC_PIN_GROUP(mmc_ctrl),
  1592. SH_PFC_PIN_GROUP(msiof0_clk),
  1593. SH_PFC_PIN_GROUP(msiof0_sync),
  1594. SH_PFC_PIN_GROUP(msiof0_ss1),
  1595. SH_PFC_PIN_GROUP(msiof0_ss2),
  1596. SH_PFC_PIN_GROUP(msiof0_txd),
  1597. SH_PFC_PIN_GROUP(msiof0_rxd),
  1598. SH_PFC_PIN_GROUP(msiof1_clk),
  1599. SH_PFC_PIN_GROUP(msiof1_sync),
  1600. SH_PFC_PIN_GROUP(msiof1_ss1),
  1601. SH_PFC_PIN_GROUP(msiof1_ss2),
  1602. SH_PFC_PIN_GROUP(msiof1_txd),
  1603. SH_PFC_PIN_GROUP(msiof1_rxd),
  1604. SH_PFC_PIN_GROUP(msiof2_clk),
  1605. SH_PFC_PIN_GROUP(msiof2_sync),
  1606. SH_PFC_PIN_GROUP(msiof2_ss1),
  1607. SH_PFC_PIN_GROUP(msiof2_ss2),
  1608. SH_PFC_PIN_GROUP(msiof2_txd),
  1609. SH_PFC_PIN_GROUP(msiof2_rxd),
  1610. SH_PFC_PIN_GROUP(msiof3_clk),
  1611. SH_PFC_PIN_GROUP(msiof3_sync),
  1612. SH_PFC_PIN_GROUP(msiof3_ss1),
  1613. SH_PFC_PIN_GROUP(msiof3_ss2),
  1614. SH_PFC_PIN_GROUP(msiof3_txd),
  1615. SH_PFC_PIN_GROUP(msiof3_rxd),
  1616. SH_PFC_PIN_GROUP(pwm0_a),
  1617. SH_PFC_PIN_GROUP(pwm0_b),
  1618. SH_PFC_PIN_GROUP(pwm1_a),
  1619. SH_PFC_PIN_GROUP(pwm1_b),
  1620. SH_PFC_PIN_GROUP(pwm2_a),
  1621. SH_PFC_PIN_GROUP(pwm2_b),
  1622. SH_PFC_PIN_GROUP(pwm3_a),
  1623. SH_PFC_PIN_GROUP(pwm3_b),
  1624. SH_PFC_PIN_GROUP(pwm4_a),
  1625. SH_PFC_PIN_GROUP(pwm4_b),
  1626. SH_PFC_PIN_GROUP(qspi0_ctrl),
  1627. SH_PFC_PIN_GROUP_SUBSET(qspi0_data2, rpc_data, 0, 2),
  1628. SH_PFC_PIN_GROUP_SUBSET(qspi0_data4, rpc_data, 0, 4),
  1629. SH_PFC_PIN_GROUP(qspi1_ctrl),
  1630. SH_PFC_PIN_GROUP_SUBSET(qspi1_data2, rpc_data, 4, 2),
  1631. SH_PFC_PIN_GROUP_SUBSET(qspi1_data4, rpc_data, 4, 4),
  1632. BUS_DATA_PIN_GROUP(rpc_clk, 1),
  1633. BUS_DATA_PIN_GROUP(rpc_clk, 2),
  1634. SH_PFC_PIN_GROUP(rpc_ctrl),
  1635. SH_PFC_PIN_GROUP(rpc_data),
  1636. SH_PFC_PIN_GROUP(rpc_reset),
  1637. SH_PFC_PIN_GROUP(rpc_int),
  1638. SH_PFC_PIN_GROUP(rpc_wp),
  1639. SH_PFC_PIN_GROUP(scif_clk_a),
  1640. SH_PFC_PIN_GROUP(scif_clk_b),
  1641. SH_PFC_PIN_GROUP(scif0_data),
  1642. SH_PFC_PIN_GROUP(scif0_clk),
  1643. SH_PFC_PIN_GROUP(scif0_ctrl),
  1644. SH_PFC_PIN_GROUP(scif1_data_a),
  1645. SH_PFC_PIN_GROUP(scif1_clk),
  1646. SH_PFC_PIN_GROUP(scif1_ctrl),
  1647. SH_PFC_PIN_GROUP(scif1_data_b),
  1648. SH_PFC_PIN_GROUP(scif3_data),
  1649. SH_PFC_PIN_GROUP(scif3_clk),
  1650. SH_PFC_PIN_GROUP(scif3_ctrl),
  1651. SH_PFC_PIN_GROUP(scif4_data),
  1652. SH_PFC_PIN_GROUP(scif4_clk),
  1653. SH_PFC_PIN_GROUP(scif4_ctrl),
  1654. SH_PFC_PIN_GROUP(tmu_tclk1_a),
  1655. SH_PFC_PIN_GROUP(tmu_tclk1_b),
  1656. SH_PFC_PIN_GROUP(tmu_tclk2_a),
  1657. SH_PFC_PIN_GROUP(tmu_tclk2_b),
  1658. BUS_DATA_PIN_GROUP(vin0_data, 8),
  1659. BUS_DATA_PIN_GROUP(vin0_data, 10),
  1660. BUS_DATA_PIN_GROUP(vin0_data, 12),
  1661. SH_PFC_PIN_GROUP(vin0_sync),
  1662. SH_PFC_PIN_GROUP(vin0_field),
  1663. SH_PFC_PIN_GROUP(vin0_clkenb),
  1664. SH_PFC_PIN_GROUP(vin0_clk),
  1665. BUS_DATA_PIN_GROUP(vin1_data, 8),
  1666. BUS_DATA_PIN_GROUP(vin1_data, 10),
  1667. BUS_DATA_PIN_GROUP(vin1_data, 12),
  1668. SH_PFC_PIN_GROUP(vin1_sync),
  1669. SH_PFC_PIN_GROUP(vin1_field),
  1670. SH_PFC_PIN_GROUP(vin1_clkenb),
  1671. SH_PFC_PIN_GROUP(vin1_clk),
  1672. };
  1673. static const char * const avb0_groups[] = {
  1674. "avb0_link",
  1675. "avb0_magic",
  1676. "avb0_phy_int",
  1677. "avb0_mdio",
  1678. "avb0_rgmii",
  1679. "avb0_txcrefclk",
  1680. "avb0_avtp_pps",
  1681. "avb0_avtp_capture",
  1682. "avb0_avtp_match",
  1683. };
  1684. static const char * const canfd_clk_groups[] = {
  1685. "canfd_clk_a",
  1686. "canfd_clk_b",
  1687. };
  1688. static const char * const canfd0_groups[] = {
  1689. "canfd0_data_a",
  1690. "canfd0_data_b",
  1691. };
  1692. static const char * const canfd1_groups[] = {
  1693. "canfd1_data",
  1694. };
  1695. static const char * const du_groups[] = {
  1696. "du_rgb666",
  1697. "du_clk_out",
  1698. "du_sync",
  1699. "du_oddf",
  1700. "du_cde",
  1701. "du_disp",
  1702. };
  1703. static const char * const hscif0_groups[] = {
  1704. "hscif0_data",
  1705. "hscif0_clk",
  1706. "hscif0_ctrl",
  1707. };
  1708. static const char * const hscif1_groups[] = {
  1709. "hscif1_data",
  1710. "hscif1_clk",
  1711. "hscif1_ctrl",
  1712. };
  1713. static const char * const hscif2_groups[] = {
  1714. "hscif2_data",
  1715. "hscif2_clk",
  1716. "hscif2_ctrl",
  1717. };
  1718. static const char * const hscif3_groups[] = {
  1719. "hscif3_data",
  1720. "hscif3_clk",
  1721. "hscif3_ctrl",
  1722. };
  1723. static const char * const i2c0_groups[] = {
  1724. "i2c0",
  1725. };
  1726. static const char * const i2c1_groups[] = {
  1727. "i2c1",
  1728. };
  1729. static const char * const i2c2_groups[] = {
  1730. "i2c2",
  1731. };
  1732. static const char * const i2c3_groups[] = {
  1733. "i2c3_a",
  1734. "i2c3_b",
  1735. };
  1736. static const char * const i2c4_groups[] = {
  1737. "i2c4",
  1738. };
  1739. static const char * const intc_ex_groups[] = {
  1740. "intc_ex_irq0",
  1741. "intc_ex_irq1",
  1742. "intc_ex_irq2",
  1743. "intc_ex_irq3",
  1744. "intc_ex_irq4",
  1745. "intc_ex_irq5",
  1746. };
  1747. static const char * const mmc_groups[] = {
  1748. "mmc_data1",
  1749. "mmc_data4",
  1750. "mmc_data8",
  1751. "mmc_ctrl",
  1752. };
  1753. static const char * const msiof0_groups[] = {
  1754. "msiof0_clk",
  1755. "msiof0_sync",
  1756. "msiof0_ss1",
  1757. "msiof0_ss2",
  1758. "msiof0_txd",
  1759. "msiof0_rxd",
  1760. };
  1761. static const char * const msiof1_groups[] = {
  1762. "msiof1_clk",
  1763. "msiof1_sync",
  1764. "msiof1_ss1",
  1765. "msiof1_ss2",
  1766. "msiof1_txd",
  1767. "msiof1_rxd",
  1768. };
  1769. static const char * const msiof2_groups[] = {
  1770. "msiof2_clk",
  1771. "msiof2_sync",
  1772. "msiof2_ss1",
  1773. "msiof2_ss2",
  1774. "msiof2_txd",
  1775. "msiof2_rxd",
  1776. };
  1777. static const char * const msiof3_groups[] = {
  1778. "msiof3_clk",
  1779. "msiof3_sync",
  1780. "msiof3_ss1",
  1781. "msiof3_ss2",
  1782. "msiof3_txd",
  1783. "msiof3_rxd",
  1784. };
  1785. static const char * const pwm0_groups[] = {
  1786. "pwm0_a",
  1787. "pwm0_b",
  1788. };
  1789. static const char * const pwm1_groups[] = {
  1790. "pwm1_a",
  1791. "pwm1_b",
  1792. };
  1793. static const char * const pwm2_groups[] = {
  1794. "pwm2_a",
  1795. "pwm2_b",
  1796. };
  1797. static const char * const pwm3_groups[] = {
  1798. "pwm3_a",
  1799. "pwm3_b",
  1800. };
  1801. static const char * const pwm4_groups[] = {
  1802. "pwm4_a",
  1803. "pwm4_b",
  1804. };
  1805. static const char * const qspi0_groups[] = {
  1806. "qspi0_ctrl",
  1807. "qspi0_data2",
  1808. "qspi0_data4",
  1809. };
  1810. static const char * const qspi1_groups[] = {
  1811. "qspi1_ctrl",
  1812. "qspi1_data2",
  1813. "qspi1_data4",
  1814. };
  1815. static const char * const rpc_groups[] = {
  1816. "rpc_clk1",
  1817. "rpc_clk2",
  1818. "rpc_ctrl",
  1819. "rpc_data",
  1820. "rpc_reset",
  1821. "rpc_int",
  1822. "rpc_wp",
  1823. };
  1824. static const char * const scif_clk_groups[] = {
  1825. "scif_clk_a",
  1826. "scif_clk_b",
  1827. };
  1828. static const char * const scif0_groups[] = {
  1829. "scif0_data",
  1830. "scif0_clk",
  1831. "scif0_ctrl",
  1832. };
  1833. static const char * const scif1_groups[] = {
  1834. "scif1_data_a",
  1835. "scif1_clk",
  1836. "scif1_ctrl",
  1837. "scif1_data_b",
  1838. };
  1839. static const char * const scif3_groups[] = {
  1840. "scif3_data",
  1841. "scif3_clk",
  1842. "scif3_ctrl",
  1843. };
  1844. static const char * const scif4_groups[] = {
  1845. "scif4_data",
  1846. "scif4_clk",
  1847. "scif4_ctrl",
  1848. };
  1849. static const char * const tmu_groups[] = {
  1850. "tmu_tclk1_a",
  1851. "tmu_tclk1_b",
  1852. "tmu_tclk2_a",
  1853. "tmu_tclk2_b",
  1854. };
  1855. static const char * const vin0_groups[] = {
  1856. "vin0_data8",
  1857. "vin0_data10",
  1858. "vin0_data12",
  1859. "vin0_sync",
  1860. "vin0_field",
  1861. "vin0_clkenb",
  1862. "vin0_clk",
  1863. };
  1864. static const char * const vin1_groups[] = {
  1865. "vin1_data8",
  1866. "vin1_data10",
  1867. "vin1_data12",
  1868. "vin1_sync",
  1869. "vin1_field",
  1870. "vin1_clkenb",
  1871. "vin1_clk",
  1872. };
  1873. static const struct sh_pfc_function pinmux_functions[] = {
  1874. SH_PFC_FUNCTION(avb0),
  1875. SH_PFC_FUNCTION(canfd_clk),
  1876. SH_PFC_FUNCTION(canfd0),
  1877. SH_PFC_FUNCTION(canfd1),
  1878. SH_PFC_FUNCTION(du),
  1879. SH_PFC_FUNCTION(hscif0),
  1880. SH_PFC_FUNCTION(hscif1),
  1881. SH_PFC_FUNCTION(hscif2),
  1882. SH_PFC_FUNCTION(hscif3),
  1883. SH_PFC_FUNCTION(i2c0),
  1884. SH_PFC_FUNCTION(i2c1),
  1885. SH_PFC_FUNCTION(i2c2),
  1886. SH_PFC_FUNCTION(i2c3),
  1887. SH_PFC_FUNCTION(i2c4),
  1888. SH_PFC_FUNCTION(intc_ex),
  1889. SH_PFC_FUNCTION(mmc),
  1890. SH_PFC_FUNCTION(msiof0),
  1891. SH_PFC_FUNCTION(msiof1),
  1892. SH_PFC_FUNCTION(msiof2),
  1893. SH_PFC_FUNCTION(msiof3),
  1894. SH_PFC_FUNCTION(pwm0),
  1895. SH_PFC_FUNCTION(pwm1),
  1896. SH_PFC_FUNCTION(pwm2),
  1897. SH_PFC_FUNCTION(pwm3),
  1898. SH_PFC_FUNCTION(pwm4),
  1899. SH_PFC_FUNCTION(qspi0),
  1900. SH_PFC_FUNCTION(qspi1),
  1901. SH_PFC_FUNCTION(rpc),
  1902. SH_PFC_FUNCTION(scif_clk),
  1903. SH_PFC_FUNCTION(scif0),
  1904. SH_PFC_FUNCTION(scif1),
  1905. SH_PFC_FUNCTION(scif3),
  1906. SH_PFC_FUNCTION(scif4),
  1907. SH_PFC_FUNCTION(tmu),
  1908. SH_PFC_FUNCTION(vin0),
  1909. SH_PFC_FUNCTION(vin1),
  1910. };
  1911. static const struct pinmux_cfg_reg pinmux_config_regs[] = {
  1912. #define F_(x, y) FN_##y
  1913. #define FM(x) FN_##x
  1914. { PINMUX_CFG_REG_VAR("GPSR0", 0xe6060100, 32,
  1915. GROUP(-10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1916. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  1917. GROUP(
  1918. /* GP0_31_22 RESERVED */
  1919. GP_0_21_FN, GPSR0_21,
  1920. GP_0_20_FN, GPSR0_20,
  1921. GP_0_19_FN, GPSR0_19,
  1922. GP_0_18_FN, GPSR0_18,
  1923. GP_0_17_FN, GPSR0_17,
  1924. GP_0_16_FN, GPSR0_16,
  1925. GP_0_15_FN, GPSR0_15,
  1926. GP_0_14_FN, GPSR0_14,
  1927. GP_0_13_FN, GPSR0_13,
  1928. GP_0_12_FN, GPSR0_12,
  1929. GP_0_11_FN, GPSR0_11,
  1930. GP_0_10_FN, GPSR0_10,
  1931. GP_0_9_FN, GPSR0_9,
  1932. GP_0_8_FN, GPSR0_8,
  1933. GP_0_7_FN, GPSR0_7,
  1934. GP_0_6_FN, GPSR0_6,
  1935. GP_0_5_FN, GPSR0_5,
  1936. GP_0_4_FN, GPSR0_4,
  1937. GP_0_3_FN, GPSR0_3,
  1938. GP_0_2_FN, GPSR0_2,
  1939. GP_0_1_FN, GPSR0_1,
  1940. GP_0_0_FN, GPSR0_0, ))
  1941. },
  1942. { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1, GROUP(
  1943. 0, 0,
  1944. 0, 0,
  1945. 0, 0,
  1946. 0, 0,
  1947. GP_1_27_FN, GPSR1_27,
  1948. GP_1_26_FN, GPSR1_26,
  1949. GP_1_25_FN, GPSR1_25,
  1950. GP_1_24_FN, GPSR1_24,
  1951. GP_1_23_FN, GPSR1_23,
  1952. GP_1_22_FN, GPSR1_22,
  1953. GP_1_21_FN, GPSR1_21,
  1954. GP_1_20_FN, GPSR1_20,
  1955. GP_1_19_FN, GPSR1_19,
  1956. GP_1_18_FN, GPSR1_18,
  1957. GP_1_17_FN, GPSR1_17,
  1958. GP_1_16_FN, GPSR1_16,
  1959. GP_1_15_FN, GPSR1_15,
  1960. GP_1_14_FN, GPSR1_14,
  1961. GP_1_13_FN, GPSR1_13,
  1962. GP_1_12_FN, GPSR1_12,
  1963. GP_1_11_FN, GPSR1_11,
  1964. GP_1_10_FN, GPSR1_10,
  1965. GP_1_9_FN, GPSR1_9,
  1966. GP_1_8_FN, GPSR1_8,
  1967. GP_1_7_FN, GPSR1_7,
  1968. GP_1_6_FN, GPSR1_6,
  1969. GP_1_5_FN, GPSR1_5,
  1970. GP_1_4_FN, GPSR1_4,
  1971. GP_1_3_FN, GPSR1_3,
  1972. GP_1_2_FN, GPSR1_2,
  1973. GP_1_1_FN, GPSR1_1,
  1974. GP_1_0_FN, GPSR1_0, ))
  1975. },
  1976. { PINMUX_CFG_REG_VAR("GPSR2", 0xe6060108, 32,
  1977. GROUP(-15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1978. 1, 1, 1, 1, 1, 1),
  1979. GROUP(
  1980. /* GP2_31_17 RESERVED */
  1981. GP_2_16_FN, GPSR2_16,
  1982. GP_2_15_FN, GPSR2_15,
  1983. GP_2_14_FN, GPSR2_14,
  1984. GP_2_13_FN, GPSR2_13,
  1985. GP_2_12_FN, GPSR2_12,
  1986. GP_2_11_FN, GPSR2_11,
  1987. GP_2_10_FN, GPSR2_10,
  1988. GP_2_9_FN, GPSR2_9,
  1989. GP_2_8_FN, GPSR2_8,
  1990. GP_2_7_FN, GPSR2_7,
  1991. GP_2_6_FN, GPSR2_6,
  1992. GP_2_5_FN, GPSR2_5,
  1993. GP_2_4_FN, GPSR2_4,
  1994. GP_2_3_FN, GPSR2_3,
  1995. GP_2_2_FN, GPSR2_2,
  1996. GP_2_1_FN, GPSR2_1,
  1997. GP_2_0_FN, GPSR2_0, ))
  1998. },
  1999. { PINMUX_CFG_REG_VAR("GPSR3", 0xe606010c, 32,
  2000. GROUP(-15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  2001. 1, 1, 1, 1, 1, 1),
  2002. GROUP(
  2003. /* GP3_31_17 RESERVED */
  2004. GP_3_16_FN, GPSR3_16,
  2005. GP_3_15_FN, GPSR3_15,
  2006. GP_3_14_FN, GPSR3_14,
  2007. GP_3_13_FN, GPSR3_13,
  2008. GP_3_12_FN, GPSR3_12,
  2009. GP_3_11_FN, GPSR3_11,
  2010. GP_3_10_FN, GPSR3_10,
  2011. GP_3_9_FN, GPSR3_9,
  2012. GP_3_8_FN, GPSR3_8,
  2013. GP_3_7_FN, GPSR3_7,
  2014. GP_3_6_FN, GPSR3_6,
  2015. GP_3_5_FN, GPSR3_5,
  2016. GP_3_4_FN, GPSR3_4,
  2017. GP_3_3_FN, GPSR3_3,
  2018. GP_3_2_FN, GPSR3_2,
  2019. GP_3_1_FN, GPSR3_1,
  2020. GP_3_0_FN, GPSR3_0, ))
  2021. },
  2022. { PINMUX_CFG_REG_VAR("GPSR4", 0xe6060110, 32,
  2023. GROUP(-26, 1, 1, 1, 1, 1, 1),
  2024. GROUP(
  2025. /* GP4_31_6 RESERVED */
  2026. GP_4_5_FN, GPSR4_5,
  2027. GP_4_4_FN, GPSR4_4,
  2028. GP_4_3_FN, GPSR4_3,
  2029. GP_4_2_FN, GPSR4_2,
  2030. GP_4_1_FN, GPSR4_1,
  2031. GP_4_0_FN, GPSR4_0, ))
  2032. },
  2033. { PINMUX_CFG_REG_VAR("GPSR5", 0xe6060114, 32,
  2034. GROUP(-17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  2035. 1, 1, 1, 1),
  2036. GROUP(
  2037. /* GP5_31_15 RESERVED */
  2038. GP_5_14_FN, GPSR5_14,
  2039. GP_5_13_FN, GPSR5_13,
  2040. GP_5_12_FN, GPSR5_12,
  2041. GP_5_11_FN, GPSR5_11,
  2042. GP_5_10_FN, GPSR5_10,
  2043. GP_5_9_FN, GPSR5_9,
  2044. GP_5_8_FN, GPSR5_8,
  2045. GP_5_7_FN, GPSR5_7,
  2046. GP_5_6_FN, GPSR5_6,
  2047. GP_5_5_FN, GPSR5_5,
  2048. GP_5_4_FN, GPSR5_4,
  2049. GP_5_3_FN, GPSR5_3,
  2050. GP_5_2_FN, GPSR5_2,
  2051. GP_5_1_FN, GPSR5_1,
  2052. GP_5_0_FN, GPSR5_0, ))
  2053. },
  2054. #undef F_
  2055. #undef FM
  2056. #define F_(x, y) x,
  2057. #define FM(x) FN_##x,
  2058. { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4, GROUP(
  2059. IP0_31_28
  2060. IP0_27_24
  2061. IP0_23_20
  2062. IP0_19_16
  2063. IP0_15_12
  2064. IP0_11_8
  2065. IP0_7_4
  2066. IP0_3_0 ))
  2067. },
  2068. { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4, GROUP(
  2069. IP1_31_28
  2070. IP1_27_24
  2071. IP1_23_20
  2072. IP1_19_16
  2073. IP1_15_12
  2074. IP1_11_8
  2075. IP1_7_4
  2076. IP1_3_0 ))
  2077. },
  2078. { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4, GROUP(
  2079. IP2_31_28
  2080. IP2_27_24
  2081. IP2_23_20
  2082. IP2_19_16
  2083. IP2_15_12
  2084. IP2_11_8
  2085. IP2_7_4
  2086. IP2_3_0 ))
  2087. },
  2088. { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4, GROUP(
  2089. IP3_31_28
  2090. IP3_27_24
  2091. IP3_23_20
  2092. IP3_19_16
  2093. IP3_15_12
  2094. IP3_11_8
  2095. IP3_7_4
  2096. IP3_3_0 ))
  2097. },
  2098. { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4, GROUP(
  2099. IP4_31_28
  2100. IP4_27_24
  2101. IP4_23_20
  2102. IP4_19_16
  2103. IP4_15_12
  2104. IP4_11_8
  2105. IP4_7_4
  2106. IP4_3_0 ))
  2107. },
  2108. { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4, GROUP(
  2109. IP5_31_28
  2110. IP5_27_24
  2111. IP5_23_20
  2112. IP5_19_16
  2113. IP5_15_12
  2114. IP5_11_8
  2115. IP5_7_4
  2116. IP5_3_0 ))
  2117. },
  2118. { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4, GROUP(
  2119. IP6_31_28
  2120. IP6_27_24
  2121. IP6_23_20
  2122. IP6_19_16
  2123. IP6_15_12
  2124. IP6_11_8
  2125. IP6_7_4
  2126. IP6_3_0 ))
  2127. },
  2128. { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4, GROUP(
  2129. IP7_31_28
  2130. IP7_27_24
  2131. IP7_23_20
  2132. IP7_19_16
  2133. IP7_15_12
  2134. IP7_11_8
  2135. IP7_7_4
  2136. IP7_3_0 ))
  2137. },
  2138. { PINMUX_CFG_REG_VAR("IPSR8", 0xe6060220, 32,
  2139. GROUP(-4, 4, 4, 4, 4, 4, 4, 4),
  2140. GROUP(
  2141. /* IP8_31_28 RESERVED */
  2142. IP8_27_24
  2143. IP8_23_20
  2144. IP8_19_16
  2145. IP8_15_12
  2146. IP8_11_8
  2147. IP8_7_4
  2148. IP8_3_0 ))
  2149. },
  2150. #undef F_
  2151. #undef FM
  2152. #define F_(x, y) x,
  2153. #define FM(x) FN_##x,
  2154. { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
  2155. GROUP(-20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  2156. GROUP(
  2157. /* RESERVED 31-12 */
  2158. MOD_SEL0_11
  2159. MOD_SEL0_10
  2160. MOD_SEL0_9
  2161. MOD_SEL0_8
  2162. MOD_SEL0_7
  2163. MOD_SEL0_6
  2164. MOD_SEL0_5
  2165. MOD_SEL0_4
  2166. MOD_SEL0_3
  2167. MOD_SEL0_2
  2168. MOD_SEL0_1
  2169. MOD_SEL0_0 ))
  2170. },
  2171. { },
  2172. };
  2173. enum ioctrl_regs {
  2174. POCCTRL0,
  2175. POCCTRL1,
  2176. POCCTRL2,
  2177. TDSELCTRL,
  2178. };
  2179. static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
  2180. [POCCTRL0] = { 0xe6060380 },
  2181. [POCCTRL1] = { 0xe6060384 },
  2182. [POCCTRL2] = { 0xe6060388 },
  2183. [TDSELCTRL] = { 0xe60603c0, },
  2184. { /* sentinel */ },
  2185. };
  2186. static int r8a77970_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
  2187. {
  2188. int bit = pin & 0x1f;
  2189. *pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
  2190. if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
  2191. return bit;
  2192. if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
  2193. return bit + 22;
  2194. *pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
  2195. if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
  2196. return bit - 10;
  2197. if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16))
  2198. return bit + 7;
  2199. return -EINVAL;
  2200. }
  2201. static const struct pinmux_bias_reg pinmux_bias_regs[] = {
  2202. { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) {
  2203. [ 0] = RCAR_GP_PIN(0, 0), /* DU_DR2 */
  2204. [ 1] = RCAR_GP_PIN(0, 1), /* DU_DR3 */
  2205. [ 2] = RCAR_GP_PIN(0, 2), /* DU_DR4 */
  2206. [ 3] = RCAR_GP_PIN(0, 3), /* DU_DR5 */
  2207. [ 4] = RCAR_GP_PIN(0, 4), /* DU_DR6 */
  2208. [ 5] = RCAR_GP_PIN(0, 5), /* DU_DR7 */
  2209. [ 6] = RCAR_GP_PIN(0, 6), /* DU_DG2 */
  2210. [ 7] = RCAR_GP_PIN(0, 7), /* DU_DG3 */
  2211. [ 8] = RCAR_GP_PIN(0, 8), /* DU_DG4 */
  2212. [ 9] = RCAR_GP_PIN(0, 9), /* DU_DG5 */
  2213. [10] = RCAR_GP_PIN(0, 10), /* DU_DG6 */
  2214. [11] = RCAR_GP_PIN(0, 11), /* DU_DG7 */
  2215. [12] = RCAR_GP_PIN(0, 12), /* DU_DB2 */
  2216. [13] = RCAR_GP_PIN(0, 13), /* DU_DB3 */
  2217. [14] = RCAR_GP_PIN(0, 14), /* DU_DB4 */
  2218. [15] = RCAR_GP_PIN(0, 15), /* DU_DB5 */
  2219. [16] = RCAR_GP_PIN(0, 16), /* DU_DB6 */
  2220. [17] = RCAR_GP_PIN(0, 17), /* DU_DB7 */
  2221. [18] = RCAR_GP_PIN(0, 18), /* DU_DOTCLKOUT */
  2222. [19] = RCAR_GP_PIN(0, 19), /* DU_EXHSYNC/DU_HSYNC */
  2223. [20] = RCAR_GP_PIN(0, 20), /* DU_EXVSYNC/DU_VSYNC */
  2224. [21] = RCAR_GP_PIN(0, 21), /* DU_EXODDF/DU_ODDF/DISP/CDE */
  2225. [22] = PIN_DU_DOTCLKIN, /* DU_DOTCLKIN */
  2226. [23] = PIN_PRESETOUT_N, /* PRESETOUT# */
  2227. [24] = PIN_EXTALR, /* EXTALR */
  2228. [25] = PIN_FSCLKST_N, /* FSCLKST# */
  2229. [26] = RCAR_GP_PIN(1, 0), /* IRQ0 */
  2230. [27] = PIN_TRST_N, /* TRST# */
  2231. [28] = PIN_TCK, /* TCK */
  2232. [29] = PIN_TMS, /* TMS */
  2233. [30] = PIN_TDI, /* TDI */
  2234. [31] = RCAR_GP_PIN(2, 0), /* VI0_CLK */
  2235. } },
  2236. { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) {
  2237. [ 0] = RCAR_GP_PIN(2, 1), /* VI0_CLKENB */
  2238. [ 1] = RCAR_GP_PIN(2, 2), /* VI0_HSYNC# */
  2239. [ 2] = RCAR_GP_PIN(2, 3), /* VI0_VSYNC# */
  2240. [ 3] = RCAR_GP_PIN(2, 4), /* VI0_DATA0 */
  2241. [ 4] = RCAR_GP_PIN(2, 5), /* VI0_DATA1 */
  2242. [ 5] = RCAR_GP_PIN(2, 6), /* VI0_DATA2 */
  2243. [ 6] = RCAR_GP_PIN(2, 7), /* VI0_DATA3 */
  2244. [ 7] = RCAR_GP_PIN(2, 8), /* VI0_DATA4 */
  2245. [ 8] = RCAR_GP_PIN(2, 9), /* VI0_DATA5 */
  2246. [ 9] = RCAR_GP_PIN(2, 10), /* VI0_DATA6 */
  2247. [10] = RCAR_GP_PIN(2, 11), /* VI0_DATA7 */
  2248. [11] = RCAR_GP_PIN(2, 12), /* VI0_DATA8 */
  2249. [12] = RCAR_GP_PIN(2, 13), /* VI0_DATA9 */
  2250. [13] = RCAR_GP_PIN(2, 14), /* VI0_DATA10 */
  2251. [14] = RCAR_GP_PIN(2, 15), /* VI0_DATA11 */
  2252. [15] = RCAR_GP_PIN(2, 16), /* VI0_FIELD */
  2253. [16] = RCAR_GP_PIN(3, 0), /* VI1_CLK */
  2254. [17] = RCAR_GP_PIN(3, 1), /* VI1_CLKENB */
  2255. [18] = RCAR_GP_PIN(3, 2), /* VI1_HSYNC# */
  2256. [19] = RCAR_GP_PIN(3, 3), /* VI1_VSYNC# */
  2257. [20] = RCAR_GP_PIN(3, 4), /* VI1_DATA0 */
  2258. [21] = RCAR_GP_PIN(3, 5), /* VI1_DATA1 */
  2259. [22] = RCAR_GP_PIN(3, 6), /* VI1_DATA2 */
  2260. [23] = RCAR_GP_PIN(3, 7), /* VI1_DATA3 */
  2261. [24] = RCAR_GP_PIN(3, 8), /* VI1_DATA4 */
  2262. [25] = RCAR_GP_PIN(3, 9), /* VI1_DATA5 */
  2263. [26] = RCAR_GP_PIN(3, 10), /* VI1_DATA6 */
  2264. [27] = RCAR_GP_PIN(3, 11), /* VI1_DATA7 */
  2265. [28] = RCAR_GP_PIN(3, 12), /* VI1_DATA8 */
  2266. [29] = RCAR_GP_PIN(3, 13), /* VI1_DATA9 */
  2267. [30] = RCAR_GP_PIN(3, 14), /* VI1_DATA10 */
  2268. [31] = RCAR_GP_PIN(3, 15), /* VI1_DATA11 */
  2269. } },
  2270. { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) {
  2271. [ 0] = RCAR_GP_PIN(3, 16), /* VI1_FIELD */
  2272. [ 1] = RCAR_GP_PIN(4, 0), /* SCL0 */
  2273. [ 2] = RCAR_GP_PIN(4, 1), /* SDA0 */
  2274. [ 3] = RCAR_GP_PIN(4, 2), /* SCL1 */
  2275. [ 4] = RCAR_GP_PIN(4, 3), /* SDA1 */
  2276. [ 5] = RCAR_GP_PIN(4, 4), /* SCL2 */
  2277. [ 6] = RCAR_GP_PIN(4, 5), /* SDA2 */
  2278. [ 7] = RCAR_GP_PIN(1, 1), /* AVB0_RX_CTL */
  2279. [ 8] = RCAR_GP_PIN(1, 2), /* AVB0_RXC */
  2280. [ 9] = RCAR_GP_PIN(1, 3), /* AVB0_RD0 */
  2281. [10] = RCAR_GP_PIN(1, 4), /* AVB0_RD1 */
  2282. [11] = RCAR_GP_PIN(1, 5), /* AVB0_RD2 */
  2283. [12] = RCAR_GP_PIN(1, 6), /* AVB0_RD3 */
  2284. [13] = RCAR_GP_PIN(1, 7), /* AVB0_TX_CTL */
  2285. [14] = RCAR_GP_PIN(1, 8), /* AVB0_TXC */
  2286. [15] = RCAR_GP_PIN(1, 9), /* AVB0_TD0 */
  2287. [16] = RCAR_GP_PIN(1, 10), /* AVB0_TD1 */
  2288. [17] = RCAR_GP_PIN(1, 11), /* AVB0_TD2 */
  2289. [18] = RCAR_GP_PIN(1, 12), /* AVB0_TD3 */
  2290. [19] = RCAR_GP_PIN(1, 13), /* AVB0_TXCREFCLK */
  2291. [20] = RCAR_GP_PIN(1, 14), /* AVB0_MDIO */
  2292. [21] = RCAR_GP_PIN(1, 15), /* AVB0_MDC */
  2293. [22] = RCAR_GP_PIN(1, 16), /* AVB0_MAGIC */
  2294. [23] = RCAR_GP_PIN(1, 17), /* AVB0_PHY_INT */
  2295. [24] = RCAR_GP_PIN(1, 18), /* AVB0_LINK */
  2296. [25] = RCAR_GP_PIN(1, 19), /* AVB0_AVTP_MATCH */
  2297. [26] = RCAR_GP_PIN(1, 20), /* AVB0_AVTP_CAPTURE */
  2298. [27] = RCAR_GP_PIN(1, 21), /* CANFD0_TX_A */
  2299. [28] = RCAR_GP_PIN(1, 22), /* CANFD0_RX_A */
  2300. [29] = RCAR_GP_PIN(1, 23), /* CANFD1_TX */
  2301. [30] = RCAR_GP_PIN(1, 24), /* CANFD1_RX */
  2302. [31] = RCAR_GP_PIN(1, 25), /* CANFD_CLK */
  2303. } },
  2304. { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) {
  2305. [ 0] = RCAR_GP_PIN(5, 0), /* QSPI0_SPCLK */
  2306. [ 1] = RCAR_GP_PIN(5, 1), /* QSPI0_MOSI_IO0 */
  2307. [ 2] = RCAR_GP_PIN(5, 2), /* QSPI0_MISO_IO1 */
  2308. [ 3] = RCAR_GP_PIN(5, 3), /* QSPI0_IO2 */
  2309. [ 4] = RCAR_GP_PIN(5, 4), /* QSPI0_IO3 */
  2310. [ 5] = RCAR_GP_PIN(5, 5), /* QSPI0_SSL */
  2311. [ 6] = RCAR_GP_PIN(5, 6), /* QSPI1_SPCLK */
  2312. [ 7] = RCAR_GP_PIN(5, 7), /* QSPI1_MOSI_IO0 */
  2313. [ 8] = RCAR_GP_PIN(5, 8), /* QSPI1_MISO_IO1 */
  2314. [ 9] = RCAR_GP_PIN(5, 9), /* QSPI1_IO2 */
  2315. [10] = RCAR_GP_PIN(5, 10), /* QSPI1_IO3 */
  2316. [11] = RCAR_GP_PIN(5, 11), /* QSPI1_SSL */
  2317. [12] = RCAR_GP_PIN(5, 12), /* RPC_RESET# */
  2318. [13] = RCAR_GP_PIN(5, 13), /* RPC_WP# */
  2319. [14] = RCAR_GP_PIN(5, 14), /* RPC_INT# */
  2320. [15] = RCAR_GP_PIN(1, 26), /* DIGRF_CLKIN */
  2321. [16] = RCAR_GP_PIN(1, 27), /* DIGRF_CLKOUT */
  2322. [17] = SH_PFC_PIN_NONE,
  2323. [18] = SH_PFC_PIN_NONE,
  2324. [19] = SH_PFC_PIN_NONE,
  2325. [20] = SH_PFC_PIN_NONE,
  2326. [21] = SH_PFC_PIN_NONE,
  2327. [22] = SH_PFC_PIN_NONE,
  2328. [23] = SH_PFC_PIN_NONE,
  2329. [24] = SH_PFC_PIN_NONE,
  2330. [25] = SH_PFC_PIN_NONE,
  2331. [26] = SH_PFC_PIN_NONE,
  2332. [27] = SH_PFC_PIN_NONE,
  2333. [28] = SH_PFC_PIN_NONE,
  2334. [29] = SH_PFC_PIN_NONE,
  2335. [30] = SH_PFC_PIN_NONE,
  2336. [31] = SH_PFC_PIN_NONE,
  2337. } },
  2338. { /* sentinel */ }
  2339. };
  2340. static const struct sh_pfc_soc_operations r8a77970_pfc_ops = {
  2341. .pin_to_pocctrl = r8a77970_pin_to_pocctrl,
  2342. .get_bias = rcar_pinmux_get_bias,
  2343. .set_bias = rcar_pinmux_set_bias,
  2344. };
  2345. const struct sh_pfc_soc_info r8a77970_pinmux_info = {
  2346. .name = "r8a77970_pfc",
  2347. .ops = &r8a77970_pfc_ops,
  2348. .unlock_reg = 0xe6060000, /* PMMR */
  2349. .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
  2350. .pins = pinmux_pins,
  2351. .nr_pins = ARRAY_SIZE(pinmux_pins),
  2352. .groups = pinmux_groups,
  2353. .nr_groups = ARRAY_SIZE(pinmux_groups),
  2354. .functions = pinmux_functions,
  2355. .nr_functions = ARRAY_SIZE(pinmux_functions),
  2356. .cfg_regs = pinmux_config_regs,
  2357. .bias_regs = pinmux_bias_regs,
  2358. .ioctrl_regs = pinmux_ioctrl_regs,
  2359. .pinmux_data = pinmux_data,
  2360. .pinmux_data_size = ARRAY_SIZE(pinmux_data),
  2361. };