Porting to Samsung Galaxy Note 4 SM-N910P
-
@tigerpro ok. How did you decide which partition number to put where, eg., how did you decide to pick 17, 24 and 27 for boot, system and userdata? What are the partition sizes? Whats the content of your board config file? What is the exact error message you get?
-
@doniks I was using the Sailfish HADK to figure that out, I forget what the actual command was, but I did "adb shell" then another command which output that info, I copy and pasted from my terminal into the fix mountpoints file then formatted it to the correct format for the file. I tried to manually adb push the system.img to the same destination the script was (/data based on my understanding) which worked, but that juat makes my phone boot loop so I think I might be missing something, I looked at the kmesg file as well, the last entry it had was "booting linux" but thats also not happening otherwise I would be posting files lol
-
@tigerpro said in Porting to Samsung Galaxy Note 4 SM-N910P:
@doniks I was using the Sailfish HADK to figure that out, I forget what the actual command was, but I did "adb shell" then another command which output that info, I copy and pasted from my terminal into the fix mountpoints file then formatted it to the correct format for the file.
Ok
I tried to manually adb push the system.img to the same destination the script was (/data based on my understanding) which worked,
Hang on. So you DO have a system.img file? I thought
make systemimage
fails?! (Can you still post that error?)but that juat makes my phone boot loop so I think I might be missing something, I looked at the kmesg file as well, the last entry it had was "booting linux" but thats also not happening otherwise I would be posting files lol
Maybe post the whole kmesg. Boot loop could be all kinds of other problems.
-
@doniks said in Porting to Samsung Galaxy Note 4 SM-N910P:
I tried to manually adb push the system.img to the same destination the script was (/data based on my understanding) which worked,
Hang on. So you DO have a system.img file? I thought
make systemimage
fails?! (Can you still post that error?)I originally was having an error with "mka systemimage" I tried it after I did a make clean cause I started to randomly get an error with "mka mkbootimg" so I just did a make clean (which failed, Had to manually delete a file for it to succeed) after that, I repo synced, and everything started to work again, so no idea on that one, but yes it does generate a system.img now, wether or not its correct is a different story.
but that juat makes my phone boot loop so I think I might be missing something, I looked at the kmesg file as well, the last entry it had was "booting linux" but thats also not happening otherwise I would be posting files lol
Maybe post the whole kmesg. Boot loop could be all kinds of other problems.
full kmsg:
- daemon not running. starting it now on port 5037 *
- daemon started successfully *
{490562} sbl1_ddr_init:: ret[0xffff]
{491080} sbl1_ddr_zi_init:: ret[0xfffe]
{492880} @@ pm power on reason : 0x20000000c1
{492910} @@ reset status : 0x0
{492941} clock_init, Start
{493185} clock_init, Delta
{493185} boot_dload_dump_tz:: Not Allowed!!
{493246} boot_fota_restore_partition, Start
{494740} boot_fota_restore_partition, Delta
{494832} Image Load, Start
{656573} Tz Execution, Start
{821151} Tz Execution, Delta
{821212} boot_fota_close_hdev, Start
{821243} boot_fota_close_hdev, Delta
{821670} RPM loading is successful.
{821700} Image Load, Start
{885689} Signal PBL to Jump to RPM FW
{887092} Image Load, Start
{911431} WDT Execution, Start
{911736} WDT Execution, Delta
{911797} Image Load, Start
{1197247} sbl1_efs_handle_cookies, Start
{1197430} sbl1_efs_handle_cookies, Delta
{1197460} RPM sync cookie updated
{1201242} SBL1, End
welcome to lk
platform_init()
target_init()
HW REV12 : (1, 1, 0, 0)
HW_REV_READ 12
sec_init: Start
check power key with 0x283b389e
Power on status : 0x20000000c1 (HARD RESET, Cable Power on, Keypad Power on)
[MUIC] MUIC initialized !
muic_driver_init
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
[MUIC] init_microusb_ic: CONTROL1:0x00
[MUIC] init_microusb_ic: CONTROL1:0x00
[MUIC] init_microusb_ic: CONTROL2:0x3b
[MUIC] init_microusb_ic: CONTROL2:0x3b
MMC Product Name: R218MA
MMC_FIRMWARE_VERSION: 0x5
eMMC CMD21 tuning DATA error handled. status = 0x20
Done initialization of the cardMODEL_NAME:{{SM-N910P}}
eMMC_SERIAL_NUMBER:{{150100523231384d4100110ddabf1200}}aboot_init()
REBOOT MODE : 0x283b389e
ENABLE LVS1 for sensorhub
ENABLE LDO9
oem_panel_select panel_id = 3
target_ldo_ctrl ++, enable = 1
Setting LDO26 1
muic_get_device
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
get_charger: hw_rev(0xc)
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
aboot_dev_charging_init : cable_status(1), cable_type(0)
max77823_get_battery_detect : battery(0)
aboot_dev_charging_init, [battery] batt_id_value (0)
max77823_set_charger_state: buck(1), chg(0), reg(0x04)
get_charger: hw_rev(0xc)
[battery] external charger init
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
max77823_set_fast_charging_current_data : fast charging current 460mA(0x09)
max77823_set_charging_current_limit_data : input current limit: reg = c0, 460mA(0x0d)
fuel_gauge_read_vcell: VCELL(3819), data(0xbefa)
max77823_set_charger_state: buck(1), chg(0), reg(0x04)
aboot_dev_charging_init : vcell(3819), count(0)
Setting 12
Setting 2
Setting 22
target_ldo_ctrl --
Panel power on done
target_panel_clock
first_qcom_dload_magic=0xffffffff,second_qcom_dload_magic=0xffffffff
mdp_gdsc_ctrl = 1
ERROR: splash Partition invalid
Config MIPI_CMD_PANEL.
pinfo->mipi.dual_dsi = 1
target_panel_reset ++ enable=1
target_panel_reset ...0
target_panel_reset --
Panel Reset--
target_panel_reset ++ enable=1
target_panel_reset ...0
init_fuelgauge: Start!!
muic_get_jig_status
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
init_fuelgauge: Battery type : SDI, capacity: 6600, status: 128
init_fuelgauge: Already initialized (0x19c8, SDI type)
get_charger: hw_rev(0xc)
max77823_set_charger_state: buck(1), chg(1), reg(0x05)
fuel_gauge_read_vcell: VCELL(3815), data(0xbec0)
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
muic_get_jig_status
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
check_low_power : rb=0, jig=0, ct=1, vcell=3815
skip check low power
vibrator started
set_vibe_tonz
[tspdrv]nForce===7
vibe_set_pwm_freq
VIBRATOR is ENABLED :::
Haptic ENABLED :::
target_panel_reset --
Panel Reset Done---
mdss_dual_dsi_cmds_tx---4
mdss_dual_dsi_cmds_tx---1
mdss_dual_dsi_cmds_tx---1
mdss_dual_read_manufacture_id : id1 : 0x50 id2 : 0x20 id3 : 0x9
mdss_dual_dsi_cmds_tx---19
vibrator stopped
set_vibe_tonz
VIBRATOR is DISABLED :::
sec_init:END
mdss_dual_dsi_cmds_tx---3
mdss_dsi_cmd_mode_config
mdss_dsi_cmd_mode_config
pinfo->mipi.dual_dsi = 1 1
mipi_pinfo.num_of_display_on = 1
mdss_dual_dsi_cmds_tx---1
BOOTLOADER VERSION : N910PVPU4COJ6
before aboot_check_mode() , boot_mode=0x0
Get DATA success.react_lock flag(id:2)
Get DATA success.react_lock flag(id:10)
init react lock flag 0x0
init cc mode flag 0x0
check_boot_mode = key Down[0], Up[1]
cable_type =0x0, reboot_mode=0x283b389e
check_ramdump_mode :: k_param.debuglevel[0x574f4c44]::k_param.cp_debuglevel[0x0]
check_pit_integrity: invalid pit magic code.(0x0)
SECURE : Signature verification...
SECURE : Signature verification succeed
before check_lpm_mode
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
is_reboot_case =0
cable_status = 1
enter normal booting mode
AST_POWERON
display_boot_image ++
Corrupt JPEG data: u extraneous bytes before marker 0x02x
Invalid JPEG file structure: two SOI markers
exit
Invalid JPEG file structure: two SOF markers file structure: two SOI markers
exit
Didn't expect more than one scanùú“
exit
after aboot_check_mode()
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
fuel_gauge_read_vcell: VCELL(3827), data(0xbf64)
muic_get_jig_status
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
fuel_gauge_read_soc: SOC(45), data(0x2dc6)
check_low_battery : rb=0, jig=0, vcell=3827, soc=45
reboot_mode = 0x283b389e, boot_mode = 3, por = 0xc1
<LP> RECOVERY BOOTING.....
LK Area: 0xF800000 - 0xFA00000
Kernel Addr: 0x8000
Ramdisk Addr: 0x2600000
Second Addr: 0xF00000
Tags Adddr: 0x2400000
use_signed_kernel=0, is_unlocked=0, is_tampered=0.
Loading boot image (11153408): start
Loading boot image (11153408): done
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 0]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 1]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 2]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 3]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 4]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 6]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 7]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 8]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 9]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 10]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 12]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 13]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 14]
board[model_info:03010008, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 15]
ERROR: Unable to find suitable device tree for device model_info:0x03010008
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 0]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 1]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 2]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 3]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 4]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 6]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 7]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 8]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 9]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 10]
board[model_info:b208ff01, sec_rev:12], dtb[dt_model_info:b208ff01, dt_board_rev 12]
matched device tree : b208ff01, rev12
boot image size(14549248)
SECURE: signature check fail. (recovery.img)
init_ddi_data: usable ddi data.
[TIMA boot measurement] : Old/non-CL device - KNOX warranty void
<LP> Set Warranty Bit : recovery
[TIMA trusted boot]: SMC call to set the warranty violation fuse succeeded
SET WV: API Status 0x0
WB : Already SET 2, VER : N910PVPU4COG5
WP 3, 1
Loading keystore failed status 5 cmdline = 'console=null androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x37 dwc3_msm.cpu_to_affin=1'
PCD Detect GPIO Status = 1
Target_cont_splash=1
PCD Detect GPIO Status = 1
WV: API Status 0x0
WV: API Status 0x0
muic_get_jig_status
[MUIC] microusb_get_attached_device: STATUS1:0x1f, 2:0x41
[MUIC] microusb_get_attached_device: chgtyp+adc: 0x11f
RUSTPROOF : k_param.uartsel = 0x3
RUSTPROOF : Disable uart.
SET HV Charge mode : Disable (0x3)
WV: API Status 0x0
Warranty Bit Set - Blowing KAP_VIOLATION_FUSEBooting Linux
TZ informed of recovery status: 1
pm8x41_get_is_cold_boot: cold boot
cmdline: console=null androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x37 dwc3_msm.cpu_to_affin=1 cont_splash=1 androidboot.sec_atd.tty=/dev/ttyHSL0 sec_log=0x100000@0x10000008 sec_dbg=0x80000@0x10100008 sec_debugenable subcmdline
Updating device tree: start
Updating device tree: done
Turn off MIPI_CMD_PANEL.
PCD Detect GPIO Status = 1
Target_cont_splash=1
PCD Detect GPIO Status = 1
Target_cont_splash=1
PCD Detect GPIO Status = 1
Target_cont_splash=1
Continuous splash enabled, keeping panel alive.
booting linux @ 0x8000, ramdisk @ 0x2600000 (4847054), tags/device tree @ 0x2400000
[eMMC] WP status = 0x00, addr = 0x0, (0x01: Temporary WP; 0x02: Power_on WP)
[eMMC] Power on Write Protect set for sector [0 ~ 0x6000000]
[eMMC] WP status = 0x02, addr = 0x0, (0x01: Temporary WP; 0x02: Power_on WP)
WV: API Status 0x0
Booting Linuxlet me know if you see something I missed, I never get a splash screen, or anything, it either just sits there and does nothing or boot loops, system.img being manually pushed is the only difference I have noticed, although my last attempt before going to bed last night was just a stuck screen, after I had pushed the system.img manually so I dunno whats going on.
-
ok so I just played around with the system.img file, if I run "mka systemimage" and try to mount it, it fails saying invalid partition type, if I run the make_ext4fs command on it, i can then mount it, but it is empty, (kind of expected as make_ext4fs is a ext4 format tool) and trying it the way the script has it doesnt work either, so now I think I have it narrowed down to the system.img file being corrupted or not compiling right. @doniks was this the issue you were experiencing with TWRP 3.1.1? if so I might be SOL from here cause my device only has 3.1.0 or 3.1.1 according to the TWRP website.
-
@tigerpro said in Porting to Samsung Galaxy Note 4 SM-N910P:
ok so I just played around with the system.img file, if I run "mka systemimage" and try to mount it, it fails saying invalid partition type,
I think the android system.img is some unusual image format. Read the halium-install script. There you see how they transform it into something else!
if I run the make_ext4fs command on it, i can then mount it, but it is empty, (kind of expected as make_ext4fs is a ext4 format tool)
Well, yeah. It is expected to be empty afterwards.
and trying it the way the script has it doesnt work either, so now I think I have it narrowed down to the system.img file being corrupted or not compiling right.
I could imagine that an incomplete, or corrupt, or even an absent system.img might all lead to a rebooting device. Do you know how far the boot process goes for you so far? Does it enter the rootfs. Do you have telnet access? ssh? Which ip? Can you watch the usb serial number? What values does it go through?
I can't make much sense of your kmesg above. Maybe it is only the "late" part of the boot process after it has switched to the rootfs. If that is the case you can check my thread for how to NOT start the lxc container with the system.img. just as a stepping stone in debugging problems in that container
@doniks was this the issue you were experiencing with TWRP 3.1.1? if so I might be SOL from here cause my device only has 3.1.0 or 3.1.1 according to the TWRP website.
No I don't think you need to worry here. You only need twrp to have ANY recovery that allows you to adb in. You can probably use any other recovery you can dig up on xda for your device. I think my problem was just that the other version wouldn't install or something.
-
@doniks thanks for the advice, I have to figure out a way to pass the kernel options though cause my device doesnt have fastboot mode, it has download, recovery, and system (normal) and if I issue "adb reboot bootloader" it boots in download mode. I suppose I could just delete the rootfs.img file, but the error I keep getting is from the halium-install script, it copies the rootfs.img over, it fails with the system.img based on my understanding of the script with an error of "unable to write 217 (or 271, not sure) blocks, out of space?" I tried manually doing what the script was trying, it copies system.img to /data, I found an alternative script here:
http://www.codegist.net/code/halium install/
This script based on my understanding, does everything on the local system, then copies it over to the device. I found this last night when I had some time to research so Ill try it and see what happens. Im hoping this script will work, otherwise I will have to dig deeper and see if theres something I miss when I do "mka systemimage", I see warnings and notes, but thats throughout the entire build process, I have yet to see perfect code compile without issue lol
#=== Edit ===#
I tried that alternative script, it didnt give me any errors, but it was rebooting still, seemed to take a little longer (2 to 3 seconds longer) so Im re downloading the source, re-compiling, and see if anything changes cause my gut is telling me something with the code (maybe something I changed?) Is what my current hurdle is. Ill let ya know the outcome of my efforts. On a side note, is the ubports rootfs still in a pre-alpha phase, if so whats the best rootfs to try once I get this working?
-
So I basically started over, after I deleted the code I had, I was getting errors with the repo sync cause the repo I am using had a couple changes that I had to chase down to get the repo sync to work. I get it to sync, it generates hybris-boot.img and system.img after i type "export use ninja false" (or something similar, not in front of PC atm" so now my device just reboots, not sure where to go from here cause the kmsg when I read through it said it was booting linux like before, and if I try "adb pull /proc/kmsg kmsg" it just sits there pulling data until I either cancel it or disconnect it. Ill post the kmsg when I get a chance, but I dont think it will be of much use. Im starting to feel like every step forward puts me 3 back, maybe deleting rootfs.img and see if it keeps rebooting? I really dont know what else I can do besides that. @doniks is there a working plasma rootfs? The script in your thread doesnt wanna work for me.
-
ok so I managed to get a working hybris-boot.img again, I can telnet in, but if I try to go anywhere from there, the screen goes blank, and it just kinda sits there. I have been unable to get a rootfs script to finish without an error (complains about missing packages even if I install them on the host system) so from here I dont really know what else i can try as so far once i telnet in and do the (echo "continue") command the screen just goes blank and the phone sits there, Ill leave it over night and see if anything changes, but im not holding my breath as I have been fighting with this port for awhile now. I can supply my images if anyone reading along has a sprint note 4 and wants to try it out and see if they get the same result or even wants to help make this port a fully working one, otherwise Ill just keep plugging away at it till I either give up or get somewhere with it.
-
@tigerpro said in Porting to Samsung Galaxy Note 4 SM-N910P:
ok so I managed to get a working hybris-boot.img again, I can telnet in, but if I try to go anywhere from there, the screen goes blank, and it just kinda sits there.
it could mean that the system in the rootfs has started, but it's just deaf blind and mute
Reboot into recovery and check the last_kmsg.
Another test is to mount the rootfs in recovery, chroot into it and then
systemctl disable lxc@android systemctl mask lxc@android
If you reboot afterwards, maybe this helps with the usb networking.
-
@doniks here is a link to my last_kmsg, its too long for me to post on here, so its a google doc:
https://docs.google.com/document/d/1AalOno1W6TtUQfuUj9NoDuPmyXnICTjH0FiBw8tgVYc/edit?usp=sharing
I tried to mount the rootfs.img, it gave me an error about invalid options, so im trying to re-make my rootfs now, see if that makes a difference.
-
@doniks said in Porting to Samsung Galaxy Note 4 SM-N910P:
again surrounded by QCOM_BSP
@tigerpro are you still working on this port? I was reminded of this conversation by this: https://docs.ubports.com/en/latest/porting/installing-16-04.html#choose-a-rootfs there they are talking about CAF (Code Aurora Forum) in relation to this flag QCOM_BSP, maybe that CAF stuff is a lead for you?!
-
@doniks I actual put this on hold during the holidays, right now I'm trying to get a better emploent situation, but after that I'll start this project again. I never received an email saying I had a reply (weird but I'll check my settings on that) when I last tried to port Halium 7 I was trying to see if I could get the kernel output on the screen as logging it to a file didn't seem to be working properly with where it was hanging up. I haven't tried the ubports code in awhile, I will have to look into that link and see if there's any useful info in it. I also got one XDA user trying to help, I have to generate another log for him, and in return I'm trying to help him get a port for his devises working. I should have an update in a couple days with any luck.
-
So update time: (sorry for double posting)
I had to start over due to a HDD crash, long story short I got Halium compiled again, since I managed to get it to compile, I figure might as well see if I can get it working before moving back to ubports 16 port, I installed Halium, go to boot it, and I seem to be having a boot failure with no telnet, the last_kmsg seems to indicate that Halium can't initialize /init, I'm wondering if my fixup_mountpoints script might be incorrect as I did "/dev/block/<partition>" instead of just the <partition>, as this time around when I followed the directions thats the output I got. I'll try switching the partition back to how I had it before, but I actually get the screen to blank itself now while trying to boot, something that did not happen prior to HDD crash. I am also helping a person create a Xiaomi land port of ubports, they have gotten quite far in their attempts so far. Has anyone successfully ported ubports 16 with their new porting guide?
-
@tigerpro I got Samsung S3 Neo to boot UT 16.04, yes. As a workaround you can also add your partition as /dev/block/mmcblk0pxx in the system image´s fstab file. instead of the mentioned userdata partition entry there.
-
@flohack thank you for the response, I will try adding that to my fstab, I'll report back any success or failure when I try it. One question that I have is, is this done in addition to the fstab work in the ubports guide or is this strictly Halium?
-
@tigerpro All porting efforts should be made with the Halium guide only now. Anything else you find might be outdated.
See here: http://docs.halium.org/en/latest/porting/first-steps.html
BR
-
@flohack is this guide up to date for ubports? It does mention Halium as well as state to get Halium to compile first
https://docs.ubports.com/en/latest/porting/introduction.html
Is the guide I'm referring to
-
-
@unisuperbox thank you for an updated guide, one question that I didn't see in the guide though, does Halium just have to compile, or does it have to boot as well?