yashsingh1/xdaforums huggingface dataset:
[Milestone 2 Android Development] tezet:
Thank you. My USB <-> TTL converter is on the way, so I need to work in the dark right now... But anyway it works when UART is enabled, so I guess it may not help in debugging it :)

I've just figured out that what really makes difference is something inside function reconfigure_emu_uart(). When I call that function, everything works, also USB. I'll try to narrow down what is really vital here.

Update: seems that all UART init process is necessary on M2. Anyone can explain that?
[Milestone 2 Android Development] czechop:
Hi tezet.

I guess this is because by default on M2 uart3 is disabled(in the original kernel), so why hboot tries to send something via uart, it crashes(because the uart3 clocks are not started).

So either you need to start clocks(first few lines in reconfigure_emu_uart()), or you need to disable uart output in hboot.

EDIT: I think that the easiest option would be to move the call to reconfigure_emu_uart just before disable_dss(outside emu_uart if statement), and inside reconfigure_emu_uart return after enabling clocks if emu_uart is not set.
[Milestone 2 Android Development] tezet:
Thx for explanation. This exactly what I already did :)

https://github.com/tezet/android_de...mmit/8b68e5b07d3e480c4a2075386fde66f1e8941d99
[Milestone 2 Android Development] Skrilax_CZ:
hboot in our repo will not send anything via UART3 if it's not enabled; the parameter is passed from hbootmod to hboot and then to the kernel via cmdline, if cmdline is not overriden.
[Milestone 2 Android Development] czechop:
Sorry tezet, haven't seen that you already did the change(was lookng on hboot at Quarx repo):o

You are right. You indeed check if uart3 is enabled in hboot:) So don't know who else is trying to use uart3(kernel is compiled with low level debugging turned off, so most likely not it). But probably this does not matter that much, as enabling uart3 clocks should not harm anything, as they are turned off by kernel at some stage anyway:)

BTW, I've seen that you are mapping memory addresses 0x48... and 0x49... in build_l1_table. I think that this could be removed(for keeping code as clean as possible), as it was used only to help debug(with uart2 initially hence 0x48..., and uart3 later therefore 0x49..) some problems I had in init.S file before the mmu is disabled.
[Milestone 2 Android Development] tezet:
I haven't seen it in your repos guys, but I guess it may also apply for Defy and M1 as well:

https://github.com/tezet/kernel-milestone2/commit/22fb7fb258c90f0d0e81c41a1a3a60404d62a7d6

It fixes multitouch bug (the one you can reproduce in multitouch paint).
[Milestone 2 Android Development] labsin:
Can anyone help me with this (for adding it to the custom kernel)

[Q] Adding Android Open Accessory (AOA) protocol to defy (CM10)

Already tried to add needed things to the Kernel and the device tree. I think i'm missing something.

My forks:

https://github.com/labsin
[Milestone 2 Android Development] Zachary57:
Hi,

On milestone XT720 our 2ndboot work but we haven't radio after 2ndboot.

Can someone tell me how to have a log to see what is the problem.

Thank you
[Milestone 2 Android Development] czechop:
Hi,

I presume that the kernel you are trying to boot have the ehci patch applied, is that correct?

If so, then I think you should examine dmesg logs from the booted kernel(you mentioned that your 2ndboot is working, so you should not have any problem obtaining dmesg logs). Check if ehci can find BP attached(you could compile your kernel with CONFIG_USB_ANNOUNCE(don't remember if that's the correct name) turned on, which should add trace to dmesg when ehci device is discovered). If ehci does not report BP connected, and it does not complain about failing enumeration, than you... should read 1st post:D
[Milestone 2 Android Development] Quarx:
Info about 3.0 kernel

New log: http://quarx2k.ru/uart.txt

All cpcap stuff are work correct now.

Voltage,nand,sd,i2c problems fixed.

Todo make work Dispaly and usb
[Milestone 2 Android Development] Zachary57:
I Will try to apply ehci patch and see dmesg.

Thank you for answer.
[Milestone 2 Android Development] jotha:
Thread cleaned

Please remember:

This is a development Thread. All posts not relevant to or concerning the development of this rom are considered OT and will be removed.

Post such questions in General-Section.

Thanks for your understanding

jotha - forum moderator
[Milestone 2 Android Development] kabaldan:
The device restart added after a critical error (it's usually in action after an occasional failure of the crc check of images passed from hbootmod to hboot) may be of interest on other devices as well, see https://github.com/nadlabak/2ndboot/blob/master/hboot/main.c#L16

(BOARD_GLOBAL_REG_PRM_BASE is 0x48307200 in the case of OMAP3430)

Btw., the progress of work done on 3.x kernel is amazing, congrats to Quarx :).
[Milestone 2 Android Development] Quarx:
Did anyone know which GPIO_en for Display?

Droid3(Solana use gpio 96), but i can't find this value in defy driver...

https://github.com/Quarx2k/jordan-k...ch/arm/mach-omap2/board-mapphone-panel.c#L495

Log of dispaly http://quarx2k.ru/display.log

I think, this errors, because power for dispaly is not enabled.
[Milestone 2 Android Development] czechop:
Looking at the code it seems that there is no gpio for enabling display. You probably could confirm that by commenting out disable_dss in hbootmod and see if moto logo will stay on screen.
[Milestone 2 Android Development] czechop:
Have you figured out what is the problem with the crc? At some point I've commented out few printfs in image_complete function(https://github.com/czechop/2ndboot/blob/master/boot/images.c#L89) and I started getting crc errors almost all the time.... which looks like some stack corruption problem or something like this.
[Milestone 2 Android Development] Skrilax_CZ:
I forgot to write it here - I've added libgcc support for hboot to add certain fucntions such as modulo and divide. Original hboot had it hacked (i.e %d doesn't work, it prints %x instead, but doesn't know about it - see the printf source).

However in our case the problem was different (collisions with used memory regions (reverted) and not using scattered buffer type).
[Milestone 2 Android Development] czechop:
I meant that the problem was occuring when I've deleted(commented out) printfs in that function... with printfs in the code, the crc errors were not showing very frequently.
[Milestone 2 Android Development] Skrilax_CZ:
Ah. Well, can't tell anything without disassembling it and checking. Also which gcc you use?
[Milestone 2 Android Development] ---UFO---:
Is it somehow possible to run adb after 2ndboot kernel is loaded? Because I cannot get any logcat.

Thanks
[Milestone 2 Android Development] Zachary57:
On milestone XT720 I applied your patch (same lsusb adress) but I had to comment get descriptor calls because I haven't declaration.

So currently kernel boot but no radio.

Can you please provide get descriptor function ?

Thank you.
[Milestone 2 Android Development] espaciosalter20:
I used to have a defy. Now I'm on Xperia sola with locked bootloader. Can I use your patch to enable custom kernel on my device??

Enviado desde mi MT27i usando Tapatalk 2
[Milestone 2 Android Development] m11kkaa:
First you need an working init-exploit(bootmenu). Otherwise you would have to do a full system boot before booting in you custom kernel/rom.
[Milestone 2 Android Development] Shubhamqweasd:
hey guys/quarx ,

galaxy sl(OMAP 3630) devs has booted kernel 3.0

http://xdaforums.com/showpost.php?p=35800002&postcount=1005
[Milestone 2 Android Development] ccav2000:
I believe Quarx has already booted 3.0 but he couldn't get the display to work. Haven't seen any work on that kernel since then, and that was over a month ago.
[Milestone 2 Android Development] moamoa:
Kernel 3.0 on Defy

He just managed to start it =)

http://xdaforums.com/showpost.php?p=37049359&postcount=82

Crossing fingers!!
[Milestone 2 Android Development] L3ibnitZ:
Quarx already released an experimental build with new kernel:
[Milestone 2 Android Development] moamoa:
I`m sorry, what I really meant was that he got display to work. He had it booting a long time ago but with a lot of display issues :good:

And by the look of his activity on github, he is close to release a working build of its 3.0 kernel

https://github.com/Quarx2k?tab=activity
[Milestone 2 Android Development] m11kkaa:
The next step is getting wifi to work so usb-problems can be debugged via SSH/ADB.

Then if usb works he can start with RIL(modem is a usb-device) - which will be hard because we have old drivers only and some old kernel-modules needs to be ported to 3.x.
[Milestone 2 Android Development] ssjoker:
what is radio.patch?how it work?
[Milestone 2 Android Development] Megalith27:
Does anyone know how to enable adb logcat on 2nd-boot?
[Milestone 2 Android Development] Kayant:
On defy adb works from startup without enabling it in bootmenu.....

command is $ adb logcat long -v > name.txt

name can be anything
[Milestone 2 Android Development] Megalith27:
I was trying to get a logcat for miui v5, in bootmenu enabling ADB deamon, does give an output to adb devices, whereas when i am booting the adb logcat command says awaiting for device...

and the rom bootloop, but i can't diagnose the cause due to lack of logcat.

As a workaround, i will be working with 2nd-init build of CM10 to port the rom and then transfer basically framework folder and some additional file to a 2nd-boot build. But like i said it's a workaround not a solution.
[Milestone 2 Android Development] m.ksy:
What's need to be done to make work 2ndboot on Droid X? Kernel source available for downloading there.
[Milestone 2 Android Development] Aaahh:
Surprise, it already does... at least with shadowmod.
[Milestone 2 Android Development] Quarx:
yea, it worked! but randomly reboots.

I tested on stock moto kernel

before 2ndboot

Linux localhost 2.6.32.9-g6977577 #1 PREEMPT Mon Nov 7 23:37:21 KST 2011 armv7l

GNU/Linux

after

Linux (none) 2.6.32.9-ge281b6e #1 PREEMPT Thu Feb 2 10:03:42 CST 2012 armv7l GNU

/Linux

and custom too:)

Linux (none) 2.6.32.9 #1 PREEMPT Fri Sep 28 14:11:14 MSK 2012 armv7l GNU/Linux
[Milestone 2 Android Development] hsrars-d:
:victory: At least its the start! :victory:
[Milestone 2 Android Development] czechop:
Good to hear that:)

Did you also got the battery status showing 100%?
[Milestone 2 Android Development] fjfalcon:
Really waiting for sources.. cause we still have only 2.6.29 =)

Maybe you can share at least 2ndboot sources?

Cause last from milestone works from time to time.
[Milestone 2 Android Development] kabaldan:
Yeah :). I don't know if I can manage to wait till next week for the source :)

I'm eager to see how you skip the EHCI reset and enumeration.

Battery charging is working fine on Milestone1 after 2ndboot.

As Quarx mentioned, Battd spits out "INIT Power IC Fail" if it can't open /dev/cpcap, usually because of permissions.

It also opens /dev/cpcap_uc and /dev/cpcap_batt , but failure to open those other devices produces different error messages (INIT MicroC Fail resp. INIT Batt Fail).
[Milestone 2 Android Development] Quarx:
Battd works.

But boot very unstable.. in 10times, only one time it booted. (reboot on boot animation) http://pastebin.com/NN5tnXUh

Hm... maybe crash caused by battd.

Wait for usb changes in kernel:)
[Milestone 2 Android Development] espaciosalter20:
Lol... I used to know that provided Motorola's source code could work someday for things like this. I just wonder how much this take to our moto genius devs to figure out how to make it work to enable custom kernel.

Essentially, and for a lot of us which know a little bit about kernel compiling and load, this project is intended to overpass 100% the signed stock kernel which it's bundle on a current Motorola device with a locked bootloader?

It's a great advance, even if only boot once in twenty times, that's mean the procedure goes in the right direction but need to be more polished in order to prevent crashes between custom and stock kernel (finding a way to disable load of the stock kernel).

Really thanks for this, and with moto genius devs on board, maybe this thing gets easier.

Enviado desde mi MB525 usando Tapatalk 2
[Milestone 2 Android Development] skeevydude:
That's exactly what the Bravo does.

Glad to see ya all over this thread. :)

Good luck.
[Milestone 2 Android Development] hackergnome:
!!!!!RISE OF THE FALLEN!!!!!

/OT Closed
[Milestone 2 Android Development] tezet:
Hmm, after moto logo, my device displays blank screen, powers up red led, than reboots... Is it normal and I need to wait or something went wrong? I haven't reached bootanimation so far :)

Is there any console output in this kernel?
[Milestone 2 Android Development] Boss442:
where can found ramdisk and devtree files? :silly: i need plz for the defy
[Milestone 2 Android Development] Kaffeekranz:
On your phone would be a good bet.

But most definitely not on the milestone forums.
[Milestone 2 Android Development] espaciosalter20:
Maybe he could if he search for sbf for defy and know how to uncompress android img...

Enviado desde mi MB525 usando Tapatalk 2
[Milestone 2 Android Development] JackpotClavin:
Might to be able to dd if= the mmcblk that contains the device tree. Otherwise, a devicetree.bin might be in the most recent offical update .zip from Motorola
[Milestone 2 Android Development] Gustavo_s:
good work guys, keep it up!
[Milestone 2 Android Development] ppero196:
Now...only honored thing to do, besides pressing thanks is to donate to OP.

ALL HAIL OP!!!
[Milestone 2 Android Development] eTaurus:
And honor them by keeping this thread clean for it purely and really is a developer thread. Don't let it get the same mess as the Quarx JB thread over at the Defy forums.

Hit the thanks button, these guys already know how we appreciate their work and how keen we are to see further advancements.

Thank you!

Gesendet von meinem MB526 mit Tapatalk 2
[Milestone 2 Android Development] ppero196:
YES sir!
[Milestone 2 Android Development] tezet:
It finally worked with ramdisk from your first thread. Battery % was OK, perhaps it didn't worked for you because used battd from froyo? The rom selects froyo or GB version on first boot. I suggest to replace the file (it's battd.gb) or just reinstall CM10.

Edit: apparently there is some problem in launching from bootmenu, it works for me only when it's started manually from bootmenu. I have never reached bootanimation when bootmenu is selected as default boot method.

Anyone have an idea why is it so painfully slow? Cache is not enabled? Memory is incorrectly initialized?
[Milestone 2 Android Development] Quarx:
I can pass bootanimation in one of 20times..

Crash in wakelock_stats_show
[Milestone 2 Android Development] mihovil13:
Would there be any use of those USB host mode files from Eclair kernel?

Could they work on newer roms? :D
[Milestone 2 Android Development] tezet:
Maybe it's a placebo effect, but it seems that when I reboot just after usual 2nd-init boot, the chance of passing bootanimation is pretty high (more than 50%). The regular 2ndinit boot needs to start after removing battery. But it is valid only with czechop's kernel, I never succeeded booting my or stock moto kernel. Is that expected without USB changes?

Update: it doesn't seems to work anymore ;)

Funny thing is that the kernel is not always slow. Now I had luck to boot with pretty normal performance - 1516 in quadrant, which is more or less the same I get on stock kernel...
[Milestone 2 Android Development] Quarx:
it's so randomly... i boot android after 27 times..

Maybe "boot" problem... so wait for new version and sources:)

Milestone2 kernel works on defy with ril:)
[Milestone 2 Android Development] tezet:
Good, that means we can most probably have a common kernel :)

For me the only problem (if it boots of course ;) ) is it's speed. It seems to be fully functional and stable. But since once I had luck to boot with normal performance, it seems to be also an initialization problem.

I have captured the logs to see the difference between these states, but I can't see anything interesting there...
[Milestone 2 Android Development] josuearisty:
Hope this really works on our love bravo, knowing that our phone has identical hardware with some other moto phones!

This is really good news, I hope this is ready soon!
[Milestone 2 Android Development] hackergnome:
i booted on my 1st try :D

and its 2 reboot per single boot for me

Also after booting as per logcat WiFi is spazzing maybe thats what makes it lag!
[Milestone 2 Android Development] Quarx:
Yes, it works for bravo, but need kernel for baravo (from defy or ml2 not working).

Need info how to use emu-uart, to make support all devices in one kernel:)

Added: i start defy+ kernel on bravo, but usb not work. Need replace cpcap firmware from bravo kernel and use devtree from defy+.

Maybe someone know how to make own devtree?

Added2: Usb works on bravo with defy kernel:)

Yes, perfomance is not good, but i think this problem will be fixed by czechop in bootloader.

Common kernel is good idea, need find which kernel from moto is newer, for defy+ or ml2. And use it as base.
[Milestone 2 Android Development] UEman:
As far as i know are all motorola devtrees almost identical, so why don't we just use the latest of those devices?
[Milestone 2 Android Development] skeevydude:
I'd assume that's the plan eventually. Find the latest Moto OMAP3630 kernel and modify it enough to be universal for us all.

@Quarx

I've downloaded the Bravo Kernel from sourceforge and I'm curious on which config I should use to try it out. The omap3630 config? And would dd if=/dev/mmcblk1p12 of=/sdcard/devtree.img be the correct Bravo devtree to use? I'm already using that devtree, still didn't boot, but like you said earlier, these kernels aren't compatible for the Bravo (or Defy) yet.

Thanks.

PS -- I'm also curious cause I'd like to compile deadline as a module as well :) and I'm not sure which default configuration is the best one to use.
[Milestone 2 Android Development] Quarx:
@skeevy420, For bravo the same Mapphone_defconfig.

You can use devtree smg from sbf or from dd(cat).
[Milestone 2 Android Development] tezet:
Guys, do you know what is the format of devtree? I used to look at the contents some time ago, but I forgot how I did it :)
[Milestone 2 Android Development] m11kkaa:
with an hex-editor? xd
[Milestone 2 Android Development] royale1223:
Use dtc (device tree compiler) in ubuntu repositories. Input format should be devtree folder. You can obtain output as dts (device tree source).

http://manpages.ubuntu.com/manpages/lucid/man1/dtc.1.html

Ps : i haven't tested this. So please let me know if it works. Also it would be nice if you upload dts. Happy coding..

Edit : there's also a patch to dtc that allows input in hexdump format.
[Milestone 2 Android Development] josuearisty:
Excellent good to know this, thanks for working with our bravo, is really great how both defy and bravo have identical hardware and share lots of software stuffs.

This should be the greastest thing that have happened to us moto users since.... I dont remember! :-p
[Milestone 2 Android Development] dangpzanco:
It works, I did this under a chrooted Ubuntu 12.04 on my M2:

root@localhost:~/devtree# dtc -I fs -O dts -o dts.a -f /proc/device-tree
DTC: fs->dts on file "/proc/device-tree"
ERROR (name_properties): "name" property in /System@0/Keypad@0 is incorrect ("umts_milestone2-keypad" instead of base node name)
Warning: Input tree has errors, output forced

I think that error should not be a big problem.

Beawere that the kernel I'm using is CH GingerBread leak.

http://db.tt/GvOu3Jk1
[Milestone 2 Android Development] royale1223:
Thanks for the dts. I'm glad to know that it works. What I'm curious though is if devtree.smg is actually a dtb file (device tree binary) and whether it could be used directly as input to dtc.
[Milestone 2 Android Development] czechop:
It's strange. At my system if it crashes, it happens at bootanimation 95% of times.

Have you changed something(as compared with the version dated 04 Septempter) in init.*.rc in your system? In the ramdisk I provided I've merged motorola init scripts with the 2nd-init ones(so that to not load 2nd-init on top of 2ndboot).

No, there is no console output in this kernel. If I enable console output(I've to comment out few things in kernel, to make console output work), then the radio does not seem to work(eventough the usb finds it):)
[Milestone 2 Android Development] czechop:
I guess that initially you can take ramdisk provided by motorola(use dd to dump boot.img partion). Check this link how to unpack it:

http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

Later on you can merge/replace it with the 2ndinit scripts/processes

Regarding devtree, I used the from sbf(for milestone2 it's in cg61). I then checked the size it should have(as the cg61 was quite huge) in the dmesg(somewhere at the begining there should be line saying what devtree size was passed to kernel), and then truncate at this lenght. I would be wise then to check with dtc if what you get is really a devtree:D
[Milestone 2 Android Development] czechop:
It turned out that it was a problem with permissions(as Quarx and kabaldan suggested:) )... I've changed init.*.rc files in ramdisk, but forgot to update ueventd.rc:)

Hmm, at my tests it never booted if started manually(altough it was reaching bootanimation).

The slowness looks similar as when you first time boot after clean cache... so perhaps it indeed has something to do with it
[Milestone 2 Android Development] czechop:
Did you find this in /data/kpanic?

Altough it does not boot frequently on milestone2, I haven't seen any crash data.
[Milestone 2 Android Development] czechop:
At my system just after boot some DownloadManager process(don't know what this is for) takes most of the cpu, but if I kill it, then the phone is quite responsive:)

BTW, could you check if GPS is working for you(once it boots)? It does not for me, so I'm not sure if it doesn't have something to do with my playing with init/uevent.rc scripts :)
[Milestone 2 Android Development] Quarx:
I comment out "wakelock_stats_show" and set "return 0". I'll add check for NULL.

Now in 95% it booted without errors.

Waiting for RIL patch:)
[Milestone 2 Android Development] czechop:
Lucky you:D

You should try to play at some lottery;)
[Milestone 2 Android Development] Quarx:
@czechop, can you explain how to use emu-uart via micro usb?

I tried set 1 in 2ndboot.ko, but pc found unreachable device.
[Milestone 2 Android Development] czechop:
Wow, 95% is a quite good score:) Where is this wakelock_stats_show?

And does this increase the boot speed? Or it is still veeeery slow?

BTW, I've just updated first post with RIL patch. You can skip this czecho_get_descriptors and printks:)
[Milestone 2 Android Development] Quarx:
Thanks for patch:)

Speed of boot is good, but android works some slowly, than on stock kernel.

wakelock_stats_show: https://github.com/Quarx2k/jordan-kernel/blob/2.6.32/kernel/power/wakelock.c#L121

i leave only return 0.. for first time.
[Milestone 2 Android Development] czechop:
I presume that you do have the uart<->usb converter?

If so, then at your pc set the speed of the usb serial(my cable presents itself as /dev/ttyUSB0) to 11500. Use this:

stty -F /dev/your_device 115200

Edit 2ndboot.sh script, and add emu_uart=1 parameter when insmoding 2ndboot.ko

Now if you cat /dev/your_device and start 2ndboot, you should get console output until "uncompressing linux...". Later outputs would require recompiling kernel with CONFIG_DEBUG_LL(if I remember correctly) flag set, and also some modification to the kernel(will try to find them, and post)

Anyway, you should check first if you are getting some output at all... it was tricky to find how to enable those for milestone2(as the way differs from the one milestone1 has), so don't know how about defy.
[Milestone 2 Android Development] Quarx:
After apply path for ril: http://pastebin.com/NRi1rDy8
[Milestone 2 Android Development] czechop:
Can you diff your kernel source with the MILS2_U6_4.1-22?

Have you enabled some special features in kernel config?