3 from interfaces
import jtag
, uart
, ulpi
, uartfull
, rgbttl
, rgmii
4 from interfaces
import flexbus1
, flexbus2
, sdram1
, sdram2
, mcu8080
5 from interfaces
import eint
, pwm
, gpio
, spi
, i2c
, emmc
, sdmmc
6 from interfaces
import quadspi
, i2s
7 from interfaces
import pinmerge
, Pinouts
9 from ifaceprint
import display
, display_fns
, check_functions
10 from ifaceprint
import display_fixed
25 pkeys
= sorted(pinbanks
.keys())
32 pinmerge(pinouts
, gpio(bankspec
, "", ('A', 0), "A", 0, 16, 0))
33 pinmerge(pinouts
, spi(bankspec
, "1", ('A', 0), "A", 3))
34 pinmerge(pinouts
, uartfull(bankspec
, "1", ('A', 0), "A", 2))
35 pinmerge(pinouts
, i2c(bankspec
, "1", ('A', 4), "A", 2))
36 pinmerge(pinouts
, emmc(bankspec
, "", ('A', 0), "A", 1))
37 #pinmerge(pinouts, uart(bankspec, "2", ('A', 14), "A", 1))
38 pinmerge(pinouts
, spi(bankspec
, "2", ('A', 6), "A", 2))
39 pinmerge(pinouts
, eint(bankspec
, "", ('A', 10), "A", 0, 6))
40 pinmerge(pinouts
, eint(bankspec
, "", ('A', 4), "A", 0, 6, mux
=3))
41 pinmerge(pinouts
, sdmmc(bankspec
, "1", ('A', 10), "A", 2))
42 pinmerge(pinouts
, jtag(bankspec
, "1", ('A', 10), "A", 3))
43 pinmerge(pinouts
, uart(bankspec
, "2", ('A', 14), "A", 3))
46 pinmerge(pinouts
, gpio(bankspec
, "", ('B', 0), "B", 0, 28, 0))
47 pinmerge(pinouts
, rgbttl(bankspec
, "0", ('B', 0), "B", 1))
48 pinmerge(pinouts
, spi(bankspec
, "1", ('B', 12), "B", 2))
49 pinmerge(pinouts
, quadspi(bankspec
, "0", ('B', 4), "B", 2, limit
=4))
50 pinmerge(pinouts
, uart(bankspec
, "3", ('B', 16), "B", 2))
51 pinmerge(pinouts
, i2c(bankspec
, "3", ('B', 18), "B", 2))
52 pinmerge(pinouts
, pwm(bankspec
, "", ('B', 9), "B", 0, 1, mux
=2))
53 pinmerge(pinouts
, pwm(bankspec
, "", ('B', 20), "B", 1, 2, mux
=2))
54 pinmerge(pinouts
, sdmmc(bankspec
, "1", ('B', 22), "B", 2))
55 pinmerge(pinouts
, eint(bankspec
, "", ('B', 0), "B", 6, 4, mux
=3))
56 pinmerge(pinouts
, flexbus2(bankspec
, "0", ('B', 4), "B", 3))
57 pinmerge(pinouts
, i2c(bankspec
, "1", ('B', 0), "B", 2))
58 pinmerge(pinouts
, uart(bankspec
, "2", ('B', 2), "B", 2))
59 pinmerge(pinouts
, uart(bankspec
, "4", ('B', 10), "B", 2))
62 pinmerge(pinouts
, gpio(bankspec
, "", ("C", 0), "C", 0, 24, 0))
63 pinmerge(pinouts
, ulpi(bankspec
, "1", ('C', 0), "C", 1))
64 pinmerge(pinouts
, ulpi(bankspec
, "2", ('C', 12), "C", 1))
65 pinmerge(pinouts
, spi(bankspec
, "2", ('C', 8), "C", 2))
66 #pinmerge(pinouts, spi(bankspec, "2", ('C', 28), "C", 2))
67 pinmerge(pinouts
, uartfull(bankspec
, "0", ('C', 20), "C", 3))
68 pinmerge(pinouts
, eint(bankspec
, "", ('C', 0), "C", 10, 8, mux
=3))
69 pinmerge(pinouts
, jtag(bankspec
, "2", ('C', 8), "C", 3))
70 pinmerge(pinouts
, eint(bankspec
, "", ('C', 12), "C", 22, 8, mux
=3))
71 pinmerge(pinouts
, uart(bankspec
, "2", ('C', 22), "C", 2))
72 pinmerge(pinouts
, i2s(bankspec
, "", ('C', 13), "C", 2))
73 pinmerge(pinouts
, pwm(bankspec
, "", ('C', 21), "C", 2, 1, mux
=2))
77 'FB0_TS': ('FB0_ALE', 2, "D"),
78 'FB0_CS2': ('FB0_BWE2', 2, "D"),
79 'FB0_A0': ('FB0_BWE2', 3, "D"),
80 'FB0_CS3': ('FB0_BWE3', 2, "D"),
81 'FB0_A1': ('FB0_BWE3', 3, "D"),
82 'FB0_TBST': ('FB0_OE', 2, "D"),
83 'FB0_TSIZ0': ('FB0_BWE0', 2, "D"),
84 'FB0_TSIZ1': ('FB0_BWE1', 2, "D"),
86 #pinmerge(pinouts, mcu8080("", 72, "D", 1))
87 pinmerge(pinouts
, gpio(bankspec
, "", ('D', 0), "D", 0, 24, 0))
88 pinmerge(pinouts
, flexbus1(bankspec
, "0", ('D', 0), "D", 1, spec
=flexspec
))
89 pinmerge(pinouts
, i2c(bankspec
, "2", ('D', 17), "D", 2))
90 pinmerge(pinouts
, pwm(bankspec
, "", ('D', 21), "D", 0, 3, mux
=1))
91 pinmerge(pinouts
, i2c(bankspec
, "1", ('D', 10), "D", 3))
92 pinmerge(pinouts
, i2c(bankspec
, "3", ('D', 19), "D", 2))
93 pinmerge(pinouts
, uartfull(bankspec
, "0", ('D', 0), "D", 2))
94 pinmerge(pinouts
, uart(bankspec
, "3", ('D', 21), "D", 2))
95 pinmerge(pinouts
, uart(bankspec
, "4", ('D', 13), "D", 2))
96 pinmerge(pinouts
, eint(bankspec
, "", ('D', 19), "D", 18, 4, mux
=3))
97 pinmerge(pinouts
, eint(bankspec
, "", ('D', 23), "D", 9, 1, mux
=3))
98 pinmerge(pinouts
, eint(bankspec
, "", ('D', 13), "D", 5, 4, mux
=3))
99 pinmerge(pinouts
, eint(bankspec
, "", ('D', 0), "D", 30, 2, mux
=3))
100 pinmerge(pinouts
, i2c(bankspec
, "2", ('D', 2), "D", 3))
101 pinmerge(pinouts
, sdmmc(bankspec
, "2", ('D', 4), "D", 2))
104 pinmerge(pinouts
, gpio(bankspec
, "", ('E', 0), "E", 0, 24, 0))
105 pinmerge(pinouts
, flexbus2(bankspec
, "0", ('E', 0), "E", 1))
106 pinmerge(pinouts
, sdmmc(bankspec
, "2", ('E', 0), "E", 2))
107 pinmerge(pinouts
, sdmmc(bankspec
, "3", ('E', 8), "E", 2))
108 pinmerge(pinouts
, quadspi(bankspec
, "0", ('E', 18), "E", 2))
109 pinmerge(pinouts
, uartfull(bankspec
, "1", ('E', 14), "E", 2))
110 pinmerge(pinouts
, i2c(bankspec
, "2", ('E', 6), "E", 2))
111 pinmerge(pinouts
, eint(bankspec
, "", ('E', 0), "E", 10, 8, mux
=3))
112 pinmerge(pinouts
, eint(bankspec
, "", ('E', 8), "E", 22, 6, mux
=3))
113 pinmerge(pinouts
, emmc(bankspec
, "", ('E', 14), "E", 3))
116 pinmerge(pinouts
, gpio(bankspec
, "", ('F', 0), "F", 0, 10, 0))
117 pinmerge(pinouts
, i2s(bankspec
, "", ('F', 0), "F", 1))
118 pinmerge(pinouts
, i2c(bankspec
, "1", ('F', 6), "F", 2))
119 pinmerge(pinouts
, pwm(bankspec
, "", ('F', 8), "F", 0, 1, mux
=2))
120 pinmerge(pinouts
, pwm(bankspec
, "", ('F', 9), "F", 1, 1, mux
=2))
121 pinmerge(pinouts
, uart(bankspec
, "4", ('F', 8), "F", 1))
122 pinmerge(pinouts
, sdmmc(bankspec
, "3", ('F', 0), "F", 2))
123 pinmerge(pinouts
, eint(bankspec
, "", ('F', 0), "F", 18, 4, mux
=3))
124 pinmerge(pinouts
, pwm(bankspec
, "", ('F', 4), "F", 2, 1, mux
=3))
125 pinmerge(pinouts
, eint(bankspec
, "", ('F', 5), "F", 7, 1, mux
=3))
126 pinmerge(pinouts
, eint(bankspec
, "", ('F', 6), "F", 28, 4, mux
=3))
129 pinmerge(pinouts
, gpio(bankspec
, "", ('G', 0), "G", 0, 32, 0))
130 pinmerge(pinouts
, rgmii(bankspec
, "", ('G', 0), "G", 1))
131 pinmerge(pinouts
, ulpi(bankspec
, "3", ('G', 20), "G", 1))
132 pinmerge(pinouts
, rgbttl(bankspec
, "1", ('G', 0), "G", 2))
133 pinmerge(pinouts
, quadspi(bankspec
, "0", ('G', 26), "G", 3))
134 pinmerge(pinouts
, flexbus2(bankspec
, "0", ('G', 0), "G", 3))
135 mmc2
= sdmmc(bankspec
, "2", ('G', 24), "G", 3, limit
=2)
136 pinmerge(pinouts
, mmc2
)
137 mmc2
= sdmmc(bankspec
, "2", ('G', 28), "G", 2, start
=2)
138 pinmerge(pinouts
, mmc2
)
140 print "# Pinouts (PinMux)"
142 print "auto-generated by [[pinouts.py]]"
150 print "# Pinouts (Fixed function)"
335 fixedpins
= display_fixed(fixedpins
, len(pinouts
))
337 print "# Functions (PinMux)"
339 print "auto-generated by [[pinouts.py]]"
342 function_names
= {'EINT': 'External Interrupt',
343 'FB': 'MC68k FlexBus',
345 'JTAG1': 'JTAG (same as JTAG2, JTAG_SEL=LOW)',
346 'JTAG2': 'JTAG (same as JTAG1, JTAG_SEL=HIGH)',
347 'LCD': '24-pin RGB/TTL LCD',
348 'RG': 'RGMII Ethernet',
349 'MMC': 'eMMC 1/2/4/8 pin',
350 'PWM': 'PWM (pulse-width modulation)',
354 'SPI1': 'SPI (Serial Peripheral Interface) 1',
355 'SPI2': 'SPI (Serial Peripheral Interface) 2',
356 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1',
360 'UARTQ0': 'UART (TX/RX/CTS/RTS) 0',
361 'UARTQ1': 'UART (TX/RX/CTS/RTS) 1',
362 'UART2': 'UART (TX/RX) 2',
363 'UART3': 'UART (TX/RX) 3',
364 'UART4': 'UART (TX/RX) 4',
365 'ULPI1': 'ULPI (USB Low Pin-count) 1',
366 'ULPI2': 'ULPI (USB Low Pin-count) 2',
367 'ULPI3': 'ULPI (USB Low Pin-count) 3',
370 fns
= display_fns(bankspec
, pinouts
, function_names
)
373 # Scenarios below can be spec'd out as either "find first interface"
374 # by name/number e.g. SPI1, or as "find in bank/mux" which must be
375 # spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)
376 # EINT and PWM are grouped together, specially, but may still be spec'd
377 # using "BM:Name". Pins are removed in-order as listed from
378 # lists (interfaces, EINTs, PWMs) from available pins.
380 # EOMA68 scenario. not totally complete (some GPIO needed for PMIC)
381 # One interface to be connected to the MCU to give RTC and boot/dbg
382 # VBUS_EN, OTG_ID etc. are all not included below, there is plenty
385 eoma68
= ['B1:LCD/22', 'ULPI1/8', 'ULPI2', 'MMC', 'SD1', 'UART3',
386 'TWI3', 'SPI2', 'E2:SD2', ]
387 eoma68_eint
= ['EINT_16', 'EINT_17', 'EINT_18', 'EINT_19']
388 eoma68_pwm
= ['D1:PWM_2']
390 'MMC': 'internal (on Card)',
391 'SD1': 'user-facing: internal (on Card), multiplexed with JTAG1\n'
392 'and UART2, for debug purposes',
393 'TWI3': 'EOMA68-compliance: must be entirely free of devices.\n'
394 'Address 0x51 used (externally) for EOMA68 EEPROM Id',
395 'E2:SD2': 'EOMA68-compliance',
396 'SPI2': 'EOMA68-compliance',
397 'UART3': 'EOMA68-compliance',
398 'B1:LCD/22': 'EOMA68-compliance, 18-bit RGB/TTL LCD',
399 'ULPI1/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
400 'ULPI2': 'EOMA68-compliance: dual USB2 Host ULPI PHY'
403 unused_pins
= check_functions("EOMA68", bankspec
, fns
, pinouts
,
404 eoma68
, eoma68_eint
, eoma68_pwm
,
407 # Industrial scenario. not totally complete (some GPIO needed for PMIC)
408 # One interface to be connected to the MCU to give RTC, boot/dbg,
409 # option of CAN Bus, ADC, DAC, OWB, more GPIO, more PWM etc. etc.
410 # Focus is on getting as many UARTs, SPIs and TWIs as possible.
411 # OTG_ID (if to be used) would require dropping some functions in order
412 # to free up GPIO. LCD could be reduced to 15-bit (freeing 3).
413 # MMC could be reduced to 4-bit-wide, used as SD/MMC (freeing 4).
414 # QSPI could be used in 1-bit (MOSI/MISO) mode (freeing up 2 more).
416 industrial
= ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
418 'JTAG1', 'A3:UART2', 'E2:UART1', 'C3:UART0',
419 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3']
420 industrial_pwm
= ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2']
421 industrial_eint
= ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27',
422 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23']
424 unused_pins
= check_functions("Industrial", bankspec
, fns
, pinouts
,
425 industrial
, industrial_eint
, industrial_pwm
)
427 # Industrial scenario, using an SPI-based LCD instead of RGB/TTL
428 # not totally complete (some GPIO needed for PMIC)
429 # One interface to be connected to the MCU to give RTC, boot/dbg,
430 # option of CAN Bus, ADC, DAC, OWB, more GPIO, more PWM etc. etc.
431 # Focus is on getting as many UARTs, SPIs and TWIs as possible,
432 # leaving some GPIO spare from the RGB/TTL bank (SPI CS#)
433 # also possibility of freeing up FlexBus CS# with a little reorg.
435 industrial
= ['D1:FB/17', 'E1:FB/8', 'B2:SPI1', 'ULPI1/8', 'ULPI2/8',
438 'A3:UART2', 'E2:UART1', 'C3:UART0', 'B2:UART4', 'B2:UART3',
439 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3']
440 industrial_pwm
= ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2']
441 industrial_eint
= ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27',
442 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23']
444 'B2:SPI1': 'Used for 320x240 or 640x480 etc. SPI-based LCD.\n'
445 'Frees up large numbers of GPIO from RGB/TTL bank'
447 unused_pins
= check_functions("Industrial with SPI-LCD",
448 bankspec
, fns
, pinouts
,
449 industrial
, industrial_eint
, industrial_pwm
,
452 # Smartphone / Tablet - basically the same thing
454 tablet
= ['B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
456 'F1:IIS', # I2C Audio
458 'E2:UART1', # WIFI/BT
463 'D3:TWI1', 'D2:TWI3', 'SPI2', 'QSPI']
464 tablet_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
465 'F2:PWM_1', 'D1:PWM_2']
466 tablet_eint
= ['EINT_24', # BT_HOST_WAKE
467 'EINT_25', # WIFI_HOST_WAKE
469 'EINT_27', # GSENSOR_INT
471 'EINT_7', # TILT_SENSOR_INT
472 'EINT_22', # COMPASS_INT
474 'EINT_16', # PMIC_INT
475 'EINT_17', # PWR_BUTTON_INT
481 'RGB/TTL LCD, 800x480 or use SN75LVDS83b for up to 1440x900',
482 'MMC': 'eMMC: main internal storage',
483 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
484 'as well as USB Host or USB Device',
485 'ULPI2/8': 'USB2 Host, connect to ULPI PHY w/and 4-port USB2 Hub\n'
486 'for example GL850G or FE1.1. '
487 'Connects to 2/3/4G/LTE Modem, 2x USB-Camera (VC0345)',
488 'SD1': 'internal, multiplexed with JTAG1\n'
489 'and UART2, for debug purposes',
490 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
491 'TWI2': 'Connect to AC97 Audio IC',
492 'E2:UART1': 'Connect to BT on AP6234/AP6335',
493 'E2:SD2': 'Connect to WIFI on AP6234/AP6335',
494 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
495 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
496 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.',
497 'SPI2': 'Spare? SPI, connect to higher-speed sensor?',
498 'D2:UART3': 'Spare? UART (or 2 extra GPIO / EINT)',
499 'D2:UART4': 'Spare? UART (or 2 extra GPIO)',
500 'D3:TWI1': 'Connect to PMIC',
501 'D2:TWI3': 'Connect to sensors (Trackpad? CTP GSENSOR TILT COMPASS)',
502 'GPIO': '9 spare GPIO pins for miscellaneous functions:\n'
503 'wake-up of BT, WIFI, LCD power, sensor power etc.\n'
504 '4 GPIO may be needed for PWM Audio from Modem.\n'
505 'LED lights for camera will be needed.\n'
506 'Some phones may have clam-shell or lid switch.\n'
507 'Some Modems have spare GPIO (over AT commandset).\n'
508 'AXP209 PMIC has 4x GPIO, accessible over I2C.\n'
509 'SPI2, UART3-4, PWM1-2 may also be spare (10 extra GPIO).\n'
510 'If more needed, companion MCU may be used (48+ pin variant)\n'
511 'which also includes ADC, DAC, more PWM etc.',
512 'F2:PWM_0': 'LCD Backlight',
513 'F2:PWM_1': 'Spare? PWM (or extra GPIO / EINT)',
514 'D1:PWM_2': 'Spare? PWM (or extra GPIO / EINT)',
515 'EINT_24': 'BT_HOST_WAKE',
516 'EINT_25': 'WIFI_HOST_WAKE',
517 'EINT_26': 'CTP_INT',
518 'EINT_27': 'GSENSOR_INT',
520 'EINT_7': 'TILT_SENSOR_INT',
521 'EINT_22': 'COMPASS_INT',
522 'EINT_23': 'MCU_INT',
523 'EINT_16': 'PMIC_INT',
524 'EINT_17': 'PWR_BUTTON_INT',
528 unused_pins
= check_functions("Smartphone / Tablet",
529 bankspec
, fns
, pinouts
,
530 tablet
, tablet_eint
, tablet_pwm
,
535 laptop
= ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
537 'F1:IIS', # I2C Audio
539 'E2:UART1', # WIFI/BT
542 laptop_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
544 laptop_eint
= ['EINT_20', # BT_HOST_WAKE
545 'EINT_21', # WIFI_HOST_WAKE
547 'EINT_31', # PMIC_INT
550 'D1:FB/17': 'FlexBus. Connect to DM9000 or AX99896A MCU-style Bus\n'
551 '10/100 Ethernet PHY.',
552 'E1:FB/8': 'FlexBus bus bits 8-15, needed to make a 16-bit bus width',
553 'B1:LCD/22': 'RGB/TTL LCD, use SN75LVDS83b for '
554 'LVDS or SSD2828 for MIPI,\n'
555 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n'
556 'display output (eDP/LVDS and HDMI/VGA) '
558 'MMC': 'eMMC: main internal storage',
559 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
560 'as well as USB Host or USB Device',
561 'ULPI2/8': 'USB2 Host, connect to ULPI PHY w/and 4-port USB2 Hub\n'
562 'for example GL850G or FE1.1. '
563 'Connects to USB-Camera (VC0345 and 3x external USB Ports)',
564 'SD1': 'internal, multiplexed with JTAG1\n'
565 'and UART2, for debug purposes',
566 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
567 'TWI2': 'Connect to AC97 Audio IC',
568 'E2:UART1': 'Connect to BT on AP6234/AP6335',
569 'E2:SD3': 'Connect to WIFI on AP6234/AP6335',
570 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
571 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
572 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.\n'
573 'MCU implements keyboard-matrix for keyboard (also trackpad?)',
574 'D2:TWI3': 'Connect to PMIC',
575 'GPIO': 'Plenty of spare GPIO pins for miscellaneous functions\n'
576 'MCU EINT-capable GPIO may be used to generate extra EINTs\n'
577 'on the single MCU_INT line, if really needed',
578 'F2:PWM_0': 'LCD Backlight',
579 'EINT_20': 'BT_HOST_WAKE',
580 'EINT_21': 'WIFI_HOST_WAKE',
582 'EINT_31': 'PMIC_INT',
584 unused_pins
= check_functions("Laptop / Netbook",
585 bankspec
, fns
, pinouts
,
586 laptop
, laptop_eint
, laptop_pwm
,
591 iot
= ['B1:LCD', 'ULPI2/8', 'ULPI1/8',
593 'F1:IIS', # I2C Audio
595 'C3:UART0', # HSPA UART
596 'E2:UART1', # BT UART
597 'C2:SPI2', # HSPI SPI
599 'D3:TWI1', # sensors CTP,
601 iot_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
603 iot_eint
= ['EINT_5', # 'HSPA_MST_RDY',
604 'EINT_6', # 'HSPA_SL_RDY',
605 'EINT_7', # 'HSPA_RING',
606 'EINT_8', # 'WL_PMU_EN',
607 'EINT_9', # HSPA_GPIO1
609 'EINT_11', # 'BT_PCM_CLK',
610 'EINT_12', # 'BT_PCM_DIN',
611 'EINT_13', # 'BT_PCM_SYNC',
612 'EINT_14', # 'BT_PCM_DOUT',
613 'EINT_16', # 'USB_DRVVBUS',
614 'EINT_17', # 'USB_VBUSDET',
615 'EINT_21', # 'USB_ID',
616 'EINT_30', # 'CTP_INT',
617 'EINT_31', # 'SD_DET#',
621 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n'
622 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n'
623 'display output (eDP/LVDS and HDMI/VGA) '
625 'MMC': 'eMMC: main internal storage',
626 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
627 'ULPI2/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
628 'as well as USB Host or USB Device',
629 'ULPI1/8': 'USB2 Host, connect to ULPI PHY',
630 'SD1': 'internal, multiplexed with JTAG1\n'
631 'and UART2, for debug purposes',
632 'C3:UART0': 'Connect to HSPA UART',
633 'E2:UART1': 'Connect to BT UART',
634 'E2:SD3': 'Connect to WIFI',
635 'C2:SPI2': 'HSPA SPI',
636 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
637 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
638 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.\n'
639 'MCU implements keyboard-matrix for keyboard (also trackpad?)',
640 'D2:TWI3': 'Connect to PMIC',
641 'D3:TWI1': 'Connect to sensors CTP',
642 'GPIO': 'Plenty of spare GPIO pins for miscellaneous functions\n'
643 'MCU EINT-capable GPIO may be used to generate extra EINTs\n'
644 'on the single MCU_INT line, if really needed',
645 'F2:PWM_0': 'LCD Backlight',
646 'GPIOD_D4': 'WL_WAKE_AP',
647 'GPIOD_D5': 'BT_WAKE_AP',
648 'GPIOD_D6': 'AP_WAKE_BT',
649 'GPIOD_D7': 'AP_CK32KO',
650 'GPIOD_D8': 'HSPA_PWRON',
651 'GPIOD_D9': 'BT_RST_N',
652 'GPIOE_E5': 'HSPA_ON_OFF',
653 'GPIOD_D2': 'HSPA_SHUTDOWN',
654 'GPIOD_D3': 'CTP_RST',
655 'GPIOD_D12': 'LCD_RDN',
656 'GPIOD_D17': 'LCD_WRN',
657 'GPIOD_D18': 'LCD_RS',
658 'GPIOD_D21': 'LCD_CSN',
660 'EINT_5': 'HSPA_MST_RDY',
661 'EINT_6': 'HSPA_SL_RDY',
662 'EINT_7': 'HSPA_RING',
663 'EINT_8': 'WL_PMU_EN',
664 'EINT_9': 'HSPA_GPIO1',
666 'EINT_11': 'BT_PCM_CLK',
667 'EINT_12': 'BT_PCM_DIN',
668 'EINT_13': 'BT_PCM_SYNC',
669 'EINT_14': 'BT_PCM_DOUT',
671 'EINT_16': 'USB_DRVVBUS',
672 'EINT_17': 'USB_VBUSDET',
674 'EINT_30': 'CTP_INT',
675 'EINT_31': 'SD_DETN',
677 unused_pins
= check_functions("IoT",
678 bankspec
, fns
, pinouts
,
679 iot
, iot_eint
, iot_pwm
,
682 print "# Reference Datasheets"
684 print "datasheets and pinout links"
686 print "* <http://datasheets.chipdb.org/AMD/8018x/80186/amd-80186.pdf>"
687 print "* <http://hands.com/~lkcl/eoma/shenzen/frida/FRD144A2701.pdf>"
688 print "* <http://pinouts.ru/Memory/sdcard_pinout.shtml>"
689 print "* p8 <http://www.onfi.org/~/media/onfi/specs/onfi_2_0_gold.pdf?la=en>"
690 print "* <https://www.heyrick.co.uk/blog/files/datasheets/dm9000aep.pdf>"
691 print "* <http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4393.pdf>"
692 print "* <https://www.nxp.com/docs/en/data-sheet/MCF54418.pdf>"
693 print "* ULPI OTG PHY, ST <http://www.st.com/en/interfaces-and-transceivers/stulpi01a.html>"
694 print "* ULPI OTG PHY, TI TUSB1210 <http://ti.com/product/TUSB1210/>"
696 return pinouts
, bankspec
, fixedpins