diff --git a/litex_boards/prog/openocd_max10_blaster.cfg b/litex_boards/prog/openocd_max10_blaster.cfg new file mode 100644 index 0000000..1fc9a23 --- /dev/null +++ b/litex_boards/prog/openocd_max10_blaster.cfg @@ -0,0 +1,22 @@ +source [find interface/altera-usb-blaster.cfg] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME 10m50 +} + +# user-defined chains are 0xC (12) or 0xE (14) +# they are the same, single, scan-chain disgtinguished by the usr1user bit + +jtag newtap $_CHIPNAME tap -irlen 10 -expected-id 0x31810dd -expected-id 0x318a0dd \ + -expected-id 0x31820dd -expected-id 0x31830dd -expected-id 0x31840dd \ + -expected-id 0x318d0dd -expected-id 0x31850dd -expected-id 0x31010dd \ + -expected-id 0x310a0dd -expected-id 0x31020dd -expected-id 0x31030dd \ + -expected-id 0x31040dd -expected-id 0x310d0dd -expected-id 0x31050dd + +# unneeded +# suppresses warning +gdb_port disabled +tcl_port disabled +telnet_port disabled diff --git a/litex_boards/prog/openocd_max10_blaster2.cfg b/litex_boards/prog/openocd_max10_blaster2.cfg new file mode 100644 index 0000000..5958c2e --- /dev/null +++ b/litex_boards/prog/openocd_max10_blaster2.cfg @@ -0,0 +1,22 @@ +source [find interface/altera-usb-blaster2.cfg] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME 10m50 +} + +# user-defined chains are 0xC (12) or 0xE (14) +# they are the same, single, scan-chain disgtinguished by the usr1user bit + +jtag newtap $_CHIPNAME tap -irlen 10 -expected-id 0x31810dd -expected-id 0x318a0dd \ + -expected-id 0x31820dd -expected-id 0x31830dd -expected-id 0x31840dd \ + -expected-id 0x318d0dd -expected-id 0x31850dd -expected-id 0x31010dd \ + -expected-id 0x310a0dd -expected-id 0x31020dd -expected-id 0x31030dd \ + -expected-id 0x31040dd -expected-id 0x310d0dd -expected-id 0x31050dd + +# unneeded +# suppresses warning +gdb_port disabled +tcl_port disabled +telnet_port disabled diff --git a/litex_boards/targets/terasic_deca.py b/litex_boards/targets/terasic_deca.py index a05b3aa..31cb222 100755 --- a/litex_boards/targets/terasic_deca.py +++ b/litex_boards/targets/terasic_deca.py @@ -53,15 +53,21 @@ class _CRG(Module): # BaseSoC ------------------------------------------------------------------------------------------ class BaseSoC(SoCCore): - def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, with_video_terminal=False, + def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, with_uartbone=False, with_jtagbone=False, with_video_terminal=False, with_ethernet=False, with_etherbone=False, eth_ip="192.168.1.50", eth_dynamic_ip=False, **kwargs): self.platform = platform = deca.Platform() # Defaults to JTAG-UART since no hardware UART. - if kwargs["uart_name"] == "serial": - kwargs["uart_name"] = "jtag_atlantic" + real_uart_name = kwargs["uart_name"] + if real_uart_name == "serial": + if with_jtagbone: + kwargs["uart_name"] = "crossover" + else: + kwargs["uart_name"] = "jtag_atlantic" + if with_uartbone: + kwargs["uart_name"] = "crossover" # SoCCore ---------------------------------------------------------------------------------- SoCCore.__init__(self, platform, sys_clk_freq, @@ -71,6 +77,14 @@ class BaseSoC(SoCCore): # CRG -------------------------------------------------------------------------------------- self.submodules.crg = self.crg = _CRG(platform, sys_clk_freq, with_usb_pll=False) + # UARTbone --------------------------------------------------------------------------------- + if with_uartbone: + self.add_uartbone(name=real_uart_name, baudrate=kwargs["uart_baudrate"]) + + # JTAGbone --------------------------------------------------------------------------------- + if with_jtagbone: + self.add_jtagbone() + # Ethernet --------------------------------------------------------------------------------- if with_ethernet or with_etherbone: self.platform.toolchain.additional_sdc_commands += [ @@ -111,6 +125,8 @@ def main(): ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support.") parser.add_argument("--eth-ip", default="192.168.1.50", type=str, help="Ethernet/Etherbone IP address.") parser.add_argument("--eth-dynamic-ip", action="store_true", help="Enable dynamic Ethernet IP addresses setting.") + parser.add_argument("--with-uartbone", action="store_true", help="Enable UARTbone support.") + parser.add_argument("--with-jtagbone", action="store_true", help="Enable JTAGbone support.") parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (VGA).") builder_args(parser) soc_core_args(parser) @@ -122,6 +138,8 @@ def main(): with_etherbone = args.with_etherbone, eth_ip = args.eth_ip, eth_dynamic_ip = args.eth_dynamic_ip, + with_uartbone = args.with_uartbone, + with_jtagbone = args.with_jtagbone, with_video_terminal = args.with_video_terminal, **soc_core_argdict(args) )