08-15-2012, 08:52 AM | #226 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
We do not need all the extra "manufacturer" support built into MfgTool. We only need the small subset built into usb_downloader. Last edited by geekmaster; 09-24-2012 at 07:52 PM. |
|
08-15-2012, 08:54 AM | #227 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
You should be able to use the custom u-boot images I built that are in the MfgTool Profiles folder, to select which bootmode to use when using this tool instead of MfgTool.
Last edited by geekmaster; 09-24-2012 at 07:54 PM. |
Advert | |
|
09-25-2012, 08:19 PM | #228 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Confirmed working
This is great! Thanks a lot, eureka - finally we don't need to jump through all those Windoze hoops anymore.
I just tried it, and it works smoothly. Just for reference again, here's what I did:
Spoiler:
Now here's the $ 10⁶ question: How will one be able to boot the KPW into USB recovery mode, if there's no physical "magic" button on the device? Of course I know it's all gonna be speculation because nobody has the device yet - just wondering how it could work in principle. Need to open the device? Or, maybe, a "really long press" of the power button? Morse codes with the power button? ... ? EDIT: For some reason, if you want to run it entirely through the configuration file (instead of giving a file from the command line), you need two lines for it to complete: Code:
KindleTouch hid,1024,0x70000000,256M,0xF8000000,128K img/main.bin:dcd,plug img/main.bin:jumpheader Last edited by ixtab; 09-25-2012 at 09:56 PM. |
09-25-2012, 09:22 PM | #229 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The magnet in the cover puts the device to sleep when closed, wakes it when open.
Hold magnet over that area of the device, wait for it to go to sleep, turn off power, turn on and hold power switch on - - **while** the magnet is still in-place. The above is speculation. Based on: Since the cover with the magnet is a "zipper close" case - - It would normally be unusual for someone to diddle with the power switch while the case was closed. At the moment, those are the only two known hardwired inputs (power switch and magnetic switch). |
09-25-2012, 10:33 PM | #230 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I did try rotations when I was searching for a DX magic key -- unsuccessfully. On kindles with sound, there is also headphone insertions/removal events (and keycodes). And because the Paperwhite uses low power consumption capacitive sensing, a screen touch may also be part of the "magic key" sequence. (More speculation)... |
|
Advert | |
|
09-25-2012, 10:35 PM | #231 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
We need to add the executables to the simple debricking sticky thread download links, and we need to make new versions of the guides (keeping the old ones) to use the new tools. We should allow doing it the old way (MfgTool) or the new way with the new tool. And again, thanks eureka! Things take awhile to gain momentum (more than a month, in this case). |
|
09-26-2012, 03:40 AM | #232 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
A few more thoughts on the imx_usb tool:
I can't for the life of me figure out why I can't access the DRAM. I looked at the Reference Manual (for convenience, the Memory map is on page 150, while the USB mode is on page 471). I have tried to fiddle around a bit with modifying some memory, the rationale being: if it's possible to upload an initrd in addition to a custom u-boot image (which would load that initrd), then we'd essentially be able to control the entire boot process, without having to write to the "disk" at all. So the first step was to simply try and upload something to the RAM - but it fails consistently. In fact, I seem to be able to access pretty much every memory location - with the exception of the DRAM I checked and double-checked it: the data going over the line is correct (you can simply #define DEBUG in the source file, and it'll dump reads and writes, so I could cross-check with the reference manual), but as soon as I even try to read 0x70000000, the result is libusb error -4 (LIBUSB_ERROR_NO_DEVICE). Does anyone have an explanation for this? Could it be that the DRAM isn't initialized yet? And if so... which options do we have? For now, it seems like the only region that we can really access is the 128kB of OCRAM starting at F8000000. That's obviously enough for putting u-boot in there, but not much more. Thinking aloud: maybe a custom u-boot that downloads a kernel using tftp could do... |
09-26-2012, 03:45 AM | #233 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
@ixtab: See the part where the DCD is set to null so that the built-in DCD is used from i.ROM?
You most likely have to download the DCD and perhaps the CSF needed to enable the DRAM before downloading and executing the "client" part of the communications code. (or, a U-Boot configured to init the DRAM when it starts up - - what you have found sounds like your downloading U-Boot into the SoC i.RAM). Sign-for and download the application note: AN3996.pdf from the Freescale site. Its one of their free documents that you have to sign-for (limited distribution). You might also want the source code to the R170_ATK_STD bundle; that plus the part number of the DRAM chip should let you find the "magic numbers" Last edited by knc1; 09-26-2012 at 03:51 AM. |
09-26-2012, 04:02 AM | #234 | ||
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Quote:
Initialization (writing to registers) could be made with the help of ordinary code or through DCD. And remember, just a part of 128kb of OCRAM is free for arbitrary use (refer to Reference Manual for details). |
||
09-26-2012, 04:19 AM | #235 | ||
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
At the moment, I'm completely overwhelmed by hundreds of new acronyms and completely confused by the structure of the u-boot source. The only thing I found so far is the include/configs/imx50_yoshi.h file (heck, I'm not even sure if that is the right one!), which seems to include the "scripts" (actually environment definitions) that are run on startup, and a bunch of #defines. But there isn't any actual code in there... so where is it? Quote:
Edit: I just realized that it's probably largely irrelevant, because there's none of our code being run - after all, the device is in USB Downloader mode, so that's *before* u-boot is even launched. And if the DRAM isn't accessible, then there's nothing we can do about it. Which means that the magic will have to be done from u-boot, so we're probably back to the tftp idea. But any hints about u-boot (or in particular, where to look for in the code if I want to enable that tftp stuff) are still welcome! Last edited by ixtab; 09-26-2012 at 04:52 AM. |
||
09-26-2012, 04:57 AM | #236 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
@ixtab: Sort of: The 128K you find usable is internal to the SoC.
The i.ROM code burned into the SoC only deals with things that are present on the SoC. (With a slight bending of that rule if using external USB device instead of the on-chip one.) I think (not actually confirmed by myself) that the i.ROM code has enabled the SPI controller, so that you have the choice of reading the SPI rom from the DRAM to get the DRAM setup specifics. If you haven't yet read AN3996.pdf, you will probably find that a better starting point than the U-Boot source. At least after reading AN3996.pdf you will recognize the CSF defines when you stumble across them (where ever they may be - I don't know). Brain Fart: Since the Java bytecode engine is in hardware, you might be able to do this all in Java at the "client" (Kindle) end of the communications link. Just don't forget to service the watchdog. Note: The K3Flasher is also a cross-platform application based on libusb - - It might be a better starting point than the application that is being discussed here. At least the original author is available at this site. |
09-26-2012, 05:50 AM | #237 | |||
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Quote:
Quote:
TFTP is OK, but you should fit whole U-Boot in that 72k. And what size is it now? I was planning to create Program Image including DCD for DRAM initialization and made of prepended small code for relocating initramfs and booting Linux kernel (no need for U-Boot, requirements for booting kernel on ARM are not easy but also not hard, they are doable in pretty small chunk of code), the Linux kernel itself and initramfs. |
|||
09-26-2012, 08:49 AM | #238 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
My custom u-boot images for Select Boot initialize the DRAM using the newer K5 u-boot code, which also supports the K4 (and other models). The K4 u-boot was stripped down, and did not have K5 support, so I did not use it.
Any app you upload would need to borrow the DRAM init code from the u-boot code in the amazon GPL. I recommend using the K5 u-boot code. There are actually two u-boots, the one used by Select Boot is the small one (not bist, no fastboot)) that does not use DRAM (but does initialize it for later use AFTER determining what init method to use after examining the idme SERIAL and PCBSN. Then it loads the larger u-boot bist from mmc into DRAM, so that fastboot can work, or the linux kernel can be loaded from mmc. So it is multi-stage (u-boot, then u-boot bist, then linux kernel). Any app that runs directly in DRAM would also need a small "bootstrap" (a very stripped down u-boot) to first load in internal SoC RAM, then init DRAM, then load the larger DRAM part of the app. You can see that u-boot also uses some self-relocating code, so it can start in internal RAM and move to DRAM after it is initialized. So, "bare hardware" native apps designed to run from USB Downloader mode need to init the hardware (and DRAM) themselves, in stages, before they can use it. At least that is my understanding of how this works when I was making the custom u-boot changes... EDIT: I see that yifanlu did exactly that. His code contains the "DRAM init" portion of u-boot. All "USB Downloader mode" apps need to do this too, as part of a multi-stage boot sequence, if they need to use DRAM. Tiny apps that fit in SoC RAM do not need DRAM, but that is very constrained. Perhaps a tiny remote debugger? Last edited by geekmaster; 05-29-2016 at 06:56 PM. |
09-26-2012, 02:55 PM | #239 | |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Code:
/*============================================================================= *init script for codex LPDDR1-200MHz CPU board *===========================================================================*/ Then, there is Enable all clocks code, but, I believe, all clocks are already enabled in boot process (BTW, PLL1 is set up at 800 MHz automatically too). It's according to chapters 6.4.3, 6.4.4 and tables 6-5 and 6-6 from Reference Manual. But I can be deadly wrong. And then there is a jump to DDR init code. Code is located at board/imx50_yoshi/ram_init.S. Search for label lpddr2_init: label mddr_init: at that source file (why mddr_init?). (Well, I was wrong. DDR intialization is expressed through code, not DCD commands. But anyway, process of writing to registers is perfectly mapped to DCD capabilities. If you're interested, look at chapter 6.6.2 of Reference Manual). Also, just to be clear, I was speaking about U-Boot from 5.1.2 sources. Last edited by eureka; 09-26-2012 at 06:10 PM. Reason: it's mddr_init, not lpddr2_init |
|
09-26-2012, 03:49 PM | #240 |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
And here are links about booting Linux kernel on ARM:
|
Tags |
debricking, kindle mx50 select boot |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bricked Kindle Touch; Won't boot into diags/fastboot | kerotan | Kindle Developer's Corner | 3 | 05-19-2012 10:58 AM |
Kindle Touch does not boot | marmomr | Kindle Developer's Corner | 38 | 05-16-2012 01:19 PM |
Kindle Touch select text, copy paste? | Zimmy | Amazon Kindle | 3 | 02-18-2012 08:45 AM |
Kindle Touch Won't Boot | teekay | Kindle Developer's Corner | 3 | 12-10-2011 12:51 AM |
Opus cannot boot, stuck on boot screen | baloma | Bookeen | 35 | 11-13-2010 04:20 AM |