mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-04-19 22:57:14 +00:00
Compare commits
No commits in common. "dev" and "15.0.rc2" have entirely different histories.
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@ -138,7 +138,7 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.10.0
|
||||
- name: Log in to the GitHub container registry
|
||||
uses: docker/login-action@v3.4.0
|
||||
uses: docker/login-action@v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
|
25
.github/workflows/lock.yml
vendored
25
.github/workflows/lock.yml
vendored
@ -1,25 +0,0 @@
|
||||
name: Lock
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "45 5 * * *"
|
||||
|
||||
permissions:
|
||||
discussions: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v5.0.1
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: "30"
|
||||
exclude-issue-created-before: "2025-01-01T00:00:00Z"
|
||||
issue-lock-reason: ""
|
||||
pr-inactive-days: "7"
|
||||
exclude-pr-created-before: "2025-01-01T00:00:00Z"
|
||||
pr-lock-reason: ""
|
@ -3,7 +3,7 @@
|
||||
|
||||
| Board | Version |
|
||||
|-------|---------|
|
||||
| Open Virtual Appliance | 6.12.23 |
|
||||
| Open Virtual Appliance | 6.12.18 |
|
||||
| Raspberry Pi | 6.6.74 |
|
||||
| Raspberry Pi 0-W | 6.6.74 |
|
||||
| Raspberry Pi 2 | 6.6.74 |
|
||||
@ -11,14 +11,14 @@
|
||||
| Raspberry Pi 4 | 6.6.74 |
|
||||
| Raspberry Pi 5 | 6.6.74 |
|
||||
| Home Assistant Yellow | 6.6.74 |
|
||||
| Home Assistant Green | 6.12.23 |
|
||||
| Tinker Board | 6.12.23 |
|
||||
| ODROID-C2 | 6.12.23 |
|
||||
| ODROID-C4 | 6.12.23 |
|
||||
| ODROID-M1 | 6.12.23 |
|
||||
| ODROID-M1S | 6.12.23 |
|
||||
| ODROID-N2 | 6.12.23 |
|
||||
| ODROID-XU4 | 6.12.23 |
|
||||
| Generic aarch64 | 6.12.23 |
|
||||
| Generic x86-64 | 6.12.23 |
|
||||
| Khadas VIM3 | 6.12.23 |
|
||||
| Home Assistant Green | 6.12.18 |
|
||||
| Tinker Board | 6.12.18 |
|
||||
| ODROID-C2 | 6.12.18 |
|
||||
| ODROID-C4 | 6.12.18 |
|
||||
| ODROID-M1 | 6.12.18 |
|
||||
| ODROID-M1S | 6.12.18 |
|
||||
| ODROID-N2 | 6.12.18 |
|
||||
| ODROID-XU4 | 6.12.18 |
|
||||
| Generic aarch64 | 6.12.18 |
|
||||
| Generic x86-64 | 6.12.18 |
|
||||
| Khadas VIM3 | 6.12.18 |
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ead21eb6d24055317b7281b1a8e7d1d6e809313b
|
||||
Subproject commit 3914f8cad5a87a3aa1ba3aa04733887a869b87fe
|
@ -74,4 +74,3 @@ CONFIG_I2C_CADENCE=y
|
||||
|
||||
# 1-wire
|
||||
CONFIG_W1_MASTER_AMD_AXI=m
|
||||
CONFIG_W1_SLAVE_THERM=m
|
||||
|
@ -1,154 +0,0 @@
|
||||
From f0fb974644a132ecc4bd2dc5cce9622435d0ec13 Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Thu, 24 Oct 2024 22:42:33 +0200
|
||||
Subject: [PATCH] r8169: add support for RTL8125D
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This adds support for new chip version RTL8125D, which can be found on
|
||||
boards like Gigabyte X870E AORUS ELITE WIFI7. Firmware rtl8125d-1.fw
|
||||
for this chip version is available in linux-firmware already.
|
||||
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Reviewed-by: Simon Horman <horms@kernel.org>
|
||||
Link: https://patch.msgid.link/d0306912-e88e-4c25-8b5d-545ae8834c0c@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f75d1fbe7809bc5ed134204b920fd9e2fc5db1df
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/ethernet/realtek/r8169.h | 1 +
|
||||
drivers/net/ethernet/realtek/r8169_main.c | 23 +++++++++++++------
|
||||
.../net/ethernet/realtek/r8169_phy_config.c | 10 ++++++++
|
||||
3 files changed, 27 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169.h b/drivers/net/ethernet/realtek/r8169.h
|
||||
index e2db944e6fa8b..be4c9622618d8 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169.h
|
||||
+++ b/drivers/net/ethernet/realtek/r8169.h
|
||||
@@ -68,6 +68,7 @@ enum mac_version {
|
||||
/* support for RTL_GIGA_MAC_VER_60 has been removed */
|
||||
RTL_GIGA_MAC_VER_61,
|
||||
RTL_GIGA_MAC_VER_63,
|
||||
+ RTL_GIGA_MAC_VER_64,
|
||||
RTL_GIGA_MAC_VER_65,
|
||||
RTL_GIGA_MAC_VER_66,
|
||||
RTL_GIGA_MAC_NONE
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
index 5ed2818bac257..1cbde7ebd6f30 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
||||
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
@@ -55,6 +55,7 @@
|
||||
#define FIRMWARE_8107E_2 "rtl_nic/rtl8107e-2.fw"
|
||||
#define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw"
|
||||
#define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw"
|
||||
+#define FIRMWARE_8125D_1 "rtl_nic/rtl8125d-1.fw"
|
||||
#define FIRMWARE_8126A_2 "rtl_nic/rtl8126a-2.fw"
|
||||
#define FIRMWARE_8126A_3 "rtl_nic/rtl8126a-3.fw"
|
||||
|
||||
@@ -138,6 +139,7 @@ static const struct {
|
||||
[RTL_GIGA_MAC_VER_61] = {"RTL8125A", FIRMWARE_8125A_3},
|
||||
/* reserve 62 for CFG_METHOD_4 in the vendor driver */
|
||||
[RTL_GIGA_MAC_VER_63] = {"RTL8125B", FIRMWARE_8125B_2},
|
||||
+ [RTL_GIGA_MAC_VER_64] = {"RTL8125D", FIRMWARE_8125D_1},
|
||||
[RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2},
|
||||
[RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3},
|
||||
};
|
||||
@@ -707,6 +709,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3);
|
||||
MODULE_FIRMWARE(FIRMWARE_8107E_2);
|
||||
MODULE_FIRMWARE(FIRMWARE_8125A_3);
|
||||
MODULE_FIRMWARE(FIRMWARE_8125B_2);
|
||||
+MODULE_FIRMWARE(FIRMWARE_8125D_1);
|
||||
MODULE_FIRMWARE(FIRMWARE_8126A_2);
|
||||
MODULE_FIRMWARE(FIRMWARE_8126A_3);
|
||||
|
||||
@@ -2098,10 +2101,7 @@ static void rtl_set_eee_txidle_timer(struct rtl8169_private *tp)
|
||||
tp->tx_lpi_timer = timer_val;
|
||||
r8168_mac_ocp_write(tp, 0xe048, timer_val);
|
||||
break;
|
||||
- case RTL_GIGA_MAC_VER_61:
|
||||
- case RTL_GIGA_MAC_VER_63:
|
||||
- case RTL_GIGA_MAC_VER_65:
|
||||
- case RTL_GIGA_MAC_VER_66:
|
||||
+ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_66:
|
||||
tp->tx_lpi_timer = timer_val;
|
||||
RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val);
|
||||
break;
|
||||
@@ -2233,6 +2233,9 @@ static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii)
|
||||
{ 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 },
|
||||
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 },
|
||||
|
||||
+ /* 8125D family. */
|
||||
+ { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
|
||||
+
|
||||
/* 8125B family. */
|
||||
{ 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 },
|
||||
|
||||
@@ -2500,9 +2503,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
|
||||
break;
|
||||
- case RTL_GIGA_MAC_VER_63:
|
||||
- case RTL_GIGA_MAC_VER_65:
|
||||
- case RTL_GIGA_MAC_VER_66:
|
||||
+ case RTL_GIGA_MAC_VER_63 ... RTL_GIGA_MAC_VER_66:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
|
||||
RX_PAUSE_SLOT_ON);
|
||||
break;
|
||||
@@ -3814,6 +3815,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
|
||||
rtl_hw_start_8125_common(tp);
|
||||
}
|
||||
|
||||
+static void rtl_hw_start_8125d(struct rtl8169_private *tp)
|
||||
+{
|
||||
+ rtl_set_def_aspm_entry_latency(tp);
|
||||
+ rtl_hw_start_8125_common(tp);
|
||||
+}
|
||||
+
|
||||
static void rtl_hw_start_8126a(struct rtl8169_private *tp)
|
||||
{
|
||||
rtl_set_def_aspm_entry_latency(tp);
|
||||
@@ -3862,6 +3869,7 @@ static void rtl_hw_config(struct rtl8169_private *tp)
|
||||
[RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117,
|
||||
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
|
||||
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
|
||||
+ [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
|
||||
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a,
|
||||
[RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a,
|
||||
};
|
||||
@@ -3879,6 +3887,7 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)
|
||||
/* disable interrupt coalescing */
|
||||
switch (tp->mac_version) {
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
+ case RTL_GIGA_MAC_VER_64:
|
||||
for (i = 0xa00; i < 0xb00; i += 4)
|
||||
RTL_W32(tp, i, 0);
|
||||
break;
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
index cf29b12084826..d09b2a41cd062 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
@@ -1104,6 +1104,15 @@ static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
|
||||
rtl8125b_config_eee_phy(phydev);
|
||||
}
|
||||
|
||||
+static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
|
||||
+ struct phy_device *phydev)
|
||||
+{
|
||||
+ r8169_apply_firmware(tp);
|
||||
+ rtl8125_legacy_force_mode(phydev);
|
||||
+ rtl8168g_disable_aldps(phydev);
|
||||
+ rtl8125b_config_eee_phy(phydev);
|
||||
+}
|
||||
+
|
||||
static void rtl8126a_hw_phy_config(struct rtl8169_private *tp,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
@@ -1160,6 +1169,7 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
|
||||
[RTL_GIGA_MAC_VER_53] = rtl8117_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_61] = rtl8125a_2_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_63] = rtl8125b_hw_phy_config,
|
||||
+ [RTL_GIGA_MAC_VER_64] = rtl8125d_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_65] = rtl8126a_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_66] = rtl8126a_hw_phy_config,
|
||||
};
|
@ -1,143 +0,0 @@
|
||||
From acc8d5ec4b6cdbf0a9625a9f9d3710b52555f3b2 Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Tue, 15 Oct 2024 07:47:14 +0200
|
||||
Subject: [PATCH] net: phy: realtek: merge the drivers for internal NBase-T
|
||||
PHY's
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The Realtek RTL8125/RTL8126 NBase-T MAC/PHY chips have internal PHY's
|
||||
which are register-compatible, at least for the registers we use here.
|
||||
So let's use just one PHY driver to support all of them.
|
||||
These internal PHY's exist also as external C45 PHY's, but on the
|
||||
internal PHY's no access to MMD registers is possible. This can be
|
||||
used to differentiate between the internal and external version.
|
||||
|
||||
As a side effect the drivers for two now external-only drivers don't
|
||||
require read_mmd/write_mmd hooks any longer.
|
||||
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Link: https://patch.msgid.link/c57081a6-811f-4571-ab35-34f4ca6de9af@gmail.com
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f87a17ed3b51fba4dfdd8f8b643b5423a85fc551
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/phy/realtek.c | 53 +++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 43 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
|
||||
index 166f6a7283731..830a0d337de5d 100644
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
#define RTL_GENERIC_PHYID 0x001cc800
|
||||
#define RTL_8211FVD_PHYID 0x001cc878
|
||||
+#define RTL_8221B 0x001cc840
|
||||
#define RTL_8221B_VB_CG 0x001cc849
|
||||
#define RTL_8221B_VN_CG 0x001cc84a
|
||||
#define RTL_8251B 0x001cc862
|
||||
@@ -1040,6 +1041,23 @@ static bool rtlgen_supports_2_5gbps(struct phy_device *phydev)
|
||||
return val >= 0 && val & MDIO_PMA_SPEED_2_5G;
|
||||
}
|
||||
|
||||
+/* On internal PHY's MMD reads over C22 always return 0.
|
||||
+ * Check a MMD register which is known to be non-zero.
|
||||
+ */
|
||||
+static bool rtlgen_supports_mmd(struct phy_device *phydev)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ phy_lock_mdio_bus(phydev);
|
||||
+ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS);
|
||||
+ __phy_write(phydev, MII_MMD_DATA, MDIO_PCS_EEE_ABLE);
|
||||
+ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS | MII_MMD_CTRL_NOINCR);
|
||||
+ val = __phy_read(phydev, MII_MMD_DATA);
|
||||
+ phy_unlock_mdio_bus(phydev);
|
||||
+
|
||||
+ return val > 0;
|
||||
+}
|
||||
+
|
||||
static int rtlgen_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return phydev->phy_id == RTL_GENERIC_PHYID &&
|
||||
@@ -1049,7 +1067,8 @@ static int rtlgen_match_phy_device(struct phy_device *phydev)
|
||||
static int rtl8226_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return phydev->phy_id == RTL_GENERIC_PHYID &&
|
||||
- rtlgen_supports_2_5gbps(phydev);
|
||||
+ rtlgen_supports_2_5gbps(phydev) &&
|
||||
+ rtlgen_supports_mmd(phydev);
|
||||
}
|
||||
|
||||
static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id,
|
||||
@@ -1061,6 +1080,11 @@ static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id,
|
||||
return !is_c45 && (id == phydev->phy_id);
|
||||
}
|
||||
|
||||
+static int rtl8221b_match_phy_device(struct phy_device *phydev)
|
||||
+{
|
||||
+ return phydev->phy_id == RTL_8221B && rtlgen_supports_mmd(phydev);
|
||||
+}
|
||||
+
|
||||
static int rtl8221b_vb_cg_c22_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return rtlgen_is_c45_match(phydev, RTL_8221B_VB_CG, false);
|
||||
@@ -1081,9 +1105,21 @@ static int rtl8221b_vn_cg_c45_match_phy_device(struct phy_device *phydev)
|
||||
return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true);
|
||||
}
|
||||
|
||||
-static int rtl8251b_c22_match_phy_device(struct phy_device *phydev)
|
||||
+static int rtl_internal_nbaset_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
- return rtlgen_is_c45_match(phydev, RTL_8251B, false);
|
||||
+ if (phydev->is_c45)
|
||||
+ return false;
|
||||
+
|
||||
+ switch (phydev->phy_id) {
|
||||
+ case RTL_GENERIC_PHYID:
|
||||
+ case RTL_8221B:
|
||||
+ case RTL_8251B:
|
||||
+ break;
|
||||
+ default:
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return rtlgen_supports_2_5gbps(phydev) && !rtlgen_supports_mmd(phydev);
|
||||
}
|
||||
|
||||
static int rtl8251b_c45_match_phy_device(struct phy_device *phydev)
|
||||
@@ -1345,10 +1381,8 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.resume = rtlgen_resume,
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
- .read_mmd = rtl822x_read_mmd,
|
||||
- .write_mmd = rtl822x_write_mmd,
|
||||
}, {
|
||||
- PHY_ID_MATCH_EXACT(0x001cc840),
|
||||
+ .match_phy_device = rtl8221b_match_phy_device,
|
||||
.name = "RTL8226B_RTL8221B 2.5Gbps PHY",
|
||||
.get_features = rtl822x_get_features,
|
||||
.config_aneg = rtl822x_config_aneg,
|
||||
@@ -1359,8 +1393,6 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.resume = rtlgen_resume,
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
- .read_mmd = rtl822x_read_mmd,
|
||||
- .write_mmd = rtl822x_write_mmd,
|
||||
}, {
|
||||
PHY_ID_MATCH_EXACT(0x001cc838),
|
||||
.name = "RTL8226-CG 2.5Gbps PHY",
|
||||
@@ -1438,8 +1470,9 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
}, {
|
||||
- .match_phy_device = rtl8251b_c22_match_phy_device,
|
||||
- .name = "RTL8126A-internal 5Gbps PHY",
|
||||
+ .match_phy_device = rtl_internal_nbaset_match_phy_device,
|
||||
+ .name = "Realtek Internal NBASE-T PHY",
|
||||
+ .flags = PHY_IS_INTERNAL,
|
||||
.get_features = rtl822x_get_features,
|
||||
.config_aneg = rtl822x_config_aneg,
|
||||
.read_status = rtl822x_read_status,
|
@ -1,36 +0,0 @@
|
||||
From 7ab842c714924784cae4b6ab229997905b096b4f Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Thu, 17 Oct 2024 18:01:13 +0200
|
||||
Subject: [PATCH] net: phy: realtek: add RTL8125D-internal PHY
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The first boards show up with Realtek's RTL8125D. This MAC/PHY chip
|
||||
comes with an integrated 2.5Gbps PHY with ID 0x001cc841. It's not
|
||||
clear yet whether there's an external version of this PHY and how
|
||||
Realtek calls it, therefore use the numeric id for now.
|
||||
|
||||
Link: https://lore.kernel.org/netdev/2ada65e1-5dfa-456c-9334-2bc51272e9da@gmail.com/T/
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Message-ID: <7d2924de-053b-44d2-a479-870dc3878170@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8989bad541133c43550bff2b80edbe37b8fb9659
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/phy/realtek.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
|
||||
index 830a0d337de5d..8ce5705af69c5 100644
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -1114,6 +1114,7 @@ static int rtl_internal_nbaset_match_phy_device(struct phy_device *phydev)
|
||||
case RTL_GENERIC_PHYID:
|
||||
case RTL_8221B:
|
||||
case RTL_8251B:
|
||||
+ case 0x001cc841:
|
||||
break;
|
||||
default:
|
||||
return false;
|
@ -90,8 +90,6 @@ CONFIG_FB_EFI=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
|
||||
CONFIG_DRM_I915=m
|
||||
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
|
@ -1,154 +0,0 @@
|
||||
From f0fb974644a132ecc4bd2dc5cce9622435d0ec13 Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Thu, 24 Oct 2024 22:42:33 +0200
|
||||
Subject: [PATCH] r8169: add support for RTL8125D
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This adds support for new chip version RTL8125D, which can be found on
|
||||
boards like Gigabyte X870E AORUS ELITE WIFI7. Firmware rtl8125d-1.fw
|
||||
for this chip version is available in linux-firmware already.
|
||||
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Reviewed-by: Simon Horman <horms@kernel.org>
|
||||
Link: https://patch.msgid.link/d0306912-e88e-4c25-8b5d-545ae8834c0c@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f75d1fbe7809bc5ed134204b920fd9e2fc5db1df
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/ethernet/realtek/r8169.h | 1 +
|
||||
drivers/net/ethernet/realtek/r8169_main.c | 23 +++++++++++++------
|
||||
.../net/ethernet/realtek/r8169_phy_config.c | 10 ++++++++
|
||||
3 files changed, 27 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169.h b/drivers/net/ethernet/realtek/r8169.h
|
||||
index e2db944e6fa8b..be4c9622618d8 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169.h
|
||||
+++ b/drivers/net/ethernet/realtek/r8169.h
|
||||
@@ -68,6 +68,7 @@ enum mac_version {
|
||||
/* support for RTL_GIGA_MAC_VER_60 has been removed */
|
||||
RTL_GIGA_MAC_VER_61,
|
||||
RTL_GIGA_MAC_VER_63,
|
||||
+ RTL_GIGA_MAC_VER_64,
|
||||
RTL_GIGA_MAC_VER_65,
|
||||
RTL_GIGA_MAC_VER_66,
|
||||
RTL_GIGA_MAC_NONE
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
index 5ed2818bac257..1cbde7ebd6f30 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
||||
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
||||
@@ -55,6 +55,7 @@
|
||||
#define FIRMWARE_8107E_2 "rtl_nic/rtl8107e-2.fw"
|
||||
#define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw"
|
||||
#define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw"
|
||||
+#define FIRMWARE_8125D_1 "rtl_nic/rtl8125d-1.fw"
|
||||
#define FIRMWARE_8126A_2 "rtl_nic/rtl8126a-2.fw"
|
||||
#define FIRMWARE_8126A_3 "rtl_nic/rtl8126a-3.fw"
|
||||
|
||||
@@ -138,6 +139,7 @@ static const struct {
|
||||
[RTL_GIGA_MAC_VER_61] = {"RTL8125A", FIRMWARE_8125A_3},
|
||||
/* reserve 62 for CFG_METHOD_4 in the vendor driver */
|
||||
[RTL_GIGA_MAC_VER_63] = {"RTL8125B", FIRMWARE_8125B_2},
|
||||
+ [RTL_GIGA_MAC_VER_64] = {"RTL8125D", FIRMWARE_8125D_1},
|
||||
[RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2},
|
||||
[RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3},
|
||||
};
|
||||
@@ -707,6 +709,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3);
|
||||
MODULE_FIRMWARE(FIRMWARE_8107E_2);
|
||||
MODULE_FIRMWARE(FIRMWARE_8125A_3);
|
||||
MODULE_FIRMWARE(FIRMWARE_8125B_2);
|
||||
+MODULE_FIRMWARE(FIRMWARE_8125D_1);
|
||||
MODULE_FIRMWARE(FIRMWARE_8126A_2);
|
||||
MODULE_FIRMWARE(FIRMWARE_8126A_3);
|
||||
|
||||
@@ -2098,10 +2101,7 @@ static void rtl_set_eee_txidle_timer(struct rtl8169_private *tp)
|
||||
tp->tx_lpi_timer = timer_val;
|
||||
r8168_mac_ocp_write(tp, 0xe048, timer_val);
|
||||
break;
|
||||
- case RTL_GIGA_MAC_VER_61:
|
||||
- case RTL_GIGA_MAC_VER_63:
|
||||
- case RTL_GIGA_MAC_VER_65:
|
||||
- case RTL_GIGA_MAC_VER_66:
|
||||
+ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_66:
|
||||
tp->tx_lpi_timer = timer_val;
|
||||
RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val);
|
||||
break;
|
||||
@@ -2233,6 +2233,9 @@ static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii)
|
||||
{ 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 },
|
||||
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 },
|
||||
|
||||
+ /* 8125D family. */
|
||||
+ { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
|
||||
+
|
||||
/* 8125B family. */
|
||||
{ 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 },
|
||||
|
||||
@@ -2500,9 +2503,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
|
||||
break;
|
||||
- case RTL_GIGA_MAC_VER_63:
|
||||
- case RTL_GIGA_MAC_VER_65:
|
||||
- case RTL_GIGA_MAC_VER_66:
|
||||
+ case RTL_GIGA_MAC_VER_63 ... RTL_GIGA_MAC_VER_66:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
|
||||
RX_PAUSE_SLOT_ON);
|
||||
break;
|
||||
@@ -3814,6 +3815,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
|
||||
rtl_hw_start_8125_common(tp);
|
||||
}
|
||||
|
||||
+static void rtl_hw_start_8125d(struct rtl8169_private *tp)
|
||||
+{
|
||||
+ rtl_set_def_aspm_entry_latency(tp);
|
||||
+ rtl_hw_start_8125_common(tp);
|
||||
+}
|
||||
+
|
||||
static void rtl_hw_start_8126a(struct rtl8169_private *tp)
|
||||
{
|
||||
rtl_set_def_aspm_entry_latency(tp);
|
||||
@@ -3862,6 +3869,7 @@ static void rtl_hw_config(struct rtl8169_private *tp)
|
||||
[RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117,
|
||||
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
|
||||
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
|
||||
+ [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
|
||||
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a,
|
||||
[RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a,
|
||||
};
|
||||
@@ -3879,6 +3887,7 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)
|
||||
/* disable interrupt coalescing */
|
||||
switch (tp->mac_version) {
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
+ case RTL_GIGA_MAC_VER_64:
|
||||
for (i = 0xa00; i < 0xb00; i += 4)
|
||||
RTL_W32(tp, i, 0);
|
||||
break;
|
||||
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
index cf29b12084826..d09b2a41cd062 100644
|
||||
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
|
||||
@@ -1104,6 +1104,15 @@ static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
|
||||
rtl8125b_config_eee_phy(phydev);
|
||||
}
|
||||
|
||||
+static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
|
||||
+ struct phy_device *phydev)
|
||||
+{
|
||||
+ r8169_apply_firmware(tp);
|
||||
+ rtl8125_legacy_force_mode(phydev);
|
||||
+ rtl8168g_disable_aldps(phydev);
|
||||
+ rtl8125b_config_eee_phy(phydev);
|
||||
+}
|
||||
+
|
||||
static void rtl8126a_hw_phy_config(struct rtl8169_private *tp,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
@@ -1160,6 +1169,7 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
|
||||
[RTL_GIGA_MAC_VER_53] = rtl8117_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_61] = rtl8125a_2_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_63] = rtl8125b_hw_phy_config,
|
||||
+ [RTL_GIGA_MAC_VER_64] = rtl8125d_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_65] = rtl8126a_hw_phy_config,
|
||||
[RTL_GIGA_MAC_VER_66] = rtl8126a_hw_phy_config,
|
||||
};
|
@ -1,143 +0,0 @@
|
||||
From acc8d5ec4b6cdbf0a9625a9f9d3710b52555f3b2 Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Tue, 15 Oct 2024 07:47:14 +0200
|
||||
Subject: [PATCH] net: phy: realtek: merge the drivers for internal NBase-T
|
||||
PHY's
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The Realtek RTL8125/RTL8126 NBase-T MAC/PHY chips have internal PHY's
|
||||
which are register-compatible, at least for the registers we use here.
|
||||
So let's use just one PHY driver to support all of them.
|
||||
These internal PHY's exist also as external C45 PHY's, but on the
|
||||
internal PHY's no access to MMD registers is possible. This can be
|
||||
used to differentiate between the internal and external version.
|
||||
|
||||
As a side effect the drivers for two now external-only drivers don't
|
||||
require read_mmd/write_mmd hooks any longer.
|
||||
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Link: https://patch.msgid.link/c57081a6-811f-4571-ab35-34f4ca6de9af@gmail.com
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f87a17ed3b51fba4dfdd8f8b643b5423a85fc551
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/phy/realtek.c | 53 +++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 43 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
|
||||
index 166f6a7283731..830a0d337de5d 100644
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
#define RTL_GENERIC_PHYID 0x001cc800
|
||||
#define RTL_8211FVD_PHYID 0x001cc878
|
||||
+#define RTL_8221B 0x001cc840
|
||||
#define RTL_8221B_VB_CG 0x001cc849
|
||||
#define RTL_8221B_VN_CG 0x001cc84a
|
||||
#define RTL_8251B 0x001cc862
|
||||
@@ -1040,6 +1041,23 @@ static bool rtlgen_supports_2_5gbps(struct phy_device *phydev)
|
||||
return val >= 0 && val & MDIO_PMA_SPEED_2_5G;
|
||||
}
|
||||
|
||||
+/* On internal PHY's MMD reads over C22 always return 0.
|
||||
+ * Check a MMD register which is known to be non-zero.
|
||||
+ */
|
||||
+static bool rtlgen_supports_mmd(struct phy_device *phydev)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ phy_lock_mdio_bus(phydev);
|
||||
+ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS);
|
||||
+ __phy_write(phydev, MII_MMD_DATA, MDIO_PCS_EEE_ABLE);
|
||||
+ __phy_write(phydev, MII_MMD_CTRL, MDIO_MMD_PCS | MII_MMD_CTRL_NOINCR);
|
||||
+ val = __phy_read(phydev, MII_MMD_DATA);
|
||||
+ phy_unlock_mdio_bus(phydev);
|
||||
+
|
||||
+ return val > 0;
|
||||
+}
|
||||
+
|
||||
static int rtlgen_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return phydev->phy_id == RTL_GENERIC_PHYID &&
|
||||
@@ -1049,7 +1067,8 @@ static int rtlgen_match_phy_device(struct phy_device *phydev)
|
||||
static int rtl8226_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return phydev->phy_id == RTL_GENERIC_PHYID &&
|
||||
- rtlgen_supports_2_5gbps(phydev);
|
||||
+ rtlgen_supports_2_5gbps(phydev) &&
|
||||
+ rtlgen_supports_mmd(phydev);
|
||||
}
|
||||
|
||||
static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id,
|
||||
@@ -1061,6 +1080,11 @@ static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id,
|
||||
return !is_c45 && (id == phydev->phy_id);
|
||||
}
|
||||
|
||||
+static int rtl8221b_match_phy_device(struct phy_device *phydev)
|
||||
+{
|
||||
+ return phydev->phy_id == RTL_8221B && rtlgen_supports_mmd(phydev);
|
||||
+}
|
||||
+
|
||||
static int rtl8221b_vb_cg_c22_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
return rtlgen_is_c45_match(phydev, RTL_8221B_VB_CG, false);
|
||||
@@ -1081,9 +1105,21 @@ static int rtl8221b_vn_cg_c45_match_phy_device(struct phy_device *phydev)
|
||||
return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true);
|
||||
}
|
||||
|
||||
-static int rtl8251b_c22_match_phy_device(struct phy_device *phydev)
|
||||
+static int rtl_internal_nbaset_match_phy_device(struct phy_device *phydev)
|
||||
{
|
||||
- return rtlgen_is_c45_match(phydev, RTL_8251B, false);
|
||||
+ if (phydev->is_c45)
|
||||
+ return false;
|
||||
+
|
||||
+ switch (phydev->phy_id) {
|
||||
+ case RTL_GENERIC_PHYID:
|
||||
+ case RTL_8221B:
|
||||
+ case RTL_8251B:
|
||||
+ break;
|
||||
+ default:
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return rtlgen_supports_2_5gbps(phydev) && !rtlgen_supports_mmd(phydev);
|
||||
}
|
||||
|
||||
static int rtl8251b_c45_match_phy_device(struct phy_device *phydev)
|
||||
@@ -1345,10 +1381,8 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.resume = rtlgen_resume,
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
- .read_mmd = rtl822x_read_mmd,
|
||||
- .write_mmd = rtl822x_write_mmd,
|
||||
}, {
|
||||
- PHY_ID_MATCH_EXACT(0x001cc840),
|
||||
+ .match_phy_device = rtl8221b_match_phy_device,
|
||||
.name = "RTL8226B_RTL8221B 2.5Gbps PHY",
|
||||
.get_features = rtl822x_get_features,
|
||||
.config_aneg = rtl822x_config_aneg,
|
||||
@@ -1359,8 +1393,6 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.resume = rtlgen_resume,
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
- .read_mmd = rtl822x_read_mmd,
|
||||
- .write_mmd = rtl822x_write_mmd,
|
||||
}, {
|
||||
PHY_ID_MATCH_EXACT(0x001cc838),
|
||||
.name = "RTL8226-CG 2.5Gbps PHY",
|
||||
@@ -1438,8 +1470,9 @@ static struct phy_driver realtek_drvs[] = {
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
}, {
|
||||
- .match_phy_device = rtl8251b_c22_match_phy_device,
|
||||
- .name = "RTL8126A-internal 5Gbps PHY",
|
||||
+ .match_phy_device = rtl_internal_nbaset_match_phy_device,
|
||||
+ .name = "Realtek Internal NBASE-T PHY",
|
||||
+ .flags = PHY_IS_INTERNAL,
|
||||
.get_features = rtl822x_get_features,
|
||||
.config_aneg = rtl822x_config_aneg,
|
||||
.read_status = rtl822x_read_status,
|
@ -1,36 +0,0 @@
|
||||
From 7ab842c714924784cae4b6ab229997905b096b4f Mon Sep 17 00:00:00 2001
|
||||
From: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Date: Thu, 17 Oct 2024 18:01:13 +0200
|
||||
Subject: [PATCH] net: phy: realtek: add RTL8125D-internal PHY
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The first boards show up with Realtek's RTL8125D. This MAC/PHY chip
|
||||
comes with an integrated 2.5Gbps PHY with ID 0x001cc841. It's not
|
||||
clear yet whether there's an external version of this PHY and how
|
||||
Realtek calls it, therefore use the numeric id for now.
|
||||
|
||||
Link: https://lore.kernel.org/netdev/2ada65e1-5dfa-456c-9334-2bc51272e9da@gmail.com/T/
|
||||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
||||
Message-ID: <7d2924de-053b-44d2-a479-870dc3878170@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8989bad541133c43550bff2b80edbe37b8fb9659
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/net/phy/realtek.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
|
||||
index 830a0d337de5d..8ce5705af69c5 100644
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -1114,6 +1114,7 @@ static int rtl_internal_nbaset_match_phy_device(struct phy_device *phydev)
|
||||
case RTL_GENERIC_PHYID:
|
||||
case RTL_8221B:
|
||||
case RTL_8251B:
|
||||
+ case 0x001cc841:
|
||||
break;
|
||||
default:
|
||||
return false;
|
@ -71,10 +71,6 @@ kernel=u-boot.bin
|
||||
# Enable audio (loads snd_bcm2835)
|
||||
dtparam=audio=on
|
||||
|
||||
[pi3]
|
||||
# Added to fix #3965
|
||||
initial_turbo=0
|
||||
|
||||
[pi4]
|
||||
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
|
||||
dtoverlay=vc4-fkms-v3d
|
||||
|
@ -1,44 +0,0 @@
|
||||
From ab1d73e2b5101689fcd1737e588119b4fde3a5ff Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 3 Feb 2025 14:44:08 +0000
|
||||
Subject: [PATCH] misc: rp1-pio: Error out on incompatible firmware
|
||||
|
||||
If the RP1 firmware has reported an error then return that from the PIO
|
||||
probe function, otherwise defer the probing.
|
||||
|
||||
Link: https://github.com/raspberrypi/linux/issues/6642
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/misc/rp1-pio.c | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/rp1-pio.c b/drivers/misc/rp1-pio.c
|
||||
index dbf69279e313d..7e875811509f8 100644
|
||||
--- a/drivers/misc/rp1-pio.c
|
||||
+++ b/drivers/misc/rp1-pio.c
|
||||
@@ -1268,8 +1268,10 @@ static int rp1_pio_probe(struct platform_device *pdev)
|
||||
return dev_err_probe(dev, pdev->id, "alias is missing\n");
|
||||
|
||||
fw = devm_rp1_firmware_get(dev, dev->of_node);
|
||||
- if (IS_ERR_OR_NULL(fw))
|
||||
- return dev_err_probe(dev, -ENOENT, "failed to contact RP1 firmware\n");
|
||||
+ if (!fw)
|
||||
+ return dev_err_probe(dev, -EPROBE_DEFER, "failed to find RP1 firmware driver\n");
|
||||
+ if (IS_ERR(fw))
|
||||
+ return dev_err_probe(dev, PTR_ERR(fw), "failed to contact RP1 firmware\n");
|
||||
ret = rp1_firmware_get_feature(fw, FOURCC_PIO, &op_base, &op_count);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -1346,6 +1348,11 @@ static void rp1_pio_remove(struct platform_device *pdev)
|
||||
|
||||
if (g_pio == pio)
|
||||
g_pio = NULL;
|
||||
+
|
||||
+ device_destroy(pio->dev_class, pio->dev_num);
|
||||
+ cdev_del(&pio->cdev);
|
||||
+ class_destroy(pio->dev_class);
|
||||
+ unregister_chrdev_region(pio->dev_num, 1);
|
||||
}
|
||||
|
||||
static const struct of_device_id rp1_pio_ids[] = {
|
@ -1,105 +0,0 @@
|
||||
From b1bcedb44c54a65a8e494158385eb23199572217 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 3 Feb 2025 14:51:52 +0000
|
||||
Subject: [PATCH] firmware: rp1: Linger on firmware failure
|
||||
|
||||
To avoid pointless retries, let the probe function succeed if the
|
||||
firmware interface is configured correctly but the firmware is
|
||||
incompatible. The value of the private drvdata field holds the outcome.
|
||||
|
||||
Link: https://github.com/raspberrypi/linux/issues/6642
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/firmware/rp1.c | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/firmware/rp1.c b/drivers/firmware/rp1.c
|
||||
index 0b0760ca77764..a258452c8b33e 100644
|
||||
--- a/drivers/firmware/rp1.c
|
||||
+++ b/drivers/firmware/rp1.c
|
||||
@@ -114,7 +114,8 @@ static void rp1_firmware_delete(struct kref *kref)
|
||||
|
||||
void rp1_firmware_put(struct rp1_firmware *fw)
|
||||
{
|
||||
- kref_put(&fw->consumers, rp1_firmware_delete);
|
||||
+ if (!IS_ERR_OR_NULL(fw))
|
||||
+ kref_put(&fw->consumers, rp1_firmware_delete);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rp1_firmware_put);
|
||||
|
||||
@@ -157,7 +158,7 @@ struct rp1_firmware *rp1_firmware_get(struct device_node *client)
|
||||
const char *match = rp1_firmware_of_match[0].compatible;
|
||||
struct platform_device *pdev;
|
||||
struct device_node *fwnode;
|
||||
- struct rp1_firmware *fw;
|
||||
+ struct rp1_firmware *fw = NULL;
|
||||
|
||||
if (!client)
|
||||
return NULL;
|
||||
@@ -166,17 +167,17 @@ struct rp1_firmware *rp1_firmware_get(struct device_node *client)
|
||||
return NULL;
|
||||
if (!of_device_is_compatible(fwnode, match)) {
|
||||
of_node_put(fwnode);
|
||||
- return NULL;
|
||||
+ return ERR_PTR(-ENXIO);
|
||||
}
|
||||
|
||||
pdev = of_find_device_by_node(fwnode);
|
||||
of_node_put(fwnode);
|
||||
|
||||
if (!pdev)
|
||||
- goto err_exit;
|
||||
+ return ERR_PTR(-ENXIO);
|
||||
|
||||
fw = platform_get_drvdata(pdev);
|
||||
- if (!fw)
|
||||
+ if (IS_ERR_OR_NULL(fw))
|
||||
goto err_exit;
|
||||
|
||||
if (!kref_get_unless_zero(&fw->consumers))
|
||||
@@ -188,7 +189,7 @@ struct rp1_firmware *rp1_firmware_get(struct device_node *client)
|
||||
|
||||
err_exit:
|
||||
put_device(&pdev->dev);
|
||||
- return NULL;
|
||||
+ return fw;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rp1_firmware_get);
|
||||
|
||||
@@ -204,8 +205,8 @@ struct rp1_firmware *devm_rp1_firmware_get(struct device *dev, struct device_nod
|
||||
int ret;
|
||||
|
||||
fw = rp1_firmware_get(client);
|
||||
- if (!fw)
|
||||
- return NULL;
|
||||
+ if (IS_ERR_OR_NULL(fw))
|
||||
+ return fw;
|
||||
|
||||
ret = devm_add_action_or_reset(dev, devm_rp1_firmware_put, fw);
|
||||
if (ret)
|
||||
@@ -270,19 +271,18 @@ static int rp1_firmware_probe(struct platform_device *pdev)
|
||||
init_completion(&fw->c);
|
||||
kref_init(&fw->consumers);
|
||||
|
||||
- platform_set_drvdata(pdev, fw);
|
||||
-
|
||||
ret = rp1_firmware_message(fw, GET_FIRMWARE_VERSION,
|
||||
NULL, 0, &version, sizeof(version));
|
||||
if (ret == sizeof(version)) {
|
||||
dev_info(dev, "RP1 Firmware version %08x%08x%08x%08x%08x\n",
|
||||
version[0], version[1], version[2], version[3], version[4]);
|
||||
- ret = 0;
|
||||
- } else if (ret >= 0) {
|
||||
- ret = -EIO;
|
||||
+ platform_set_drvdata(pdev, fw);
|
||||
+ } else {
|
||||
+ rp1_firmware_put(fw);
|
||||
+ platform_set_drvdata(pdev, ERR_PTR(-ENOENT));
|
||||
}
|
||||
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int rp1_firmware_remove(struct platform_device *pdev)
|
@ -1,32 +0,0 @@
|
||||
From 97e6955cef61340165e8ec276084841d335335e9 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Tue, 4 Feb 2025 13:18:45 +0000
|
||||
Subject: [PATCH] mailbox: rp1: Don't claim channels in of_xlate
|
||||
|
||||
The of_xlate method saves the calculated event mask in the con_priv
|
||||
field. It also rejects subsequent attempt to use that channel because
|
||||
the mask is non-zero, which causes a repeated instantiation of a client
|
||||
driver to fail.
|
||||
|
||||
The of_xlate method is not meant to be a point of resource acquisition.
|
||||
Leave the con_priv initialisation, but drop the test that it was
|
||||
previously zero.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/mailbox/rp1-mailbox.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/mailbox/rp1-mailbox.c b/drivers/mailbox/rp1-mailbox.c
|
||||
index bf71db1dd9fae..0e8af098b62b2 100644
|
||||
--- a/drivers/mailbox/rp1-mailbox.c
|
||||
+++ b/drivers/mailbox/rp1-mailbox.c
|
||||
@@ -133,8 +133,6 @@ static struct mbox_chan *rp1_mbox_xlate(struct mbox_controller *mbox,
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
chan = &mbox->chans[doorbell];
|
||||
- if (chan->con_priv)
|
||||
- return ERR_PTR(-EBUSY);
|
||||
|
||||
chan->con_priv = (void *)(uintptr_t)(1 << doorbell);
|
||||
|
@ -1,34 +0,0 @@
|
||||
From c8cf0694d8ecd5acaa03c26fc404e66dea9308fd Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Tue, 25 Feb 2025 12:16:33 +0000
|
||||
Subject: [PATCH] misc: rp1-pio: Demote fw probe error to warning
|
||||
|
||||
Support for the RP1 firmware mailbox API is rolling out to Pi 5 EEPROM
|
||||
images. For most users, the fact that the PIO is not available is no
|
||||
cause for alarm. Change the message to a warning, so that it does not
|
||||
appear with "quiet" in cmdline.txt.
|
||||
|
||||
Link: https://github.com/raspberrypi/linux/issues/6642
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/misc/rp1-pio.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/rp1-pio.c b/drivers/misc/rp1-pio.c
|
||||
index 7e875811509f8..a04dc8edcf5b8 100644
|
||||
--- a/drivers/misc/rp1-pio.c
|
||||
+++ b/drivers/misc/rp1-pio.c
|
||||
@@ -1270,8 +1270,10 @@ static int rp1_pio_probe(struct platform_device *pdev)
|
||||
fw = devm_rp1_firmware_get(dev, dev->of_node);
|
||||
if (!fw)
|
||||
return dev_err_probe(dev, -EPROBE_DEFER, "failed to find RP1 firmware driver\n");
|
||||
- if (IS_ERR(fw))
|
||||
- return dev_err_probe(dev, PTR_ERR(fw), "failed to contact RP1 firmware\n");
|
||||
+ if (IS_ERR(fw)) {
|
||||
+ dev_warn(dev, "failed to contact RP1 firmware\n");
|
||||
+ return PTR_ERR(fw);
|
||||
+ }
|
||||
ret = rp1_firmware_get_feature(fw, FOURCC_PIO, &op_base, &op_count);
|
||||
if (ret < 0)
|
||||
return ret;
|
@ -1,11 +1,10 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/arm-uefi/generic-aarch64/patches"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/arm-uefi/generic-aarch64 $(BR2_EXTERNAL_HASSOS_PATH)/board/arm-uefi/generic-aarch64/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless-pci.config $(BR2_EXTERNAL_HASSOS_PATH)/board/arm-uefi/generic-aarch64/kernel.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
|
@ -1,11 +1,10 @@
|
||||
BR2_x86_64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/patches"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/pc/generic-x86-64 $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/generic-x86-64/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="x86_64"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless-pci.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-pci.config $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/generic-x86-64/kernel.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
|
@ -1,5 +1,4 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/kernel-arm64-rockchip.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/board/nabucasa/green/kernel.config"
|
||||
|
@ -1,5 +1,4 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/khadas/vim3 $(BR2_EXTERNAL_HASSOS_PATH)/board/khadas/vim3/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/khadas/kernel-vim.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config"
|
||||
|
@ -1,11 +1,10 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/kernel-amlogic.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config"
|
||||
|
@ -1,11 +1,10 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c4 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c4/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/kernel-amlogic.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config"
|
||||
|
@ -1,5 +1,4 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/kernel-arm64-rockchip.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1/kernel.config"
|
||||
|
@ -1,5 +1,4 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1s $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1s/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/kernel-arm64-rockchip.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-m1s/kernel.config"
|
||||
|
@ -1,11 +1,10 @@
|
||||
BR2_aarch64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/patches-meson"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-n2 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-n2/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/kernel-amlogic.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-n2/kernel.config"
|
||||
|
@ -1,6 +1,5 @@
|
||||
BR2_arm=y
|
||||
BR2_cortex_a7=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -18,7 +17,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-xu4 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-xu4/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="exynos"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-xu4/kernel.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
|
@ -1,11 +1,10 @@
|
||||
BR2_x86_64=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_ENABLE_LTO=y
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/patches"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches"
|
||||
BR2_SSP_REGULAR=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="homeassistant"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Home Assistant"
|
||||
@ -17,7 +16,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/pc/ova $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/ova/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="x86_64"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-pci.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless-pci.config $(BR2_EXTERNAL_HASSOS_PATH)/board/pc/ova/kernel.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
|
@ -1,7 +1,6 @@
|
||||
BR2_arm=y
|
||||
BR2_cortex_a7=y
|
||||
BR2_ARM_FPU_VFPV4=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,6 +1,5 @@
|
||||
BR2_aarch64=y
|
||||
BR2_ARM_FPU_VFPV4=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,7 +1,6 @@
|
||||
BR2_arm=y
|
||||
BR2_cortex_a53=y
|
||||
BR2_ARM_FPU_VFPV4=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,6 +1,5 @@
|
||||
BR2_aarch64=y
|
||||
BR2_cortex_a72=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,7 +1,6 @@
|
||||
BR2_arm=y
|
||||
BR2_cortex_a72=y
|
||||
BR2_ARM_FPU_NEON_VFPV4=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,6 +1,5 @@
|
||||
BR2_aarch64=y
|
||||
BR2_cortex_a76=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -1,7 +1,6 @@
|
||||
BR2_arm=y
|
||||
BR2_cortex_a17=y
|
||||
BR2_ARM_FPU_NEON_VFPV4=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
@ -19,7 +18,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker $(BR2_EXTERNAL_HASSOS_PATH)/board/asus/hassos-hook.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.23"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker/kernel.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/hassos.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/docker.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support.config $(BR2_EXTERNAL_HASSOS_PATH)/kernel/v6.12.y/device-support-wireless.config"
|
||||
|
@ -1,6 +1,5 @@
|
||||
BR2_aarch64=y
|
||||
BR2_cortex_a72=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
|
@ -26,11 +26,6 @@ CONFIG_NET_VENDOR_STMICRO=y
|
||||
CONFIG_STMMAC_ETH=m
|
||||
CONFIG_STMMAC_PCI=m
|
||||
|
||||
# Mellanox ConnectX-3 NIC support
|
||||
CONFIG_MLX4_EN=m
|
||||
# CONFIG_MLX4_DEBUG is not set
|
||||
CONFIG_MLX4_CORE_GEN2=y
|
||||
|
||||
CONFIG_MEDIA_PCI_SUPPORT=y
|
||||
|
||||
# PCI sound drivers
|
||||
|
@ -1,8 +1,8 @@
|
||||
VERSION_MAJOR="15"
|
||||
VERSION_MINOR="3"
|
||||
VERSION_SUFFIX="dev0"
|
||||
VERSION_MINOR="0"
|
||||
VERSION_SUFFIX="rc2"
|
||||
|
||||
HASSOS_NAME="Home Assistant OS"
|
||||
HASSOS_ID="haos"
|
||||
|
||||
DEPLOYMENT="development"
|
||||
DEPLOYMENT="staging"
|
||||
|
@ -53,21 +53,6 @@ install_boot() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Fix for Pi3 not booting from some SD cards with now default initial_turbo=60
|
||||
# see: https://github.com/home-assistant/operating-system/issues/3965
|
||||
if [ "$RAUC_SYSTEM_COMPATIBLE" = "haos-rpi3" ] || [ "$RAUC_SYSTEM_COMPATIBLE" = "haos-rpi3-64" ]; then
|
||||
# Don't change anything if initial_turbo is already set anywhere
|
||||
if ! grep -q "^initial_turbo=" "${BOOT_MNT}/config.txt"; then
|
||||
if grep -q '^\[pi3\]' "${BOOT_MNT}/config.txt"; then
|
||||
echo "Adding initial_turbo=0 to [pi3] section of config.txt"
|
||||
sed -i '/^\[pi3\]/a # Added to fix #3965\ninitial_turbo=0' "${BOOT_MNT}/config.txt"
|
||||
else
|
||||
echo "Adding [pi3] section with initial_turbo=0 to config.txt"
|
||||
sed -i 's/^\[all\]/\[pi3\]\n# Added to fix #3965\ninitial_turbo=0\n\n\[all\]/' "${BOOT_MNT}/config.txt"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Prepare rauc.db for migration, should be removed in HAOS 16
|
||||
# (along with raucdb-migrate.service and related raucdb-update changes)
|
||||
if [ -f /mnt/data/rauc.db ]; then
|
||||
|
@ -1,17 +1,16 @@
|
||||
Upstream: Not applicable
|
||||
Remove llseek NULL'd in 6.0 (868941b) removed in 6.12 (cb787f4)
|
||||
|
||||
Signed-off-by: Alexander Reinert <alex@areinert.de>
|
||||
Signed-off-by: Nick Venenga <nick@venenga.com>
|
||||
Upstream: https://github.com/jens-maus/occu/pull/1
|
||||
|
||||
--- a/KernelDrivers/eq3_char_loop.c
|
||||
+++ b/KernelDrivers/eq3_char_loop.c
|
||||
@@ -917,7 +917,11 @@ static int eq3loop_open(struct inode *inode, struct file *filp)
|
||||
@@ -898,7 +898,9 @@ static int eq3loop_open(struct inode *inode, struct file *filp)
|
||||
|
||||
static struct file_operations eq3loop_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
|
||||
+ .llseek = noop_llseek,
|
||||
+#else
|
||||
.llseek = no_llseek,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
|
||||
.llseek = no_llseek,
|
||||
+#endif
|
||||
.read = eq3loop_read,
|
||||
.write = eq3loop_write,
|
||||
|
@ -0,0 +1,17 @@
|
||||
Remove llseek NULL'd in 6.0 (868941b) removed in 6.12 (cb787f4)
|
||||
|
||||
Signed-off-by: Nick Venenga <nick@venenga.com>
|
||||
Upstream: https://github.com/alexreinert/piVCCU/pull/533
|
||||
|
||||
--- a/kernel/generic_raw_uart.c
|
||||
+++ b/kernel/generic_raw_uart.c
|
||||
@@ -147,7 +147,9 @@ static int generic_raw_uart_get_device_type(struct generic_raw_uart_instance *in
|
||||
static struct file_operations generic_raw_uart_fops =
|
||||
{
|
||||
.owner = THIS_MODULE,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
|
||||
.llseek = no_llseek,
|
||||
+#endif
|
||||
.read = generic_raw_uart_read,
|
||||
.write = generic_raw_uart_write,
|
||||
.open = generic_raw_uart_open,
|
@ -0,0 +1,19 @@
|
||||
Replace `gpiochip_add` removed in 6.11 (3ff1180) with `gpiochip_add_data` added in 4.5 (b08ea35)
|
||||
|
||||
Signed-off-by: Nick Venenga <nick@venenga.com>
|
||||
Upstream: https://github.com/alexreinert/piVCCU/pull/533
|
||||
|
||||
--- a/kernel/hb_rf_eth.c
|
||||
+++ b/kernel/hb_rf_eth.c
|
||||
@@ -715,7 +715,11 @@ static int __init hb_rf_eth_init(void)
|
||||
gc.base = -1;
|
||||
gc.can_sleep = false;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
|
||||
err = gpiochip_add(&gc);
|
||||
+#else
|
||||
+ err = gpiochip_add_data(&gc, NULL);
|
||||
+#endif
|
||||
if (err)
|
||||
goto failed_gc_create;
|
||||
|
@ -0,0 +1,87 @@
|
||||
Change raw_uart_driver remove macro to define the function as void as in kernel 6.11
|
||||
the platform_device remove function was changed to void (0edb555).
|
||||
|
||||
Upstream: Not applicable
|
||||
|
||||
Signed-off-by: Jens Maus <mail@jens-maus.de>
|
||||
|
||||
diff --git a/kernel/generic_raw_uart.h b/kernel/generic_raw_uart.h
|
||||
index b865e22..791e5d0 100644
|
||||
--- a/kernel/generic_raw_uart.h 2025-01-10 13:19:08.697184514 +0100
|
||||
+++ b/kernel/generic_raw_uart.h 2025-01-10 13:28:43.311159893 +0100
|
||||
@@ -93,6 +93,8 @@
|
||||
|
||||
extern bool generic_raw_uart_verify_dkey(struct device *dev, unsigned char *dkey, int dkey_len, unsigned char *skey, uint32_t *pkey, int bytes);
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
|
||||
+
|
||||
#define module_raw_uart_driver(__module_name, __raw_uart_driver, __of_match) \
|
||||
static struct generic_raw_uart *__raw_uart_driver##_raw_uart; \
|
||||
static int __##__raw_uart_driver##_probe(struct platform_device *pdev) \
|
||||
@@ -121,7 +123,7 @@
|
||||
int err; \
|
||||
struct device *dev = &pdev->dev; \
|
||||
\
|
||||
- err = generic_raw_uart_remove(__raw_uart_driver##_raw_uart); \
|
||||
+ err = generic_raw_uart_remove(__raw_uart_driver##_raw_uart); \
|
||||
if (err) \
|
||||
{ \
|
||||
dev_err(dev, "failed to remove generic_raw_uart module"); \
|
||||
@@ -143,3 +145,57 @@
|
||||
\
|
||||
module_platform_driver(__raw_uart_driver_platform_driver); \
|
||||
MODULE_DEVICE_TABLE(of, __of_match);
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#define module_raw_uart_driver(__module_name, __raw_uart_driver, __of_match) \
|
||||
+ static struct generic_raw_uart *__raw_uart_driver##_raw_uart; \
|
||||
+ static int __##__raw_uart_driver##_probe(struct platform_device *pdev) \
|
||||
+ { \
|
||||
+ struct device *dev = &pdev->dev; \
|
||||
+ int err = __raw_uart_driver##_probe(pdev); \
|
||||
+ \
|
||||
+ if (err) \
|
||||
+ { \
|
||||
+ dev_err(dev, "failed to initialize generic_raw_uart module"); \
|
||||
+ return err; \
|
||||
+ } \
|
||||
+ \
|
||||
+ __raw_uart_driver##_raw_uart = generic_raw_uart_probe(dev, &__raw_uart_driver, NULL); \
|
||||
+ if (IS_ERR_OR_NULL(__raw_uart_driver##_raw_uart)) \
|
||||
+ { \
|
||||
+ dev_err(dev, "failed to initialize generic_raw_uart module"); \
|
||||
+ return PTR_ERR(__raw_uart_driver##_raw_uart); \
|
||||
+ } \
|
||||
+ \
|
||||
+ return 0; \
|
||||
+ } \
|
||||
+ \
|
||||
+ static void __##__raw_uart_driver##_remove(struct platform_device *pdev) \
|
||||
+ { \
|
||||
+ int err; \
|
||||
+ struct device *dev = &pdev->dev; \
|
||||
+ \
|
||||
+ err = generic_raw_uart_remove(__raw_uart_driver##_raw_uart); \
|
||||
+ if (err) \
|
||||
+ { \
|
||||
+ dev_err(dev, "failed to remove generic_raw_uart module"); \
|
||||
+ } \
|
||||
+ \
|
||||
+ __raw_uart_driver##_remove(pdev); \
|
||||
+ } \
|
||||
+ \
|
||||
+ static struct platform_driver __raw_uart_driver_platform_driver = { \
|
||||
+ .probe = __##__raw_uart_driver##_probe, \
|
||||
+ .remove = __##__raw_uart_driver##_remove, \
|
||||
+ .driver = { \
|
||||
+ .owner = THIS_MODULE, \
|
||||
+ .name = __module_name, \
|
||||
+ .of_match_table = __of_match, \
|
||||
+ }, \
|
||||
+ }; \
|
||||
+ \
|
||||
+ module_platform_driver(__raw_uart_driver_platform_driver); \
|
||||
+ MODULE_DEVICE_TABLE(of, __of_match);
|
||||
+
|
||||
+#endif
|
@ -1,3 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
|
||||
sha256 1a99e87c48e95c173ce6f43b8783ac359022886265bb2ed86f67c6d05cf12658 generic_raw_uart-b80aacfb75e9689d14d4e2c94380728816c6313e.tar.gz
|
||||
sha256 f1741dfe9ea6ea37213c35c735aa899f11e4c2961bccd6d8198d4051b3c42c5d generic_raw_uart-f691101c32435921a70c96075233b6d5e5eeab7d.tar.gz
|
||||
|
@ -13,7 +13,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GENERIC_RAW_UART_VERSION = b80aacfb75e9689d14d4e2c94380728816c6313e
|
||||
GENERIC_RAW_UART_VERSION = f691101c32435921a70c96075233b6d5e5eeab7d
|
||||
GENERIC_RAW_UART_SITE = $(call github,alexreinert,piVCCU,$(GENERIC_RAW_UART_VERSION))
|
||||
GENERIC_RAW_UART_LICENSE = GPL2
|
||||
GENERIC_RAW_UART_LICENSE_FILES = LICENSE
|
||||
|
@ -0,0 +1,598 @@
|
||||
From 90f09d1766dfaad29f1c19c39f6b4b7a8483a86e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
|
||||
Date: Tue, 28 May 2024 15:49:32 +0200
|
||||
Subject: [PATCH] image-hd: add forced-primary flag for higher MBR layout
|
||||
flexibility
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The current limitation of Genimage is that it is not able to create
|
||||
MBR images that have primary partitions that start after a logical
|
||||
partition. This can be useful for images that can be later resized based
|
||||
on the actual device size - for this operation the partition must be at
|
||||
the end of the device, and if it is present in a logical partition, it
|
||||
must be resized first, making it a two-step process.
|
||||
|
||||
This commit adds the "forced-primary" flag which can be used to indicate
|
||||
that the partition should be put into the disk's MBR instead of creating
|
||||
another logical partition. Validation ensures that this syntax allows to
|
||||
create such partitions only after an existing logical partition, and
|
||||
that the maximum number of MBR entries woudn't be exceeded by doing so.
|
||||
|
||||
Test cases for valid and invalid configuiration has been added. Also
|
||||
added few more details in the debug print to make it more obvious how
|
||||
the MBR/EBR layout looks like.
|
||||
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
Upstream: https://github.com/pengutronix/genimage/pull/248
|
||||
---
|
||||
README.rst | 5 ++
|
||||
genimage.c | 2 +
|
||||
genimage.h | 3 +-
|
||||
image-hd.c | 116 +++++++++++++++++++----------
|
||||
test/hdimage-fail10.config | 33 ++++++++
|
||||
test/hdimage-fail11.config | 32 ++++++++
|
||||
test/hdimage-fail8.config | 28 +++++++
|
||||
test/hdimage-fail9.config | 27 +++++++
|
||||
test/hdimage-forced-primary.config | 47 ++++++++++++
|
||||
test/hdimage-forced-primary.fdisk | 10 +++
|
||||
test/hdimage.test | 14 +++-
|
||||
11 files changed, 275 insertions(+), 42 deletions(-)
|
||||
create mode 100644 test/hdimage-fail10.config
|
||||
create mode 100644 test/hdimage-fail11.config
|
||||
create mode 100644 test/hdimage-fail8.config
|
||||
create mode 100644 test/hdimage-fail9.config
|
||||
create mode 100644 test/hdimage-forced-primary.config
|
||||
create mode 100644 test/hdimage-forced-primary.fdisk
|
||||
|
||||
diff --git a/README.rst b/README.rst
|
||||
index d908ff5..7e2a0c5 100644
|
||||
--- a/README.rst
|
||||
+++ b/README.rst
|
||||
@@ -131,6 +131,11 @@ Partition options:
|
||||
:bootable: Boolean specifying whether to set the bootable flag.
|
||||
:in-partition-table: Boolean specifying whether to include this partition in
|
||||
the partition table. Defaults to true.
|
||||
+:forced-primary: Force this partition to be a primary partition in the
|
||||
+ MBR partition table, useful when the extended partition should be
|
||||
+ followed by primary partitions. If there are more partitions
|
||||
+ defined after the first forced-primary, they must be also defined
|
||||
+ as forced-primary. Defaults to false.
|
||||
:partition-uuid: UUID string used by GPT partition tables to specify the partition
|
||||
id. Defaults to a random value.
|
||||
:partition-type-uuid: String used by GPT partition tables to specify the partition type.
|
||||
diff --git a/genimage.c b/genimage.c
|
||||
index 5bd235b..2fa9fa2 100644
|
||||
--- a/genimage.c
|
||||
+++ b/genimage.c
|
||||
@@ -96,6 +96,7 @@ static cfg_opt_t partition_opts[] = {
|
||||
CFG_STR("align", NULL, CFGF_NONE),
|
||||
CFG_INT("partition-type", 0, CFGF_NONE),
|
||||
CFG_BOOL("bootable", cfg_false, CFGF_NONE),
|
||||
+ CFG_BOOL("forced-primary", cfg_false, CFGF_NONE),
|
||||
CFG_BOOL("read-only", cfg_false, CFGF_NONE),
|
||||
CFG_BOOL("hidden", cfg_false, CFGF_NONE),
|
||||
CFG_BOOL("no-automount", cfg_false, CFGF_NONE),
|
||||
@@ -396,6 +397,7 @@ static int parse_partitions(struct image *image, cfg_t *imagesec)
|
||||
part->align = cfg_getint_suffix(partsec, "align");
|
||||
part->partition_type = cfg_getint(partsec, "partition-type");
|
||||
part->bootable = cfg_getbool(partsec, "bootable");
|
||||
+ part->forced_primary = cfg_getbool(partsec, "forced-primary");
|
||||
part->read_only = cfg_getbool(partsec, "read-only");
|
||||
part->hidden = cfg_getbool(partsec, "hidden");
|
||||
part->no_automount = cfg_getbool(partsec, "no-automount");
|
||||
diff --git a/genimage.h b/genimage.h
|
||||
index 8c86e77..b630984 100644
|
||||
--- a/genimage.h
|
||||
+++ b/genimage.h
|
||||
@@ -39,7 +39,8 @@ struct partition {
|
||||
unsigned long long align;
|
||||
unsigned char partition_type;
|
||||
cfg_bool_t bootable;
|
||||
- cfg_bool_t extended;
|
||||
+ cfg_bool_t logical;
|
||||
+ cfg_bool_t forced_primary;
|
||||
cfg_bool_t read_only;
|
||||
cfg_bool_t hidden;
|
||||
cfg_bool_t no_automount;
|
||||
diff --git a/image-hd.c b/image-hd.c
|
||||
index 4ea55b6..6fb850f 100644
|
||||
--- a/image-hd.c
|
||||
+++ b/image-hd.c
|
||||
@@ -35,10 +35,12 @@
|
||||
#define TYPE_GPT 2
|
||||
#define TYPE_HYBRID (TYPE_MBR|TYPE_GPT)
|
||||
|
||||
+#define PARTITION_TYPE_EXTENDED 0x0F
|
||||
+
|
||||
struct hdimage {
|
||||
- unsigned int extended_partition;
|
||||
+ unsigned int extended_partition_index;
|
||||
+ struct partition *extended_partition;
|
||||
unsigned long long align;
|
||||
- unsigned long long extended_lba;
|
||||
uint32_t disksig;
|
||||
const char *disk_uuid;
|
||||
int table_type;
|
||||
@@ -151,32 +153,24 @@ static int hdimage_insert_mbr(struct image *image, struct list_head *partitions)
|
||||
list_for_each_entry(part, partitions, list) {
|
||||
struct mbr_partition_entry *entry;
|
||||
|
||||
- if (!part->in_partition_table)
|
||||
+ if (!part->in_partition_table || part->logical)
|
||||
continue;
|
||||
|
||||
if (hd->table_type == TYPE_HYBRID && !part->partition_type)
|
||||
continue;
|
||||
|
||||
- if (hd->table_type == TYPE_HYBRID && part->extended)
|
||||
- continue;
|
||||
-
|
||||
entry = &mbr.part_entry[i];
|
||||
|
||||
entry->boot = part->bootable ? 0x80 : 0x00;
|
||||
- if (!part->extended) {
|
||||
- entry->partition_type = part->partition_type;
|
||||
- entry->relative_sectors = part->offset/512;
|
||||
- entry->total_sectors = part->size/512;
|
||||
- }
|
||||
- else {
|
||||
- entry->partition_type = 0x0F;
|
||||
- entry->relative_sectors = (hd->extended_lba)/512;
|
||||
- entry->total_sectors = (image->size - hd->extended_lba)/512;
|
||||
- }
|
||||
+ entry->partition_type = part->partition_type;
|
||||
+ entry->relative_sectors = part->offset/512;
|
||||
+ entry->total_sectors = part->size/512;
|
||||
hdimage_setup_chs(entry);
|
||||
|
||||
- if (part->extended)
|
||||
- break;
|
||||
+ image_debug(image, "[MBR entry %d]: type=%x start=%d size=%d\n",
|
||||
+ i, entry->partition_type,
|
||||
+ entry->relative_sectors, entry->total_sectors);
|
||||
+
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -215,8 +209,9 @@ static int hdimage_insert_ebr(struct image *image, struct partition *part)
|
||||
struct mbr_partition_entry *entry;
|
||||
char ebr[4*sizeof(struct mbr_partition_entry)+2], *part_table;
|
||||
int ret;
|
||||
+ unsigned long long ebr_offset = part->offset - hd->align + 446;
|
||||
|
||||
- image_info(image, "writing EBR\n");
|
||||
+ image_debug(image, "writing EBR to sector %llu\n", ebr_offset / 512);
|
||||
|
||||
memset(ebr, 0, sizeof(ebr));
|
||||
part_table = ebr;
|
||||
@@ -229,12 +224,12 @@ static int hdimage_insert_ebr(struct image *image, struct partition *part)
|
||||
hdimage_setup_chs(entry);
|
||||
struct partition *p = part;
|
||||
list_for_each_entry_continue(p, &image->partitions, list) {
|
||||
- if (!p->extended)
|
||||
+ if (!p->logical)
|
||||
continue;
|
||||
++entry;
|
||||
entry->boot = 0x00;
|
||||
- entry->partition_type = 0x0F;
|
||||
- entry->relative_sectors = (p->offset - hd->align - hd->extended_lba)/512;
|
||||
+ entry->partition_type = PARTITION_TYPE_EXTENDED;
|
||||
+ entry->relative_sectors = (p->offset - hd->align - hd->extended_partition->offset)/512;
|
||||
entry->total_sectors = (p->size + hd->align)/512;
|
||||
hdimage_setup_chs(entry);
|
||||
break;
|
||||
@@ -245,7 +240,7 @@ static int hdimage_insert_ebr(struct image *image, struct partition *part)
|
||||
part_table[1] = 0xaa;
|
||||
|
||||
ret = insert_data(image, ebr, imageoutfile(image), sizeof(ebr),
|
||||
- part->offset - hd->align + 446);
|
||||
+ ebr_offset);
|
||||
if (ret) {
|
||||
image_error(image, "failed to write EBR\n");
|
||||
return ret;
|
||||
@@ -577,13 +572,15 @@ static int hdimage_generate(struct image *image)
|
||||
list_for_each_entry(part, &image->partitions, list) {
|
||||
struct image *child;
|
||||
|
||||
- image_info(image, "adding partition '%s'%s%s%s%s ...\n", part->name,
|
||||
+ image_info(image, "adding %s partition '%s'%s%s%s%s ...\n",
|
||||
+ part->logical ? "logical" : "primary",
|
||||
+ part->name,
|
||||
part->in_partition_table ? " (in MBR)" : "",
|
||||
part->image ? " from '": "",
|
||||
part->image ? part->image : "",
|
||||
part->image ? "'" : "");
|
||||
|
||||
- if (part->extended) {
|
||||
+ if (part->logical) {
|
||||
ret = hdimage_insert_ebr(image, part);
|
||||
if (ret) {
|
||||
image_error(image, "failed to write EBR\n");
|
||||
@@ -756,13 +753,14 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
struct partition *autoresize_part = NULL;
|
||||
int has_extended;
|
||||
unsigned int partition_table_entries = 0, hybrid_entries = 0;
|
||||
+ unsigned int mbr_entries = 0, forced_primary_entries = 0;
|
||||
unsigned long long now = 0;
|
||||
const char *disk_signature, *table_type;
|
||||
struct hdimage *hd = xzalloc(sizeof(*hd));
|
||||
struct partition *gpt_backup = NULL;
|
||||
|
||||
hd->align = cfg_getint_suffix(cfg, "align");
|
||||
- hd->extended_partition = cfg_getint(cfg, "extended-partition");
|
||||
+ hd->extended_partition_index = cfg_getint(cfg, "extended-partition");
|
||||
disk_signature = cfg_getstr(cfg, "disk-signature");
|
||||
table_type = cfg_getstr(cfg, "partition-table-type");
|
||||
hd->gpt_location = cfg_getint_suffix(cfg, "gpt-location");
|
||||
@@ -809,10 +807,10 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
if (!hd->align)
|
||||
hd->align = hd->table_type == TYPE_NONE ? 1 : 512;
|
||||
|
||||
- if (hd->extended_partition > 4) {
|
||||
+ if (hd->extended_partition_index > 4) {
|
||||
image_error(image, "invalid extended partition index (%i). must be "
|
||||
"inferior or equal to 4 (0 for automatic)\n",
|
||||
- hd->extended_partition);
|
||||
+ hd->extended_partition_index);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -821,11 +819,41 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
"multiple of 1 sector (512 bytes)\n", hd->align);
|
||||
return -EINVAL;
|
||||
}
|
||||
+ if (hd->table_type == TYPE_MBR && hd->extended_partition_index)
|
||||
+ mbr_entries = hd->extended_partition_index;
|
||||
+
|
||||
+ has_extended = hd->extended_partition_index > 0;
|
||||
+
|
||||
list_for_each_entry(part, &image->partitions, list) {
|
||||
if (hd->table_type == TYPE_NONE)
|
||||
part->in_partition_table = false;
|
||||
if (part->in_partition_table)
|
||||
++partition_table_entries;
|
||||
+ if (hd->table_type == TYPE_MBR && part->in_partition_table) {
|
||||
+ if (!hd->extended_partition_index && partition_table_entries > 4) {
|
||||
+ hd->extended_partition_index = mbr_entries = 4;
|
||||
+ has_extended = true;
|
||||
+ }
|
||||
+ if (part->forced_primary) {
|
||||
+ ++forced_primary_entries;
|
||||
+ ++mbr_entries;
|
||||
+ if (partition_table_entries <= hd->extended_partition_index) {
|
||||
+ image_error(image, "partition %s: forced-primary can only be used for "
|
||||
+ "partitions following the extended partition\n",
|
||||
+ part->name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ } else if (forced_primary_entries > 0) {
|
||||
+ image_error(image,
|
||||
+ "cannot create non-primary partition %s after forced-primary partition\n",
|
||||
+ part->name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ if (mbr_entries > 4) {
|
||||
+ image_error(image, "too many primary partitions\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ }
|
||||
if (!part->align)
|
||||
part->align = (part->in_partition_table || hd->table_type == TYPE_NONE) ? hd->align : 1;
|
||||
if (part->in_partition_table && part->align % hd->align) {
|
||||
@@ -834,10 +862,6 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
part->align, part->name, hd->align);
|
||||
}
|
||||
}
|
||||
- if (hd->table_type == TYPE_MBR && !hd->extended_partition &&
|
||||
- partition_table_entries > 4)
|
||||
- hd->extended_partition = 4;
|
||||
- has_extended = hd->extended_partition > 0;
|
||||
|
||||
if (hd->disk_uuid) {
|
||||
if (!(hd->table_type & TYPE_GPT)) {
|
||||
@@ -958,12 +982,12 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
if (part->partition_type)
|
||||
++hybrid_entries;
|
||||
}
|
||||
- /* reserve space for extended boot record if necessary */
|
||||
if (part->in_partition_table)
|
||||
++partition_table_entries;
|
||||
- part->extended = has_extended && part->in_partition_table &&
|
||||
- (partition_table_entries >= hd->extended_partition);
|
||||
- if (part->extended) {
|
||||
+ part->logical = !part->forced_primary && has_extended && part->in_partition_table &&
|
||||
+ (partition_table_entries >= hd->extended_partition_index);
|
||||
+ if (part->logical) {
|
||||
+ /* reserve space for extended boot record */
|
||||
now += hd->align;
|
||||
now = roundup(now, part->align);
|
||||
}
|
||||
@@ -978,8 +1002,6 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
if (!part->offset && (part->in_partition_table || hd->table_type == TYPE_NONE)) {
|
||||
part->offset = roundup(now, part->align);
|
||||
}
|
||||
- if (part->extended && !hd->extended_lba)
|
||||
- hd->extended_lba = part->offset - hd->align;
|
||||
|
||||
if (part->offset % part->align) {
|
||||
image_error(image, "part %s offset (%lld) must be a"
|
||||
@@ -1027,7 +1049,7 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
part->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
- if (!part->extended) {
|
||||
+ if (!part->logical) {
|
||||
int ret = check_overlap(image, part);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1051,8 +1073,22 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
||||
hd->file_size = part->offset + child->size;
|
||||
}
|
||||
}
|
||||
- else if (part->extended)
|
||||
+ else if (part->logical)
|
||||
hd->file_size = part->offset - hd->align + 512;
|
||||
+
|
||||
+ if (has_extended && hd->extended_partition_index == partition_table_entries) {
|
||||
+ struct partition *p = fake_partition("[Extended]", now - hd->align - part->size,
|
||||
+ 0);
|
||||
+ p->in_partition_table = true;
|
||||
+ p->partition_type = PARTITION_TYPE_EXTENDED;
|
||||
+
|
||||
+ hd->extended_partition = p;
|
||||
+ list_add_tail(&p->list, &part->list);
|
||||
+ }
|
||||
+
|
||||
+ if (part->logical) {
|
||||
+ hd->extended_partition->size = now - hd->extended_partition->offset;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (hybrid_entries > 3) {
|
||||
diff --git a/test/hdimage-fail10.config b/test/hdimage-fail10.config
|
||||
new file mode 100644
|
||||
index 0000000..782c090
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-fail10.config
|
||||
@@ -0,0 +1,33 @@
|
||||
+image test.hdimage {
|
||||
+ hdimage {
|
||||
+ align = 1M
|
||||
+ extended-partition = 3
|
||||
+ }
|
||||
+ partition primary1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition extended1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition extended2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary3 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+ partition primary4 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ /* would be 5th primary partition */
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hdimage-fail11.config b/test/hdimage-fail11.config
|
||||
new file mode 100644
|
||||
index 0000000..06bf64b
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-fail11.config
|
||||
@@ -0,0 +1,32 @@
|
||||
+image test.hdimage {
|
||||
+ hdimage {
|
||||
+ align = 1M
|
||||
+ extended-partition = 1
|
||||
+ }
|
||||
+ partition extended1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition extended2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition extended3 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition extended4 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+ partition extended5 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ /* extended partition would overlap the forced-primary one */
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hdimage-fail8.config b/test/hdimage-fail8.config
|
||||
new file mode 100644
|
||||
index 0000000..8f55faa
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-fail8.config
|
||||
@@ -0,0 +1,28 @@
|
||||
+image test.hdimage {
|
||||
+ hdimage {
|
||||
+ align = 1M
|
||||
+ extended-partition = 1
|
||||
+ }
|
||||
+ partition part1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ forced-primary = "yes"
|
||||
+ /* forced-primary can be only used for partitions defined after the extended partition */
|
||||
+ }
|
||||
+ partition part2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part3 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part4 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part5 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hdimage-fail9.config b/test/hdimage-fail9.config
|
||||
new file mode 100644
|
||||
index 0000000..d811b7b
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-fail9.config
|
||||
@@ -0,0 +1,27 @@
|
||||
+image test.hdimage {
|
||||
+ hdimage {
|
||||
+ align = 1M
|
||||
+ }
|
||||
+ partition primary1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary2 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary3 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary4 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition primary5 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ /* part4 is implicitly extended -> too many primary entries */
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hdimage-forced-primary.config b/test/hdimage-forced-primary.config
|
||||
new file mode 100644
|
||||
index 0000000..c15b3a5
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-forced-primary.config
|
||||
@@ -0,0 +1,47 @@
|
||||
+image test.hdimage {
|
||||
+ hdimage {
|
||||
+ align = 1M
|
||||
+ disk-signature = 0x12345678
|
||||
+ extended-partition = 2
|
||||
+ }
|
||||
+ partition part1 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0xc
|
||||
+ bootable = "yes"
|
||||
+ }
|
||||
+ /*
|
||||
+ * partition 2 will be the extended partition entry
|
||||
+ * partitions 3-4 will be primary partitions at the end
|
||||
+ * partition 5 is first logical partition of the extended partition
|
||||
+ */
|
||||
+ partition part5-logical {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part6-logical {
|
||||
+ image = "part2.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part7-logical {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part8-logical {
|
||||
+ image = "part2.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part9-logical {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ }
|
||||
+ partition part3 {
|
||||
+ image = "part1.img"
|
||||
+ partition-type = 0x83
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+ partition part4 {
|
||||
+ image = "part2.img"
|
||||
+ partition-type = 0x82
|
||||
+ forced-primary = "yes"
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hdimage-forced-primary.fdisk b/test/hdimage-forced-primary.fdisk
|
||||
new file mode 100644
|
||||
index 0000000..ff0e903
|
||||
--- /dev/null
|
||||
+++ b/test/hdimage-forced-primary.fdisk
|
||||
@@ -0,0 +1,10 @@
|
||||
+Disk identifier: 0x12345678
|
||||
+images/test.hdimage1:start=2048,size=2048,type=c,bootable
|
||||
+images/test.hdimage2:start=4096,size=20480,type=f
|
||||
+images/test.hdimage3:start=24576,size=2048,type=83
|
||||
+images/test.hdimage4:start=26624,size=2048,type=82
|
||||
+images/test.hdimage5:start=6144,size=2048,type=83
|
||||
+images/test.hdimage6:start=10240,size=2048,type=83
|
||||
+images/test.hdimage7:start=14336,size=2048,type=83
|
||||
+images/test.hdimage8:start=18432,size=2048,type=83
|
||||
+images/test.hdimage9:start=22528,size=2048,type=83
|
||||
diff --git a/test/hdimage.test b/test/hdimage.test
|
||||
index c284613..a81c3f1 100755
|
||||
--- a/test/hdimage.test
|
||||
+++ b/test/hdimage.test
|
||||
@@ -96,7 +96,11 @@ test_expect_success "hdimage syntax" "
|
||||
test_must_fail run_genimage hdimage-fail4.config &&
|
||||
test_must_fail run_genimage hdimage-fail5.config &&
|
||||
test_must_fail run_genimage hdimage-fail6.config &&
|
||||
- test_must_fail run_genimage hdimage-fail7.config
|
||||
+ test_must_fail run_genimage hdimage-fail7.config &&
|
||||
+ test_must_fail run_genimage hdimage-fail8.config &&
|
||||
+ test_must_fail run_genimage hdimage-fail9.config &&
|
||||
+ test_must_fail run_genimage hdimage-fail10.config &&
|
||||
+ test_must_fail run_genimage hdimage-fail11.config
|
||||
"
|
||||
|
||||
setup_gpt_files() {
|
||||
@@ -163,6 +167,14 @@ test_expect_success "hdimage no-partition" "
|
||||
test_cmp 'hdimage-nopart.hexdump' '${testdir}/hdimage-nopart.hexdump'
|
||||
"
|
||||
|
||||
+test_expect_success "hdimage forced-primary" "
|
||||
+ setup_test_images &&
|
||||
+ run_genimage hdimage-forced-primary.config &&
|
||||
+ sfdisk_validate images/test.hdimage &&
|
||||
+ sanitized_fdisk_sfdisk images/test.hdimage > hdimage.fdisk &&
|
||||
+ test_cmp '${testdir}/hdimage-forced-primary.fdisk' hdimage.fdisk
|
||||
+"
|
||||
+
|
||||
test_done
|
||||
|
||||
# vim: syntax=sh
|
@ -0,0 +1,64 @@
|
||||
From 9484103803a36783fe6f6a8ec762797cf962c9bf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <sairon@sairon.cz>
|
||||
Date: Mon, 29 Jul 2024 17:00:31 +0200
|
||||
Subject: [PATCH] image-hd: do not use first partition offset for GPT's first
|
||||
usable LBA
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently first usable LBA in the GPT header is pointing to offset of
|
||||
the first partition, ignoring the gpt-location specified in the config.
|
||||
This can lead to some issues as explained in [1]. Disabling this
|
||||
behavior doesn't break any tests and allows for generating of images
|
||||
that have same layout as those generated by sgdisk or other utilities.
|
||||
|
||||
[1] https://github.com/pengutronix/genimage/issues/262
|
||||
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
image-hd.c | 10 +---------
|
||||
1 file changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/image-hd.c b/image-hd.c
|
||||
index 6fb850f..4f965db 100644
|
||||
--- a/image-hd.c
|
||||
+++ b/image-hd.c
|
||||
@@ -456,7 +456,6 @@ static int hdimage_insert_gpt(struct image *image, struct list_head *partitions)
|
||||
const char *outfile = imageoutfile(image);
|
||||
struct gpt_header header;
|
||||
struct gpt_partition_entry table[GPT_ENTRIES];
|
||||
- unsigned long long smallest_offset = ~0ULL;
|
||||
struct partition *part;
|
||||
unsigned i, j;
|
||||
int ret;
|
||||
@@ -469,7 +468,7 @@ static int hdimage_insert_gpt(struct image *image, struct list_head *partitions)
|
||||
header.header_size = htole32(sizeof(struct gpt_header));
|
||||
header.current_lba = htole64(1);
|
||||
header.backup_lba = htole64(hd->gpt_no_backup ? 1 :image->size/512 - 1);
|
||||
- header.first_usable_lba = htole64(~0ULL);
|
||||
+ header.first_usable_lba = htole64(hd->gpt_location / 512 + GPT_SECTORS - 1);
|
||||
header.last_usable_lba = htole64(image->size/512 - 1 - GPT_SECTORS);
|
||||
uuid_parse(hd->disk_uuid, header.disk_uuid);
|
||||
header.starting_lba = htole64(hd->gpt_location/512);
|
||||
@@ -482,9 +481,6 @@ static int hdimage_insert_gpt(struct image *image, struct list_head *partitions)
|
||||
if (!part->in_partition_table)
|
||||
continue;
|
||||
|
||||
- if (part->offset < smallest_offset)
|
||||
- smallest_offset = part->offset;
|
||||
-
|
||||
uuid_parse(part->partition_type_uuid, table[i].type_uuid);
|
||||
uuid_parse(part->partition_uuid, table[i].uuid);
|
||||
table[i].first_lba = htole64(part->offset/512);
|
||||
@@ -499,10 +495,6 @@ static int hdimage_insert_gpt(struct image *image, struct list_head *partitions)
|
||||
|
||||
i++;
|
||||
}
|
||||
- if (smallest_offset == ~0ULL)
|
||||
- smallest_offset = hd->gpt_location + (GPT_SECTORS - 1)*512;
|
||||
- header.first_usable_lba = htole64(smallest_offset / 512);
|
||||
-
|
||||
|
||||
header.table_crc = htole32(crc32(table, sizeof(table)));
|
||||
|
@ -1,119 +0,0 @@
|
||||
From adee1a842735a55adde3575be523cafa424ab2ef Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Date: Wed, 19 Mar 2025 11:58:31 -0500
|
||||
Subject: [PATCH] drm/amd: Handle being compiled without SI or CIK support
|
||||
better
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If compiled without SI or CIK support but amdgpu tries to load it
|
||||
will run into failures with uninitialized callbacks.
|
||||
|
||||
Show a nicer message in this case and fail probe instead.
|
||||
|
||||
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4050
|
||||
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5f054ddead33c1622ea9c0c0aaf07c6843fc7ab0
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 44 ++++++++++++++-----------
|
||||
1 file changed, 24 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
index 32afcf9485245..e0c33e93e29f5 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
@@ -1795,7 +1795,6 @@ static const u16 amdgpu_unsupported_pciidlist[] = {
|
||||
};
|
||||
|
||||
static const struct pci_device_id pciidlist[] = {
|
||||
-#ifdef CONFIG_DRM_AMDGPU_SI
|
||||
{0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI},
|
||||
{0x1002, 0x6784, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI},
|
||||
{0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI},
|
||||
@@ -1868,8 +1867,6 @@ static const struct pci_device_id pciidlist[] = {
|
||||
{0x1002, 0x6665, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY},
|
||||
{0x1002, 0x6667, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY},
|
||||
{0x1002, 0x666F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|AMD_IS_MOBILITY},
|
||||
-#endif
|
||||
-#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||
/* Kaveri */
|
||||
{0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU},
|
||||
{0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_APU},
|
||||
@@ -1952,7 +1949,6 @@ static const struct pci_device_id pciidlist[] = {
|
||||
{0x1002, 0x985D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU},
|
||||
{0x1002, 0x985E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU},
|
||||
{0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU},
|
||||
-#endif
|
||||
/* topaz */
|
||||
{0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
|
||||
{0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
|
||||
@@ -2284,14 +2280,14 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
+ switch (flags & AMD_ASIC_MASK) {
|
||||
+ case CHIP_TAHITI:
|
||||
+ case CHIP_PITCAIRN:
|
||||
+ case CHIP_VERDE:
|
||||
+ case CHIP_OLAND:
|
||||
+ case CHIP_HAINAN:
|
||||
#ifdef CONFIG_DRM_AMDGPU_SI
|
||||
- if (!amdgpu_si_support) {
|
||||
- switch (flags & AMD_ASIC_MASK) {
|
||||
- case CHIP_TAHITI:
|
||||
- case CHIP_PITCAIRN:
|
||||
- case CHIP_VERDE:
|
||||
- case CHIP_OLAND:
|
||||
- case CHIP_HAINAN:
|
||||
+ if (!amdgpu_si_support) {
|
||||
dev_info(&pdev->dev,
|
||||
"SI support provided by radeon.\n");
|
||||
dev_info(&pdev->dev,
|
||||
@@ -2299,16 +2295,18 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
|
||||
);
|
||||
return -ENODEV;
|
||||
}
|
||||
- }
|
||||
+ break;
|
||||
+#else
|
||||
+ dev_info(&pdev->dev, "amdgpu is built without SI support.\n");
|
||||
+ return -ENODEV;
|
||||
#endif
|
||||
+ case CHIP_KAVERI:
|
||||
+ case CHIP_BONAIRE:
|
||||
+ case CHIP_HAWAII:
|
||||
+ case CHIP_KABINI:
|
||||
+ case CHIP_MULLINS:
|
||||
#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||
- if (!amdgpu_cik_support) {
|
||||
- switch (flags & AMD_ASIC_MASK) {
|
||||
- case CHIP_KAVERI:
|
||||
- case CHIP_BONAIRE:
|
||||
- case CHIP_HAWAII:
|
||||
- case CHIP_KABINI:
|
||||
- case CHIP_MULLINS:
|
||||
+ if (!amdgpu_cik_support) {
|
||||
dev_info(&pdev->dev,
|
||||
"CIK support provided by radeon.\n");
|
||||
dev_info(&pdev->dev,
|
||||
@@ -2316,8 +2314,14 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
|
||||
);
|
||||
return -ENODEV;
|
||||
}
|
||||
- }
|
||||
+ break;
|
||||
+#else
|
||||
+ dev_info(&pdev->dev, "amdgpu is built without CIK support.\n");
|
||||
+ return -ENODEV;
|
||||
#endif
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev);
|
||||
if (IS_ERR(adev))
|
@ -0,0 +1,27 @@
|
||||
From 00592cc1e5f0a04b06a4aac33fd62d84650c9c3f Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Agner <stefan@agner.ch>
|
||||
Date: Mon, 27 Mar 2023 17:48:34 +0200
|
||||
Subject: [PATCH] ndisc: support multiple gateways for a single network
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
[Jan: updated for NM 1.44]
|
||||
Signed-off-by: Jan Čermák <sairon@sairon.cz>
|
||||
---
|
||||
src/core/ndisc/nm-ndisc.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c
|
||||
index 20dd21212d..e00bdac872 100644
|
||||
--- a/src/core/ndisc/nm-ndisc.c
|
||||
+++ b/src/core/ndisc/nm-ndisc.c
|
||||
@@ -705,6 +705,7 @@ nm_ndisc_add_route(NMNDisc *ndisc, const NMNDiscRoute *new_item, gint64 now_msec
|
||||
* comparison is aborted, and both routes are added.
|
||||
*/
|
||||
if (IN6_ARE_ADDR_EQUAL(&item->network, &new_item->network) && item->plen == new_item->plen
|
||||
+ && IN6_ARE_ADDR_EQUAL(&item->gateway, &new_item->gateway)
|
||||
&& item->on_link == new_item->on_link) {
|
||||
if (new_item->expiry_msec <= now_msec) {
|
||||
g_array_remove_index(rdata->routes, i);
|
@ -0,0 +1,59 @@
|
||||
From f42a5b49e95a8deed0b8e6f1bea6679af7e908e4 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 19 Apr 2024 13:25:55 +0200
|
||||
Subject: [PATCH] detect-virt: detect hyperv-enlightened qemu as qemu, not as
|
||||
hyperv
|
||||
|
||||
CPUID reporting hyperv should be taken with a grain of salt, and we
|
||||
should prefer other mechanisms then.
|
||||
|
||||
Fixes: #28001
|
||||
---
|
||||
src/basic/virt.c | 20 ++++++++++++++++----
|
||||
1 file changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/basic/virt.c b/src/basic/virt.c
|
||||
index 88357a9..89abb53 100644
|
||||
--- a/src/basic/virt.c
|
||||
+++ b/src/basic/virt.c
|
||||
@@ -446,7 +446,7 @@ static Virtualization detect_vm_zvm(void) {
|
||||
/* Returns a short identifier for the various VM implementations */
|
||||
Virtualization detect_vm(void) {
|
||||
static thread_local Virtualization cached_found = _VIRTUALIZATION_INVALID;
|
||||
- bool other = false;
|
||||
+ bool other = false, hyperv = false;
|
||||
int xen_dom0 = 0;
|
||||
Virtualization v, dmi;
|
||||
|
||||
@@ -503,7 +503,12 @@ Virtualization detect_vm(void) {
|
||||
v = detect_vm_cpuid();
|
||||
if (v < 0)
|
||||
return v;
|
||||
- if (v == VIRTUALIZATION_VM_OTHER)
|
||||
+ if (v == VIRTUALIZATION_MICROSOFT)
|
||||
+ /* QEMU sets the CPUID string to hyperv's, in case it provides hyperv enlightenments. Let's
|
||||
+ * hence not return Microsoft here but just use the other mechanisms first to make a better
|
||||
+ * decision. */
|
||||
+ hyperv = true;
|
||||
+ else if (v == VIRTUALIZATION_VM_OTHER)
|
||||
other = true;
|
||||
else if (v != VIRTUALIZATION_NONE)
|
||||
goto finish;
|
||||
@@ -544,8 +549,15 @@ Virtualization detect_vm(void) {
|
||||
return v;
|
||||
|
||||
finish:
|
||||
- if (v == VIRTUALIZATION_NONE && other)
|
||||
- v = VIRTUALIZATION_VM_OTHER;
|
||||
+ /* None of the checks above gave us a clear answer, hence let's now use fallback logic: if hyperv
|
||||
+ * enlightenments are available but the VMM wasn't recognized as anything yet, it's probably
|
||||
+ * Microsoft. */
|
||||
+ if (v == VIRTUALIZATION_NONE) {
|
||||
+ if (hyperv)
|
||||
+ v = VIRTUALIZATION_MICROSOFT;
|
||||
+ else if (other)
|
||||
+ v = VIRTUALIZATION_VM_OTHER;
|
||||
+ }
|
||||
|
||||
cached_found = v;
|
||||
log_debug("Found VM virtualization %s", virtualization_to_string(v));
|
@ -21,13 +21,11 @@ SWAPFILE="/mnt/data/swapfile"
|
||||
|
||||
# Swap size in kilobytes (as it's also what meminfo shows)
|
||||
SWAPSIZE="$(size2kilobytes "${SWAPSIZE}")"
|
||||
SWAPSIZE_TOLERANCE=0
|
||||
|
||||
if [ -z "${SWAPSIZE}" ] || [ "${SWAPSIZE}" = "-1" ]; then
|
||||
# Default to 33% of total memory
|
||||
SWAPSIZE="$(awk '/MemTotal/{ print int($2 * 0.33) }' /proc/meminfo)"
|
||||
echo "[INFO] Using default swapsize of 33% RAM (${SWAPSIZE} kB)"
|
||||
SWAPSIZE_TOLERANCE=$((32*1024)) # allow for 32MB fluctuations
|
||||
fi
|
||||
|
||||
# Swap space in 4k blocks
|
||||
@ -44,12 +42,7 @@ if [ "${SWAPSIZE_BLOCKS}" -lt 10 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CURRENT_SIZE="$([ -f "${SWAPFILE}" ] && stat "${SWAPFILE}" -c '%s' || echo 0)"
|
||||
|
||||
if [ -s "${SWAPFILE}" ] && [ "${CURRENT_SIZE}" -ge $(((SWAPSIZE - SWAPSIZE_TOLERANCE) * 1024)) ] \
|
||||
&& [ "${CURRENT_SIZE}" -le $(((SWAPSIZE + SWAPSIZE_TOLERANCE) * 1024)) ]; then
|
||||
echo "[INFO] Swapfile already exists with size ${CURRENT_SIZE} bytes"
|
||||
elif [ ! -s "${SWAPFILE}" ] || [ "${CURRENT_SIZE}" -ne $((SWAPSIZE_BLOCKS * 4096)) ]; then
|
||||
if [ ! -s "${SWAPFILE}" ] || [ "$(stat "${SWAPFILE}" -c '%s')" -ne $((SWAPSIZE_BLOCKS * 4096)) ]; then
|
||||
# Check free space (in 4k blocks)
|
||||
if [ "$(stat -f /mnt/data -c '%f')" -lt "${SWAPSIZE_BLOCKS}" ]; then
|
||||
echo "[ERROR] Not enough space to allocate swapfile"
|
||||
|
@ -81,7 +81,7 @@ function convert_disk_image_ova() {
|
||||
|
||||
cp -a "${BOARD_DIR}/home-assistant.ovf" "${ova_data}/home-assistant.ovf"
|
||||
qemu-img convert -O vmdk -o subformat=streamOptimized,adapter_type=lsilogic "${hdd_img}" "${ova_data}/home-assistant.vmdk"
|
||||
(cd "${ova_data}" || exit 1; "${HOST_DIR}/bin/openssl" sha256 home-assistant.* | sed 's/SHA2-256/SHA256/' > home-assistant.mf)
|
||||
(cd "${ova_data}" || exit 1; "${HOST_DIR}/bin/openssl" sha256 home-assistant.* >home-assistant.mf)
|
||||
tar -C "${ova_data}" --owner=root --group=root -cf "${hdd_ova}" home-assistant.ovf home-assistant.vmdk home-assistant.mf
|
||||
}
|
||||
|
||||
|
@ -65,12 +65,6 @@ def test_supervisor_logs(shell):
|
||||
_LOGGER.info("%s", "\n".join(output))
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
def test_landing_page(shell):
|
||||
web_index = shell.run_check("curl http://localhost:8123")
|
||||
assert "</html>" in " ".join(web_index)
|
||||
|
||||
|
||||
def test_systemctl_status(shell):
|
||||
output = shell.run_check("systemctl --no-pager -l status -a || true")
|
||||
_LOGGER.info("%s", "\n".join(output))
|
||||
@ -87,29 +81,6 @@ def test_systemctl_no_cycles(shell):
|
||||
assert not output, f"Found Systemd dependency cycles:\n{"\n".join(output)}"
|
||||
|
||||
|
||||
def test_host_connectivity(shell):
|
||||
output = shell.run_check("curl -f https://checkonline.home-assistant.io/online.txt")
|
||||
assert "NetworkManager is online" in output
|
||||
output = shell.run_check("nmcli network connectivity check")
|
||||
assert "full" in output, f"Connectivity check failed, nmcli reports: {output}"
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
@pytest.mark.timeout(10)
|
||||
def test_supervisor_connectivity(shell):
|
||||
# checks URL used by connectivity checks via docker0 bridge
|
||||
output = shell.run_check("docker exec -ti hassio_supervisor curl -f https://checkonline.home-assistant.io/online.txt")
|
||||
assert "NetworkManager is online" in output
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
@pytest.mark.timeout(10)
|
||||
def test_hassio_connectivity(shell):
|
||||
# checks URL used by connectivity checks via hassio bridge
|
||||
output = shell.run_check("docker exec -ti hassio_cli curl -f https://checkonline.home-assistant.io/online.txt")
|
||||
assert "NetworkManager is online" in output
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
def test_custom_swap_size(shell, target):
|
||||
output = shell.run_check("stat -c '%s' /mnt/data/swapfile")
|
||||
|
@ -59,9 +59,7 @@ def test_check_supervisor(shell_json):
|
||||
def test_update_supervisor(shell_json):
|
||||
supervisor_info = shell_json("ha supervisor info --no-progress --raw-json")
|
||||
supervisor_version = supervisor_info.get("data").get("version")
|
||||
supervisor_version_latest = supervisor_info.get("data").get("version_latest")
|
||||
assert supervisor_version_latest, "Missing latest supervisor version info"
|
||||
if supervisor_version == supervisor_version_latest:
|
||||
if supervisor_version == supervisor_info.get("data").get("version_latest"):
|
||||
logger.info("Supervisor is already up to date")
|
||||
pytest.skip("Supervisor is already up to date")
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user