--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
2013/4/3 Qiang Yu <yuq...@gmail.com>
PS. the uboot config is:make CROSS_COMPILE=arm-linux-gnueabihf- EM6000_config
On Wed, Apr 3, 2013 at 3:41 PM, Qiang Yu <yuq...@gmail.com> wrote:
Hi guys,
Good news! The uboot can boot up on MTD nand. The boot0 is replaced by uboot SPL, then load uboot directly. The SPL and uboot all use my MTD nand driver. Code is here:
Let uboot use MTD driver is straight forword. But let SPL replace boot0 is not. boot0 lays in the first 128 pages of the nand flash chip. The first 64 pages are the same as the following 64 pages. I can't find raw boot0 in this area, so guess it is encrypted which I can't crack.
My tmp strategy is: replace boot0.bin in the pack tool provided by Allwinner with uboot SPL. Pack a firmware and burn into flash using livesuit. Then read out first 128 pages. The SPL will load the uboot image from the 1M offset. So I burn the dumped SPL to the begginning of the new flash, the uboot image to the 1M offset.
I will try to examine and see if I recognize anything there, could you attach your 'original' stock 1M of flash to compare?
Hereattaches the dumped 1M SPL image which is for 8K page chips. Other page size (2K, 4K) can use attached shell script to convert it.
Great! Have you found out where and how we can read DRAM parameters? So we could get rid of per board u-boot build..
Regards,Qiang
--
-Jari
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Do you mean the DDR part of the boot0 header? I dump and parse it from the original boot0 image and add it to SPL in tools/mksunxiboot.c.
Amazing work. I assume it's a read-only driver and performance limited (that is fine)?
On Wed, Apr 3, 2013 at 3:41 PM, Qiang Yu <yuq...@gmail.com> wrote:
Hi guys,
Good news! The uboot can boot up on MTD nand. The boot0 is replaced by uboot SPL, then load uboot directly. The SPL and uboot all use my MTD nand driver. Code is here:
I don't think this is the case.
Let uboot use MTD driver is straight forword. But let SPL replace boot0 is not. boot0 lays in the first 128 pages of the nand flash chip. The first 64 pages are the same as the following 64 pages. I can't find raw boot0 in this area, so guess it is encrypted which I can't crack.
boot0 is read from the BROM and BROM is limited by 20k filesize (for MMC, so I assume the same restriction is for NAND aswell, why use boot0 then). I haven't found any encrpytion/decryption/load-more reference in boot0. boot0 code is actually quite simple. Also BROM is only 32k in size, which doesn't leave a lot of room for decryption.
Nice hack :D some people smarter then me should look into this and see if we can do this without the hack.
My tmp strategy is: replace boot0.bin in the pack tool provided by Allwinner with uboot SPL. Pack a firmware and burn into flash using livesuit. Then read out first 128 pages. The SPL will load the uboot image from the 1M offset. So I burn the dumped SPL to the begginning of the new flash, the uboot image to the 1M offset.
So to summarize, you swap boot0.bin (64 pages) in the livesuit image; flash that, read 128 pages to have u-boot-spl + 64 pages of extra data? Maybe livesuit flashes boot0.bin twice? (like script.bin and script0.bin)
Now what I find odd, is that boot0.bin is 512 kiB (64 * 8k). u-boot-spl/boot0.bin should not be larger then 28 kiB. (or not much, unless nand driver takes up 500 kiB more then the mmc driver).
We know from hno's research [1] that stock nand boot0.bin is 24 kiB and boot1.bin is 221 kiB. So 512 kiB is way way to big for either/or. I don't know if we have a way to write anything there at the moment however, my knowledge lacks herein.
I will try to examine and see if I recognize anything there, could you attach your 'original' stock 1M of flash to compare?
Hereattaches the dumped 1M SPL image which is for 8K page chips. Other page size (2K, 4K) can use attached shell script to convert it.
Amazing work. I assume it's a read-only driver and performance limited (that is fine)?
On Wed, Apr 3, 2013 at 3:41 PM, Qiang Yu <yuq...@gmail.com> wrote:
Hi guys,
Good news! The uboot can boot up on MTD nand. The boot0 is replaced by uboot SPL, then load uboot directly. The SPL and uboot all use my MTD nand driver. Code is here:
It can do both read and write. I write it referencing the allwinner block nand driver. So it should reach the same performance as it in theory.
I don't think this is the case.
Let uboot use MTD driver is straight forword. But let SPL replace boot0 is not. boot0 lays in the first 128 pages of the nand flash chip. The first 64 pages are the same as the following 64 pages. I can't find raw boot0 in this area, so guess it is encrypted which I can't crack.
boot0 is read from the BROM and BROM is limited by 20k filesize (for MMC, so I assume the same restriction is for NAND aswell, why use boot0 then). I haven't found any encrpytion/decryption/load-more reference in boot0. boot0 code is actually quite simple. Also BROM is only 32k in size, which doesn't leave a lot of room for decryption.
I'm afraid NAND is not the same as MMC. I can't find the raw boot0 image in the dumped image.
Nice hack :D some people smarter then me should look into this and see if we can do this without the hack.
My tmp strategy is: replace boot0.bin in the pack tool provided by Allwinner with uboot SPL. Pack a firmware and burn into flash using livesuit. Then read out first 128 pages. The SPL will load the uboot image from the 1M offset. So I burn the dumped SPL to the begginning of the new flash, the uboot image to the 1M offset.
So to summarize, you swap boot0.bin (64 pages) in the livesuit image; flash that, read 128 pages to have u-boot-spl + 64 pages of extra data? Maybe livesuit flashes boot0.bin twice? (like script.bin and script0.bin)
Now what I find odd, is that boot0.bin is 512 kiB (64 * 8k). u-boot-spl/boot0.bin should not be larger then 28 kiB. (or not much, unless nand driver takes up 500 kiB more then the mmc driver).
We know from hno's research [1] that stock nand boot0.bin is 24 kiB and boot1.bin is 221 kiB. So 512 kiB is way way to big for either/or. I don't know if we have a way to write anything there at the moment however, my knowledge lacks herein.
I swap the boot0.bin in allwinner's firmware image build tool (lichee/buildroot/tools/pack/eGon/storage_media/nand/boot0.bin). It will use the fake boot0.bin to build a new firmware (include boot0.bin, boot1.bin, linux kernel, rootfs into a single file). Then I flash the whole firmware using livesuit. The dumped image shows the first 64 pages are the same as the following 64 pages, so it must be a backup not extra data.
The dumped image also shows no matter how large the flash chip page is, only the first 1024+96 bytes have valide data. So the data size is 64 * 1K = 64K
I don't know if other u-boot drivers actually do write (leaving it out would save space) and it would always only read anyway?On 03-04-13 12:19, Qiang Yu wrote:
Amazing work. I assume it's a read-only driver and performance limited (that is fine)?
On Wed, Apr 3, 2013 at 3:41 PM, Qiang Yu <yuq...@gmail.com> wrote:
Hi guys,
Good news! The uboot can boot up on MTD nand. The boot0 is replaced by uboot SPL, then load uboot directly. The SPL and uboot all use my MTD nand driver. Code is here:
It can do both read and write. I write it referencing the allwinner block nand driver. So it should reach the same performance as it in theory.
Yes, but as we see from hno's allwinner-info repository, where he extracted boot0, boot0 isn't that big.I don't think this is the case.
Let uboot use MTD driver is straight forword. But let SPL replace boot0 is not. boot0 lays in the first 128 pages of the nand flash chip. The first 64 pages are the same as the following 64 pages. I can't find raw boot0 in this area, so guess it is encrypted which I can't crack.
boot0 is read from the BROM and BROM is limited by 20k filesize (for MMC, so I assume the same restriction is for NAND aswell, why use boot0 then). I haven't found any encrpytion/decryption/load-more reference in boot0. boot0 code is actually quite simple. Also BROM is only 32k in size, which doesn't leave a lot of room for decryption.
I'm afraid NAND is not the same as MMC. I can't find the raw boot0 image in the dumped image.So 512 kiB x2 (for backup).
Nice hack :D some people smarter then me should look into this and see if we can do this without the hack.
My tmp strategy is: replace boot0.bin in the pack tool provided by Allwinner with uboot SPL. Pack a firmware and burn into flash using livesuit. Then read out first 128 pages. The SPL will load the uboot image from the 1M offset. So I burn the dumped SPL to the begginning of the new flash, the uboot image to the 1M offset.
So to summarize, you swap boot0.bin (64 pages) in the livesuit image; flash that, read 128 pages to have u-boot-spl + 64 pages of extra data? Maybe livesuit flashes boot0.bin twice? (like script.bin and script0.bin)
Now what I find odd, is that boot0.bin is 512 kiB (64 * 8k). u-boot-spl/boot0.bin should not be larger then 28 kiB. (or not much, unless nand driver takes up 500 kiB more then the mmc driver).
We know from hno's research [1] that stock nand boot0.bin is 24 kiB and boot1.bin is 221 kiB. So 512 kiB is way way to big for either/or. I don't know if we have a way to write anything there at the moment however, my knowledge lacks herein.
I swap the boot0.bin in allwinner's firmware image build tool (lichee/buildroot/tools/pack/eGon/storage_media/nand/boot0.bin). It will use the fake boot0.bin to build a new firmware (include boot0.bin, boot1.bin, linux kernel, rootfs into a single file). Then I flash the whole firmware using livesuit. The dumped image shows the first 64 pages are the same as the following 64 pages, so it must be a backup not extra data.Why * 1 k now? You said it was 8 k page chips and you where talking about pages.
The dumped image also shows no matter how large the flash chip page is, only the first 1024+96 bytes have valide data. So the data size is 64 * 1K = 64K
On Wed, Apr 3, 2013 at 7:07 PM, Oliver Schinagl <olive...@schinagl.nl> wrote:
I don't know if other u-boot drivers actually do write (leaving it out would save space) and it would always only read anyway?On 03-04-13 12:19, Qiang Yu wrote:
Amazing work. I assume it's a read-only driver and performance limited (that is fine)?
On Wed, Apr 3, 2013 at 3:41 PM, Qiang Yu <yuq...@gmail.com> wrote:
Hi guys,
Good news! The uboot can boot up on MTD nand. The boot0 is replaced by uboot SPL, then load uboot directly. The SPL and uboot all use my MTD nand driver. Code is here:
It can do both read and write. I write it referencing the allwinner block nand driver. So it should reach the same performance as it in theory.
SPL only read, but uboot may save env and do other write thing.
Yes, but as we see from hno's allwinner-info repository, where he extracted boot0, boot0 isn't that big.I don't think this is the case.
Let uboot use MTD driver is straight forword. But let SPL replace boot0 is not. boot0 lays in the first 128 pages of the nand flash chip. The first 64 pages are the same as the following 64 pages. I can't find raw boot0 in this area, so guess it is encrypted which I can't crack.
boot0 is read from the BROM and BROM is limited by 20k filesize (for MMC, so I assume the same restriction is for NAND aswell, why use boot0 then). I haven't found any encrpytion/decryption/load-more reference in boot0. boot0 code is actually quite simple. Also BROM is only 32k in size, which doesn't leave a lot of room for decryption.
I'm afraid NAND is not the same as MMC. I can't find the raw boot0 image in the dumped image.So 512 kiB x2 (for backup).
Nice hack :D some people smarter then me should look into this and see if we can do this without the hack.
My tmp strategy is: replace boot0.bin in the pack tool provided by Allwinner with uboot SPL. Pack a firmware and burn into flash using livesuit. Then read out first 128 pages. The SPL will load the uboot image from the 1M offset. So I burn the dumped SPL to the begginning of the new flash, the uboot image to the 1M offset.
So to summarize, you swap boot0.bin (64 pages) in the livesuit image; flash that, read 128 pages to have u-boot-spl + 64 pages of extra data? Maybe livesuit flashes boot0.bin twice? (like script.bin and script0.bin)
Now what I find odd, is that boot0.bin is 512 kiB (64 * 8k). u-boot-spl/boot0.bin should not be larger then 28 kiB. (or not much, unless nand driver takes up 500 kiB more then the mmc driver).
We know from hno's research [1] that stock nand boot0.bin is 24 kiB and boot1.bin is 221 kiB. So 512 kiB is way way to big for either/or. I don't know if we have a way to write anything there at the moment however, my knowledge lacks herein.
I swap the boot0.bin in allwinner's firmware image build tool (lichee/buildroot/tools/pack/eGon/storage_media/nand/boot0.bin). It will use the fake boot0.bin to build a new firmware (include boot0.bin, boot1.bin, linux kernel, rootfs into a single file). Then I flash the whole firmware using livesuit. The dumped image shows the first 64 pages are the same as the following 64 pages, so it must be a backup not extra data.Why * 1 k now? You said it was 8 k page chips and you where talking about pages.
The dumped image also shows no matter how large the flash chip page is, only the first 1024+96 bytes have valide data. So the data size is 64 * 1K = 64K
Yes 8K page. But only the first 1K+96B in a page contains valide data, others are 0xff. So do 2K and 4K page chips.
--
--
You received this message because you are subscribed to a topic in the Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linux-sunxi/KJ4YL_NzhWw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linux-sunxi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.