Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Samsung Galaxy (Note 7 & S7 & S7 Edge) #458

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

playday3008
Copy link
Contributor

@playday3008 playday3008 commented Dec 1, 2024

Added:

  • Samsung Galaxy Note 7 (2016) - graceqlte
  • Samsung Galaxy S7 (2016) - herolte
  • Samsung Galaxy S7 Edge (2016) - hero2lte

Testing on Note 7:
What works:

  • Boot into lk2nd
  • Screen (kinda, see what not works)
  • Buttons

What doesn't work:

  • Screen when using DEBUG_FBCON=1, it's just looks like corrupted framebuffer
  • Booting stock boot image (really have no idea, logs says that dt doesn't match, but it should though)

Notes:

  • fastboot kinda quirky, sometimes work, sometimes no, reconnecting cable seems to fix it
Photos

Normal boot:
20241202_001540

With DEBUG_FBCON=1
20241202_001705

Log
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.XF.1.0-00298
S - IMAGE_VARIANT_STRING=M8996LAB
S - OEM_IMAGE_VERSION_STRING=SWDD5513
S - Boot Interface: UFS
S - Secure Boot: On
S - Boot Config @ 0x00076044 = 0x000001c9
S - JTAG ID @ 0x000760f4 = 0x409470e1
S - OEM ID @ 0x000760f8 = 0x00200000
S - Serial Number @ <removed>
S - Feature Config Row 0 @ 0x000741a0 = 0x0050000010000100
S - Feature Config Row 1 @ 0x000741a8 = 0x0000000000000000
S - Core 0 Frequency, 1228 MHz
Android Bootloader - UART_DM Initialized!!!
AST_POWERON
Android Bootloader - UART_DM Initialized!!!
[0] welcome to lk

[0] calling constructors
[0] initializing heap
[0] initializing threads
[0] initializing dpc
[0] initializing timers
[0] creating bootstrap completion thread
[10] top of bootstrap2()
[10] initializing platform
[10] platform_init()
[10] Board info v11:
        format 11
        msm_id 0xf6
        msm_version 0x30001
        build_id 
        raw_msm_id 0x947
        raw_msm_version 0x4
        hw_platform 0x8
        platform_version 0x10000
        fused_chip 0x0
        platform_subtype 0x0
        foundry_id 0x3
        chip_serial <removed>
        num_pmics 2
        pmic_array_offset 0x6c
        PMIC 0:
                pmic_type 0x10009
                pmic_version 0x20000
        PMIC 1:
                pmic_type 0x1000c
                pmic_version 0x10000
[10] initializing target
[10] target_init()
[10] RPM GLink Init
[20] xport_rpm_init:1025: RPM Transport INIT
[20] xport_rpm_init:1061: Initialize Edges
[20] Register interrupt: 200
[30] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[30] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[30] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[30] Opening RPM Glink Port success
[30] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[30] Opening SSR Glink Port success
[40] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[40] xport_rpm_send_event:184: Notify RPM with IPC interrupt
[40] Glink Connection between APPS and RPM established
[40] Glink Connection between APPS and RPM established
[50] UFS init success
[50] calling apps_init()
[50] lk2nd_init()
[50] Booted @ 0x80008000, r0=0x0, r1=0x0, r2=0x83200000
[60] MMU mapping mismatch @ 0x83200000: 0x83201c1e != 0x83200c1a
[60] Found valid DTB with 4764 bytes total
[70] Command line from previous bootloader: lk2nd cordon=<removed> connie=SM-N9300_HK_CHN_<removed> androidboot.ucs_mode=0 androidboot.security_mode=<removed> androidboot.ddr_size=4 androidboot.bootdevice=624000.ufshc androidboot.serialno=<removed> androidboot.baseband=msm lcd_id=0xc16080 lcd_id2=0xffffff mdss_mdp.panel=1:dsi:0:ss_dsi_panel_S6E3HA5_AMB567MK01_WQHD:config0:1:none:cfg:single_dsi androidboot.sec_atd.tty=/dev/ttyHSL0 androidboot.revision=11 androidboot.hmac_mismatch=0 androidboot.emmc_checksum=3 loglevel=4 sec_log=0x200000@0x85200000 sec_dbg=0x1ff000@0x85000000 sec_debug.reset_reason=0x0 sec_dbg_ex_info=0x400@0x851ff000 androidboot.debug_level=0x4f4c sec_debug.enable=0 sec_debug.enable_user=0 androidboot.cp_debug_level=0x55FF sec_debug.enable_cp_debug=0 androidboot.cp_reserved_mem=off androidboot.boot_recovery=0 charging_mode=0x3030 pmic_info=3 ccic_info=1 androidboot.em.did=<removed> androidboot.em.model=SM-N9300 androidboot.em.status=0x0 androidboot.warranty_bit=1 fg_reset=0 androidboot.bootloader=N9300ZHU3BQB1 androidboot.carrierid.param.offset=9438268 androidboot.sales.param.offset=9438272 androidboot.carrierid= androidboot.sales_code=TGY
[170] Detected device: Samsung Galaxy Note 7 (compatible: samsung,graceqlte)
[430] muic-reset: Successful, earlier UART log might be lost!
[430]  | label | code  | gpio        |
[440] pm8x41_gpio_config_sid: gpio=2 base=c100
[440]  | home_key |   290 | 0x02 0x0002 |
[450] pm8x41_gpio_config_sid: gpio=3 base=c200
[450]  | vol_up |   277 | 0x02 0x0003 |
[450] keys: 2 keymap overrides applied
[460] Display Init: Start
[460] MDP continuous splash detected: pipe VIG_0, base: 0x9a400000, stride: 4320, src: 720x2560 (0,0), img: 1440x2560, out: 720x2560 (0,0), format: 0x2243f (bpp: 3)
[470] MMU mapping mismatch @ 0x9a400000: 0x9a401c1e != 0x9a400c1a
[480] Display refresh: cmd mode: 1, auto refresh: 0 (sel: 0x21f20)
[490] Display Init: Done
[490] serial number: <removed>
[490] Registering wrapper bio devices...
[500] mbr partition table dump:
[500]   0: status 0x6f, type 0x72, start 0x2e616964, len 0x440a0dff
[510]   1: status 0x69, type 0x65, start 0xa0dff72, len 0x73657250
[510]   2: status 0x73, type 0x79, start 0x6f742079, len 0x73657220
[520]   3: status 0x74, type 0xd, start 0x0, len 0xd8cbac00
[520] mbr partition table dump:
[530]   0: status 0x6f, type 0x72, start 0x2e616964, len 0x440a0dff
[530]   1: status 0x69, type 0x65, start 0xa0dff72, len 0x73657250
[540]   2: status 0x73, type 0x79, start 0x6f742079, len 0x73657220
[540]   3: status 0x74, type 0xd, start 0x0, len 0xd8cbac00
[550] Registering mmc_sdhci bio devices...
[560] SD card MMC is unavailable.
[560] block devices:
[560]  | dev        | label           | size       | Leaf |
[570]  | wrp0p46    | lk2nd           |    512 KiB | Yes  |
[570]  | wrp0p45    | pad             |     10 MiB | Yes  |
[580]  | wrp0p44    | ddr             |   1024 KiB | Yes  |
[580]  | wrp0p43    | dpo             |      4 KiB | Yes  |
[590]  | wrp0p42    | msadp           |    128 KiB | Yes  |
[590]  | wrp0p41    | apdp            |    128 KiB | Yes  |
[600]  | wrp0p40    | cmnlib64        |    256 KiB | Yes  |
[600]  | wrp0p39    | cmnlib          |    256 KiB | Yes  |
[610]  | wrp0p38    | keymaster       |    256 KiB | Yes  |
[610]  | wrp0p37    | lksecapp        |    384 KiB | Yes  |
[620]  | wrp0p36    | bluetooth       |   1024 KiB | Yes  |
[620]  | wrp0p35    | devinfo         |      4 KiB | Yes  |
[630]  | wrp0p34    | aboot           |     20 MiB | Yes  |
[630]  | wrp0p33    | mdtp            |     32 MiB | Yes  |
[640]  | wrp0p32    | dip             |   1024 KiB | Yes  |
[640]  | wrp0p31    | dsp             |     16 MiB | Yes  |
[650]  | wrp0p30    | pmic            |    512 KiB | Yes  |
[660]  | wrp0p29    | sec             |     16 KiB | Yes  |
[660]  | wrp0p28    | fsg             |      2 MiB | Yes  |
[670]  | wrp0p27    | hyp             |    512 KiB | Yes  |
[670]  | wrp0p26    | tz              |      2 MiB | Yes  |
[680]  | wrp0p25    | rpm             |    512 KiB | Yes  |
[680]  | wrp0p24    | xbl             |      3 MiB | Yes  |
[690]  | wrp0p23    | xbl             |      3 MiB | Yes  |
[690]  | wrp0p22    | userdata        |  54264 MiB | Yes  |
[700]  | wrp0p21    | cache           |    300 MiB | Yes  |
[700]  | wrp0p20    | system          |   5900 MiB | Yes  |
[710]  | wrp0p19    | persdata        |      9 MiB | Yes  |
[710]  | wrp0p18    | recovery        |     76 MiB | Yes  |
[720]  | wrp0p17    | boot            |     75 MiB | Yes  |
[720]  | wrp0p16    | modem           |     85 MiB | Yes  |
[730]  | wrp0p15    | apnhlos         |     95 MiB | Yes  |
[730]  | wrp0p14    | steady          |   1024 KiB | Yes  |
[740]  | wrp0p13    | persistent      |   1024 KiB | Yes  |
[750]  | wrp0p12    | fota            |     21 MiB | Yes  |
[750]  | wrp0p11    | bota            |     30 MiB | Yes  |
[760]  | wrp0p10    | frp             |    512 KiB | Yes  |
[760]  | wrp0p9     | devcfg          |    128 KiB | Yes  |
[770]  | wrp0p8     | keystore        |    512 KiB | Yes  |
[770]  | wrp0p7     | misc            |   1024 KiB | Yes  |
[780]  | wrp0p6     | param           |     10 MiB | Yes  |
[780]  | wrp0p5     | efs             |     20 MiB | Yes  |
[790]  | wrp0p4     | persist         |     32 MiB | Yes  |
[790]  | wrp0p3     | ssd             |      8 KiB | Yes  |
[800]  | wrp0p2     | fsc             |      4 KiB | Yes  |
[800]  | wrp0p1     | modemst2        |      2 MiB | Yes  |
[810]  | wrp0p0     | modemst1        |      2 MiB | Yes  |
[810]  | wrp0       |                 |  60928 MiB |      |
[820] boot: Trying to boot from the file system...
[830] boot: Bootable file system not found. Reverting to android boot.[830] Loading (boot) image (17743872): start
[900] Loading (boot) image (17743872): done
[900] use_signed_kernel=0, is_unlocked=1, is_tampered=0.
[910] decompressing kernel image: start
[1200] decompressing kernel image: done
[1200] DTB Total entry: 4, DTB version: 33
[1250] Parsed DTB entry info (246/00030001/0x00000008/2)
[1260] Parsed DTB entry info (246/00030001/0x00000008/3)
[1260] Parsed DTB entry info (246/00030001/0x00000008/6)
[1270] Parsed DTB entry info (246/00030001/0x00000008/9)
[1210] ERROR: Unable to find suitable device tree for device (246/0x00030001/0x00010008/0)
[1220] ERROR: Getting device tree address failed
[1220] ERROR: Could not do normal boot. Reverting to fastboot mode.
[1230] Generated MAC address <removed>, BD address <removed>
[1230] recovery() Reverting to default 0x0
[1240] system() Found EXT FS
[1240] cache() Found EXT FS
[1240] userdata() Reverting to default 0xa6a2
[1250] ptn[0]:Name[modemst1] Size[512] Type[0] First[264] Last[775]
[1250] ptn[1]:Name[modemst2] Size[512] Type[0] First[776] Last[1287]
[1260] ptn[2]:Name[fsc] Size[1] Type[0] First[1288] Last[1288]
[1260] ptn[3]:Name[ssd] Size[2] Type[0] First[1289] Last[1290]
[1270] ptn[4]:Name[persist] Size[8192] Type[0] First[1291] Last[9482]
[1280] ptn[5]:Name[efs] Size[5120] Type[0] First[9483] Last[14602]
[1280] ptn[6]:Name[param] Size[2560] Type[0] First[14603] Last[17162]
[1290] ptn[7]:Name[misc] Size[256] Type[0] First[17163] Last[17418]
[1290] ptn[8]:Name[keystore] Size[128] Type[0] First[17419] Last[17546]
[1300] ptn[9]:Name[devcfg] Size[32] Type[0] First[17547] Last[17578]
[1310] ptn[10]:Name[frp] Size[128] Type[0] First[17579] Last[17706]
[1310] ptn[11]:Name[bota] Size[7680] Type[0] First[17707] Last[25386]
[1320] ptn[12]:Name[fota] Size[5376] Type[0] First[25387] Last[30762]
[1330] ptn[13]:Name[persistent] Size[256] Type[0] First[30763] Last[31018]
[1330] ptn[14]:Name[steady] Size[256] Type[0] First[31019] Last[31274]
[1340] ptn[15]:Name[apnhlos] Size[24320] Type[0] First[31275] Last[55594]
[1340] ptn[16]:Name[modem] Size[21760] Type[0] First[55595] Last[77354]
[1350] ptn[17]:Name[boot] Size[19328] Type[0] First[77483] Last[96810]
[1360] ptn[18]:Name[recovery] Size[19456] Type[0] First[96811] Last[116266]
[1360] ptn[19]:Name[persdata] Size[2304] Type[0] First[116267] Last[118570]
[1370] ptn[20]:Name[system] Size[1510400] Type[0] First[118571] Last[1628970]
[1380] ptn[21]:Name[cache] Size[76800] Type[0] First[1628971] Last[1705770]
[1380] ptn[22]:Name[userdata] Size[13891792] Type[0] First[1705771] Last[15597562]
[1390] ptn[23]:Name[xbl] Size[768] Type[0] First[6] Last[773]
[1400] ptn[24]:Name[xbl] Size[768] Type[0] First[6] Last[773]
[1400] ptn[25]:Name[rpm] Size[128] Type[0] First[6] Last[133]
[1410] ptn[26]:Name[tz] Size[512] Type[0] First[134] Last[645]
[1410] ptn[27]:Name[hyp] Size[128] Type[0] First[646] Last[773]
[1420] ptn[28]:Name[fsg] Size[512] Type[0] First[774] Last[1285]
[1420] ptn[29]:Name[sec] Size[4] Type[0] First[1286] Last[1289]
[1430] ptn[30]:Name[pmic] Size[128] Type[0] First[1290] Last[1417]
[1440] ptn[31]:Name[dsp] Size[4096] Type[0] First[1418] Last[5513]
[1440] ptn[32]:Name[dip] Size[256] Type[0] First[5514] Last[5769]
[1450] ptn[33]:Name[mdtp] Size[8192] Type[0] First[5770] Last[13961]
[1450] ptn[34]:Name[aboot] Size[5120] Type[0] First[13962] Last[19081]
[1460] ptn[35]:Name[devinfo] Size[1] Type[0] First[19082] Last[19082]
[1470] ptn[36]:Name[bluetooth] Size[256] Type[0] First[19083] Last[19338]
[1470] ptn[37]:Name[lksecapp] Size[96] Type[0] First[19339] Last[19434]
[1480] ptn[38]:Name[keymaster] Size[64] Type[0] First[19435] Last[19498]
[1490] ptn[39]:Name[cmnlib] Size[64] Type[0] First[19499] Last[19562]
[1490] ptn[40]:Name[cmnlib64] Size[64] Type[0] First[19563] Last[19626]
[1500] ptn[41]:Name[apdp] Size[32] Type[0] First[19627] Last[19658]
[1500] ptn[42]:Name[msadp] Size[32] Type[0] First[19659] Last[19690]
[1510] ptn[43]:Name[dpo] Size[1] Type[0] First[19691] Last[19691]
[1520] ptn[44]:Name[ddr] Size[256] Type[0] First[19692] Last[19947]
[1520] ptn[45]:Name[pad] Size[2575] Type[0] First[19948] Last[22522]
[1530] ptn[46]:Name[lk2nd] Size[128] Type[0] First[77355] Last[77482]
[1530] fastboot_init()
[1540] serial number: <removed>

That PR will be draft, until booting stock image will work

@playday3008
Copy link
Contributor Author

Here's stock kernel for reference: https://github.com/jcadduono/android_kernel_samsung_msm8996

lk2nd/device/dts/msm8996/rules.mk Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
lk2nd/device/dts/msm8996/msm8996-samsung.dts Outdated Show resolved Hide resolved
- Samsung Galaxy Note 7 (2016) - graceqlte
- Samsung Galaxy S7 (2016) - herolte
- Samsung Galaxy S7 Edge (2016) - hero2lte
Comment on lines +85 to +86
muic-reset {
compatible = "samsung,muic-reset";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, you actually need to reset the muic and you don't get usb unless you have this in, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants