* <https://ftp.libre-soc.org/Pin_Control_Subsystem_Overview.pdf>
* <https://bugs.libre-soc.org/show_bug.cgi?id=50>
* <https://bugs.libre-soc.org/show_bug.cgi?id=750>
+* <https://bugs.libre-soc.org/show_bug.cgi?id=762>
* <https://git.libre-soc.org/?p=c4m-jtag.git;a=tree;hb=HEAD>
* Extra info: [[/docs/pinmux/temp_pinmux_info]]
* 0x02 - Configure GPIOs 8-11 - requires 4-bit `sel` one bit per GPIO
* 0x03 - Configure GPIOs 12-15 - requires 4-bit `sel` one bit per GPIO
+Here is the pseudocode for reading the GPIO
+data structs:
+
+ read_bytes = []
+ for i in range(len(sel)):
+ GPIO_num = adr*len(sel)+i
+ if sel[i]:
+ read_bytes.append(GPIO[GPIO_num])
+ else:
+ read_bytes.append(Const(0, 8))
+ if not wen:
+ dat_r.eq(Cat(read_bytes))
+
+and for writing, slightly different style:
+
+ if wen:
+ write_bytes = []
+ for i in range(len(sel)):
+ GPIO_num = adr*len(sel)+i
+ write_byte = dat_w.bit_select(i*8, 8)
+ if sel[i]:
+ GPIO[GPIO_num].eq(write_byte)
+
+As explained in this video
+
## Combining JTAG BS Chain and Pinmux (In Progress)
[[!img io_mux_bank_planning.JPG size="600x"]]