• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 11
Booting Linux in a f16ref board with AMLOGIC 8736-M3 processor
#16
(2013-01-20, 23:02)davilla Wrote: 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

Thanks Davilla. Still getting the same issue with the bootargs command line not being passed to the kernel by the look of it?

I had to modify your suggestions a bit - and have a few area I'm confused by which may be significant.

My default printenv in uBoot on start-up before I do anything is :
Code:
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
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
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
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=u-boot-aml-ucl.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
stdin=serial
stdout=serial
stderr=serial
ethact=Apollo EMAC
outputmode=480i
upgrade_step=2

Environment size: 1418/8188 bytes
gd->env_addr: 0x8b8057d4

As you can see I don't have a loadlogoaddr defined, but looking at the line from my printenv
Code:
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
I take it this is 0x84100000 so have put in a line
Code:
setenv loadlogoaddr 0x84100000

I'm not sure this line
Code:
setenv temp1 nohltmem=${memsize} mac=${ethaddr}
works as I can't find a memsize variable already defined in my env. Am assuming I can
Code:
setenv memsize=1024M


After doing this I end up with the following when I printenv
Code:
bootcmd=run nandboot
bootdelay=1
baudrate=115200
ethaddr=00:01:02:65:04:75
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
720poutputwidth=1280
720poutputheight=720
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
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=u-boot-aml-ucl.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
stdin=serial
stdout=serial
stderr=serial
ethact=Apollo EMAC
outputmode=480i
upgrade_step=2
serverip=192.168.1.16
gatewayip=192.168.1.254
ipaddr=192.168.1.17
loadlogoaddr=0x84100000
temp=logo=osd1,0x84100000,full,480i,full androidboot.resolution=720p resolution_size=1280,720
memsize=1024M
temp1=nohltmem=1024M mac=00:01:02:65:04:75
bootargs=rw noinitrd root=/dev/nfs nfsroot=192.168.1.16:/home/stephen/target,nfsvers=3 init=/sbin/init ip=192.168.1.17:192.168.1.16:192.168.1.254:255.255.255.0:target:eth0:off console=ttyS0,115200 a9_clk=600M clk81=187500000 nohltmem=1024M mac=00:01:02:65:04:75 logo=osd1,0x84100000,full,480i,full androidboot.resolution=720p resolution_size=1280,720

Environment size: 1785/8188 bytes

I reduced the clock rate back to 600M from 800M as that is what my previous bootargs had.

**EDIT Was trying to understand the "ip=" bit of the bootargs and looked up the kernel parameters. I think I've tweaked mine to be right :
Code:
ip=192.168.1.17:192.168.1.16:192.168.1.254:255.255.255.0:target:eth0:off

Where 192.168.1.17 is the IP address I want for my Amlogic box (have also tried 192.168.1.18), 192.168.1.16 is the IP address of my NFS server, 192.168.1.254 is my Gateway, eth0 is my adaptor and off means no Autoconf."
"target" is the hostname - but this shouldn't be significant for me? **

I can't execute the following line
Code:
nand read logo ${loadlogoaddr} ${logo_start} ${logo_size}

When I type it I get the nand help - I think the logo is not being understood - is it a variable that is not defined? Or is my uBoot missing this? I can drop the logo and it does something...

However I still get this line when I bootm
Code:
[    0.000000] Ignoring unrecognised tag 0x00000000
[    0.000000] Ignoring tag cmdline (using the default kernel command line)
which suggests the kernel is not getting the bootargs from uBoot ?

The boot process pauses here :
Code:
[    6.942351] yaffs: dev is 32505861 name is "mtdblock5" rw
[    6.947388] yaffs: passed flags ""
[    6.950823] yaffs2 check point failed.
for about 10 seconds

Then
Code:
[   18.761403] devtmpfs: error mounting -2
[   18.761436] init_post.
[   18.762879] Freeing init memory: 192K
[   18.766527] run_init_process /sbin/init.
[   18.770454] Failed to execute /sbin/init.  Attempting defaults...
[   18.776474] run_init_process /sbin/init.
[   18.780375] run_init_process /etc/init.
[   18.793219] run_init_process /bin/init.
[   18.838544] run_init_process /bin/sh.
/bin/sh: 8: No such file or directory
[   18.851537] Kernel panic - not syncing: Attempted to kill init!
which suggests to me it doesn't have any form of meaningful rootfs?

Anything obvious I'm doing wrong?

Apologies if this is taking up too much of your time. I'm trying to get somewhere - and slowly getting there...
Reply
#17
I want Pivos boxes to boot fast so I dial the initial clock to 800MHz.

"nand read logo ${loadlogoaddr} ${logo_start} ${logo_size}" you can drop that. It just loads the logo, "logo" is the logo partition.
Reply
#18
(2013-01-21, 01:28)davilla Wrote: "nand read logo ${loadlogoaddr} ${logo_start} ${logo_size}" you can drop that. It just loads the logo, "logo" is the logo partition.
Thanks davilla - it looked like it wasn't important.

Any idea why
Code:
bootargs=rw noinitrd root=/dev/nfs nfsroot=192.168.1.16:/home/stephen/target,nfsvers=3 init=/sbin/init ip=192.168.1.17:192.168.1.16:192.168.1.254:255.255.255.0:target:eth0:off console=ttyS0,115200 a9_clk=600M clk81=187500000 nohltmem=1024M mac=00:01:02:65:04:75 logo=osd1,0x84100000,full,480i,full androidboot.resolution=720p resolution_size=1280,720

appears to be ignored and a default kernel command line used instead?
Code:
[    0.000000] Ignoring unrecognised tag 0x00000000
[    0.000000] Ignoring tag cmdline (using the default kernel command line)
Reply
#19
Think I may have answered this myself. I've been compiling j1nx's Gbox build and the kernel config includes the line CONFIG_CMDLINE_FORCE=y - which means it won't take bootargs from uBoot? I'll need to try something else. Time to fork and play I guess?
Reply
#20
try on uboot command-line.

setenv bootargs=rw noinitrd root=/dev/nfs nfsroot=192.168.1.16:/home/stephen/target,nfsvers=3 init=/sbin/init ip=192.168.1.17:192.168.1.16:192.168.1.254:255.255.255.0:target:eth0:off console=ttyS0,115200 a9_clk=600M clk81=187500000 nohltmem=1024M mac=00:01:02:65:04:75 logo=osd1,0x84100000,full,480i,full androidboot.resolution=720p resolution_size=1280,720

tftpboot 0x82000000 uImage-m3;bootm 0x82000000


Also

static int __init parse_tag_cmdline(const struct tag *tag)
{
#if defined(CONFIG_CMDLINE_EXTEND)
strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
strlcat(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
#elif defined(CONFIG_CMDLINE_FORCE)
pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
#else
strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
#endif
return 0;
}

looks like you have CONFIG_CMDLINE_FORCE instead of CONFIG_CMDLINE_EXTEND enabled.


Reply
#21
Thanks davilla. Found the CONFIG_CMDLINE_FORCE bit - and rebuilt kernel without it.

Have now got the kernel booting and mounting a rootfs over NFS. Hurray! Also added the AVL6211 option and I now have a /dev/dvb/adapter0/frontend0

Next stage is to work out how to get XBMC running and then how to compile TV Headend (I've done this in debian and ubuntu with package managers - but never in a minimal environment... Any tips on how to proceed)

Thanks so much for your patience.

(BTW - is deleting the .stamp files in folders a good way of triggering a rebuild or is it horribly hacky?)
Reply
#22
deleting the .stamp files is the only way in buildroot proper Smile

But there is another way, say you want to do heavy xbmc dev, then you can repoint the git to your local dir with file://<full path>/.git . Then you can bump/build/bump/build and you don't have to worry about pushing back to github until you have what you want.

Another way is to stop or rm the init.d xbmc, install xbmc to another place in the nfs mount and run it from there.

#build side
sudo make install DESTDIR=/opt/aml-rootfs-m3/opt/xbmc-aml;sync

#m3 box side

/etc/init.d/S95xbmc stop

export HOME=/root
export XBMC_HOME=/opt/xbmc-aml/usr/share/xbmc
export PATH=$PATH:/opt/xbmc-aml/usr/bin
export LD_LIBRARY_PATH=/opt/xbmc-aml/usr/lib:/usr/local/lib:/usr/lib:/lib

/opt/xbmc-aml/usr/lib/xbmc/xbmc.bin --standalone




Reply
#23
Right - so next step was trying xbmc... Ever the optimist!

Got a couple of things reported that I need to look at I think :
Not sure if this is important?
Code:
[    5.915870] HDMI irq 0
[    5.918131] HDMI Error: Unkown HDMI Interrupt source Process_Irq
[    5.924129] HDMI DEBUG: hdmi_task_handle [1016]


Think this is to do with recovery flashing and can be ignored mainly - and looks to be part of S10 stuff, however the udev bit is significant isn't it? :
Code:
[    9.526184] run_init_process /sbin/init.
mount: mounting /usr.sqsh on /usr failed: No such file or direct[    9.945163] yaffs: dev is 32505859 name is "mtdblock3" rw
[    9.949531] yaffs: passed flags ""
ory
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.013196 seconds, 266.4MB/s
2880+0 records in
2880+0 records out
3686400 bytes (3.5MB) copied, 0.013225 seconds, 265.8MB/s
S10setup: remount / rw
S10setup: checking keys
S10setup: moving /etc
S10setup: moving /media
S10setup: mounting /tmp/userdata
[   10.741044] yaffs: dev is 32505863 name is "mtdblock7" rw
[   10.741070] yaffs: passed flags ""
[   10.744351] yaffs2 check point failed.
S10setup: remount / ro
S10setup: switching to ondemand
S10setup: done
Populating  using udev: udevd[107]: error: runtime directory '/run/udev' not writable, for now falling back to '/dev/.udev'
Don't think this is significant - just some IR keymapping not happening quite right? Possibly due to stuff above not mounting?
Code:
Starting XBMC...
config file has not supported parameter:fn_key_scancode=0x00

config file has not supported parameter:left_key_scancode=0x51

config file has not supported parameter:right_key_scancode=0x50

config file has not supported parameter:up_key_scancode=0x16

config file has not supported parameter:down_key_scancode=0x1a

config file has not supported parameter:ok_key_scancode=0x13

config file has not supported parameter:pageup_key_scancode=0x55

config file has not supported parameter:pagedown_key_scancode=0x54

However here it seems because XBMC is handling network config duties it is reconfiguring the IP address of my box using DHCP. Does this disrupt NFS (where my rootfs is mounted over the network? My NFS server is not tied to a specific client IP address)
Code:
ifdown: interface eth0 not configured
ifdown: interface wlan0 not configured
udhcpc (v1.17.4) started
Failed to kill daemon: No such file or directory
Sending discover...
Sending select for 192.168.1.123...
Lease of 192.168.1.123 obtained, lease time 86400
Failed to kill daemon: No such file or directory
(STUFF SNIPPED)
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.1.254

Then XBMC crashes with
Code:
xbmc.bin: /home/stephen/Amlogic/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.
(STUFF SNIPPED)
Aborted
XBMC crashed with exit code 134.  Respawning..
and finally I get
Code:
[   43.835560] nfs: server 192.168.1.16 not responding, still trying

If anything here screams - "Obvious - how can you be so stupid as to not have done XXX" then please let me know!
Reply
#24
"mount: mounting /usr.sqsh on /usr failed: No such file or directory" That's bad, you are dead at this point. usr.sqsh contains the entire /usr directory... Smile There is a very good reason reason for making /usr a sqsh file Smile bonus points as to why Smile Hint, what is the physical size of a zero block file ?


ignore -> "Populating using udev: udevd[107]: error: runtime directory '/run/udev' not writable, for now falling back to '/dev/.udev'" That's udev spewing useless messages.

Reply
#25
(2013-01-21, 15:59)davilla Wrote: "mount: mounting /usr.sqsh on /usr failed: No such file or directory" That's bad, you are dead at this point. usr.sqsh contains the entire /usr directory... Smile There is a very good reason reason for making /usr a sqsh file Smile bonus points as to why Smile Hint, what is the physical size of a zero block file ?

As ever - thanks Davilla. Is this related to this :
Code:
echo "S10setup: mounting /tmp/userdata"  
# find userdata via mtd partition name, mount it and bind to /root  
for i in `ls /dev/mtd* | grep -o "mtd[0-9]$"`; do
    if [[ "`cat /sys/devices/virtual/mtd/$i/name`" == "userdata" ]]; then
      USERDATA="/dev/"`ls /sys/devices/virtual/mtd/$i | grep -o mtdblock[0-9]`
      break
    fi
done
  mkdir -p /tmp/userdata
  mount -t yaffs2 $USERDATA /tmp/userdata
  mkdir -p /tmp/userdata/xios/root
  mount -o bind /tmp/userdata/xios/root /root

It looks like it is looking at NAND flash (/sys/devices/virtual/mtd/)? rather than NFS for my userdata stuff? As I'm hoping to leave the internal stuff completely untouched (apart from the uBoot Env eventually) I guess I'll need to find a way round this. I guess I could just put an SD card in the reader and use this for my userdata?

Should I comment this out - or am I going to have to find a way of mounting this to SD Card or my NFS rootfs?

Assume sqsh is being used to reduce the size of userdata as it is stored in relatively scarce NAND flash, and allows a single block of storage to be used incredibly efficiently (or so the info I can find suggests!)? As for the size of a zero block file. Umm... Is it much smaller inside sqsh than outside - does it take a block in "normal" fs - which could be quite a lot depending on the file system block size?
Reply
#26
no, userdata is on nand, it's where temp files are written like all XBMC prefs. / is mostly read only and nfs boot follow that rule.

are any of your nand partitons name 'userdata' ?
Reply
#27
Touch a zero byte file and it takes up one block size, which can be 16k to 32k depending on nand organization. /usr is filled with lots and lots of tiny files and when these are added up, you quickly blow past available nand space on the 'system' partition.
Reply
#28
(2013-01-21, 18:53)davilla Wrote: no, userdata is on nand, it's where temp files are written like all XBMC prefs. / is mostly read only and nfs boot follow that rule.

are any of your nand partitons name 'userdata' ?

Looking at a bootlog
Code:
[    2.552585] nand env: nand_env_probe.
[    2.556122] set nand parts for chip 4096MB
[    2.579813] Creating 8 MTD partitions on "B revision 26nm NAND 4GiB H27UBG8T2B":
[    2.581646] 0x000001400000-0x000001800000 : "ubootenv"
[    2.588418] 0x000001800000-0x000002800000 : "aml_logo"
[    2.597245] 0x000002800000-0x000003800000 : "recovery"
[    2.602633] 0x000003800000-0x000004c00000 : "boot"
[    2.609484] 0x000004c00000-0x000024c00000 : "system"
[    2.771792] 0x000024c00000-0x000030c00000 : "cache"
[    2.830703] 0x000030c00000-0x000050c00000 : "userdata"
[    2.987235] 0x000050c00000-0x000100000000 : "NFTL_Part"
[    5.095091] nftl initilize completely dev size: 0xa1e00000 5
[    5.095760]  avnftl8: unknown partition table
[    5.099551] nftl release flush cache data: 0

Looks like I do have a userdata partition?

So are you suggesting I can use my NAND userdata partition for XBMC without zapping any Android stuff (I'm keen to keep the box dual-booting) - or could I move it to NFS or SD card?

And was I almost right about a zero length file taking up a block?

Also - should I be manually editing defconfig files - or should I be making them in a "make menuconfig" type way?
Reply
#29
OK - so I've found usr.sqsh inside the update.img Android package and copied it to my NFS target.

So I now get :
Code:
[    9.676351] VFS: Mounted root (nfs filesystem) on device 0:14.
[    9.677061] devtmpfs: mounted
[    9.679607] init_post.
[    9.681947] Freeing init memory: 192K
[    9.685609] run_init_process /sbin/init.
[   10.224240] yaffs: dev is 32505859 name is "mtdblock3" rw
[   10.224273] 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.013141 seconds, 267.5MB/s
2880+0 records in
2880+0 records out
3686400 bytes (3.5MB) copied, 0.013262 seconds, 265.1MB/s
S10setup: remount / rw
S10setup: checking keys
S10setup: moving /etc
S10setup: moving /media
S10setup: mounting /tmp/userdata
[   11.298290] yaffs: dev is 32505863 name is "mtdblock7" rw
[   11.298315] yaffs: passed flags ""
[   11.301596] yaffs2 check point failed.
S10setup: remount / ro
S10setup: switching to ondemand
S10setup: done

No error message about "mount: mounting /usr.sqsh on /usr failed: No such file or directory" now - but something's still not right?

XBMC still crashes with the same error message.
Code:
xbmc.bin: /home/stephen/Amlogic/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.

However - I did add the AV6211 DVB-S2 support to my kernel make (along with the bit that accepts bootloader command lines), and added TVHeadend to the packages to install list. And if I stop XBMC running at bootup I can start TV Headend and it appears to see the tuner. Can't plug it into an LNB feed until tomorrow to see if it is actually working - but definitely better than a poke in the eye with a sharp stick.

But this is looking quite fun!
Reply
#30
looks like your nfs rootfs is incomplete, we populate it using rhe buildroot-linux tar file, in the below "/opt/aml-rootfs-m3" is the nfs share.

# on build side
sudo mkdir -p /opt/aml-rootfs-m3
sudo rm -rf /opt/aml-rootfs-m3/*
sudo tar -C /opt/aml-rootfs-m3 -xf /xbmc/pivosgroup/buildroot-linux-m3/output/images/rootfs.tar
sync
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 11

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