Skip to content

Commit

Permalink
update to r83; no wifi drv
Browse files Browse the repository at this point in the history
  • Loading branch information
yunshansimon committed Aug 14, 2020
1 parent 6ed883f commit ddc1862
Show file tree
Hide file tree
Showing 31 changed files with 11,592 additions and 20 deletions.
25 changes: 22 additions & 3 deletions chromeos-base/chromeos-bsp-tinker/chromeos-bsp-tinker-1.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
EAPI=4
EAPI=5

inherit udev

DESCRIPTION="Asus Tinkerboad BSP package (meta package to pull in driver/tool dependencies)"

Expand All @@ -12,6 +14,23 @@ RDEPEND="
x11-drivers/mali-rules
chromeos-base/auto-expand-partition
bluetooth? ( net-wireless/rtl8723bs_bt )
sys-boot/tinker-uboot
sys-boot/tinker-uboot-bin
x11-drivers/mali-rules
"
DEPEND="${RDEPEND}
!media-libs/media-rules
"
DEPEND="${RDEPEND}"

S=$WORKDIR

src_install() {
insinto /lib/firmware
doins -r ${FILESDIR}/rtlwifi
insinto "/etc" │·
doins "${FILESDIR}/cpufreq-419/cpufreq.conf"
insinto "/etc/init"
doins "${FILESDIR}/cpufreq-419/platform-cpusets.conf"
doins "${FILESDIR}/udev/udev-trigger-codec.conf"
udev_dorules "${FILESDIR}/udev/50-media.rules"
udev_dorules "${FILESDIR}/udev/99-rk3288-ehci-persist.rules"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CPUFREQ_GOVERNOR="schedutil"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#

on early-boot
# Mount SchedTune controller and create tuning groups.
mkdir /dev/stune
mount cgroup none /dev/stune schedtune
mkdir /dev/stune/foreground
chown system system /dev/stune
chown system system /dev/stune/foreground
chown system system /dev/stune/tasks
chown system system /dev/stune/foreground/tasks
chmod 0664 /dev/stune/tasks
chmod 0664 /dev/stune/foreground/tasks

# Foreground tasks get schedule boost
write /dev/stune/foreground/schedtune.boost 20
write /dev/stune/foreground/schedtune.prefer_idle 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

description "set up cgroups according to the platform (veyron) needs"
author "chromium-os-dev@chromium.org"

start on stopped cgroups
task

script
# We use a schedtune cgroup to boost the deadline sensitive tasks.
schedtune_dir="/sys/fs/cgroup/schedtune/chrome"
# default boost parameters
echo 20 > "${schedtune_dir}/urgent/schedtune.boost"
echo 1 > "${schedtune_dir}/urgent/schedtune.prefer_idle"

# enable touch boosting
echo 75 > /sys/module/cpu_boost/parameters/input_boost_freq_percent
end script
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions chromeos-base/chromeos-bsp-tinker/files/udev/50-media.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ACTION!="add", GOTO="media_end"
SUBSYSTEM!="video4linux", GOTO="v4l_end"

# TODO(owenlin): Remove "video-dec" once all clients are updated and understand
# numbering.
# Use for kernel v3.14
ATTR{name}=="rk3288-vpu-dec", SYMLINK+="video-dec video-dec0"
ATTR{name}=="rk3288-vpu-enc", SYMLINK+="video-enc"
# Use for kernel v4.19
ATTR{name}=="rockchip,rk3288-vpu-dec", SYMLINK+="video-dec video-dec0"
ATTR{name}=="rockchip,rk3288-vpu-enc", SYMLINK+="video-enc"

LABEL="v4l_end"
SUBSYSTEM!="media", GOTO="media_end"

ATTR{model}=="hantro-vpu", SYMLINK+="media-dec0"

LABEL="media_end"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Slow down autosuspend for hubs under dwc2 host port
#
# Autosuspend on dwc2's "host" port is pretty broken. When we see a "remote
# wakeup" we have to fully reset the port.
#
# If we disable autosuspend then the main downside is that security keys will
# take up more power. That's not so good for laptops. ...so we don't do it.
# We don't actually allow autosuspend for too many devices anyway.
#
# One type of thing that _does_ get autosuspend turned on is USB hubs. That
# means if you plug in an empty USB hub you'll see the "remote wakeup" when
# you plug the first device in. Though a bit gross, this isn't a huge deal.
# After all you're just re-enumerating an empty hub.
#
# ...but...
#
# It turns out that for at least one hub I looked at (an Amazon Basics one)
# the device goes back and autosuspends again quickly after we reset it.
# Thus we get into a loop that looks like this:
#
# 1. Plug in empty hub.
# 2. Empty hub autosuspends.
# 3. Plug in new device.
# 4. Hub does a remote wakeup to us because there's a device.
# 5. We wee the remote wakeup and reset (looks like plug / unplug of the hub).
# 6. Enumerate the hub.
# 7. Before we can enumerate the device in the hub, hub autosuspends.
# 8. Hub realizes that there's a device and does a remote wakeup.
# 9. Goto step #5
#
# We can _sometimes_ get out of the loop if we win the race and enumerate the
# device before the hub suspends.
#
# Let's make the race a little more likely to be won by giving ourselves
# 1 second before we autosuspend things that originally were going to
# autosuspend after 0 seconds.

ACTION=="add|change", KERNELS=="ff540000.usb", ATTR{product}!="DWC OTG Controller", ATTR{bDeviceClass}=="09", ATTR{power/autosuspend_delay_ms}=="0", ATTR{power/autosuspend_delay_ms}="1000"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Workaround: On RK3288 the EHCI controller is quirky and requires
# USB devices to be reset on resume. To prevent userspace from failing
# after this happens, persist needs to be enabled on devices connected
# to this controller.
#
# Note that this is safe, because only internal devices use this controller.

ACTION=="add|change", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_MODEL}!="EHCI_Host_Controller", DRIVERS=="ehci-platform", ATTR{power/persist}="1"

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Don't allow autosuspend for things on the dwc2 controllers
#
# Autosuspend sorta works on dwc2 but sometimes causes the device to be reset.
# In some cases this is intentional due to the "remote wakeup" problem on the
# dwc2 host-only port (see the "snps,need-phy-full-reset-on-wake" property)
# but in other cases it looks like something about the suspend sequence in dwc2
# and/or the PHY isn't quite right.
#
# In general Chrome OS doesn't use autosuspend much and it's turned off for
# almost all USB devices. Notably the only devices that have autosuspend
# enabled are:
# - webcams
# - security keys
# - usb peripherals that are expected to be connected internally
# See power manager's "udev/gen_autosuspend_rules.py"
#
# If we disable autosuspend then the main downside is that security keys will
# take up more power. That's not so good for laptops, but it's unlikely to
# be a big negative for Chromeboxes.
#
# We'll include this udev rule on any "ac_only" devices. That will make them
# work a little better with webcams in particular (one of the few things you
# might plug in that had autosuspend turned on). It's unfortunate that we
# can't do something that would fix everyone with no compromises, but this is
# better than nothing. If nothing else it's not really expected that someone
# would plug a webcam into their laptop.

ACTION=="add|change", KERNELS=="ff540000.usb", DRIVER!="dwc2", ATTR{product}!="DWC OTG Controller", ATTR{power/control}="on"
ACTION=="add|change", KERNELS=="ff580000.usb", DRIVER!="dwc2", ATTR{product}!="DWC OTG Controller", ATTR{power/control}="on"

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

description "Replay codec video device udev events"
author "chromium-os-dev@chromium.org"

# This job is used to replay events of codec video devices. Chrome queries
# the video nodes for hardware decode and encode capabilities when it starts.
# The video nodes have to be present before it starts. So this job is a task
# and blocks Chrome to start.
#
# To avoid hardcoding the names in udev-trigger.conf, these events are
# replayed again there. But these events are simple and do not increase
# much boot time.
start on starting boot-services
task

script
udevadm trigger --action=add --subsystem-match=video4linux \
--attr-match="name=rk3288-vpu*"
exec udevadm settle
end script
16 changes: 16 additions & 0 deletions chromeos-base/chromeos-config-bsp/chromeos-config-bsp-0.0.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2018 The Fyde OS Authors. All rights reserved.
# Distributed under the terms of the BSD

EAPI="5"

DESCRIPTION="empty project"
HOMEPAGE="http://fydeos.com"

LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE=""

RDEPEND=""

DEPEND="${RDEPEND}"
Loading

0 comments on commit ddc1862

Please sign in to comment.