Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Odroid C2 improvements #148

Open
wants to merge 2 commits into
base: kirkstone
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From eaaf9cff3e2d5d0f3cb2c7cd12ded55ca0aa5f5f Mon Sep 17 00:00:00 2001
From: Tomasz Olszak <[email protected]>
Date: Thu, 12 Jan 2023 14:56:35 +0100
Subject: [PATCH 1/2] Odroid C2 - enable microusb

---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index 201596247fd9..927292af54d1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -348,7 +348,7 @@ &saradc {
};

&scpi_clocks {
- status = "disabled";
+ status = "okay";
};

/* SD */
@@ -400,17 +400,16 @@ &uart_AO {
};

&usb0_phy {
- status = "disabled";
+ status = "okay";
phy-supply = <&usb_otg_pwr>;
};

&usb1_phy {
status = "okay";
- phy-supply = <&usb_otg_pwr>;
};

&usb0 {
- status = "disabled";
+ status = "okay";
};

&usb1 {
--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 192eab71ec617a793812f2ae34783c077b62a9cc Mon Sep 17 00:00:00 2001
From: Tomasz Olszak <[email protected]>
Date: Thu, 15 Dec 2022 12:03:50 +0100
Subject: [PATCH 2/2] Odroid C2 : overclock to 1752000000

---
drivers/firmware/arm_scpi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index ddf0b9ff9e15..2a41f466e03f 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -622,7 +622,8 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
if (scpi_info->dvfs[domain]) /* data already populated */
return scpi_info->dvfs[domain];

- ret = scpi_send_message(CMD_GET_DVFS_INFO, &domain, sizeof(domain),
+ u8 odroidc2_overclocked_domain = domain | 0x80;
+ ret = scpi_send_message(CMD_GET_DVFS_INFO, &odroidc2_overclocked_domain, sizeof(odroidc2_overclocked_domain),
&buf, sizeof(buf));
if (ret)
return ERR_PTR(ret);
@@ -641,8 +642,13 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
}

for (i = 0, opp = info->opps; i < info->count; i++, opp++) {
+
opp->freq = le32_to_cpu(buf.opps[i].freq);
opp->m_volt = le32_to_cpu(buf.opps[i].m_volt);
+ if (opp->freq >= 1752000000) {
+ info->count = i + 1;
+ break;
+ }
}

sort(info->opps, info->count, sizeof(*opp), opp_cmp_func, NULL);
--
2.25.1

5 changes: 5 additions & 0 deletions recipes-kernel/linux/linux-yocto_5.15.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:"
SRC_URI:append:meson-gx = " file://0001-drm-bridge-display-connector-implement-bus-fmts-call.patch;minrev=v5.16.62%;maxrev=v5.16.67"

SRC_URI:append:meson-g12a = " file://0002-FROMLIST-arm64-dts-amlogic-add-support-for-radxa-zero.patch"

SRC_URI:append:hardkernel-odroidc2 = " file://0001-Odroid-C2-enable-microusb.patch"

# Uncomment to enable overclocking to 1752 on Odroid C2
#SRC_URI:append:hardkernel-odroidc2 = " file://0002-Odroid-C2-overclock-to-1752000000.patch"