Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ "`whoami`" = "root" ]
then
echo "Running the script as root is not permitted"
exit 1
fi
CALLED=$_
[[ "${BASH_SOURCE[0]}" != "${0}" ]] && SOURCED=1 || SOURCED=0
# hdmi_ignore_edid Enables the ignoring of EDID/display data if your display doesn't have an accurate EDID.
hdmi_ignore_edid=0xa5000080
# hdmi_ignore_edid_audio Pretends all audio formats are unsupported by display. This means ALSA will default to analogue.
hdmi_ignore_edid_audio=1
sudo dnf install fxload
sudo dnf install libftdi-devel
ln -s /lib64/libftdi1.so build/conda/lib/libftdi.so.1
# zsh compatability for scripts/enter-env.sh
## realpath: missing operand
## Try 'realpath --help' for more information.
## dirname: missing operand
## Try 'dirname --help' for more information.
## Please install the HDMI2USB udev rules.
@mithro
mithro / digilent_arty.cfg
Created October 15, 2017 10:57
Digilent Arty config for OpenOCD.
#
# Digilent Arty with Xilinx Artix-7 FPGA
#
# http://store.digilentinc.com/arty-artix-7-fpga-development-board-for-makers-and-hobbyists/
#
# iManufacturer 1 Digilent
# iProduct 2 Digilent USB Device
# iSerial 3 210319A28C7F
@mithro
mithro / merge-migen+misoc.sh
Last active May 17, 2018 04:25
Prepare an upstream migen/misoc for merging into litex
#! /bin/bash
set -x
set -e
function git_commit {
git commit -a -m"litex import: $1"
}
mkdir -p repos
@mithro
mithro / README.md
Last active October 5, 2017 10:48
MimasV2 mor1kx tuning patches

Patches for the configs used to look at the resource usage.

  • Base mor1kx - v5.0
  • Base HDMI2USB-litex-firmware rev - or1k-fixing
  • 9949934e2804238be9ccda9e17e60e34c233cfab - git+ssh://[email protected]/mithro/HDMI2USB-litex-firmware.git
  • Base LiteX rev - or1k-mimasv2
  • 1b7fa415b6c51faf1f616bbc36f06679e5fb6568 - git+ssh://github.com/mithro/litex.git
@mithro
mithro / symposium-review-extra.js
Last active August 2, 2018 10:57
GreaseMonkey / TamperMonkey script to make Linux.conf.au (Symposium) reviews a bit nicer
// ==UserScript==
// @name symposium-review-extra
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Show all the tabs in the review pane at once.
// @author You
// @match https://rego.linux.conf.au/reviews/review/.*
// @match https://rego.linux.conf.au/reviews/review/*
// @downloadURL https://gist.github.com/mithro/e60a3f8b62696d1cff12dbb7e1377c47.js
// @updateURL https://gist.github.com/mithro/e60a3f8b62696d1cff12dbb7e1377c47.js
@mithro
mithro / or1k-j-ops.c
Last active April 11, 2017 03:07
Code for dynamically patching or1k l.j functions....
/*
* l.j instruction is opcode 0 and does a
* PC ← exts(Immediate << 2) + JumpInsnAddr
*/
// Top 6 bits is the op code
#define OPENRISC_OPCODE_MASK 0xfc000000 // Top 6 bits
#define OPENRISC_OPCODE_J 0x0 << 26
#define OPENRISC_OPCODE_BNF 0x3 << 26
#define OPENRISC_OPCODE_BF 0x4 << 26
@mithro
mithro / or1klitex-opsis.dts
Created April 5, 2017 05:45
Linux DeviceTree Stub for Litex with mor1k running on Numato Opsis
/dts-v1/;
/ {
compatible = "opencores,or1ksim";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&pic>;
chosen {
bootargs = "console=uart,mmio,0x90000000,115200";
};
@mithro
mithro / check_csrs.py
Created January 12, 2017 02:14
Hacky script to check the csrs don't violate constraints in litex
#!/usr/bin/env python3
import sys
import csv
import pprint
print(sys.argv[1])
data = list(csv.reader(open(sys.argv[1],'r')))
bases = [x for x in data if x[0] == 'csr_base']