Skip to content

Commit

Permalink
Changelog:
Browse files Browse the repository at this point in the history
- Build Brunch against ChromeOS r119
- Update kernels to r121
  • Loading branch information
sebanc committed Dec 9, 2023
1 parent 3a98842 commit 9d01b30
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 214 deletions.
2 changes: 1 addition & 1 deletion build_brunch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ ! -z $1 ] && [ "$1" != "skip" ] ; then
else
git clone -b master https://github.com/sebanc/chromeos-ota-extract.git rootfs || { echo "Failed to clone chromeos-ota-extract"; exit 1; }
cd rootfs
curl -L https://dl.google.com/chromeos/rammus/15604.57.0/stable-channel/chromeos_15604.57.0_rammus_stable-channel_full_mp-v3.bin-gy2tgyrvgyydbr3dkz5iqxodi6tym6w7.signed -o ./update.signed || { echo "Failed to Download the OTA update"; exit 1; }
curl -L https://dl.google.com/chromeos/rammus/15633.65.0/stable-channel/chromeos_15633.65.0_rammus_stable-channel_full_mp-v3.bin-gy2tmzbxmy3ts65sgw6pixqqcmkmxsz4.signed -o ./update.signed || { echo "Failed to Download the OTA update"; exit 1; }
python3 extract_android_ota_payload.py ./update.signed || { echo "Failed to extract the OTA update"; exit 1; }
cd ..
[ -f ./rootfs/root.img ] || { echo "ChromeOS rootfs has not been extracted"; exit 1; }
Expand Down
204 changes: 0 additions & 204 deletions kernel-patches/5.15/base/base.patch
Original file line number Diff line number Diff line change
Expand Up @@ -51832,210 +51832,6 @@ diff -ruN a/drivers/regulator/core.c b/drivers/regulator/core.c
return current_uV;
}

diff -ruN a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c
--- a/drivers/rpmsg/mtk_rpmsg.c 2021-12-08 09:04:57.000000000 +0100
+++ b/drivers/rpmsg/mtk_rpmsg.c 2021-12-23 08:35:44.000000000 +0100
@@ -183,7 +183,7 @@
int ret;

for_each_available_child_of_node(node, child) {
- ret = of_property_read_string(child, "mtk,rpmsg-name", &name);
+ ret = of_property_read_string(child, "mediatek,rpmsg-name", &name);
if (ret)
continue;

diff -ruN a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
--- a/drivers/rpmsg/qcom_glink_native.c 2021-12-08 09:04:57.000000000 +0100
+++ b/drivers/rpmsg/qcom_glink_native.c 2021-12-23 08:35:44.000000000 +0100
@@ -92,6 +92,8 @@
* @rcids: idr of all channels with a known remote channel id
* @features: remote features
* @intentless: flag to indicate that there is no intent
+ * @tx_avail_notify: Waitqueue for pending tx tasks
+ * @sent_read_notify: flag to check cmd sent or not
*/
struct qcom_glink {
struct device *dev;
@@ -118,6 +120,8 @@
unsigned long features;

bool intentless;
+ wait_queue_head_t tx_avail_notify;
+ bool sent_read_notify;
};

enum {
@@ -301,6 +305,20 @@
glink->tx_pipe->write(glink->tx_pipe, hdr, hlen, data, dlen);
}

+static void qcom_glink_send_read_notify(struct qcom_glink *glink)
+{
+ struct glink_msg msg;
+
+ msg.cmd = cpu_to_le16(RPM_CMD_READ_NOTIF);
+ msg.param1 = 0;
+ msg.param2 = 0;
+
+ qcom_glink_tx_write(glink, &msg, sizeof(msg), NULL, 0);
+
+ mbox_send_message(glink->mbox_chan, NULL);
+ mbox_client_txdone(glink->mbox_chan, 0);
+}
+
static int qcom_glink_tx(struct qcom_glink *glink,
const void *hdr, size_t hlen,
const void *data, size_t dlen, bool wait)
@@ -321,12 +339,21 @@
goto out;
}

+ if (!glink->sent_read_notify) {
+ glink->sent_read_notify = true;
+ qcom_glink_send_read_notify(glink);
+ }
+
/* Wait without holding the tx_lock */
spin_unlock_irqrestore(&glink->tx_lock, flags);

- usleep_range(10000, 15000);
+ wait_event_timeout(glink->tx_avail_notify,
+ qcom_glink_tx_avail(glink) >= tlen, 10 * HZ);

spin_lock_irqsave(&glink->tx_lock, flags);
+
+ if (qcom_glink_tx_avail(glink) >= tlen)
+ glink->sent_read_notify = false;
}

qcom_glink_tx_write(glink, hdr, hlen, data, dlen);
@@ -986,6 +1013,9 @@
unsigned int cmd;
int ret = 0;

+ /* To wakeup any blocking writers */
+ wake_up_all(&glink->tx_avail_notify);
+
for (;;) {
avail = qcom_glink_rx_avail(glink);
if (avail < sizeof(msg))
@@ -1271,6 +1301,8 @@
} __packed req;
int ret;
unsigned long flags;
+ int chunk_size = len;
+ int left_size = 0;

if (!glink->intentless) {
while (!intent) {
@@ -1304,18 +1336,46 @@
iid = intent->id;
}

+ if (wait && chunk_size > SZ_8K) {
+ chunk_size = SZ_8K;
+ left_size = len - chunk_size;
+ }
req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA);
req.msg.param1 = cpu_to_le16(channel->lcid);
req.msg.param2 = cpu_to_le32(iid);
- req.chunk_size = cpu_to_le32(len);
- req.left_size = cpu_to_le32(0);
+ req.chunk_size = cpu_to_le32(chunk_size);
+ req.left_size = cpu_to_le32(left_size);

- ret = qcom_glink_tx(glink, &req, sizeof(req), data, len, wait);
+ ret = qcom_glink_tx(glink, &req, sizeof(req), data, chunk_size, wait);

/* Mark intent available if we failed */
- if (ret && intent)
+ if (ret && intent) {
intent->in_use = false;
+ return ret;
+ }

+ while (left_size > 0) {
+ data = (void *)((char *)data + chunk_size);
+ chunk_size = left_size;
+ if (chunk_size > SZ_8K)
+ chunk_size = SZ_8K;
+ left_size -= chunk_size;
+
+ req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA_CONT);
+ req.msg.param1 = cpu_to_le16(channel->lcid);
+ req.msg.param2 = cpu_to_le32(iid);
+ req.chunk_size = cpu_to_le32(chunk_size);
+ req.left_size = cpu_to_le32(left_size);
+
+ ret = qcom_glink_tx(glink, &req, sizeof(req), data,
+ chunk_size, wait);
+
+ /* Mark intent available if we failed */
+ if (ret && intent) {
+ intent->in_use = false;
+ break;
+ }
+ }
return ret;
}

@@ -1387,9 +1447,7 @@
static void qcom_glink_rpdev_release(struct device *dev)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
- struct glink_channel *channel = to_glink_channel(rpdev->ept);

- channel->rpdev = NULL;
kfree(rpdev);
}

@@ -1494,6 +1552,7 @@

rpmsg_unregister_device(glink->dev, &chinfo);
}
+ channel->rpdev = NULL;

qcom_glink_send_close_ack(glink, channel->rcid);

@@ -1507,9 +1566,13 @@

static void qcom_glink_rx_close_ack(struct qcom_glink *glink, unsigned int lcid)
{
+ struct rpmsg_channel_info chinfo;
struct glink_channel *channel;
unsigned long flags;

+ /* To wakeup any blocking writers */
+ wake_up_all(&glink->tx_avail_notify);
+
spin_lock_irqsave(&glink->idr_lock, flags);
channel = idr_find(&glink->lcids, lcid);
if (WARN(!channel, "close ack on unknown channel\n")) {
@@ -1521,6 +1584,16 @@
channel->lcid = 0;
spin_unlock_irqrestore(&glink->idr_lock, flags);

+ /* Decouple the potential rpdev from the channel */
+ if (channel->rpdev) {
+ strscpy(chinfo.name, channel->name, sizeof(chinfo.name));
+ chinfo.src = RPMSG_ADDR_ANY;
+ chinfo.dst = RPMSG_ADDR_ANY;
+
+ rpmsg_unregister_device(glink->dev, &chinfo);
+ }
+ channel->rpdev = NULL;
+
kref_put(&channel->refcount, qcom_glink_channel_release);
}

@@ -1670,6 +1743,7 @@
spin_lock_init(&glink->rx_lock);
INIT_LIST_HEAD(&glink->rx_queue);
INIT_WORK(&glink->rx_work, qcom_glink_work);
+ init_waitqueue_head(&glink->tx_avail_notify);

spin_lock_init(&glink->idr_lock);
idr_init(&glink->lcids);
diff -ruN a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
--- a/drivers/scsi/scsi_pm.c 2021-12-08 09:04:57.000000000 +0100
+++ b/drivers/scsi/scsi_pm.c 2021-12-23 08:35:46.000000000 +0100
Expand Down
8 changes: 0 additions & 8 deletions kernel-patches/6.1/others/steamdeck.patch
Original file line number Diff line number Diff line change
Expand Up @@ -719,14 +719,6 @@ diff -ruN a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -474,6 +475,7 @@
XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
+ XPAD_XBOXONE_VENDOR(0x10f5), /* Turtle Beach Controllers */
XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
XPAD_XBOX360_VENDOR(0x1209), /* Ardwiino Controllers */
XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
@@ -492,7 +494,9 @@
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
Expand Down
2 changes: 1 addition & 1 deletion prepare_kernels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ done
rm -rf ./kernels
mkdir ./kernels

chromeos_version="R120"
chromeos_version="R121"
download_and_patch_kernels

0 comments on commit 9d01b30

Please sign in to comment.