summaryrefslogtreecommitdiff
path: root/resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch
diff options
context:
space:
mode:
authorNicholas Chin <nic.c3.14@gmail.com>2023-09-02 14:44:07 -0600
committerNicholas Chin <nic.c3.14@gmail.com>2023-09-03 09:13:03 -0600
commitebc04e521256442318427476ef69ee2aa3b946eb (patch)
treeecf48d9e40256dbdab5b182ec8632d0b277aeb7c /resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch
parent9ef8a7ea80f42246c842eb9aaf79c03535ae594c (diff)
Add Dell Latitude E6430
This was only tested on the iGPU model, though a dGPU model does exist. The vendor firmware used a 16KiB gbe.bin, which was modified with a random MAC address as well as shrinking it to 8KiB. As with the E6400, GRUB doesn't like the way the EC implements the keyboard controller and thus GRUB payloads are disabled at this time. Suspend does not currently work, and this is believed to be due to the EC controlling the DRAM reset gate which is required to prevent DRAM from being reset on resume. With some tweaks, the e6400-flash-unlock utility also works on this system, though both flash chips can be accessed through removal of only the keyboard. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Diffstat (limited to 'resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch')
-rw-r--r--resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch b/resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch
new file mode 100644
index 00000000..f3dad1e1
--- /dev/null
+++ b/resources/coreboot/default/patches/0021-ec-dell-mec5035-Add-command-to-enable-disable-radios.patch
@@ -0,0 +1,61 @@
+From f4c41a930b777128bd418cbae525ba509e5f19ff Mon Sep 17 00:00:00 2001
+From: Nicholas Chin <nic.c3.14@gmail.com>
+Date: Sun, 27 Aug 2023 17:36:36 -0600
+Subject: [PATCH 1/3] ec/dell/mec5035: Add command to enable/disable radios
+
+These were determined by sniffing the LPC bus while toggling the
+hardware wireless switch on the Latitude E6400. To differentiate devices
+options in the vendor BIOS to change which radios the switch controlled
+were used.
+
+Change-Id: I173dc197d63cda232dd7ede0cb798ab0a364482b
+Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
+---
+ src/ec/dell/mec5035/mec5035.c | 9 +++++++++
+ src/ec/dell/mec5035/mec5035.h | 8 ++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/src/ec/dell/mec5035/mec5035.c b/src/ec/dell/mec5035/mec5035.c
+index 8da11e5b1c..e0335a4635 100644
+--- a/src/ec/dell/mec5035/mec5035.c
++++ b/src/ec/dell/mec5035/mec5035.c
+@@ -84,6 +84,15 @@ u8 mec5035_mouse_touchpad(u8 setting)
+ return buf[0];
+ }
+
++void mec5035_radio_enable(enum mec5035_radio_dev dev, u8 on)
++{
++ /* From LPC traces and userspace testing with other values,
++ the second byte has to be 2 for an unknown reason. */
++ u8 buf[3] = {dev, 2, on};
++ write_mailbox_regs(buf, 2, 3);
++ ec_command(CMD_RADIO_EN);
++}
++
+ void mec5035_early_init(void)
+ {
+ /* If this isn't sent the EC shuts down the system after about 15
+diff --git a/src/ec/dell/mec5035/mec5035.h b/src/ec/dell/mec5035/mec5035.h
+index e7a05b64d4..16512e2cc2 100644
+--- a/src/ec/dell/mec5035/mec5035.h
++++ b/src/ec/dell/mec5035/mec5035.h
+@@ -16,8 +16,16 @@
+
+ #define CMD_CPU_OK 0xc2
+
++#define CMD_RADIO_EN 0x2b
++enum mec5035_radio_dev {
++ RADIO_WLAN = 0,
++ RADIO_WWAN = 1,
++ RADIO_WPAN = 2,
++};
++
+ u8 mec5035_mouse_touchpad(u8 setting);
+ void mec5035_cpu_ok(void);
+ void mec5035_early_init(void);
++void mec5035_radio_enable(enum mec5035_radio_dev device, u8 on);
+
+ #endif /* _EC_DELL_MEC5035_H_ */
+--
+2.42.0
+