New device: Ouya (!80)

Ouya boots. Install instructions are being refined, but device does
boot through fastboot. Hoping to merge into master to encourage others
to contribute to the device.
This commit is contained in:
rendeko 2018-09-14 12:43:14 -07:00 committed by Oliver Smith
parent 7aded95988
commit 6e7c39bbe7
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 3761 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-ouya-ouya
pkgver=1
pkgdesc="Ouya"
pkgrel=5
url="https://postmarketos.org"
arch="armhf"
license="MIT"
options="!check !archcheck"
depends="postmarketos-base linux-ouya-ouya mkbootimg"
makedepends=""
install=""
subpackages=""
source="deviceinfo initfs-hook.sh fb.modes"
package() {
install -Dm644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
install -D -m644 "$srcdir/deviceinfo" \
"$pkgdir/etc/deviceinfo"
install -D -m644 "$srcdir"/fb.modes \
"$pkgdir/etc/fb.modes"
}
sha512sums="410596c22551c6927d18593e63ee7f3eda9074e31d4a53a8ffc8aad4fdc08fd552306fef3cfb9690f9764a764be3fe64f1146ab913f5df446390b80fa813501a deviceinfo
c7253d5d6f53b7acbb1c2358e95ecba86ccbaa2bb5e99ad8db9f59e453209ddad55b13d8c1dc67f634cc4f997283b4079fa1b5b60f6d1440b13f39e5b1646d81 initfs-hook.sh
bf442fac4dc0594e055ed7a7d8232b5c884e2e77543273e8c4f32b5fe3c199561c86d8a5f665e17406057ca7863fabb93e789fe5e168fcd89d2982e0046232ad fb.modes"

View file

@ -0,0 +1,30 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Ouya"
deviceinfo_manufacturer="Ouya"
deviceinfo_date=""
deviceinfo_keyboard="false"
deviceinfo_nonfree="????"
deviceinfo_dtb=""
deviceinfo_modules=""
deviceinfo_modules_initfs=""
deviceinfo_external_storage="false"
deviceinfo_flash_method="fastboot"
deviceinfo_arch="armhf"
# Splash screen
deviceinfo_screen_width="1920"
deviceinfo_screen_height="1080"
# Fastboot related
deviceinfo_kernel_cmdline=""
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,7 @@
mode "1920x1080-60"
# D: 148.500 MHz, H: 67.500 kHz, V: 60.000 Hz
geometry 1920 1080 1920 2160 16
timings 6734 148 88 36 4 44 5
accel false
rgba 8/0,8/8,8/16,8/24
endmode

View file

@ -0,0 +1,6 @@
#!/bin/sh
# fix display for xorg
echo 0 > /sys/class/graphics/fb0/blank
echo 16 > /sys/devices/tegradc.0/graphics/fb0/bits_per_pixel
echo 0 0 > /sys/class/graphics/fb0/pan

View file

@ -0,0 +1,70 @@
this fixes:
CC arch/arm/mach-tegra/common.o
/home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address sh
ould use unwind tables" [-Wcpp]
#warning "TODO: return_address should use unwind tables"
^~~~~~~
/home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/arch/arm/kernel/return_address.c:65:7: error: redefinition of 'return_address'
void *return_address(unsigned int level)
^~~~~~~~~~~~~~
In file included from /home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/include/linux/ftrace.h:20:0,
from /home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/arch/arm/kernel/return_address.c:12:
/home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/arch/arm/include/asm/ftrace.h:48:21: note: previous definition of 'return_address' was here
extern inline void *return_address(unsigned int level)
^~~~~~~~~~~~~~
make[3]: *** [/home/user/build/src/android_kernel_boxer8_ouya-aec3c7f7900554ede9cb34559416e3ee74d0bf36/scripts/Makefile.build:305: arch/arm/kernel/return_address.o] Error 1
original commit message:
---
From aeea3592a13bf12861943e44fc48f1f270941f8d Mon Sep 17 00:00:00 2001
From: Behan Webster <behanw@converseincode.com>
Date: Wed, 24 Sep 2014 01:06:46 +0100
Subject: [PATCH] ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/ftrace.h | 2 +-
arch/arm/kernel/return_address.c | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index 39eb16b0066f2..bfe2a2f5a644e 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -45,7 +45,7 @@ void *return_address(unsigned int);
#else
-extern inline void *return_address(unsigned int level)
+static inline void *return_address(unsigned int level)
{
return NULL;
}
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index fafedd86885dd..f6aa84d5b93c9 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
#warning "TODO: return_address should use unwind tables"
#endif
-void *return_address(unsigned int level)
-{
- return NULL;
-}
-
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
EXPORT_SYMBOL_GPL(return_address);

View file

@ -0,0 +1,45 @@
From 63a3f603413ffe82ad775f2d62a5afff87fd94a0 Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@linux.intel.com>
Date: Thu, 7 Feb 2013 17:14:08 -0800
Subject: [PATCH] timeconst.pl: Eliminate Perl warning
defined(@array) is deprecated in Perl and gives off a warning.
Restructure the code to remove that warning.
[ hpa: it would be interesting to revert to the timeconst.bc script.
It appears that the failures reported by akpm during testing of
that script was due to a known broken version of make, not a problem
with bc. The Makefile rules could probably be restructured to avoid
the make bug, or it is probably old enough that it doesn't matter. ]
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com>
---
Patch status: upstream
kernel/timeconst.pl | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76..3f42652 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -369,10 +369,8 @@ if ($hz eq '--can') {
die "Usage: $0 HZ\n";
}
- @val = @{$canned_values{$hz}};
- if (!defined(@val)) {
- @val = compute_values($hz);
- }
+ $cv = $canned_values{$hz};
+ @val = defined($cv) ? @$cv : compute_values($hz);
output($hz, @val);
}
exit 0;
--
2.4.10

View file

@ -0,0 +1,67 @@
# Kernel config based on: arch/arm/configs/cyanogenmod_ouya_defconfig
pkgname="linux-ouya-ouya"
pkgver=3.1.10
pkgrel=0
pkgdesc="Ouya kernel fork"
arch="armhf"
_carch="arm"
_flavor="ouya-ouya"
url="https://github.com/milaq/android_kernel_boxer8_ouya"
license="GPL2"
options="!strip !check !tracedeps"
makedepends="gcc6 perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev"
# Compiling with GCC6
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source
_repository="android_kernel_boxer8_ouya"
_commit="49f035e65e689f8c227bac7a6c4ecf89ad9158af"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/milaq/${_repository}/archive/${_commit}.tar.gz
$_config
compiler-gcc6.h
00_fix_return_address.patch""
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
}
sha512sums="7e29ed39c61693d85d344b6eb6180920431364124e8a261f28804585e7362ddbb3ad43c9610bed1ce83b1de7957261e450862081f53de98a5873b5a8aad1748e linux-ouya-ouya-49f035e65e689f8c227bac7a6c4ecf89ad9158af.tar.gz
3dcb8513b7eccb6a4f8fc3c5624d54e909ee0690cae07b2e5a6cda90671149529e147a6e1bb6f5cec05cb04175244943be20c9cf21b6adf8697acf04b11d6c8a config-ouya-ouya.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
6b7ecfd0939b920f263492484e8d60ff30c55614a750f5efd813a699729e65916e31b106e18bd6ea9858b37753403a6428f3a8d993c18b2459685aa29c1f2055 00_fix_return_address.patch"

View file

@ -0,0 +1,69 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

File diff suppressed because it is too large Load diff