Post Reply

Android Smart TV Box M6 - AML8726-MX - G18REF - XBMC Native Linux - Hints

OP ak_dev

16th June 2014, 12:11 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Jun 2014
Hi guys,
I don't have access to ROM forum yet so I posted a thread here. My intention is to clarify the process of flashing native Linux with XBMC to this box.

The reference thread is:
http://forum.xda-developers.com/show....php?t=2418029

What started my doubts was the information on checking the MTD layout before proceeding with the update. I have checked mine via ssh and it is different from what is posted on the above thread.

Mine is:
Code:
dev:    size   erasesize  name
mtd0: 00800000 00200000 "bootloader"
mtd1: 00400000 00200000 "ubootenv"
mtd2: 00800000 00200000 "logo"
mtd3: 00800000 00200000 "aml_logo"
mtd4: 00800000 00200000 "recovery"
mtd5: 00800000 00200000 "boot"
mtd6: 40600000 00200000 "system"
mtd7: 20000000 00200000 "cache"
mtd8: 10000000 00200000 "backup"
mtd9: 18c600000 00200000 "userdata"
which is same as the author's of this thread:
http://forum.xda-developers.com/show....php?t=2492843

I have also checked the contents of the zip file from the first cited thread (the "updater-script" file in particular) and it looks like the only MTD partitions that are modified are: boot, system and logo.

I want to build the system myself from sources using what is already available on the Internet (probably using croniccorey's repo).

That being said, my questions are:
1. Is it safe to update the box to Native Linux? Are mtd0 (bootloader) and mtd4 (recovery) partitions left intact during update? If so, there should be no risk of bricking the device.

2. How is booting to recovery done? What I have already found is that the detection of the pressed-during-power-on button is done in the bootloader phase. So if the bootloader stays at mtd0 of the NAND flash and I accidentaly erease that partition, I brick the device with no chance to get to recovery mode. Am I right?

3. Does AM8726-MX try to boot from other than default devices if NAND boot fails? If so, It would be possible to copy U-boot to SD card and start from there. I can't find the processor's datasheet neither the schematics of G18ref board.

4. Is there a way to find the offset of a particular MTD partition in running system with no source knowledge? Using cat /proc/mtd I only get partition sizes. Partitions may follow each other with unused space in between, so if my real MTD layout differs from what I have in the updated system, I may have troubles (e.x. I may overwrite the recovery partition writing to boot partition)

5. From the config file of G18ref board:
https://github.com/CoreTech-Developm..._mx2_defconfig
and the board configuration file:
https://github.com/CoreTech-Developm.../board-m6g18.c
I can see that some NOR flash is used (CONFIG_AMLOGIC_SPI_NOR=y). If so, what about the fact that my bootloader has a partition on NAND (mtd0). Or maybe mtd0 and mtd1 belong to NOR flash and the rest (mtd2..9) are NAND partitions?


I am confused. Would appreciate help.
Regards, ak_dev.
17th June 2014, 07:04 PM   |  #2  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Jun 2014
So far I have found the answers for:
Quote:

4. Is there a way to find the offset of a particular MTD partition in running system with no source knowledge? Using cat /proc/mtd I only get partition sizes. Partitions may follow each other with unused space in between, so if my real MTD layout differs from what I have in the updated system, I may have troubles (e.x. I may overwrite the recovery partition writing to boot partition)

Simply by finding it in dmesg, for example:
Code:
dmesg | grep -C 20 mtd
I have tried finding the info in /sys, but it looks like there is no offset information there

Quote:

5. From the config file of G18ref board:
and the board configuration file:
I can see that some NOR flash is used (CONFIG_AMLOGIC_SPI_NOR=y). If so, what about the fact that my bootloader has a partition on NAND (mtd0). Or maybe mtd0 and mtd1 belong to NOR flash and the rest (mtd2..9) are NAND partitions?

No signs of SPI NOR flash in the system yet...
From dmesg, I can see that mtd0 and mtd1 are created on same NAND as other partitions.

But another question arised.

dmesg reports:
Code:
[    4.133286@0] Creating 9 MTD partitions on "B revision NAND 8GiB MT29F64G08CBABA":
(...)
[    4.157462@0] 0x000002400000-0x000002c00000 : "recovery"
(...)
But in the board-m6g18.c file there is a definition for recovery partition:
Code:
{
        .name = "recovery",
        .offset = 64*SZ_1M+40*SZ_1M,
        .size = 8*SZ_1M,
}
64*SZ_1M+40*SZ_1M = 0x6800000
Why the offsets don't match? Wrong board config file? Don't think so...

And still, I can't find answers to other questions...
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Upgrading, Modifying and Unlocking by ThreadRank