aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorRong Wang <Rong.Wang@csr.com>2013-09-29 10:27:59 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-10-08 04:19:26 -0400
commit6a08a92ec45782e5543addf5f8785e2560a078f6 (patch)
treee5844fb3b5f3913e0a1f1c17790eebcf987a5540 /drivers/pinctrl
parentaf614b2301f0e30423240a754ec2812a4c793201 (diff)
pinctrl: sirf: add USB1/UART1 pinmux usb/uart share
dn and dp of USB1 can share with UART1(UART1 can route rx,tx to dn and dp pins of USB1). here we add this pinmux capability. USB1/UART1 mode selection has dedicated control register in RSC module, here we attach the register offset of private data of related pin groups. Signed-off-by: Rong Wang <Rong.Wang@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/sirf/pinctrl-atlas6.c56
-rw-r--r--drivers/pinctrl/sirf/pinctrl-prima2.c52
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.c8
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.h6
4 files changed, 116 insertions, 6 deletions
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas6.c b/drivers/pinctrl/sirf/pinctrl-atlas6.c
index edf45a6940ca..8ab7898d21be 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas6.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas6.c
@@ -122,6 +122,9 @@ static const struct pinctrl_pin_desc sirfsoc_pads[] = {
122 PINCTRL_PIN(100, "ac97_dout"), 122 PINCTRL_PIN(100, "ac97_dout"),
123 PINCTRL_PIN(101, "ac97_din"), 123 PINCTRL_PIN(101, "ac97_din"),
124 PINCTRL_PIN(102, "x_rtc_io"), 124 PINCTRL_PIN(102, "x_rtc_io"),
125
126 PINCTRL_PIN(103, "x_usb1_dp"),
127 PINCTRL_PIN(104, "x_usb1_dn"),
125}; 128};
126 129
127static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = { 130static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
@@ -139,6 +142,7 @@ static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
139static const struct sirfsoc_padmux lcd_16bits_padmux = { 142static const struct sirfsoc_padmux lcd_16bits_padmux = {
140 .muxmask_counts = ARRAY_SIZE(lcd_16bits_sirfsoc_muxmask), 143 .muxmask_counts = ARRAY_SIZE(lcd_16bits_sirfsoc_muxmask),
141 .muxmask = lcd_16bits_sirfsoc_muxmask, 144 .muxmask = lcd_16bits_sirfsoc_muxmask,
145 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
142 .funcmask = BIT(4), 146 .funcmask = BIT(4),
143 .funcval = 0, 147 .funcval = 0,
144}; 148};
@@ -164,6 +168,7 @@ static const struct sirfsoc_muxmask lcd_18bits_muxmask[] = {
164static const struct sirfsoc_padmux lcd_18bits_padmux = { 168static const struct sirfsoc_padmux lcd_18bits_padmux = {
165 .muxmask_counts = ARRAY_SIZE(lcd_18bits_muxmask), 169 .muxmask_counts = ARRAY_SIZE(lcd_18bits_muxmask),
166 .muxmask = lcd_18bits_muxmask, 170 .muxmask = lcd_18bits_muxmask,
171 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
167 .funcmask = BIT(4) | BIT(15), 172 .funcmask = BIT(4) | BIT(15),
168 .funcval = 0, 173 .funcval = 0,
169}; 174};
@@ -189,6 +194,7 @@ static const struct sirfsoc_muxmask lcd_24bits_muxmask[] = {
189static const struct sirfsoc_padmux lcd_24bits_padmux = { 194static const struct sirfsoc_padmux lcd_24bits_padmux = {
190 .muxmask_counts = ARRAY_SIZE(lcd_24bits_muxmask), 195 .muxmask_counts = ARRAY_SIZE(lcd_24bits_muxmask),
191 .muxmask = lcd_24bits_muxmask, 196 .muxmask = lcd_24bits_muxmask,
197 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
192 .funcmask = BIT(4) | BIT(15), 198 .funcmask = BIT(4) | BIT(15),
193 .funcval = 0, 199 .funcval = 0,
194}; 200};
@@ -214,6 +220,7 @@ static const struct sirfsoc_muxmask lcdrom_muxmask[] = {
214static const struct sirfsoc_padmux lcdrom_padmux = { 220static const struct sirfsoc_padmux lcdrom_padmux = {
215 .muxmask_counts = ARRAY_SIZE(lcdrom_muxmask), 221 .muxmask_counts = ARRAY_SIZE(lcdrom_muxmask),
216 .muxmask = lcdrom_muxmask, 222 .muxmask = lcdrom_muxmask,
223 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
217 .funcmask = BIT(4), 224 .funcmask = BIT(4),
218 .funcval = BIT(4), 225 .funcval = BIT(4),
219}; 226};
@@ -237,6 +244,7 @@ static const struct sirfsoc_muxmask uart0_muxmask[] = {
237static const struct sirfsoc_padmux uart0_padmux = { 244static const struct sirfsoc_padmux uart0_padmux = {
238 .muxmask_counts = ARRAY_SIZE(uart0_muxmask), 245 .muxmask_counts = ARRAY_SIZE(uart0_muxmask),
239 .muxmask = uart0_muxmask, 246 .muxmask = uart0_muxmask,
247 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
240 .funcmask = BIT(9), 248 .funcmask = BIT(9),
241 .funcval = BIT(9), 249 .funcval = BIT(9),
242}; 250};
@@ -284,6 +292,7 @@ static const struct sirfsoc_muxmask uart2_muxmask[] = {
284static const struct sirfsoc_padmux uart2_padmux = { 292static const struct sirfsoc_padmux uart2_padmux = {
285 .muxmask_counts = ARRAY_SIZE(uart2_muxmask), 293 .muxmask_counts = ARRAY_SIZE(uart2_muxmask),
286 .muxmask = uart2_muxmask, 294 .muxmask = uart2_muxmask,
295 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
287 .funcmask = BIT(10), 296 .funcmask = BIT(10),
288 .funcval = BIT(10), 297 .funcval = BIT(10),
289}; 298};
@@ -317,6 +326,7 @@ static const struct sirfsoc_muxmask sdmmc3_muxmask[] = {
317static const struct sirfsoc_padmux sdmmc3_padmux = { 326static const struct sirfsoc_padmux sdmmc3_padmux = {
318 .muxmask_counts = ARRAY_SIZE(sdmmc3_muxmask), 327 .muxmask_counts = ARRAY_SIZE(sdmmc3_muxmask),
319 .muxmask = sdmmc3_muxmask, 328 .muxmask = sdmmc3_muxmask,
329 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
320 .funcmask = BIT(7), 330 .funcmask = BIT(7),
321 .funcval = 0, 331 .funcval = 0,
322}; 332};
@@ -336,6 +346,7 @@ static const struct sirfsoc_muxmask spi0_muxmask[] = {
336static const struct sirfsoc_padmux spi0_padmux = { 346static const struct sirfsoc_padmux spi0_padmux = {
337 .muxmask_counts = ARRAY_SIZE(spi0_muxmask), 347 .muxmask_counts = ARRAY_SIZE(spi0_muxmask),
338 .muxmask = spi0_muxmask, 348 .muxmask = spi0_muxmask,
349 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
339 .funcmask = BIT(7), 350 .funcmask = BIT(7),
340 .funcval = BIT(7), 351 .funcval = BIT(7),
341}; 352};
@@ -352,6 +363,7 @@ static const struct sirfsoc_muxmask cko1_muxmask[] = {
352static const struct sirfsoc_padmux cko1_padmux = { 363static const struct sirfsoc_padmux cko1_padmux = {
353 .muxmask_counts = ARRAY_SIZE(cko1_muxmask), 364 .muxmask_counts = ARRAY_SIZE(cko1_muxmask),
354 .muxmask = cko1_muxmask, 365 .muxmask = cko1_muxmask,
366 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
355 .funcmask = BIT(3), 367 .funcmask = BIT(3),
356 .funcval = 0, 368 .funcval = 0,
357}; 369};
@@ -371,6 +383,7 @@ static const struct sirfsoc_muxmask i2s_muxmask[] = {
371static const struct sirfsoc_padmux i2s_padmux = { 383static const struct sirfsoc_padmux i2s_padmux = {
372 .muxmask_counts = ARRAY_SIZE(i2s_muxmask), 384 .muxmask_counts = ARRAY_SIZE(i2s_muxmask),
373 .muxmask = i2s_muxmask, 385 .muxmask = i2s_muxmask,
386 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
374 .funcmask = BIT(3), 387 .funcmask = BIT(3),
375 .funcval = BIT(3), 388 .funcval = BIT(3),
376}; 389};
@@ -390,6 +403,7 @@ static const struct sirfsoc_muxmask i2s_no_din_muxmask[] = {
390static const struct sirfsoc_padmux i2s_no_din_padmux = { 403static const struct sirfsoc_padmux i2s_no_din_padmux = {
391 .muxmask_counts = ARRAY_SIZE(i2s_no_din_muxmask), 404 .muxmask_counts = ARRAY_SIZE(i2s_no_din_muxmask),
392 .muxmask = i2s_no_din_muxmask, 405 .muxmask = i2s_no_din_muxmask,
406 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
393 .funcmask = BIT(3), 407 .funcmask = BIT(3),
394 .funcval = BIT(3), 408 .funcval = BIT(3),
395}; 409};
@@ -409,6 +423,7 @@ static const struct sirfsoc_muxmask i2s_6chn_muxmask[] = {
409static const struct sirfsoc_padmux i2s_6chn_padmux = { 423static const struct sirfsoc_padmux i2s_6chn_padmux = {
410 .muxmask_counts = ARRAY_SIZE(i2s_6chn_muxmask), 424 .muxmask_counts = ARRAY_SIZE(i2s_6chn_muxmask),
411 .muxmask = i2s_6chn_muxmask, 425 .muxmask = i2s_6chn_muxmask,
426 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
412 .funcmask = BIT(1) | BIT(3) | BIT(9), 427 .funcmask = BIT(1) | BIT(3) | BIT(9),
413 .funcval = BIT(1) | BIT(3) | BIT(9), 428 .funcval = BIT(1) | BIT(3) | BIT(9),
414}; 429};
@@ -439,6 +454,7 @@ static const struct sirfsoc_muxmask spi1_muxmask[] = {
439static const struct sirfsoc_padmux spi1_padmux = { 454static const struct sirfsoc_padmux spi1_padmux = {
440 .muxmask_counts = ARRAY_SIZE(spi1_muxmask), 455 .muxmask_counts = ARRAY_SIZE(spi1_muxmask),
441 .muxmask = spi1_muxmask, 456 .muxmask = spi1_muxmask,
457 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
442 .funcmask = BIT(16), 458 .funcmask = BIT(16),
443 .funcval = 0, 459 .funcval = 0,
444}; 460};
@@ -455,6 +471,7 @@ static const struct sirfsoc_muxmask sdmmc1_muxmask[] = {
455static const struct sirfsoc_padmux sdmmc1_padmux = { 471static const struct sirfsoc_padmux sdmmc1_padmux = {
456 .muxmask_counts = ARRAY_SIZE(sdmmc1_muxmask), 472 .muxmask_counts = ARRAY_SIZE(sdmmc1_muxmask),
457 .muxmask = sdmmc1_muxmask, 473 .muxmask = sdmmc1_muxmask,
474 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
458 .funcmask = BIT(5), 475 .funcmask = BIT(5),
459 .funcval = BIT(5), 476 .funcval = BIT(5),
460}; 477};
@@ -471,6 +488,7 @@ static const struct sirfsoc_muxmask gps_muxmask[] = {
471static const struct sirfsoc_padmux gps_padmux = { 488static const struct sirfsoc_padmux gps_padmux = {
472 .muxmask_counts = ARRAY_SIZE(gps_muxmask), 489 .muxmask_counts = ARRAY_SIZE(gps_muxmask),
473 .muxmask = gps_muxmask, 490 .muxmask = gps_muxmask,
491 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
474 .funcmask = BIT(13), 492 .funcmask = BIT(13),
475 .funcval = 0, 493 .funcval = 0,
476}; 494};
@@ -487,6 +505,7 @@ static const struct sirfsoc_muxmask sdmmc5_muxmask[] = {
487static const struct sirfsoc_padmux sdmmc5_padmux = { 505static const struct sirfsoc_padmux sdmmc5_padmux = {
488 .muxmask_counts = ARRAY_SIZE(sdmmc5_muxmask), 506 .muxmask_counts = ARRAY_SIZE(sdmmc5_muxmask),
489 .muxmask = sdmmc5_muxmask, 507 .muxmask = sdmmc5_muxmask,
508 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
490 .funcmask = BIT(13), 509 .funcmask = BIT(13),
491 .funcval = BIT(13), 510 .funcval = BIT(13),
492}; 511};
@@ -503,6 +522,7 @@ static const struct sirfsoc_muxmask usp0_muxmask[] = {
503static const struct sirfsoc_padmux usp0_padmux = { 522static const struct sirfsoc_padmux usp0_padmux = {
504 .muxmask_counts = ARRAY_SIZE(usp0_muxmask), 523 .muxmask_counts = ARRAY_SIZE(usp0_muxmask),
505 .muxmask = usp0_muxmask, 524 .muxmask = usp0_muxmask,
525 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
506 .funcmask = BIT(1) | BIT(2) | BIT(9), 526 .funcmask = BIT(1) | BIT(2) | BIT(9),
507 .funcval = 0, 527 .funcval = 0,
508}; 528};
@@ -535,6 +555,7 @@ static const struct sirfsoc_muxmask usp1_muxmask[] = {
535static const struct sirfsoc_padmux usp1_padmux = { 555static const struct sirfsoc_padmux usp1_padmux = {
536 .muxmask_counts = ARRAY_SIZE(usp1_muxmask), 556 .muxmask_counts = ARRAY_SIZE(usp1_muxmask),
537 .muxmask = usp1_muxmask, 557 .muxmask = usp1_muxmask,
558 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
538 .funcmask = BIT(16), 559 .funcmask = BIT(16),
539 .funcval = BIT(16), 560 .funcval = BIT(16),
540}; 561};
@@ -554,6 +575,7 @@ static const struct sirfsoc_muxmask nand_muxmask[] = {
554static const struct sirfsoc_padmux nand_padmux = { 575static const struct sirfsoc_padmux nand_padmux = {
555 .muxmask_counts = ARRAY_SIZE(nand_muxmask), 576 .muxmask_counts = ARRAY_SIZE(nand_muxmask),
556 .muxmask = nand_muxmask, 577 .muxmask = nand_muxmask,
578 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
557 .funcmask = BIT(5) | BIT(19), 579 .funcmask = BIT(5) | BIT(19),
558 .funcval = 0, 580 .funcval = 0,
559}; 581};
@@ -570,6 +592,7 @@ static const struct sirfsoc_muxmask sdmmc0_muxmask[] = {
570static const struct sirfsoc_padmux sdmmc0_padmux = { 592static const struct sirfsoc_padmux sdmmc0_padmux = {
571 .muxmask_counts = ARRAY_SIZE(sdmmc0_muxmask), 593 .muxmask_counts = ARRAY_SIZE(sdmmc0_muxmask),
572 .muxmask = sdmmc0_muxmask, 594 .muxmask = sdmmc0_muxmask,
595 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
573 .funcmask = BIT(5) | BIT(19), 596 .funcmask = BIT(5) | BIT(19),
574 .funcval = BIT(19), 597 .funcval = BIT(19),
575}; 598};
@@ -586,6 +609,7 @@ static const struct sirfsoc_muxmask sdmmc2_muxmask[] = {
586static const struct sirfsoc_padmux sdmmc2_padmux = { 609static const struct sirfsoc_padmux sdmmc2_padmux = {
587 .muxmask_counts = ARRAY_SIZE(sdmmc2_muxmask), 610 .muxmask_counts = ARRAY_SIZE(sdmmc2_muxmask),
588 .muxmask = sdmmc2_muxmask, 611 .muxmask = sdmmc2_muxmask,
612 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
589 .funcmask = BIT(11), 613 .funcmask = BIT(11),
590 .funcval = 0, 614 .funcval = 0,
591}; 615};
@@ -602,6 +626,7 @@ static const struct sirfsoc_muxmask sdmmc2_nowp_muxmask[] = {
602static const struct sirfsoc_padmux sdmmc2_nowp_padmux = { 626static const struct sirfsoc_padmux sdmmc2_nowp_padmux = {
603 .muxmask_counts = ARRAY_SIZE(sdmmc2_nowp_muxmask), 627 .muxmask_counts = ARRAY_SIZE(sdmmc2_nowp_muxmask),
604 .muxmask = sdmmc2_nowp_muxmask, 628 .muxmask = sdmmc2_nowp_muxmask,
629 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
605 .funcmask = BIT(11), 630 .funcmask = BIT(11),
606 .funcval = 0, 631 .funcval = 0,
607}; 632};
@@ -634,6 +659,7 @@ static const struct sirfsoc_muxmask vip_muxmask[] = {
634static const struct sirfsoc_padmux vip_padmux = { 659static const struct sirfsoc_padmux vip_padmux = {
635 .muxmask_counts = ARRAY_SIZE(vip_muxmask), 660 .muxmask_counts = ARRAY_SIZE(vip_muxmask),
636 .muxmask = vip_muxmask, 661 .muxmask = vip_muxmask,
662 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
637 .funcmask = BIT(18), 663 .funcmask = BIT(18),
638 .funcval = BIT(18), 664 .funcval = BIT(18),
639}; 665};
@@ -654,6 +680,7 @@ static const struct sirfsoc_muxmask vip_noupli_muxmask[] = {
654static const struct sirfsoc_padmux vip_noupli_padmux = { 680static const struct sirfsoc_padmux vip_noupli_padmux = {
655 .muxmask_counts = ARRAY_SIZE(vip_noupli_muxmask), 681 .muxmask_counts = ARRAY_SIZE(vip_noupli_muxmask),
656 .muxmask = vip_noupli_muxmask, 682 .muxmask = vip_noupli_muxmask,
683 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
657 .funcmask = BIT(15), 684 .funcmask = BIT(15),
658 .funcval = BIT(15), 685 .funcval = BIT(15),
659}; 686};
@@ -684,6 +711,7 @@ static const struct sirfsoc_muxmask i2c1_muxmask[] = {
684static const struct sirfsoc_padmux i2c1_padmux = { 711static const struct sirfsoc_padmux i2c1_padmux = {
685 .muxmask_counts = ARRAY_SIZE(i2c1_muxmask), 712 .muxmask_counts = ARRAY_SIZE(i2c1_muxmask),
686 .muxmask = i2c1_muxmask, 713 .muxmask = i2c1_muxmask,
714 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
687 .funcmask = BIT(16), 715 .funcmask = BIT(16),
688 .funcval = 0, 716 .funcval = 0,
689}; 717};
@@ -700,6 +728,7 @@ static const struct sirfsoc_muxmask pwm0_muxmask[] = {
700static const struct sirfsoc_padmux pwm0_padmux = { 728static const struct sirfsoc_padmux pwm0_padmux = {
701 .muxmask_counts = ARRAY_SIZE(pwm0_muxmask), 729 .muxmask_counts = ARRAY_SIZE(pwm0_muxmask),
702 .muxmask = pwm0_muxmask, 730 .muxmask = pwm0_muxmask,
731 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
703 .funcmask = BIT(12), 732 .funcmask = BIT(12),
704 .funcval = 0, 733 .funcval = 0,
705}; 734};
@@ -772,6 +801,7 @@ static const struct sirfsoc_muxmask warm_rst_muxmask[] = {
772static const struct sirfsoc_padmux warm_rst_padmux = { 801static const struct sirfsoc_padmux warm_rst_padmux = {
773 .muxmask_counts = ARRAY_SIZE(warm_rst_muxmask), 802 .muxmask_counts = ARRAY_SIZE(warm_rst_muxmask),
774 .muxmask = warm_rst_muxmask, 803 .muxmask = warm_rst_muxmask,
804 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
775 .funcmask = BIT(4), 805 .funcmask = BIT(4),
776 .funcval = 0, 806 .funcval = 0,
777}; 807};
@@ -789,6 +819,7 @@ static const struct sirfsoc_muxmask usb0_upli_drvbus_muxmask[] = {
789static const struct sirfsoc_padmux usb0_upli_drvbus_padmux = { 819static const struct sirfsoc_padmux usb0_upli_drvbus_padmux = {
790 .muxmask_counts = ARRAY_SIZE(usb0_upli_drvbus_muxmask), 820 .muxmask_counts = ARRAY_SIZE(usb0_upli_drvbus_muxmask),
791 .muxmask = usb0_upli_drvbus_muxmask, 821 .muxmask = usb0_upli_drvbus_muxmask,
822 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
792 .funcmask = BIT(18), 823 .funcmask = BIT(18),
793 .funcval = 0, 824 .funcval = 0,
794}; 825};
@@ -805,12 +836,31 @@ static const struct sirfsoc_muxmask usb1_utmi_drvbus_muxmask[] = {
805static const struct sirfsoc_padmux usb1_utmi_drvbus_padmux = { 836static const struct sirfsoc_padmux usb1_utmi_drvbus_padmux = {
806 .muxmask_counts = ARRAY_SIZE(usb1_utmi_drvbus_muxmask), 837 .muxmask_counts = ARRAY_SIZE(usb1_utmi_drvbus_muxmask),
807 .muxmask = usb1_utmi_drvbus_muxmask, 838 .muxmask = usb1_utmi_drvbus_muxmask,
839 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
808 .funcmask = BIT(11), 840 .funcmask = BIT(11),
809 .funcval = BIT(11), /* refer to PAD_UTMI_DRVVBUS1_ENABLE */ 841 .funcval = BIT(11), /* refer to PAD_UTMI_DRVVBUS1_ENABLE */
810}; 842};
811 843
812static const unsigned usb1_utmi_drvbus_pins[] = { 28 }; 844static const unsigned usb1_utmi_drvbus_pins[] = { 28 };
813 845
846static const struct sirfsoc_padmux usb1_dp_dn_padmux = {
847 .muxmask_counts = 0,
848 .ctrlreg = SIRFSOC_RSC_USB_UART_SHARE,
849 .funcmask = BIT(2),
850 .funcval = BIT(2),
851};
852
853static const unsigned usb1_dp_dn_pins[] = { 103, 104 };
854
855static const struct sirfsoc_padmux uart1_route_io_usb1_padmux = {
856 .muxmask_counts = 0,
857 .ctrlreg = SIRFSOC_RSC_USB_UART_SHARE,
858 .funcmask = BIT(2),
859 .funcval = 0,
860};
861
862static const unsigned uart1_route_io_usb1_pins[] = { 103, 104 };
863
814static const struct sirfsoc_muxmask pulse_count_muxmask[] = { 864static const struct sirfsoc_muxmask pulse_count_muxmask[] = {
815 { 865 {
816 .group = 0, 866 .group = 0,
@@ -859,6 +909,8 @@ static const struct sirfsoc_pin_group sirfsoc_pin_groups[] = {
859 SIRFSOC_PIN_GROUP("sdmmc5grp", sdmmc5_pins), 909 SIRFSOC_PIN_GROUP("sdmmc5grp", sdmmc5_pins),
860 SIRFSOC_PIN_GROUP("usb0_upli_drvbusgrp", usb0_upli_drvbus_pins), 910 SIRFSOC_PIN_GROUP("usb0_upli_drvbusgrp", usb0_upli_drvbus_pins),
861 SIRFSOC_PIN_GROUP("usb1_utmi_drvbusgrp", usb1_utmi_drvbus_pins), 911 SIRFSOC_PIN_GROUP("usb1_utmi_drvbusgrp", usb1_utmi_drvbus_pins),
912 SIRFSOC_PIN_GROUP("usb1_dp_dngrp", usb1_dp_dn_pins),
913 SIRFSOC_PIN_GROUP("uart1_route_io_usb1grp", uart1_route_io_usb1_pins),
862 SIRFSOC_PIN_GROUP("pulse_countgrp", pulse_count_pins), 914 SIRFSOC_PIN_GROUP("pulse_countgrp", pulse_count_pins),
863 SIRFSOC_PIN_GROUP("i2sgrp", i2s_pins), 915 SIRFSOC_PIN_GROUP("i2sgrp", i2s_pins),
864 SIRFSOC_PIN_GROUP("i2s_no_dingrp", i2s_no_din_pins), 916 SIRFSOC_PIN_GROUP("i2s_no_dingrp", i2s_no_din_pins),
@@ -903,6 +955,8 @@ static const char * const sdmmc5grp[] = { "sdmmc5grp" };
903static const char * const sdmmc2_nowpgrp[] = { "sdmmc2_nowpgrp" }; 955static const char * const sdmmc2_nowpgrp[] = { "sdmmc2_nowpgrp" };
904static const char * const usb0_upli_drvbusgrp[] = { "usb0_upli_drvbusgrp" }; 956static const char * const usb0_upli_drvbusgrp[] = { "usb0_upli_drvbusgrp" };
905static const char * const usb1_utmi_drvbusgrp[] = { "usb1_utmi_drvbusgrp" }; 957static const char * const usb1_utmi_drvbusgrp[] = { "usb1_utmi_drvbusgrp" };
958static const char * const usb1_dp_dngrp[] = { "usb1_dp_dngrp" };
959static const char * const uart1_route_io_usb1grp[] = { "uart1_route_io_usb1grp" };
906static const char * const pulse_countgrp[] = { "pulse_countgrp" }; 960static const char * const pulse_countgrp[] = { "pulse_countgrp" };
907static const char * const i2sgrp[] = { "i2sgrp" }; 961static const char * const i2sgrp[] = { "i2sgrp" };
908static const char * const i2s_no_dingrp[] = { "i2s_no_dingrp" }; 962static const char * const i2s_no_dingrp[] = { "i2s_no_dingrp" };
@@ -949,6 +1003,8 @@ static const struct sirfsoc_pmx_func sirfsoc_pmx_functions[] = {
949 SIRFSOC_PMX_FUNCTION("sdmmc2_nowp", sdmmc2_nowpgrp, sdmmc2_nowp_padmux), 1003 SIRFSOC_PMX_FUNCTION("sdmmc2_nowp", sdmmc2_nowpgrp, sdmmc2_nowp_padmux),
950 SIRFSOC_PMX_FUNCTION("usb0_upli_drvbus", usb0_upli_drvbusgrp, usb0_upli_drvbus_padmux), 1004 SIRFSOC_PMX_FUNCTION("usb0_upli_drvbus", usb0_upli_drvbusgrp, usb0_upli_drvbus_padmux),
951 SIRFSOC_PMX_FUNCTION("usb1_utmi_drvbus", usb1_utmi_drvbusgrp, usb1_utmi_drvbus_padmux), 1005 SIRFSOC_PMX_FUNCTION("usb1_utmi_drvbus", usb1_utmi_drvbusgrp, usb1_utmi_drvbus_padmux),
1006 SIRFSOC_PMX_FUNCTION("usb1_dp_dn", usb1_dp_dngrp, usb1_dp_dn_padmux),
1007 SIRFSOC_PMX_FUNCTION("uart1_route_io_usb1", uart1_route_io_usb1grp, uart1_route_io_usb1_padmux),
952 SIRFSOC_PMX_FUNCTION("pulse_count", pulse_countgrp, pulse_count_padmux), 1008 SIRFSOC_PMX_FUNCTION("pulse_count", pulse_countgrp, pulse_count_padmux),
953 SIRFSOC_PMX_FUNCTION("i2s", i2sgrp, i2s_padmux), 1009 SIRFSOC_PMX_FUNCTION("i2s", i2sgrp, i2s_padmux),
954 SIRFSOC_PMX_FUNCTION("i2s_no_din", i2s_no_dingrp, i2s_no_din_padmux), 1010 SIRFSOC_PMX_FUNCTION("i2s_no_din", i2s_no_dingrp, i2s_no_din_padmux),
diff --git a/drivers/pinctrl/sirf/pinctrl-prima2.c b/drivers/pinctrl/sirf/pinctrl-prima2.c
index 241d83992692..050777be0f1e 100644
--- a/drivers/pinctrl/sirf/pinctrl-prima2.c
+++ b/drivers/pinctrl/sirf/pinctrl-prima2.c
@@ -126,6 +126,9 @@ static const struct pinctrl_pin_desc sirfsoc_pads[] = {
126 PINCTRL_PIN(112, "x_ldd[13]"), 126 PINCTRL_PIN(112, "x_ldd[13]"),
127 PINCTRL_PIN(113, "x_ldd[14]"), 127 PINCTRL_PIN(113, "x_ldd[14]"),
128 PINCTRL_PIN(114, "x_ldd[15]"), 128 PINCTRL_PIN(114, "x_ldd[15]"),
129
130 PINCTRL_PIN(115, "x_usb1_dp"),
131 PINCTRL_PIN(116, "x_usb1_dn"),
129}; 132};
130 133
131static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = { 134static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
@@ -143,6 +146,7 @@ static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
143static const struct sirfsoc_padmux lcd_16bits_padmux = { 146static const struct sirfsoc_padmux lcd_16bits_padmux = {
144 .muxmask_counts = ARRAY_SIZE(lcd_16bits_sirfsoc_muxmask), 147 .muxmask_counts = ARRAY_SIZE(lcd_16bits_sirfsoc_muxmask),
145 .muxmask = lcd_16bits_sirfsoc_muxmask, 148 .muxmask = lcd_16bits_sirfsoc_muxmask,
149 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
146 .funcmask = BIT(4), 150 .funcmask = BIT(4),
147 .funcval = 0, 151 .funcval = 0,
148}; 152};
@@ -168,6 +172,7 @@ static const struct sirfsoc_muxmask lcd_18bits_muxmask[] = {
168static const struct sirfsoc_padmux lcd_18bits_padmux = { 172static const struct sirfsoc_padmux lcd_18bits_padmux = {
169 .muxmask_counts = ARRAY_SIZE(lcd_18bits_muxmask), 173 .muxmask_counts = ARRAY_SIZE(lcd_18bits_muxmask),
170 .muxmask = lcd_18bits_muxmask, 174 .muxmask = lcd_18bits_muxmask,
175 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
171 .funcmask = BIT(4), 176 .funcmask = BIT(4),
172 .funcval = 0, 177 .funcval = 0,
173}; 178};
@@ -193,6 +198,7 @@ static const struct sirfsoc_muxmask lcd_24bits_muxmask[] = {
193static const struct sirfsoc_padmux lcd_24bits_padmux = { 198static const struct sirfsoc_padmux lcd_24bits_padmux = {
194 .muxmask_counts = ARRAY_SIZE(lcd_24bits_muxmask), 199 .muxmask_counts = ARRAY_SIZE(lcd_24bits_muxmask),
195 .muxmask = lcd_24bits_muxmask, 200 .muxmask = lcd_24bits_muxmask,
201 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
196 .funcmask = BIT(4), 202 .funcmask = BIT(4),
197 .funcval = 0, 203 .funcval = 0,
198}; 204};
@@ -218,6 +224,7 @@ static const struct sirfsoc_muxmask lcdrom_muxmask[] = {
218static const struct sirfsoc_padmux lcdrom_padmux = { 224static const struct sirfsoc_padmux lcdrom_padmux = {
219 .muxmask_counts = ARRAY_SIZE(lcdrom_muxmask), 225 .muxmask_counts = ARRAY_SIZE(lcdrom_muxmask),
220 .muxmask = lcdrom_muxmask, 226 .muxmask = lcdrom_muxmask,
227 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
221 .funcmask = BIT(4), 228 .funcmask = BIT(4),
222 .funcval = BIT(4), 229 .funcval = BIT(4),
223}; 230};
@@ -238,6 +245,7 @@ static const struct sirfsoc_muxmask uart0_muxmask[] = {
238static const struct sirfsoc_padmux uart0_padmux = { 245static const struct sirfsoc_padmux uart0_padmux = {
239 .muxmask_counts = ARRAY_SIZE(uart0_muxmask), 246 .muxmask_counts = ARRAY_SIZE(uart0_muxmask),
240 .muxmask = uart0_muxmask, 247 .muxmask = uart0_muxmask,
248 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
241 .funcmask = BIT(9), 249 .funcmask = BIT(9),
242 .funcval = BIT(9), 250 .funcval = BIT(9),
243}; 251};
@@ -282,6 +290,7 @@ static const struct sirfsoc_muxmask uart2_muxmask[] = {
282static const struct sirfsoc_padmux uart2_padmux = { 290static const struct sirfsoc_padmux uart2_padmux = {
283 .muxmask_counts = ARRAY_SIZE(uart2_muxmask), 291 .muxmask_counts = ARRAY_SIZE(uart2_muxmask),
284 .muxmask = uart2_muxmask, 292 .muxmask = uart2_muxmask,
293 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
285 .funcmask = BIT(10), 294 .funcmask = BIT(10),
286 .funcval = BIT(10), 295 .funcval = BIT(10),
287}; 296};
@@ -315,6 +324,7 @@ static const struct sirfsoc_muxmask sdmmc3_muxmask[] = {
315static const struct sirfsoc_padmux sdmmc3_padmux = { 324static const struct sirfsoc_padmux sdmmc3_padmux = {
316 .muxmask_counts = ARRAY_SIZE(sdmmc3_muxmask), 325 .muxmask_counts = ARRAY_SIZE(sdmmc3_muxmask),
317 .muxmask = sdmmc3_muxmask, 326 .muxmask = sdmmc3_muxmask,
327 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
318 .funcmask = BIT(7), 328 .funcmask = BIT(7),
319 .funcval = 0, 329 .funcval = 0,
320}; 330};
@@ -331,6 +341,7 @@ static const struct sirfsoc_muxmask spi0_muxmask[] = {
331static const struct sirfsoc_padmux spi0_padmux = { 341static const struct sirfsoc_padmux spi0_padmux = {
332 .muxmask_counts = ARRAY_SIZE(spi0_muxmask), 342 .muxmask_counts = ARRAY_SIZE(spi0_muxmask),
333 .muxmask = spi0_muxmask, 343 .muxmask = spi0_muxmask,
344 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
334 .funcmask = BIT(7), 345 .funcmask = BIT(7),
335 .funcval = BIT(7), 346 .funcval = BIT(7),
336}; 347};
@@ -361,6 +372,7 @@ static const struct sirfsoc_muxmask cko1_muxmask[] = {
361static const struct sirfsoc_padmux cko1_padmux = { 372static const struct sirfsoc_padmux cko1_padmux = {
362 .muxmask_counts = ARRAY_SIZE(cko1_muxmask), 373 .muxmask_counts = ARRAY_SIZE(cko1_muxmask),
363 .muxmask = cko1_muxmask, 374 .muxmask = cko1_muxmask,
375 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
364 .funcmask = BIT(3), 376 .funcmask = BIT(3),
365 .funcval = 0, 377 .funcval = 0,
366}; 378};
@@ -379,6 +391,7 @@ static const struct sirfsoc_muxmask i2s_muxmask[] = {
379static const struct sirfsoc_padmux i2s_padmux = { 391static const struct sirfsoc_padmux i2s_padmux = {
380 .muxmask_counts = ARRAY_SIZE(i2s_muxmask), 392 .muxmask_counts = ARRAY_SIZE(i2s_muxmask),
381 .muxmask = i2s_muxmask, 393 .muxmask = i2s_muxmask,
394 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
382 .funcmask = BIT(3) | BIT(9), 395 .funcmask = BIT(3) | BIT(9),
383 .funcval = BIT(3), 396 .funcval = BIT(3),
384}; 397};
@@ -395,6 +408,7 @@ static const struct sirfsoc_muxmask ac97_muxmask[] = {
395static const struct sirfsoc_padmux ac97_padmux = { 408static const struct sirfsoc_padmux ac97_padmux = {
396 .muxmask_counts = ARRAY_SIZE(ac97_muxmask), 409 .muxmask_counts = ARRAY_SIZE(ac97_muxmask),
397 .muxmask = ac97_muxmask, 410 .muxmask = ac97_muxmask,
411 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
398 .funcmask = BIT(8), 412 .funcmask = BIT(8),
399 .funcval = 0, 413 .funcval = 0,
400}; 414};
@@ -411,6 +425,7 @@ static const struct sirfsoc_muxmask spi1_muxmask[] = {
411static const struct sirfsoc_padmux spi1_padmux = { 425static const struct sirfsoc_padmux spi1_padmux = {
412 .muxmask_counts = ARRAY_SIZE(spi1_muxmask), 426 .muxmask_counts = ARRAY_SIZE(spi1_muxmask),
413 .muxmask = spi1_muxmask, 427 .muxmask = spi1_muxmask,
428 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
414 .funcmask = BIT(8), 429 .funcmask = BIT(8),
415 .funcval = BIT(8), 430 .funcval = BIT(8),
416}; 431};
@@ -441,6 +456,7 @@ static const struct sirfsoc_muxmask gps_muxmask[] = {
441static const struct sirfsoc_padmux gps_padmux = { 456static const struct sirfsoc_padmux gps_padmux = {
442 .muxmask_counts = ARRAY_SIZE(gps_muxmask), 457 .muxmask_counts = ARRAY_SIZE(gps_muxmask),
443 .muxmask = gps_muxmask, 458 .muxmask = gps_muxmask,
459 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
444 .funcmask = BIT(12) | BIT(13) | BIT(14), 460 .funcmask = BIT(12) | BIT(13) | BIT(14),
445 .funcval = BIT(12), 461 .funcval = BIT(12),
446}; 462};
@@ -463,6 +479,7 @@ static const struct sirfsoc_muxmask sdmmc5_muxmask[] = {
463static const struct sirfsoc_padmux sdmmc5_padmux = { 479static const struct sirfsoc_padmux sdmmc5_padmux = {
464 .muxmask_counts = ARRAY_SIZE(sdmmc5_muxmask), 480 .muxmask_counts = ARRAY_SIZE(sdmmc5_muxmask),
465 .muxmask = sdmmc5_muxmask, 481 .muxmask = sdmmc5_muxmask,
482 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
466 .funcmask = BIT(13) | BIT(14), 483 .funcmask = BIT(13) | BIT(14),
467 .funcval = BIT(13) | BIT(14), 484 .funcval = BIT(13) | BIT(14),
468}; 485};
@@ -479,6 +496,7 @@ static const struct sirfsoc_muxmask usp0_muxmask[] = {
479static const struct sirfsoc_padmux usp0_padmux = { 496static const struct sirfsoc_padmux usp0_padmux = {
480 .muxmask_counts = ARRAY_SIZE(usp0_muxmask), 497 .muxmask_counts = ARRAY_SIZE(usp0_muxmask),
481 .muxmask = usp0_muxmask, 498 .muxmask = usp0_muxmask,
499 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
482 .funcmask = BIT(1) | BIT(2) | BIT(6) | BIT(9), 500 .funcmask = BIT(1) | BIT(2) | BIT(6) | BIT(9),
483 .funcval = 0, 501 .funcval = 0,
484}; 502};
@@ -509,6 +527,7 @@ static const struct sirfsoc_muxmask usp1_muxmask[] = {
509static const struct sirfsoc_padmux usp1_padmux = { 527static const struct sirfsoc_padmux usp1_padmux = {
510 .muxmask_counts = ARRAY_SIZE(usp1_muxmask), 528 .muxmask_counts = ARRAY_SIZE(usp1_muxmask),
511 .muxmask = usp1_muxmask, 529 .muxmask = usp1_muxmask,
530 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
512 .funcmask = BIT(1) | BIT(9) | BIT(10) | BIT(11), 531 .funcmask = BIT(1) | BIT(9) | BIT(10) | BIT(11),
513 .funcval = 0, 532 .funcval = 0,
514}; 533};
@@ -542,6 +561,7 @@ static const struct sirfsoc_muxmask usp2_muxmask[] = {
542static const struct sirfsoc_padmux usp2_padmux = { 561static const struct sirfsoc_padmux usp2_padmux = {
543 .muxmask_counts = ARRAY_SIZE(usp2_muxmask), 562 .muxmask_counts = ARRAY_SIZE(usp2_muxmask),
544 .muxmask = usp2_muxmask, 563 .muxmask = usp2_muxmask,
564 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
545 .funcmask = BIT(13) | BIT(14), 565 .funcmask = BIT(13) | BIT(14),
546 .funcval = 0, 566 .funcval = 0,
547}; 567};
@@ -572,6 +592,7 @@ static const struct sirfsoc_muxmask nand_muxmask[] = {
572static const struct sirfsoc_padmux nand_padmux = { 592static const struct sirfsoc_padmux nand_padmux = {
573 .muxmask_counts = ARRAY_SIZE(nand_muxmask), 593 .muxmask_counts = ARRAY_SIZE(nand_muxmask),
574 .muxmask = nand_muxmask, 594 .muxmask = nand_muxmask,
595 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
575 .funcmask = BIT(5), 596 .funcmask = BIT(5),
576 .funcval = 0, 597 .funcval = 0,
577}; 598};
@@ -580,6 +601,7 @@ static const unsigned nand_pins[] = { 64, 65, 92, 93, 94 };
580 601
581static const struct sirfsoc_padmux sdmmc0_padmux = { 602static const struct sirfsoc_padmux sdmmc0_padmux = {
582 .muxmask_counts = 0, 603 .muxmask_counts = 0,
604 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
583 .funcmask = BIT(5), 605 .funcmask = BIT(5),
584 .funcval = 0, 606 .funcval = 0,
585}; 607};
@@ -596,6 +618,7 @@ static const struct sirfsoc_muxmask sdmmc2_muxmask[] = {
596static const struct sirfsoc_padmux sdmmc2_padmux = { 618static const struct sirfsoc_padmux sdmmc2_padmux = {
597 .muxmask_counts = ARRAY_SIZE(sdmmc2_muxmask), 619 .muxmask_counts = ARRAY_SIZE(sdmmc2_muxmask),
598 .muxmask = sdmmc2_muxmask, 620 .muxmask = sdmmc2_muxmask,
621 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
599 .funcmask = BIT(5), 622 .funcmask = BIT(5),
600 .funcval = BIT(5), 623 .funcval = BIT(5),
601}; 624};
@@ -628,6 +651,7 @@ static const struct sirfsoc_muxmask vip_muxmask[] = {
628static const struct sirfsoc_padmux vip_padmux = { 651static const struct sirfsoc_padmux vip_padmux = {
629 .muxmask_counts = ARRAY_SIZE(vip_muxmask), 652 .muxmask_counts = ARRAY_SIZE(vip_muxmask),
630 .muxmask = vip_muxmask, 653 .muxmask = vip_muxmask,
654 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
631 .funcmask = BIT(0), 655 .funcmask = BIT(0),
632 .funcval = 0, 656 .funcval = 0,
633}; 657};
@@ -677,6 +701,7 @@ static const struct sirfsoc_muxmask viprom_muxmask[] = {
677static const struct sirfsoc_padmux viprom_padmux = { 701static const struct sirfsoc_padmux viprom_padmux = {
678 .muxmask_counts = ARRAY_SIZE(viprom_muxmask), 702 .muxmask_counts = ARRAY_SIZE(viprom_muxmask),
679 .muxmask = viprom_muxmask, 703 .muxmask = viprom_muxmask,
704 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
680 .funcmask = BIT(0), 705 .funcmask = BIT(0),
681 .funcval = BIT(0), 706 .funcval = BIT(0),
682}; 707};
@@ -693,6 +718,7 @@ static const struct sirfsoc_muxmask pwm0_muxmask[] = {
693static const struct sirfsoc_padmux pwm0_padmux = { 718static const struct sirfsoc_padmux pwm0_padmux = {
694 .muxmask_counts = ARRAY_SIZE(pwm0_muxmask), 719 .muxmask_counts = ARRAY_SIZE(pwm0_muxmask),
695 .muxmask = pwm0_muxmask, 720 .muxmask = pwm0_muxmask,
721 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
696 .funcmask = BIT(12), 722 .funcmask = BIT(12),
697 .funcval = 0, 723 .funcval = 0,
698}; 724};
@@ -764,6 +790,7 @@ static const struct sirfsoc_muxmask usb0_utmi_drvbus_muxmask[] = {
764static const struct sirfsoc_padmux usb0_utmi_drvbus_padmux = { 790static const struct sirfsoc_padmux usb0_utmi_drvbus_padmux = {
765 .muxmask_counts = ARRAY_SIZE(usb0_utmi_drvbus_muxmask), 791 .muxmask_counts = ARRAY_SIZE(usb0_utmi_drvbus_muxmask),
766 .muxmask = usb0_utmi_drvbus_muxmask, 792 .muxmask = usb0_utmi_drvbus_muxmask,
793 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
767 .funcmask = BIT(6), 794 .funcmask = BIT(6),
768 .funcval = BIT(6), /* refer to PAD_UTMI_DRVVBUS0_ENABLE */ 795 .funcval = BIT(6), /* refer to PAD_UTMI_DRVVBUS0_ENABLE */
769}; 796};
@@ -780,12 +807,31 @@ static const struct sirfsoc_muxmask usb1_utmi_drvbus_muxmask[] = {
780static const struct sirfsoc_padmux usb1_utmi_drvbus_padmux = { 807static const struct sirfsoc_padmux usb1_utmi_drvbus_padmux = {
781 .muxmask_counts = ARRAY_SIZE(usb1_utmi_drvbus_muxmask), 808 .muxmask_counts = ARRAY_SIZE(usb1_utmi_drvbus_muxmask),
782 .muxmask = usb1_utmi_drvbus_muxmask, 809 .muxmask = usb1_utmi_drvbus_muxmask,
810 .ctrlreg = SIRFSOC_RSC_PIN_MUX,
783 .funcmask = BIT(11), 811 .funcmask = BIT(11),
784 .funcval = BIT(11), /* refer to PAD_UTMI_DRVVBUS1_ENABLE */ 812 .funcval = BIT(11), /* refer to PAD_UTMI_DRVVBUS1_ENABLE */
785}; 813};
786 814
787static const unsigned usb1_utmi_drvbus_pins[] = { 59 }; 815static const unsigned usb1_utmi_drvbus_pins[] = { 59 };
788 816
817static const struct sirfsoc_padmux usb1_dp_dn_padmux = {
818 .muxmask_counts = 0,
819 .ctrlreg = SIRFSOC_RSC_USB_UART_SHARE,
820 .funcmask = BIT(2),
821 .funcval = BIT(2),
822};
823
824static const unsigned usb1_dp_dn_pins[] = { 115, 116 };
825
826static const struct sirfsoc_padmux uart1_route_io_usb1_padmux = {
827 .muxmask_counts = 0,
828 .ctrlreg = SIRFSOC_RSC_USB_UART_SHARE,
829 .funcmask = BIT(2),
830 .funcval = 0,
831};
832
833static const unsigned uart1_route_io_usb1_pins[] = { 115, 116 };
834
789static const struct sirfsoc_muxmask pulse_count_muxmask[] = { 835static const struct sirfsoc_muxmask pulse_count_muxmask[] = {
790 { 836 {
791 .group = 0, 837 .group = 0,
@@ -838,6 +884,8 @@ static const struct sirfsoc_pin_group sirfsoc_pin_groups[] = {
838 SIRFSOC_PIN_GROUP("sdmmc5grp", sdmmc5_pins), 884 SIRFSOC_PIN_GROUP("sdmmc5grp", sdmmc5_pins),
839 SIRFSOC_PIN_GROUP("usb0_utmi_drvbusgrp", usb0_utmi_drvbus_pins), 885 SIRFSOC_PIN_GROUP("usb0_utmi_drvbusgrp", usb0_utmi_drvbus_pins),
840 SIRFSOC_PIN_GROUP("usb1_utmi_drvbusgrp", usb1_utmi_drvbus_pins), 886 SIRFSOC_PIN_GROUP("usb1_utmi_drvbusgrp", usb1_utmi_drvbus_pins),
887 SIRFSOC_PIN_GROUP("usb1_dp_dngrp", usb1_dp_dn_pins),
888 SIRFSOC_PIN_GROUP("uart1_route_io_usb1grp", uart1_route_io_usb1_pins),
841 SIRFSOC_PIN_GROUP("pulse_countgrp", pulse_count_pins), 889 SIRFSOC_PIN_GROUP("pulse_countgrp", pulse_count_pins),
842 SIRFSOC_PIN_GROUP("i2sgrp", i2s_pins), 890 SIRFSOC_PIN_GROUP("i2sgrp", i2s_pins),
843 SIRFSOC_PIN_GROUP("ac97grp", ac97_pins), 891 SIRFSOC_PIN_GROUP("ac97grp", ac97_pins),
@@ -884,6 +932,8 @@ static const char * const sdmmc4grp[] = { "sdmmc4grp" };
884static const char * const sdmmc5grp[] = { "sdmmc5grp" }; 932static const char * const sdmmc5grp[] = { "sdmmc5grp" };
885static const char * const usb0_utmi_drvbusgrp[] = { "usb0_utmi_drvbusgrp" }; 933static const char * const usb0_utmi_drvbusgrp[] = { "usb0_utmi_drvbusgrp" };
886static const char * const usb1_utmi_drvbusgrp[] = { "usb1_utmi_drvbusgrp" }; 934static const char * const usb1_utmi_drvbusgrp[] = { "usb1_utmi_drvbusgrp" };
935static const char * const usb1_dp_dngrp[] = { "usb1_dp_dngrp" };
936static const char * const uart1_route_io_usb1grp[] = { "uart1_route_io_usb1grp" };
887static const char * const pulse_countgrp[] = { "pulse_countgrp" }; 937static const char * const pulse_countgrp[] = { "pulse_countgrp" };
888static const char * const i2sgrp[] = { "i2sgrp" }; 938static const char * const i2sgrp[] = { "i2sgrp" };
889static const char * const ac97grp[] = { "ac97grp" }; 939static const char * const ac97grp[] = { "ac97grp" };
@@ -930,6 +980,8 @@ static const struct sirfsoc_pmx_func sirfsoc_pmx_functions[] = {
930 SIRFSOC_PMX_FUNCTION("sdmmc5", sdmmc5grp, sdmmc5_padmux), 980 SIRFSOC_PMX_FUNCTION("sdmmc5", sdmmc5grp, sdmmc5_padmux),
931 SIRFSOC_PMX_FUNCTION("usb0_utmi_drvbus", usb0_utmi_drvbusgrp, usb0_utmi_drvbus_padmux), 981 SIRFSOC_PMX_FUNCTION("usb0_utmi_drvbus", usb0_utmi_drvbusgrp, usb0_utmi_drvbus_padmux),
932 SIRFSOC_PMX_FUNCTION("usb1_utmi_drvbus", usb1_utmi_drvbusgrp, usb1_utmi_drvbus_padmux), 982 SIRFSOC_PMX_FUNCTION("usb1_utmi_drvbus", usb1_utmi_drvbusgrp, usb1_utmi_drvbus_padmux),
983 SIRFSOC_PMX_FUNCTION("usb1_dp_dn", usb1_dp_dngrp, usb1_dp_dn_padmux),
984 SIRFSOC_PMX_FUNCTION("uart1_route_io_usb1", uart1_route_io_usb1grp, uart1_route_io_usb1_padmux),
933 SIRFSOC_PMX_FUNCTION("pulse_count", pulse_countgrp, pulse_count_padmux), 985 SIRFSOC_PMX_FUNCTION("pulse_count", pulse_countgrp, pulse_count_padmux),
934 SIRFSOC_PMX_FUNCTION("i2s", i2sgrp, i2s_padmux), 986 SIRFSOC_PMX_FUNCTION("i2s", i2sgrp, i2s_padmux),
935 SIRFSOC_PMX_FUNCTION("ac97", ac97grp, ac97_padmux), 987 SIRFSOC_PMX_FUNCTION("ac97", ac97grp, ac97_padmux),
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 26f946af7933..b81e388c50de 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -166,12 +166,12 @@ static void sirfsoc_pinmux_endisable(struct sirfsoc_pmx *spmx, unsigned selector
166 166
167 if (mux->funcmask && enable) { 167 if (mux->funcmask && enable) {
168 u32 func_en_val; 168 u32 func_en_val;
169
169 func_en_val = 170 func_en_val =
170 readl(spmx->rsc_virtbase + SIRFSOC_RSC_PIN_MUX); 171 readl(spmx->rsc_virtbase + mux->ctrlreg);
171 func_en_val = 172 func_en_val =
172 (func_en_val & ~mux->funcmask) | (mux-> 173 (func_en_val & ~mux->funcmask) | (mux->funcval);
173 funcval); 174 writel(func_en_val, spmx->rsc_virtbase + mux->ctrlreg);
174 writel(func_en_val, spmx->rsc_virtbase + SIRFSOC_RSC_PIN_MUX);
175 } 175 }
176} 176}
177 177
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.h b/drivers/pinctrl/sirf/pinctrl-sirf.h
index 17cc108510ba..d7f16b499ad9 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.h
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.h
@@ -9,8 +9,9 @@
9#ifndef __PINMUX_SIRF_H__ 9#ifndef __PINMUX_SIRF_H__
10#define __PINMUX_SIRF_H__ 10#define __PINMUX_SIRF_H__
11 11
12#define SIRFSOC_NUM_PADS 622 12#define SIRFSOC_NUM_PADS 622
13#define SIRFSOC_RSC_PIN_MUX 0x4 13#define SIRFSOC_RSC_USB_UART_SHARE 0
14#define SIRFSOC_RSC_PIN_MUX 0x4
14 15
15#define SIRFSOC_GPIO_PAD_EN(g) ((g)*0x100 + 0x84) 16#define SIRFSOC_GPIO_PAD_EN(g) ((g)*0x100 + 0x84)
16#define SIRFSOC_GPIO_PAD_EN_CLR(g) ((g)*0x100 + 0x90) 17#define SIRFSOC_GPIO_PAD_EN_CLR(g) ((g)*0x100 + 0x90)
@@ -61,6 +62,7 @@ struct sirfsoc_padmux {
61 unsigned long muxmask_counts; 62 unsigned long muxmask_counts;
62 const struct sirfsoc_muxmask *muxmask; 63 const struct sirfsoc_muxmask *muxmask;
63 /* RSC_PIN_MUX set */ 64 /* RSC_PIN_MUX set */
65 unsigned long ctrlreg;
64 unsigned long funcmask; 66 unsigned long funcmask;
65 unsigned long funcval; 67 unsigned long funcval;
66}; 68};