Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #196 from timvideos/small-fixes
Couple of small fixes.
  • Loading branch information
mithro committed Jan 27, 2016
2 parents ec9f88e + 4acd999 commit 0c9ce97
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 22 deletions.
12 changes: 3 additions & 9 deletions .travis/run.sh
Expand Up @@ -96,18 +96,11 @@ for BOARD in $BOARDS; do
echo "- No Github token so unable to copy built files"
fi
else
echo ""
echo ""
echo ""
echo "- Fetching non shallow to get git version"
echo "---------------------------------------------"
git fetch --unshallow && git fetch --tags
GIT_REVISION=`git describe`
echo "============================================="
# Look at repo we are running in to determine where to try pushing to if in a fork
COPY_REPO_OWNER=$(echo $TRAVIS_REPO_SLUG|awk -F'/' '{print $1}')
echo "COPY_REPO_OWNER = $COPY_REPO_OWNER"
COPY_REPO="HDMI2USB-firmware-prebuilt"
GIT_REVISION=`git describe`
COPY_DEST="archive/$GIT_REVISION/$BOARD/$TARGET"
ORIG_COMMITTER_NAME=$(git log -1 --pretty=%an)
ORIG_COMMITTER_EMAIL=$(git log -1 --pretty=%ae)
Expand All @@ -123,9 +116,10 @@ for BOARD in $BOARDS; do
# Not currently built so use .bit instead
#cp ../third_party/misoc/build/*.xsvf $COPY_DEST
cp ../third_party/misoc/build/*.bit $COPY_DEST
cp ../third_party/misoc/build/*.bin $COPY_DEST
cp ../build/output.*.log $COPY_DEST/output.log
echo ""
echo "- Uploading .bit and logfile"
echo "- Uploading .bit, .bin and logfile"
# Only hdmi2usb is considered usable just now
UNSTABLE_LINK="$BOARD/firmware/unstable"
if [ "$TARGET" = "hdmi2usb" ]; then
Expand Down
9 changes: 9 additions & 0 deletions .travis/setup.sh
Expand Up @@ -3,6 +3,15 @@
set -x
set -e

echo ""
echo ""
echo ""
echo "- Fetching non shallow to get git version"
echo "---------------------------------------------"
git fetch --unshallow && git fetch --tags
GIT_REVISION=`git describe`
echo "============================================="

# Run the script once to check it works
time scripts/get-env.sh
# Run the script again to check it doesn't break things
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -72,7 +72,8 @@ all: clean gateware firmware

# Initialize submodules automatically
third_party/%/.git: .gitmodules
git submodule update --recursive --init $(dir $@)
git submodule sync --recursive -- $$(dirname $@)
git submodule update --recursive --init $$(dirname $@)
touch $@ -r .gitmodules

# Gateware
Expand Down
16 changes: 11 additions & 5 deletions Makefile.fx2
Expand Up @@ -27,18 +27,24 @@ gateware-build-fx2:
cp gateware/encoder/vhdl/header.hex $(MSCDIR)/build/header.hex

# Firmware for the Cypress FX2
firmware-fx2: third_party/fx2lib/.git
$(MAKE) -C firmware/fx2
firmware-fx2: firmware/fx2/hdmi2usb.hex
@true

embed-fx2: firmware-fx2
firmware/fx2/generate_fx2_microboot.py firmware/fx2/hdmi2usb.hex > firmware/lm32/fx2_fw_hdmi2usb.c
embed-fx2: firmware/lm32/fx2_fw_hdmi2usb.c
@true

load-fx2: firmware-fx2
load-fx2: firmware/fx2/hdmi2usb.hex
firmware/fx2/download.sh firmware/fx2/hdmi2usb.hex

clean-fx2:
$(MAKE) -C firmware/fx2 clean

firmware/fx2/hdmi2usb.hex:
$(MAKE) -C firmware/fx2

firmware/lm32/fx2_fw_hdmi2usb.c: firmware/fx2/generate_fx2_microboot.py firmware/fx2/hdmi2usb.hex
firmware/fx2/generate_fx2_microboot.py firmware/fx2/hdmi2usb.hex > firmware/lm32/fx2_fw_hdmi2usb.c

# Utility functions
view:
./scripts/view-hdmi2usb.sh
Expand Down
2 changes: 1 addition & 1 deletion firmware/lm32/edid.c
Expand Up @@ -128,7 +128,7 @@ void get_monitor_name(const void *buf, char *name)

name[MAX_MONITOR_NAME_LEN] = 0;
memcpy(name, &data_block[5], MAX_MONITOR_NAME_LEN);
c = strchr(name, '\r\n');
c = strchr(name, '\n');
if(c)
*c = 0;
}
Expand Down
1 change: 1 addition & 0 deletions firmware/lm32/edid.h
Expand Up @@ -17,6 +17,7 @@ struct video_timing {
unsigned int v_sync_width;

unsigned int established_timing;
const char* comment;
};

int validate_edid(const void *buf);
Expand Down
4 changes: 2 additions & 2 deletions firmware/lm32/fx2.c
Expand Up @@ -43,8 +43,8 @@ static inline uint8_t fx2_fw_get_value(size_t addr) {
return r;
}

#define FX2_REPORT_PERIOD (1 << 22)
#define FX2_WAIT_PERIOD FX2_REPORT_PERIOD*10
#define FX2_REPORT_PERIOD (1 << 20)
#define FX2_WAIT_PERIOD FX2_REPORT_PERIOD*5

static void fx2_load_init(void)
{
Expand Down
11 changes: 8 additions & 3 deletions firmware/lm32/processor.c
Expand Up @@ -267,7 +267,7 @@ static const struct video_timing video_modes[PROCESSOR_MODE_COUNT] = {
.v_sync_offset = 4,
.v_sync_width = 5
},
// 720x480 @ 60.00 Hz Modeline "720x480" 26.72 720 736 808 896 480 481 484 497 -HSync +Vsync
// 720x480 @ 60.00 Hz Modeline "720x480" 26.72 720 736 808 896 480 481 484 497 -HSync +Vsync
{
.pixel_clock = 2672,

Expand All @@ -279,7 +279,8 @@ static const struct video_timing video_modes[PROCESSOR_MODE_COUNT] = {
.v_active = 480,
.v_blanking = 17,
.v_sync_offset = 1,
.v_sync_width = 3
.v_sync_width = 3,
.comment = "(HV20/HV30 in NTSC mode)"
}
};

Expand All @@ -288,7 +289,11 @@ void processor_list_modes(char *mode_descriptors)
int i;
for(i=0;i<PROCESSOR_MODE_COUNT;i++) {
sprintf(&mode_descriptors[PROCESSOR_MODE_DESCLEN*i],
"%ux%u @%uHz", video_modes[i].h_active, video_modes[i].v_active, calculate_refresh_rate(&(video_modes[i])));
"%ux%u @%uHz %s",
video_modes[i].h_active,
video_modes[i].v_active,
calculate_refresh_rate(&(video_modes[i])),
video_modes[i].comment ? video_modes[i].comment : "");
}
}

Expand Down
2 changes: 1 addition & 1 deletion firmware/lm32/processor.h
Expand Up @@ -2,7 +2,7 @@
#define __PROCESSOR_H

#define PROCESSOR_MODE_COUNT 13
#define PROCESSOR_MODE_DESCLEN 32
#define PROCESSOR_MODE_DESCLEN 64

enum {
VIDEO_IN_HDMI_IN0=0,
Expand Down

0 comments on commit 0c9ce97

Please sign in to comment.