Compare commits

..

1 Commits

Author SHA1 Message Date
Andy Nguyen
07ef7442c0 linux: revert hdmi changes 2026-05-24 18:33:43 +02:00
2 changed files with 40 additions and 43 deletions

View File

@@ -2402,7 +2402,7 @@ CONFIG_SMSC_PHY=m
# CONFIG_DP83TG720_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_XILINX_GMII2RGMII is not set
CONFIG_MTS=m
CONFIG_MTS=y
CONFIG_FWNODE_MDIO=y
CONFIG_ACPI_MDIO=y
# CONFIG_MDIO_BITBANG is not set

View File

@@ -604,7 +604,7 @@ index 3459d356151e..f09233c05e04 100644
break;
default:
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index c91638e65174..00618809031f 100644
index c91638e65174..c25b073ca658 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -41,6 +41,10 @@
@@ -639,13 +639,14 @@ index c91638e65174..00618809031f 100644
{0x1002, 0x13DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
{0x1002, 0x13F9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
{0x1002, 0x13FA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
@@ -2393,6 +2404,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
@@ -2393,6 +2404,12 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
int ret, retry = 0, i;
bool supports_atomic = false;
+#ifdef CONFIG_X86_PS5
+ if (!spcie_is_initialized())
+ if (!isHdmiEnabled()) {
+ return -EPROBE_DEFER;
+ }
+#endif
+
if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA ||
@@ -1162,7 +1163,7 @@ index 000000000000..e01771be845b
+mts-y := mts_main.o mts_phy.o
diff --git a/drivers/net/phy/mts/mts.h b/drivers/net/phy/mts/mts.h
new file mode 100644
index 000000000000..e846b6b0edbc
index 000000000000..d994ace066eb
--- /dev/null
+++ b/drivers/net/phy/mts/mts.h
@@ -0,0 +1,181 @@
@@ -1173,8 +1174,8 @@ index 000000000000..e846b6b0edbc
+ * Based on the MediaTek Star Ethernet MAC (mtk_star_emac).
+ */
+
+#ifndef _MTS_H
+#define _MTS_H
+#ifndef _PS5_GBE_H
+#define _PS5_GBE_H
+
+#include <linux/types.h>
+#include <linux/bits.h>
@@ -1346,13 +1347,13 @@ index 000000000000..e846b6b0edbc
+
+int gbe_phy_init(struct gbe_priv *p);
+
+#endif /* _MTS_H */
+#endif /* _PS5_GBE_H */
diff --git a/drivers/net/phy/mts/mts_main.c b/drivers/net/phy/mts/mts_main.c
new file mode 100644
index 000000000000..4250a25d7260
index 000000000000..cc9e18ebb7c3
--- /dev/null
+++ b/drivers/net/phy/mts/mts_main.c
@@ -0,0 +1,810 @@
@@ -0,0 +1,808 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * PlayStation 5 Gigabit Ethernet driver
@@ -1373,8 +1374,9 @@ index 000000000000..4250a25d7260
+
+#include "mts.h"
+
+#define PCI_DEVICE_ID_GBE 0x9104
+#define PCI_DEVICE_ID_SPCIE 0x9107
+#define GBE_VENDOR_ID 0x104d
+#define GBE_DEVICE_ID 0x9104
+#define GBE_GLUE_ID 0x9107
+
+static void gbe_write_mac(struct gbe_priv *p, const u8 *addr)
+{
@@ -1388,7 +1390,7 @@ index 000000000000..4250a25d7260
+{
+ struct pci_dev *glue;
+
+ glue = pci_get_device(PCI_VENDOR_ID_SONY, PCI_DEVICE_ID_SPCIE, NULL);
+ glue = pci_get_device(GBE_VENDOR_ID, GBE_GLUE_ID, NULL);
+ if (!glue)
+ return -ENODEV;
+
@@ -2046,9 +2048,6 @@ index 000000000000..4250a25d7260
+ u8 mac[ETH_ALEN];
+ int ret;
+
+ if (!spcie_is_initialized())
+ return -EPROBE_DEFER;
+
+ ret = pcim_enable_device(pdev);
+ if (ret)
+ return ret;
@@ -2146,7 +2145,7 @@ index 000000000000..4250a25d7260
+}
+
+static const struct pci_device_id gbe_pci_tbl[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_SONY, PCI_DEVICE_ID_GBE) },
+ { PCI_DEVICE(GBE_VENDOR_ID, GBE_DEVICE_ID) },
+ { }
+};
+MODULE_DEVICE_TABLE(pci, gbe_pci_tbl);
@@ -4509,10 +4508,10 @@ index 000000000000..d2c25e461bf7
+#endif /* _AUTOSERVO_PARAM_H */
diff --git a/drivers/ps5/hdmi.c b/drivers/ps5/hdmi.c
new file mode 100644
index 000000000000..1193d840f5d6
index 000000000000..fc2912853e54
--- /dev/null
+++ b/drivers/ps5/hdmi.c
@@ -0,0 +1,1226 @@
@@ -0,0 +1,1234 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
@@ -4615,6 +4614,7 @@ index 000000000000..1193d840f5d6
+
+static struct i2c_context i2c_ctx;
+
+static bool hdmi_is_enabled;
+static u8 hdmi_ic_type;
+static u8 tmds_polarity;
+static u8 tmds_ch_swap;
@@ -5031,23 +5031,24 @@ index 000000000000..1193d840f5d6
+ i2c_init(4);
+ i2c_cmd_5_4(enable);
+ i2c_exec();
+ hdmi_is_enabled = !!enable;
+}
+
+void hdmiSystemResume(void)
+{
+ sceSetBackToUnpluggedSequence();
+ sceSetBackToWaitResolutionSequence();
+ // sceSetBackToUnpluggedSequence();
+ // sceSetBackToWaitResolutionSequence();
+ if (hdmi_ic_type == HDMI_IC_TYPE_FLAVA3) {
+ i2c_cmd_4_2();
+ // i2c_cmd_4_2();
+ // sceSetHdcpSequence1st();
+ // sceSetHdcpSequence2nd();
+ // sceSetHdcpSequence3rd();
+ sceSetEdidSequence(0);
+ sceSetEdidSequence(1);
+ sceSetEdidSequence(2);
+ sceSetEdidSequence(3);
+ sceSetWaitPllSequence();
+ unk_akv();
+ // sceSetEdidSequence(0);
+ // sceSetEdidSequence(1);
+ // sceSetEdidSequence(2);
+ // sceSetEdidSequence(3);
+ // sceSetWaitPllSequence();
+ // unk_akv();
+ }
+ sceControlHdmiEvent(1);
+}
@@ -5662,6 +5663,12 @@ index 000000000000..1193d840f5d6
+}
+EXPORT_SYMBOL(sceHdmiSetAudioMute);
+
+int isHdmiEnabled(void)
+{
+ return hdmi_is_enabled;
+}
+EXPORT_SYMBOL(isHdmiEnabled);
+
+int getHdmiConfiguration(void)
+{
+ u8 buf[ICC_MSG_MAX_SIZE] = {};
@@ -6235,10 +6242,10 @@ index 000000000000..4af890c842a7
+MODULE_LICENSE("GPL");
diff --git a/drivers/ps5/spcie.c b/drivers/ps5/spcie.c
new file mode 100644
index 000000000000..8a073f2f0f0a
index 000000000000..70c9dc4126f7
--- /dev/null
+++ b/drivers/ps5/spcie.c
@@ -0,0 +1,1084 @@
@@ -0,0 +1,1075 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
@@ -6326,7 +6333,6 @@ index 000000000000..8a073f2f0f0a
+static struct spcie_dev *sdev;
+static struct spcie_icc_dev *icc_dev;
+
+static bool spcie_initialized = false;
+static u32 spcie_chip_revision_id = 0;
+
+static const u8 indicator_white_dim[] = {
@@ -7043,12 +7049,6 @@ index 000000000000..8a073f2f0f0a
+ return 0;
+}
+
+bool spcie_is_initialized(void)
+{
+ return spcie_initialized;
+}
+EXPORT_SYMBOL(spcie_is_initialized);
+
+u32 spcie_get_chip_id(void)
+{
+ return spcie_chip_revision_id & 0xff0000;
@@ -7281,8 +7281,6 @@ index 000000000000..8a073f2f0f0a
+ return ret;
+ }
+
+ spcie_initialized = true;
+
+ pci_set_drvdata(pdev, sdev);
+ return 0;
+}
@@ -7648,10 +7646,10 @@ index 2eedf44e6801..2785a47665be 100644
extern void dmi_setup(void);
diff --git a/include/linux/ps5.h b/include/linux/ps5.h
new file mode 100644
index 000000000000..7ed7adc99719
index 000000000000..f8d9a5ddc04b
--- /dev/null
+++ b/include/linux/ps5.h
@@ -0,0 +1,89 @@
@@ -0,0 +1,88 @@
+#ifndef _LINUX_PS5_H
+#define _LINUX_PS5_H
+
@@ -7694,8 +7692,6 @@ index 000000000000..7ed7adc99719
+ ICC_SERVICE_ID_FLOYD = 0x9a,
+};
+
+bool spcie_is_initialized(void);
+
+u32 spcie_get_chip_id(void);
+u32 spcie_get_revision_id(void);
+u32 spcie_bar2_180000_read(u32 reg);
@@ -7711,6 +7707,7 @@ index 000000000000..7ed7adc99719
+void sceHdmiDeviceSetVideoMute(int mute);
+void sceHdmiSetAudioMute(int mute);
+int getHdmiConfiguration(void);
+int isHdmiEnabled(void);
+bool isHdmiModeValid(const struct drm_display_mode *mode, int force_1080p);
+
+int icc_nvs_write(u32 partition, u16 offset, u16 length, const void *data);