Compare commits

...

42 commits

Author SHA1 Message Date
build@apk-groulx
c748d8e3f6 rm: attempt fix 2023-04-23 06:35:19 +00:00
build@apk-groulx
0d9940d604 remove x86_64 2023-04-23 06:25:54 +00:00
build@apk-groulx
4bb00234ef Strip modules 2023-04-23 06:16:01 +00:00
build@apk-groulx
118cd9107d lint 2023-04-23 06:01:09 +00:00
build@apk-groulx
cc3bed22ed Remove empty var 2023-04-23 05:59:07 +00:00
build@apk-groulx
3dd87fcdf5 Target x86_64 2023-04-23 05:58:30 +00:00
build@apk-groulx
0e6910f187 Depend on linux-rm-dev 2023-04-23 05:58:30 +00:00
build@apk-groulx
3b1f4b081e Depend on linux-rm-dev 2023-04-23 05:58:30 +00:00
b7deea6edb
lint 2023-04-23 01:58:20 -04:00
2799122f8e
Remove dev 2023-04-23 01:58:17 -04:00
build@apk-groulx
f18d763dc7 Missing 2023-04-23 05:54:25 +00:00
ca9859445f
remove lzop workaround 2023-04-23 01:46:28 -04:00
6bdc332ed9
set KZLOP 2023-04-23 01:45:45 -04:00
ce186ef534
Force REPODEST 2023-04-22 21:28:25 -04:00
b5d80396fb
lzop workaround 2023-04-22 21:14:59 -04:00
f942d3e29c
rm-utils: only for arm 2023-04-22 21:11:11 -04:00
bfb0dc3913
rm-utils: new aport 2023-04-22 21:10:37 -04:00
build@apk-groulx
cc548863e2 uboot: refactor for future build of rm2 2023-04-23 01:02:50 +00:00
90a0138caf
Try adding pissing depends 2023-04-22 17:24:12 -04:00
build@apk-groulx
84c8b14b59 ci: fix 2023-04-22 19:06:28 +00:00
build@apk-groulx
d714d8e02d ci: other fix 2023-04-22 19:03:14 +00:00
build@apk-groulx
fdc715ba30 ci: other fix 2023-04-22 19:00:45 +00:00
build@apk-groulx
2d6370f643 ci: attempt chost fix 2023-04-22 18:41:56 +00:00
build@apk-groulx
352605c7fe Test 2023-04-22 18:40:25 +00:00
build@apk-groulx
243daf359f ci: test 2023-04-22 18:37:07 +00:00
build@apk-groulx
c51ae02398 ci: typo 2023-04-22 18:35:13 +00:00
build@apk-groulx
52e80f7444 ci: more fixes 2023-04-22 18:33:56 +00:00
build@apk-groulx
2e8ed5b72c ci: add missing vars 2023-04-22 18:31:11 +00:00
build@apk-groulx
05dc26badb ci: fix cross when 2023-04-22 18:29:33 +00:00
build@apk-groulx
53e2a5bc42 ci: fix attempt 2023-04-22 18:27:50 +00:00
build@apk-groulx
9936248dbc gitlab-ci: cross-build to armv7 2023-04-22 18:26:04 +00:00
build@apk-groulx
07085b7e29 Refactor to match linux-rpi 2023-04-22 18:14:59 +00:00
build@apk-groulx
bea9886d19 Cleanup 2023-04-22 06:56:08 +00:00
build@apk-groulx
fe9075d246 Remove big rm kernel 2023-04-22 06:55:56 +00:00
build@apk-groulx
e73ebf3c3f Break apart subpackages 2023-04-22 06:53:14 +00:00
build@apk-groulx
f2c7730310 Refactor to fix dev 2023-04-22 05:19:45 +00:00
build@apk-groulx
440ac8345f brcmfmac now integrated in kernel rather than module 2023-04-22 02:16:22 +00:00
build@apk-groulx
5fca53a252 Fix u-boot build 2023-04-21 04:33:13 +00:00
build@apk-groulx
2e6c2c605c Fix linux kernel 2023-04-21 04:32:56 +00:00
3398a1ad5c
uboot name change 2023-04-19 19:16:55 -04:00
15da6ccbbb
user/linux-rm: new aport 2023-04-19 19:16:54 -04:00
a663d239e4
user/u-boot-rm: new aport 2023-04-19 19:16:53 -04:00
22 changed files with 2719 additions and 5 deletions

View file

@ -21,7 +21,7 @@ lint:
tags:
- apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
build:
.build:
stage: build
interruptible: true
script:
@ -42,12 +42,41 @@ build:
tags:
- apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
.cross:
stage: build
interruptible: true
script:
- |
sudo apk add alpine-sdk lua-aports doas gzip xz qemu-$CI_QEMU_TARGET_ARCH
doas addgroup $USER abuild
export PATH="$PATH:$CI_PROJECT_DIR/.gitlab/bin"
build-rootfs.sh alpine$CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_ALPINE_TARGET_ARCH --rootfsdir $HOME/sysroot-$CI_ALPINE_TARGET_ARCH
cp /etc/apk/repositories $HOME/sysroot-$CI_ALPINE_TARGET_ARCH/etc/apk/.
sudo -Eu $USER CHOST=$CI_TARGET_ALPINE_ARCH build.sh
artifacts:
paths:
- packages/
- keys/
- logs/
expire_in: 7 days
when: always
only:
- merge_requests
tags:
- apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
build-x86_64:
extends: .build
build-armv7:
extends: .cross
variables:
CI_ALPINE_TARGET_ARCH: armv7
CI_QEMU_TARGET_ARCH: arm
push:
interruptible: true
stage: deploy
needs:
- job: build
artifacts: true
script:
- |
sudo apk add abuild git-lfs

605
.gitlab/bin/build-rootfs.sh Executable file
View file

@ -0,0 +1,605 @@
#!/usr/bin/env bash
# Availabl here: https://lab.ilot.io/dotnet/arcade/-/blob/7f6d9796cc7f594772f798358dbdd8c69b6a97af/eng/common/cross/build-rootfs.sh
# Only modification: qemu-$arch-static becomes qemu-$arch
set -e
usage()
{
echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir <directory>]"
echo "BuildArch can be: arm(default), arm64, armel, armv6, ppc64le, riscv64, s390x, x64, x86"
echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine"
echo " for alpine can be specified with version: alpineX.YY or alpineedge"
echo " for FreeBSD can be: freebsd12, freebsd13"
echo " for illumos can be: illumos"
echo " for Haiku can be: haiku."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FreeBSD"
echo "llvmx[.y] - optional, LLVM version for LLVM related packages."
echo "--skipunmount - optional, will skip the unmount of rootfs folder."
echo "--use-mirror - optional, use mirror URL to fetch resources, when available."
echo "--jobs N - optional, restrict to N jobs."
exit 1
}
__CodeName=xenial
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__BuildArch=arm
__AlpineArch=armv7
__FreeBSDArch=arm
__FreeBSDMachineArch=armv7
__IllumosArch=arm7
__QEMUArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
# base development support
__UbuntuPackages="build-essential"
__AlpinePackages="alpine-base"
__AlpinePackages+=" build-base"
__AlpinePackages+=" linux-headers"
__AlpinePackages+=" python3"
__AlpinePackages+=" libedit"
# symlinks fixer
__UbuntuPackages+=" symlinks"
# runtime dependencies
__UbuntuPackages+=" libicu-dev"
__UbuntuPackages+=" liblttng-ust-dev"
__UbuntuPackages+=" libunwind8-dev"
__UbuntuPackages+=" libnuma-dev"
__AlpinePackages+=" gettext-dev"
__AlpinePackages+=" icu-dev"
__AlpinePackages+=" libunwind-dev"
__AlpinePackages+=" lttng-ust-dev"
__AlpinePackages+=" compiler-rt"
__AlpinePackages+=" numactl-dev"
# runtime libraries' dependencies
__UbuntuPackages+=" libcurl4-openssl-dev"
__UbuntuPackages+=" libkrb5-dev"
__UbuntuPackages+=" libssl-dev"
__UbuntuPackages+=" zlib1g-dev"
__AlpinePackages+=" curl-dev"
__AlpinePackages+=" krb5-dev"
__AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"
__FreeBSDBase="12.3-RELEASE"
__FreeBSDPkg="1.17.0"
__FreeBSDABI="12"
__FreeBSDPackages="libunwind"
__FreeBSDPackages+=" icu"
__FreeBSDPackages+=" libinotify"
__FreeBSDPackages+=" openssl"
__FreeBSDPackages+=" krb5"
__FreeBSDPackages+=" terminfo-db"
__IllumosPackages="icu"
__IllumosPackages+=" mit-krb5"
__IllumosPackages+=" openssl"
__IllumosPackages+=" zlib"
__HaikuPackages="gmp"
__HaikuPackages+=" gmp_devel"
__HaikuPackages+=" krb5"
__HaikuPackages+=" krb5_devel"
__HaikuPackages+=" libiconv"
__HaikuPackages+=" libiconv_devel"
__HaikuPackages+=" llvm12_libunwind"
__HaikuPackages+=" llvm12_libunwind_devel"
__HaikuPackages+=" mpfr"
__HaikuPackages+=" mpfr_devel"
# ML.NET dependencies
__UbuntuPackages+=" libomp5"
__UbuntuPackages+=" libomp-dev"
__Keyring=
__UseMirror=0
__UnprocessedBuildArgs=
while :; do
if [[ "$#" -le 0 ]]; then
break
fi
lowerI="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
case $lowerI in
-\?|-h|--help)
usage
exit 1
;;
arm)
__BuildArch=arm
__UbuntuArch=armhf
__AlpineArch=armv7
__QEMUArch=arm
;;
arm64)
__BuildArch=arm64
__UbuntuArch=arm64
__AlpineArch=aarch64
__QEMUArch=aarch64
__FreeBSDArch=arm64
__FreeBSDMachineArch=aarch64
;;
armel)
__BuildArch=armel
__UbuntuArch=armel
__UbuntuRepo="http://ftp.debian.org/debian/"
__CodeName=jessie
;;
armv6)
__BuildArch=armv6
__UbuntuArch=armhf
__QEMUArch=arm
__UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/"
__CodeName=buster
__LLDB_Package="liblldb-6.0-dev"
if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then
__Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg"
fi
;;
riscv64)
__BuildArch=riscv64
__AlpineArch=riscv64
__AlpinePackages="${__AlpinePackages// lldb-dev/}"
__QEMUArch=riscv64
__UbuntuArch=riscv64
__UbuntuRepo="http://deb.debian.org/debian-ports"
__UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}"
unset __LLDB_Package
if [[ -e "/usr/share/keyrings/debian-ports-archive-keyring.gpg" ]]; then
__Keyring="--keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --include=debian-ports-archive-keyring"
fi
;;
ppc64le)
__BuildArch=ppc64le
__AlpineArch=ppc64le
__QEMUArch=ppc64le
__UbuntuArch=ppc64el
__UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/"
__UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}"
__UbuntuPackages="${__UbuntuPackages// libomp-dev/}"
__UbuntuPackages="${__UbuntuPackages// libomp5/}"
unset __LLDB_Package
;;
s390x)
__BuildArch=s390x
__AlpineArch=s390x
__QEMUArch=s390x
__UbuntuArch=s390x
__UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/"
__UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}"
__UbuntuPackages="${__UbuntuPackages// libomp-dev/}"
__UbuntuPackages="${__UbuntuPackages// libomp5/}"
unset __LLDB_Package
;;
x64)
__BuildArch=x64
__AlpineArch=x86_64
__QEMUArch=x86_64
__UbuntuArch=amd64
__FreeBSDArch=amd64
__FreeBSDMachineArch=amd64
__illumosArch=x86_64
__UbuntuRepo=
;;
x86)
__BuildArch=x86
__AlpineArch=i386
__QEMUArch=i386
__UbuntuArch=i386
__AlpineArch=x86
__UbuntuRepo="http://archive.ubuntu.com/ubuntu/"
;;
lldb*)
version="${lowerI/lldb/}"
parts=(${version//./ })
# for versions > 6.0, lldb has dropped the minor version
if [[ "${parts[0]}" -gt 6 ]]; then
version="${parts[0]}"
fi
__LLDB_Package="liblldb-${version}-dev"
;;
no-lldb)
unset __LLDB_Package
;;
llvm*)
version="${lowerI/llvm/}"
parts=(${version//./ })
__LLVM_MajorVersion="${parts[0]}"
__LLVM_MinorVersion="${parts[1]}"
# for versions > 6.0, llvm has dropped the minor version
if [[ -z "$__LLVM_MinorVersion" && "$__LLVM_MajorVersion" -le 6 ]]; then
__LLVM_MinorVersion=0;
fi
;;
xenial) # Ubuntu 16.04
if [[ "$__CodeName" != "jessie" ]]; then
__CodeName=xenial
fi
;;
zesty) # Ubuntu 17.04
if [[ "$__CodeName" != "jessie" ]]; then
__CodeName=zesty
fi
;;
bionic) # Ubuntu 18.04
if [[ "$__CodeName" != "jessie" ]]; then
__CodeName=bionic
fi
;;
focal) # Ubuntu 20.04
if [[ "$__CodeName" != "jessie" ]]; then
__CodeName=focal
fi
;;
jammy) # Ubuntu 22.04
if [[ "$__CodeName" != "jessie" ]]; then
__CodeName=jammy
fi
;;
jessie) # Debian 8
__CodeName=jessie
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
fi
;;
stretch) # Debian 9
__CodeName=stretch
__LLDB_Package="liblldb-6.0-dev"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
fi
;;
buster) # Debian 10
__CodeName=buster
__LLDB_Package="liblldb-6.0-dev"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
fi
;;
bullseye) # Debian 11
__CodeName=bullseye
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
fi
;;
sid) # Debian sid
__CodeName=sid
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
fi
;;
tizen)
__CodeName=
__UbuntuRepo=
__Tizen=tizen
;;
alpine*)
__CodeName=alpine
__UbuntuRepo=
version="${lowerI/alpine/}"
if [[ "$version" == "edge" ]]; then
__AlpineVersion=edge
else
parts=(${version//./ })
__AlpineMajorVersion="${parts[0]}"
__AlpineMinoVersion="${parts[1]}"
__AlpineVersion="$__AlpineMajorVersion.$__AlpineMinoVersion"
fi
;;
freebsd12)
__CodeName=freebsd
__SkipUnmount=1
;;
freebsd13)
__CodeName=freebsd
__FreeBSDBase="13.0-RELEASE"
__FreeBSDABI="13"
__SkipUnmount=1
;;
illumos)
__CodeName=illumos
__SkipUnmount=1
;;
haiku)
__CodeName=haiku
__BuildArch=x64
__SkipUnmount=1
;;
--skipunmount)
__SkipUnmount=1
;;
--rootfsdir|-rootfsdir)
shift
__RootfsDir="$1"
;;
--use-mirror)
__UseMirror=1
;;
--use-jobs)
shift
MAXJOBS=$1
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;;
esac
shift
done
case "$__AlpineVersion" in
3.14) __AlpinePackages+=" llvm11-libs" ;;
3.15) __AlpinePackages+=" llvm12-libs" ;;
3.16) __AlpinePackages+=" llvm13-libs" ;;
3.17) __AlpinePackages+=" llvm15-libs" ;;
edge) __AlpineLlvmLibsLookup=1 ;;
*)
if [[ "$__AlpineArch" =~ s390x|ppc64le ]]; then
echo boo
__AlpineVersion=3.15 # minimum version that supports lldb-dev
__AlpinePackages+=" llvm12-libs"
elif [[ "$__AlpineArch" == "x86" ]]; then
__AlpineVersion=3.17 # minimum version that supports lldb-dev
__AlpinePackages+=" llvm15-libs"
elif [[ "$__AlpineArch" == "riscv64" ]]; then
__AlpineLlvmLibsLookup=1
__AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive)
else
__AlpineVersion=3.13 # 3.13 to maximize compatibility
__AlpinePackages+=" llvm10-libs"
if [[ "$__AlpineArch" == "armv7" ]]; then
__AlpinePackages="${__AlpinePackages//numactl-dev/}"
fi
fi
esac
if [[ "$__AlpineVersion" =~ 3\.1[345] ]]; then
# compiler-rt--static was merged in compiler-rt package in alpine 3.16
# for older versions, we need compiler-rt--static, so replace the name
__AlpinePackages="${__AlpinePackages/compiler-rt/compiler-rt-static}"
fi
if [[ "$__BuildArch" == "armel" ]]; then
__LLDB_Package="lldb-3.5-dev"
fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
if [[ -n "$__LLVM_MajorVersion" ]]; then
__UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev"
fi
if [[ -z "$__RootfsDir" && -n "$ROOTFS_DIR" ]]; then
__RootfsDir="$ROOTFS_DIR"
fi
if [[ -z "$__RootfsDir" ]]; then
__RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch"
fi
if [[ -d "$__RootfsDir" ]]; then
if [[ "$__SkipUnmount" == "0" ]]; then
umount "$__RootfsDir"/* || true
fi
rm -rf "$__RootfsDir"
fi
mkdir -p "$__RootfsDir"
__RootfsDir="$( cd "$__RootfsDir" && pwd )"
if [[ "$__CodeName" == "alpine" ]]; then
__ApkToolsVersion=2.12.11
__ApkToolsDir="$(mktemp -d)"
wget "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic//v$__ApkToolsVersion/x86_64/apk.static" -P "$__ApkToolsDir"
chmod +x "$__ApkToolsDir/apk.static"
mkdir -p "$__RootfsDir"/usr/bin
cp -v "/usr/bin/qemu-$__QEMUArch" "$__RootfsDir/usr/bin"
if [[ "$__AlpineVersion" == "edge" ]]; then
version=edge
else
version="v$__AlpineVersion"
fi
# initialize DB
"$__ApkToolsDir/apk.static" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \
-U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" --initdb add
if [[ "$__AlpineLlvmLibsLookup" == 1 ]]; then
__AlpinePackages+=" $("$__ApkToolsDir/apk.static" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \
-U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" \
search 'llvm*-libs' | sort | tail -1 | sed 's/-[^-]*//2g')"
fi
# install all packages in one go
"$__ApkToolsDir/apk.static" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \
-X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \
-U --allow-untrusted --no-scripts --root "$__RootfsDir" --arch "$__AlpineArch" \
add $__AlpinePackages
rm -r "$__ApkToolsDir"
elif [[ "$__CodeName" == "freebsd" ]]; then
mkdir -p "$__RootfsDir"/usr/local/etc
JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"}
wget -O - "https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz" | tar -C "$__RootfsDir" -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > "${__RootfsDir}"/usr/local/etc/pkg.conf
echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf
mkdir -p "$__RootfsDir"/tmp
# get and build package manager
wget -O - "https://github.com/freebsd/pkg/archive/${__FreeBSDPkg}.tar.gz" | tar -C "$__RootfsDir"/tmp -zxf -
cd "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}"
# needed for install to succeed
mkdir -p "$__RootfsDir"/host/etc
./autogen.sh && ./configure --prefix="$__RootfsDir"/host && make -j "$JOBS" && make install
rm -rf "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}"
# install packages we need.
INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update
INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages
elif [[ "$__CodeName" == "illumos" ]]; then
mkdir "$__RootfsDir/tmp"
pushd "$__RootfsDir/tmp"
JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"}
echo "Downloading sysroot."
wget -O - https://github.com/illumos/sysroot/releases/download/20181213-de6af22ae73b-v1/illumos-sysroot-i386-20181213-de6af22ae73b-v1.tar.gz | tar -C "$__RootfsDir" -xzf -
echo "Building binutils. Please wait.."
wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
mkdir build-binutils && cd build-binutils
../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir"
make -j "$JOBS" && make install && cd ..
echo "Building gcc. Please wait.."
wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
CFLAGS="-fPIC"
CXXFLAGS="-fPIC"
CXXFLAGS_FOR_TARGET="-fPIC"
CFLAGS_FOR_TARGET="-fPIC"
export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
mkdir build-gcc && cd build-gcc
../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \
--with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \
--disable-libquadmath-support --disable-shared --enable-tls
make -j "$JOBS" && make install && cd ..
BaseUrl=https://pkgsrc.smartos.org
if [[ "$__UseMirror" == 1 ]]; then
BaseUrl=https://pkgsrc.smartos.skylime.net
fi
BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All"
echo "Downloading manifest"
wget "$BaseUrl"
echo "Downloading dependencies."
read -ra array <<<"$__IllumosPackages"
for package in "${array[@]}"; do
echo "Installing '$package'"
# find last occurrence of package in listing and extract its name
package="$(sed -En '/.*href="('"$package"'-[0-9].*).tgz".*/h;$!d;g;s//\1/p' All)"
echo "Resolved name '$package'"
wget "$BaseUrl"/"$package".tgz
ar -x "$package".tgz
tar --skip-old-files -xzf "$package".tmp.tg* -C "$__RootfsDir" 2>/dev/null
done
echo "Cleaning up temporary files."
popd
rm -rf "$__RootfsDir"/{tmp,+*}
mkdir -p "$__RootfsDir"/usr/include/net
mkdir -p "$__RootfsDir"/usr/include/netpacket
wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/bpf.h
wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/dlt.h
wget -P "$__RootfsDir"/usr/include/netpacket https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/inet/sockmods/netpacket/packet.h
wget -P "$__RootfsDir"/usr/include/sys https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/sys/sdt.h
elif [[ "$__CodeName" == "haiku" ]]; then
JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"}
echo "Building Haiku sysroot for x86_64"
mkdir -p "$__RootfsDir/tmp"
cd "$__RootfsDir/tmp"
git clone -b hrev56235 https://review.haiku-os.org/haiku
git clone -b btrev43195 https://review.haiku-os.org/buildtools
cd "$__RootfsDir/tmp/buildtools" && git checkout 7487388f5110021d400b9f3b88e1a7f310dc066d
# Fetch some unmerged patches
cd "$__RootfsDir/tmp/haiku"
## Add development build profile (slimmer than nightly)
git fetch origin refs/changes/64/4164/1 && git -c commit.gpgsign=false cherry-pick FETCH_HEAD
# Build jam
cd "$__RootfsDir/tmp/buildtools/jam"
make
# Configure cross tools
echo "Building cross-compiler"
mkdir -p "$__RootfsDir/generated"
cd "$__RootfsDir/generated"
"$__RootfsDir/tmp/haiku/configure" -j"$JOBS" --sysroot "$__RootfsDir" --cross-tools-source "$__RootfsDir/tmp/buildtools" --build-cross-tools x86_64
# Build Haiku packages
echo "Building Haiku"
echo 'HAIKU_BUILD_PROFILE = "development-raw" ;' > UserProfileConfig
"$__RootfsDir/tmp/buildtools/jam/jam0" -j"$JOBS" -q '<build>package' '<repository>Haiku'
BaseUrl="https://depot.haiku-os.org/__api/v2/pkg/get-pkg"
# Download additional packages
echo "Downloading additional required packages"
read -ra array <<<"$__HaikuPackages"
for package in "${array[@]}"; do
echo "Downloading $package..."
# API documented here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L60
# The schema here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L598
hpkgDownloadUrl="$(wget -qO- --post-data='{"name":"'"$package"'","repositorySourceCode":"haikuports_x86_64","versionType":"LATEST","naturalLanguageCode":"en"}' \
--header='Content-Type:application/json' "$BaseUrl" | jq -r '.result.versions[].hpkgDownloadURL')"
wget -P "$__RootfsDir/generated/download" "$hpkgDownloadUrl"
done
# Setup the sysroot
echo "Setting up sysroot and extracting needed packages"
mkdir -p "$__RootfsDir/boot/system"
for file in "$__RootfsDir/generated/objects/haiku/x86_64/packaging/packages/"*.hpkg; do
"$__RootfsDir/generated/objects/linux/x86_64/release/tools/package/package" extract -C "$__RootfsDir/boot/system" "$file"
done
for file in "$__RootfsDir/generated/download/"*.hpkg; do
"$__RootfsDir/generated/objects/linux/x86_64/release/tools/package/package" extract -C "$__RootfsDir/boot/system" "$file"
done
# Cleaning up temporary files
echo "Cleaning up temporary files"
rm -rf "$__RootfsDir/tmp"
for name in "$__RootfsDir/generated/"*; do
if [[ "$name" =~ "cross-tools-" ]]; then
: # Keep the cross-compiler
else
rm -rf "$name"
fi
done
elif [[ -n "$__CodeName" ]]; then
qemu-debootstrap $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"
cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list"
chroot "$__RootfsDir" apt-get update
chroot "$__RootfsDir" apt-get -f -y install
chroot "$__RootfsDir" apt-get -y install $__UbuntuPackages
chroot "$__RootfsDir" symlinks -cr /usr
chroot "$__RootfsDir" apt-get clean
if [[ "$__SkipUnmount" == "0" ]]; then
umount "$__RootfsDir"/* || true
fi
if [[ "$__BuildArch" == "armel" && "$__CodeName" == "jessie" ]]; then
pushd "$__RootfsDir"
patch -p1 < "$__CrossDir/$__BuildArch/armel.jessie.patch"
popd
fi
elif [[ "$__Tizen" == "tizen" ]]; then
ROOTFS_DIR="$__RootfsDir" "$__CrossDir/tizen-build-rootfs.sh" "$__BuildArch"
else
echo "Unsupported target platform."
usage;
exit 1
fi

View file

@ -7,7 +7,7 @@
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
readonly REPOS="backports user"
readonly REPOS="cross backports user"
readonly ALPINE_REPOS="main community testing"
readonly ARCH=$(apk --print-arch)
# gitlab variables
@ -21,6 +21,7 @@ readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
: "${CI_ALPINE_BUILD_OFFSET:=0}"
: "${CI_ALPINE_BUILD_LIMIT:=9999}"
: "${CI_ALPINE_TARGET_ARCH:=$(uname -m)}"
msg() {
local color=${2:-green}
@ -79,6 +80,7 @@ get_release() {
build_aport() {
local repo="$1" aport="$2"
cd "$APORTSDIR/$repo/$aport"
export CHOST=$CI_ALPINE_TARGET_ARCH
if abuild -r 2>&1 | report "build-$aport"; then
checkapk | report "checkapk-$aport" || true
aport_ok="$aport_ok $repo/$aport"
@ -90,6 +92,7 @@ build_aport() {
check_aport() {
local repo="$1" aport="$2"
cd "$APORTSDIR/$repo/$aport"
export CHOST=$CI_ALPINE_TARGET_ARCH
if ! abuild check_arch 2>/dev/null; then
aport_na="$aport_na $repo/$aport"
return 1
@ -133,6 +136,7 @@ setup_system() {
chmod 700 $HOME/.abuild/$ABUILD_KEY_NAME.rsa
echo "PACKAGER_PRIVKEY=$HOME/.abuild/$ABUILD_KEY_NAME.rsa" >> $HOME/.abuild/abuild.conf
doas cp $HOME/.abuild/$ABUILD_KEY_NAME.rsa.pub /etc/apk/keys/$ABUILD_KEY_NAME.rsa.pub
echo "REPODEST=$HOME/packages" >> $HOME/.abuild/abuild.conf
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf
( . /etc/abuild.conf && echo "Building with $JOBS jobs" )
@ -238,6 +242,7 @@ section_start artifacts "Handeling artifacts" collapse
copy_artifacts || true
section_end artifacts
section_start summary "Build summary"
echo "### Build summary ###"

Binary file not shown.

262
user/linux-rm/APKBUILD Normal file
View file

@ -0,0 +1,262 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
pkgname=linux-rm
pkgver=5.4.70
_rmver=1.3.3
pkgrel=0
pkgdesc="Linux kernel with reMarkable patches"
url=https://github.com/reMarkable/linux
depends="initramfs-generator linux-firmware-brcm linux-firmware-cypress"
_depends_dev="perl gmp-dev elfutils-dev bash mpc1-dev mpfr-dev"
makedepends="$_depends_dev sed installkernel bc linux-headers linux-firmware mawk
bison flex openssl-dev>3 diffutils pahole findutils xz lzop gcc$_cross
"
options="!strip !check"
builddir="$srcdir"/linux-RM1XX_${pkgver}_v$_rmver
source="
https://github.com/reMarkable/linux/archive/refs/tags/RM1XX_${pkgver}_v$_rmver.tar.gz
enable-automatic-partial-refreshing.patch
enable-sdhc1.patch
config-changes-rm.armv7
config-changes-rm.armhf
config-changes-rm2.armv7
config-changes-rm2.armhf
"
arch="armv7 armhf"
license="GPL-2.0"
for _i in $source; do
case $_i in
config-*.$CARCH)
_f=${_i%."$CARCH"}
_f=${_f#config-changes-}
_flavors="$_flavors $_f"
[ "linux-$_f" != "$pkgname" ] && subpackages="$subpackages linux-$_f::$CBUILD_ARCH"
subpackages="$subpackages linux-$_f-dev:_dev:$CBUILD_ARCH"
;;
esac
done
_carch=$CARCH
case "$CARCH" in
aarch64) _carch="arm64" ;;
arm*) _carch="arm" ;;
esac
# generate config from defconfig and apply local changes.
# config-changes-$flavor.$CARCH holds a list of = delimited
# config command and values used by kernel scripts/config script.
_genconfig() {
local flavor=$1 defconfig=
local subbuilddir="$srcdir"/build-$flavor
local defconfig=
case $flavor in
rm) defconfig=zero-gravitas_defconfig ;;
rm2) defconfig=zero-sugar_defconfig ;;
*) die "Unknown flavor: $flavor" ;;
esac
cp "$builddir"/arch/$_carch/configs/$defconfig \
"$subbuilddir"/.config
while read -r line; do
# skip comments
case "$line" in
"#"*) continue;;
esac
local option=${line%%=*} str=
local cmd=$(echo $line | cut -d= -f2)
case "$cmd" in
y) cmd="enable";;
n) cmd="disable";;
m) cmd="module";;
'"'*) cmd="set-str"; str="${line#*=}";;
[0-9]*) cmd="set-val"; str="${line#*=}";;
*) die "Command $cmd not accepted" ;;
esac
msg "[$flavor] $cmd: $option $str"
"$builddir"/scripts/config \
--file "$subbuilddir"/.config \
--$cmd "$option" "${str//\"/}"
done < "$srcdir"/config-changes-$flavor.$CARCH
}
# verify if options are set to correct value
_verifyconfig() {
local flavor=$1
local subbuilddir="$srcdir"/build-$flavor
while read -r line; do
[ ${line:0:1} = "#" ] && continue
local option=${line%%=*} str= invert=
local cmd=$(echo $line | cut -d= -f2)
case "$cmd" in
enable) str="$option=y" ;;
disable) str="$option"; invert="-v" ;;
module) str="$option=m" ;;
set-val) str="$option=${line##*=}" ;;
set-str) str=${line##*=}
str="$option=\"${str//\"/}\"" ;;
esac
grep -q $invert "^$str" "$subbuilddir"/.config || \
die "Config: $option not properly set!"
done < "$srcdir"/config-changes-$flavor.$CARCH
}
prepare() {
default_prepare
local flavor=
for flavor in $_flavors; do
local _builddir="$srcdir"/build-$flavor
mkdir -p "$_builddir"
echo "-$pkgrel-$flavor" > "$_builddir"/localversion-alpine
_genconfig $flavor
make -C "$builddir" \
O="$_builddir" \
ARCH="$_carch" \
olddefconfig
_verifyconfig $flavor
done
}
build() {
unset LDFLAGS
for i in $_flavors; do
cd "$srcdir"/build-$i
local _kver=$(make kernelversion)
if [ "$_kver" != "$pkgver" ]; then
error "Version in Makefile ($_kver) does not correspond with pkgver ($pkgver)"
return 1
fi
make ARCH="$_carch" CC="${CC:-gcc}" KLZOP="/usr/bin/lzop" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine"
done
}
_package() {
local _flavor="$1" _outdir="$2"
local _builddir="$srcdir"/build-$_flavor
local _abi_release="$(make -C "$_builddir" -s kernelrelease)"
cd "$srcdir"/build-$_flavor
mkdir -p "$_outdir"/boot "$_outdir"/lib/modules
local _install
case "$CARCH" in
arm*)
_install="zinstall dtbs_install"
;;
aarch64)
_install="install dtbs_install"
;;
*)
_install=install
;;
esac
cd "$srcdir"/build-$_flavor
# modules_install seems to regenerate a defect Modules.symvers. Work
# around it by backing it up and restore it after modules_install
cp Module.symvers Module.symvers.backup
local INSTALL_DTBS_PATH="$_outdir"/boot
make -j1 modules_install $_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$_outdir" \
INSTALL_PATH="$_outdir"/boot \
INSTALL_DTBS_PATH="$INSTALL_DTBS_PATH"
cp Module.symvers.backup Module.symvers
rm -f "$_outdir"/lib/modules/$_abi_release/build \
"$_outdir"/lib/modules/$_abi_release/source
rm -rf "$_outdir"/lib/firmware
install -D -m644 include/config/kernel.release \
"$_outdir"/usr/share/kernel/$_flavor/kernel.release
if [ "$CARCH" = "aarch64" ]; then
mv -f "$INSTALL_DTBS_PATH"/broadcom/*.dtb \
"$INSTALL_DTBS_PATH"
rmdir "$INSTALL_DTBS_PATH"/broadcom
fi
}
# main flavor installs in $pkgdir
package() {
_package rm "$pkgdir"
}
# subflavors install in $subpkgdir
rm2() {
depends="initramfs-generator linux-firmware-brcm linux-firmware-cypress"
_package rm2 "$subpkgdir"
}
_dev() {
local _flavor=$(echo $subpkgname | sed -E 's/(^linux-|-dev$)//g')
local _builddir="$srcdir"/build-$_flavor
local _abi_release="$(make -C "$_builddir" -s kernelrelease)"
# copy the only the parts that we really need for build 3rd party
# kernel modules and install those as /usr/src/linux-headers,
# simlar to what ubuntu does
#
# this way you dont need to install the 300-400 kernel sources to
# build a tiny kernel module
#
pkgdesc="Headers and script for third party modules for $_flavor kernel"
depends="$_depends_dev"
local dir="$subpkgdir"/usr/src/linux-headers-$_abi_release
# first we import config, run prepare to set up for building
# external modules, and create the scripts
mkdir -p "$dir"
cp "$_builddir"/.config "$dir"/.config
echo "-$pkgrel-$_flavor" > "$dir"/localversion-alpine
make -j1 -C "$builddir" \
O="$dir" \
ARCH="$_carch" \
AWK="${AWK:-mawk}" \
syncconfig prepare modules_prepare scripts
# remove the stuff that points to real sources. we want 3rd party
# modules to believe this is the soruces
rm "$dir"/Makefile "$dir"/source
# copy the needed stuff from real sources
#
# this is taken from ubuntu kernel build script
# http://kernel.ubuntu.com/git/ubuntu/ubuntu-zesty.git/tree/debian/rules.d/3-binary-indep.mk
cd "$builddir"
find . -path './include/*' -prune \
-o -path './scripts/*' -prune -o -type f \
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
-name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
-print | cpio -pdm "$dir"
cp -a scripts include "$dir"
find $(find arch -name include -type d -print) -type f \
| cpio -pdm "$dir"
install -Dm644 "$_builddir"/Module.symvers \
"$dir"/Module.symvers
mkdir -p "$subpkgdir"/lib/modules/$_abi_release
ln -sf /usr/src/linux-headers-$_abi_release \
"$subpkgdir"/lib/modules/$_abi_release/build
}
sha512sums="
80ab274ca3d30935d9913490662f17499c1ceedb438fe171554097d25ffc1cf85ee53f0c1642e94c0b833fdfb17636cd554bf685e4a6f5dac20cf122c1a25447 RM1XX_5.4.70_v1.3.3.tar.gz
0f47278c5bfafb939e46224fbf16f9491e3cc560ac128dcf430a1f6cf9064fb1c5bf5db1a3076c35d30c004aec525a7d6616a647564f197bb29c57701c1db982 enable-automatic-partial-refreshing.patch
6f2036a2f88b0d80ba5e37e3d119aebd2dc33453f5a5d84b319ec50c0c00d8cb93fc4b3f5e10f3d56c1496f3cb297551c405f36c5d864af112398f0792f1549a enable-sdhc1.patch
786e7db529023bfd74e2281436858691e833937650814d8dc31ef0f17af0b3d8fb71af16328685e8a3f52885b9840084f5d457d053cc9f8f597a422dca6eb470 config-changes-rm.armv7
786e7db529023bfd74e2281436858691e833937650814d8dc31ef0f17af0b3d8fb71af16328685e8a3f52885b9840084f5d457d053cc9f8f597a422dca6eb470 config-changes-rm.armhf
786e7db529023bfd74e2281436858691e833937650814d8dc31ef0f17af0b3d8fb71af16328685e8a3f52885b9840084f5d457d053cc9f8f597a422dca6eb470 config-changes-rm2.armv7
786e7db529023bfd74e2281436858691e833937650814d8dc31ef0f17af0b3d8fb71af16328685e8a3f52885b9840084f5d457d053cc9f8f597a422dca6eb470 config-changes-rm2.armhf
"

View file

@ -0,0 +1 @@
config-changes-rm.armv7

View file

@ -0,0 +1,42 @@
# format is config=command
# where command can be one of:
# y,n,m,"<str>,<value>
# from remarkable-microsd project
# see http://www.davisr.me/projects/remarkable-microsd/
CONFIG_RTL_CARDS=y
CONFIG_BATTERY_BQ27XXX=y
CONFIG_BATTERY_BQ27XXX_I2C=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_GHASH=y
CONFIG_FB_MXC_EINK_AUTO_UPDATE_MODE=y
# serial through USB
CONFIG_USB_ACM=y
CONFIG_USB_F_ACM=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_CDC_COMPOSITE=y
# wifi module doesn't load early enough for lack of initramfs
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_BRCMFMAC=y
CONFIG_BRCMUTIL=y
# iwd requires these modules
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_KEY_DH_OPERATIONS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA1=y
# other
LOCALVERSION=""
CONFIG_DEFAULT_HOSTNAME="remarkable"

View file

@ -0,0 +1 @@
config-changes-rm.armv7

View file

@ -0,0 +1 @@
config-changes-rm.armv7

View file

@ -0,0 +1,26 @@
diff --git a/drivers/video/fbdev/mxc/mxc_epdc_fb.c.orig b/drivers/video/fbdev/mxc/mxc_epdc_fb.c
index 5c7d87d..5c31379 100644
--- a/drivers/video/fbdev/mxc/mxc_epdc_fb.c.orig
+++ b/drivers/video/fbdev/mxc/mxc_epdc_fb.c
@@ -3489,10 +3489,10 @@ static void mxc_epdc_fb_update_pages(struct mxc_epdc_fb_data *fb_data,
update.update_region.top = y1;
update.update_region.height = y2 - y1;
update.waveform_mode = WAVEFORM_MODE_AUTO;
- update.update_mode = UPDATE_MODE_FULL;
+ update.update_mode = UPDATE_MODE_PARTIAL;
update.update_marker = 0;
update.temp = TEMP_USE_AMBIENT;
- update.flags = 0;
+ update.flags = EPDC_FLAG_USE_REGAL;
mxc_epdc_fb_send_update(&update, &fb_data->info);
}
@@ -3687,7 +3687,7 @@ static struct fb_ops mxc_epdc_fb_ops = {
};
static struct fb_deferred_io mxc_epdc_fb_defio = {
- .delay = HZ,
+ .delay = HZ / 30,
.deferred_io = mxc_epdc_fb_deferred_io,
};

View file

@ -0,0 +1,790 @@
diff --git a/arch/arm/boot/dts/zero-gravitas.dts b/arch/arm/boot/dts/zero-gravitas.dts
index f51edfdedf8a..947f43c3434c 100644
--- a/arch/arm/boot/dts/zero-gravitas.dts
+++ b/arch/arm/boot/dts/zero-gravitas.dts
@@ -1,6 +1,783 @@
-#include "zero-gravitas-factory.dts"
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include "imx6sl.dtsi"
+#include "zero-gravitas-padctl.h"
+
+/ {
+ model = "reMarkable 1.0";
+ compatible = "remarkable,zero-gravitas", "fsl,imx6sl";
+
+ memory {
+ reg = <0x80000000 0x20000000>;
+ };
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&gpio3 30 GPIO_ACTIVE_LOW>,
+ <&gpio4 0 GPIO_ACTIVE_LOW>;
+ clocks = <&clks IMX6SL_CLK_OSC>;
+ clock-names = "ext_clock";
+ };
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ reg_usb_otg1_vbus: regulator@0 {
+ compatible = "regulator-fixed";
+ reg = <0>;
+ regulator-name = "usb_otg1_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio4 15 0>;
+ enable-active-high;
+ vin-supply = <&swbst_reg>;
+ };
+
+ charger_regulator: regulator@1 {
+ reg = <1>;
+ compatible = "regulator-fixed";
+ regulator-name = "charger-regulator";
+ regulator-min-microamp = <5000000>;
+ regulator-max-microamp = <5000000>;
+ gpios = <&gpio3 27 GPIO_ACTIVE_LOW>;
+ enable-active-high; /* Don't invert twice */
+ regulator-boot-on;
+ status = "disabled";
+ };
+ };
+
+ wacom_reset: wacom-reset {
+ compatible = "gpio-reset";
+ reset-gpios = <&gpio4 4 1>;
+ reset-delay-us = <100000>;
+ #reset-cells = <0>;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&pinctrl_keys>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ button_0 {
+ label = "Power";
+ gpios = <&gpio4 9 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_POWER>;
+ gpio-key,wakeup;
+ debounce-interval = <10>;
+ };
+
+ button_1 {
+ label = "Left";
+ gpios = <&gpio3 24 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_LEFT>;
+ gpio-key,wakeup;
+ debounce-interval = <5>;
+ };
+
+ button_2 {
+ label = "Home";
+ gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_HOME>;
+ gpio-key,wakeup;
+ debounce-interval = <5>;
+ };
+ button_3 {
+ label = "Right";
+ gpios = <&gpio3 28 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RIGHT>;
+ gpio-key,wakeup;
+ debounce-interval = <5>;
+ };
+ button_4 {
+ label = "LowPower";
+ gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WAKEUP>;
+ gpio-key,wakeup;
+ debounce-interval = <100>;
+ };
+ };
+
+ usb_charger: usb_charger {
+ compatible = "gpio-charger";
+ gpios = <&gpio4 1 0>;
+ status = "disabled";
+ };
+};
+
+&epdc {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_epdc_0>;
+ VCOM-supply = <&VCOM_reg>;
+ DISPLAY-supply = <&DISPLAY_reg>;
+ TMST-supply = <&TMST_reg>;
+ status = "okay";
+};
+
+&gpc {
+ fsl,ldo-bypass = <1>;
+};
+
+&reg_arm {
+ vin-supply = <&sw1a_reg>;
+ regulator-allow-bypass;
+};
+
+&reg_soc {
+ vin-supply = <&sw1c_reg>;
+ regulator-allow-bypass;
+};
+
+&reg_pu {
+ vin-supply = <&sw1c_reg>;
+ regulator-allow-bypass;
+};
+
+&i2c1 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1>;
+ status = "okay";
+
+ battery: bq27441@55 {
+ reg = <0x55>;
+ compatible = "ti,bq27441";
+ /*power-supplies = <&usb_charger>;*/
+ /*charger-supply = <&charger_regulator>;*/
+ /*interrupt-parent = <&gpio3>;
+ interrupts = <31 IRQ_TYPE_LEVEL_HIGH>;*/
+ ti,resistor-sense = <10>;
+ };
+
+ pmic: pfuze100@8 {
+ compatible = "fsl,pfuze100";
+ reg = <0x08>;
+
+ regulators {
+ sw1a_reg: sw1ab {
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1875000>;
+ regulator-boot-on;
+ regulator-always-on;
+ regulator-ramp-delay = <6250>;
+ };
+
+ sw1c_reg: sw1c {
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1875000>;
+ regulator-boot-on;
+ regulator-always-on;
+ regulator-ramp-delay = <6250>;
+ };
+
+ sw2_reg: sw2 {
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ sw3a_reg: sw3a {
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <1975000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ sw3b_reg: sw3b {
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <1975000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ sw4_reg: sw4 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ swbst_reg: swbst {
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5150000>;
+ };
+
+ snvs_reg: vsnvs {
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vref_reg: vrefddr {
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vgen1_reg: vgen1 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1550000>;
+ regulator-always-on;
+ };
+
+ vgen2_reg: vgen2 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1550000>;
+ };
+
+ vgen3_reg: vgen3 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ vgen4_reg: vgen4 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ vgen5_reg: vgen5 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ vgen6_reg: vgen6 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+ };
+ };
+
+ max17135@48 {
+ compatible = "maxim,max17135";
+ reg = <0x48>;
+ pass_num = <2>;
+ gvee_pwrup = <0>; /* ms */
+ vneg_pwrup = <3>;
+ vpos_pwrup = <6>;
+ gvdd_pwrup = <3>;
+
+ gvdd_pwrdn = <1>;
+ vpos_pwrdn = <2>;
+ vneg_pwrdn = <6>;
+ gvee_pwrdn = <50>;
+ /* These are only for passnum 1, we use i2c */
+ gpio_pmic_pwrgood = <&gpio2 13 0>;
+ gpio_pmic_vcom_ctrl = <&gpio2 3 0>;
+ gpio_pmic_wakeup = <&gpio2 14 0>;
+ gpio_pmic_v3p3 = <&gpio2 7 0>;
+ gpio_pmic_intr = <&gpio2 12 0>;
+
+ regulators {
+ DISPLAY_reg: DISPLAY {
+ regulator-name = "DISPLAY";
+ };
+
+ GVDD_reg: GVDD {
+ /* 20v */
+ regulator-name = "GVDD";
+ };
+
+ GVEE_reg: GVEE {
+ /* -22v */
+ regulator-name = "GVEE";
+ };
+
+ HVINN_reg: HVINN {
+ /* -22v */
+ regulator-name = "HVINN";
+ };
+
+ HVINP_reg: HVINP {
+ /* 20v */
+ regulator-name = "HVINP";
+ };
+
+ VCOM_reg: VCOM {
+ regulator-name = "VCOM";
+ /* Real max value: -500000 */
+ regulator-max-microvolt = <4325000>;
+ /* Real min value: -4325000 */
+ regulator-min-microvolt = <500000>;
+ };
+
+ VNEG_reg: VNEG {
+ /* -15v */
+ regulator-name = "VNEG";
+ };
+
+ VPOS_reg: VPOS {
+ /* 15v */
+ regulator-name = "VPOS";
+ };
+
+ TMST_reg: TMST {
+ regulator-name = "TMST";
+ /* 2's-compliment, -127 */
+ regulator-min-microvolt = <0xffffff81>;
+ /* 2's-compliment, +127 */
+ regulator-max-microvolt = <0x0000007f>;
+ };
+ };
+ };
+
+};
+
+&i2c2 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2>;
+ status = "okay";
+
+ digitizer: wacom-i2c@9 {
+ compatible = "wacom,wacom-i2c";
+ reg = <0x09>;
+ interrupt-parent = <&gpio2>;
+ interrupts = <10 2>;
+ resets = <&wacom_reset>;
+ };
+};
+
+&i2c3 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c3>;
+ status = "okay";
+
+ tsc@24 {
+ compatible = "cy,cyttsp5_i2c_adapter";
+ reg = <0x24>;
+ interrupt-parent = <&gpio4>;
+ interrupts = <3 2>;
+ cy,adapter_id = "cyttsp5_i2c_adapter";
+ status = "okay";
+
+ cy,core {
+ cy,name = "cyttsp5_core";
+
+ cy,irq_gpio = <&gpio4 3 0>;
+ cy,rst_gpio = <&gpio4 5 0>;
+ cy,hid_desc_register = <1>;
+ /* CY_CORE_FLAG_RESTORE_PARAMETERS */
+ cy,flags = <4>;
+ /* CY_CORE_EWG_NONE */
+ cy,easy_wakeup_gesture = <0>;
+ cy,btn_keys = <172 /* KEY_HOMEPAGE */
+ /* previously was KEY_HOME, new Android versions use KEY_HOMEPAGE */
+ 139 /* KEY_MENU */
+ 158 /* KEY_BACK */
+ 217 /* KEY_SEARCH */
+ 114 /* KEY_VOLUMEDOWN */
+ 115 /* KEY_VOLUMEUP */
+ 212 /* KEY_CAMERA */
+ 116>; /* KEY_POWER */
+ cy,btn_keys-tag = <0>;
+
+ cy,mt {
+ cy,name = "cyttsp5_mt";
+
+ cy,inp_dev_name = "cyttsp5_mt";
+ cy,flags = <0>;
+ cy,abs =
+ /* ABS_MT_POSITION_X, CY_ABS_MIN_X, CY_ABS_MAX_X, 0, 0 */
+ <0x35 0 880 0 0
+ /* ABS_MT_POSITION_Y, CY_ABS_MIN_Y, CY_ABS_MAX_Y, 0, 0 */
+ 0x36 0 1280 0 0
+ /* ABS_MT_PRESSURE, CY_ABS_MIN_P, CY_ABS_MAX_P, 0, 0 */
+ 0x3a 0 255 0 0
+ /* CY_IGNORE_VALUE, CY_ABS_MIN_W, CY_ABS_MAX_W, 0, 0 */
+ 0xffff 0 255 0 0
+ /* ABS_MT_TRACKING_ID, CY_ABS_MIN_T, CY_ABS_MAX_T, 0, 0 */
+ 0x39 0 15 0 0
+ /* ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0 */
+ 0x30 0 255 0 0
+ /* ABS_MT_TOUCH_MINOR, 0, 255, 0, 0 */
+ 0x31 0 255 0 0
+ /* ABS_MT_ORIENTATION, -127, 127, 0, 0 */
+ 0x34 0xffffff81 127 0 0
+ /* ABS_MT_TOOL_TYPE, 0, MT_TOOL_MAX, 0, 0 */
+ 0x37 0 1 0 0
+ /* ABS_DISTANCE, 0, 255, 0, 0 */
+ 0x19 0 255 0 0>;
+
+ cy,vkeys_x = <720>;
+ cy,vkeys_y = <1280>;
+
+ cy,virtual_keys = /* KeyCode CenterX CenterY Width Height */
+ /* KEY_BACK */
+ <158 1360 90 160 180
+ /* KEY_MENU */
+ 139 1360 270 160 180
+ /* KEY_HOMEPAGE */
+ 172 1360 450 160 180
+ /* KEY SEARCH */
+ 217 1360 630 160 180>;
+ };
+ };
+ };
+};
+
+&iomuxc {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hog>;
+
+ zero-gravitas {
+ pinctrl_hog: hoggrp {
+ fsl,pins = <
+ /* MAX17135 pwrgood */
+ MX6SL_PAD_EPDC_PWRSTAT__GPIO2_IO13 PAD_CTL_NONE
+ /* MAX17135 vcom ctrl */
+ MX6SL_PAD_EPDC_VCOM0__GPIO2_IO03 PAD_CTL_NONE
+ /* MAX17135 wakeup */
+ MX6SL_PAD_EPDC_PWRWAKEUP__GPIO2_IO14 PAD_CTL_NONE
+ /* MAX17135 v3p3 */
+ MX6SL_PAD_EPDC_PWRCTRL0__GPIO2_IO07 PAD_CTL_NONE
+ /* MAX17135 intr */
+ MX6SL_PAD_EPDC_PWRINT__GPIO2_IO12 PAD_CTL_NONE
+
+ /* BQ27441 low power */
+ MX6SL_PAD_KEY_ROW3__GPIO3_IO31 0x17000
+
+ /* Wacom interrupt */
+ MX6SL_PAD_EPDC_PWRCTRL3__GPIO2_IO10 0x17000
+ /* Wacom reset */
+ MX6SL_PAD_KEY_COL6__GPIO4_IO04 0x110b0
+
+ /* CYTTSP interrupt */
+ MX6SL_PAD_KEY_ROW5__GPIO4_IO03 0x17000
+ /* CYTTSP reset */
+ MX6SL_PAD_KEY_ROW6__GPIO4_IO05 0x110b0
+
+ /* USB OTG1 voltage control */
+ /*MX6SL_PAD_ECSPI2_SS0__GPIO4_IO15 0x17000*/
+ /*MX6SL_PAD_ECSPI2_SS0__GPIO4_IO15 0x000b0*/
+ MX6SL_PAD_ECSPI2_SS0__GPIO4_IO15 PAD_CTL_NONE
+ /*MX6SL_PAD_ECSPI2_SS0__USB_OTG1_PWR 0x17000*/
+ /* USB OTG1 over current detection */
+ MX6SL_PAD_ECSPI2_MISO__USB_OTG1_OC 0x1b0b0
+
+ /* Charger control */
+ MX6SL_PAD_KEY_ROW1__GPIO3_IO27 0x110b0
+ /* Charger status */
+ MX6SL_PAD_KEY_ROW4__GPIO4_IO01 PAD_CTL_NONE
+
+ /* USDHC1 card detect */
+ MX6SL_PAD_KEY_ROW7__GPIO4_IO07 0x17059
+
+ /* CHIP_WAKE_HOST */
+ MX6SL_PAD_KEY_COL5__GPIO4_IO02 PAD_CTL_NONE
+ /* POWER_WIFI: WiFi external power control */
+ MX6SL_PAD_KEY_COL3__GPIO3_IO30 PAD_CTL_NONE
+ /* WL_DIS: WiFi internal power control */
+ MX6SL_PAD_KEY_COL4__GPIO4_IO00 PAD_CTL_NONE
+
+ /* 32Khz clock from i.MX6 to WiFi for power saving */
+ MX6SL_PAD_REF_CLK_32K__XTALOSC_REF_CLK_32K 0x1b0b0
+ >;
+ };
+
+ pinctrl_epdc_0: epdcgrp-0 {
+ fsl,pins = <
+ MX6SL_PAD_EPDC_D0__EPDC_DATA00 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D1__EPDC_DATA01 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D2__EPDC_DATA02 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D3__EPDC_DATA03 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D4__EPDC_DATA04 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D5__EPDC_DATA05 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D6__EPDC_DATA06 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D7__EPDC_DATA07 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D8__EPDC_DATA08 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D9__EPDC_DATA09 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D10__EPDC_DATA10 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D11__EPDC_DATA11 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D12__EPDC_DATA12 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D13__EPDC_DATA13 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D14__EPDC_DATA14 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_D15__EPDC_DATA15 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_GDCLK__EPDC_GDCLK PAD_CTL_NONE
+ MX6SL_PAD_EPDC_GDOE__EPDC_GDOE PAD_CTL_NONE
+ MX6SL_PAD_EPDC_GDSP__EPDC_GDSP PAD_CTL_NONE
+ MX6SL_PAD_EPDC_SDCE0__EPDC_SDCE0 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_SDCLK__EPDC_SDCLK_P PAD_CTL_NONE
+ MX6SL_PAD_EPDC_SDLE__EPDC_SDLE PAD_CTL_NONE
+ MX6SL_PAD_EPDC_SDOE__EPDC_SDOE PAD_CTL_NONE
+ MX6SL_PAD_EPDC_BDR0__EPDC_BDR0 PAD_CTL_NONE
+ MX6SL_PAD_EPDC_BDR1__EPDC_BDR1 PAD_CTL_NONE
+ >;
+ };
+
+ pinctrl_i2c1: i2c1grp {
+ fsl,pins = <
+ MX6SL_PAD_I2C1_SCL__I2C1_SCL 0x4001b8b1
+ MX6SL_PAD_I2C1_SDA__I2C1_SDA 0x4001b8b1
+ >;
+ };
+
+
+ pinctrl_i2c2: i2c2grp {
+ fsl,pins = <
+ MX6SL_PAD_I2C2_SCL__I2C2_SCL 0x4001b8b1
+ MX6SL_PAD_I2C2_SDA__I2C2_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c3: i2c3grp {
+ fsl,pins = <
+ MX6SL_PAD_AUD_RXFS__I2C3_SCL 0x4001b8b1
+ MX6SL_PAD_AUD_RXC__I2C3_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_keys: keygrp {
+ fsl,pins = <
+ MX6SL_PAD_ECSPI1_MOSI__GPIO4_IO09 0x100b1
+ MX6SL_PAD_KEY_COL0__GPIO3_IO24 0x100b1
+ MX6SL_PAD_KEY_COL1__GPIO3_IO26 0x100b1
+ MX6SL_PAD_KEY_COL2__GPIO3_IO28 0x100b1
+ >;
+ };
+
+ pinctrl_uart1: uart1grp {
+ fsl,pins = <
+ MX6SL_PAD_UART1_RXD__UART1_RX_DATA 0x1b0b1
+ MX6SL_PAD_UART1_TXD__UART1_TX_DATA 0x1b0b1
+ >;
+ };
+
+ pinctrl_usbotg1: usbotg1grp {
+ fsl,pins = <
+ MX6SL_PAD_EPDC_PWRCOM__USB_OTG1_ID 0x17059
+ >;
+ };
+
+ pinctrl_usdhc1: usdhc1grp {
+ fsl,pins = <
+ MX6SL_PAD_SD1_CMD__SD1_CMD PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD1_CLK__SD1_CLK PAD_CTL_USDHC_CLK_DEFAULT
+ MX6SL_PAD_SD1_DAT0__SD1_DATA0 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD1_DAT1__SD1_DATA1 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD1_DAT2__SD1_DATA2 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD1_DAT3__SD1_DATA3 PAD_CTL_USDHC_DEFAULT
+ >;
+ };
+
+ pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD1_CMD__SD1_CMD PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD1_CLK__SD1_CLK PAD_CTL_USDHC_CLK_100MHZ
+ MX6SL_PAD_SD1_DAT0__SD1_DATA0 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD1_DAT1__SD1_DATA1 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD1_DAT2__SD1_DATA2 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD1_DAT3__SD1_DATA3 PAD_CTL_USDHC_100MHZ
+ >;
+ };
+
+ pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD1_CMD__SD1_CMD PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD1_CLK__SD1_CLK PAD_CTL_USDHC_CLK_200MHZ
+ MX6SL_PAD_SD1_DAT0__SD1_DATA0 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD1_DAT1__SD1_DATA1 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD1_DAT2__SD1_DATA2 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD1_DAT3__SD1_DATA3 PAD_CTL_USDHC_200MHZ
+ >;
+ };
+
+ pinctrl_usdhc2: usdhc2grp {
+ fsl,pins = <
+ MX6SL_PAD_SD2_CMD__SD2_CMD PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_CLK__SD2_CLK PAD_CTL_USDHC_CLK_DEFAULT
+ MX6SL_PAD_SD2_DAT0__SD2_DATA0 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT1__SD2_DATA1 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT2__SD2_DATA2 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT3__SD2_DATA3 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT4__SD2_DATA4 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT5__SD2_DATA5 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT6__SD2_DATA6 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_DAT7__SD2_DATA7 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD2_RST__SD2_RESET PAD_CTL_USDHC_CLK_DEFAULT
+ >;
+ };
+
+ pinctrl_usdhc2_100mhz: usdhc2grp100mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD2_CMD__SD2_CMD PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_CLK__SD2_CLK PAD_CTL_USDHC_CLK_100MHZ
+ MX6SL_PAD_SD2_DAT0__SD2_DATA0 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT1__SD2_DATA1 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT2__SD2_DATA2 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT3__SD2_DATA3 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT4__SD2_DATA4 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT5__SD2_DATA5 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT6__SD2_DATA6 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_DAT7__SD2_DATA7 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD2_RST__SD2_RESET PAD_CTL_USDHC_CLK_DEFAULT
+ >;
+ };
+
+ pinctrl_usdhc2_200mhz: usdhc2grp200mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD2_CMD__SD2_CMD PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_CLK__SD2_CLK PAD_CTL_USDHC_CLK_200MHZ
+ MX6SL_PAD_SD2_DAT0__SD2_DATA0 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT1__SD2_DATA1 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT2__SD2_DATA2 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT3__SD2_DATA3 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT4__SD2_DATA4 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT5__SD2_DATA5 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT6__SD2_DATA6 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_DAT7__SD2_DATA7 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD2_RST__SD2_RESET PAD_CTL_USDHC_CLK_DEFAULT
+ >;
+ };
+
+ pinctrl_usdhc3: usdhc3grp {
+ fsl,pins = <
+ MX6SL_PAD_SD3_CMD__SD3_CMD PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD3_CLK__SD3_CLK PAD_CTL_USDHC_CLK_DEFAULT
+ MX6SL_PAD_SD3_DAT0__SD3_DATA0 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD3_DAT1__SD3_DATA1 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD3_DAT2__SD3_DATA2 PAD_CTL_USDHC_DEFAULT
+ MX6SL_PAD_SD3_DAT3__SD3_DATA3 PAD_CTL_USDHC_DEFAULT
+ >;
+ };
+
+ pinctrl_usdhc3_100mhz: usdhc3grp100mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD3_CMD__SD3_CMD PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD3_CLK__SD3_CLK PAD_CTL_USDHC_CLK_100MHZ
+ MX6SL_PAD_SD3_DAT0__SD3_DATA0 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD3_DAT1__SD3_DATA1 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD3_DAT2__SD3_DATA2 PAD_CTL_USDHC_100MHZ
+ MX6SL_PAD_SD3_DAT3__SD3_DATA3 PAD_CTL_USDHC_100MHZ
+ >;
+ };
+
+ pinctrl_usdhc3_200mhz: usdhc3grp200mhz {
+ fsl,pins = <
+ MX6SL_PAD_SD3_CMD__SD3_CMD PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD3_CLK__SD3_CLK PAD_CTL_USDHC_CLK_200MHZ
+ MX6SL_PAD_SD3_DAT0__SD3_DATA0 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD3_DAT1__SD3_DATA1 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD3_DAT2__SD3_DATA2 PAD_CTL_USDHC_200MHZ
+ MX6SL_PAD_SD3_DAT3__SD3_DATA3 PAD_CTL_USDHC_200MHZ
+ >;
+ };
+ };
+};
+
+&pxp {
+ status = "okay";
+};
+
+&snvs_poweroff {
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart1>;
+ status = "okay";
+};
+
+/*&usbmisc {
+ vbus-wakeup-supply = <&reg_usb_otg1_vbus>;
+};*/
&usbotg1 {
- vbus-supply = <&reg_usb_otg1_vbus>;
+ /*vbus-supply = <&reg_usb_otg1_vbus>;*/
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usbotg1>;
+ disable-over-current;
+ /* This kills the speed */
+ imx-usb-charger-detection;
+ srp-disable;
+ hnp-disable;
+ adp-disable;
+ status = "okay";
};
+&usbotg2 {
+ dr_mode = "host";
+ disable-over-current;
+ srp-disable;
+ hnp-disable;
+ adp-disable;
+ status = "disabled";
+};
+
+
+&usbphy1 {
+ tx-d-cal = <0x5>;
+};
+
+&usbphy2 {
+ tx-d-cal = <0x5>;
+ status = "disabled";
+};
+
+&usdhc1 {
+ pinctrl-names = "default", "state_100mhz", "state_200mhz";
+ pinctrl-0 = <&pinctrl_usdhc1>;
+ pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
+ pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
+ bus-width = <4>;
+ cd-gpios = <&gpio4 7 GPIO_ACTIVE_LOW>;
+ disable-wp;
+ wp-controller;
+ keep-power-in-suspend;
+ enable-sdio-wakeup;
+ no-1-8-v;
+ status = "okay";
+};
+
+&usdhc2 {
+ pinctrl-names = "default", "state_100mhz", "state_200mhz";
+ pinctrl-0 = <&pinctrl_usdhc2>;
+ pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
+ pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
+ bus-width = <8>;
+ non-removable;
+ keep-power-in-suspend;
+ no-1-8-v;
+ disable-wp;
+ cap-mmc-highspeed;
+ status = "okay";
+};
+
+&usdhc3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default", "state_100mhz", "state_200mhz";
+ pinctrl-0 = <&pinctrl_usdhc3>;
+ pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+ pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ enable-sdio-wakeup;
+ non-removable;
+ disable-wp;
+ no-1-8-v;
+ wifi-host;
+ keep-power-in-suspend;
+ status = "okay";
+
+ brcmf: bcrmf@1 {
+ reg = <1>;
+ compatible = "brcm,bcm4329-fmac";
+ /*resets = <&wifi_reset>;*/
+ };
+};

40
user/rm-utils/APKBUILD Normal file
View file

@ -0,0 +1,40 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
pkgname=rm-utils
pkgver=0.0.1
pkgrel=0
pkgdesc="Utility files for reMarkable tablet"
arch="armv7 armhf"
url="http://www.davisr.me/projects/parabola-rm/"
license="GPL-3.0-only"
makedepends="gcc$_cross linux-rm-dev"
options="!check" # No testsuite
builddir="$srcdir"
source="
battery-monitor.sh
epdc-init-auto.c
epdc-show-bitmap.c
xorg.conf
"
builddir() {
$CC -c epdc-init-auto.c -o epdc-init-auto
$CC -c epdc-show-bitmap.c -o epdc-show-bitmap
}
package() {
install -vDm755 battery-monitor.sh -t "$pkgdir"/usr/bin/battery-monitor
install -vDm755 epdc-show-bitmap -t "$pkgdir"/usr/bin/epdc-show-bitmap
install -vDm755 epdc-init-auto -t "$pkgdir"/usr/bin/epdc-init-auto
install -vDm644 xorg.conf -t "$pkgdir"/etc/defaults/xorg.conf
}
sha512sums="
7f0e6cb276357983b76c37c81a91c0d278dbec16d8982a97618f2217ef5e4d706211d921af6c79db3aad912d50aaed8cf5ce67f52a1081f61585eb97322c8deb battery-monitor.sh
50813c5c2e888e106416dd0b5b515c8a145da23343992b29ee8ad325a72a7b4bd464824636ea66c95f16df20f357646bf8e9e1ed66367f8b540b50dc608495d6 epdc-init-auto.c
274ba66666628ec12ee32e2054d7fd2d3ebcccb144784934f645472d482ed0d56777ebd87a342dd121c6e753e8efc776d9c340e4f54ac3b0fb460afbdb0020fe epdc-show-bitmap.c
e14a61751e4c830652e7a849b9d596c6bc213fed87ba3f9f7c3df0d5fe35ddf28bde7de2fa977c0321639503ceff5abffd0d856380eacce24389fd50eaf3372a xorg.conf
"

View file

@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# battery-monitor.sh
# Prints the state of charge of the tablet's battery
#
# Parabola-rM is a free operating system for the reMarakble tablet.
# Copyright (C) 2020
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.
# Path for Linux 4.9
battpath="/sys/class/power_supply/bq27441-0"
chargenow="$(cat $battpath/charge_now)"
chargefull="$(cat $battpath/charge_full)"
status="$(cat $battpath/status)"
chargepct="$(echo $chargenow $chargefull \
| awk '{printf "%f", $1 / $2 * 100}' \
| cut -d'.' -f1)"
symbol=""
if [[ "Charging" == "$status" ]]; then
symbol=$'\u26a1' # Lightning symbol
fi
echo "${symbol}${chargepct}%"

View file

@ -0,0 +1,126 @@
/*
epdc-init-auto.c
Initializes the EPDC framebuffer into a deferred-IO automatic-update
mode
Parabola-rM is a free operating system for the reMarakble tablet.
Copyright (C) 2020 Davis Remmel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "mxcfb.h"
#include <stdio.h>
int main()
{
int ret;
int fb = open("/dev/fb0", O_RDWR);
struct fb_var_screeninfo vinfo;
ret = ioctl(fb, FBIOGET_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOGET_VSCREENINFO failed with error "
"%d, aborting\n", ret);
return 1;
}
vinfo.xres = 1872;
vinfo.yres = 1404;
vinfo.pixclock = 160000000;
vinfo.left_margin = 32;
vinfo.right_margin = 326;
vinfo.upper_margin = 4;
vinfo.lower_margin = 12;
vinfo.hsync_len = 44;
vinfo.vsync_len = 1;
vinfo.sync = 0;
vinfo.vmode = FB_VMODE_NONINTERLACED;
vinfo.accel_flags = 0;
vinfo.activate = FB_ACTIVATE_FORCE;
// Put screen info. Sometimes this fails when trying to set the
// pixclock. This may be a bug in the driver's arithmetic.
ret = ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOPUT_VSCREENINFO failed with error "
"%d, attempting to reset pixclock\n", ret);
vinfo.pixclock = 6250;
ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
vinfo.pixclock = 160000000;
ret = ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOPUT_VSCREENINFO failed "
"with error %d, aborting\n", ret);
return 1;
}
}
// Pull the screeninfo agian
ret = ioctl(fb, FBIOGET_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOGET_VSCREENINFO failed with error "
"%d, aborting\n", ret);
return 1;
}
printf("x:%d y:%d activate:%d bpp:%d rotate:%d hsync_len:%d"
"vsync_len: %d sync:%d\n",
vinfo.xres, vinfo.yres, vinfo.activate,
vinfo.bits_per_pixel, vinfo.rotate, vinfo.hsync_len,
vinfo.vsync_len, vinfo.sync);
struct fb_fix_screeninfo finfo;
ret = ioctl(fb, FBIOGET_FSCREENINFO, &finfo);
if (0 != ret) {
fprintf(stderr, "FBIOGET_FSCREENINFO failed with error "
"%d, aborting\n", ret);
return 1;
}
// In case the EPDC wasn't accessible
ret = ioctl(fb, MXCFB_ENABLE_EPDC_ACCESS);
if (0 != ret) {
fprintf(stderr, "MXCFB_ENABLE_EPDC_ACCESS failed with "
"error %d, aborting\n", ret);
return 1;
}
// Set auto update mode
__u32 aumode = AUTO_UPDATE_MODE_AUTOMATIC_MODE;
ret = ioctl(fb, MXCFB_SET_AUTO_UPDATE_MODE, &aumode);
if (0 != ret) {
fprintf(stderr, "MXCFB_SET_AUTO_UPDATE_MODE failed "
"with error %d, aborting\n", ret);
return 1;
}
// Queue-and-merge is best-performing
__u32 uscheme = UPDATE_SCHEME_QUEUE_AND_MERGE;
ret = ioctl(fb, MXCFB_SET_UPDATE_SCHEME, &uscheme);
if (0 != ret) {
fprintf(stderr, "MXCFB_SET_UPDATE_SCHEME failed with "
"error %d, aborting\n", ret);
return 1;
}
close(fb);
return 0;
}

View file

@ -0,0 +1,184 @@
/*
epdc-show-bitmap.c
Displays a raw image to the EPDC framebuffer
Parabola-rM is a free operating system for the reMarakble tablet.
Copyright (C) 2020 Davis Remmel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "mxcfb.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
if (argc < 2) {
printf("Must pass an image as an argument.\n");
return 1;
}
int ret;
int fb = open("/dev/fb0", O_RDWR);
struct fb_var_screeninfo vinfo;
ret = ioctl(fb, FBIOGET_VSCREENINFO, &vinfo);
if (0 != ret) {
printf("FBIOGET_VSCREENINFO failed with error %d"
", aborting\n", ret);
return 1;
}
vinfo.xres = 1872;
vinfo.yres = 1404;
vinfo.pixclock = 160000000;
vinfo.left_margin = 32;
vinfo.right_margin = 326;
vinfo.upper_margin = 4;
vinfo.lower_margin = 12;
vinfo.hsync_len = 44;
vinfo.vsync_len = 1;
vinfo.sync = 0;
vinfo.vmode = FB_VMODE_NONINTERLACED;
vinfo.accel_flags = 0;
vinfo.activate = FB_ACTIVATE_FORCE;
// Put screen info. Sometimes this fails when trying to set the
// pixclock. This may be a bug in the driver's arithmetic.
ret = ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOPUT_VSCREENINFO failed with error "
"%d, attempting To reset pixclock\n", ret);
vinfo.pixclock = 6250;
ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
vinfo.pixclock = 160000000;
ret = ioctl(fb, FBIOPUT_VSCREENINFO, &vinfo);
if (0 != ret) {
fprintf(stderr, "FBIOPUT_VSCREENINFO failed "
"with error %d, aborting\n", ret);
return 1;
}
}
printf("x:%d y:%d activate:%d bpp:%d rotate:%d hsync_len:%d"
"vsync_len: %d sync:%d\n",
vinfo.xres, vinfo.yres, vinfo.activate,
vinfo.bits_per_pixel, vinfo.rotate, vinfo.hsync_len,
vinfo.vsync_len, vinfo.sync);
struct fb_fix_screeninfo finfo;
ret = ioctl(fb, FBIOGET_FSCREENINFO, &finfo);
if (0 != ret) {
fprintf(stderr, "FBIOGET_FSCREENINFO failed with error "
"%d, aborting\n", ret);
return 1;
}
// In case the EPDC wasn't accessible
ret = ioctl(fb, MXCFB_ENABLE_EPDC_ACCESS);
if (0 != ret) {
fprintf(stderr, "MXCFB_ENABLE_EPDC_ACCESS failed with "
"error %d, aborting\n", ret);
return 1;
}
// Set to partial mode to control update parameters
__u32 aumode = AUTO_UPDATE_MODE_REGION_MODE;
ret = ioctl(fb, MXCFB_SET_AUTO_UPDATE_MODE, &aumode);
if (0 != ret) {
fprintf(stderr, "MXCFB_SET_AUTO_UPDATE_MODE failed "
"with error %d, aborting\n", ret);
return 1;
}
// No artifacts in display output
__u32 uscheme = UPDATE_SCHEME_SNAPSHOT;
ret = ioctl(fb, MXCFB_SET_UPDATE_SCHEME, &uscheme);
if (0 != ret) {
fprintf(stderr, "MXCFB_SET_UPDATE_SCHEME failed with "
"error %d, aborting\n", ret);
return 1;
}
// Set up update (same region for all writes, gets reused)
struct mxcfb_update_data bupdate;
bupdate.update_region.left = 0;
bupdate.update_region.top = 0;
bupdate.update_region.width = 1872;
bupdate.update_region.height = 1404;
bupdate.waveform_mode = WAVEFORM_MODE_AUTO;
bupdate.update_mode = UPDATE_MODE_FULL;
bupdate.update_marker = 0;
bupdate.temp = TEMP_USE_AMBIENT;
bupdate.flags = 0;
struct mxcfb_update_marker_data updm;
updm.update_marker = 0;
// mmap to framebuffer
int buflength = vinfo.yres_virtual * finfo.line_length;
printf("buflength %d\n", buflength);
char * region = mmap(0, buflength, PROT_READ | PROT_WRITE,
MAP_SHARED, fb, (off_t)0);
if (region == MAP_FAILED) {
fprintf(stderr, "map failed!\n");
return 1;
}
// Write black
memset(region, 0x00, buflength);
ioctl(fb, MXCFB_SEND_UPDATE, &bupdate);
ioctl(fb, MXCFB_WAIT_FOR_UPDATE_COMPLETE, &updm);
// Write white
memset(region, 0xff, buflength);
ioctl(fb, MXCFB_SEND_UPDATE, &bupdate);
ioctl(fb, MXCFB_WAIT_FOR_UPDATE_COMPLETE, &updm);
// Write image
FILE *pattern = fopen(argv[1], "rb");
fseek(pattern, 0, SEEK_END);
long psize = ftell(pattern);
printf("psize is %d\n", psize);
fseek(pattern, 0, SEEK_SET);
if (psize != buflength) {
fprintf(stderr, "Image must match framebuffer size\n");
return 1;
}
char *buffer = malloc(psize);
fread(buffer, psize, 1, pattern);
fclose(pattern);
memcpy(region, buffer, psize);
ret = ioctl(fb, MXCFB_SEND_UPDATE, &bupdate);
ioctl(fb, MXCFB_WAIT_FOR_UPDATE_COMPLETE, &updm);
if (0 != ret) {
fprintf(stderr, "MXCFB_SEND_UPDATE failed with error "
"%d, aborting\n", ret);
return 1;
}
close(fb);
return 0;
}

62
user/rm-utils/xorg.conf Normal file
View file

@ -0,0 +1,62 @@
Section "ServerLayout"
Identifier "reMarkable Tablet RM100"
Screen 0 "Screen0"
InputDevice "wacom" "CorePointer"
EndSection
Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
Section "Monitor"
Identifier "Monitor0"
DisplaySize 210 158 # mm, sets DPI
Modeline "1872x1404_30.00" 104.26 1872 1960 2152 2432 1404 1405 \
1408 1429 -HSync +Vsync
Option "PreferredMode" "1872x1404_30.00"
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "Monitor0"
Device "epdc0"
DefaultDepth 16
SubSectionSub "Display"
Depth 16
Modes "1872x1404_30.00"
EndSubSection
EndSection
Section "Device"
Identifier "epdc0"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
Option "Rotate" "CW"
EndSection
Section "InputDevice"
Identifier "wacom"
Driver "evdev"
Option "Protocol" "Auto"
Option "Device" "/dev/input/event0"
Option "SwapAxes" "1"
Option "InvertY" "1"
EndSection
Section "InputClass"
Identifier "touchscreen"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event1"
Driver "libinput"
Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" # Rot 180
EndSection
Section "InputClass"
Identifier "facialbuttons"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event2"
Driver "libinput"
EndSection

146
user/u-boot-rm/APKBUILD Normal file
View file

@ -0,0 +1,146 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=u-boot-rm
pkgver=2020.09
_rm1tag=97b35fdddf0077abd2e0f0409b94ef20adbe8565
_rm2tag=47c91918aa7724c16b6eaf87cf5dfbf4548eafc1
pkgrel=0
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
pkgdesc="u-boot bootloader common files"
url="https://www.denx.de/wiki/U-Boot/"
arch="armv7 armhf"
license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs
ISC LGPL-2.0-only LGPL-2.1-only X11"
options="!check" # no tests
makedepends="
bc
bison
dtc
flex
gnutls-dev
linux-headers
openssl-dev>3
py3-elftools
py3-setuptools
python3-dev
swig
util-linux-dev
gcc$_cross
"
source="
u-boot-rm1-$_rm1tag.tar.gz::https://github.com/reMarkable/uboot/archive/$_rm1tag.tar.gz
u-boot-rm2-$_rm2tag.tar.gz::https://github.com/reMarkable/uboot/archive/$_rm2tag.tar.gz
update-u-boot
README.txt
rm1-uboot-config-patch.diff
rm2-uboot-config-patch.diff
"
builddir="$srcdir"
#rm2:zero-sugar broken
case "$CARCH" in
arm*) board_configs="
rm1:zero-gravitas
";;
esac
for board_config in $board_configs; do
_allboards="$_allboards $pkgname-${board_config%%:*}"
done
subpackages="$pkgname-all:_all $_allboards"
prepare() {
default_prepare
cd "$builddir"/uboot-$_rm1tag
patch -p1 -i "$srcdir"/rm1-uboot-config-patch.diff
cd "$builddir"/uboot-$_rm2tag
patch -p1 -i "$srcdir"/rm2-uboot-config-patch.diff
}
build() {
local board_config board
for board_config in $board_configs; do
local configs="${board_config#*:}"
for board in ${configs//,/ }; do
msg "Building u-boot for $board"
case $board in
zero-gravitas) cd "$builddir"/uboot-$_rm1tag;;
zero-sugar) cd "$builddir"/uboot-$_rm2tag;;
esac
touch include/config.h
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
export BUILD_DIR="$builddir"/build/$board
mkdir -p "$BUILD_DIR"
make O="$BUILD_DIR" ${board}_config
make O="$BUILD_DIR" all
done
done
}
package() {
mkdir -p "$pkgdir"/usr/share/$pkgname "$pkgdir"/usr/sbin
install "$srcdir"/README.txt "$pkgdir"/usr/share/$pkgname/README.txt
install "$srcdir"/update-u-boot "$pkgdir"/usr/sbin
}
_all() {
pkgdesc="u-boot for all boards (meta package)"
depends="$_allboards"
mkdir -p "$subpkgdir"/
}
_split_boards() {
cd "$builddir"/build
pkgdesc="u-boot for $1"
depends="u-boot"
shift
local board
for board; do
msg "Including board $board"
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
export BUILD_DIR="$builddir"/build/$board
local board_images=""
case "$board" in
"sifive_unleashed") board_images="u-boot.itb spl/u-boot-spl.bin --" ;;
"sifive_unmatched") board_images="u-boot.itb spl/u-boot-spl.bin --" ;;
"rockpro64-rk3399"|"roc-pc-rk3399"|"roc-cc-rk3328") board_images="u-boot.img u-boot.itb idbloader.img --" ;;
esac
local ok=no
for image in $board_images u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do
if [ "$image" = "--" ]; then
[ "$ok" = yes ] && break
continue
fi
if [ -e "$BUILD_DIR"/$image ]; then
cp "$BUILD_DIR"/$image "$subpkgdir"/usr/share/$pkgname/$board
ok=yes
fi
done
[ "$ok" = yes ] || return
done
}
for board_config in $board_configs; do
_board="${board_config%%:*}"
_configs="${board_config#*:}"
eval "$_board() { _split_boards $_board ${_configs//,/ }; }"
done
sha512sums="
7cc8d513cac1d63ee5119529caa056164ee3bc3633da5d880fbfb344b770c7c53c41475d42dd129b505390dcd5449e14524afc06f7cdba9354af7e70a7035ef9 u-boot-rm1-97b35fdddf0077abd2e0f0409b94ef20adbe8565.tar.gz
d0d18b123c4281285a8b3c1afd9ef623b48a33506399c8e0dbc393f22d967ee3e5df7030aab26c4fe8cad614f3f22f1ea5d6b5bb4ef5cc46fffe56b7ac7c3c28 u-boot-rm2-47c91918aa7724c16b6eaf87cf5dfbf4548eafc1.tar.gz
84974430d68321d3dd109d52ecd18ecf4e99c9576e2aa85b99057ecf369ac9a60c7c6cb68f4fabcd88f3a421f359fbabe0b9ca2fccb91053c5f4e9cd30944657 update-u-boot
f8c9bb6e84d6f0620c976ac7ad5dd7ec7ff9dfdd4b1d03d2bf6653e7beccf80bdf2debfc92fb1f696dba92fb40287d3c45897e0078951451d0835cb61a5f16d1 README.txt
673cb917cc565ae245d4a7d659227bc240473112bc9c73ae184a64ce74be7994273d6dc4db17194d348941f83a42b3b67d3140f6f23c37c13d6dc93f7d76cc39 rm1-uboot-config-patch.diff
0e98404ca6d20eb01bd9c129b05e2eb10c60a692a56adc221ea283b4bfe7b0bcc2851121d4c3fe51e07a9784c339f7ccb221e0cc3f3603144fec46be66d0cbcc rm2-uboot-config-patch.diff
"

32
user/u-boot-rm/README.txt Normal file
View file

@ -0,0 +1,32 @@
WandBoard
---------
- ROM loads boot loader from raw MMC sectors at fixed address
- NOTE: 1st partition needs to start after boot loader
- Install u-boot with:
dd if=wandboard/SPL of=/dev/mmcblk0 bs=1k seek=1
dd if=wandboard/u-boot.img of=/dev/mmcblk0 bs=1k seek=69
sync
(Note - the SD card node may vary, so adjust this as needed).
- Insert the SD card into the slot located in the bottom of the board
(same side as the mx6 processor)
BeagleBoard
-----------
- ROM looks for 1st partition with FAT, and loads MLO from it
- NOTE: MLO needs to be the first file created on this partition
- Install u-boot with:
cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/
Sunxi (Cubie* etc)
------------------
- ROM loads boot loader from SD-CARD sectors at fixed address
- Install u-boot with:
sudo dd if=<board>/u-boot-sunxi-with-spl.bin of=/dev/sda bs=1024 seek=8

View file

@ -0,0 +1,52 @@
From 58772283210e15f8d803db4aa67c877d668db867 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/u-boot/u-boot/commit/58772283210e15f8d803db4aa67c877d668db867
From: Alistair Delva <adelva@google.com>
Date: Wed, 20 Oct 2021 21:31:33 +0000
Subject: [PATCH] x86: Fix linking u-boot with ld.lld
When linking the final u-boot binary with LLD, the following link errors
are seen:
ld.lld: error: can't create dynamic relocation R_386_32 against local
symbol in readonly segment; recompile object files with
-fPIC or pass '-Wl,-z,notext' to allow text relocations
in the output
>>> defined in arch/x86/cpu/start.o
>>> referenced by arch/x86/cpu/start.o:(.text.start+0x32)
[...]
>>> defined in arch/x86/cpu/start16.o
>>> referenced by arch/x86/cpu/start16.o:(.start16+0x1C)
According to Nick Desaulniers:
"This is a known difference between GNU and LLVM linkers; the GNU
linkers permit relocations in readonly segments (making them not read
only), LLVM does not (by default)."
Since U-Boot apparently seems to use relocations in readonly segments,
change the global linker flags to permit them when linking with LLD by
specifying '-z notext'.
Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index c0ea933cb636..286757986c02 100644
--- a/Makefile
+++ b/Makefile
@@ -776,6 +776,9 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
endif
+# ld.lld support
+LDFLAGS_u-boot += -z notext
+
# Normally we fill empty space with 0xff
quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $(OBJCOPY) --gap-fill=0xff $(OBJCOPYFLAGS) \

View file

@ -0,0 +1,83 @@
diff --git a/include/configs/zero-gravitas.h b/include/configs/zero-gravitas.h
index 074f171422..818ed56892 100644
--- a/include/configs/zero-gravitas.h
+++ b/include/configs/zero-gravitas.h
@@ -71,12 +71,10 @@
"splashimage=0x80000000\0" \
"splashpos=m,m\0" \
"active_partition=2\0" \
- "fallback_partition=3\0" \
"bootlimit=1\0" \
"por=undefined\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "systemd.crash_reboot=true memtest " \
- "root=/dev/mmcblk1p${active_partition} rootwait rootfstype=ext4 quiet rw por=${por};\0" \
+ "root=/dev/mmcblk1p2 rootwait rootfstype=ext4 rw por=${por};\0" \
"loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
@@ -89,41 +87,13 @@
"echo WARN: Cannot load the DT; " \
"fi; " \
"fi; " \
- "fi;\0" \
- "memboot=echo Booting from memory...; " \
- "setenv bootargs console=${console},${baudrate} " \
- "g_mass_storage.stall=0 g_mass_storage.removable=1 " \
- "g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\
- "g_mass_storage.iSerialNumber=\"\" rdinit=/linuxrc; "\
- "bootz ${loadaddr} ${initrd} ${fdt_addr};\0" \
- "altbootcmd=echo Running from fallback root...; " \
- "run memboot; " \
- "if test ${bootcount} -gt 10; then " \
- "echo WARN: Failed too much, resetting bootcount and turning off; " \
- "setenv bootcount 0; " \
- "saveenv; " \
- "poweroff; " \
- "fi; " \
- "setenv mmcpart ${fallback_partition}; " \
- "setenv bootargs console=${console},${baudrate} " \
- "root=/dev/mmcblk1p${fallback_partition} rootwait rootfstype=ext4 quiet rw " \
- "systemd.log_level=debug systemd.log_target=kmsg memtest " \
- "log_buf_len=1M printk.devkmsg systemd.journald.forward_to_console=1; " \
- "run mmcboot;\0" \
+ "fi;\0"
/* Always try to boot from memory first, in case of USB download mode */
#define CONFIG_BOOTCOMMAND \
- "if test ! -e mmc 1:1 uboot.env; then " \
- "saveenv; " \
- "fi; " \
- "run memboot; " \
"run mmcargs; " \
"setenv mmcpart ${active_partition}; " \
- "run mmcboot; " \
- "echo WARN: unable to boot from either RAM or eMMC; " \
- "setenv upgrade_available 1; " \
- "saveenv; " \
- "reset; "
+ "run mmcboot; "
#ifdef CONFIG_BOOTDELAY
#undef CONFIG_BOOTDELAY
@@ -157,18 +127,8 @@
/* Environment organization */
#define CONFIG_ENV_SIZE SZ_8K
-#define CONFIG_ENV_IS_IN_FAT
-/*#define CONFIG_ENV_IS_NOWHERE*/
-
-#ifdef CONFIG_ENV_IS_IN_FAT
-#define CONFIG_BOOTCOUNT_LIMIT
-#define CONFIG_BOOTCOUNT_ENV
-
-#define FAT_ENV_INTERFACE "mmc"
-#define FAT_ENV_DEVICE_AND_PART "1:1"
-#define CONFIG_FAT_WRITE
-#define FAT_ENV_FILE "uboot.env"
-#endif
+/*#define CONFIG_ENV_IS_IN_FAT*/
+#define CONFIG_ENV_IS_NOWHERE
#ifdef CONFIG_CMD_SF
#define CONFIG_MXC_SPI

View file

@ -0,0 +1,75 @@
diff --git a/include/configs/zero-sugar.h.orig b/include/configs/zero-sugar.h
index 6b5450a..dd6da5c 100644
--- a/include/configs/zero-sugar.h.orig
+++ b/include/configs/zero-sugar.h
@@ -122,12 +122,10 @@
"panel=EPD\0" \
"mmcdev=0\0" \
"active_partition=2\0" \
- "fallback_partition=3\0 " \
"bootlimit=1\0 " \
"mmcautodetect=yes\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/mmcblk2p${active_partition} rootwait rootfstype=ext4 rw " \
- "quiet panic=20 systemd.crash_reboot\0" \
+ "root=/dev/mmcblk2p2 rootwait rootfstype=ext4 rw " \
"loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
@@ -140,41 +138,13 @@
"echo WARN: Cannot load the DT; " \
"fi; " \
"fi; " \
- "fi;\0" \
- "memboot=echo Booting from memory...; " \
- "setenv bootargs console=${console},${baudrate} " \
- "g_mass_storage.stall=0 g_mass_storage.removable=1 " \
- "g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\
- "g_mass_storage.iSerialNumber=\"\" rdinit=/linuxrc; "\
- "bootz ${loadaddr} ${initrd} ${fdt_addr};\0" \
- "altbootcmd=echo Running from fallback root...; " \
- "run memboot; " \
- "if test ${bootcount} -gt 10; then " \
- "echo WARN: Failed too much, resetting bootcount and turning off; " \
- "setenv bootcount 0; " \
- "saveenv; " \
- "poweroff; " \
- "fi; " \
- "setenv mmcpart ${fallback_partition}; " \
- "setenv bootargs console=${console},${baudrate} " \
- "root=/dev/mmcblk2p${fallback_partition} rootwait rootfstype=ext4 quiet rw " \
- "systemd.log_level=debug systemd.log_target=kmsg memtest " \
- "log_buf_len=1M printk.devkmsg systemd.journald.forward_to_console=1; " \
- "run mmcboot;\0" \
+ "fi;\0"
/* Always try to boot from memory first, in case of USB download mode */
#define CONFIG_BOOTCOMMAND \
- "if test ! -e mmc 0:1 uboot.env; then " \
- "saveenv; " \
- "fi; " \
- "run memboot; " \
"run mmcargs; " \
"setenv mmcpart ${active_partition}; " \
- "run mmcboot; " \
- "echo WARN: unable to boot from either RAM or eMMC; " \
- "setenv upgrade_available 1; " \
- "saveenv; " \
- "reset; "
+ "run mmcboot; "
#define CONFIG_SYS_MEMTEST_START 0x80000000
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x20000000)
@@ -198,10 +168,8 @@
/* Environment organization */
#define CONFIG_ENV_SIZE SZ_8K
-#ifdef CONFIG_ENV_IS_IN_FAT
-#define CONFIG_BOOTCOUNT_LIMIT
-#define CONFIG_BOOTCOUNT_ENV
-#endif
+/*#define CONFIG_ENV_IS_IN_FAT*/
+#define CONFIG_ENV_IS_NOWHERE
#define CONFIG_SYS_FSL_USDHC_NUM 2

115
user/u-boot-rm/update-u-boot Executable file
View file

@ -0,0 +1,115 @@
#!/bin/sh
verbose=
board=
device=
dryrun=
imagedir=
get_defaults() {
if [ -z "$board" -a -e /sys/firmware/devicetree/base/compatible ]; then
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
wand,*) board=wand ;;
esac
fi
if [ -z "$device" ]; then
case "$board" in
wand|cubie|cubie2) device=/dev/mmcblk0p0 ;;
esac
fi
if [ -z "$imagedir" ]; then
imagedir="$(realpath $(dirname $0))"
[ -f "$imagedir/README.txt" ] || imagedir="/usr/share/u-boot-rm"
fi
}
die() {
echo "ERROR: $@"
exit 1
}
usage() {
get_defaults
cat <<EOF
usage: $0 [-b|--board <board-type>] [-d|--device <device>]
options:
-b,--board <board> Specify the board type: wand, cubie, cubie2
(current default: ${board:-none})
-d,--device <device> Specify the device where to install u-boot
(current default: ${device:-none})
-i,--imagedir <imagedir> Specify u-boot image directory
(current default: ${imagedir:-none})
-n,--dry-run Print commands but don't execute them
EOF
}
while [ $# -gt 0 ]; do
opt="$1"
shift
case "$opt" in
-b|--board)
case "$1" in
wand|wandboard) board="wand" ;;
cubie|cubieboard) board="cubie" ;;
*) usage; exit 1;;
esac
shift
;;
-d|--device)
device="$1"
shift
;;
-i|--imagedir)
imagedir="$1"
shift
;;
-n|--dry-run)
dryrun="echo"
;;
--)
break
;;
-*)
usage
exit 1
;;
esac
done
get_defaults
if [ -z "$board" -o -z "$device" -o -z "$imagedir" -o ! -e "$imagedir" ]; then
usage
exit 1
fi
if [ -z "$dryrun" ]; then
echo "Updating $board u-boot in $device in 3 seconds..."
sleep 3
fi
(
set -e
case "$board" in
wand)
[ -e "$imagedir/wandboard" ] || die "wandboard images not installed, apk add u-boot-wandboard"
$dryrun dd if=$imagedir/wandboard/SPL of=$device bs=1k seek=1 status=none
$dryrun dd if=$imagedir/wandboard/u-boot.img of=$device bs=1k seek=69 status=none
;;
cubie|cubie2)
[ -e "$imagedir/Cubieboard${board#cubie}" ] || die "Cubieboard images not installed, apk add u-boot-cubieboard"
$dryrun dd if=$imagedir/Cubieboard${board#cubie}/u-boot-sunxi-with-spl.bin of=/dev/sda bs=1024 seek=8 status=none
;;
esac
$dryrun sync
) || die "U-Boot installation in $device failed"
[ -z "$dryrun" ] && echo "Completed successfully."