Skip to content

Instantly share code, notes, and snippets.

@mithro
Created April 5, 2017 05:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mithro/7d646e791fa507ea06ae918d3b331f1f to your computer and use it in GitHub Desktop.
Save mithro/7d646e791fa507ea06ae918d3b331f1f to your computer and use it in GitHub Desktop.
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";
};
memory {
device_type = "memory";
reg = <0x40000000 268435456>;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "opencores,or1200-rtlsvn481";
reg = <0>;
clock-frequency = <83333333>;
};
};
/*
* OR1K PIC is built into CPU and accessed via special purpose
* registers. It is not addressable and, hence, has no 'reg'
* property.
*/
pic: pic {
compatible = "opencores,or1k-pic";
#interrupt-cells = <1>;
interrupt-controller;
};
serial0: serial@e0000800 {
compatible = "litex,uart";
reg = <0xe0000800 0x100>;
interrupts = <0>;
};
};
@mithro
Copy link
Author

mithro commented Apr 5, 2017

		compatible = "mtd-rom";
		reg = <0 0 0x00000000>;
		bank-width = <2>;
	};

	sram@10000000 {
		compatible = "mtd-ram";
		reg = <0 0 0x00000000>;
		bank-width = <2>;
	};

	flash: m25p80@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "spansion,m25p80", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <40000000>;
		m25p,fast-read;
	};

// Values in the partition table should be relative to the flash start address...
flash@??? {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		/* FPGA gateware */
		partition@0 {
			label = "gateware";
			reg = <0x0000000 0x80000>;
			read-only;
		};

		/* MiSoC / LiteX BIOS */
		partition@80000 {
			label = "bios";
			reg = <0x00080000 0x8000>;
			read-only;
		};

		/* HDMI2USB Firmware (or Linux Kernel?) */
		partition@88000 {
			label = "firmware";
			reg = <0x00088000 0x????>;
			read-only;
		};
	};
};

// Opsis EEPROM
eeprom@52 {
	compatible = "atmel,24c32";
	reg = <0x50>;
//	pagesize = <32>;
//	read-only;
};


i2c@0 {
	compatible = "i2c-gpio";
	gpios = <&pioA 23 0 /* sda */
		 &pioA 24 0 /* scl */
		>;
	i2c-gpio,sda-open-drain;
	i2c-gpio,scl-open-drain;
	i2c-gpio,delay-us = <2>;	/* ~100 kHz */
	#address-cells = <1>;
	#size-cells = <0>;
	rv3029c2@56 {
		compatible = "rv3029c2";
		reg = <0x56>;
	};
};


// http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/net/mdio-gpio.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment