• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 11
Booting Linux in a f16ref board with AMLOGIC 8736-M3 processor
#1
As suggested,

I'm starting a thread in order to collect information available for those of us interested in booting linux in our f16ref based devices.

j1nx suggested creating a vfat partition on an SD and copying a kernel renamed as uImage_recovery, and running the device in "recovery mode", by starting it with the reset button pressed. This has not worked for me, so i did follow a tutorial on creating a recovery card for meson 3 processors, which includes burning a u-boot image, creating a partition starting on cylinder 3 and creating a fat filesystem, restoring the partition table (destroyed after burning the uboot image) and copying a kernel image in the vfat partitions.

I've used both u-boot binary "u-boot-aml-ucl.bin" and kernel binary "uImage" found on google, but i can't get them to work.

System boots up normally with android as if no card was on the slot.

Is there any specific source to get binaries for this board or will i have to compile them myself?

I case only sources are available, where can I get the u-boot sources for this board?


Thanks a lot!




Reply
#2
Full source code for the midnight is in a torrent here http://mgnet.me/AtTm
Reply
#3
I'm working on a slightly different approach. I have an AMLogic M3 based DVB-S2 Android set top box (same as http://dvbdroid.info ) with a UART interface connected to the J2 header seen in the photos there (my model came with a header already soldered)

I'm trying to avoid altering the SPI and NAND flash in the box and instead edit the uBoot environment to get it to boot a Linux Kernel and XBMC rootfs from SD card (so that I can revert to Android quickly)

I have a kernel booting - but it isn't quite right (xbmc crashes)

More info in the old GBox Midnight thread : http://forum.xbmc.org/showthread.php?tid...pid1299819

**EDIT - Which I paste below as others have suggested cross-linking threads may not be a great idea **
Quote:Managed to get a kernel to boot built with J1nx's Gbox code loaded manually from SD card using uBoot (uImage-2.6.34 on FAT32 first partition). Now need to know what bootargs to feed it to properly start xbmc from a rootfs on the ext3 formatted second partition of my SD card in ext3.

Running with the environment default of :

bootargs=root=/dev/cardblksd2 rw rootfstype=ext3 androidboot.resolution=720p rootwait init=/init console=ttyS0,115200n8 nohlt a9_clk=600M clk81=187500000 mem=1024m

Gets me a long way - but xbmc crashes reporting crash code 134.

The init=/init is wrong I'm pretty sure, but I'm wondering if the startup is looking for my rootfs - or something in the wrong place?

I'm obviously doing something wrong - or the gbox build isn't quite right for my box.

Code:
[    8.075376] init_post.
[    8.077416] Freeing init memory: 192K
[    8.081029] run_init_process /init.
[    8.084628] Failed to execute /init.  Attempting defaults...
[    8.090124] run_init_process /sbin/init.
[   13.374433] yaffs: dev is 32505859 name is "mtdblock3" rw
[   13.374468] yaffs: passed flags ""
mount: mounting /dev/mtdblock3 on /recovery failed: Invalid argument
chown: unknown user/group default:default
S10setup: init fb0, fb1
2880+0 records in
2880+0 records out
3686400 bytes (3.5MB) copied, 0.013237 seconds, 265.6MB/s
2880+0 records in
2880+0 records out
3686400 bytes (3.5MB) copied, 0.013319 seconds, 264.0MB/s
S10setup: remount / rw
[   13.565379] EXT3-fs (cardblksd2): using internal journal
S10setup: checking keys
generating rsa key... generating dsa key... S10setup: moving /etc
S10setup: moving /media
S10setup: mounting /tmp/userdata
[   18.336599] yaffs: dev is 32505863 name is "mtdblock7" rw
[   18.336625] yaffs: passed flags ""
[   18.339901] yaffs2 check point success.
[   18.365070] aml nand write failed at 103952
S10setup: remount / ro
[   21.083865] nftl creat stucture completely free blk: 5 erased blk: 1388
S10setup: switching to ondemand
S10setup: done
Populating  using udev: Segmentation fault
FAIL
done

This looks, to me, as if something is still trying to load stuff from the NAND flash in the box rather than the rootfs on the ext3 partition on the SD card? Suspect I need to make some changes other than just in the bootargs?

I also get this :
Code:
xbmc.bin: /home/stephen/buildroot-AmLogic/output/build/xbmc-68ef0273c1f62ac9b6bbd30b6974bd3e4abca5a3/xbmc/utils/MathUtils.h:166: int MathUtils::truncate_int(double): Assertion `x > static_cast<double>((-2147483647 - 1) / 2) - 1.0' failed.
Code:
Aborted
XBMC crashed with exit code 134.  Respawning..

(This looks like it might be a symptom rather than a cause?)

and this :
Code:
udhcpc (v1.17.4) started
Failed to kill daemon: No such file or directory

But not sure if they are relevant.

And huge apologies if this isn't the right place to post this stuff. I'm after pointers really - as this is a great learning experience for me.

Thanks as ever for everyone's amazing efforts with this stuff.
Reply
#4
hint: tfpt boot the kernel and nfs the file system. it's much, much faster than playing the SD card game.
Reply
#5
(2013-01-17, 06:08)davilla Wrote: hint: tfpt boot the kernel and nfs the file system. it's much, much faster than playing the SD card game.

Thanks Davilla - need to sort out some local networking issues before I can do that - but will definitely give it a go.

In the Pivos XBMC build-root rootfs tarball, is there any specific linkage to yaffs file systems or NAND flash mtd partitions I need to look at? (I notice from my bootlog that there is some yaffs and mtd stuff going on - but not sure if that is related to bootargs)
Reply
#6
hint: Rename /etc/init.d/S95xbmc /etc/init.d/not-S95xbmc until you can boot and get the file system up, then you can kick off xbmc.bin directly from an ssh command-line and see the actual reason why it crashes.

Bonus points for running XBMC under gdb which is present in the buildroot-linux filesystem.

Reply
#7
(2013-01-17, 13:15)noggin Wrote: In the Pivos XBMC build-root rootfs tarball, is there any specific linkage to yaffs file systems or NAND flash mtd partitions I need to look at? (I notice from my bootlog that there is some yaffs and mtd stuff going on - but not sure if that is related to bootargs)

not sure what you mean, /etc/init.d/S10setup contains all the prerun filesystem operations.

Note that "mount: mounting /dev/mtdblock3 on /recovery failed: Invalid argument" is for support of auto-updating the firmware from linux. We need to mount cache to cp over new firmware and kick off a reboot into recovery.
Reply
#8
Thanks Davilla. Still very much learning about this stuff. Thought the Sxx files in /etc/init.d/ were important - just not quite sure how! Your help is greatly appreciated.
Cheers!

So far I've been compiling in a VM under OS X (my fastest machine is a Sandy Bridge i7 Hackintosh) - but I've just ordered an SSD and 2TB HD to give me a native Linux dev environment I can boot into on that machine. Should make developing slightly easier.

Davilla - would you suggest I fork the Pivos or J1nx depository for my work on this? I'm new to this - and will need to make some changes - and knowing the best way to contribute would be useful.
Reply
#9
for f16ref work, I would fork J1nx depository, but please do keep pivos in mind in feeding back changes. Pivos is 'upstream' Smile
Reply
#10
(2013-01-19, 18:24)davilla Wrote: for f16ref work, I would fork J1nx depository, but please do keep pivos in mind in feeding back changes. Pivos is 'upstream' Smile

Thanks - not promising I'll get anywhere - but worth knowing where to start. It's all a great learning process.
Reply
#11
(2013-01-17, 22:17)noggin Wrote: Davilla - would you suggest I fork the Pivos or J1nx depository for my work on this? I'm new to this - and will need to make some changes - and knowing the best way to contribute would be useful.

I try/tried to setup my fork in such a way that any patch/bug fix/Change worth to Pivos can be pushed "upstream". As soon as I catched up on Pivos (if I ever will), all bug reports and fixes can then be pushed as soon as the arise.

Whatever repository you are going to fork, try to do the same.
Reply
#12
(2013-01-17, 06:08)davilla Wrote: hint: tfpt boot the kernel and nfs the file system. it's much, much faster than playing the SD card game.

Hi davilla

Have installed atftpd and configured it, but although I can ping the machine my tftp server is running on tftp loading the kernel times out.

*** EDIT : switched to tftpd-hpa and did a bit of fiddling and seem to have started to get somewhere. Please ignore for now ***
Reply
#13
OK - got a kernel loading via TFTP. However doing this in uBoot
Code:
8726M_ref # set ipaddr 192.168.1.17
8726M_ref # set serverip 192.168.1.16
8726M_ref # set gatewayip 192.168.1.254
8726M_ref # set bootargs 'root=/dev/nfs rw nfsroot=192.168.1.16:/home/stephen/Amlogic/buildroot-AmLogic/output/target rootwait init=/sbin/init console=ttyS0,115200n81 nohlt a9_clk=600M clk81=18750000 mem=1024m'
8726M_ref # tftp
Amlogic eth init
detected phy id=1
find net phy id=7c0f1
eth reset ok
MAC address is 00:01:02:65:04:75
duplex
100m
Using Apollo EMAC device
TFTP from server 192.168.1.16; our IP address is 192.168.1.17
Filename 'uImage'.
Load address: 0x82000000
Loading: *T #################################################################
     #################################################################
     #################################################################
     ################################################################
done
Bytes transferred = 3789719 (39d397 hex)
8726M_ref # bootm
I get the following :
Code:
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.34 (stephen@stephen-i7-Ubuntu) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #1 Sun Jan 20 12:45:03 GMT 2013
[    0.000000] CPU: ARMv7 Processor [412fc094] revision 4 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: AMLOGIC MESON3 8726M SKT SH
[    0.000000] Ignoring unrecognised tag 0x00000000
[    0.000000] Ignoring tag cmdline (using the default kernel command line)
[    0.000000] bankstart=0x8f200000, size=0x10d00000
[    0.000000] bankstart=0xa0000000, size=0x20000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] BUG: mapping for 0x84000000 at 0xc4000000 overlaps vmalloc space
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 214272
[    0.000000] Kernel command line: root=/dev/mtdblock5 rw rootfstype=yaffs2 init=/sbin/init rootwait console=ttyS0,115200n 8 no hlt a9_clk=600M clk81=187500000 mem=1024m mac=00:26:ea:99:73:ea
My bootargs are wrong aren't they - as the kernel command line I'm trying to send with an nfs file system is being ignored and a yaffs2 file system kernel command line being sent instead?
Reply
#14
m3:


setenv serverip 192.168.2.202
setenv gatewayip 192.168.2.1
setenv ipaddr 192.168.2.214
setenv temp logo=osd1,${loadlogoaddr},full,${outputmode},full androidboot.resolution=720p resolution_size=1280,720
setenv temp1 nohltmem=${memsize} mac=${ethaddr}
setenv bootargs rw noinitrd root=/dev/nfs nfsroot=192.168.2.202:/opt/aml-rootfs-m3,nfsvers=3 init=/sbin/init ip=192.168.2.215:192.168.2.202:192.168.2.1:255.255.255.0:target:eth0:off console=ttyS0,115200 a9_clk=800M clk81=187500k ${temp1} ${temp}

nand read logo ${loadlogoaddr} ${logo_start} ${logo_size}
tftpboot 0x82000000 uImage-m3;bootm 0x82000000

The 2nd part is the actual kernel boot.


you might do a 'printenv' to get the uboot command-line

Reply
#15
Extracted this from the uboot-wyst-a11.bin:

bootcmd=run nandboot bootdelay=1 baudrate=115200 ethaddr=00:01:02:65:04:75 ipaddr=10.18.9.97 serverip=10.18.9.113 gatewayip=10.18.9.1 netmask=255.255.255.0 hostname=arm_m3 bootfile=uImage loadaddr=0x82000000 testaddr=0x82400000 usbtty=cdc_acm console=ttyS2,115200n8 mmcargs=setenv bootargs console=${console} boardname=m3-oplay chipname=8726m outputmode=720p 720poutputwidth=1280 720poutputheight=720 bootargs=root=/dev/cardblksd2 rw rootfstype=ext3 androidboot.resolution=720p rootwait init=/init console=ttyS0,115200n8 nohlt a9_clk=600M clk81=187500000 mem=1024m mac=${ethaddr} nandargs=setenv bootargs rootfstype=ext3 androidboot.resolution=${outputmode} rootwait init=/init console=ttyS0,115200n8 nohlt logo=osd1,0x84100000,loaded,${outputmode} a9_clk=600M clk81=187500000 mem=1024m mac=${ethaddr} nandboot=run nandargs;
nand read ${normal_name} ${loadaddr} 0 ${normal_size};
bootm ${loadaddr} recoveryboot=echo Enter recovery mode...;
mmcinfo;
fatload mmc 0 ${loadaddr} ${recovery_path};
bootm ${loadaddr} bootloader_start=0 bootloader_size=60000 bootloader_path=uboot-wyst-a11.bin normal_name=boot normal_start=0x8800000 normal_size=0x800000 recovery_name=recovery recovery_start=0x6800000 recovery_size=0x800000 recovery_path=uImage_recovery logo_name=logo logo_start=0x4800000 logo_size=0x400000 aml_logo_name=aml_logo aml_logo_start=0x5800000 aml_logo_size=0x400000

Could you tell me why you added 200M to your a9_clk ?
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 11

Logout Mark Read Team Forum Stats Members Help
Booting Linux in a f16ref board with AMLOGIC 8736-M3 processor1