Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit 5f694b6

Browse files
committed
fixes and patches
added patches to repo, optimized, added options for different patches and oc coreboot
1 parent 872079b commit 5f694b6

File tree

4 files changed

+208
-15
lines changed

4 files changed

+208
-15
lines changed

Foster_Tab_Q_Build_Script.sh

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# get current working directory
4+
CWD = $(pwd)
5+
36
# get threads for tasks
47
JOBS=$(($(nproc) + 1))
58

@@ -9,9 +12,24 @@ sudo apt install bc bison build-essential ccache curl flex g++-multilib gcc-mult
912
> libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc
1013
> zip zlib1g-dev
1114

15+
# chill in home
16+
cd ~/
17+
1218
# rom type?
1319
read -p "Do ya want android (t) or android tv (f)? " FOSTERTYPE
1420

21+
# oc coreboot?
22+
read -p "Do ya want an 1862 MHz memory OC (y/n)? " MEMOC
23+
24+
# oc patch?
25+
read -p "Do ya want a CPU OC (y/n)? " CPUOC
26+
27+
# joycon-swap?
28+
read -p "Do ya want the joycon trigger patch (y/n)? " JCPATCH
29+
30+
# wdc?
31+
read -p "Do ya want to test with wdc patch (y/n)? " WDCPATCH
32+
1533
# check to see if git is configured, if not prompt user
1634
if ["$(git config --list)" != *"user.email"*]
1735
then
@@ -76,20 +94,36 @@ repopick -t icosa-bt-lineage-17.1
7694
repopick 287339
7795
repopick 284553
7896

79-
# patch bionic_intrinsics, nvcpl, oc, joycond, and foster
80-
cd bionic
81-
patch -p1 < ../.repo/local_manifests/patches/bionic_intrinsics.patch
82-
cd ../frameworks/base
83-
patch -p1 < ../../.repo/local_manifests/patches/frameworks_base_nvcpl.patch
84-
cd ../../kernel/nvidia/linux-4.9/kernel/kernel-4.9
85-
patch -p1 < ../../../../../.repo/local_manifests/patches/oc-android10.patch
86-
cd ~/android/lineage/hardware/nintendo/joycond
87-
patch -p1 < ../../../.repo/local_manifests/patches/joycond10.patch
88-
wget -O .repo/android_device_nvidia_foster.patch https://gitlab.com/ZachyCatGames/q-tips-guide/-/raw/master/res/android_device_nvidia_foster.patch
89-
cd ~/android/lineage/device/nvidia/foster
90-
rm patch -p1 < ../../../.repo/android_device_nvidia_foster.patch
91-
patch -p1 < ../../../.repo/android_device_nvidia_foster.patch
92-
cd ../../../
97+
# patches
98+
cd ~/android/lineage/bionic
99+
patch -p1 < ~/android/lineage/.repo/local_manifests/patches/bionic_intrinsics.patch
100+
101+
# nvcpl patch
102+
cd ~/android/lineage/frameworks/base
103+
patch -p1 < ~/android/lineage/.repo/local_manifests/patches/frameworks_base_nvcpl.patch
104+
105+
# cpu oc patch
106+
if [$CPUOC == "y"];
107+
then
108+
cd ../../kernel/nvidia/linux-4.9/kernel/kernel-4.9
109+
patch -p1 < $CWD/patches/oc-android10.patch
110+
fi
111+
112+
# joycon patch
113+
if [$JCPATCH == "y"];
114+
then
115+
cd ~/android/lineage/hardware/nintendo/joycond
116+
patch -p1 < $CWD/patches/joycond10.patch
117+
fi
118+
119+
# wdc patch
120+
if [$WDCPATCH == "y"];
121+
then
122+
cd /hardware/nvidia/platform/t210/icosa
123+
patch -p1 < $CWD/patches/wdc.patch
124+
125+
# reset back to lineage directory
126+
cd ~/android/lineage
93127

94128
# ccache
95129
export USE_CCACHE=1
@@ -141,7 +175,15 @@ cp ~/android/lineage/out/target/product/$OUTPUTFILE/obj/KERNEL_OBJ/arch/arm64/bo
141175
echo "Downloading twrp..."
142176
curl -L -o ~/android/output/switchroot/install/twrp.img https://github.com/PabloZaiden/switchroot-android-build/raw/master/external/twrp.img
143177
echo "Downloading coreboot.rom..."
144-
curl -L -o ~/android/output/switchroot/android/coreboot.rom https://github.com/PabloZaiden/switchroot-android-build/raw/master/external/coreboot.rom
178+
179+
# oc coreboot check
180+
if [$MEMOC == "y"];
181+
then
182+
curl -L -o ~/android/output/switchroot/android/coreboot.rom https://cdn.discordapp.com/attachments/667093920005619742/772516469078622239/coreboot-oc.rom
183+
else
184+
curl -L -o ~/android/output/switchroot/android/coreboot.rom https://github.com/PabloZaiden/switchroot-android-build/raw/master/external/coreboot.rom
185+
fi
186+
145187
echo "Downloading 00-android.ini..."
146188
curl -L -o ~/android/output/bootloader/ini/00-android.ini https://gitlab.com/ZachyCatGames/shitty-pie-guide/-/raw/master/res/00-android.ini?inline=false
147189
echo "Downloading boot scripts..."

patches/joycond10.patch

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
diff --git a/android/Vendor_057e_Product_2008.kl b/android/Vendor_057e_Product_2008.kl
2+
index 0b96cab..11fb6cb 100644
3+
--- a/android/Vendor_057e_Product_2008.kl
4+
+++ b/android/Vendor_057e_Product_2008.kl
5+
@@ -1,15 +1,13 @@
6+
-key 309 BACK
7+
+key 309 SYSRQ
8+
key 314 BUTTON_SELECT
9+
key 318 BUTTON_THUMBR
10+
key 317 BUTTON_THUMBL
11+
-key 304 BUTTON_A
12+
-key 305 BUTTON_B
13+
+key 305 BUTTON_A
14+
+key 304 BUTTON_B
15+
key 308 BUTTON_X
16+
key 307 BUTTON_Y
17+
key 310 BUTTON_L1
18+
key 311 BUTTON_R1
19+
-key 312 BUTTON_L2
20+
-key 313 BUTTON_R2
21+
key 315 BUTTON_START
22+
key 316 HOME
23+
key 544 DPAD_UP
24+
@@ -21,3 +19,5 @@ axis 0x00 X
25+
axis 0x01 Y
26+
axis 0x03 Z
27+
axis 0x04 RZ
28+
+axis 0x02 LTRIGGER
29+
+axis 0x05 RTRIGGER
30+
diff --git a/src/virt_ctlr_combined.cpp b/src/virt_ctlr_combined.cpp
31+
index b33da76..e168a1c 100644
32+
--- a/src/virt_ctlr_combined.cpp
33+
+++ b/src/virt_ctlr_combined.cpp
34+
@@ -40,6 +40,17 @@ void virt_ctlr_combined::relay_events(std::shared_ptr<phys_ctlr> phys)
35+
ret = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
36+
continue;
37+
}
38+
+
39+
+ /* Second remap the ZL and ZR buttons on each physical controller */
40+
+ if (phys == physl && ev.type == EV_KEY && ev.code == BTN_TL2) {
41+
+ libevdev_uinput_write_event(uidev, EV_ABS, ABS_Z, ev.value);
42+
+ ret = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
43+
+ continue;
44+
+ } else if (phys == physr && ev.type == EV_KEY && ev.code == BTN_TR2) {
45+
+ libevdev_uinput_write_event(uidev, EV_ABS, ABS_RZ, ev.value);
46+
+ ret = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
47+
+ continue;
48+
+ }
49+
libevdev_uinput_write_event(uidev, ev.type, ev.code, ev.value);
50+
}
51+
ret = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
52+
@@ -220,8 +231,6 @@ virt_ctlr_combined::virt_ctlr_combined(std::shared_ptr<phys_ctlr> physl, std::sh
53+
libevdev_enable_event_code(virt_evdev, EV_KEY, BTN_DPAD_RIGHT, NULL);
54+
libevdev_enable_event_code(virt_evdev, EV_KEY, BTN_TL, NULL);
55+
libevdev_enable_event_code(virt_evdev, EV_KEY, BTN_TR, NULL);
56+
- libevdev_enable_event_code(virt_evdev, EV_KEY, BTN_TL2, NULL);
57+
- libevdev_enable_event_code(virt_evdev, EV_KEY, BTN_TR2, NULL);
58+
59+
// Map the S triggers to these misc. buttons if not connected via serial.
60+
if (!physl->is_serial_ctlr() && !physr->is_serial_ctlr()) {
61+
@@ -236,12 +245,22 @@ virt_ctlr_combined::virt_ctlr_combined(std::shared_ptr<phys_ctlr> physl, std::sh
62+
absconfig.maximum = 32767;
63+
absconfig.fuzz = 250;
64+
absconfig.flat = 500;
65+
+
66+
+ struct input_absinfo absconfig_fake = { 0 };
67+
+ absconfig_fake.minimum = 0;
68+
+ absconfig_fake.maximum = 1;
69+
+ absconfig_fake.fuzz = 0;
70+
+ absconfig_fake.flat = 0;
71+
+
72+
libevdev_enable_event_type(virt_evdev, EV_ABS);
73+
libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_X, &absconfig);
74+
libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_Y, &absconfig);
75+
libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_RX, &absconfig);
76+
libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_RY, &absconfig);
77+
78+
+ libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_Z, &absconfig_fake);
79+
+ libevdev_enable_event_code(virt_evdev, EV_ABS, ABS_RZ, &absconfig_fake);
80+
+
81+
libevdev_enable_event_type(virt_evdev, EV_FF);
82+
libevdev_enable_event_code(virt_evdev, EV_FF, FF_RUMBLE, NULL);
83+
libevdev_enable_event_code(virt_evdev, EV_FF, FF_PERIODIC, NULL);

patches/oc-android10.patch

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
2+
index f17014b9c38d..311edf15c48c 100644
3+
--- a/drivers/clk/tegra/clk-dfll.c
4+
+++ b/drivers/clk/tegra/clk-dfll.c
5+
@@ -3057,7 +3057,7 @@ static int dfll_build_i2c_lut(struct tegra_dfll *td, int v_max)
6+
if (selector != td->lut[j - 1])
7+
td->lut[j++] = selector;
8+
9+
- if (v >= v_max)
10+
+ if (v > v_max)
11+
break;
12+
}
13+
td->lut_size = j;
14+
diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
15+
index 1d63c90cff00..d2039f8083f0 100644
16+
--- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
17+
+++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
18+
@@ -99,7 +99,7 @@ static const unsigned long tegra210_cpu_max_freq_table[] = {
19+
[0] = 1912500000UL,
20+
[1] = 1912500000UL,
21+
[2] = 2218500000UL,
22+
- [3] = 1785000000UL,
23+
+ [3] = 2091000000UL,
24+
[4] = 1632000000UL,
25+
[5] = 1912500000UL,
26+
[6] = 2014500000UL,
27+
@@ -245,6 +245,9 @@ static const unsigned long tegra210_cpu_max_freq_table[] = {
28+
{1581000000UL, {1130000, 0, 0} }, \
29+
{1683000000UL, {1168000, 0, 0} }, \
30+
{1785000000UL, {1227500, 0, 0} }, \
31+
+ {1887000000UL, {1241400, 0, 0} }, \
32+
+ {1989000000UL, {1270408, 0, 0} }, \
33+
+ {2091000000UL, {1298886, 0, 0} }, \
34+
{0, { 0, 0, 0} }, \
35+
}
36+
37+
diff --git a/drivers/soc/tegra/tegra210-dvfs.c b/drivers/soc/tegra/tegra210-dvfs.c
38+
index 1f3d664c53e0..30f4e70e3151 100644
39+
--- a/drivers/soc/tegra/tegra210-dvfs.c
40+
+++ b/drivers/soc/tegra/tegra210-dvfs.c
41+
@@ -377,6 +377,9 @@ static struct dvfs cpu_dvfs = {
42+
{1581000000UL, { 2889664, -122173, 1834 } }, \
43+
{1683000000UL, { 5100873, -279186, 4747 } }, \
44+
{1785000000UL, { 5100873, -279186, 4747 } }, \
45+
+ {1887000000UL, { 5100873, -279186, 4747 } }, \
46+
+ {1989000000UL, { 5100873, -279186, 4747 } }, \
47+
+ {2091000000UL, { 5100873, -279186, 4747 } }, \
48+
{0, { } }, \
49+
}
50+

patches/wdt.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/kernel-dts/tegra210-icosa-common.dtsi b/kernel-dts/tegra210-icosa-common.dtsi
2+
index 7178913..5e9fce2 100644
3+
--- a/kernel-dts/tegra210-icosa-common.dtsi
4+
+++ b/kernel-dts/tegra210-icosa-common.dtsi
5+
@@ -446,6 +446,13 @@
6+
7+
};
8+
9+
+ tegra_wdt: watchdog@60005100 {
10+
+ dt-override-status-odm-data = <0x00010000 0x00010000>;
11+
+ timeout-sec = <120>;
12+
+ status = "okay";
13+
+ };
14+
+
15+
+
16+
joyconr_charger: joyconr_charger {
17+
status = "okay";
18+
compatible = "regulator-fixed";

0 commit comments

Comments
 (0)