From f243e4017f2f1ef717bf7b227ed88d599a4d6442 Mon Sep 17 00:00:00 2001 From: Luke Valenty Date: Mon, 14 May 2018 14:10:19 -0700 Subject: [PATCH 1/2] add TinyFPGA BX support --- .gitignore | 3 + README.md | 1 + app/package.json | 3 +- app/resources/boards/TinyFPGA-BX/info.json | 12 ++++ app/resources/boards/TinyFPGA-BX/pinout.json | 1 + app/resources/boards/TinyFPGA-BX/pinout.pcf | 64 ++++++++++++++++++++ app/resources/boards/TinyFPGA-BX/rules.json | 8 +++ app/scripts/services/drivers.js | 2 + app/scripts/services/tools.js | 1 + 9 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 app/resources/boards/TinyFPGA-BX/info.json create mode 100644 app/resources/boards/TinyFPGA-BX/pinout.json create mode 100644 app/resources/boards/TinyFPGA-BX/pinout.pcf create mode 100644 app/resources/boards/TinyFPGA-BX/rules.json diff --git a/.gitignore b/.gitignore index ae4e10023..780668c27 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ *.log *.mo +*.swp +*~ + .tmp dist cache diff --git a/README.md b/README.md index 9449cb90a..3242d81a6 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ | [BlackIce](https://hackaday.io/project/12930-blackice-low-cost-open-hardware-fpga-dev-board) | :white_check_mark: | :white_check_mark: | :white_check_mark: | | [BlackIce II](https://github.com/mystorm-org/BlackIce-II) | :white_check_mark: | :white_check_mark: | :white_check_mark: | | [TinyFPGA B2](http://tinyfpga.com/b-series-guide.html) | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [TinyFPGA BX](http://tinyfpga.com/b-series-guide.html) | :white_check_mark: | :white_check_mark: | :white_check_mark: | **\*** Use with Raspberry Pi diff --git a/app/package.json b/app/package.json index ff42d6260..37070c631 100644 --- a/app/package.json +++ b/app/package.json @@ -22,7 +22,8 @@ "max": "0.4.0", "extras": [ "blackiceprog", - "tinyfpgab" + "tinyfpgab", + "tinyprog" ], "external": "", "develop": false diff --git a/app/resources/boards/TinyFPGA-BX/info.json b/app/resources/boards/TinyFPGA-BX/info.json new file mode 100644 index 000000000..2d7579231 --- /dev/null +++ b/app/resources/boards/TinyFPGA-BX/info.json @@ -0,0 +1,12 @@ +{ + "label": "TinyFPGA BX", + "datasheet": "https://github.com/tinyfpga/TinyFPGA-BX", + "interface": "Serial", + "FPGAResources": { + "ffs": 7680, + "luts": 7680, + "pios": 23, + "plbs": 960, + "brams": 32 + } +} diff --git a/app/resources/boards/TinyFPGA-BX/pinout.json b/app/resources/boards/TinyFPGA-BX/pinout.json new file mode 100644 index 000000000..5664d03b0 --- /dev/null +++ b/app/resources/boards/TinyFPGA-BX/pinout.json @@ -0,0 +1 @@ +[{"type": "inout", "name": "PIN_1", "value": "A2"}, {"type": "inout", "name": "PIN_2", "value": "A1"}, {"type": "inout", "name": "PIN_3", "value": "B1"}, {"type": "inout", "name": "PIN_4", "value": "C2"}, {"type": "inout", "name": "PIN_5", "value": "C1"}, {"type": "inout", "name": "PIN_6", "value": "D2"}, {"type": "inout", "name": "PIN_7", "value": "D1"}, {"type": "inout", "name": "PIN_8", "value": "E2"}, {"type": "inout", "name": "PIN_9", "value": "E1"}, {"type": "inout", "name": "PIN_10", "value": "G2"}, {"type": "inout", "name": "PIN_11", "value": "H1"}, {"type": "inout", "name": "PIN_12", "value": "J1"}, {"type": "inout", "name": "PIN_13", "value": "H2"}, {"type": "inout", "name": "PIN_14", "value": "H9"}, {"type": "inout", "name": "PIN_15", "value": "D9"}, {"type": "inout", "name": "PIN_16", "value": "D8"}, {"type": "inout", "name": "PIN_17", "value": "C9"}, {"type": "inout", "name": "PIN_18", "value": "A9"}, {"type": "inout", "name": "PIN_19", "value": "B8"}, {"type": "inout", "name": "PIN_20", "value": "A8"}, {"type": "inout", "name": "PIN_21", "value": "B7"}, {"type": "inout", "name": "PIN_22", "value": "A7"}, {"type": "inout", "name": "PIN_23", "value": "B6"}, {"type": "inout", "name": "PIN_24", "value": "A6"}, {"type": "inout", "name": "SPI_SS", "value": "F7"}, {"type": "inout", "name": "SPI_SCK", "value": "G7"}, {"type": "inout", "name": "SPI_IO0", "value": "G6"}, {"type": "inout", "name": "SPI_IO1", "value": "H7"}, {"type": "inout", "name": "SPI_IO2", "value": "H4"}, {"type": "inout", "name": "SPI_IO3", "value": "J8"}, {"type": "inout", "name": "PIN_25", "value": "G1"}, {"type": "inout", "name": "PIN_26", "value": "J3"}, {"type": "inout", "name": "PIN_27", "value": "J4"}, {"type": "inout", "name": "PIN_28", "value": "G9"}, {"type": "inout", "name": "PIN_29", "value": "J9"}, {"type": "inout", "name": "PIN_30", "value": "E8"}, {"type": "inout", "name": "PIN_31", "value": "J2"}, {"type": "inout", "name": "LED", "value": "B3"}, {"type": "inout", "name": "USBP", "value": "B4"}, {"type": "inout", "name": "USBN", "value": "A4"}, {"type": "inout", "name": "USBPU", "value": "A3"}, {"type": "input", "name": "CLK", "value": "B2"}] \ No newline at end of file diff --git a/app/resources/boards/TinyFPGA-BX/pinout.pcf b/app/resources/boards/TinyFPGA-BX/pinout.pcf new file mode 100644 index 000000000..026184079 --- /dev/null +++ b/app/resources/boards/TinyFPGA-BX/pinout.pcf @@ -0,0 +1,64 @@ +# ----------------------------------------------------------------------------- +#- TinyFPGA BX constraint file (.pcf) +#- By Luke Valenty +#- May - 2018 +#- GPLv3 license +# ----------------------------------------------------------------------------- +# +# TinyFPGA BX information: https://github.com/tinyfpga/TinyFPGA-BX/ + +# -- Left side of board +set_io --warn-no-port PIN_1 A2 +set_io --warn-no-port PIN_2 A1 +set_io --warn-no-port PIN_3 B1 +set_io --warn-no-port PIN_4 C2 +set_io --warn-no-port PIN_5 C1 +set_io --warn-no-port PIN_6 D2 +set_io --warn-no-port PIN_7 D1 +set_io --warn-no-port PIN_8 E2 +set_io --warn-no-port PIN_9 E1 +set_io --warn-no-port PIN_10 G2 +set_io --warn-no-port PIN_11 H1 +set_io --warn-no-port PIN_12 J1 +set_io --warn-no-port PIN_13 H2 + +# -- Right side of board +set_io --warn-no-port PIN_14 H9 +set_io --warn-no-port PIN_15 D9 +set_io --warn-no-port PIN_16 D8 +set_io --warn-no-port PIN_17 C9 +set_io --warn-no-port PIN_18 A9 +set_io --warn-no-port PIN_19 B8 +set_io --warn-no-port PIN_20 A8 +set_io --warn-no-port PIN_21 B7 +set_io --warn-no-port PIN_22 A7 +set_io --warn-no-port PIN_23 B6 +set_io --warn-no-port PIN_24 A6 + +# -- SPI flash interface on bottom of board +set_io --warn-no-port SPI_SS F7 +set_io --warn-no-port SPI_SCK G7 +set_io --warn-no-port SPI_IO0 G6 +set_io --warn-no-port SPI_IO1 H7 +set_io --warn-no-port SPI_IO2 H4 +set_io --warn-no-port SPI_IO3 J8 + +# -- General purpose pins on bottom of board +set_io --warn-no-port PIN_25 G1 +set_io --warn-no-port PIN_26 J3 +set_io --warn-no-port PIN_27 J4 +set_io --warn-no-port PIN_28 G9 +set_io --warn-no-port PIN_29 J9 +set_io --warn-no-port PIN_30 E8 +set_io --warn-no-port PIN_31 J2 + +# -- LED pin on bottom of board +set_io --warn-no-port LED B3 + +# -- USB pins on bottom of board +set_io --warn-no-port USBP B4 +set_io --warn-no-port USBN A4 +set_io --warn-no-port USBPU A3 + +# -- 16MHz clock pin on bottom of board +set_io --warn-no-port CLK B2 # input diff --git a/app/resources/boards/TinyFPGA-BX/rules.json b/app/resources/boards/TinyFPGA-BX/rules.json new file mode 100644 index 000000000..3191def33 --- /dev/null +++ b/app/resources/boards/TinyFPGA-BX/rules.json @@ -0,0 +1,8 @@ +{ + "input" : [ + { + "port" : "clk", + "pin": "B2" + } + ] +} diff --git a/app/scripts/services/drivers.js b/app/scripts/services/drivers.js index f132414f7..541e09db8 100644 --- a/app/scripts/services/drivers.js +++ b/app/scripts/services/drivers.js @@ -130,6 +130,8 @@ angular.module('icestudio') rules += 'ATTRS{idVendor}==\\"0483\\", ATTRS{idProduct}==\\"5740\\", ENV{ID_MM_DEVICE_IGNORE}=\\"1\\"\n'; rules += '# Disable ModemManager for TinyFPGA B2\n'; rules += 'ATTRS{idVendor}==\\"1209\\", ATTRS{idProduct}==\\"2100\\", ENV{ID_MM_DEVICE_IGNORE}=\\"1\\"'; + rules += '# Disable ModemManager for TinyFPGA BX\n'; + rules += 'ATTRS{idVendor}==\\"1d50\\", ATTRS{idProduct}==\\"6130\\", ENV{ID_MM_DEVICE_IGNORE}=\\"1\\"'; configureLinuxDrivers([ 'echo \'' + rules + '\' > /etc/udev/rules.d/80-fpga-serial.rules' ].concat(reloadRules()), function() { diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index 2a33b2a6f..d4324d3ea 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -345,6 +345,7 @@ angular.module('icestudio') switch (common.selectedBoard.name) { // TinyFPGA-B2 programmer errors case 'TinyFPGA-B2': + case 'TinyFPGA-BX': var match = stdout.match(/Bootloader\snot\sactive/g); if (match && match.length === 3) { resultAlert = alertify.error(gettextCatalog.getString('Bootloader not active'), 30); From af477c2b202f36041eaa40ef1b73e3dc728c6dd6 Mon Sep 17 00:00:00 2001 From: Luke Valenty Date: Tue, 15 May 2018 13:01:03 -0700 Subject: [PATCH 2/2] update apio min/max version number, needs to be reviewed --- app/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 37070c631..83fe6a193 100644 --- a/app/package.json +++ b/app/package.json @@ -18,8 +18,8 @@ "icon": "resources/images/icestudio-logo.png" }, "apio": { - "min": "0.3.3", - "max": "0.4.0", + "min": "0.4.0", + "max": "0.5.0", "extras": [ "blackiceprog", "tinyfpgab",