Skip to content

Instantly share code, notes, and snippets.

View digetx's full-sized avatar

Dmitry Osipenko digetx

View GitHub Profile
@digetx
digetx / gist:dbd46109503b1a91941a
Last active July 20, 2016 17:00
ARM MPtimer tests
#ifdef __KERNEL__
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#define abort() {pr_err("%s: %d\n", __func__, __LINE__); errored = 1; return;}
#define assert(a) if (!(a)) abort()
#define msleep(d) mdelay(d)
#define sleep(d) mdelay((d) * 1000)
@digetx
digetx / bug.c
Last active September 26, 2016 12:40
BUG: Bad page state in process
/*
* gcc bug.c -I/usr/include/libdrm -ldrm
*
*/
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
/* Vertex constants */
.constants
/* Linker disassembly */
/* Fragment disassembly */
pseq_to_dw_exec_nb = 1
alu_buffer_size = 1
.constants
@digetx
digetx / gist:99d62b96823bdfe2dc49dfbd372a65e6
Last active May 30, 2018 12:05
Grate-driver compilation instructions
General rules:
----------------------
1. Use the master branches.
2. Install autotools and gcc.
3. Compile and install libdrm first.
4. Use the most recent mainline linux kernel or at least the most recent stable.
5. Update all libdrm / opentegra / mesa at once as there could be interdependencies, start from libdrm.
libdrm:
----------
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 590b1cf1a8c4..9fb2835e8977 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -116,6 +116,10 @@ static void __init tegra_dt_init_late(void)
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
of_machine_is_compatible("nvidia,tegra20"))
platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
+
+ if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) &&
@digetx
digetx / tegra20-qemu.dts
Last active October 8, 2018 16:37
QEMU Tegra2 DTS
/dts-v1/;
#include <dt-bindings/input/input.h>
#include "tegra20.dtsi"
/ {
model = "QEMU";
compatible = "qemu", "nvidia,tegra20";
memory {
From ffea1cc88d7480d0cd4e1ead196ff53555ccc5a4 Mon Sep 17 00:00:00 2001
From: Dmitry Osipenko <digetx@gmail.com>
Date: Thu, 4 Oct 2018 16:46:38 +0300
Subject: [PATCH] ramconsole
---
drivers/staging/android/Kconfig | 2 +
drivers/staging/android/Makefile | 2 +
drivers/staging/android/ramconsole/Kconfig | 63 +++
drivers/staging/android/ramconsole/Makefile | 1 +
/dts-v1/;
/memreserve/ 0xbeb00000 0x100000;
#include "tegra30.dtsi"
/ {
compatible = "asus,tilapia", "nvidia,tegra30";
model = "ASUS Google Nexus 7 2012 (Project Bach)";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <openssl/sha.h>
#include <stdbool.h>
#include <stdint-gcc.h>
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 5.6.0-rc6 Kernel Configuration
#
#
# Compiler: armv7a-hardfloat-linux-gnueabi-gcc (Gentoo 9.2.0-r4 p5) 9.2.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90200