user/linux-rm: new aport

This commit is contained in:
Antoine Martin 2023-04-23 02:30:43 -04:00 committed by Antoine Martin
parent cbca51c7aa
commit 13ac30af62
7 changed files with 1123 additions and 0 deletions

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>
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
"
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::$CTARGET_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_MOD_STRIP=1 \
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"
# shellcheck disable=SC2046
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>;*/
+ };
+};