3 from spec
.interfaces
import jtag
, uart
, ulpi
, uartfull
, rgbttl
, rgmii
4 from spec
.interfaces
import flexbus1
, flexbus2
, sdram1
, sdram2
, mcu8080
5 from spec
.interfaces
import eint
, pwm
, gpio
, spi
, i2c
, emmc
, sdmmc
6 from spec
.interfaces
import quadspi
, i2s
7 from spec
.interfaces
import pinmerge
, Pinouts
9 from spec
.ifaceprint
import display
, display_fns
, check_functions
10 from spec
.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)
141 auto-generated by [[pinouts.py]]
147 print ("\n# Pinouts (Fixed function)\n")
331 fixedpins
= display_fixed(fixedpins
, len(pinouts
))
333 print ("""# Functions (PinMux)
335 auto-generated by [[pinouts.py]]
338 function_names
= {'EINT': 'External Interrupt',
339 'FB': 'MC68k FlexBus',
341 'JTAG1': 'JTAG (same as JTAG2, JTAG_SEL=LOW)',
342 'JTAG2': 'JTAG (same as JTAG1, JTAG_SEL=HIGH)',
343 'LCD': '24-pin RGB/TTL LCD',
344 'RG': 'RGMII Ethernet',
345 'MMC': 'eMMC 1/2/4/8 pin',
346 'PWM': 'PWM (pulse-width modulation)',
350 'SPI1': 'SPI (Serial Peripheral Interface) 1',
351 'SPI2': 'SPI (Serial Peripheral Interface) 2',
352 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1',
356 'UARTQ0': 'UART (TX/RX/CTS/RTS) 0',
357 'UARTQ1': 'UART (TX/RX/CTS/RTS) 1',
358 'UART2': 'UART (TX/RX) 2',
359 'UART3': 'UART (TX/RX) 3',
360 'UART4': 'UART (TX/RX) 4',
361 'ULPI1': 'ULPI (USB Low Pin-count) 1',
362 'ULPI2': 'ULPI (USB Low Pin-count) 2',
363 'ULPI3': 'ULPI (USB Low Pin-count) 3',
366 fns
= display_fns(bankspec
, pinouts
, function_names
)
369 # Scenarios below can be spec'd out as either "find first interface"
370 # by name/number e.g. SPI1, or as "find in bank/mux" which must be
371 # spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)
372 # EINT and PWM are grouped together, specially, but may still be spec'd
373 # using "BM:Name". Pins are removed in-order as listed from
374 # lists (interfaces, EINTs, PWMs) from available pins.
376 # EOMA68 scenario. not totally complete (some GPIO needed for PMIC)
377 # One interface to be connected to the MCU to give RTC and boot/dbg
378 # VBUS_EN, OTG_ID etc. are all not included below, there is plenty
381 eoma68
= ['B1:LCD/22', 'ULPI1/8', 'ULPI2', 'MMC', 'SD1', 'UART3',
382 'TWI3', 'SPI2', 'E2:SD2', ]
383 eoma68_eint
= ['EINT_16', 'EINT_17', 'EINT_18', 'EINT_19']
384 eoma68_pwm
= ['D1:PWM_2']
386 'MMC': 'internal (on Card)',
387 'SD1': 'user-facing: internal (on Card), multiplexed with JTAG1\n'
388 'and UART2, for debug purposes',
389 'TWI3': 'EOMA68-compliance: must be entirely free of devices.\n'
390 'Address 0x51 used (externally) for EOMA68 EEPROM Id',
391 'E2:SD2': 'EOMA68-compliance',
392 'SPI2': 'EOMA68-compliance',
393 'UART3': 'EOMA68-compliance',
394 'B1:LCD/22': 'EOMA68-compliance, 18-bit RGB/TTL LCD',
395 'ULPI1/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
396 'ULPI2': 'EOMA68-compliance: dual USB2 Host ULPI PHY'
399 unused_pins
= check_functions("EOMA68", bankspec
, fns
, pinouts
,
400 eoma68
, eoma68_eint
, eoma68_pwm
,
403 # Industrial scenario. not totally complete (some GPIO needed for PMIC)
404 # One interface to be connected to the MCU to give RTC, boot/dbg,
405 # option of CAN Bus, ADC, DAC, OWB, more GPIO, more PWM etc. etc.
406 # Focus is on getting as many UARTs, SPIs and TWIs as possible.
407 # OTG_ID (if to be used) would require dropping some functions in order
408 # to free up GPIO. LCD could be reduced to 15-bit (freeing 3).
409 # MMC could be reduced to 4-bit-wide, used as SD/MMC (freeing 4).
410 # QSPI could be used in 1-bit (MOSI/MISO) mode (freeing up 2 more).
412 industrial
= ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
414 'JTAG1', 'A3:UART2', 'E2:UART1', 'C3:UART0',
415 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3']
416 industrial_pwm
= ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2']
417 industrial_eint
= ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27',
418 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23']
420 unused_pins
= check_functions("Industrial", bankspec
, fns
, pinouts
,
421 industrial
, industrial_eint
, industrial_pwm
)
423 # Industrial scenario, using an SPI-based LCD instead of RGB/TTL
424 # not totally complete (some GPIO needed for PMIC)
425 # One interface to be connected to the MCU to give RTC, boot/dbg,
426 # option of CAN Bus, ADC, DAC, OWB, more GPIO, more PWM etc. etc.
427 # Focus is on getting as many UARTs, SPIs and TWIs as possible,
428 # leaving some GPIO spare from the RGB/TTL bank (SPI CS#)
429 # also possibility of freeing up FlexBus CS# with a little reorg.
431 industrial
= ['D1:FB/17', 'E1:FB/8', 'B2:SPI1', 'ULPI1/8', 'ULPI2/8',
434 'A3:UART2', 'E2:UART1', 'C3:UART0', 'B2:UART4', 'B2:UART3',
435 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3']
436 industrial_pwm
= ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2']
437 industrial_eint
= ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27',
438 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23']
440 'B2:SPI1': 'Used for 320x240 or 640x480 etc. SPI-based LCD.\n'
441 'Frees up large numbers of GPIO from RGB/TTL bank'
443 unused_pins
= check_functions("Industrial with SPI-LCD",
444 bankspec
, fns
, pinouts
,
445 industrial
, industrial_eint
, industrial_pwm
,
448 # Smartphone / Tablet - basically the same thing
450 tablet
= ['B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
452 'F1:IIS', # I2C Audio
454 'E2:UART1', # WIFI/BT
459 'D3:TWI1', 'D2:TWI3', 'SPI2', 'QSPI']
460 tablet_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
461 'F2:PWM_1', 'D1:PWM_2']
462 tablet_eint
= ['EINT_24', # BT_HOST_WAKE
463 'EINT_25', # WIFI_HOST_WAKE
465 'EINT_27', # GSENSOR_INT
467 'EINT_7', # TILT_SENSOR_INT
468 'EINT_22', # COMPASS_INT
470 'EINT_16', # PMIC_INT
471 'EINT_17', # PWR_BUTTON_INT
477 'RGB/TTL LCD, 800x480 or use SN75LVDS83b for up to 1440x900',
478 'MMC': 'eMMC: main internal storage',
479 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
480 'as well as USB Host or USB Device',
481 'ULPI2/8': 'USB2 Host, connect to ULPI PHY w/and 4-port USB2 Hub\n'
482 'for example GL850G or FE1.1. '
483 'Connects to 2/3/4G/LTE Modem, 2x USB-Camera (VC0345)',
484 'SD1': 'internal, multiplexed with JTAG1\n'
485 'and UART2, for debug purposes',
486 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
487 'TWI2': 'Connect to AC97 Audio IC',
488 'E2:UART1': 'Connect to BT on AP6234/AP6335',
489 'E2:SD2': 'Connect to WIFI on AP6234/AP6335',
490 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
491 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
492 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.',
493 'SPI2': 'Spare? SPI, connect to higher-speed sensor?',
494 'D2:UART3': 'Spare? UART (or 2 extra GPIO / EINT)',
495 'D2:UART4': 'Spare? UART (or 2 extra GPIO)',
496 'D3:TWI1': 'Connect to PMIC',
497 'D2:TWI3': 'Connect to sensors (Trackpad? CTP GSENSOR TILT COMPASS)',
498 'GPIO': '9 spare GPIO pins for miscellaneous functions:\n'
499 'wake-up of BT, WIFI, LCD power, sensor power etc.\n'
500 '4 GPIO may be needed for PWM Audio from Modem.\n'
501 'LED lights for camera will be needed.\n'
502 'Some phones may have clam-shell or lid switch.\n'
503 'Some Modems have spare GPIO (over AT commandset).\n'
504 'AXP209 PMIC has 4x GPIO, accessible over I2C.\n'
505 'SPI2, UART3-4, PWM1-2 may also be spare (10 extra GPIO).\n'
506 'If more needed, companion MCU may be used (48+ pin variant)\n'
507 'which also includes ADC, DAC, more PWM etc.',
508 'F2:PWM_0': 'LCD Backlight',
509 'F2:PWM_1': 'Spare? PWM (or extra GPIO / EINT)',
510 'D1:PWM_2': 'Spare? PWM (or extra GPIO / EINT)',
511 'EINT_24': 'BT_HOST_WAKE',
512 'EINT_25': 'WIFI_HOST_WAKE',
513 'EINT_26': 'CTP_INT',
514 'EINT_27': 'GSENSOR_INT',
516 'EINT_7': 'TILT_SENSOR_INT',
517 'EINT_22': 'COMPASS_INT',
518 'EINT_23': 'MCU_INT',
519 'EINT_16': 'PMIC_INT',
520 'EINT_17': 'PWR_BUTTON_INT',
524 unused_pins
= check_functions("Smartphone / Tablet",
525 bankspec
, fns
, pinouts
,
526 tablet
, tablet_eint
, tablet_pwm
,
531 laptop
= ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8',
533 'F1:IIS', # I2C Audio
535 'E2:UART1', # WIFI/BT
538 laptop_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
540 laptop_eint
= ['EINT_20', # BT_HOST_WAKE
541 'EINT_21', # WIFI_HOST_WAKE
543 'EINT_31', # PMIC_INT
546 'D1:FB/17': 'FlexBus. Connect to DM9000 or AX99896A MCU-style Bus\n'
547 '10/100 Ethernet PHY.',
548 'E1:FB/8': 'FlexBus bus bits 8-15, needed to make a 16-bit bus width',
549 'B1:LCD/22': 'RGB/TTL LCD, use SN75LVDS83b for '
550 'LVDS or SSD2828 for MIPI,\n'
551 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n'
552 'display output (eDP/LVDS and HDMI/VGA) '
554 'MMC': 'eMMC: main internal storage',
555 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
556 'as well as USB Host or USB Device',
557 'ULPI2/8': 'USB2 Host, connect to ULPI PHY w/and 4-port USB2 Hub\n'
558 'for example GL850G or FE1.1. '
559 'Connects to USB-Camera (VC0345 and 3x external USB Ports)',
560 'SD1': 'internal, multiplexed with JTAG1\n'
561 'and UART2, for debug purposes',
562 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
563 'TWI2': 'Connect to AC97 Audio IC',
564 'E2:UART1': 'Connect to BT on AP6234/AP6335',
565 'E2:SD3': 'Connect to WIFI on AP6234/AP6335',
566 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
567 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
568 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.\n'
569 'MCU implements keyboard-matrix for keyboard (also trackpad?)',
570 'D2:TWI3': 'Connect to PMIC',
571 'GPIO': 'Plenty of spare GPIO pins for miscellaneous functions\n'
572 'MCU EINT-capable GPIO may be used to generate extra EINTs\n'
573 'on the single MCU_INT line, if really needed',
574 'F2:PWM_0': 'LCD Backlight',
575 'EINT_20': 'BT_HOST_WAKE',
576 'EINT_21': 'WIFI_HOST_WAKE',
578 'EINT_31': 'PMIC_INT',
580 unused_pins
= check_functions("Laptop / Netbook",
581 bankspec
, fns
, pinouts
,
582 laptop
, laptop_eint
, laptop_pwm
,
587 iot
= ['B1:LCD', 'ULPI2/8', 'ULPI1/8',
589 'F1:IIS', # I2C Audio
591 'C3:UART0', # HSPA UART
592 'E2:UART1', # BT UART
593 'C2:SPI2', # HSPI SPI
595 'D3:TWI1', # sensors CTP,
597 iot_pwm
= ['F2:PWM_0', # LCD_BACKLIGHT
599 iot_eint
= ['EINT_5', # 'HSPA_MST_RDY',
600 'EINT_6', # 'HSPA_SL_RDY',
601 'EINT_7', # 'HSPA_RING',
602 'EINT_8', # 'WL_PMU_EN',
603 'EINT_9', # HSPA_GPIO1
605 'EINT_11', # 'BT_PCM_CLK',
606 'EINT_12', # 'BT_PCM_DIN',
607 'EINT_13', # 'BT_PCM_SYNC',
608 'EINT_14', # 'BT_PCM_DOUT',
609 'EINT_16', # 'USB_DRVVBUS',
610 'EINT_17', # 'USB_VBUSDET',
611 'EINT_21', # 'USB_ID',
612 'EINT_30', # 'CTP_INT',
613 'EINT_31', # 'SD_DET#',
617 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n'
618 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n'
619 'display output (eDP/LVDS and HDMI/VGA) '
621 'MMC': 'eMMC: main internal storage',
622 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC',
623 'ULPI2/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n'
624 'as well as USB Host or USB Device',
625 'ULPI1/8': 'USB2 Host, connect to ULPI PHY',
626 'SD1': 'internal, multiplexed with JTAG1\n'
627 'and UART2, for debug purposes',
628 'C3:UART0': 'Connect to HSPA UART',
629 'E2:UART1': 'Connect to BT UART',
630 'E2:SD3': 'Connect to WIFI',
631 'C2:SPI2': 'HSPA SPI',
632 'QSPI': 'Boot Storage (connection to companion / debug / boot MCU)\n'
633 'Only actually needs MISO/MOSI, bootstrap loader v. small\n'
634 'Bootstrap loader checks eMMC, USB-OTG, SD/MMC, SPI, etc.\n'
635 'MCU implements keyboard-matrix for keyboard (also trackpad?)',
636 'D2:TWI3': 'Connect to PMIC',
637 'D3:TWI1': 'Connect to sensors CTP',
638 'GPIO': 'Plenty of spare GPIO pins for miscellaneous functions\n'
639 'MCU EINT-capable GPIO may be used to generate extra EINTs\n'
640 'on the single MCU_INT line, if really needed',
641 'F2:PWM_0': 'LCD Backlight',
642 'GPIOD_D4': 'WL_WAKE_AP',
643 'GPIOD_D5': 'BT_WAKE_AP',
644 'GPIOD_D6': 'AP_WAKE_BT',
645 'GPIOD_D7': 'AP_CK32KO',
646 'GPIOD_D8': 'HSPA_PWRON',
647 'GPIOD_D9': 'BT_RST_N',
648 'GPIOE_E5': 'HSPA_ON_OFF',
649 'GPIOD_D2': 'HSPA_SHUTDOWN',
650 'GPIOD_D3': 'CTP_RST',
651 'GPIOD_D12': 'LCD_RDN',
652 'GPIOD_D17': 'LCD_WRN',
653 'GPIOD_D18': 'LCD_RS',
654 'GPIOD_D21': 'LCD_CSN',
656 'EINT_5': 'HSPA_MST_RDY',
657 'EINT_6': 'HSPA_SL_RDY',
658 'EINT_7': 'HSPA_RING',
659 'EINT_8': 'WL_PMU_EN',
660 'EINT_9': 'HSPA_GPIO1',
662 'EINT_11': 'BT_PCM_CLK',
663 'EINT_12': 'BT_PCM_DIN',
664 'EINT_13': 'BT_PCM_SYNC',
665 'EINT_14': 'BT_PCM_DOUT',
667 'EINT_16': 'USB_DRVVBUS',
668 'EINT_17': 'USB_VBUSDET',
670 'EINT_30': 'CTP_INT',
671 'EINT_31': 'SD_DETN',
673 unused_pins
= check_functions("IoT",
674 bankspec
, fns
, pinouts
,
675 iot
, iot_eint
, iot_pwm
,
678 print ("""# Reference Datasheets
680 datasheets and pinout links
681 * <http://datasheets.chipdb.org/AMD/8018x/80186/amd-80186.pdf>
682 * <http://hands.com/~lkcl/eoma/shenzen/frida/FRD144A2701.pdf>
683 * <http://pinouts.ru/Memory/sdcard_pinout.shtml>
684 * p8 <http://www.onfi.org/~/media/onfi/specs/onfi_2_0_gold.pdf?la=en>
685 * <https://www.heyrick.co.uk/blog/files/datasheets/dm9000aep.pdf>
686 * <http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4393.pdf>
687 * <https://www.nxp.com/docs/en/data-sheet/MCF54418.pdf>
688 * ULPI OTG PHY, ST <http://www.st.com/en/interfaces-and-transceivers/stulpi01a.html>
689 * ULPI OTG PHY, TI TUSB1210 <http://ti.com/product/TUSB1210/>
692 return pinouts
, bankspec
, pinbanks
, fixedpins