pfc-sh7372.c 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665
  1. /*
  2. * sh7372 processor support - PFC hardware block
  3. *
  4. * Copyright (C) 2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>
  5. *
  6. * Based on
  7. * sh7367 processor support - PFC hardware block
  8. * Copyright (C) 2010 Magnus Damm
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; version 2 of the License.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #include <linux/io.h>
  24. #include <linux/kernel.h>
  25. #include <linux/pinctrl/pinconf-generic.h>
  26. #include <mach/irqs.h>
  27. #include <mach/sh7372.h>
  28. #include "core.h"
  29. #include "sh_pfc.h"
  30. #define CPU_ALL_PORT(fn, pfx, sfx) \
  31. PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \
  32. PORT_10(fn, pfx##10, sfx), PORT_10(fn, pfx##11, sfx), \
  33. PORT_10(fn, pfx##12, sfx), PORT_10(fn, pfx##13, sfx), \
  34. PORT_10(fn, pfx##14, sfx), PORT_10(fn, pfx##15, sfx), \
  35. PORT_10(fn, pfx##16, sfx), PORT_10(fn, pfx##17, sfx), \
  36. PORT_10(fn, pfx##18, sfx), PORT_1(fn, pfx##190, sfx)
  37. #define IRQC_PIN_MUX(irq, pin) \
  38. static const unsigned int intc_irq##irq##_pins[] = { \
  39. pin, \
  40. }; \
  41. static const unsigned int intc_irq##irq##_mux[] = { \
  42. IRQ##irq##_MARK, \
  43. }
  44. #define IRQC_PINS_MUX(irq, pin0, pin1) \
  45. static const unsigned int intc_irq##irq##_0_pins[] = { \
  46. pin0, \
  47. }; \
  48. static const unsigned int intc_irq##irq##_0_mux[] = { \
  49. IRQ##irq##_##pin0##_MARK, \
  50. }; \
  51. static const unsigned int intc_irq##irq##_1_pins[] = { \
  52. pin1, \
  53. }; \
  54. static const unsigned int intc_irq##irq##_1_mux[] = { \
  55. IRQ##irq##_##pin1##_MARK, \
  56. }
  57. enum {
  58. PINMUX_RESERVED = 0,
  59. /* PORT0_DATA -> PORT190_DATA */
  60. PINMUX_DATA_BEGIN,
  61. PORT_ALL(DATA),
  62. PINMUX_DATA_END,
  63. /* PORT0_IN -> PORT190_IN */
  64. PINMUX_INPUT_BEGIN,
  65. PORT_ALL(IN),
  66. PINMUX_INPUT_END,
  67. /* PORT0_OUT -> PORT190_OUT */
  68. PINMUX_OUTPUT_BEGIN,
  69. PORT_ALL(OUT),
  70. PINMUX_OUTPUT_END,
  71. PINMUX_FUNCTION_BEGIN,
  72. PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT190_FN_IN */
  73. PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT190_FN_OUT */
  74. PORT_ALL(FN0), /* PORT0_FN0 -> PORT190_FN0 */
  75. PORT_ALL(FN1), /* PORT0_FN1 -> PORT190_FN1 */
  76. PORT_ALL(FN2), /* PORT0_FN2 -> PORT190_FN2 */
  77. PORT_ALL(FN3), /* PORT0_FN3 -> PORT190_FN3 */
  78. PORT_ALL(FN4), /* PORT0_FN4 -> PORT190_FN4 */
  79. PORT_ALL(FN5), /* PORT0_FN5 -> PORT190_FN5 */
  80. PORT_ALL(FN6), /* PORT0_FN6 -> PORT190_FN6 */
  81. PORT_ALL(FN7), /* PORT0_FN7 -> PORT190_FN7 */
  82. MSEL1CR_31_0, MSEL1CR_31_1,
  83. MSEL1CR_30_0, MSEL1CR_30_1,
  84. MSEL1CR_29_0, MSEL1CR_29_1,
  85. MSEL1CR_28_0, MSEL1CR_28_1,
  86. MSEL1CR_27_0, MSEL1CR_27_1,
  87. MSEL1CR_26_0, MSEL1CR_26_1,
  88. MSEL1CR_16_0, MSEL1CR_16_1,
  89. MSEL1CR_15_0, MSEL1CR_15_1,
  90. MSEL1CR_14_0, MSEL1CR_14_1,
  91. MSEL1CR_13_0, MSEL1CR_13_1,
  92. MSEL1CR_12_0, MSEL1CR_12_1,
  93. MSEL1CR_9_0, MSEL1CR_9_1,
  94. MSEL1CR_8_0, MSEL1CR_8_1,
  95. MSEL1CR_7_0, MSEL1CR_7_1,
  96. MSEL1CR_6_0, MSEL1CR_6_1,
  97. MSEL1CR_4_0, MSEL1CR_4_1,
  98. MSEL1CR_3_0, MSEL1CR_3_1,
  99. MSEL1CR_2_0, MSEL1CR_2_1,
  100. MSEL1CR_0_0, MSEL1CR_0_1,
  101. MSEL3CR_27_0, MSEL3CR_27_1,
  102. MSEL3CR_26_0, MSEL3CR_26_1,
  103. MSEL3CR_21_0, MSEL3CR_21_1,
  104. MSEL3CR_20_0, MSEL3CR_20_1,
  105. MSEL3CR_15_0, MSEL3CR_15_1,
  106. MSEL3CR_9_0, MSEL3CR_9_1,
  107. MSEL3CR_6_0, MSEL3CR_6_1,
  108. MSEL4CR_19_0, MSEL4CR_19_1,
  109. MSEL4CR_18_0, MSEL4CR_18_1,
  110. MSEL4CR_17_0, MSEL4CR_17_1,
  111. MSEL4CR_16_0, MSEL4CR_16_1,
  112. MSEL4CR_15_0, MSEL4CR_15_1,
  113. MSEL4CR_14_0, MSEL4CR_14_1,
  114. MSEL4CR_10_0, MSEL4CR_10_1,
  115. MSEL4CR_6_0, MSEL4CR_6_1,
  116. MSEL4CR_4_0, MSEL4CR_4_1,
  117. MSEL4CR_1_0, MSEL4CR_1_1,
  118. PINMUX_FUNCTION_END,
  119. PINMUX_MARK_BEGIN,
  120. /* IRQ */
  121. IRQ0_6_MARK, IRQ0_162_MARK, IRQ1_MARK, IRQ2_4_MARK,
  122. IRQ2_5_MARK, IRQ3_8_MARK, IRQ3_16_MARK, IRQ4_17_MARK,
  123. IRQ4_163_MARK, IRQ5_MARK, IRQ6_39_MARK, IRQ6_164_MARK,
  124. IRQ7_40_MARK, IRQ7_167_MARK, IRQ8_41_MARK, IRQ8_168_MARK,
  125. IRQ9_42_MARK, IRQ9_169_MARK, IRQ10_MARK, IRQ11_MARK,
  126. IRQ12_80_MARK, IRQ12_137_MARK, IRQ13_81_MARK, IRQ13_145_MARK,
  127. IRQ14_82_MARK, IRQ14_146_MARK, IRQ15_83_MARK, IRQ15_147_MARK,
  128. IRQ16_84_MARK, IRQ16_170_MARK, IRQ17_MARK, IRQ18_MARK,
  129. IRQ19_MARK, IRQ20_MARK, IRQ21_MARK, IRQ22_MARK,
  130. IRQ23_MARK, IRQ24_MARK, IRQ25_MARK, IRQ26_121_MARK,
  131. IRQ26_172_MARK, IRQ27_122_MARK, IRQ27_180_MARK, IRQ28_123_MARK,
  132. IRQ28_181_MARK, IRQ29_129_MARK, IRQ29_182_MARK, IRQ30_130_MARK,
  133. IRQ30_183_MARK, IRQ31_138_MARK, IRQ31_184_MARK,
  134. /* MSIOF0 */
  135. MSIOF0_TSYNC_MARK, MSIOF0_TSCK_MARK, MSIOF0_RXD_MARK,
  136. MSIOF0_RSCK_MARK, MSIOF0_RSYNC_MARK, MSIOF0_MCK0_MARK,
  137. MSIOF0_MCK1_MARK, MSIOF0_SS1_MARK, MSIOF0_SS2_MARK,
  138. MSIOF0_TXD_MARK,
  139. /* MSIOF1 */
  140. MSIOF1_TSCK_39_MARK, MSIOF1_TSYNC_40_MARK,
  141. MSIOF1_TSCK_88_MARK, MSIOF1_TSYNC_89_MARK,
  142. MSIOF1_TXD_41_MARK, MSIOF1_RXD_42_MARK,
  143. MSIOF1_TXD_90_MARK, MSIOF1_RXD_91_MARK,
  144. MSIOF1_SS1_43_MARK, MSIOF1_SS2_44_MARK,
  145. MSIOF1_SS1_92_MARK, MSIOF1_SS2_93_MARK,
  146. MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
  147. MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
  148. /* MSIOF2 */
  149. MSIOF2_RSCK_MARK, MSIOF2_RSYNC_MARK, MSIOF2_MCK0_MARK,
  150. MSIOF2_MCK1_MARK, MSIOF2_SS1_MARK, MSIOF2_SS2_MARK,
  151. MSIOF2_TSYNC_MARK, MSIOF2_TSCK_MARK, MSIOF2_RXD_MARK,
  152. MSIOF2_TXD_MARK,
  153. /* BBIF1 */
  154. BBIF1_RXD_MARK, BBIF1_TSYNC_MARK, BBIF1_TSCK_MARK,
  155. BBIF1_TXD_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
  156. BBIF1_FLOW_MARK, BB_RX_FLOW_N_MARK,
  157. /* BBIF2 */
  158. BBIF2_TSCK1_MARK, BBIF2_TSYNC1_MARK,
  159. BBIF2_TXD1_MARK, BBIF2_RXD_MARK,
  160. /* FSI */
  161. FSIACK_MARK, FSIBCK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
  162. FSIAISLD_MARK, FSIAOMC_MARK, FSIAOLR_MARK, FSIAOBT_MARK,
  163. FSIAOSLD_MARK, FSIASPDIF_11_MARK, FSIASPDIF_15_MARK,
  164. /* FMSI */
  165. FMSOCK_MARK, FMSOOLR_MARK, FMSIOLR_MARK, FMSOOBT_MARK,
  166. FMSIOBT_MARK, FMSOSLD_MARK, FMSOILR_MARK, FMSIILR_MARK,
  167. FMSOIBT_MARK, FMSIIBT_MARK, FMSISLD_MARK, FMSICK_MARK,
  168. /* SCIFA0 */
  169. SCIFA0_TXD_MARK, SCIFA0_RXD_MARK, SCIFA0_SCK_MARK,
  170. SCIFA0_RTS_MARK, SCIFA0_CTS_MARK,
  171. /* SCIFA1 */
  172. SCIFA1_TXD_MARK, SCIFA1_RXD_MARK, SCIFA1_SCK_MARK,
  173. SCIFA1_RTS_MARK, SCIFA1_CTS_MARK,
  174. /* SCIFA2 */
  175. SCIFA2_CTS1_MARK, SCIFA2_RTS1_MARK, SCIFA2_TXD1_MARK,
  176. SCIFA2_RXD1_MARK, SCIFA2_SCK1_MARK,
  177. /* SCIFA3 */
  178. SCIFA3_CTS_43_MARK, SCIFA3_CTS_140_MARK, SCIFA3_RTS_44_MARK,
  179. SCIFA3_RTS_141_MARK, SCIFA3_SCK_MARK, SCIFA3_TXD_MARK,
  180. SCIFA3_RXD_MARK,
  181. /* SCIFA4 */
  182. SCIFA4_RXD_MARK, SCIFA4_TXD_MARK,
  183. /* SCIFA5 */
  184. SCIFA5_RXD_MARK, SCIFA5_TXD_MARK,
  185. /* SCIFB */
  186. SCIFB_SCK_MARK, SCIFB_RTS_MARK, SCIFB_CTS_MARK,
  187. SCIFB_TXD_MARK, SCIFB_RXD_MARK,
  188. /* CEU */
  189. VIO_HD_MARK, VIO_CKO1_MARK, VIO_CKO2_MARK, VIO_VD_MARK,
  190. VIO_CLK_MARK, VIO_FIELD_MARK, VIO_CKO_MARK,
  191. VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK, VIO_D3_MARK,
  192. VIO_D4_MARK, VIO_D5_MARK, VIO_D6_MARK, VIO_D7_MARK,
  193. VIO_D8_MARK, VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
  194. VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK, VIO_D15_MARK,
  195. /* USB0 */
  196. IDIN_0_MARK, EXTLP_0_MARK, OVCN2_0_MARK, PWEN_0_MARK,
  197. OVCN_0_MARK, VBUS0_0_MARK,
  198. /* USB1 */
  199. IDIN_1_18_MARK, IDIN_1_113_MARK,
  200. PWEN_1_115_MARK, PWEN_1_138_MARK,
  201. OVCN_1_114_MARK, OVCN_1_162_MARK,
  202. EXTLP_1_MARK, OVCN2_1_MARK,
  203. VBUS0_1_MARK,
  204. /* GPIO */
  205. GPI0_MARK, GPI1_MARK, GPO0_MARK, GPO1_MARK,
  206. /* BSC */
  207. BS_MARK, WE1_MARK,
  208. CKO_MARK, WAIT_MARK, RDWR_MARK,
  209. A0_MARK, A1_MARK, A2_MARK, A3_MARK,
  210. A6_MARK, A7_MARK, A8_MARK, A9_MARK,
  211. A10_MARK, A11_MARK, A12_MARK, A13_MARK,
  212. A14_MARK, A15_MARK, A16_MARK, A17_MARK,
  213. A18_MARK, A19_MARK, A20_MARK, A21_MARK,
  214. A22_MARK, A23_MARK, A24_MARK, A25_MARK,
  215. A26_MARK,
  216. CS0_MARK, CS2_MARK, CS4_MARK,
  217. CS5A_MARK, CS5B_MARK, CS6A_MARK,
  218. /* BSC/FLCTL */
  219. RD_FSC_MARK, WE0_FWE_MARK, A4_FOE_MARK, A5_FCDE_MARK,
  220. D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
  221. D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
  222. D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
  223. D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
  224. /* MMCIF(1) */
  225. MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
  226. MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK,
  227. MMCCMD0_MARK, MMCCLK0_MARK,
  228. /* MMCIF(2) */
  229. MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
  230. MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK,
  231. MMCCLK1_MARK, MMCCMD1_MARK,
  232. /* SPU2 */
  233. VINT_I_MARK,
  234. /* FLCTL */
  235. FCE1_MARK, FCE0_MARK, FRB_MARK,
  236. /* HSI */
  237. GP_RX_FLAG_MARK, GP_RX_DATA_MARK, GP_TX_READY_MARK,
  238. GP_RX_WAKE_MARK, MP_TX_FLAG_MARK, MP_TX_DATA_MARK,
  239. MP_RX_READY_MARK, MP_TX_WAKE_MARK,
  240. /* MFI */
  241. MFIv6_MARK,
  242. MFIv4_MARK,
  243. MEMC_CS0_MARK, MEMC_BUSCLK_MEMC_A0_MARK,
  244. MEMC_CS1_MEMC_A1_MARK, MEMC_ADV_MEMC_DREQ0_MARK,
  245. MEMC_WAIT_MEMC_DREQ1_MARK, MEMC_NOE_MARK,
  246. MEMC_NWE_MARK, MEMC_INT_MARK,
  247. MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK,
  248. MEMC_AD3_MARK, MEMC_AD4_MARK, MEMC_AD5_MARK,
  249. MEMC_AD6_MARK, MEMC_AD7_MARK, MEMC_AD8_MARK,
  250. MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
  251. MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK,
  252. MEMC_AD15_MARK,
  253. /* SIM */
  254. SIM_RST_MARK, SIM_CLK_MARK, SIM_D_MARK,
  255. /* TPU */
  256. TPU0TO0_MARK, TPU0TO1_MARK,
  257. TPU0TO2_93_MARK, TPU0TO2_99_MARK,
  258. TPU0TO3_MARK,
  259. /* I2C2 */
  260. I2C_SCL2_MARK, I2C_SDA2_MARK,
  261. /* I2C3(1) */
  262. I2C_SCL3_MARK, I2C_SDA3_MARK,
  263. /* I2C3(2) */
  264. I2C_SCL3S_MARK, I2C_SDA3S_MARK,
  265. /* I2C4(2) */
  266. I2C_SCL4_MARK, I2C_SDA4_MARK,
  267. /* I2C4(2) */
  268. I2C_SCL4S_MARK, I2C_SDA4S_MARK,
  269. /* KEYSC */
  270. KEYOUT0_MARK, KEYIN0_121_MARK, KEYIN0_136_MARK,
  271. KEYOUT1_MARK, KEYIN1_122_MARK, KEYIN1_135_MARK,
  272. KEYOUT2_MARK, KEYIN2_123_MARK, KEYIN2_134_MARK,
  273. KEYOUT3_MARK, KEYIN3_124_MARK, KEYIN3_133_MARK,
  274. KEYOUT4_MARK, KEYIN4_MARK,
  275. KEYOUT5_MARK, KEYIN5_MARK,
  276. KEYOUT6_MARK, KEYIN6_MARK,
  277. KEYOUT7_MARK, KEYIN7_MARK,
  278. /* LCDC */
  279. LCDC0_SELECT_MARK,
  280. LCDC1_SELECT_MARK,
  281. LCDHSYN_MARK, LCDCS_MARK, LCDVSYN_MARK, LCDDCK_MARK,
  282. LCDWR_MARK, LCDRD_MARK, LCDDISP_MARK, LCDRS_MARK,
  283. LCDLCLK_MARK, LCDDON_MARK,
  284. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  285. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  286. LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
  287. LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
  288. LCDD16_MARK, LCDD17_MARK, LCDD18_MARK, LCDD19_MARK,
  289. LCDD20_MARK, LCDD21_MARK, LCDD22_MARK, LCDD23_MARK,
  290. /* IRDA */
  291. IRDA_OUT_MARK, IRDA_IN_MARK, IRDA_FIRSEL_MARK,
  292. IROUT_139_MARK, IROUT_140_MARK,
  293. /* TSIF1 */
  294. TS0_1SELECT_MARK,
  295. TS0_2SELECT_MARK,
  296. TS1_1SELECT_MARK,
  297. TS1_2SELECT_MARK,
  298. TS_SPSYNC1_MARK, TS_SDAT1_MARK,
  299. TS_SDEN1_MARK, TS_SCK1_MARK,
  300. /* TSIF2 */
  301. TS_SPSYNC2_MARK, TS_SDAT2_MARK,
  302. TS_SDEN2_MARK, TS_SCK2_MARK,
  303. /* HDMI */
  304. HDMI_HPD_MARK, HDMI_CEC_MARK,
  305. /* SDHI0 */
  306. SDHICLK0_MARK, SDHICD0_MARK,
  307. SDHICMD0_MARK, SDHIWP0_MARK,
  308. SDHID0_0_MARK, SDHID0_1_MARK,
  309. SDHID0_2_MARK, SDHID0_3_MARK,
  310. /* SDHI1 */
  311. SDHICLK1_MARK, SDHICMD1_MARK, SDHID1_0_MARK,
  312. SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK,
  313. /* SDHI2 */
  314. SDHICLK2_MARK, SDHICMD2_MARK, SDHID2_0_MARK,
  315. SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK,
  316. /* SDENC */
  317. SDENC_CPG_MARK,
  318. SDENC_DV_CLKI_MARK,
  319. PINMUX_MARK_END,
  320. };
  321. static const u16 pinmux_data[] = {
  322. PINMUX_DATA_ALL(),
  323. /* IRQ */
  324. PINMUX_DATA(IRQ0_6_MARK, PORT6_FN0, MSEL1CR_0_0),
  325. PINMUX_DATA(IRQ0_162_MARK, PORT162_FN0, MSEL1CR_0_1),
  326. PINMUX_DATA(IRQ1_MARK, PORT12_FN0),
  327. PINMUX_DATA(IRQ2_4_MARK, PORT4_FN0, MSEL1CR_2_0),
  328. PINMUX_DATA(IRQ2_5_MARK, PORT5_FN0, MSEL1CR_2_1),
  329. PINMUX_DATA(IRQ3_8_MARK, PORT8_FN0, MSEL1CR_3_0),
  330. PINMUX_DATA(IRQ3_16_MARK, PORT16_FN0, MSEL1CR_3_1),
  331. PINMUX_DATA(IRQ4_17_MARK, PORT17_FN0, MSEL1CR_4_0),
  332. PINMUX_DATA(IRQ4_163_MARK, PORT163_FN0, MSEL1CR_4_1),
  333. PINMUX_DATA(IRQ5_MARK, PORT18_FN0),
  334. PINMUX_DATA(IRQ6_39_MARK, PORT39_FN0, MSEL1CR_6_0),
  335. PINMUX_DATA(IRQ6_164_MARK, PORT164_FN0, MSEL1CR_6_1),
  336. PINMUX_DATA(IRQ7_40_MARK, PORT40_FN0, MSEL1CR_7_1),
  337. PINMUX_DATA(IRQ7_167_MARK, PORT167_FN0, MSEL1CR_7_0),
  338. PINMUX_DATA(IRQ8_41_MARK, PORT41_FN0, MSEL1CR_8_1),
  339. PINMUX_DATA(IRQ8_168_MARK, PORT168_FN0, MSEL1CR_8_0),
  340. PINMUX_DATA(IRQ9_42_MARK, PORT42_FN0, MSEL1CR_9_0),
  341. PINMUX_DATA(IRQ9_169_MARK, PORT169_FN0, MSEL1CR_9_1),
  342. PINMUX_DATA(IRQ10_MARK, PORT65_FN0, MSEL1CR_9_1),
  343. PINMUX_DATA(IRQ11_MARK, PORT67_FN0),
  344. PINMUX_DATA(IRQ12_80_MARK, PORT80_FN0, MSEL1CR_12_0),
  345. PINMUX_DATA(IRQ12_137_MARK, PORT137_FN0, MSEL1CR_12_1),
  346. PINMUX_DATA(IRQ13_81_MARK, PORT81_FN0, MSEL1CR_13_0),
  347. PINMUX_DATA(IRQ13_145_MARK, PORT145_FN0, MSEL1CR_13_1),
  348. PINMUX_DATA(IRQ14_82_MARK, PORT82_FN0, MSEL1CR_14_0),
  349. PINMUX_DATA(IRQ14_146_MARK, PORT146_FN0, MSEL1CR_14_1),
  350. PINMUX_DATA(IRQ15_83_MARK, PORT83_FN0, MSEL1CR_15_0),
  351. PINMUX_DATA(IRQ15_147_MARK, PORT147_FN0, MSEL1CR_15_1),
  352. PINMUX_DATA(IRQ16_84_MARK, PORT84_FN0, MSEL1CR_16_0),
  353. PINMUX_DATA(IRQ16_170_MARK, PORT170_FN0, MSEL1CR_16_1),
  354. PINMUX_DATA(IRQ17_MARK, PORT85_FN0),
  355. PINMUX_DATA(IRQ18_MARK, PORT86_FN0),
  356. PINMUX_DATA(IRQ19_MARK, PORT87_FN0),
  357. PINMUX_DATA(IRQ20_MARK, PORT92_FN0),
  358. PINMUX_DATA(IRQ21_MARK, PORT93_FN0),
  359. PINMUX_DATA(IRQ22_MARK, PORT94_FN0),
  360. PINMUX_DATA(IRQ23_MARK, PORT95_FN0),
  361. PINMUX_DATA(IRQ24_MARK, PORT112_FN0),
  362. PINMUX_DATA(IRQ25_MARK, PORT119_FN0),
  363. PINMUX_DATA(IRQ26_121_MARK, PORT121_FN0, MSEL1CR_26_1),
  364. PINMUX_DATA(IRQ26_172_MARK, PORT172_FN0, MSEL1CR_26_0),
  365. PINMUX_DATA(IRQ27_122_MARK, PORT122_FN0, MSEL1CR_27_1),
  366. PINMUX_DATA(IRQ27_180_MARK, PORT180_FN0, MSEL1CR_27_0),
  367. PINMUX_DATA(IRQ28_123_MARK, PORT123_FN0, MSEL1CR_28_1),
  368. PINMUX_DATA(IRQ28_181_MARK, PORT181_FN0, MSEL1CR_28_0),
  369. PINMUX_DATA(IRQ29_129_MARK, PORT129_FN0, MSEL1CR_29_1),
  370. PINMUX_DATA(IRQ29_182_MARK, PORT182_FN0, MSEL1CR_29_0),
  371. PINMUX_DATA(IRQ30_130_MARK, PORT130_FN0, MSEL1CR_30_1),
  372. PINMUX_DATA(IRQ30_183_MARK, PORT183_FN0, MSEL1CR_30_0),
  373. PINMUX_DATA(IRQ31_138_MARK, PORT138_FN0, MSEL1CR_31_1),
  374. PINMUX_DATA(IRQ31_184_MARK, PORT184_FN0, MSEL1CR_31_0),
  375. /* Function 1 */
  376. PINMUX_DATA(BBIF2_TSCK1_MARK, PORT0_FN1),
  377. PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT1_FN1),
  378. PINMUX_DATA(BBIF2_TXD1_MARK, PORT2_FN1),
  379. PINMUX_DATA(BBIF2_RXD_MARK, PORT3_FN1),
  380. PINMUX_DATA(FSIACK_MARK, PORT4_FN1),
  381. PINMUX_DATA(FSIAILR_MARK, PORT5_FN1),
  382. PINMUX_DATA(FSIAIBT_MARK, PORT6_FN1),
  383. PINMUX_DATA(FSIAISLD_MARK, PORT7_FN1),
  384. PINMUX_DATA(FSIAOMC_MARK, PORT8_FN1),
  385. PINMUX_DATA(FSIAOLR_MARK, PORT9_FN1),
  386. PINMUX_DATA(FSIAOBT_MARK, PORT10_FN1),
  387. PINMUX_DATA(FSIAOSLD_MARK, PORT11_FN1),
  388. PINMUX_DATA(FMSOCK_MARK, PORT12_FN1),
  389. PINMUX_DATA(FMSOOLR_MARK, PORT13_FN1),
  390. PINMUX_DATA(FMSOOBT_MARK, PORT14_FN1),
  391. PINMUX_DATA(FMSOSLD_MARK, PORT15_FN1),
  392. PINMUX_DATA(FMSOILR_MARK, PORT16_FN1),
  393. PINMUX_DATA(FMSOIBT_MARK, PORT17_FN1),
  394. PINMUX_DATA(FMSISLD_MARK, PORT18_FN1),
  395. PINMUX_DATA(A0_MARK, PORT19_FN1),
  396. PINMUX_DATA(A1_MARK, PORT20_FN1),
  397. PINMUX_DATA(A2_MARK, PORT21_FN1),
  398. PINMUX_DATA(A3_MARK, PORT22_FN1),
  399. PINMUX_DATA(A4_FOE_MARK, PORT23_FN1),
  400. PINMUX_DATA(A5_FCDE_MARK, PORT24_FN1),
  401. PINMUX_DATA(A6_MARK, PORT25_FN1),
  402. PINMUX_DATA(A7_MARK, PORT26_FN1),
  403. PINMUX_DATA(A8_MARK, PORT27_FN1),
  404. PINMUX_DATA(A9_MARK, PORT28_FN1),
  405. PINMUX_DATA(A10_MARK, PORT29_FN1),
  406. PINMUX_DATA(A11_MARK, PORT30_FN1),
  407. PINMUX_DATA(A12_MARK, PORT31_FN1),
  408. PINMUX_DATA(A13_MARK, PORT32_FN1),
  409. PINMUX_DATA(A14_MARK, PORT33_FN1),
  410. PINMUX_DATA(A15_MARK, PORT34_FN1),
  411. PINMUX_DATA(A16_MARK, PORT35_FN1),
  412. PINMUX_DATA(A17_MARK, PORT36_FN1),
  413. PINMUX_DATA(A18_MARK, PORT37_FN1),
  414. PINMUX_DATA(A19_MARK, PORT38_FN1),
  415. PINMUX_DATA(A20_MARK, PORT39_FN1),
  416. PINMUX_DATA(A21_MARK, PORT40_FN1),
  417. PINMUX_DATA(A22_MARK, PORT41_FN1),
  418. PINMUX_DATA(A23_MARK, PORT42_FN1),
  419. PINMUX_DATA(A24_MARK, PORT43_FN1),
  420. PINMUX_DATA(A25_MARK, PORT44_FN1),
  421. PINMUX_DATA(A26_MARK, PORT45_FN1),
  422. PINMUX_DATA(D0_NAF0_MARK, PORT46_FN1),
  423. PINMUX_DATA(D1_NAF1_MARK, PORT47_FN1),
  424. PINMUX_DATA(D2_NAF2_MARK, PORT48_FN1),
  425. PINMUX_DATA(D3_NAF3_MARK, PORT49_FN1),
  426. PINMUX_DATA(D4_NAF4_MARK, PORT50_FN1),
  427. PINMUX_DATA(D5_NAF5_MARK, PORT51_FN1),
  428. PINMUX_DATA(D6_NAF6_MARK, PORT52_FN1),
  429. PINMUX_DATA(D7_NAF7_MARK, PORT53_FN1),
  430. PINMUX_DATA(D8_NAF8_MARK, PORT54_FN1),
  431. PINMUX_DATA(D9_NAF9_MARK, PORT55_FN1),
  432. PINMUX_DATA(D10_NAF10_MARK, PORT56_FN1),
  433. PINMUX_DATA(D11_NAF11_MARK, PORT57_FN1),
  434. PINMUX_DATA(D12_NAF12_MARK, PORT58_FN1),
  435. PINMUX_DATA(D13_NAF13_MARK, PORT59_FN1),
  436. PINMUX_DATA(D14_NAF14_MARK, PORT60_FN1),
  437. PINMUX_DATA(D15_NAF15_MARK, PORT61_FN1),
  438. PINMUX_DATA(CS0_MARK, PORT62_FN1),
  439. PINMUX_DATA(CS2_MARK, PORT63_FN1),
  440. PINMUX_DATA(CS4_MARK, PORT64_FN1),
  441. PINMUX_DATA(CS5A_MARK, PORT65_FN1),
  442. PINMUX_DATA(CS5B_MARK, PORT66_FN1),
  443. PINMUX_DATA(CS6A_MARK, PORT67_FN1),
  444. PINMUX_DATA(FCE0_MARK, PORT68_FN1),
  445. PINMUX_DATA(RD_FSC_MARK, PORT69_FN1),
  446. PINMUX_DATA(WE0_FWE_MARK, PORT70_FN1),
  447. PINMUX_DATA(WE1_MARK, PORT71_FN1),
  448. PINMUX_DATA(CKO_MARK, PORT72_FN1),
  449. PINMUX_DATA(FRB_MARK, PORT73_FN1),
  450. PINMUX_DATA(WAIT_MARK, PORT74_FN1),
  451. PINMUX_DATA(RDWR_MARK, PORT75_FN1),
  452. PINMUX_DATA(MEMC_AD0_MARK, PORT76_FN1),
  453. PINMUX_DATA(MEMC_AD1_MARK, PORT77_FN1),
  454. PINMUX_DATA(MEMC_AD2_MARK, PORT78_FN1),
  455. PINMUX_DATA(MEMC_AD3_MARK, PORT79_FN1),
  456. PINMUX_DATA(MEMC_AD4_MARK, PORT80_FN1),
  457. PINMUX_DATA(MEMC_AD5_MARK, PORT81_FN1),
  458. PINMUX_DATA(MEMC_AD6_MARK, PORT82_FN1),
  459. PINMUX_DATA(MEMC_AD7_MARK, PORT83_FN1),
  460. PINMUX_DATA(MEMC_AD8_MARK, PORT84_FN1),
  461. PINMUX_DATA(MEMC_AD9_MARK, PORT85_FN1),
  462. PINMUX_DATA(MEMC_AD10_MARK, PORT86_FN1),
  463. PINMUX_DATA(MEMC_AD11_MARK, PORT87_FN1),
  464. PINMUX_DATA(MEMC_AD12_MARK, PORT88_FN1),
  465. PINMUX_DATA(MEMC_AD13_MARK, PORT89_FN1),
  466. PINMUX_DATA(MEMC_AD14_MARK, PORT90_FN1),
  467. PINMUX_DATA(MEMC_AD15_MARK, PORT91_FN1),
  468. PINMUX_DATA(MEMC_CS0_MARK, PORT92_FN1),
  469. PINMUX_DATA(MEMC_BUSCLK_MEMC_A0_MARK, PORT93_FN1),
  470. PINMUX_DATA(MEMC_CS1_MEMC_A1_MARK, PORT94_FN1),
  471. PINMUX_DATA(MEMC_ADV_MEMC_DREQ0_MARK, PORT95_FN1),
  472. PINMUX_DATA(MEMC_WAIT_MEMC_DREQ1_MARK, PORT96_FN1),
  473. PINMUX_DATA(MEMC_NOE_MARK, PORT97_FN1),
  474. PINMUX_DATA(MEMC_NWE_MARK, PORT98_FN1),
  475. PINMUX_DATA(MEMC_INT_MARK, PORT99_FN1),
  476. PINMUX_DATA(VIO_VD_MARK, PORT100_FN1),
  477. PINMUX_DATA(VIO_HD_MARK, PORT101_FN1),
  478. PINMUX_DATA(VIO_D0_MARK, PORT102_FN1),
  479. PINMUX_DATA(VIO_D1_MARK, PORT103_FN1),
  480. PINMUX_DATA(VIO_D2_MARK, PORT104_FN1),
  481. PINMUX_DATA(VIO_D3_MARK, PORT105_FN1),
  482. PINMUX_DATA(VIO_D4_MARK, PORT106_FN1),
  483. PINMUX_DATA(VIO_D5_MARK, PORT107_FN1),
  484. PINMUX_DATA(VIO_D6_MARK, PORT108_FN1),
  485. PINMUX_DATA(VIO_D7_MARK, PORT109_FN1),
  486. PINMUX_DATA(VIO_D8_MARK, PORT110_FN1),
  487. PINMUX_DATA(VIO_D9_MARK, PORT111_FN1),
  488. PINMUX_DATA(VIO_D10_MARK, PORT112_FN1),
  489. PINMUX_DATA(VIO_D11_MARK, PORT113_FN1),
  490. PINMUX_DATA(VIO_D12_MARK, PORT114_FN1),
  491. PINMUX_DATA(VIO_D13_MARK, PORT115_FN1),
  492. PINMUX_DATA(VIO_D14_MARK, PORT116_FN1),
  493. PINMUX_DATA(VIO_D15_MARK, PORT117_FN1),
  494. PINMUX_DATA(VIO_CLK_MARK, PORT118_FN1),
  495. PINMUX_DATA(VIO_FIELD_MARK, PORT119_FN1),
  496. PINMUX_DATA(VIO_CKO_MARK, PORT120_FN1),
  497. PINMUX_DATA(LCDD0_MARK, PORT121_FN1),
  498. PINMUX_DATA(LCDD1_MARK, PORT122_FN1),
  499. PINMUX_DATA(LCDD2_MARK, PORT123_FN1),
  500. PINMUX_DATA(LCDD3_MARK, PORT124_FN1),
  501. PINMUX_DATA(LCDD4_MARK, PORT125_FN1),
  502. PINMUX_DATA(LCDD5_MARK, PORT126_FN1),
  503. PINMUX_DATA(LCDD6_MARK, PORT127_FN1),
  504. PINMUX_DATA(LCDD7_MARK, PORT128_FN1),
  505. PINMUX_DATA(LCDD8_MARK, PORT129_FN1),
  506. PINMUX_DATA(LCDD9_MARK, PORT130_FN1),
  507. PINMUX_DATA(LCDD10_MARK, PORT131_FN1),
  508. PINMUX_DATA(LCDD11_MARK, PORT132_FN1),
  509. PINMUX_DATA(LCDD12_MARK, PORT133_FN1),
  510. PINMUX_DATA(LCDD13_MARK, PORT134_FN1),
  511. PINMUX_DATA(LCDD14_MARK, PORT135_FN1),
  512. PINMUX_DATA(LCDD15_MARK, PORT136_FN1),
  513. PINMUX_DATA(LCDD16_MARK, PORT137_FN1),
  514. PINMUX_DATA(LCDD17_MARK, PORT138_FN1),
  515. PINMUX_DATA(LCDD18_MARK, PORT139_FN1),
  516. PINMUX_DATA(LCDD19_MARK, PORT140_FN1),
  517. PINMUX_DATA(LCDD20_MARK, PORT141_FN1),
  518. PINMUX_DATA(LCDD21_MARK, PORT142_FN1),
  519. PINMUX_DATA(LCDD22_MARK, PORT143_FN1),
  520. PINMUX_DATA(LCDD23_MARK, PORT144_FN1),
  521. PINMUX_DATA(LCDHSYN_MARK, PORT145_FN1),
  522. PINMUX_DATA(LCDVSYN_MARK, PORT146_FN1),
  523. PINMUX_DATA(LCDDCK_MARK, PORT147_FN1),
  524. PINMUX_DATA(LCDRD_MARK, PORT148_FN1),
  525. PINMUX_DATA(LCDDISP_MARK, PORT149_FN1),
  526. PINMUX_DATA(LCDLCLK_MARK, PORT150_FN1),
  527. PINMUX_DATA(LCDDON_MARK, PORT151_FN1),
  528. PINMUX_DATA(SCIFA0_TXD_MARK, PORT152_FN1),
  529. PINMUX_DATA(SCIFA0_RXD_MARK, PORT153_FN1),
  530. PINMUX_DATA(SCIFA1_TXD_MARK, PORT154_FN1),
  531. PINMUX_DATA(SCIFA1_RXD_MARK, PORT155_FN1),
  532. PINMUX_DATA(TS_SPSYNC1_MARK, PORT156_FN1),
  533. PINMUX_DATA(TS_SDAT1_MARK, PORT157_FN1),
  534. PINMUX_DATA(TS_SDEN1_MARK, PORT158_FN1),
  535. PINMUX_DATA(TS_SCK1_MARK, PORT159_FN1),
  536. PINMUX_DATA(TPU0TO0_MARK, PORT160_FN1),
  537. PINMUX_DATA(TPU0TO1_MARK, PORT161_FN1),
  538. PINMUX_DATA(SCIFB_SCK_MARK, PORT162_FN1),
  539. PINMUX_DATA(SCIFB_RTS_MARK, PORT163_FN1),
  540. PINMUX_DATA(SCIFB_CTS_MARK, PORT164_FN1),
  541. PINMUX_DATA(SCIFB_TXD_MARK, PORT165_FN1),
  542. PINMUX_DATA(SCIFB_RXD_MARK, PORT166_FN1),
  543. PINMUX_DATA(VBUS0_0_MARK, PORT167_FN1),
  544. PINMUX_DATA(VBUS0_1_MARK, PORT168_FN1),
  545. PINMUX_DATA(HDMI_HPD_MARK, PORT169_FN1),
  546. PINMUX_DATA(HDMI_CEC_MARK, PORT170_FN1),
  547. PINMUX_DATA(SDHICLK0_MARK, PORT171_FN1),
  548. PINMUX_DATA(SDHICD0_MARK, PORT172_FN1),
  549. PINMUX_DATA(SDHID0_0_MARK, PORT173_FN1),
  550. PINMUX_DATA(SDHID0_1_MARK, PORT174_FN1),
  551. PINMUX_DATA(SDHID0_2_MARK, PORT175_FN1),
  552. PINMUX_DATA(SDHID0_3_MARK, PORT176_FN1),
  553. PINMUX_DATA(SDHICMD0_MARK, PORT177_FN1),
  554. PINMUX_DATA(SDHIWP0_MARK, PORT178_FN1),
  555. PINMUX_DATA(SDHICLK1_MARK, PORT179_FN1),
  556. PINMUX_DATA(SDHID1_0_MARK, PORT180_FN1),
  557. PINMUX_DATA(SDHID1_1_MARK, PORT181_FN1),
  558. PINMUX_DATA(SDHID1_2_MARK, PORT182_FN1),
  559. PINMUX_DATA(SDHID1_3_MARK, PORT183_FN1),
  560. PINMUX_DATA(SDHICMD1_MARK, PORT184_FN1),
  561. PINMUX_DATA(SDHICLK2_MARK, PORT185_FN1),
  562. PINMUX_DATA(SDHID2_0_MARK, PORT186_FN1),
  563. PINMUX_DATA(SDHID2_1_MARK, PORT187_FN1),
  564. PINMUX_DATA(SDHID2_2_MARK, PORT188_FN1),
  565. PINMUX_DATA(SDHID2_3_MARK, PORT189_FN1),
  566. PINMUX_DATA(SDHICMD2_MARK, PORT190_FN1),
  567. /* Function 2 */
  568. PINMUX_DATA(FSIBCK_MARK, PORT4_FN2),
  569. PINMUX_DATA(SCIFA4_RXD_MARK, PORT5_FN2),
  570. PINMUX_DATA(SCIFA4_TXD_MARK, PORT6_FN2),
  571. PINMUX_DATA(SCIFA5_RXD_MARK, PORT8_FN2),
  572. PINMUX_DATA(FSIASPDIF_11_MARK, PORT11_FN2),
  573. PINMUX_DATA(SCIFA5_TXD_MARK, PORT12_FN2),
  574. PINMUX_DATA(FMSIOLR_MARK, PORT13_FN2),
  575. PINMUX_DATA(FMSIOBT_MARK, PORT14_FN2),
  576. PINMUX_DATA(FSIASPDIF_15_MARK, PORT15_FN2),
  577. PINMUX_DATA(FMSIILR_MARK, PORT16_FN2),
  578. PINMUX_DATA(FMSIIBT_MARK, PORT17_FN2),
  579. PINMUX_DATA(BS_MARK, PORT19_FN2),
  580. PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT36_FN2),
  581. PINMUX_DATA(MSIOF0_TSCK_MARK, PORT37_FN2),
  582. PINMUX_DATA(MSIOF0_RXD_MARK, PORT38_FN2),
  583. PINMUX_DATA(MSIOF0_RSCK_MARK, PORT39_FN2),
  584. PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT40_FN2),
  585. PINMUX_DATA(MSIOF0_MCK0_MARK, PORT41_FN2),
  586. PINMUX_DATA(MSIOF0_MCK1_MARK, PORT42_FN2),
  587. PINMUX_DATA(MSIOF0_SS1_MARK, PORT43_FN2),
  588. PINMUX_DATA(MSIOF0_SS2_MARK, PORT44_FN2),
  589. PINMUX_DATA(MSIOF0_TXD_MARK, PORT45_FN2),
  590. PINMUX_DATA(FMSICK_MARK, PORT65_FN2),
  591. PINMUX_DATA(FCE1_MARK, PORT66_FN2),
  592. PINMUX_DATA(BBIF1_RXD_MARK, PORT76_FN2),
  593. PINMUX_DATA(BBIF1_TSYNC_MARK, PORT77_FN2),
  594. PINMUX_DATA(BBIF1_TSCK_MARK, PORT78_FN2),
  595. PINMUX_DATA(BBIF1_TXD_MARK, PORT79_FN2),
  596. PINMUX_DATA(BBIF1_RSCK_MARK, PORT80_FN2),
  597. PINMUX_DATA(BBIF1_RSYNC_MARK, PORT81_FN2),
  598. PINMUX_DATA(BBIF1_FLOW_MARK, PORT82_FN2),
  599. PINMUX_DATA(BB_RX_FLOW_N_MARK, PORT83_FN2),
  600. PINMUX_DATA(MSIOF1_RSCK_MARK, PORT84_FN2),
  601. PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT85_FN2),
  602. PINMUX_DATA(MSIOF1_MCK0_MARK, PORT86_FN2),
  603. PINMUX_DATA(MSIOF1_MCK1_MARK, PORT87_FN2),
  604. PINMUX_DATA(MSIOF1_TSCK_88_MARK, PORT88_FN2, MSEL4CR_10_1),
  605. PINMUX_DATA(MSIOF1_TSYNC_89_MARK, PORT89_FN2, MSEL4CR_10_1),
  606. PINMUX_DATA(MSIOF1_TXD_90_MARK, PORT90_FN2, MSEL4CR_10_1),
  607. PINMUX_DATA(MSIOF1_RXD_91_MARK, PORT91_FN2, MSEL4CR_10_1),
  608. PINMUX_DATA(MSIOF1_SS1_92_MARK, PORT92_FN2, MSEL4CR_10_1),
  609. PINMUX_DATA(MSIOF1_SS2_93_MARK, PORT93_FN2, MSEL4CR_10_1),
  610. PINMUX_DATA(SCIFA2_CTS1_MARK, PORT94_FN2),
  611. PINMUX_DATA(SCIFA2_RTS1_MARK, PORT95_FN2),
  612. PINMUX_DATA(SCIFA2_TXD1_MARK, PORT96_FN2),
  613. PINMUX_DATA(SCIFA2_RXD1_MARK, PORT97_FN2),
  614. PINMUX_DATA(SCIFA2_SCK1_MARK, PORT98_FN2),
  615. PINMUX_DATA(I2C_SCL2_MARK, PORT110_FN2),
  616. PINMUX_DATA(I2C_SDA2_MARK, PORT111_FN2),
  617. PINMUX_DATA(I2C_SCL3_MARK, PORT114_FN2, MSEL4CR_16_1),
  618. PINMUX_DATA(I2C_SDA3_MARK, PORT115_FN2, MSEL4CR_16_1),
  619. PINMUX_DATA(I2C_SCL4_MARK, PORT116_FN2, MSEL4CR_17_1),
  620. PINMUX_DATA(I2C_SDA4_MARK, PORT117_FN2, MSEL4CR_17_1),
  621. PINMUX_DATA(MSIOF2_RSCK_MARK, PORT134_FN2),
  622. PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT135_FN2),
  623. PINMUX_DATA(MSIOF2_MCK0_MARK, PORT136_FN2),
  624. PINMUX_DATA(MSIOF2_MCK1_MARK, PORT137_FN2),
  625. PINMUX_DATA(MSIOF2_SS1_MARK, PORT138_FN2),
  626. PINMUX_DATA(MSIOF2_SS2_MARK, PORT139_FN2),
  627. PINMUX_DATA(SCIFA3_CTS_140_MARK, PORT140_FN2, MSEL3CR_9_1),
  628. PINMUX_DATA(SCIFA3_RTS_141_MARK, PORT141_FN2),
  629. PINMUX_DATA(SCIFA3_SCK_MARK, PORT142_FN2),
  630. PINMUX_DATA(SCIFA3_TXD_MARK, PORT143_FN2),
  631. PINMUX_DATA(SCIFA3_RXD_MARK, PORT144_FN2),
  632. PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT148_FN2),
  633. PINMUX_DATA(MSIOF2_TSCK_MARK, PORT149_FN2),
  634. PINMUX_DATA(MSIOF2_RXD_MARK, PORT150_FN2),
  635. PINMUX_DATA(MSIOF2_TXD_MARK, PORT151_FN2),
  636. PINMUX_DATA(SCIFA0_SCK_MARK, PORT156_FN2),
  637. PINMUX_DATA(SCIFA0_RTS_MARK, PORT157_FN2),
  638. PINMUX_DATA(SCIFA0_CTS_MARK, PORT158_FN2),
  639. PINMUX_DATA(SCIFA1_SCK_MARK, PORT159_FN2),
  640. PINMUX_DATA(SCIFA1_RTS_MARK, PORT160_FN2),
  641. PINMUX_DATA(SCIFA1_CTS_MARK, PORT161_FN2),
  642. /* Function 3 */
  643. PINMUX_DATA(VIO_CKO1_MARK, PORT16_FN3),
  644. PINMUX_DATA(VIO_CKO2_MARK, PORT17_FN3),
  645. PINMUX_DATA(IDIN_1_18_MARK, PORT18_FN3, MSEL4CR_14_1),
  646. PINMUX_DATA(MSIOF1_TSCK_39_MARK, PORT39_FN3, MSEL4CR_10_0),
  647. PINMUX_DATA(MSIOF1_TSYNC_40_MARK, PORT40_FN3, MSEL4CR_10_0),
  648. PINMUX_DATA(MSIOF1_TXD_41_MARK, PORT41_FN3, MSEL4CR_10_0),
  649. PINMUX_DATA(MSIOF1_RXD_42_MARK, PORT42_FN3, MSEL4CR_10_0),
  650. PINMUX_DATA(MSIOF1_SS1_43_MARK, PORT43_FN3, MSEL4CR_10_0),
  651. PINMUX_DATA(MSIOF1_SS2_44_MARK, PORT44_FN3, MSEL4CR_10_0),
  652. PINMUX_DATA(MMCD1_0_MARK, PORT54_FN3, MSEL4CR_15_1),
  653. PINMUX_DATA(MMCD1_1_MARK, PORT55_FN3, MSEL4CR_15_1),
  654. PINMUX_DATA(MMCD1_2_MARK, PORT56_FN3, MSEL4CR_15_1),
  655. PINMUX_DATA(MMCD1_3_MARK, PORT57_FN3, MSEL4CR_15_1),
  656. PINMUX_DATA(MMCD1_4_MARK, PORT58_FN3, MSEL4CR_15_1),
  657. PINMUX_DATA(MMCD1_5_MARK, PORT59_FN3, MSEL4CR_15_1),
  658. PINMUX_DATA(MMCD1_6_MARK, PORT60_FN3, MSEL4CR_15_1),
  659. PINMUX_DATA(MMCD1_7_MARK, PORT61_FN3, MSEL4CR_15_1),
  660. PINMUX_DATA(VINT_I_MARK, PORT65_FN3),
  661. PINMUX_DATA(MMCCLK1_MARK, PORT66_FN3, MSEL4CR_15_1),
  662. PINMUX_DATA(MMCCMD1_MARK, PORT67_FN3, MSEL4CR_15_1),
  663. PINMUX_DATA(TPU0TO2_93_MARK, PORT93_FN3),
  664. PINMUX_DATA(TPU0TO2_99_MARK, PORT99_FN3),
  665. PINMUX_DATA(TPU0TO3_MARK, PORT112_FN3),
  666. PINMUX_DATA(IDIN_0_MARK, PORT113_FN3),
  667. PINMUX_DATA(EXTLP_0_MARK, PORT114_FN3),
  668. PINMUX_DATA(OVCN2_0_MARK, PORT115_FN3),
  669. PINMUX_DATA(PWEN_0_MARK, PORT116_FN3),
  670. PINMUX_DATA(OVCN_0_MARK, PORT117_FN3),
  671. PINMUX_DATA(KEYOUT7_MARK, PORT121_FN3),
  672. PINMUX_DATA(KEYOUT6_MARK, PORT122_FN3),
  673. PINMUX_DATA(KEYOUT5_MARK, PORT123_FN3),
  674. PINMUX_DATA(KEYOUT4_MARK, PORT124_FN3),
  675. PINMUX_DATA(KEYOUT3_MARK, PORT125_FN3),
  676. PINMUX_DATA(KEYOUT2_MARK, PORT126_FN3),
  677. PINMUX_DATA(KEYOUT1_MARK, PORT127_FN3),
  678. PINMUX_DATA(KEYOUT0_MARK, PORT128_FN3),
  679. PINMUX_DATA(KEYIN7_MARK, PORT129_FN3),
  680. PINMUX_DATA(KEYIN6_MARK, PORT130_FN3),
  681. PINMUX_DATA(KEYIN5_MARK, PORT131_FN3),
  682. PINMUX_DATA(KEYIN4_MARK, PORT132_FN3),
  683. PINMUX_DATA(KEYIN3_133_MARK, PORT133_FN3, MSEL4CR_18_0),
  684. PINMUX_DATA(KEYIN2_134_MARK, PORT134_FN3, MSEL4CR_18_0),
  685. PINMUX_DATA(KEYIN1_135_MARK, PORT135_FN3, MSEL4CR_18_0),
  686. PINMUX_DATA(KEYIN0_136_MARK, PORT136_FN3, MSEL4CR_18_0),
  687. PINMUX_DATA(TS_SPSYNC2_MARK, PORT137_FN3),
  688. PINMUX_DATA(IROUT_139_MARK, PORT139_FN3),
  689. PINMUX_DATA(IRDA_OUT_MARK, PORT140_FN3),
  690. PINMUX_DATA(IRDA_IN_MARK, PORT141_FN3),
  691. PINMUX_DATA(IRDA_FIRSEL_MARK, PORT142_FN3),
  692. PINMUX_DATA(TS_SDAT2_MARK, PORT145_FN3),
  693. PINMUX_DATA(TS_SDEN2_MARK, PORT146_FN3),
  694. PINMUX_DATA(TS_SCK2_MARK, PORT147_FN3),
  695. /* Function 4 */
  696. PINMUX_DATA(SCIFA3_CTS_43_MARK, PORT43_FN4, MSEL3CR_9_0),
  697. PINMUX_DATA(SCIFA3_RTS_44_MARK, PORT44_FN4),
  698. PINMUX_DATA(GP_RX_FLAG_MARK, PORT76_FN4),
  699. PINMUX_DATA(GP_RX_DATA_MARK, PORT77_FN4),
  700. PINMUX_DATA(GP_TX_READY_MARK, PORT78_FN4),
  701. PINMUX_DATA(GP_RX_WAKE_MARK, PORT79_FN4),
  702. PINMUX_DATA(MP_TX_FLAG_MARK, PORT80_FN4),
  703. PINMUX_DATA(MP_TX_DATA_MARK, PORT81_FN4),
  704. PINMUX_DATA(MP_RX_READY_MARK, PORT82_FN4),
  705. PINMUX_DATA(MP_TX_WAKE_MARK, PORT83_FN4),
  706. PINMUX_DATA(MMCD0_0_MARK, PORT84_FN4, MSEL4CR_15_0),
  707. PINMUX_DATA(MMCD0_1_MARK, PORT85_FN4, MSEL4CR_15_0),
  708. PINMUX_DATA(MMCD0_2_MARK, PORT86_FN4, MSEL4CR_15_0),
  709. PINMUX_DATA(MMCD0_3_MARK, PORT87_FN4, MSEL4CR_15_0),
  710. PINMUX_DATA(MMCD0_4_MARK, PORT88_FN4, MSEL4CR_15_0),
  711. PINMUX_DATA(MMCD0_5_MARK, PORT89_FN4, MSEL4CR_15_0),
  712. PINMUX_DATA(MMCD0_6_MARK, PORT90_FN4, MSEL4CR_15_0),
  713. PINMUX_DATA(MMCD0_7_MARK, PORT91_FN4, MSEL4CR_15_0),
  714. PINMUX_DATA(MMCCMD0_MARK, PORT92_FN4, MSEL4CR_15_0),
  715. PINMUX_DATA(SIM_RST_MARK, PORT94_FN4),
  716. PINMUX_DATA(SIM_CLK_MARK, PORT95_FN4),
  717. PINMUX_DATA(SIM_D_MARK, PORT98_FN4),
  718. PINMUX_DATA(MMCCLK0_MARK, PORT99_FN4, MSEL4CR_15_0),
  719. PINMUX_DATA(IDIN_1_113_MARK, PORT113_FN4, MSEL4CR_14_0),
  720. PINMUX_DATA(OVCN_1_114_MARK, PORT114_FN4, MSEL4CR_14_0),
  721. PINMUX_DATA(PWEN_1_115_MARK, PORT115_FN4),
  722. PINMUX_DATA(EXTLP_1_MARK, PORT116_FN4),
  723. PINMUX_DATA(OVCN2_1_MARK, PORT117_FN4),
  724. PINMUX_DATA(KEYIN0_121_MARK, PORT121_FN4, MSEL4CR_18_1),
  725. PINMUX_DATA(KEYIN1_122_MARK, PORT122_FN4, MSEL4CR_18_1),
  726. PINMUX_DATA(KEYIN2_123_MARK, PORT123_FN4, MSEL4CR_18_1),
  727. PINMUX_DATA(KEYIN3_124_MARK, PORT124_FN4, MSEL4CR_18_1),
  728. PINMUX_DATA(PWEN_1_138_MARK, PORT138_FN4),
  729. PINMUX_DATA(IROUT_140_MARK, PORT140_FN4),
  730. PINMUX_DATA(LCDCS_MARK, PORT145_FN4),
  731. PINMUX_DATA(LCDWR_MARK, PORT147_FN4),
  732. PINMUX_DATA(LCDRS_MARK, PORT149_FN4),
  733. PINMUX_DATA(OVCN_1_162_MARK, PORT162_FN4, MSEL4CR_14_1),
  734. /* Function 5 */
  735. PINMUX_DATA(GPI0_MARK, PORT41_FN5),
  736. PINMUX_DATA(GPI1_MARK, PORT42_FN5),
  737. PINMUX_DATA(GPO0_MARK, PORT43_FN5),
  738. PINMUX_DATA(GPO1_MARK, PORT44_FN5),
  739. PINMUX_DATA(I2C_SCL3S_MARK, PORT137_FN5, MSEL4CR_16_0),
  740. PINMUX_DATA(I2C_SDA3S_MARK, PORT145_FN5, MSEL4CR_16_0),
  741. PINMUX_DATA(I2C_SCL4S_MARK, PORT146_FN5, MSEL4CR_17_0),
  742. PINMUX_DATA(I2C_SDA4S_MARK, PORT147_FN5, MSEL4CR_17_0),
  743. /* Function select */
  744. PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
  745. PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
  746. PINMUX_DATA(TS0_1SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_0),
  747. PINMUX_DATA(TS0_2SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_1),
  748. PINMUX_DATA(TS1_1SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_0),
  749. PINMUX_DATA(TS1_2SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_1),
  750. PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
  751. PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
  752. PINMUX_DATA(MFIv6_MARK, MSEL4CR_6_0),
  753. PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1),
  754. };
  755. #define SH7372_PIN(pin, cfgs) \
  756. { \
  757. .name = __stringify(PORT##pin), \
  758. .enum_id = PORT##pin##_DATA, \
  759. .configs = cfgs, \
  760. }
  761. #define __I (SH_PFC_PIN_CFG_INPUT)
  762. #define __O (SH_PFC_PIN_CFG_OUTPUT)
  763. #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT)
  764. #define __PD (SH_PFC_PIN_CFG_PULL_DOWN)
  765. #define __PU (SH_PFC_PIN_CFG_PULL_UP)
  766. #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP)
  767. #define SH7372_PIN_I_PD(pin) SH7372_PIN(pin, __I | __PD)
  768. #define SH7372_PIN_I_PU(pin) SH7372_PIN(pin, __I | __PU)
  769. #define SH7372_PIN_I_PU_PD(pin) SH7372_PIN(pin, __I | __PUD)
  770. #define SH7372_PIN_IO(pin) SH7372_PIN(pin, __IO)
  771. #define SH7372_PIN_IO_PD(pin) SH7372_PIN(pin, __IO | __PD)
  772. #define SH7372_PIN_IO_PU(pin) SH7372_PIN(pin, __IO | __PU)
  773. #define SH7372_PIN_IO_PU_PD(pin) SH7372_PIN(pin, __IO | __PUD)
  774. #define SH7372_PIN_O(pin) SH7372_PIN(pin, __O)
  775. #define SH7372_PIN_O_PU_PD(pin) SH7372_PIN(pin, __O | __PUD)
  776. static struct sh_pfc_pin pinmux_pins[] = {
  777. /* Table 57-1 (I/O and Pull U/D) */
  778. SH7372_PIN_IO_PD(0), SH7372_PIN_IO_PD(1),
  779. SH7372_PIN_O(2), SH7372_PIN_I_PD(3),
  780. SH7372_PIN_I_PD(4), SH7372_PIN_I_PD(5),
  781. SH7372_PIN_IO_PU_PD(6), SH7372_PIN_I_PD(7),
  782. SH7372_PIN_IO_PD(8), SH7372_PIN_O(9),
  783. SH7372_PIN_O(10), SH7372_PIN_O(11),
  784. SH7372_PIN_IO_PU_PD(12), SH7372_PIN_IO_PD(13),
  785. SH7372_PIN_IO_PD(14), SH7372_PIN_O(15),
  786. SH7372_PIN_IO_PD(16), SH7372_PIN_IO_PD(17),
  787. SH7372_PIN_I_PD(18), SH7372_PIN_IO(19),
  788. SH7372_PIN_IO(20), SH7372_PIN_IO(21),
  789. SH7372_PIN_IO(22), SH7372_PIN_IO(23),
  790. SH7372_PIN_IO(24), SH7372_PIN_IO(25),
  791. SH7372_PIN_IO(26), SH7372_PIN_IO(27),
  792. SH7372_PIN_IO(28), SH7372_PIN_IO(29),
  793. SH7372_PIN_IO(30), SH7372_PIN_IO(31),
  794. SH7372_PIN_IO(32), SH7372_PIN_IO(33),
  795. SH7372_PIN_IO(34), SH7372_PIN_IO(35),
  796. SH7372_PIN_IO(36), SH7372_PIN_IO(37),
  797. SH7372_PIN_IO(38), SH7372_PIN_IO(39),
  798. SH7372_PIN_IO(40), SH7372_PIN_IO(41),
  799. SH7372_PIN_IO(42), SH7372_PIN_IO(43),
  800. SH7372_PIN_IO(44), SH7372_PIN_IO(45),
  801. SH7372_PIN_IO_PU(46), SH7372_PIN_IO_PU(47),
  802. SH7372_PIN_IO_PU(48), SH7372_PIN_IO_PU(49),
  803. SH7372_PIN_IO_PU(50), SH7372_PIN_IO_PU(51),
  804. SH7372_PIN_IO_PU(52), SH7372_PIN_IO_PU(53),
  805. SH7372_PIN_IO_PU(54), SH7372_PIN_IO_PU(55),
  806. SH7372_PIN_IO_PU(56), SH7372_PIN_IO_PU(57),
  807. SH7372_PIN_IO_PU(58), SH7372_PIN_IO_PU(59),
  808. SH7372_PIN_IO_PU(60), SH7372_PIN_IO_PU(61),
  809. SH7372_PIN_IO(62), SH7372_PIN_O(63),
  810. SH7372_PIN_O(64), SH7372_PIN_IO_PU(65),
  811. SH7372_PIN_O_PU_PD(66), SH7372_PIN_IO_PU(67),
  812. SH7372_PIN_O(68), SH7372_PIN_IO(69),
  813. SH7372_PIN_IO(70), SH7372_PIN_IO(71),
  814. SH7372_PIN_O(72), SH7372_PIN_I_PU(73),
  815. SH7372_PIN_I_PU_PD(74), SH7372_PIN_IO_PU_PD(75),
  816. SH7372_PIN_IO_PU_PD(76), SH7372_PIN_IO_PU_PD(77),
  817. SH7372_PIN_IO_PU_PD(78), SH7372_PIN_IO_PU_PD(79),
  818. SH7372_PIN_IO_PU_PD(80), SH7372_PIN_IO_PU_PD(81),
  819. SH7372_PIN_IO_PU_PD(82), SH7372_PIN_IO_PU_PD(83),
  820. SH7372_PIN_IO_PU_PD(84), SH7372_PIN_IO_PU_PD(85),
  821. SH7372_PIN_IO_PU_PD(86), SH7372_PIN_IO_PU_PD(87),
  822. SH7372_PIN_IO_PU_PD(88), SH7372_PIN_IO_PU_PD(89),
  823. SH7372_PIN_IO_PU_PD(90), SH7372_PIN_IO_PU_PD(91),
  824. SH7372_PIN_IO_PU_PD(92), SH7372_PIN_IO_PU_PD(93),
  825. SH7372_PIN_IO_PU_PD(94), SH7372_PIN_IO_PU_PD(95),
  826. SH7372_PIN_IO_PU(96), SH7372_PIN_IO_PU_PD(97),
  827. SH7372_PIN_IO_PU_PD(98), SH7372_PIN_O_PU_PD(99),
  828. SH7372_PIN_IO_PD(100), SH7372_PIN_IO_PD(101),
  829. SH7372_PIN_IO_PD(102), SH7372_PIN_IO_PD(103),
  830. SH7372_PIN_IO_PD(104), SH7372_PIN_IO_PD(105),
  831. SH7372_PIN_IO_PU(106), SH7372_PIN_IO_PU(107),
  832. SH7372_PIN_IO_PU(108), SH7372_PIN_IO_PU(109),
  833. SH7372_PIN_IO_PU(110), SH7372_PIN_IO_PU(111),
  834. SH7372_PIN_IO_PD(112), SH7372_PIN_IO_PD(113),
  835. SH7372_PIN_IO_PU(114), SH7372_PIN_IO_PU(115),
  836. SH7372_PIN_IO_PU(116), SH7372_PIN_IO_PU(117),
  837. SH7372_PIN_IO_PU(118), SH7372_PIN_IO_PU(119),
  838. SH7372_PIN_IO_PU(120), SH7372_PIN_IO_PD(121),
  839. SH7372_PIN_IO_PD(122), SH7372_PIN_IO_PD(123),
  840. SH7372_PIN_IO_PD(124), SH7372_PIN_IO_PD(125),
  841. SH7372_PIN_IO_PD(126), SH7372_PIN_IO_PD(127),
  842. SH7372_PIN_IO_PD(128), SH7372_PIN_IO_PU_PD(129),
  843. SH7372_PIN_IO_PU_PD(130), SH7372_PIN_IO_PU_PD(131),
  844. SH7372_PIN_IO_PU_PD(132), SH7372_PIN_IO_PU_PD(133),
  845. SH7372_PIN_IO_PU_PD(134), SH7372_PIN_IO_PU_PD(135),
  846. SH7372_PIN_IO_PD(136), SH7372_PIN_IO_PD(137),
  847. SH7372_PIN_IO_PD(138), SH7372_PIN_IO_PD(139),
  848. SH7372_PIN_IO_PD(140), SH7372_PIN_IO_PD(141),
  849. SH7372_PIN_IO_PD(142), SH7372_PIN_IO_PU_PD(143),
  850. SH7372_PIN_IO_PD(144), SH7372_PIN_IO_PD(145),
  851. SH7372_PIN_IO_PD(146), SH7372_PIN_IO_PD(147),
  852. SH7372_PIN_IO_PD(148), SH7372_PIN_IO_PD(149),
  853. SH7372_PIN_IO_PD(150), SH7372_PIN_IO_PD(151),
  854. SH7372_PIN_IO_PU_PD(152), SH7372_PIN_I_PD(153),
  855. SH7372_PIN_IO_PU_PD(154), SH7372_PIN_I_PD(155),
  856. SH7372_PIN_IO_PD(156), SH7372_PIN_IO_PD(157),
  857. SH7372_PIN_I_PD(158), SH7372_PIN_IO_PD(159),
  858. SH7372_PIN_O(160), SH7372_PIN_IO_PD(161),
  859. SH7372_PIN_IO_PD(162), SH7372_PIN_IO_PD(163),
  860. SH7372_PIN_I_PD(164), SH7372_PIN_IO_PD(165),
  861. SH7372_PIN_I_PD(166), SH7372_PIN_I_PD(167),
  862. SH7372_PIN_I_PD(168), SH7372_PIN_I_PD(169),
  863. SH7372_PIN_I_PD(170), SH7372_PIN_O(171),
  864. SH7372_PIN_IO_PU_PD(172), SH7372_PIN_IO_PU_PD(173),
  865. SH7372_PIN_IO_PU_PD(174), SH7372_PIN_IO_PU_PD(175),
  866. SH7372_PIN_IO_PU_PD(176), SH7372_PIN_IO_PU_PD(177),
  867. SH7372_PIN_IO_PU_PD(178), SH7372_PIN_O(179),
  868. SH7372_PIN_IO_PU_PD(180), SH7372_PIN_IO_PU_PD(181),
  869. SH7372_PIN_IO_PU_PD(182), SH7372_PIN_IO_PU_PD(183),
  870. SH7372_PIN_IO_PU_PD(184), SH7372_PIN_O(185),
  871. SH7372_PIN_IO_PU_PD(186), SH7372_PIN_IO_PU_PD(187),
  872. SH7372_PIN_IO_PU_PD(188), SH7372_PIN_IO_PU_PD(189),
  873. SH7372_PIN_IO_PU_PD(190),
  874. };
  875. /* - BSC -------------------------------------------------------------------- */
  876. static const unsigned int bsc_data8_pins[] = {
  877. /* D[0:7] */
  878. 46, 47, 48, 49, 50, 51, 52, 53,
  879. };
  880. static const unsigned int bsc_data8_mux[] = {
  881. D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
  882. D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
  883. };
  884. static const unsigned int bsc_data16_pins[] = {
  885. /* D[0:15] */
  886. 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
  887. };
  888. static const unsigned int bsc_data16_mux[] = {
  889. D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
  890. D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
  891. D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
  892. D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
  893. };
  894. static const unsigned int bsc_cs0_pins[] = {
  895. /* CS */
  896. 62,
  897. };
  898. static const unsigned int bsc_cs0_mux[] = {
  899. CS0_MARK,
  900. };
  901. static const unsigned int bsc_cs2_pins[] = {
  902. /* CS */
  903. 63,
  904. };
  905. static const unsigned int bsc_cs2_mux[] = {
  906. CS2_MARK,
  907. };
  908. static const unsigned int bsc_cs4_pins[] = {
  909. /* CS */
  910. 64,
  911. };
  912. static const unsigned int bsc_cs4_mux[] = {
  913. CS4_MARK,
  914. };
  915. static const unsigned int bsc_cs5a_pins[] = {
  916. /* CS */
  917. 65,
  918. };
  919. static const unsigned int bsc_cs5a_mux[] = {
  920. CS5A_MARK,
  921. };
  922. static const unsigned int bsc_cs5b_pins[] = {
  923. /* CS */
  924. 66,
  925. };
  926. static const unsigned int bsc_cs5b_mux[] = {
  927. CS5B_MARK,
  928. };
  929. static const unsigned int bsc_cs6a_pins[] = {
  930. /* CS */
  931. 67,
  932. };
  933. static const unsigned int bsc_cs6a_mux[] = {
  934. CS6A_MARK,
  935. };
  936. static const unsigned int bsc_rd_we8_pins[] = {
  937. /* RD, WE[0] */
  938. 69, 70,
  939. };
  940. static const unsigned int bsc_rd_we8_mux[] = {
  941. RD_FSC_MARK, WE0_FWE_MARK,
  942. };
  943. static const unsigned int bsc_rd_we16_pins[] = {
  944. /* RD, WE[0:1] */
  945. 69, 70, 71,
  946. };
  947. static const unsigned int bsc_rd_we16_mux[] = {
  948. RD_FSC_MARK, WE0_FWE_MARK, WE1_MARK,
  949. };
  950. static const unsigned int bsc_bs_pins[] = {
  951. /* BS */
  952. 19,
  953. };
  954. static const unsigned int bsc_bs_mux[] = {
  955. BS_MARK,
  956. };
  957. static const unsigned int bsc_rdwr_pins[] = {
  958. /* RDWR */
  959. 75,
  960. };
  961. static const unsigned int bsc_rdwr_mux[] = {
  962. RDWR_MARK,
  963. };
  964. static const unsigned int bsc_wait_pins[] = {
  965. /* WAIT */
  966. 74,
  967. };
  968. static const unsigned int bsc_wait_mux[] = {
  969. WAIT_MARK,
  970. };
  971. /* - CEU -------------------------------------------------------------------- */
  972. static const unsigned int ceu_data_0_7_pins[] = {
  973. /* D[0:7] */
  974. 102, 103, 104, 105, 106, 107, 108, 109,
  975. };
  976. static const unsigned int ceu_data_0_7_mux[] = {
  977. VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK, VIO_D3_MARK,
  978. VIO_D4_MARK, VIO_D5_MARK, VIO_D6_MARK, VIO_D7_MARK,
  979. };
  980. static const unsigned int ceu_data_8_15_pins[] = {
  981. /* D[8:15] */
  982. 110, 111, 112, 113, 114, 115, 116, 117,
  983. };
  984. static const unsigned int ceu_data_8_15_mux[] = {
  985. VIO_D8_MARK, VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
  986. VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK, VIO_D15_MARK,
  987. };
  988. static const unsigned int ceu_clk_0_pins[] = {
  989. /* CKO */
  990. 120,
  991. };
  992. static const unsigned int ceu_clk_0_mux[] = {
  993. VIO_CKO_MARK,
  994. };
  995. static const unsigned int ceu_clk_1_pins[] = {
  996. /* CKO */
  997. 16,
  998. };
  999. static const unsigned int ceu_clk_1_mux[] = {
  1000. VIO_CKO1_MARK,
  1001. };
  1002. static const unsigned int ceu_clk_2_pins[] = {
  1003. /* CKO */
  1004. 17,
  1005. };
  1006. static const unsigned int ceu_clk_2_mux[] = {
  1007. VIO_CKO2_MARK,
  1008. };
  1009. static const unsigned int ceu_sync_pins[] = {
  1010. /* CLK, VD, HD */
  1011. 118, 100, 101,
  1012. };
  1013. static const unsigned int ceu_sync_mux[] = {
  1014. VIO_CLK_MARK, VIO_VD_MARK, VIO_HD_MARK,
  1015. };
  1016. static const unsigned int ceu_field_pins[] = {
  1017. /* FIELD */
  1018. 119,
  1019. };
  1020. static const unsigned int ceu_field_mux[] = {
  1021. VIO_FIELD_MARK,
  1022. };
  1023. /* - FLCTL ------------------------------------------------------------------ */
  1024. static const unsigned int flctl_data_pins[] = {
  1025. /* NAF[0:15] */
  1026. 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
  1027. };
  1028. static const unsigned int flctl_data_mux[] = {
  1029. D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
  1030. D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
  1031. D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
  1032. D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
  1033. };
  1034. static const unsigned int flctl_ce0_pins[] = {
  1035. /* CE */
  1036. 68,
  1037. };
  1038. static const unsigned int flctl_ce0_mux[] = {
  1039. FCE0_MARK,
  1040. };
  1041. static const unsigned int flctl_ce1_pins[] = {
  1042. /* CE */
  1043. 66,
  1044. };
  1045. static const unsigned int flctl_ce1_mux[] = {
  1046. FCE1_MARK,
  1047. };
  1048. static const unsigned int flctl_ctrl_pins[] = {
  1049. /* FCDE, FOE, FSC, FWE, FRB */
  1050. 24, 23, 69, 70, 73,
  1051. };
  1052. static const unsigned int flctl_ctrl_mux[] = {
  1053. A5_FCDE_MARK, A4_FOE_MARK, RD_FSC_MARK, WE0_FWE_MARK, FRB_MARK,
  1054. };
  1055. /* - FSIA ------------------------------------------------------------------- */
  1056. static const unsigned int fsia_mclk_in_pins[] = {
  1057. /* CK */
  1058. 4,
  1059. };
  1060. static const unsigned int fsia_mclk_in_mux[] = {
  1061. FSIACK_MARK,
  1062. };
  1063. static const unsigned int fsia_mclk_out_pins[] = {
  1064. /* OMC */
  1065. 8,
  1066. };
  1067. static const unsigned int fsia_mclk_out_mux[] = {
  1068. FSIAOMC_MARK,
  1069. };
  1070. static const unsigned int fsia_sclk_in_pins[] = {
  1071. /* ILR, IBT */
  1072. 5, 6,
  1073. };
  1074. static const unsigned int fsia_sclk_in_mux[] = {
  1075. FSIAILR_MARK, FSIAIBT_MARK,
  1076. };
  1077. static const unsigned int fsia_sclk_out_pins[] = {
  1078. /* OLR, OBT */
  1079. 9, 10,
  1080. };
  1081. static const unsigned int fsia_sclk_out_mux[] = {
  1082. FSIAOLR_MARK, FSIAOBT_MARK,
  1083. };
  1084. static const unsigned int fsia_data_in_pins[] = {
  1085. /* ISLD */
  1086. 7,
  1087. };
  1088. static const unsigned int fsia_data_in_mux[] = {
  1089. FSIAISLD_MARK,
  1090. };
  1091. static const unsigned int fsia_data_out_pins[] = {
  1092. /* OSLD */
  1093. 11,
  1094. };
  1095. static const unsigned int fsia_data_out_mux[] = {
  1096. FSIAOSLD_MARK,
  1097. };
  1098. static const unsigned int fsia_spdif_0_pins[] = {
  1099. /* SPDIF */
  1100. 11,
  1101. };
  1102. static const unsigned int fsia_spdif_0_mux[] = {
  1103. FSIASPDIF_11_MARK,
  1104. };
  1105. static const unsigned int fsia_spdif_1_pins[] = {
  1106. /* SPDIF */
  1107. 15,
  1108. };
  1109. static const unsigned int fsia_spdif_1_mux[] = {
  1110. FSIASPDIF_15_MARK,
  1111. };
  1112. /* - FSIB ------------------------------------------------------------------- */
  1113. static const unsigned int fsib_mclk_in_pins[] = {
  1114. /* CK */
  1115. 4,
  1116. };
  1117. static const unsigned int fsib_mclk_in_mux[] = {
  1118. FSIBCK_MARK,
  1119. };
  1120. /* - HDMI ------------------------------------------------------------------- */
  1121. static const unsigned int hdmi_pins[] = {
  1122. /* HPD, CEC */
  1123. 169, 170,
  1124. };
  1125. static const unsigned int hdmi_mux[] = {
  1126. HDMI_HPD_MARK, HDMI_CEC_MARK,
  1127. };
  1128. /* - INTC ------------------------------------------------------------------- */
  1129. IRQC_PINS_MUX(0, 6, 162);
  1130. IRQC_PIN_MUX(1, 12);
  1131. IRQC_PINS_MUX(2, 4, 5);
  1132. IRQC_PINS_MUX(3, 8, 16);
  1133. IRQC_PINS_MUX(4, 17, 163);
  1134. IRQC_PIN_MUX(5, 18);
  1135. IRQC_PINS_MUX(6, 39, 164);
  1136. IRQC_PINS_MUX(7, 40, 167);
  1137. IRQC_PINS_MUX(8, 41, 168);
  1138. IRQC_PINS_MUX(9, 42, 169);
  1139. IRQC_PIN_MUX(10, 65);
  1140. IRQC_PIN_MUX(11, 67);
  1141. IRQC_PINS_MUX(12, 80, 137);
  1142. IRQC_PINS_MUX(13, 81, 145);
  1143. IRQC_PINS_MUX(14, 82, 146);
  1144. IRQC_PINS_MUX(15, 83, 147);
  1145. IRQC_PINS_MUX(16, 84, 170);
  1146. IRQC_PIN_MUX(17, 85);
  1147. IRQC_PIN_MUX(18, 86);
  1148. IRQC_PIN_MUX(19, 87);
  1149. IRQC_PIN_MUX(20, 92);
  1150. IRQC_PIN_MUX(21, 93);
  1151. IRQC_PIN_MUX(22, 94);
  1152. IRQC_PIN_MUX(23, 95);
  1153. IRQC_PIN_MUX(24, 112);
  1154. IRQC_PIN_MUX(25, 119);
  1155. IRQC_PINS_MUX(26, 121, 172);
  1156. IRQC_PINS_MUX(27, 122, 180);
  1157. IRQC_PINS_MUX(28, 123, 181);
  1158. IRQC_PINS_MUX(29, 129, 182);
  1159. IRQC_PINS_MUX(30, 130, 183);
  1160. IRQC_PINS_MUX(31, 138, 184);
  1161. /* - KEYSC ------------------------------------------------------------------ */
  1162. static const unsigned int keysc_in04_0_pins[] = {
  1163. /* KEYIN[0:4] */
  1164. 136, 135, 134, 133, 132,
  1165. };
  1166. static const unsigned int keysc_in04_0_mux[] = {
  1167. KEYIN0_136_MARK, KEYIN1_135_MARK, KEYIN2_134_MARK, KEYIN3_133_MARK,
  1168. KEYIN4_MARK,
  1169. };
  1170. static const unsigned int keysc_in04_1_pins[] = {
  1171. /* KEYIN[0:4] */
  1172. 121, 122, 123, 124, 132,
  1173. };
  1174. static const unsigned int keysc_in04_1_mux[] = {
  1175. KEYIN0_121_MARK, KEYIN1_122_MARK, KEYIN2_123_MARK, KEYIN3_124_MARK,
  1176. KEYIN4_MARK,
  1177. };
  1178. static const unsigned int keysc_in5_pins[] = {
  1179. /* KEYIN5 */
  1180. 131,
  1181. };
  1182. static const unsigned int keysc_in5_mux[] = {
  1183. KEYIN5_MARK,
  1184. };
  1185. static const unsigned int keysc_in6_pins[] = {
  1186. /* KEYIN6 */
  1187. 130,
  1188. };
  1189. static const unsigned int keysc_in6_mux[] = {
  1190. KEYIN6_MARK,
  1191. };
  1192. static const unsigned int keysc_in7_pins[] = {
  1193. /* KEYIN7 */
  1194. 129,
  1195. };
  1196. static const unsigned int keysc_in7_mux[] = {
  1197. KEYIN7_MARK,
  1198. };
  1199. static const unsigned int keysc_out4_pins[] = {
  1200. /* KEYOUT[0:3] */
  1201. 128, 127, 126, 125,
  1202. };
  1203. static const unsigned int keysc_out4_mux[] = {
  1204. KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
  1205. };
  1206. static const unsigned int keysc_out5_pins[] = {
  1207. /* KEYOUT[0:4] */
  1208. 128, 127, 126, 125, 124,
  1209. };
  1210. static const unsigned int keysc_out5_mux[] = {
  1211. KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
  1212. KEYOUT4_MARK,
  1213. };
  1214. static const unsigned int keysc_out6_pins[] = {
  1215. /* KEYOUT[0:5] */
  1216. 128, 127, 126, 125, 124, 123,
  1217. };
  1218. static const unsigned int keysc_out6_mux[] = {
  1219. KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
  1220. KEYOUT4_MARK, KEYOUT5_MARK,
  1221. };
  1222. static const unsigned int keysc_out8_pins[] = {
  1223. /* KEYOUT[0:7] */
  1224. 128, 127, 126, 125, 124, 123, 122, 121,
  1225. };
  1226. static const unsigned int keysc_out8_mux[] = {
  1227. KEYOUT0_MARK, KEYOUT1_MARK, KEYOUT2_MARK, KEYOUT3_MARK,
  1228. KEYOUT4_MARK, KEYOUT5_MARK, KEYOUT6_MARK, KEYOUT7_MARK,
  1229. };
  1230. /* - LCD -------------------------------------------------------------------- */
  1231. static const unsigned int lcd_data8_pins[] = {
  1232. /* D[0:7] */
  1233. 121, 122, 123, 124, 125, 126, 127, 128,
  1234. };
  1235. static const unsigned int lcd_data8_mux[] = {
  1236. /* LCDC */
  1237. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1238. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1239. };
  1240. static const unsigned int lcd_data9_pins[] = {
  1241. /* D[0:8] */
  1242. 121, 122, 123, 124, 125, 126, 127, 128,
  1243. 129,
  1244. 137, 138, 139, 140, 141, 142, 143, 144,
  1245. };
  1246. static const unsigned int lcd_data9_mux[] = {
  1247. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1248. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1249. LCDD8_MARK,
  1250. };
  1251. static const unsigned int lcd_data12_pins[] = {
  1252. /* D[0:11] */
  1253. 121, 122, 123, 124, 125, 126, 127, 128,
  1254. 129, 130, 131, 132,
  1255. };
  1256. static const unsigned int lcd_data12_mux[] = {
  1257. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1258. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1259. LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
  1260. };
  1261. static const unsigned int lcd_data16_pins[] = {
  1262. /* D[0:15] */
  1263. 121, 122, 123, 124, 125, 126, 127, 128,
  1264. 129, 130, 131, 132, 133, 134, 135, 136,
  1265. };
  1266. static const unsigned int lcd_data16_mux[] = {
  1267. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1268. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1269. LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
  1270. LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
  1271. };
  1272. static const unsigned int lcd_data18_pins[] = {
  1273. /* D[0:17] */
  1274. 121, 122, 123, 124, 125, 126, 127, 128,
  1275. 129, 130, 131, 132, 133, 134, 135, 136,
  1276. 137, 138,
  1277. };
  1278. static const unsigned int lcd_data18_mux[] = {
  1279. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1280. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1281. LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
  1282. LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
  1283. LCDD16_MARK, LCDD17_MARK,
  1284. };
  1285. static const unsigned int lcd_data24_pins[] = {
  1286. /* D[0:23] */
  1287. 121, 122, 123, 124, 125, 126, 127, 128,
  1288. 129, 130, 131, 132, 133, 134, 135, 136,
  1289. 137, 138, 139, 140, 141, 142, 143, 144,
  1290. };
  1291. static const unsigned int lcd_data24_mux[] = {
  1292. LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
  1293. LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
  1294. LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
  1295. LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
  1296. LCDD16_MARK, LCDD17_MARK, LCDD18_MARK, LCDD19_MARK,
  1297. LCDD20_MARK, LCDD21_MARK, LCDD22_MARK, LCDD23_MARK,
  1298. };
  1299. static const unsigned int lcd_display_pins[] = {
  1300. /* DON */
  1301. 151,
  1302. };
  1303. static const unsigned int lcd_display_mux[] = {
  1304. LCDDON_MARK,
  1305. };
  1306. static const unsigned int lcd_lclk_pins[] = {
  1307. /* LCLK */
  1308. 150,
  1309. };
  1310. static const unsigned int lcd_lclk_mux[] = {
  1311. LCDLCLK_MARK,
  1312. };
  1313. static const unsigned int lcd_sync_pins[] = {
  1314. /* VSYN, HSYN, DCK, DISP */
  1315. 146, 145, 147, 149,
  1316. };
  1317. static const unsigned int lcd_sync_mux[] = {
  1318. LCDVSYN_MARK, LCDHSYN_MARK, LCDDCK_MARK, LCDDISP_MARK,
  1319. };
  1320. static const unsigned int lcd_sys_pins[] = {
  1321. /* CS, WR, RD, RS */
  1322. 145, 147, 148, 149,
  1323. };
  1324. static const unsigned int lcd_sys_mux[] = {
  1325. LCDCS_MARK, LCDWR_MARK, LCDRD_MARK, LCDRS_MARK,
  1326. };
  1327. /* - MMCIF ------------------------------------------------------------------ */
  1328. static const unsigned int mmc0_data1_0_pins[] = {
  1329. /* D[0] */
  1330. 84,
  1331. };
  1332. static const unsigned int mmc0_data1_0_mux[] = {
  1333. MMCD0_0_MARK,
  1334. };
  1335. static const unsigned int mmc0_data4_0_pins[] = {
  1336. /* D[0:3] */
  1337. 84, 85, 86, 87,
  1338. };
  1339. static const unsigned int mmc0_data4_0_mux[] = {
  1340. MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
  1341. };
  1342. static const unsigned int mmc0_data8_0_pins[] = {
  1343. /* D[0:7] */
  1344. 84, 85, 86, 87, 88, 89, 90, 91,
  1345. };
  1346. static const unsigned int mmc0_data8_0_mux[] = {
  1347. MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
  1348. MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK,
  1349. };
  1350. static const unsigned int mmc0_ctrl_0_pins[] = {
  1351. /* CMD, CLK */
  1352. 92, 99,
  1353. };
  1354. static const unsigned int mmc0_ctrl_0_mux[] = {
  1355. MMCCMD0_MARK, MMCCLK0_MARK,
  1356. };
  1357. static const unsigned int mmc0_data1_1_pins[] = {
  1358. /* D[0] */
  1359. 54,
  1360. };
  1361. static const unsigned int mmc0_data1_1_mux[] = {
  1362. MMCD1_0_MARK,
  1363. };
  1364. static const unsigned int mmc0_data4_1_pins[] = {
  1365. /* D[0:3] */
  1366. 54, 55, 56, 57,
  1367. };
  1368. static const unsigned int mmc0_data4_1_mux[] = {
  1369. MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
  1370. };
  1371. static const unsigned int mmc0_data8_1_pins[] = {
  1372. /* D[0:7] */
  1373. 54, 55, 56, 57, 58, 59, 60, 61,
  1374. };
  1375. static const unsigned int mmc0_data8_1_mux[] = {
  1376. MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
  1377. MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK,
  1378. };
  1379. static const unsigned int mmc0_ctrl_1_pins[] = {
  1380. /* CMD, CLK */
  1381. 67, 66,
  1382. };
  1383. static const unsigned int mmc0_ctrl_1_mux[] = {
  1384. MMCCMD1_MARK, MMCCLK1_MARK,
  1385. };
  1386. /* - SCIFA0 ----------------------------------------------------------------- */
  1387. static const unsigned int scifa0_data_pins[] = {
  1388. /* RXD, TXD */
  1389. 153, 152,
  1390. };
  1391. static const unsigned int scifa0_data_mux[] = {
  1392. SCIFA0_RXD_MARK, SCIFA0_TXD_MARK,
  1393. };
  1394. static const unsigned int scifa0_clk_pins[] = {
  1395. /* SCK */
  1396. 156,
  1397. };
  1398. static const unsigned int scifa0_clk_mux[] = {
  1399. SCIFA0_SCK_MARK,
  1400. };
  1401. static const unsigned int scifa0_ctrl_pins[] = {
  1402. /* RTS, CTS */
  1403. 157, 158,
  1404. };
  1405. static const unsigned int scifa0_ctrl_mux[] = {
  1406. SCIFA0_RTS_MARK, SCIFA0_CTS_MARK,
  1407. };
  1408. /* - SCIFA1 ----------------------------------------------------------------- */
  1409. static const unsigned int scifa1_data_pins[] = {
  1410. /* RXD, TXD */
  1411. 155, 154,
  1412. };
  1413. static const unsigned int scifa1_data_mux[] = {
  1414. SCIFA1_RXD_MARK, SCIFA1_TXD_MARK,
  1415. };
  1416. static const unsigned int scifa1_clk_pins[] = {
  1417. /* SCK */
  1418. 159,
  1419. };
  1420. static const unsigned int scifa1_clk_mux[] = {
  1421. SCIFA1_SCK_MARK,
  1422. };
  1423. static const unsigned int scifa1_ctrl_pins[] = {
  1424. /* RTS, CTS */
  1425. 160, 161,
  1426. };
  1427. static const unsigned int scifa1_ctrl_mux[] = {
  1428. SCIFA1_RTS_MARK, SCIFA1_CTS_MARK,
  1429. };
  1430. /* - SCIFA2 ----------------------------------------------------------------- */
  1431. static const unsigned int scifa2_data_pins[] = {
  1432. /* RXD, TXD */
  1433. 97, 96,
  1434. };
  1435. static const unsigned int scifa2_data_mux[] = {
  1436. SCIFA2_RXD1_MARK, SCIFA2_TXD1_MARK,
  1437. };
  1438. static const unsigned int scifa2_clk_pins[] = {
  1439. /* SCK */
  1440. 98,
  1441. };
  1442. static const unsigned int scifa2_clk_mux[] = {
  1443. SCIFA2_SCK1_MARK,
  1444. };
  1445. static const unsigned int scifa2_ctrl_pins[] = {
  1446. /* RTS, CTS */
  1447. 95, 94,
  1448. };
  1449. static const unsigned int scifa2_ctrl_mux[] = {
  1450. SCIFA2_RTS1_MARK, SCIFA2_CTS1_MARK,
  1451. };
  1452. /* - SCIFA3 ----------------------------------------------------------------- */
  1453. static const unsigned int scifa3_data_pins[] = {
  1454. /* RXD, TXD */
  1455. 144, 143,
  1456. };
  1457. static const unsigned int scifa3_data_mux[] = {
  1458. SCIFA3_RXD_MARK, SCIFA3_TXD_MARK,
  1459. };
  1460. static const unsigned int scifa3_clk_pins[] = {
  1461. /* SCK */
  1462. 142,
  1463. };
  1464. static const unsigned int scifa3_clk_mux[] = {
  1465. SCIFA3_SCK_MARK,
  1466. };
  1467. static const unsigned int scifa3_ctrl_0_pins[] = {
  1468. /* RTS, CTS */
  1469. 44, 43,
  1470. };
  1471. static const unsigned int scifa3_ctrl_0_mux[] = {
  1472. SCIFA3_RTS_44_MARK, SCIFA3_CTS_43_MARK,
  1473. };
  1474. static const unsigned int scifa3_ctrl_1_pins[] = {
  1475. /* RTS, CTS */
  1476. 141, 140,
  1477. };
  1478. static const unsigned int scifa3_ctrl_1_mux[] = {
  1479. SCIFA3_RTS_141_MARK, SCIFA3_CTS_140_MARK,
  1480. };
  1481. /* - SCIFA4 ----------------------------------------------------------------- */
  1482. static const unsigned int scifa4_data_pins[] = {
  1483. /* RXD, TXD */
  1484. 5, 6,
  1485. };
  1486. static const unsigned int scifa4_data_mux[] = {
  1487. SCIFA4_RXD_MARK, SCIFA4_TXD_MARK,
  1488. };
  1489. /* - SCIFA5 ----------------------------------------------------------------- */
  1490. static const unsigned int scifa5_data_pins[] = {
  1491. /* RXD, TXD */
  1492. 8, 12,
  1493. };
  1494. static const unsigned int scifa5_data_mux[] = {
  1495. SCIFA5_RXD_MARK, SCIFA5_TXD_MARK,
  1496. };
  1497. /* - SCIFB ------------------------------------------------------------------ */
  1498. static const unsigned int scifb_data_pins[] = {
  1499. /* RXD, TXD */
  1500. 166, 165,
  1501. };
  1502. static const unsigned int scifb_data_mux[] = {
  1503. SCIFB_RXD_MARK, SCIFB_TXD_MARK,
  1504. };
  1505. static const unsigned int scifb_clk_pins[] = {
  1506. /* SCK */
  1507. 162,
  1508. };
  1509. static const unsigned int scifb_clk_mux[] = {
  1510. SCIFB_SCK_MARK,
  1511. };
  1512. static const unsigned int scifb_ctrl_pins[] = {
  1513. /* RTS, CTS */
  1514. 163, 164,
  1515. };
  1516. static const unsigned int scifb_ctrl_mux[] = {
  1517. SCIFB_RTS_MARK, SCIFB_CTS_MARK,
  1518. };
  1519. /* - SDHI0 ------------------------------------------------------------------ */
  1520. static const unsigned int sdhi0_data1_pins[] = {
  1521. /* D0 */
  1522. 173,
  1523. };
  1524. static const unsigned int sdhi0_data1_mux[] = {
  1525. SDHID0_0_MARK,
  1526. };
  1527. static const unsigned int sdhi0_data4_pins[] = {
  1528. /* D[0:3] */
  1529. 173, 174, 175, 176,
  1530. };
  1531. static const unsigned int sdhi0_data4_mux[] = {
  1532. SDHID0_0_MARK, SDHID0_1_MARK, SDHID0_2_MARK, SDHID0_3_MARK,
  1533. };
  1534. static const unsigned int sdhi0_ctrl_pins[] = {
  1535. /* CMD, CLK */
  1536. 177, 171,
  1537. };
  1538. static const unsigned int sdhi0_ctrl_mux[] = {
  1539. SDHICMD0_MARK, SDHICLK0_MARK,
  1540. };
  1541. static const unsigned int sdhi0_cd_pins[] = {
  1542. /* CD */
  1543. 172,
  1544. };
  1545. static const unsigned int sdhi0_cd_mux[] = {
  1546. SDHICD0_MARK,
  1547. };
  1548. static const unsigned int sdhi0_wp_pins[] = {
  1549. /* WP */
  1550. 178,
  1551. };
  1552. static const unsigned int sdhi0_wp_mux[] = {
  1553. SDHIWP0_MARK,
  1554. };
  1555. /* - SDHI1 ------------------------------------------------------------------ */
  1556. static const unsigned int sdhi1_data1_pins[] = {
  1557. /* D0 */
  1558. 180,
  1559. };
  1560. static const unsigned int sdhi1_data1_mux[] = {
  1561. SDHID1_0_MARK,
  1562. };
  1563. static const unsigned int sdhi1_data4_pins[] = {
  1564. /* D[0:3] */
  1565. 180, 181, 182, 183,
  1566. };
  1567. static const unsigned int sdhi1_data4_mux[] = {
  1568. SDHID1_0_MARK, SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK,
  1569. };
  1570. static const unsigned int sdhi1_ctrl_pins[] = {
  1571. /* CMD, CLK */
  1572. 184, 179,
  1573. };
  1574. static const unsigned int sdhi1_ctrl_mux[] = {
  1575. SDHICMD1_MARK, SDHICLK1_MARK,
  1576. };
  1577. static const unsigned int sdhi2_data1_pins[] = {
  1578. /* D0 */
  1579. 186,
  1580. };
  1581. static const unsigned int sdhi2_data1_mux[] = {
  1582. SDHID2_0_MARK,
  1583. };
  1584. static const unsigned int sdhi2_data4_pins[] = {
  1585. /* D[0:3] */
  1586. 186, 187, 188, 189,
  1587. };
  1588. static const unsigned int sdhi2_data4_mux[] = {
  1589. SDHID2_0_MARK, SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK,
  1590. };
  1591. static const unsigned int sdhi2_ctrl_pins[] = {
  1592. /* CMD, CLK */
  1593. 190, 185,
  1594. };
  1595. static const unsigned int sdhi2_ctrl_mux[] = {
  1596. SDHICMD2_MARK, SDHICLK2_MARK,
  1597. };
  1598. /* - USB0 ------------------------------------------------------------------- */
  1599. static const unsigned int usb0_vbus_pins[] = {
  1600. /* VBUS */
  1601. 167,
  1602. };
  1603. static const unsigned int usb0_vbus_mux[] = {
  1604. VBUS0_0_MARK,
  1605. };
  1606. static const unsigned int usb0_otg_id_pins[] = {
  1607. /* IDIN */
  1608. 113,
  1609. };
  1610. static const unsigned int usb0_otg_id_mux[] = {
  1611. IDIN_0_MARK,
  1612. };
  1613. static const unsigned int usb0_otg_ctrl_pins[] = {
  1614. /* PWEN, EXTLP, OVCN, OVCN2 */
  1615. 116, 114, 117, 115,
  1616. };
  1617. static const unsigned int usb0_otg_ctrl_mux[] = {
  1618. PWEN_0_MARK, EXTLP_0_MARK, OVCN_0_MARK, OVCN2_0_MARK,
  1619. };
  1620. /* - USB1 ------------------------------------------------------------------- */
  1621. static const unsigned int usb1_vbus_pins[] = {
  1622. /* VBUS */
  1623. 168,
  1624. };
  1625. static const unsigned int usb1_vbus_mux[] = {
  1626. VBUS0_1_MARK,
  1627. };
  1628. static const unsigned int usb1_otg_id_0_pins[] = {
  1629. /* IDIN */
  1630. 113,
  1631. };
  1632. static const unsigned int usb1_otg_id_0_mux[] = {
  1633. IDIN_1_113_MARK,
  1634. };
  1635. static const unsigned int usb1_otg_id_1_pins[] = {
  1636. /* IDIN */
  1637. 18,
  1638. };
  1639. static const unsigned int usb1_otg_id_1_mux[] = {
  1640. IDIN_1_18_MARK,
  1641. };
  1642. static const unsigned int usb1_otg_ctrl_0_pins[] = {
  1643. /* PWEN, EXTLP, OVCN, OVCN2 */
  1644. 115, 116, 114, 117, 113,
  1645. };
  1646. static const unsigned int usb1_otg_ctrl_0_mux[] = {
  1647. PWEN_1_115_MARK, EXTLP_1_MARK, OVCN_1_114_MARK, OVCN2_1_MARK,
  1648. };
  1649. static const unsigned int usb1_otg_ctrl_1_pins[] = {
  1650. /* PWEN, EXTLP, OVCN, OVCN2 */
  1651. 138, 116, 162, 117, 18,
  1652. };
  1653. static const unsigned int usb1_otg_ctrl_1_mux[] = {
  1654. PWEN_1_138_MARK, EXTLP_1_MARK, OVCN_1_162_MARK, OVCN2_1_MARK,
  1655. };
  1656. static const struct sh_pfc_pin_group pinmux_groups[] = {
  1657. SH_PFC_PIN_GROUP(bsc_data8),
  1658. SH_PFC_PIN_GROUP(bsc_data16),
  1659. SH_PFC_PIN_GROUP(bsc_cs0),
  1660. SH_PFC_PIN_GROUP(bsc_cs2),
  1661. SH_PFC_PIN_GROUP(bsc_cs4),
  1662. SH_PFC_PIN_GROUP(bsc_cs5a),
  1663. SH_PFC_PIN_GROUP(bsc_cs5b),
  1664. SH_PFC_PIN_GROUP(bsc_cs6a),
  1665. SH_PFC_PIN_GROUP(bsc_rd_we8),
  1666. SH_PFC_PIN_GROUP(bsc_rd_we16),
  1667. SH_PFC_PIN_GROUP(bsc_bs),
  1668. SH_PFC_PIN_GROUP(bsc_rdwr),
  1669. SH_PFC_PIN_GROUP(ceu_data_0_7),
  1670. SH_PFC_PIN_GROUP(ceu_data_8_15),
  1671. SH_PFC_PIN_GROUP(ceu_clk_0),
  1672. SH_PFC_PIN_GROUP(ceu_clk_1),
  1673. SH_PFC_PIN_GROUP(ceu_clk_2),
  1674. SH_PFC_PIN_GROUP(ceu_sync),
  1675. SH_PFC_PIN_GROUP(ceu_field),
  1676. SH_PFC_PIN_GROUP(flctl_data),
  1677. SH_PFC_PIN_GROUP(flctl_ce0),
  1678. SH_PFC_PIN_GROUP(flctl_ce1),
  1679. SH_PFC_PIN_GROUP(flctl_ctrl),
  1680. SH_PFC_PIN_GROUP(fsia_mclk_in),
  1681. SH_PFC_PIN_GROUP(fsia_mclk_out),
  1682. SH_PFC_PIN_GROUP(fsia_sclk_in),
  1683. SH_PFC_PIN_GROUP(fsia_sclk_out),
  1684. SH_PFC_PIN_GROUP(fsia_data_in),
  1685. SH_PFC_PIN_GROUP(fsia_data_out),
  1686. SH_PFC_PIN_GROUP(fsia_spdif_0),
  1687. SH_PFC_PIN_GROUP(fsia_spdif_1),
  1688. SH_PFC_PIN_GROUP(fsib_mclk_in),
  1689. SH_PFC_PIN_GROUP(hdmi),
  1690. SH_PFC_PIN_GROUP(intc_irq0_0),
  1691. SH_PFC_PIN_GROUP(intc_irq0_1),
  1692. SH_PFC_PIN_GROUP(intc_irq1),
  1693. SH_PFC_PIN_GROUP(intc_irq2_0),
  1694. SH_PFC_PIN_GROUP(intc_irq2_1),
  1695. SH_PFC_PIN_GROUP(intc_irq3_0),
  1696. SH_PFC_PIN_GROUP(intc_irq3_1),
  1697. SH_PFC_PIN_GROUP(intc_irq4_0),
  1698. SH_PFC_PIN_GROUP(intc_irq4_1),
  1699. SH_PFC_PIN_GROUP(intc_irq5),
  1700. SH_PFC_PIN_GROUP(intc_irq6_0),
  1701. SH_PFC_PIN_GROUP(intc_irq6_1),
  1702. SH_PFC_PIN_GROUP(intc_irq7_0),
  1703. SH_PFC_PIN_GROUP(intc_irq7_1),
  1704. SH_PFC_PIN_GROUP(intc_irq8_0),
  1705. SH_PFC_PIN_GROUP(intc_irq8_1),
  1706. SH_PFC_PIN_GROUP(intc_irq9_0),
  1707. SH_PFC_PIN_GROUP(intc_irq9_1),
  1708. SH_PFC_PIN_GROUP(intc_irq10),
  1709. SH_PFC_PIN_GROUP(intc_irq11),
  1710. SH_PFC_PIN_GROUP(intc_irq12_0),
  1711. SH_PFC_PIN_GROUP(intc_irq12_1),
  1712. SH_PFC_PIN_GROUP(intc_irq13_0),
  1713. SH_PFC_PIN_GROUP(intc_irq13_1),
  1714. SH_PFC_PIN_GROUP(intc_irq14_0),
  1715. SH_PFC_PIN_GROUP(intc_irq14_1),
  1716. SH_PFC_PIN_GROUP(intc_irq15_0),
  1717. SH_PFC_PIN_GROUP(intc_irq15_1),
  1718. SH_PFC_PIN_GROUP(intc_irq16_0),
  1719. SH_PFC_PIN_GROUP(intc_irq16_1),
  1720. SH_PFC_PIN_GROUP(intc_irq17),
  1721. SH_PFC_PIN_GROUP(intc_irq18),
  1722. SH_PFC_PIN_GROUP(intc_irq19),
  1723. SH_PFC_PIN_GROUP(intc_irq20),
  1724. SH_PFC_PIN_GROUP(intc_irq21),
  1725. SH_PFC_PIN_GROUP(intc_irq22),
  1726. SH_PFC_PIN_GROUP(intc_irq23),
  1727. SH_PFC_PIN_GROUP(intc_irq24),
  1728. SH_PFC_PIN_GROUP(intc_irq25),
  1729. SH_PFC_PIN_GROUP(intc_irq26_0),
  1730. SH_PFC_PIN_GROUP(intc_irq26_1),
  1731. SH_PFC_PIN_GROUP(intc_irq27_0),
  1732. SH_PFC_PIN_GROUP(intc_irq27_1),
  1733. SH_PFC_PIN_GROUP(intc_irq28_0),
  1734. SH_PFC_PIN_GROUP(intc_irq28_1),
  1735. SH_PFC_PIN_GROUP(intc_irq29_0),
  1736. SH_PFC_PIN_GROUP(intc_irq29_1),
  1737. SH_PFC_PIN_GROUP(intc_irq30_0),
  1738. SH_PFC_PIN_GROUP(intc_irq30_1),
  1739. SH_PFC_PIN_GROUP(intc_irq31_0),
  1740. SH_PFC_PIN_GROUP(intc_irq31_1),
  1741. SH_PFC_PIN_GROUP(keysc_in04_0),
  1742. SH_PFC_PIN_GROUP(keysc_in04_1),
  1743. SH_PFC_PIN_GROUP(keysc_in5),
  1744. SH_PFC_PIN_GROUP(keysc_in6),
  1745. SH_PFC_PIN_GROUP(keysc_in7),
  1746. SH_PFC_PIN_GROUP(keysc_out4),
  1747. SH_PFC_PIN_GROUP(keysc_out5),
  1748. SH_PFC_PIN_GROUP(keysc_out6),
  1749. SH_PFC_PIN_GROUP(keysc_out8),
  1750. SH_PFC_PIN_GROUP(lcd_data8),
  1751. SH_PFC_PIN_GROUP(lcd_data9),
  1752. SH_PFC_PIN_GROUP(lcd_data12),
  1753. SH_PFC_PIN_GROUP(lcd_data16),
  1754. SH_PFC_PIN_GROUP(lcd_data18),
  1755. SH_PFC_PIN_GROUP(lcd_data24),
  1756. SH_PFC_PIN_GROUP(lcd_display),
  1757. SH_PFC_PIN_GROUP(lcd_lclk),
  1758. SH_PFC_PIN_GROUP(lcd_sync),
  1759. SH_PFC_PIN_GROUP(lcd_sys),
  1760. SH_PFC_PIN_GROUP(mmc0_data1_0),
  1761. SH_PFC_PIN_GROUP(mmc0_data4_0),
  1762. SH_PFC_PIN_GROUP(mmc0_data8_0),
  1763. SH_PFC_PIN_GROUP(mmc0_ctrl_0),
  1764. SH_PFC_PIN_GROUP(mmc0_data1_1),
  1765. SH_PFC_PIN_GROUP(mmc0_data4_1),
  1766. SH_PFC_PIN_GROUP(mmc0_data8_1),
  1767. SH_PFC_PIN_GROUP(mmc0_ctrl_1),
  1768. SH_PFC_PIN_GROUP(scifa0_data),
  1769. SH_PFC_PIN_GROUP(scifa0_clk),
  1770. SH_PFC_PIN_GROUP(scifa0_ctrl),
  1771. SH_PFC_PIN_GROUP(scifa1_data),
  1772. SH_PFC_PIN_GROUP(scifa1_clk),
  1773. SH_PFC_PIN_GROUP(scifa1_ctrl),
  1774. SH_PFC_PIN_GROUP(scifa2_data),
  1775. SH_PFC_PIN_GROUP(scifa2_clk),
  1776. SH_PFC_PIN_GROUP(scifa2_ctrl),
  1777. SH_PFC_PIN_GROUP(scifa3_data),
  1778. SH_PFC_PIN_GROUP(scifa3_clk),
  1779. SH_PFC_PIN_GROUP(scifa3_ctrl_0),
  1780. SH_PFC_PIN_GROUP(scifa3_ctrl_1),
  1781. SH_PFC_PIN_GROUP(scifa4_data),
  1782. SH_PFC_PIN_GROUP(scifa5_data),
  1783. SH_PFC_PIN_GROUP(scifb_data),
  1784. SH_PFC_PIN_GROUP(scifb_clk),
  1785. SH_PFC_PIN_GROUP(scifb_ctrl),
  1786. SH_PFC_PIN_GROUP(sdhi0_data1),
  1787. SH_PFC_PIN_GROUP(sdhi0_data4),
  1788. SH_PFC_PIN_GROUP(sdhi0_ctrl),
  1789. SH_PFC_PIN_GROUP(sdhi0_cd),
  1790. SH_PFC_PIN_GROUP(sdhi0_wp),
  1791. SH_PFC_PIN_GROUP(sdhi1_data1),
  1792. SH_PFC_PIN_GROUP(sdhi1_data4),
  1793. SH_PFC_PIN_GROUP(sdhi1_ctrl),
  1794. SH_PFC_PIN_GROUP(sdhi2_data1),
  1795. SH_PFC_PIN_GROUP(sdhi2_data4),
  1796. SH_PFC_PIN_GROUP(sdhi2_ctrl),
  1797. SH_PFC_PIN_GROUP(usb0_vbus),
  1798. SH_PFC_PIN_GROUP(usb0_otg_id),
  1799. SH_PFC_PIN_GROUP(usb0_otg_ctrl),
  1800. SH_PFC_PIN_GROUP(usb1_vbus),
  1801. SH_PFC_PIN_GROUP(usb1_otg_id_0),
  1802. SH_PFC_PIN_GROUP(usb1_otg_id_1),
  1803. SH_PFC_PIN_GROUP(usb1_otg_ctrl_0),
  1804. SH_PFC_PIN_GROUP(usb1_otg_ctrl_1),
  1805. };
  1806. static const char * const bsc_groups[] = {
  1807. "bsc_data8",
  1808. "bsc_data16",
  1809. "bsc_cs0",
  1810. "bsc_cs2",
  1811. "bsc_cs4",
  1812. "bsc_cs5a",
  1813. "bsc_cs5b",
  1814. "bsc_cs6a",
  1815. "bsc_rd_we8",
  1816. "bsc_rd_we16",
  1817. "bsc_bs",
  1818. "bsc_rdwr",
  1819. };
  1820. static const char * const ceu_groups[] = {
  1821. "ceu_data_0_7",
  1822. "ceu_data_8_15",
  1823. "ceu_clk_0",
  1824. "ceu_clk_1",
  1825. "ceu_clk_2",
  1826. "ceu_sync",
  1827. "ceu_field",
  1828. };
  1829. static const char * const flctl_groups[] = {
  1830. "flctl_data",
  1831. "flctl_ce0",
  1832. "flctl_ce1",
  1833. "flctl_ctrl",
  1834. };
  1835. static const char * const fsia_groups[] = {
  1836. "fsia_mclk_in",
  1837. "fsia_mclk_out",
  1838. "fsia_sclk_in",
  1839. "fsia_sclk_out",
  1840. "fsia_data_in",
  1841. "fsia_data_out",
  1842. "fsia_spdif_0",
  1843. "fsia_spdif_1",
  1844. };
  1845. static const char * const fsib_groups[] = {
  1846. "fsib_mclk_in",
  1847. };
  1848. static const char * const hdmi_groups[] = {
  1849. "hdmi",
  1850. };
  1851. static const char * const intc_groups[] = {
  1852. "intc_irq0_0",
  1853. "intc_irq0_1",
  1854. "intc_irq1",
  1855. "intc_irq2_0",
  1856. "intc_irq2_1",
  1857. "intc_irq3_0",
  1858. "intc_irq3_1",
  1859. "intc_irq4_0",
  1860. "intc_irq4_1",
  1861. "intc_irq5",
  1862. "intc_irq6_0",
  1863. "intc_irq6_1",
  1864. "intc_irq7_0",
  1865. "intc_irq7_1",
  1866. "intc_irq8_0",
  1867. "intc_irq8_1",
  1868. "intc_irq9_0",
  1869. "intc_irq9_1",
  1870. "intc_irq10",
  1871. "intc_irq11",
  1872. "intc_irq12_0",
  1873. "intc_irq12_1",
  1874. "intc_irq13_0",
  1875. "intc_irq13_1",
  1876. "intc_irq14_0",
  1877. "intc_irq14_1",
  1878. "intc_irq15_0",
  1879. "intc_irq15_1",
  1880. "intc_irq16_0",
  1881. "intc_irq16_1",
  1882. "intc_irq17",
  1883. "intc_irq18",
  1884. "intc_irq19",
  1885. "intc_irq20",
  1886. "intc_irq21",
  1887. "intc_irq22",
  1888. "intc_irq23",
  1889. "intc_irq24",
  1890. "intc_irq25",
  1891. "intc_irq26_0",
  1892. "intc_irq26_1",
  1893. "intc_irq27_0",
  1894. "intc_irq27_1",
  1895. "intc_irq28_0",
  1896. "intc_irq28_1",
  1897. "intc_irq29_0",
  1898. "intc_irq29_1",
  1899. "intc_irq30_0",
  1900. "intc_irq30_1",
  1901. "intc_irq31_0",
  1902. "intc_irq31_1",
  1903. };
  1904. static const char * const keysc_groups[] = {
  1905. "keysc_in04_0",
  1906. "keysc_in04_1",
  1907. "keysc_in5",
  1908. "keysc_in6",
  1909. "keysc_in7",
  1910. "keysc_out4",
  1911. "keysc_out5",
  1912. "keysc_out6",
  1913. "keysc_out8",
  1914. };
  1915. static const char * const lcd_groups[] = {
  1916. "lcd_data8",
  1917. "lcd_data9",
  1918. "lcd_data12",
  1919. "lcd_data16",
  1920. "lcd_data18",
  1921. "lcd_data24",
  1922. "lcd_display",
  1923. "lcd_lclk",
  1924. "lcd_sync",
  1925. "lcd_sys",
  1926. };
  1927. static const char * const mmc0_groups[] = {
  1928. "mmc0_data1_0",
  1929. "mmc0_data4_0",
  1930. "mmc0_data8_0",
  1931. "mmc0_ctrl_0",
  1932. "mmc0_data1_1",
  1933. "mmc0_data4_1",
  1934. "mmc0_data8_1",
  1935. "mmc0_ctrl_1",
  1936. };
  1937. static const char * const scifa0_groups[] = {
  1938. "scifa0_data",
  1939. "scifa0_clk",
  1940. "scifa0_ctrl",
  1941. };
  1942. static const char * const scifa1_groups[] = {
  1943. "scifa1_data",
  1944. "scifa1_clk",
  1945. "scifa1_ctrl",
  1946. };
  1947. static const char * const scifa2_groups[] = {
  1948. "scifa2_data",
  1949. "scifa2_clk",
  1950. "scifa2_ctrl",
  1951. };
  1952. static const char * const scifa3_groups[] = {
  1953. "scifa3_data",
  1954. "scifa3_clk",
  1955. "scifa3_ctrl_0",
  1956. "scifa3_ctrl_1",
  1957. };
  1958. static const char * const scifa4_groups[] = {
  1959. "scifa4_data",
  1960. };
  1961. static const char * const scifa5_groups[] = {
  1962. "scifa5_data",
  1963. };
  1964. static const char * const scifb_groups[] = {
  1965. "scifb_data",
  1966. "scifb_clk",
  1967. "scifb_ctrl",
  1968. };
  1969. static const char * const sdhi0_groups[] = {
  1970. "sdhi0_data1",
  1971. "sdhi0_data4",
  1972. "sdhi0_ctrl",
  1973. "sdhi0_cd",
  1974. "sdhi0_wp",
  1975. };
  1976. static const char * const sdhi1_groups[] = {
  1977. "sdhi1_data1",
  1978. "sdhi1_data4",
  1979. "sdhi1_ctrl",
  1980. };
  1981. static const char * const sdhi2_groups[] = {
  1982. "sdhi2_data1",
  1983. "sdhi2_data4",
  1984. "sdhi2_ctrl",
  1985. };
  1986. static const char * const usb0_groups[] = {
  1987. "usb0_vbus",
  1988. "usb0_otg_id",
  1989. "usb0_otg_ctrl",
  1990. };
  1991. static const char * const usb1_groups[] = {
  1992. "usb1_vbus",
  1993. "usb1_otg_id_0",
  1994. "usb1_otg_id_1",
  1995. "usb1_otg_ctrl_0",
  1996. "usb1_otg_ctrl_1",
  1997. };
  1998. static const struct sh_pfc_function pinmux_functions[] = {
  1999. SH_PFC_FUNCTION(bsc),
  2000. SH_PFC_FUNCTION(ceu),
  2001. SH_PFC_FUNCTION(flctl),
  2002. SH_PFC_FUNCTION(fsia),
  2003. SH_PFC_FUNCTION(fsib),
  2004. SH_PFC_FUNCTION(hdmi),
  2005. SH_PFC_FUNCTION(intc),
  2006. SH_PFC_FUNCTION(keysc),
  2007. SH_PFC_FUNCTION(lcd),
  2008. SH_PFC_FUNCTION(mmc0),
  2009. SH_PFC_FUNCTION(scifa0),
  2010. SH_PFC_FUNCTION(scifa1),
  2011. SH_PFC_FUNCTION(scifa2),
  2012. SH_PFC_FUNCTION(scifa3),
  2013. SH_PFC_FUNCTION(scifa4),
  2014. SH_PFC_FUNCTION(scifa5),
  2015. SH_PFC_FUNCTION(scifb),
  2016. SH_PFC_FUNCTION(sdhi0),
  2017. SH_PFC_FUNCTION(sdhi1),
  2018. SH_PFC_FUNCTION(sdhi2),
  2019. SH_PFC_FUNCTION(usb0),
  2020. SH_PFC_FUNCTION(usb1),
  2021. };
  2022. #undef PORTCR
  2023. #define PORTCR(nr, reg) \
  2024. { \
  2025. PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
  2026. _PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT), \
  2027. PORT##nr##_FN0, PORT##nr##_FN1, \
  2028. PORT##nr##_FN2, PORT##nr##_FN3, \
  2029. PORT##nr##_FN4, PORT##nr##_FN5, \
  2030. PORT##nr##_FN6, PORT##nr##_FN7 } \
  2031. }
  2032. static const struct pinmux_cfg_reg pinmux_config_regs[] = {
  2033. PORTCR(0, 0xE6051000), /* PORT0CR */
  2034. PORTCR(1, 0xE6051001), /* PORT1CR */
  2035. PORTCR(2, 0xE6051002), /* PORT2CR */
  2036. PORTCR(3, 0xE6051003), /* PORT3CR */
  2037. PORTCR(4, 0xE6051004), /* PORT4CR */
  2038. PORTCR(5, 0xE6051005), /* PORT5CR */
  2039. PORTCR(6, 0xE6051006), /* PORT6CR */
  2040. PORTCR(7, 0xE6051007), /* PORT7CR */
  2041. PORTCR(8, 0xE6051008), /* PORT8CR */
  2042. PORTCR(9, 0xE6051009), /* PORT9CR */
  2043. PORTCR(10, 0xE605100A), /* PORT10CR */
  2044. PORTCR(11, 0xE605100B), /* PORT11CR */
  2045. PORTCR(12, 0xE605100C), /* PORT12CR */
  2046. PORTCR(13, 0xE605100D), /* PORT13CR */
  2047. PORTCR(14, 0xE605100E), /* PORT14CR */
  2048. PORTCR(15, 0xE605100F), /* PORT15CR */
  2049. PORTCR(16, 0xE6051010), /* PORT16CR */
  2050. PORTCR(17, 0xE6051011), /* PORT17CR */
  2051. PORTCR(18, 0xE6051012), /* PORT18CR */
  2052. PORTCR(19, 0xE6051013), /* PORT19CR */
  2053. PORTCR(20, 0xE6051014), /* PORT20CR */
  2054. PORTCR(21, 0xE6051015), /* PORT21CR */
  2055. PORTCR(22, 0xE6051016), /* PORT22CR */
  2056. PORTCR(23, 0xE6051017), /* PORT23CR */
  2057. PORTCR(24, 0xE6051018), /* PORT24CR */
  2058. PORTCR(25, 0xE6051019), /* PORT25CR */
  2059. PORTCR(26, 0xE605101A), /* PORT26CR */
  2060. PORTCR(27, 0xE605101B), /* PORT27CR */
  2061. PORTCR(28, 0xE605101C), /* PORT28CR */
  2062. PORTCR(29, 0xE605101D), /* PORT29CR */
  2063. PORTCR(30, 0xE605101E), /* PORT30CR */
  2064. PORTCR(31, 0xE605101F), /* PORT31CR */
  2065. PORTCR(32, 0xE6051020), /* PORT32CR */
  2066. PORTCR(33, 0xE6051021), /* PORT33CR */
  2067. PORTCR(34, 0xE6051022), /* PORT34CR */
  2068. PORTCR(35, 0xE6051023), /* PORT35CR */
  2069. PORTCR(36, 0xE6051024), /* PORT36CR */
  2070. PORTCR(37, 0xE6051025), /* PORT37CR */
  2071. PORTCR(38, 0xE6051026), /* PORT38CR */
  2072. PORTCR(39, 0xE6051027), /* PORT39CR */
  2073. PORTCR(40, 0xE6051028), /* PORT40CR */
  2074. PORTCR(41, 0xE6051029), /* PORT41CR */
  2075. PORTCR(42, 0xE605102A), /* PORT42CR */
  2076. PORTCR(43, 0xE605102B), /* PORT43CR */
  2077. PORTCR(44, 0xE605102C), /* PORT44CR */
  2078. PORTCR(45, 0xE605102D), /* PORT45CR */
  2079. PORTCR(46, 0xE605202E), /* PORT46CR */
  2080. PORTCR(47, 0xE605202F), /* PORT47CR */
  2081. PORTCR(48, 0xE6052030), /* PORT48CR */
  2082. PORTCR(49, 0xE6052031), /* PORT49CR */
  2083. PORTCR(50, 0xE6052032), /* PORT50CR */
  2084. PORTCR(51, 0xE6052033), /* PORT51CR */
  2085. PORTCR(52, 0xE6052034), /* PORT52CR */
  2086. PORTCR(53, 0xE6052035), /* PORT53CR */
  2087. PORTCR(54, 0xE6052036), /* PORT54CR */
  2088. PORTCR(55, 0xE6052037), /* PORT55CR */
  2089. PORTCR(56, 0xE6052038), /* PORT56CR */
  2090. PORTCR(57, 0xE6052039), /* PORT57CR */
  2091. PORTCR(58, 0xE605203A), /* PORT58CR */
  2092. PORTCR(59, 0xE605203B), /* PORT59CR */
  2093. PORTCR(60, 0xE605203C), /* PORT60CR */
  2094. PORTCR(61, 0xE605203D), /* PORT61CR */
  2095. PORTCR(62, 0xE605203E), /* PORT62CR */
  2096. PORTCR(63, 0xE605203F), /* PORT63CR */
  2097. PORTCR(64, 0xE6052040), /* PORT64CR */
  2098. PORTCR(65, 0xE6052041), /* PORT65CR */
  2099. PORTCR(66, 0xE6052042), /* PORT66CR */
  2100. PORTCR(67, 0xE6052043), /* PORT67CR */
  2101. PORTCR(68, 0xE6052044), /* PORT68CR */
  2102. PORTCR(69, 0xE6052045), /* PORT69CR */
  2103. PORTCR(70, 0xE6052046), /* PORT70CR */
  2104. PORTCR(71, 0xE6052047), /* PORT71CR */
  2105. PORTCR(72, 0xE6052048), /* PORT72CR */
  2106. PORTCR(73, 0xE6052049), /* PORT73CR */
  2107. PORTCR(74, 0xE605204A), /* PORT74CR */
  2108. PORTCR(75, 0xE605204B), /* PORT75CR */
  2109. PORTCR(76, 0xE605004C), /* PORT76CR */
  2110. PORTCR(77, 0xE605004D), /* PORT77CR */
  2111. PORTCR(78, 0xE605004E), /* PORT78CR */
  2112. PORTCR(79, 0xE605004F), /* PORT79CR */
  2113. PORTCR(80, 0xE6050050), /* PORT80CR */
  2114. PORTCR(81, 0xE6050051), /* PORT81CR */
  2115. PORTCR(82, 0xE6050052), /* PORT82CR */
  2116. PORTCR(83, 0xE6050053), /* PORT83CR */
  2117. PORTCR(84, 0xE6050054), /* PORT84CR */
  2118. PORTCR(85, 0xE6050055), /* PORT85CR */
  2119. PORTCR(86, 0xE6050056), /* PORT86CR */
  2120. PORTCR(87, 0xE6050057), /* PORT87CR */
  2121. PORTCR(88, 0xE6050058), /* PORT88CR */
  2122. PORTCR(89, 0xE6050059), /* PORT89CR */
  2123. PORTCR(90, 0xE605005A), /* PORT90CR */
  2124. PORTCR(91, 0xE605005B), /* PORT91CR */
  2125. PORTCR(92, 0xE605005C), /* PORT92CR */
  2126. PORTCR(93, 0xE605005D), /* PORT93CR */
  2127. PORTCR(94, 0xE605005E), /* PORT94CR */
  2128. PORTCR(95, 0xE605005F), /* PORT95CR */
  2129. PORTCR(96, 0xE6050060), /* PORT96CR */
  2130. PORTCR(97, 0xE6050061), /* PORT97CR */
  2131. PORTCR(98, 0xE6050062), /* PORT98CR */
  2132. PORTCR(99, 0xE6050063), /* PORT99CR */
  2133. PORTCR(100, 0xE6053064), /* PORT100CR */
  2134. PORTCR(101, 0xE6053065), /* PORT101CR */
  2135. PORTCR(102, 0xE6053066), /* PORT102CR */
  2136. PORTCR(103, 0xE6053067), /* PORT103CR */
  2137. PORTCR(104, 0xE6053068), /* PORT104CR */
  2138. PORTCR(105, 0xE6053069), /* PORT105CR */
  2139. PORTCR(106, 0xE605306A), /* PORT106CR */
  2140. PORTCR(107, 0xE605306B), /* PORT107CR */
  2141. PORTCR(108, 0xE605306C), /* PORT108CR */
  2142. PORTCR(109, 0xE605306D), /* PORT109CR */
  2143. PORTCR(110, 0xE605306E), /* PORT110CR */
  2144. PORTCR(111, 0xE605306F), /* PORT111CR */
  2145. PORTCR(112, 0xE6053070), /* PORT112CR */
  2146. PORTCR(113, 0xE6053071), /* PORT113CR */
  2147. PORTCR(114, 0xE6053072), /* PORT114CR */
  2148. PORTCR(115, 0xE6053073), /* PORT115CR */
  2149. PORTCR(116, 0xE6053074), /* PORT116CR */
  2150. PORTCR(117, 0xE6053075), /* PORT117CR */
  2151. PORTCR(118, 0xE6053076), /* PORT118CR */
  2152. PORTCR(119, 0xE6053077), /* PORT119CR */
  2153. PORTCR(120, 0xE6053078), /* PORT120CR */
  2154. PORTCR(121, 0xE6050079), /* PORT121CR */
  2155. PORTCR(122, 0xE605007A), /* PORT122CR */
  2156. PORTCR(123, 0xE605007B), /* PORT123CR */
  2157. PORTCR(124, 0xE605007C), /* PORT124CR */
  2158. PORTCR(125, 0xE605007D), /* PORT125CR */
  2159. PORTCR(126, 0xE605007E), /* PORT126CR */
  2160. PORTCR(127, 0xE605007F), /* PORT127CR */
  2161. PORTCR(128, 0xE6050080), /* PORT128CR */
  2162. PORTCR(129, 0xE6050081), /* PORT129CR */
  2163. PORTCR(130, 0xE6050082), /* PORT130CR */
  2164. PORTCR(131, 0xE6050083), /* PORT131CR */
  2165. PORTCR(132, 0xE6050084), /* PORT132CR */
  2166. PORTCR(133, 0xE6050085), /* PORT133CR */
  2167. PORTCR(134, 0xE6050086), /* PORT134CR */
  2168. PORTCR(135, 0xE6050087), /* PORT135CR */
  2169. PORTCR(136, 0xE6050088), /* PORT136CR */
  2170. PORTCR(137, 0xE6050089), /* PORT137CR */
  2171. PORTCR(138, 0xE605008A), /* PORT138CR */
  2172. PORTCR(139, 0xE605008B), /* PORT139CR */
  2173. PORTCR(140, 0xE605008C), /* PORT140CR */
  2174. PORTCR(141, 0xE605008D), /* PORT141CR */
  2175. PORTCR(142, 0xE605008E), /* PORT142CR */
  2176. PORTCR(143, 0xE605008F), /* PORT143CR */
  2177. PORTCR(144, 0xE6050090), /* PORT144CR */
  2178. PORTCR(145, 0xE6050091), /* PORT145CR */
  2179. PORTCR(146, 0xE6050092), /* PORT146CR */
  2180. PORTCR(147, 0xE6050093), /* PORT147CR */
  2181. PORTCR(148, 0xE6050094), /* PORT148CR */
  2182. PORTCR(149, 0xE6050095), /* PORT149CR */
  2183. PORTCR(150, 0xE6050096), /* PORT150CR */
  2184. PORTCR(151, 0xE6050097), /* PORT151CR */
  2185. PORTCR(152, 0xE6053098), /* PORT152CR */
  2186. PORTCR(153, 0xE6053099), /* PORT153CR */
  2187. PORTCR(154, 0xE605309A), /* PORT154CR */
  2188. PORTCR(155, 0xE605309B), /* PORT155CR */
  2189. PORTCR(156, 0xE605009C), /* PORT156CR */
  2190. PORTCR(157, 0xE605009D), /* PORT157CR */
  2191. PORTCR(158, 0xE605009E), /* PORT158CR */
  2192. PORTCR(159, 0xE605009F), /* PORT159CR */
  2193. PORTCR(160, 0xE60500A0), /* PORT160CR */
  2194. PORTCR(161, 0xE60500A1), /* PORT161CR */
  2195. PORTCR(162, 0xE60500A2), /* PORT162CR */
  2196. PORTCR(163, 0xE60500A3), /* PORT163CR */
  2197. PORTCR(164, 0xE60500A4), /* PORT164CR */
  2198. PORTCR(165, 0xE60500A5), /* PORT165CR */
  2199. PORTCR(166, 0xE60500A6), /* PORT166CR */
  2200. PORTCR(167, 0xE60520A7), /* PORT167CR */
  2201. PORTCR(168, 0xE60520A8), /* PORT168CR */
  2202. PORTCR(169, 0xE60520A9), /* PORT169CR */
  2203. PORTCR(170, 0xE60520AA), /* PORT170CR */
  2204. PORTCR(171, 0xE60520AB), /* PORT171CR */
  2205. PORTCR(172, 0xE60520AC), /* PORT172CR */
  2206. PORTCR(173, 0xE60520AD), /* PORT173CR */
  2207. PORTCR(174, 0xE60520AE), /* PORT174CR */
  2208. PORTCR(175, 0xE60520AF), /* PORT175CR */
  2209. PORTCR(176, 0xE60520B0), /* PORT176CR */
  2210. PORTCR(177, 0xE60520B1), /* PORT177CR */
  2211. PORTCR(178, 0xE60520B2), /* PORT178CR */
  2212. PORTCR(179, 0xE60520B3), /* PORT179CR */
  2213. PORTCR(180, 0xE60520B4), /* PORT180CR */
  2214. PORTCR(181, 0xE60520B5), /* PORT181CR */
  2215. PORTCR(182, 0xE60520B6), /* PORT182CR */
  2216. PORTCR(183, 0xE60520B7), /* PORT183CR */
  2217. PORTCR(184, 0xE60520B8), /* PORT184CR */
  2218. PORTCR(185, 0xE60520B9), /* PORT185CR */
  2219. PORTCR(186, 0xE60520BA), /* PORT186CR */
  2220. PORTCR(187, 0xE60520BB), /* PORT187CR */
  2221. PORTCR(188, 0xE60520BC), /* PORT188CR */
  2222. PORTCR(189, 0xE60520BD), /* PORT189CR */
  2223. PORTCR(190, 0xE60520BE), /* PORT190CR */
  2224. { PINMUX_CFG_REG("MSEL1CR", 0xE605800C, 32, 1) {
  2225. MSEL1CR_31_0, MSEL1CR_31_1,
  2226. MSEL1CR_30_0, MSEL1CR_30_1,
  2227. MSEL1CR_29_0, MSEL1CR_29_1,
  2228. MSEL1CR_28_0, MSEL1CR_28_1,
  2229. MSEL1CR_27_0, MSEL1CR_27_1,
  2230. MSEL1CR_26_0, MSEL1CR_26_1,
  2231. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  2232. 0, 0, 0, 0, 0, 0, 0, 0,
  2233. MSEL1CR_16_0, MSEL1CR_16_1,
  2234. MSEL1CR_15_0, MSEL1CR_15_1,
  2235. MSEL1CR_14_0, MSEL1CR_14_1,
  2236. MSEL1CR_13_0, MSEL1CR_13_1,
  2237. MSEL1CR_12_0, MSEL1CR_12_1,
  2238. 0, 0, 0, 0,
  2239. MSEL1CR_9_0, MSEL1CR_9_1,
  2240. MSEL1CR_8_0, MSEL1CR_8_1,
  2241. MSEL1CR_7_0, MSEL1CR_7_1,
  2242. MSEL1CR_6_0, MSEL1CR_6_1,
  2243. 0, 0,
  2244. MSEL1CR_4_0, MSEL1CR_4_1,
  2245. MSEL1CR_3_0, MSEL1CR_3_1,
  2246. MSEL1CR_2_0, MSEL1CR_2_1,
  2247. 0, 0,
  2248. MSEL1CR_0_0, MSEL1CR_0_1,
  2249. }
  2250. },
  2251. { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
  2252. 0, 0, 0, 0,
  2253. 0, 0, 0, 0,
  2254. MSEL3CR_27_0, MSEL3CR_27_1,
  2255. MSEL3CR_26_0, MSEL3CR_26_1,
  2256. 0, 0, 0, 0,
  2257. 0, 0, 0, 0,
  2258. MSEL3CR_21_0, MSEL3CR_21_1,
  2259. MSEL3CR_20_0, MSEL3CR_20_1,
  2260. 0, 0, 0, 0,
  2261. 0, 0, 0, 0,
  2262. MSEL3CR_15_0, MSEL3CR_15_1,
  2263. 0, 0, 0, 0,
  2264. 0, 0, 0, 0,
  2265. 0, 0,
  2266. MSEL3CR_9_0, MSEL3CR_9_1,
  2267. 0, 0, 0, 0,
  2268. MSEL3CR_6_0, MSEL3CR_6_1,
  2269. 0, 0, 0, 0,
  2270. 0, 0, 0, 0,
  2271. 0, 0, 0, 0,
  2272. }
  2273. },
  2274. { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
  2275. 0, 0, 0, 0,
  2276. 0, 0, 0, 0,
  2277. 0, 0, 0, 0,
  2278. 0, 0, 0, 0,
  2279. 0, 0, 0, 0,
  2280. 0, 0, 0, 0,
  2281. MSEL4CR_19_0, MSEL4CR_19_1,
  2282. MSEL4CR_18_0, MSEL4CR_18_1,
  2283. MSEL4CR_17_0, MSEL4CR_17_1,
  2284. MSEL4CR_16_0, MSEL4CR_16_1,
  2285. MSEL4CR_15_0, MSEL4CR_15_1,
  2286. MSEL4CR_14_0, MSEL4CR_14_1,
  2287. 0, 0, 0, 0,
  2288. 0, 0,
  2289. MSEL4CR_10_0, MSEL4CR_10_1,
  2290. 0, 0, 0, 0,
  2291. 0, 0,
  2292. MSEL4CR_6_0, MSEL4CR_6_1,
  2293. 0, 0,
  2294. MSEL4CR_4_0, MSEL4CR_4_1,
  2295. 0, 0, 0, 0,
  2296. MSEL4CR_1_0, MSEL4CR_1_1,
  2297. 0, 0,
  2298. }
  2299. },
  2300. { },
  2301. };
  2302. static const struct pinmux_data_reg pinmux_data_regs[] = {
  2303. { PINMUX_DATA_REG("PORTL095_064DR", 0xE6054008, 32) {
  2304. PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
  2305. PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
  2306. PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
  2307. PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
  2308. PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
  2309. 0, 0, 0, 0,
  2310. 0, 0, 0, 0,
  2311. 0, 0, 0, 0,
  2312. }
  2313. },
  2314. { PINMUX_DATA_REG("PORTL127_096DR", 0xE605400C, 32) {
  2315. PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
  2316. PORT123_DATA, PORT122_DATA, PORT121_DATA, 0,
  2317. 0, 0, 0, 0,
  2318. 0, 0, 0, 0,
  2319. 0, 0, 0, 0,
  2320. 0, 0, 0, 0,
  2321. 0, 0, 0, 0,
  2322. PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA,
  2323. }
  2324. },
  2325. { PINMUX_DATA_REG("PORTL159_128DR", 0xE6054010, 32) {
  2326. PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
  2327. 0, 0, 0, 0,
  2328. PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
  2329. PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
  2330. PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
  2331. PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
  2332. PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
  2333. PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA,
  2334. }
  2335. },
  2336. { PINMUX_DATA_REG("PORTL191_160DR", 0xE6054014, 32) {
  2337. 0, 0, 0, 0,
  2338. 0, 0, 0, 0,
  2339. 0, 0, 0, 0,
  2340. 0, 0, 0, 0,
  2341. 0, 0, 0, 0,
  2342. 0, 0, 0, 0,
  2343. 0, PORT166_DATA, PORT165_DATA, PORT164_DATA,
  2344. PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA,
  2345. }
  2346. },
  2347. { PINMUX_DATA_REG("PORTD031_000DR", 0xE6055000, 32) {
  2348. PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
  2349. PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
  2350. PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
  2351. PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
  2352. PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
  2353. PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
  2354. PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
  2355. PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA,
  2356. }
  2357. },
  2358. { PINMUX_DATA_REG("PORTD063_032DR", 0xE6055004, 32) {
  2359. 0, 0, 0, 0, 0, 0, 0, 0,
  2360. 0, 0, 0, 0, 0, 0, 0, 0,
  2361. 0, 0, PORT45_DATA, PORT44_DATA,
  2362. PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
  2363. PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
  2364. PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA,
  2365. }
  2366. },
  2367. { PINMUX_DATA_REG("PORTR063_032DR", 0xE6056004, 32) {
  2368. PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
  2369. PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
  2370. PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
  2371. PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
  2372. PORT47_DATA, PORT46_DATA, 0, 0,
  2373. 0, 0, 0, 0,
  2374. 0, 0, 0, 0,
  2375. 0, 0, 0, 0,
  2376. }
  2377. },
  2378. { PINMUX_DATA_REG("PORTR095_064DR", 0xE6056008, 32) {
  2379. 0, 0, 0, 0,
  2380. 0, 0, 0, 0,
  2381. 0, 0, 0, 0,
  2382. 0, 0, 0, 0,
  2383. 0, 0, 0, 0,
  2384. PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
  2385. PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
  2386. PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA,
  2387. }
  2388. },
  2389. { PINMUX_DATA_REG("PORTR191_160DR", 0xE6056014, 32) {
  2390. 0, PORT190_DATA, PORT189_DATA, PORT188_DATA,
  2391. PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
  2392. PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
  2393. PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
  2394. PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
  2395. PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
  2396. PORT167_DATA, 0, 0, 0,
  2397. 0, 0, 0, 0,
  2398. }
  2399. },
  2400. { PINMUX_DATA_REG("PORTU127_096DR", 0xE605700C, 32) {
  2401. 0, 0, 0, 0,
  2402. 0, 0, 0, PORT120_DATA,
  2403. PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
  2404. PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
  2405. PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
  2406. PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
  2407. PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
  2408. 0, 0, 0, 0,
  2409. }
  2410. },
  2411. { PINMUX_DATA_REG("PORTU159_128DR", 0xE6057010, 32) {
  2412. 0, 0, 0, 0,
  2413. PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
  2414. 0, 0, 0, 0,
  2415. 0, 0, 0, 0,
  2416. 0, 0, 0, 0,
  2417. 0, 0, 0, 0,
  2418. 0, 0, 0, 0,
  2419. 0, 0, 0, 0,
  2420. }
  2421. },
  2422. { },
  2423. };
  2424. #define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
  2425. #define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
  2426. static const struct pinmux_irq pinmux_irqs[] = {
  2427. PINMUX_IRQ(EXT_IRQ16L(0), 6, 162),
  2428. PINMUX_IRQ(EXT_IRQ16L(1), 12),
  2429. PINMUX_IRQ(EXT_IRQ16L(2), 4, 5),
  2430. PINMUX_IRQ(EXT_IRQ16L(3), 8, 16),
  2431. PINMUX_IRQ(EXT_IRQ16L(4), 17, 163),
  2432. PINMUX_IRQ(EXT_IRQ16L(5), 18),
  2433. PINMUX_IRQ(EXT_IRQ16L(6), 39, 164),
  2434. PINMUX_IRQ(EXT_IRQ16L(7), 40, 167),
  2435. PINMUX_IRQ(EXT_IRQ16L(8), 41, 168),
  2436. PINMUX_IRQ(EXT_IRQ16L(9), 42, 169),
  2437. PINMUX_IRQ(EXT_IRQ16L(10), 65),
  2438. PINMUX_IRQ(EXT_IRQ16L(11), 67),
  2439. PINMUX_IRQ(EXT_IRQ16L(12), 80, 137),
  2440. PINMUX_IRQ(EXT_IRQ16L(13), 81, 145),
  2441. PINMUX_IRQ(EXT_IRQ16L(14), 82, 146),
  2442. PINMUX_IRQ(EXT_IRQ16L(15), 83, 147),
  2443. PINMUX_IRQ(EXT_IRQ16H(16), 84, 170),
  2444. PINMUX_IRQ(EXT_IRQ16H(17), 85),
  2445. PINMUX_IRQ(EXT_IRQ16H(18), 86),
  2446. PINMUX_IRQ(EXT_IRQ16H(19), 87),
  2447. PINMUX_IRQ(EXT_IRQ16H(20), 92),
  2448. PINMUX_IRQ(EXT_IRQ16H(21), 93),
  2449. PINMUX_IRQ(EXT_IRQ16H(22), 94),
  2450. PINMUX_IRQ(EXT_IRQ16H(23), 95),
  2451. PINMUX_IRQ(EXT_IRQ16H(24), 112),
  2452. PINMUX_IRQ(EXT_IRQ16H(25), 119),
  2453. PINMUX_IRQ(EXT_IRQ16H(26), 121, 172),
  2454. PINMUX_IRQ(EXT_IRQ16H(27), 122, 180),
  2455. PINMUX_IRQ(EXT_IRQ16H(28), 123, 181),
  2456. PINMUX_IRQ(EXT_IRQ16H(29), 129, 182),
  2457. PINMUX_IRQ(EXT_IRQ16H(30), 130, 183),
  2458. PINMUX_IRQ(EXT_IRQ16H(31), 138, 184),
  2459. };
  2460. #define PORTnCR_PULMD_OFF (0 << 6)
  2461. #define PORTnCR_PULMD_DOWN (2 << 6)
  2462. #define PORTnCR_PULMD_UP (3 << 6)
  2463. #define PORTnCR_PULMD_MASK (3 << 6)
  2464. struct sh7372_portcr_group {
  2465. unsigned int end_pin;
  2466. unsigned int offset;
  2467. };
  2468. static const struct sh7372_portcr_group sh7372_portcr_offsets[] = {
  2469. { 45, 0x1000 }, { 75, 0x2000 }, { 99, 0x0000 }, { 120, 0x3000 },
  2470. { 151, 0x0000 }, { 155, 0x3000 }, { 166, 0x0000 }, { 190, 0x2000 },
  2471. };
  2472. static void __iomem *sh7372_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin)
  2473. {
  2474. unsigned int i;
  2475. for (i = 0; i < ARRAY_SIZE(sh7372_portcr_offsets); ++i) {
  2476. const struct sh7372_portcr_group *group =
  2477. &sh7372_portcr_offsets[i];
  2478. if (i <= group->end_pin)
  2479. return pfc->window->virt + group->offset + pin;
  2480. }
  2481. return NULL;
  2482. }
  2483. static unsigned int sh7372_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin)
  2484. {
  2485. void __iomem *addr = sh7372_pinmux_portcr(pfc, pin);
  2486. u32 value = ioread8(addr) & PORTnCR_PULMD_MASK;
  2487. switch (value) {
  2488. case PORTnCR_PULMD_UP:
  2489. return PIN_CONFIG_BIAS_PULL_UP;
  2490. case PORTnCR_PULMD_DOWN:
  2491. return PIN_CONFIG_BIAS_PULL_DOWN;
  2492. case PORTnCR_PULMD_OFF:
  2493. default:
  2494. return PIN_CONFIG_BIAS_DISABLE;
  2495. }
  2496. }
  2497. static void sh7372_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
  2498. unsigned int bias)
  2499. {
  2500. void __iomem *addr = sh7372_pinmux_portcr(pfc, pin);
  2501. u32 value = ioread8(addr) & ~PORTnCR_PULMD_MASK;
  2502. switch (bias) {
  2503. case PIN_CONFIG_BIAS_PULL_UP:
  2504. value |= PORTnCR_PULMD_UP;
  2505. break;
  2506. case PIN_CONFIG_BIAS_PULL_DOWN:
  2507. value |= PORTnCR_PULMD_DOWN;
  2508. break;
  2509. }
  2510. iowrite8(value, addr);
  2511. }
  2512. static const struct sh_pfc_soc_operations sh7372_pinmux_ops = {
  2513. .get_bias = sh7372_pinmux_get_bias,
  2514. .set_bias = sh7372_pinmux_set_bias,
  2515. };
  2516. const struct sh_pfc_soc_info sh7372_pinmux_info = {
  2517. .name = "sh7372_pfc",
  2518. .ops = &sh7372_pinmux_ops,
  2519. .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
  2520. .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
  2521. .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
  2522. .pins = pinmux_pins,
  2523. .nr_pins = ARRAY_SIZE(pinmux_pins),
  2524. .groups = pinmux_groups,
  2525. .nr_groups = ARRAY_SIZE(pinmux_groups),
  2526. .functions = pinmux_functions,
  2527. .nr_functions = ARRAY_SIZE(pinmux_functions),
  2528. .cfg_regs = pinmux_config_regs,
  2529. .data_regs = pinmux_data_regs,
  2530. .gpio_data = pinmux_data,
  2531. .gpio_data_size = ARRAY_SIZE(pinmux_data),
  2532. .gpio_irq = pinmux_irqs,
  2533. .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
  2534. };