edk2-msm icon indicating copy to clipboard operation
edk2-msm copied to clipboard

support for SM6150

Open nookgit12 opened this issue 11 months ago • 61 comments

plz i dont know how to write these config files so i want to ask yall to make config for SM6150 (snapdragon 675)

nookgit12 avatar Jan 19 '25 12:01 nookgit12

@nookgit12 i have init the project for xiaomi note 7 pro(violet), platform is sm6150 now it can build boot-violet.img, but need more time to dump the dsdt.aml from my cell phone

sndnvaps avatar Apr 13 '25 15:04 sndnvaps

when i try to port edk2 to sm6150 platform, i had got some trouble like this

Image

is any one can give me some advices....

sndnvaps avatar May 08 '25 11:05 sndnvaps

can you send the boot-violet.img ? i used dipper img(personal modified version) to split emmc partitions to win esp etc ... so far i am not able to make a boot img for it

Sasmithere avatar Sep 20 '25 15:09 Sasmithere

@Sasmithere in xiaomi_violet-edk2-boot-violet.zip contains 2 file, edk2-boot-violet.img and edk2-boot-violet-old.img

xiaomi_violet-edk2-boot-violet.zip

sndnvaps avatar Sep 21 '25 13:09 sndnvaps

i'll try both and return with an update

Sasmithere avatar Sep 21 '25 13:09 Sasmithere

@sndnvaps the old img one seems to boot into efi shell but my otg usb keyboard doesn't seem to work , i was wondering if you still have the .dsc , .fdf and .conf related files for it , i want to change the cmdline so it automatically boots to windows partition

Sasmithere avatar Sep 22 '25 13:09 Sasmithere

@Sasmithere I have push the change to github https://github.com/sndnvaps/edk2-msm/commit/45b4445cec810481c8a7fba5ae69793d018e0b5c https://github.com/sndnvaps/edk2-msm/commit/e44c5ab0ff5978cb31743ed3b5e812c84517fa71 the efi binary and my port for button.dxe etc. https://github.com/sndnvaps/edk2-msm-binary/commit/c54e69c81c6357b334ac1f0c1f069933022834ef

i hope it can help you.

sndnvaps avatar Sep 30 '25 12:09 sndnvaps

Hey @sndnvaps @Sasmithere

I came across this project and thought it might be useful for your work:

GitHub: https://github.com/Project-Aloha/mu_aloha_platforms Porting Guide: https://aloha.firmware.icu/PortingGuides/SimpleGuide.html

Thirumal-Palwai avatar Oct 01 '25 00:10 Thirumal-Palwai

@Thirumal-Palwai i had also read the https://aloha.firmware.icu/PortingGuides/SimpleGuide.html , i made the change base on it ... what i port the dxe file use Ghidra but it seem had some bug on platform sm6150 ,made it cann't run . only work is UEFI Shell, pwm,vol_up,vol_down still not work... may be need uart debug to get the really problem.... i had one idea, use uart shell to get the problem of ui not work, but i dont known how to get the uart work

sndnvaps avatar Oct 01 '25 03:10 sndnvaps

@sndnvaps thanks for the files , i think the tech stack which calls The graphicsconsoledxe.efi which also combines buttonsdxe is causing the ruckus I'll be approaching this issue in these ways :

  1. fix the graphicsconsoledxe.efi by dumping and recompiling then insert some dummy registers which are causing the issue and i did saw some registers having unknown as address (hard)
  2. use a dummy graphicsconsoledxe.efi which returns efi_success as true and goes to text based interface (medium)
  3. change the stack in which graphicsconsoledxe is called and remove it from there , inshort remove it from the call stack(hard)
  4. build graphicsconsoledxe from scratch myself from the xbl.elf file or search internet for something similar (very hard 💀)
  5. and last is i will try to change the bootdef.c and boot.c so it automatically boots into uefi boot menu

Sasmithere avatar Oct 01 '25 06:10 Sasmithere

@sndnvaps

Image

is emmc storage not supported ?

Sasmithere avatar Oct 02 '25 12:10 Sasmithere

close 🤏🏻 but no touchscreen and pwm , vol_up and down work , just scripted to auto boot to simple-init

Image

Sasmithere avatar Oct 02 '25 19:10 Sasmithere

hey @sndnvaps still there ? i think i fixed it ? i dont know can you see this video log?

Gdrive low res

Gdrive High res

Sasmithere avatar Oct 11 '25 18:10 Sasmithere

@sndnvaps i added this line in DSC to get all debug info , under

[PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF

Sasmithere avatar Oct 13 '25 16:10 Sasmithere

@sndnvaps buttons are working vol_up and vol_down in tianocore but no touch , idk about power button since my phones power button is not working or i can say its damaged

here is the image :

edk2-boot-violet.zip

Edit: power button is working , i used jumper cable on the motherboard

Sasmithere avatar Oct 26 '25 20:10 Sasmithere

@Sasmithere

hey @sndnvaps still there ? i think i fixed it ? i dont know can you see this video log?

Gdrive low res

Gdrive High res

in PRC (China), because of gfw, i cann't play the video you shared... so, i don't known you progress,,, (can you share the video to https://pan.baidu.com/) in comment https://github.com/edk2-porting/edk2-msm/issues/411#issuecomment-3362716859 ,you pic look like you have great progress....

sndnvaps avatar Oct 28 '25 12:10 sndnvaps

@sndnvaps touch is not working but power button and volume up and volume down button are working .....

https://github.com/user-attachments/assets/d08626bf-de7a-4c39-9628-71f0adcf0eee

Sasmithere avatar Oct 28 '25 12:10 Sasmithere

@Sasmithere i have test on my phone. every thing is ok, touch_screen is not the quesion... pwm,vol_up,vol_down can work. it's the best . can you upload the change to you edk2-violet project

sndnvaps avatar Oct 28 '25 12:10 sndnvaps

@sndnvaps i have pushed the change to github

edk2-msm

edk2-msm-binary

Sasmithere avatar Oct 28 '25 13:10 Sasmithere

@Sasmithere i cherry-pick you changed, but still get dark screen. you need to push patched file to https://github.com/Sasmithere/edk2-msm-binary/tree/main/Drivers/sm6150 , so i can make a fully test

sndnvaps avatar Oct 29 '25 03:10 sndnvaps

@sndnvaps i'll upload here my current working set, let me know if you want anything else , P.S: new DeviceTreeBlob (DTB) from my device , originally it was 670kb , mine is 692kb

edk2-violet.zip

Sasmithere avatar Oct 29 '25 03:10 Sasmithere

@Sasmithere thks bro, i will do the test as soon as possible in touch_screen, i have some idea, it make need a touch_screen drv to make the touch work.

sndnvaps avatar Oct 29 '25 04:10 sndnvaps

@sndnvaps i also thought of that as well , to use a passthrough for testing , but it generate errors while compiling and even tho it compiled , it would cause synchronous exception

Sasmithere avatar Oct 29 '25 04:10 Sasmithere

@Sasmithere in this commit https://github.com/BigfootACA/simple-init/blob/29e062805776db5ab7a61d07ef040d43aed71161/libs/lvgl/README.md, Features, support touch screen, it make do some hack to make it work....

sndnvaps avatar Oct 29 '25 04:10 sndnvaps

@Sasmithere i need more time to test what you changed. i had to reinit the build env base on you work flow.

sndnvaps avatar Oct 30 '25 11:10 sndnvaps

@sndnvaps no worriers , the thing is i just included all drivers from QcomPkg/Drivers from xbl and i think the apriori should be ordered in such a manner that every requirement for DXE is fullfilled .... well thats what i found out anyway

Sasmithere avatar Oct 30 '25 12:10 Sasmithere

@Sasmithere i replace the submobule path with china gitee.com .i just build the boot-violet.img, test every thing is ok(vol_up,vol_down,pwr), just touch_screen not working.

boot-violet-sndnvaps.zip

sndnvaps avatar Oct 30 '25 13:10 sndnvaps

@sndnvaps TouchScreen config is in DisplayDxe.efi , but when i include it , it restarts the device

Sasmithere avatar Oct 31 '25 09:10 Sasmithere

@Sasmithere in DisplayDxe.depex , i found 4 Guid_Protocol not defind in edk2 project dec file

use https://github.com/YangGangUEFI/DecGuidParser Extract GUID from Edk2 .dec file to json file.

use https://yangganguefi.github.io/Edk2DepexGUIDParser/Edk2DepexGuidVue3.html to parse the GUID from DisplayDxe.depex

Edk2Guid.json

{ 0x5bef7c41, 0xa560, 0x435b, { 0x83, 0x5b, 0x3c, 0x3e, 0xbf, 0x2b, 0xd1, 0x51 } }
(未知GUID)
{ 0xc1bff82d, 0x6c92, 0x48fb, { 0x83, 0x55, 0xc7, 0xfb, 0x42, 0x18, 0xa4, 0xea } }
(未知GUID)
{ 0xa966cc4f, 0xee6c, 0x424d, { 0xa7, 0x62, 0x8e, 0xd3, 0xb5, 0xa4, 0xa5, 0x01 } }
(未知GUID)
{ 0x47861dff, 0x556f, 0x4269, { 0x9b, 0x28, 0x06, 0x2e, 0xc3, 0xec, 0xb3, 0x0d } }
(未知GUID)

i got there defind in github

/* Protocol GUID definition */
/** @ingroup efi_pmicWled_protocol */
#define EFI_PMIC_WLED_PROTOCOL_GUID \
{ 0x5bef7c41, 0xa560, 0x435b, { 0x83, 0x5b, 0x3c, 0x3e, 0xbf, 0x2b, 0xd1, 0x51 } }

https://github.com/Rivko/android-firmware-qti-sdm670/blob/20bb8ae36c93fc16bbadda0e0a83f930c0c8a271/boot_images/QcomPkg/Include/Protocol/EFIPmicWled.h#L41

/*  Protocol GUID definition */
/** @ingroup @ingroup efi_pmicIbb_protocol */
#define EFI_PMIC_IBB_PROTOCOL_GUID \
    { 0xc1bff82d, 0x6c92, 0x48fb, { 0x83, 0x55, 0xc7, 0xfb, 0x42, 0x18, 0xa4, 0xea } }

https://github.com/Daniel224455/xbl2nd/blob/b3242a2e7f7fd4b90116611a13c28c1748f2f086/QcomPkg/Include/Protocol/EFIPmicIbb.h#L47

just only got the two of them.

the edk2 project cannot load DisplayDxe.efi ,it may be cause by loose of GUID protocol

sndnvaps avatar Oct 31 '25 15:10 sndnvaps

From DisplayDxe.depex

these GUIDs are not defined in edk2 project , they're closed source , i found they correspond to WLED, IBB, LAB, LCDB :

PUSH { 0x5bef7c41, 0xa560, 0x435b, { 0x83, 0x5b, 0x3c, 0x3e, 0xbf, 0x2b, 0xd1, 0x51 } }
PUSH { 0xc1bff82d, 0x6c92, 0x48fb, { 0x83, 0x55, 0xc7, 0xfb, 0x42, 0x18, 0xa4, 0xea } }
PUSH { 0xa966cc4f, 0xee6c, 0x424d, { 0xa7, 0x62, 0x8e, 0xd3, 0xb5, 0xa4, 0xa5, 0x01 } }
PUSH { 0x47861dff, 0x556f, 0x4269, { 0x9b, 0x28, 0x06, 0x2e, 0xc3, 0xec, 0xb3, 0x0d } }

and these GUIDs are defined in QcomPkg.dec :

PUSH { 0x157a5c45, 0x21b2, 0x43c5, { 0xba, 0x7c, 0x82, 0x2f, 0xee, 0x5f, 0xe5, 0x99 } }
PUSH { 0xb0760469, 0x970c, 0x487a, { 0xa4, 0xb5, 0x28, 0xdb, 0x7b, 0x45, 0xce, 0xf1 } }
PUSH { 0xad9aec18, 0x7bf0, 0x4809, { 0x9e, 0x96, 0x30, 0x12, 0x30, 0x9f, 0x3d, 0xf7 } }
PUSH { 0xb27ae8b1, 0x3e10, 0x4d07, { 0xab, 0x5c, 0xeb, 0x9a, 0x6d, 0xc6, 0xfa, 0x8f } }
PUSH { 0x241afae6, 0x885f, 0x4f6c, { 0xa7, 0xea, 0xc2, 0x8e, 0xab, 0x79, 0xc3, 0xe5 } }

if we were to path DisplayDxe.depex then we'd need patch DisplayDxe.efi as well and protocol pointers to dereferenced as NULL

Sasmithere avatar Oct 31 '25 18:10 Sasmithere