timvideos / HDMI2USB-jahanzeb-firmware

Original hand-coded firmware for the HDMI2USB - HDMI/DVI Capture - project
https://hdmi2usb.tv
Other
105 stars 26 forks source link

Convert cypress firmware to be compiled by sdcc #16

Closed mithro closed 9 years ago

mithro commented 11 years ago

Currently we use the closed source Kiel UV2 software for compiling the Cypress firmware.

We'd like to use open source tools instead, the sdcc compiler has support for the 8051 chip inside the chip and a number of people have already done a lot of the work. Take a look at the links below;

Links

shenki commented 11 years ago

I did a bit of reading. It looks like there are two options for developing an open source (no Cypress copyrights) SDCC built firmware:

allmybrain.com appears to be a good source of ideas for potential speedups when using fx2lib, should we require it down the track. They provide benchmarks of their implementation. I took at look at the source, and got it to build with a modern fx2lib and sdcc. The result is here https://github.com/shenki/cystream.git, if someone can test it using the included Python script that would be useful. (There appears to be a fx2 python module in fx2lib/examples that must be built in order to use this script).

At this stage, ezusb-firmware looks simpler, I suggest using this as a starting point for a re-implementation of the firmware.

kripton commented 10 years ago

The sigrok project also uses sdcc: http://sigrok.org/wiki/Fx2lafw code: http://sigrok.org/gitweb/?p=sigrok-firmware-fx2lafw.git;a=tree

mithro commented 9 years ago

Tim has started some of this work at https://github.com/mithro/HDMI2USB/tree/cypress-firmware

mithro commented 9 years ago

Example porting document can be found at http://www.danielclemente.com/placa_pi/index.en.html

cfelton commented 9 years ago

I haven't looked at the HDMI2USB FX2 firmware yet but I wrote and compiled previous FX2 code using SDCC for the USBP project and used it for a couple boards including this one. I am sure the firmware I used was the bare-minimal (I should go look at the source ...).

Are there are specific issues (road-blocks) you are currently dealing with?

mithro commented 9 years ago

@cfelton Lack of time is the major roadblock like always. I think I have a good handle on what needs to be done. The steps are,

New feature wise, I'd like the cypress to boot up and use JTAG to query the Spartan before enumeration. This is so it can include the serial number and use different usb ids if the FPGA had good firmware or not. Hence using a firmware which already does JTAG stuff makes sense.

cfelton commented 9 years ago

@mithro Yes, leveraging the existing JTAG is good! Isn't the JTAG in the FW very thin, it requires all the JTAG stream (commands) to be created by the host?

mithro commented 9 years ago

@cfelton Yes, you are correct - the JTAG implementations are extremely thin - basically just the bitbanging of the JTAG signals with correct transition timings. It should be pretty simple to make the firmware do the operations though because we only need some very specific operations rather than generic JTAG support.

The two possibility base firmware are;

mithro commented 9 years ago

Currently investigating using the libfpgalink FX2 firmware as base. Asked the original author for advice in https://github.com/makestuff/libfpgalink/issues/30

mithro commented 9 years ago

Fixed.

mithro commented 8 years ago

The HDMI2USB-jahanzeb-firmware is no longer under development.

All active development is now on the HDMI2USB-misoc-firmware which supports both the Atlys and Opsis boards and has loads of other new features!