Reg: Openwrt for AT91SAM9x25

This forum is for users of Atmel's SAM Series and who are interested in using Linux OS.

Moderator: nferre

tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Reg: Openwrt for AT91SAM9x25

Thu Feb 09, 2017 4:42 am

Hi,

i am trying to compile openwrt for at91sam9x25 (http://armdevs.com/Product/CORE9X25.html) , but im getting kernel panic error,,Please help me..

i followed steps to compile:

git clone https://github.com/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make V=s

cd bin/at91/
dd if=openwrt-at91-legacy-AT91SAM9G25EK-rootfs.tar.gz of=./rootfs.img

i followed steps to flash kernel:

LOAD LINUX KERNEL
-----------------
nand erase 0x200000 0x600000

tftp 0x22000000 openwrt-at91-legacy-9x25ek-uImage

nand write 0x22000000 0x200000 <size>

/****************************************************************************************/
LOAD LINUX FILESYSTEM
---------------------
nand erase 0x800000 0xF800000

tftp 0x20000000 rootfs.img

nand write.trimffs 0x20000000 0x800000 <size>

/****************************************************************************************/
LOAD DTB
--------
nand erase 0x180000 0x80000

tftp 0x21000000 at91sam9g25ek.dtb

nand write 0x21000000 0x180000 <size>

-------
Please help me anyone...
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Reg: Openwrt for AT91SAM9x25

Thu Feb 16, 2017 1:34 am

tganeshg8 wrote:... but im getting kernel panic error,,Please help me...
Then you need to post the salient details about that panic.
And don't double post.

Regards
tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Re: Reg: Openwrt for AT91SAM9x25

Tue Feb 28, 2017 12:35 pm

U-Boot 2012.10-svn283 (Jun 25 2014 - 19:41:41)

CPU: AT91SAM9G25
Crystal frequency: 12 MHz
CPU clock : 400 MHz
Master clock : 133.333 MHz
I2C: ready
DRAM: 128 MiB
WARNING: Caches not enabled
NAND: 256 MiB
MMC: mci: 0
In: serial
Out: serial
Err: serial
EEPROM: Invalid ID (00 00 00 00)
Net: macb0
USB: scanning bus for devices... 1 USB Device(s) found
0 Storage Device(s) found
USB upgrade initialize USB failed.
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x180000, size 0x80000
524288 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x600000
Skipping bad block 0x004c0000
6291456 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
Image Name: OpenWrt ARM 4.4.14
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1557815 Bytes = 1.5 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Kernel Image ... OK
OK
Loading Device Tree to 27ddd000, end 27de6a36 ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.4.14 (ganesh@hpTestPc) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 50104) ) #4 Wed Feb 22 04:31:41 UTC 2017
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine model: Atmel AT91SAM9G25-EK
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
[ 0.000000] Kernel command line: root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 124848K/131072K available (3258K kernel code, 106K rwdata, 1184K rodata, 156K init, 194K bss, 6224K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc8800000 - 0xff800000 ( 880 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc045edb4 (4444 kB)
[ 0.000000] .init : 0xc045f000 - 0xc0486000 ( 156 kB)
[ 0.000000] .data : 0xc0486000 - 0xc04a08f0 ( 107 kB)
[ 0.000000] .bss : 0xc04a08f0 - 0xc04d1124 ( 195 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] clocksource: pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14334453866 ns
[ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[ 0.070000] Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070000] CPU: Testing write buffer coherency: ok
[ 0.070000] Setting up static identity map for 0x20008400 - 0x2000843c
[ 0.100000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.100000] pinctrl core: initialized pinctrl subsystem
[ 0.100000] NET: Registered protocol family 16
[ 0.100000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.100000] AT91: Detected SoC family: at91sam9x5
[ 0.100000] AT91: Detected SoC: at91sam9g25, revision 1
[ 0.120000] gpio-at91 fffff400.gpio: at address c8852400
[ 0.120000] gpio-at91 fffff600.gpio: at address c8854600
[ 0.120000] gpio-at91 fffff800.gpio: at address c8856800
[ 0.120000] gpio-at91 fffffa00.gpio: at address c8858a00
[ 0.130000] pinctrl-at91 ahb:apb:pinctrl@fffff400: initialized AT91 pinctrl driver
[ 0.610000] clocksource: Switched to clocksource pit
[ 0.610000] NET: Registered protocol family 2
[ 0.610000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.610000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.610000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.610000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.610000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.610000] NET: Registered protocol family 1
[ 0.620000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.670000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.670000] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.680000] io scheduler noop registered
[ 0.680000] io scheduler deadline registered (default)
[ 0.680000] fffff200.serial: ttyS0 at MMIO 0xfffff200 (irq = 16, base_baud = 8333333) is a ATMEL_SERIAL
[ 1.030000] console [ttyS0] enabled
[ 1.040000] f801c000.serial: ttyS1 at MMIO 0xf801c000 (irq = 30, base_baud = 8333333) is a ATMEL_SERIAL
[ 1.060000] atmel_nand 40000000.nand: Use On Flash BBT
[ 1.060000] atmel_nand 40000000.nand: Failed to request DMA channel
[ 1.070000] atmel_nand 40000000.nand: No DMA support for NAND access.
[ 1.080000] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xda
[ 1.080000] nand: Samsung NAND 256MiB 3,3V 8-bit
[ 1.090000] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 1.100000] atmel_nand 40000000.nand: can't detect min. ECC, assume 2 bits in 512 bytes
[ 1.100000] atmel_nand 40000000.nand: Initialize PMECC params, cap: 2, sector: 512
[ 1.120000] Bad block table not found for chip 0
[ 1.120000] Bad block table not found for chip 0
[ 1.130000] Scanning device for bad blocks
[ 1.130000] Bad eraseblock 38 at 0x0000004c0000
[ 1.150000] Bad eraseblock 175 at 0x0000015e0000
[ 1.170000] Bad eraseblock 330 at 0x000002940000
[ 1.180000] Bad eraseblock 463 at 0x0000039e0000
[ 1.220000] Bad eraseblock 764 at 0x000005f80000
[ 1.230000] Bad eraseblock 851 at 0x000006a60000
[ 1.270000] Bad eraseblock 1274 at 0x000009f40000
[ 1.320000] Bad eraseblock 1810 at 0x00000e240000
[ 1.340000] Bad eraseblock 1952 at 0x00000f400000
[ 1.350000] Bad block table written to 0x00000ffe0000, version 0x01
[ 1.360000] Bad block table written to 0x00000ffc0000, version 0x01
[ 1.370000] 5 ofpart partitions found on MTD device atmel_nand
[ 1.370000] Creating 5 MTD partitions on "atmel_nand":
[ 1.380000] 0x000000000000-0x000000040000 : "at91bootstrap"
[ 1.390000] 0x000000040000-0x0000000c0000 : "u-boot"
[ 1.400000] 0x0000000c0000-0x000000200000 : "U-Boot Env"
[ 1.410000] 0x000000200000-0x000000800000 : "kernel"
[ 1.420000] 0x000000800000-0x000020000000 : "rootfs"
[ 1.420000] mtd: partition "rootfs" extends beyond the end of device "atmel_nand" -- size truncated to 0xf800000
[ 1.440000] mtd: device 4 (rootfs) set to be root filesystem
[ 1.440000] mtdsplit: no squashfs found in "rootfs"
[ 1.450000] libphy: MACB_mii_bus: probed
[ 1.470000] macb f802c000.ethernet eth0: Cadence MACB rev 0x0001010c at 0xf802c000 irq 35 (f6:bc:f7:4b:79:08)
[ 1.480000] macb f802c000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=f802c000.etherne:01, irq=-1)
[ 1.490000] AT91: Starting after software reset
[ 1.500000] at91sam9_wdt: enabled (heartbeat=15 sec, nowayout=0)
[ 1.500000] atmel_mci f0008000.mmc: version: 0x504
[ 1.510000] atmel_mci f0008000.mmc: using PIO
[ 1.510000] atmel_mci f0008000.mmc: No vmmc regulator found
[ 1.520000] atmel_mci f0008000.mmc: No vqmmc regulator found
[ 1.560000] atmel_mci f0008000.mmc: Atmel MCI controller at 0xf0008000 irq 29, 1 slots
[ 1.570000] NET: Registered protocol family 10
[ 1.580000] NET: Registered protocol family 17
[ 1.580000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 1.600000] 8021q: 802.1Q VLAN Support v1.8
[ 1.610000] ubi0: attaching mtd1
[ 1.610000] ubi0: scanning is finished
[ 1.620000] ubi0 error: ubi_read_volume_table: the layout volume was not found
[ 1.620000] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -22
[ 1.630000] UBI error: cannot attach mtd1
[ 1.630000] hctosys: unable to open rtc device (rtc0)
[ 1.650000] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,4): error -19
[ 1.660000] Please append a correct "root=" boot option; here are the available partitions:
[ 1.660000] 1f00 256 mtdblock0 (driver?)
[ 1.670000] 1f01 512 mtdblock1 (driver?)
[ 1.670000] 1f02 1280 mtdblock2 (driver?)
[ 1.680000] 1f03 6144 mtdblock3 (driver?)
[ 1.680000] 1f04 253952 mtdblock4 (driver?)
[ 1.690000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
[ 1.690000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.14 #4
[ 1.690000] Hardware name: Atmel AT91SAM9
[ 1.690000] Backtrace:
[ 1.690000] [<c0015fc0>] (dump_backtrace) from [<c00161bc>] (show_stack+0x18/0x1c)
[ 1.690000] r7:c047b858 r6:c7ab5000 r5:ffffffed r4:c7ab5000
[ 1.690000] [<c00161a4>] (show_stack) from [<c01a6aa4>] (dump_stack+0x20/0x28)
[ 1.690000] [<c01a6a84>] (dump_stack) from [<c001c94c>] (panic+0x84/0x1f0)
[ 1.690000] [<c001c8cc>] (panic) from [<c0460314>] (mount_block_root+0x20c/0x270)
[ 1.690000] r3:5c96b434 r2:5c96b434 r1:c7831eec r0:c03e4892
[ 1.690000] r7:c047b858
[ 1.690000] [<c0460108>] (mount_block_root) from [<c04604f8>] (prepare_namespace+0x94/0x184)
[ 1.690000] r10:00000000 r9:c04a0910 r8:c04a0918 r7:c0484968 r6:c047b834 r5:c047b858
[ 1.690000] r4:c047b868
[ 1.690000] [<c0460464>] (prepare_namespace) from [<c045fe8c>] (kernel_init_freeable+0x184/0x1d8)
[ 1.690000] r5:00000027 r4:00000008
[ 1.690000] [<c045fd08>] (kernel_init_freeable) from [<c000e59c>] (kernel_init+0x10/0x104)
[ 1.690000] r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c000e58c r4:00000000
[ 1.690000] [<c000e58c>] (kernel_init) from [<c00095b0>] (ret_from_fork+0x14/0x24)
[ 1.690000] r5:c000e58c r4:00000000
[ 1.690000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
-------------------------------------------------------------------------------------------
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Reg: Openwrt for AT91SAM9x25

Wed Mar 01, 2017 11:49 pm

You have defined five MTD partitions for the NAND flash (using the Device Tree?):
tganeshg8 wrote:[ 1.370000] 5 ofpart partitions found on MTD device atmel_nand
[ 1.370000] Creating 5 MTD partitions on "atmel_nand":
[ 1.380000] 0x000000000000-0x000000040000 : "at91bootstrap"
[ 1.390000] 0x000000040000-0x0000000c0000 : "u-boot"
[ 1.400000] 0x0000000c0000-0x000000200000 : "U-Boot Env"
[ 1.410000] 0x000000200000-0x000000800000 : "kernel"
[ 1.420000] 0x000000800000-0x000020000000 : "rootfs"
[ 1.420000] mtd: partition "rootfs" extends beyond the end of device "atmel_nand" -- size truncated to 0xf800000
So presumably you want to use the MTD partition 4 as the root filesystem, since you named it "rootfs".

But your kernel command line is malformed in terms of specifying the rootfs.
tganeshg8 wrote:[ 0.000000] Kernel command line: root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
The kernel parameter "root=" is specified twice. The first instance is incorrect, and should be deleted.
The "ubi.mtd=" parameter specifies an incorrect partition number; it should be 4 instead of 1.
The corrections should be made to the bootargs environment variable in U-Boot.

Regards
tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Re: Reg: Openwrt for AT91SAM9x25

Thu Mar 02, 2017 6:26 am

Thanks for your reply...

This is my uboot config:

U-Boot> printenv
baudrate=115200
bootargs=console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw coherent_pool=1M video=800x480-16@60
bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootm 0x22000000 - 0x21000000
bootdelay=3
ethact=macb0
ethaddr=F6:BC:F7:4B:79:08
ipaddr=192.168.10.130
serverip=192.168.10.172


Here where i can modify...

i think the arguments are not taking from uboot
"root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs"
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Reg: Openwrt for AT91SAM9x25

Thu Mar 02, 2017 9:42 pm

tganeshg8 wrote:i think the arguments are not taking from uboot
The Linux kernel can be configured to use one of three modes for the kernel command line.
In menuconfig, Boot options ---> Kernel command line type, the choices are:
- Use bootloader kernel arguments if available,
- Extend bootloader kernel arguments, or
- Always use the default kernel command string.

Apparently the kernel you are using is configured to always use the command string defined in the kernel.
Reconfigure the kernel to use the first choice.

Regards
tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Re: Reg: Openwrt for AT91SAM9x25

Sun Mar 05, 2017 8:47 am

i changed the values of bootargs as following types

rootfstype=ubifs ubi.mtd=4 root=ubi0:rootfs rw
rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw
rootfstype=ubifs ubi.mtd=4 root=ubi4:rootfs rw
console=ttyS0,115200 root=/dev/mtdblock0 rw rootfstype=ubifs ubi.mtd=0 root=ubi0:rootfs
console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
console=ttyS0,115200 root=/dev/mtdblock2 rw rootfstype=ubifs ubi.mtd=2 root=ubi0:rootfs
console=ttyS0,115200 root=/dev/mtdblock3 rw rootfstype=ubifs ubi.mtd=3 root=ubi0:rootfs
console=ttyS0,115200 root=/dev/mtdblock4 rw rootfstype=ubifs ubi.mtd=4 root=ubi0:rootfs
console=ttyS0,115200 root=/dev/mtdblock7 rw rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs


But still same problem....

but tried with option in menuconfig ,i enabled Target Image --> ramdisk--> with compression none.. for this i did't get that problem(kernel panic), but shell prompt is not coming ..

Please any idea...
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Reg: Openwrt for AT91SAM9x25

Tue Mar 07, 2017 4:04 am

tganeshg8 wrote:Please any idea...
If you're going to ignore my previous advice, what's the purpose of more?
tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Re: Reg: Openwrt for AT91SAM9x25

Tue Mar 07, 2017 5:24 pm

@blue_z ...

I'm trying your suggestions only. Please don't mistake me ...
I just tried another way that's it..

I tried with my maximum effort.. but could't..
I hope you (only) can help for this..

Thank you.
blue_z
Location: USA
Posts: 1507
Joined: Thu Apr 19, 2007 10:15 pm

Re: Reg: Openwrt for AT91SAM9x25

Wed Mar 08, 2017 2:26 am

tganeshg8 wrote:I tried with my maximum effort.. but could't..
I don't know what that means, and I'm not going to speculate on what you "tried".
I provided concise advice with verbatim text that is copied from the kernel menuconfig screens.
You, on the other hand, write generalities that provide little information.
It's your obligation to clearly explain what you "tried" if you want help.
http://www.catb.org/esr/faqs/smart-questions.html
tganeshg8
Posts: 9
Joined: Fri May 27, 2016 2:43 pm

Re: Reg: Openwrt for AT91SAM9x25

Wed Mar 08, 2017 9:45 am

Thanks for your reply..

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest