Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #11 from MuertoGB/V107_testbuild
Browse files Browse the repository at this point in the history
V107 testbuild
  • Loading branch information
MuertoGB authored Feb 18, 2023
2 parents 393326c + edf963a commit 8256e5e
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 157 deletions.
13 changes: 0 additions & 13 deletions 820-00426-DG.nsh

This file was deleted.

13 changes: 0 additions & 13 deletions 820-00426-IG.nsh

This file was deleted.

2 changes: 1 addition & 1 deletion 820-00426.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ echo -off

cls

echo "MacBookPro11,5"
echo "MacBookPro11,5, dGPU"
echo "Mac-06F11F11946D27C5"
echo "Flashing SMC with 820-00426 v2.30f2 firmware..."

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**Version 1.0.7**
```
- bootx64.efi replaced with a more compatible shell
- Removed 00426 (IG) and pertaining information
```
**Version 1.0.6**
```
- Corrected 820-00138 payload
Expand Down
42 changes: 16 additions & 26 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
**Compatibility Information:**
-
This information is still a work in progress, I only have so many MacBooks at my disposal to verify board-ids and perform a test flash. If a model is marked as verified, this means it was successfully flashed with SMC Tool. If a board is not in the below list, it isn't currently supported.
## Compatibility Information

Some boards carry identical board-ids but have different logic board models, I have tried to keep them separate for ease of use.
This information is still a work in progress, I only have so many machines at my disposal to verify board-ids and perform a test flash. If a model is marked as verified, this means it was successfully flashed with SMCTool. If a model is not in the below list, it isn't currently supported.

If you'd like to verify a board please open an issue. Make sure to include the following information:-
If you'd like to verify a successful flash please open an issue. Make sure to include the following information:

* Model Number (e.g. A1502)
* EMC Number (e.g. EMC 2835)
* Board ID `ioreg -l | grep -i board-id`
* Board Model (e.g. 820-4924)
* Graphics Type and Model (e.g. iGPU, Intel HD 6000)
> Model Number (e.g. A1502)\
> EMC Number (e.g. EMC 2835)\
> Board ID `ioreg -l | grep -i board-id`\
> Board Model (e.g. 820-4924)\
> Graphics Type and Model (e.g. iGPU, Intel HD 6000)\
> Proof of a successful flash
---

**MacBook Air**
## MacBook Air
```
A1465 (EMC 2631)
Expand Down Expand Up @@ -59,7 +58,7 @@ A1466 (EMC 2925, EMC 3178) - Verified
Flash using 820-00165.nsh
```
**MacBook Pro**
## MacBook Pro
```
A1502 (EMC 2678. EMC 2875) - Verified
Expand Down Expand Up @@ -139,17 +138,6 @@ A1398 (EMC 2910)
Flash using 820-00163.nsh
```
**The 820-00426 comes with either an iGPU, or dGPU, make sure you flash the correct version.**
```
A1398 (EMC 2909)
- MacBookPro11,4 (15-inch Mid 2015 with iGPU)
- Board Model: 820-00426
- Board-ID: Mac-06F11FD93F0323C5
- Firmware: 2.29f24
Flash using 820-00426-IG.nsh
```

```
A1398 (EMC 2910)
Expand All @@ -159,9 +147,9 @@ A1398 (EMC 2910)
- Board-ID: Mac-06F11F11946D27C5
- Firmware: 2.30f2
Flash using 820-00426-DG.nsh
Flash using 820-00426.nsh
```
**Mac Mini**
## Mac Mini
```
A1347 (EMC 2840)
Expand All @@ -171,4 +159,6 @@ A1347 (EMC 2840)
- Firmware: v2.24f32
Flash using 820-5509.nsh
```
```

---
170 changes: 81 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,123 +1,115 @@
**SMC Tool by David R:**
-
Aimed at Mac logic board technicians, SMCTool makes flashing a replacement SMC quicker and easier. It not only saves time, but money, as a specific donor SMC isn't necessary to have 'on hand'. Simply take a matching donor SMC* from another board, replace and flash.

*Currently, a full list of SMC boot compatibility between boards has not been established. I recommend you keep the board years as close as possible when taking a donor SMC from a non-matching board, otherwise the machine may not power on.
<h1 align="center">
<img width="200" src="resource/img/icon256.png" alt="SMCTool Logo">
<br>
SMCTool
</h1>

It has come to my attention SMCTool may not like some USB memory sticks, I use SanDisk SDCZ50 USB 2.0 without issue. Possibly an issue with UEFI, I don't know, yet. Also, removing the system storage drive is necessary in most cases, otherwise 'startup.nsh' may not run.
<h4 align="center">Making SMC flashing quicker and easier.</h4>

💡 This project is based on the work from [logi.wiki](https://logi.wiki/index.php?title=SMC_flashing).\
🎥 SMC Tool tested by Paul L Daniels on [YouTube](https://www.youtube.com/watch?v=q8LEh8C4iYo).
<p align="center">
<a href="#about">About</a> •
<a href="#download">Download</a> •
<a href="#bootable-usb">Bootable USB</a> •
<a href="#flashing-an-smc">Flashing An SMC</a> •
<a href="#compatibility">Compatibility</a> •
<a href="#disclaimers">Disclaimers</a> •
<a href="#acknowledgements">Acknowledgements</a> •
<a href="#donate">Donate</a>
</p>

**Thanks to:-**\
**Paul L Daniels** for development help, and the kick to finish this project.\
**Logi.wiki** for the original work, which I could base this project on.\
**EineWildeStehlampe** for information and help regarding UEFI.\
**theSmudge** for being a great help verifying information.\
**Nobluesky** for gathering Board-IDs.
## About

☕ If you'd like to make a donation for my work, please [see here](https://www.buymeacoffee.com/Muerto). Cheers. ☕
This bootable shell is used to program a Mac LM4F (Stellaris) System Management Controller (SMC) in EFI mode with the correct stock firmware, this enables a technician to replace a faulty SMC with a donor from a non-matching machine. This not only saves time, but money, as a specific donor SMC isn't necessary to have 'on hand'; simply take a donor SMC* from another board, replace it, and flash with this handy bootable software.

---
**Before you start:**
-
I'm not responsible if you do something wrong, if you're here I expect you to know what you're doing. Where I do my utmost to verify all information to my best ability, I'm also not responsible for any mistakes my end either. As they say, sometimes shit happens.
> *Currently, a full list of SMC boot compatibility between boards has not been established, I recommend you keep the platform and GPU type the same (MacBook, iMac, Mac Mini), (iGPU, dGPU).
This is also **not** a magical 'fix my Mac' tool, it has a specific purpose, which is flashing correct payloads to a System Management Controller with incorrect firmware.
## Download

---
**Download:**
-
Current Version: `1.0.6` - (31.01.2023)\
See the [Changelog](CHANGELOG.md).\
Downloads can be acquired in the [releases](https://github.com/MuertoGB/SMCTool/releases) section.
| Version| Release Date| Latest|
|--------|-------------|--------|
| [V1.0.7](https://github.com/MuertoGB/SMCTool/releases/tag/v1.0.7)| 18th Feb 2023 | `Yes` |
| [V1.0.6](https://github.com/MuertoGB/SMCTool/releases/tag/v1.0.6)| 31st Jan 2022 | `No` |

---
**Creating a USB disk:**
-
To begin, format a USB disk in ExFAT, FAT32, VFAT or HFS+ using a GPT or MBR partition table, then....
> 📔 See the full [Changelog](CHANGELOG.md).
- Option A: Manually copy all SMC_Tool.iso files to the formatted USB disk.
- Option B: Write the SMC_Tool.img to disk with ddrescue, Passmark imageUSB, or similar.
- Option C: Use a bootable USB creation tool and select SMC_Tool.iso as the source file.
## Bootable USB

Extended instructions [here](BOOTABLEUSB.md).
To begin, format a USB disk in ExFAT, FAT32, VFAT or HFS+ for use with SMCTool.
> ⚠ FAT32 using a GPT partition table is recommended.
---
**Flashing the SMC:**
-
1. Plug in your USB disk and power on the Mac whilst holding the `Option ⌥` key.
2. Load into `SMC Tool` from the boot menu and let startup.nsh run.
3. Type the boardnumber.nsh you want to flash, e.g: `820-00165.nsh`, then press return, the script will then flash the SMC.
4. Type 'exit' to reboot, or power off machine to complete the process.
Once the memory stick is ready, you can do any of the following:
- Option A: Manually copy all files from the ISO to the formatted memory stick.
- Option B: Write the image to the memory stick with ddrescue, Passmark imageUSB, or similar.
- Option C: Use a bootable USB creation tool and select the ISO, or image as the source file, and the memory stick as the destination.

Quick video of flashing an SMC [here](https://www.youtube.com/watch?v=nUm30m3zNxI).
> ❕ Extended instructions [here](BOOTABLEUSB.md).
---
**Compatible Boards:**
-
See the [compatibility information](COMPATIBILITY.md).
## Flashing An SMC

Older, single file payloads for boards such as 820-3115/3332 are currently being worked out. Support may be added in the future.
1. Remove the internal storage drive.
2. If you have a portable device, plug in the power adapter.
3. Insert your USB stick, then power on the device whilst holding `Option ⌥`.
4. Load into SMCTool from the boot menu and let 'startup.nsh' run.
5. Type the 'boardnumber.nsh' you want to flash, e.g: `820-00165.nsh`, then press return; the script will then flash the SMC.
6. Type `exit` to reboot, or power off machine to complete the process.

---
> ⚠ You may need to perform an [NVRAM reset](https://support.apple.com/en-mide/HT201255) after flashing an SMC.
**Compatible SMC:**
-
**Why must the SMC be flashed?:**\
Each System Management Controller is specifically programmed for it's counterpart board, and is in charge of managing video, hibernation, battery charging, thermal and power management. Incorrect or mismatched firmware causes erratic behaviour such as broken display resolution, high fan speed, throttling, and crashing.

✅ Texus Instruments LM4 BGA157\
❌ Texus Instruments TM4 BGA168\
❌ Renesas DF2117 BGA145
**I flashed an incorrect firmware:**\
No problem, just type the correct board number and the correct payload will be flashed. If you restart, or power off after an incorrect payload flash you may brick the device. If a system is somehow rendered 'bricked', and cannot get to the boot menu, you must replace the SMC again. You can always put the incorrectly flashed SMC aside for future use on a board it was 'accidentally' programmed for.

Currently supporting MacBook, and Mac Mini. iMac support is in development.
> 💻 Quick video of flashing an SMC [here](https://www.youtube.com/watch?v=nUm30m3zNxI).
---
**Why must the firmware be flashed:**
-
Each System Management Controller is specifically programmed for it's counterpart board, and is in charge of managing video, hibernation, battery charging, thermal and power management. Incorrect or mismatched firmware causes erratic behaviour such as broken display resolution, high fan speed, throttling, and crashing.
## Compatibility

**Devices:**

---
**If you flash the wrong firmware:**
-
You must immediately flash the correct firmware before powering off the system. In some cases you **might** brick the system if you reboot after flashing the incorrect firmware. After much testing I've never achieved a bricked board by flashing an incorrect firmware, however, others have mentioned 'no power' after loading the wrong SMC firmware for that board after a reboot, or power down.
| Platform | Supported? | Planned?|
|----------|-------------|--------|
| MacBook || `N/A` |
| Mac Mini || `N/A` |
| iMac || `In development`|
| Mac Pro || `Researching` |

If a system is somehow rendered 'bricked' and cannot get to the boot menu, you must replace the SMC again. You can always put the incorrectly flashed SMC aside for future use on a board it was 'accidentally' programmed for.
> ℹ See the [compatibility information](COMPATIBILITY.md) for a full list of supported models.
---
**If you want to flash a different firmware:**
-
You must replace the update, base, code and EPM in the respective folder, say 820-00165 would be `payloads\Mac-937CB26E2E02BB01`.
**System Management Controllers:**

Alternative SMC payloads can be found in firmwareupdate.pkg inside the MacOS Install.ESD file, or [here](https://github.com/sadponyguerillaboy/SMC-Toolkit/tree/main/SMCPayloads).
| SMC | Supported? | Planned?|
|----------------|-------------|---------|
| LM4F BGA157 || `N/A` |
| TM4C BGA168 || `Researching` |
| F2117LP BGA145 || `No` |

---
> ℹ Older single file payloads for boards such as 820-3115, 3332, and 3462 are currently being worked out. Support *may* be added in the future.
**Screen resolution:**
-
Use the `mode` command to display a list of supported screen modes, type the highest mode available e.g. `mode 160 47`, then press return.
## Disclaimers

The script will automatically switch screen mode when it can.
I'm not responsible if you do something wrong, if you're here I expect you to know what you're doing. Where I do my utmost to verify all information to my best ability, I'm not responsible for any mistakes my end either.

---
**Licenses and acknowledgements:**
-
Startup manager icon by [KBuHT](https://macosicons.com/#/u/KBuHT) on macOSicons.
This is **not** a magical 'fix my Mac' tool, it has a specific purpose, which is flashing correct payloads to a System Management Controller with incorrect firmware. **Do not** flash your SMC if you have no reason to.

*** UEFI Shell v2.0, release 4.632 ***
## Acknowledgements

This bootable image contains builds of the 2.0 UEFI Shell, as provided by the
Open Source 'EDK' project (https://github.com/tianocore/edk).
> 🖼 Project icon by [KBuHT](https://macosicons.com/#/u/KBuHT) on macOSicons.\
> 💡 This tool is based on the work from [logi.wiki](https://logi.wiki/index.php?title=SMC_flashing).\
>🎥 SMC Tool tested by Paul L Daniels on [YouTube](https://www.youtube.com/watch?v=q8LEh8C4iYo).
More specifically, this release, which we call '4.632', was produced using the
Shell executables, built on 2010.05.07, and published at:
https://github.com/tianocore/edk/tree/master/Other/Maintained/Application/UefiShell/bin
**⭐ Many Thanks To ⭐**
* Paul L Daniels for development help, and the kick to finish this project.
* Logi.wiki for the original work, which I could base this project on.
* EineWildeStehlampe for information and help regarding UEFI.
* theSmudge for being a great help verifying information.
* Nobluesky for verifying iMac board-id's.

This image supports the following UEFI platform architectures:
* X64
* IA32
## Donate

You are invited to validate that the binaries provided on this ISO are 100%
identical to the ones from the official EDK project.
<a href="https://www.buymeacoffee.com/Muerto">
<img width="160" src="https://uc80e5ba3058c2d15b2a77972a8b.previews.dropboxusercontent.com/p/thumb/AB18JbfsN4REmFgvOrzwO3ooBl2K1VkxckN-h1H0qKcNhQDfIIROLC57mhfRHlNPZXBDEK7S3gHEnx6Uc35udaYsS-Mx66J6llYd_lSwfaIAntk3eynVXJNhd5nRHFDI1ncBuDVpVbrtKeQZlP2WPhejwCDH99YAFH8xcPef9q2d37EBjVV9-cK4cGUd7KmXCfa81wP6tXXV8r7-f_5L1c6tgs9HxLgqaDlAPXG8BcM9B6NRFdxlOsLGvYh9ESFE7fMb7dTrOu7PgsBsVrrIfTOxL8akUj2QiSGMJiZNXJrYrsW7mjKu_qQ-7Z-mhlZ2ZtY-FApmMFhfQrWj17D7hiXCemMdb_SaZCbaHBucMaJZ5Y1OPY3a6XlAxUCNJXSrFoI/p.png" alt="Buy Me A Coffee Logo">
</a>

For more information on this release, you are invited to visit our official
project page at https://github.com/pbatard/UEFI-Shell.
---
Binary file modified efi/boot/bootx64.efi
Binary file not shown.
Binary file added resource/img/icon256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 14 additions & 15 deletions startup.nsh
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
@echo ""
@echo "SMCTool V1.0.6 by David R (Muerto)"
@echo "SMCTool V1.0.7 by David R (Muerto)"
@echo ""
@echo " Supported Boards:-"
@echo ""
@echo "A1465 820-3435 - FW: 2.12f143 - Type: 820-3435.nsh"
@echo "A1466 820-3437 - FW: 2.13f15 - Type: 820-3437.nsh"
@echo "A1465 820-00164 - FW: 2.26f2 - Type: 820-00164.nsh"
@echo "A1466 820-00165 - FW: 2.27f2 - Type: 820-00165.nsh"
@echo "A1502 820-3476 - FW: 2.16f68 - Type: 820-3476.nsh"
@echo "A1502 820-3536 - FW: 2.16f68 - Type: 820-3536.nsh"
@echo "A1502 820-4924 - FW: 2.28f7 - Type: 820-4924.nsh"
@echo "A1398 820-3662 - FW: 2.18f15 - Type: 820-3662.nsh"
@echo "A1398 820-3787 - FW: 2.19f12 - Type: 820-3787.nsh"
@echo "A1398 820-00138 - FW: 2.29f24 - Type: 820-00138.nsh"
@echo "A1398 820-00163 - FW: 2.30f2 - Type: 820-00163.nsh"
@echo "A1398 820-00426(IG) - FW: 2.29f24 - Type: 820-00426-IG.nsh"
@echo "A1398 820-00426(DG) - FW: 2.30f2 - Type: 820-00426-DG.nsh"
@echo "A1347 820-5509 - FW: 2.24f32 - Type: 820-5509.nsh"
@echo " A1465 820-3435 - FW: 2.12f143 - Type: 820-3435.nsh"
@echo " A1466 820-3437 - FW: 2.13f15 - Type: 820-3437.nsh"
@echo " A1465 820-00164 - FW: 2.26f2 - Type: 820-00164.nsh"
@echo " A1466 820-00165 - FW: 2.27f2 - Type: 820-00165.nsh"
@echo " A1502 820-3476 - FW: 2.16f68 - Type: 820-3476.nsh"
@echo " A1502 820-3536 - FW: 2.16f68 - Type: 820-3536.nsh"
@echo " A1502 820-4924 - FW: 2.28f7 - Type: 820-4924.nsh"
@echo " A1398 820-3662 - FW: 2.18f15 - Type: 820-3662.nsh"
@echo " A1398 820-3787 - FW: 2.19f12 - Type: 820-3787.nsh"
@echo " A1398 820-00138 - FW: 2.29f24 - Type: 820-00138.nsh"
@echo " A1398 820-00163 - FW: 2.30f2 - Type: 820-00163.nsh"
@echo " A1398 820-00426 - FW: 2.30f2 - Type: 820-00426.nsh"
@echo " A1347 820-5509 - FW: 2.24f32 - Type: 820-5509.nsh"
@echo "NOTE: Script will run immediately, so be sure"
@echo " when you choose to run the script."
@echo ""

0 comments on commit 8256e5e

Please sign in to comment.