PCI driver 'Oops: Kernel access of bad area' error - linux

I wanted to write a simple PCI express driver for Xilinx FPGA. But I am not able to request memory region for PCI.
Question is: How to claim that I/O memory area for custom driver. I want to write 3. byte of that area using driver.
Below are the details. What am I missing ? Thanks
1-) I am getting this error:
[ 4.345350] Unable to handle kernel paging request for data at address 0x00000005
[ 4.353978] Faulting instruction address: 0x80000000002c9370
[ 4.358337] Oops: Kernel access of bad area, sig: 11 [#1]
[ 4.362426] BE SMP NR_CPUS=24 CoreNet Generic
[ 4.365477] Modules linked in: fpgapcie(O+) ucc_uart
[ 4.369139] CPU: 0 PID: 1999 Comm: udevd Tainted: G O 4.19.26+gc0c2141 #1
[ 4.375924] NIP: 80000000002c9370 LR: 80000000002c9350 CTR: c00000000053acfc
[ 4.381753] REGS: c0000001ee2bb1c0 TRAP: 0300 Tainted: G O (4.19.26+gc0c2141)
[ 4.389146] MSR: 000000008002b000 <CE,EE,FP,ME> CR: 22228242 XER: 20000000
[ 4.394982] DEAR: 0000000000000005 ESR: 0000000000800000 IRQMASK: 0
GPR00: 80000000002c9350 c0000001ee2bb440 80000000002d1f00 000000000000001a
GPR04: 0000000000000001 000000000000022d c000000000f30548 c000000001013000
GPR08: 00000001fec37000 0000000000000003 0000000000000000 0000000000000020
GPR12: 0000000028228444 c000000001013000 0000000000020000 000000013c323ac8
GPR16: 000000013c323ae0 80000000002cc000 c000000000a194b0 c0000001f0eaa1c0
GPR20: 00000000006000c0 c000000000ed9da0 0000000000000000 0000000000000100
GPR24: 000000000000001c 000000000f700000 c0000001f3034880 0000000000000000
GPR28: c0000001f337b800 00000000000000f7 c0000001f337b8a0 0000000000000000
2-) Code piece in PCI probe function:
static int pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
int ret, minor;
struct cdev *cdev;
dev_t devno;
unsigned long pci_io_addr = 0;
/* add this pci device in pci_cdev */
if ((minor = pci_cdev_add(pci_cdev, MAX_DEVICE, dev)) < 0)
goto error;
/* compute major/minor number */
devno = MKDEV(major, minor);
/* allocate struct cdev */
cdev = cdev_alloc();
/* initialise struct cde
cdev_init(cdev, &pci_ops);
cdev->owner = THIS_MODULE;
/* register cdev */
ret = cdev_add(cdev, devno, 1);
if (ret < 0) {
dev_err(&(dev->dev), "Can't register character device\n");
goto error;
}
pci_cdev[minor].cdev = cdev;
dev_info(&(dev->dev), "%s The major device number is %d (%d).\n",
"Registeration is a success", MAJOR(devno), MINOR(devno));
dev_info(&(dev->dev), "If you want to talk to the device driver,\n");
dev_info(&(dev->dev), "you'll have to create a device file. \n");
dev_info(&(dev->dev), "We suggest you use:\n");
dev_info(&(dev->dev), "mknod %s c %d %d\n", DEVICE_NAME, MAJOR(devno), MINOR(devno));
dev_info(&(dev->dev), "The device file name is important, because\n");
dev_info(&(dev->dev), "the ioctl program assumes that's the\n");
dev_info(&(dev->dev), "file you'll use.\n");
/* enable the device */
pci_enable_device(dev);
/* 'alloc' IO to talk with the card */
if (pci_request_region(dev, BAR_IO, "IO-pci") == 0) {
printk(KERN_ALERT "The memory you requested from fpgapcie is already reserved by CORE pci driver.");
}
check that BAR_IO is *really* IO region
if ((pci_resource_flags(dev, BAR_IO) & IORESOURCE_IO) != IORESOURCE_IO) {
dev_err(&(dev->dev), "BAR2 isn't an IO region\n");
cdev_del(cdev);
goto error;
}
pci_io_addr = pci_resource_start(dev,BAR_IO);
printk(KERN_INFO "PCI start adress: %02X", &pci_io_addr);
outb(pci_io_addr+3, 5);
printk(KERN_INFO "Message from PCI device to user: 5");
return 1;
error:
printk(KERN_INFO "An error occuder while probing pci");
return 0;
}
3-) lspci -v output:
0001:01:00.0 Memory controller: Xilinx Corporation Device 7021
Subsystem: Xilinx Corporation Device 0007
Flags: bus master, fast devsel, latency 0, IRQ 41
Memory at c10000000 (32-bit, non-prefetchable) [size=2K]
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [100] Device Serial Number 00-00-00-01-01-00-0a-35
Kernel driver in use: yusufpci
Kernel modules: fpgapcie
4-) full dmesg:
[ 4.285663] Module pci init
[ 4.294787] yusufpci 0001:01:00.0: Registeration is a success The major device number is 247 (0).
[ 4.302367] yusufpci 0001:01:00.0: If you want to talk to the device driver,
[ 4.308116] yusufpci 0001:01:00.0: you'll have to create a device file.
[ 4.313516] yusufpci 0001:01:00.0: We suggest you use:
[ 4.317354] yusufpci 0001:01:00.0: mknod virtual_pci c 247 0
[ 4.321713] yusufpci 0001:01:00.0: The device file name is important, because
[ 4.327553] yusufpci 0001:01:00.0: the ioctl program assumes that's the
[ 4.332866] yusufpci 0001:01:00.0: file you'll use.
[ 4.336459] The memory you requested from fpgapcie is already reserved by CORE pci driver. This is not an error.
[ 4.336463] PCI start adress: EE2BB4B0
[ 4.345350] Unable to handle kernel paging request for data at address 0x00000005
[ 4.353978] Faulting instruction address: 0x80000000002c9370
[ 4.358337] Oops: Kernel access of bad area, sig: 11 [#1]
[ 4.362426] BE SMP NR_CPUS=24 CoreNet Generic
[ 4.365477] Modules linked in: fpgapcie(O+) ucc_uart
[ 4.369139] CPU: 0 PID: 1999 Comm: udevd Tainted: G O 4.19.26+gc0c2141 #1
[ 4.375924] NIP: 80000000002c9370 LR: 80000000002c9350 CTR: c00000000053acfc
[ 4.381753] REGS: c0000001ee2bb1c0 TRAP: 0300 Tainted: G O (4.19.26+gc0c2141)
[ 4.389146] MSR: 000000008002b000 <CE,EE,FP,ME> CR: 22228242 XER: 20000000
[ 4.394982] DEAR: 0000000000000005 ESR: 0000000000800000 IRQMASK: 0
GPR00: 80000000002c9350 c0000001ee2bb440 80000000002d1f00 000000000000001a
GPR04: 0000000000000001 000000000000022d c000000000f30548 c000000001013000
GPR08: 00000001fec37000 0000000000000003 0000000000000000 0000000000000020
GPR12: 0000000028228444 c000000001013000 0000000000020000 000000013c323ac8
GPR16: 000000013c323ae0 80000000002cc000 c000000000a194b0 c0000001f0eaa1c0
GPR20: 00000000006000c0 c000000000ed9da0 0000000000000000 0000000000000100
GPR24: 000000000000001c 000000000f700000 c0000001f3034880 0000000000000000
GPR28: c0000001f337b800 00000000000000f7 c0000001f337b8a0 0000000000000000
[ 4.453632] NIP [80000000002c9370] .pci_probe+0x220/0x2b4 [fpgapcie]
[ 4.458680] LR [80000000002c9350] .pci_probe+0x200/0x2b4 [fpgapcie]
[ 4.463639] Call Trace:
[ 4.464775] [c0000001ee2bb440] [80000000002c9350] .pci_probe+0x200/0x2b4 [fpgapcie] (unreliable)
[ 4.472262] [c0000001ee2bb500] [c0000000004b77c8] .pci_device_probe+0x11c/0x1f4
[ 4.478270] [c0000001ee2bb5a0] [c000000000561ebc] .really_probe+0x26c/0x38c
[ 4.483927] [c0000001ee2bb640] [c0000000005621ac] .driver_probe_device+0x78/0x154
[ 4.490106] [c0000001ee2bb6d0] [c0000000005623d8] .__driver_attach+0x150/0x154
[ 4.496025] [c0000001ee2bb760] [c00000000055f424] .bus_for_each_dev+0x94/0xdc
[ 4.501856] [c0000001ee2bb800] [c0000000005615fc] .driver_attach+0x24/0x38
[ 4.507426] [c0000001ee2bb870] [c000000000560ec8] .bus_add_driver+0x264/0x2a4
[ 4.513258] [c0000001ee2bb910] [c000000000563384] .driver_register+0x88/0x178
[ 4.519089] [c0000001ee2bb990] [c0000000004b5a68] .__pci_register_driver+0x50/0x64
[ 4.525355] [c0000001ee2bba00] [80000000002c9564] .pci_init_module+0xc0/0x444 [fpgapcie]
[ 4.532144] [c0000001ee2bba80] [c0000000000020b4] .do_one_initcall+0x64/0x224
[ 4.537978] [c0000001ee2bbb50] [c0000000000f443c] .do_init_module+0x70/0x260
[ 4.543722] [c0000001ee2bbbf0] [c0000000000f6564] .load_module+0x1e6c/0x2400
[ 4.549467] [c0000001ee2bbd10] [c0000000000f6d28] .__se_sys_finit_module+0xcc/0x100
[ 4.555819] [c0000001ee2bbe30] [c0000000000006b0] system_call+0x60/0x6c
[ 4.561127] Instruction dump:
[ 4.562785] e86a8080 38810070 f9210070 4800041d e8410028 e9210070 3d420000 e94a8088
[ 4.569231] 39290003 5529063e e94a0000 7c0004ac <992a0005> 39200001 3d420000 992d0684
[ 4.575854] ---[ end trace 2d15cff7ba1b3255 ]---

Problem solved. But when I write the third byte of Memory Mapped area, FPGA programmed to answer with lighting its GPIO leds. I tried to write first 15 byte of MMIO but it did not work. The leds did not lighted. But the code stopped giving errors.
I also cannot read the bytes on MMIO space using readb() function. It's
giving
unrecoverable machine check error
Problem solved using this code.
pci_request_regions(dev, "fpgapcie");
pci_io_startaddr = pci_resource_start(dev,BAR_IO);
pci_io_endaddr = pci_resource_end(dev,BAR_IO);
pci_io_size = pci_resource_len(dev,BAR_IO);
printk(KERN_INFO "Region start: %lX, Region end: %lX, Size: % lX",pci_io_startaddr,pci_io_endaddr,pci_io_size);
pci_io_addr = ioremap(pci_io_startaddr, pci_io_endaddr);
printk(KERN_INFO "PCI start adress: %lX", pci_io_addr);
for(i = 0;i<15;i++) /* Write first 15 byte */
{
writeb(2, pci_io_addr+i);
printk(KERN_INFO "%lX, Message from PCI device to user: 2", pci_io_addr+i);
}
and the dmesg output:
fpgapcie: loading out-of-tree module taints kernel.
fpgapcie 0001:01:00.0: Registeration is a success The major device number is 247 (0).
fpgapcie 0001:01:00.0: If you want to talk to the device driver,
fsl-fman-port ffe488000.port fm1-gb0: renamed from eth0
fpgapcie 0001:01:00.0: you'll have to create a device file.
fpgapcie 0001:01:00.0: We suggest you use:
fpgapcie 0001:01:00.0: mknod virtual_pci c 247 0
fpgapcie 0001:01:00.0: The device file name is important, because
fpgapcie 0001:01:00.0: the ioctl program assumes that's the
fpgapcie 0001:01:00.0: file you'll use.
Region start: 210000000, Region end: 2100007FF, Size: 800
PCI start adress: 8000080088900000
8000080088900000, Message from PCI device to user: 2
8000080088900001, Message from PCI device to user: 2
8000080088900002, Message from PCI device to user: 2
8000080088900003, Message from PCI device to user: 2
8000080088900004, Message from PCI device to user: 2
8000080088900005, Message from PCI device to user: 2
8000080088900006, Message from PCI device to user: 2
8000080088900007, Message from PCI device to user: 2
8000080088900008, Message from PCI device to user: 2
8000080088900009, Message from PCI device to user: 2
800008008890000A, Message from PCI device to user: 2
800008008890000B, Message from PCI device to user: 2
800008008890000C, Message from PCI device to user: 2
800008008890000D, Message from PCI device to user: 2
800008008890000E, Message from PCI device to user: 2

Related

Increasing initrd.gz size prevents kernel from booting

I have an ARM based embedded system with 1GB of memory. The kernel, dtb file and root filesystem (initrd.gz) are stored in a FIT file in flash. U-boot loads the FIT into ram and boots the kernel.
I'm having a problem where if I slightly increase the size of my root file system my system no longer boots and I can't figure out where I'm exceeding a memory boundary.
This configuration works (initrd.gz size ~30MB) u-boot output:
Booting using the fdt blob at 0x20683744
Loading Kernel Image ... OK
Loading Ramdisk to 8e1d0000, end 8ffffebd ... OK
Loading Device Tree to 8e1bf000, end 8e1cf118 ... OK
Kernel output:
[ 2.761235] RAMDISK: gzip image found at block 0
[ 5.345119] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
After increasing the size of initrd.gz this configuration doesn't work (initrd.gz size ~35MB):
Booting using the fdt blob at 0x20683744
Loading Kernel Image ... OK
Loading Ramdisk to 8dfc1000, end 8ffff795 ... OK
Loading Device Tree to 8dfb0000, end 8dfc0118 ... OK
This is the Kernel error I get when trying to use the larger initrd.gz:
[ 2.781244] RAMDISK: gzip image found at block 0
[ 5.731423] RAMDISK: EOF while reading compressed data
[ 5.739401] uncompression error
[ 6.192160] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
[ 6.200144] VFS: Mounted root (ext4 filesystem) on device 1:0.
[ 6.207089] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 64974
[ 6.218882] EXT4-fs (ram0): Remounting filesystem read-only
[ 6.225112] devtmpfs: error mounting -117
I have 1GB of ram starting at 0x80000000 and U-boot detects the right amount of memory:
DRAM: already initialized, 1 GiB (capacity:1024 MiB, VGA:0 MiB), ECC off
Kenel config of ramdisk size:
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=256000
Full U-boot and Kernel Log:
U-Boot SPL 2019.04 (Nov 24 2021 - 18:02:33 +0000)
Trying to boot from RAM
U-Boot 2019.04 (Nov 24 2021 - 18:02:33 +0000)
UnKnow-SOC: 5010203
RST: Power On
eSPI Mode: SIO:Enable : SuperIO-2e
Eth: MAC0: RMII/NCSI, MAC1: RMII/NCSI, MAC2: RMII/NCSI, MAC3: RMII/NCSI
Model: Aspeed BMC
DRAM: already initialized, 1 GiB (capacity:1024 MiB, VGA:0 MiB), ECC off
PCIE-0: Link down
MMC:
sdhci_slot0#100: 1, emmc_slot0#100: 0
Loading Environment from SPI Flash... SF: Detected mt25ql02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB
*** Warning - bad CRC, using default environment
In: serial#1e784000
Out: serial#1e784000
Err: serial#1e784000
Model: Aspeed BMC
adc 15 value = 0x385
board_rev: 3
Net:
Warning: ftgmac#1e660000 (eth0) using random MAC address - 12:2c:e3:e4:22:c7
eth0: ftgmac#1e660000
Warning: ftgmac#1e680000 (eth1) using random MAC address - fa:38:94:5e:b7:43
, eth1: ftgmac#1e680000
Hit any key to stop autoboot: 0
## Loading kernel from FIT Image at 20100000 ...
Using 'conf-1' configuration
Trying 'kernel-1' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x201000cc
Data Size: 5780952 Bytes = 5.5 MiB
Architecture: ARM
OS: Linux
Load Address: 0x80008000
Entry Point: 0x80008000
Verifying Hash Integrity ... OK
## Loading ramdisk from FIT Image at 20100000 ...
Using 'conf-1' configuration
Trying 'ramdisk-1' ramdisk subimage
Description: RAMDISK
Type: RAMDisk Image
Compression: uncompressed
Data Start: 0x206908e0
Data Size: 35515536 Bytes = 33.9 MiB
Architecture: ARM
OS: Linux
Load Address: unavailable
Entry Point: unavailable
Verifying Hash Integrity ... OK
## Loading fdt from FIT Image at 20100000 ...
Using 'conf-1' configuration
Trying 'fdt-1' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x20683754
Data Size: 53529 Bytes = 52.3 KiB
Architecture: ARM
Verifying Hash Integrity ... OK
Booting using the fdt blob at 0x20683754
Loading Kernel Image ... OK
Loading Ramdisk to 8de21000, end 8ffffc90 ... OK
Loading Device Tree to 8de10000, end 8de20118 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0xf00
[ 0.000000] Linux version 5.1.3 (aaron#aaron-VirtualBox) (gcc version 9.2.0 (GCC)) #20 SMP Wed Jan 5 14:22:25 CST 2022
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: AST2620 PSC
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 16 MiB at 0xbf000000
[ 0.000000] random: get_random_bytes called from start_kernel+0x9c/0x4e0 with crng_init=0
[ 0.000000] percpu: Embedded 17 pages/cpu s39820 r8192 d21620 u69632
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 243712
[ 0.000000] Kernel command line: console=ttyS4,115200n8 root=/dev/ram rw
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 911132K/983040K available (8192K kernel code, 512K rwdata, 1892K rodata, 1024K init, 194K bss, 55524K reserved, 16384K cma-reserved)
[ 0.000000] ftrace: allocating 28861 entries in 57 pages
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] scu-irq controller registered, irq 17
[ 0.000000] scu-irq controller registered, irq 18
[ 0.000000] arch_timer: cp15 timer(s) running at 1200.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x114c1bbbeec, max_idle_ns: 440795229572 ns
[ 0.000006] sched_clock: 56 bits at 1200MHz, resolution 0ns, wraps every 2199023255551ns
[ 0.000015] Switching to timer-based delay loop, resolution 0ns
[ 0.001364] Calibrating delay loop (skipped), value calculated using timer frequency.. 2400.00 BogoMIPS (lpj=12000000)
[ 0.001381] pid_max: default: 32768 minimum: 301
[ 0.001584] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001598] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.002112] *** VALIDATE proc ***
[ 0.002213] *** VALIDATE cgroup1 ***
[ 0.002224] *** VALIDATE cgroup2 ***
[ 0.002234] CPU: Testing write buffer coherency: ok
[ 0.002522] /cpus/cpu#0 missing clock-frequency property
[ 0.002538] /cpus/cpu#1 missing clock-frequency property
[ 0.002549] CPU0: thread -1, cpu 0, socket 15, mpidr 80000f00
[ 0.003326] Setting up static identity map for 0x80100000 - 0x80100060
[ 0.003436] rcu: Hierarchical SRCU implementation.
[ 0.004015] smp: Bringing up secondary CPUs ...
[ 0.004543] CPU1: thread -1, cpu 1, socket 15, mpidr 80000f01
[ 0.004678] smp: Brought up 1 node, 2 CPUs
[ 0.004690] SMP: Total of 2 processors activated (4800.00 BogoMIPS).
[ 0.004695] CPU: All CPU(s) started in SVC mode.
[ 0.005462] devtmpfs: initialized
[ 0.015183] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.015413] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.015436] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.016155] pinctrl core: initialized pinctrl subsystem
[ 0.016780] NET: Registered protocol family 16
[ 0.017796] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.019143] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.019159] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.034904] i2cg - base_clk0 : 1000000
[ 0.034974] i2cg - base_clk1 : 4000000
[ 0.035007] i2cg - base_clk2 : 10000000
[ 0.035030] i2cg - base_clk3 : 33333333
[ 0.035059] i2c global registered
[ 0.052820] vgaarb: loaded
[ 0.053173] SCSI subsystem initialized
[ 0.053462] usbcore: registered new interface driver usbfs
[ 0.053527] usbcore: registered new interface driver hub
[ 0.053629] usbcore: registered new device driver usb
[ 0.053777] EDAC MC: Ver: 3.0.0
[ 0.056747] clocksource: Switched to clocksource arch_sys_counter
[ 0.102558] NET: Registered protocol family 2
[ 0.103052] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[ 0.103077] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.103136] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.103232] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.103337] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.103383] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.103595] NET: Registered protocol family 1
[ 0.104121] RPC: Registered named UNIX socket transport module.
[ 0.104133] RPC: Registered udp transport module.
[ 0.104138] RPC: Registered tcp transport module.
[ 0.104142] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.104365] Trying to unpack rootfs image as initramfs...
[ 0.104959] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.230086] Freeing initrd memory: 34684K
[ 0.232404] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[ 0.232955] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.233298] jffs2: version 2.2. (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.238540] NET: Registered protocol family 38
[ 0.238631] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.240354] PCIE- Link down
[ 0.240394] aspeed-pcie 1e6ed200.pcie: host bridge /ahb/apb/pcie#1e6ed2000 ranges:
[ 0.240439] aspeed-pcie 1e6ed200.pcie: IO 0x00010000..0x0001ffff -> 0x00010000
[ 0.240463] aspeed-pcie 1e6ed200.pcie: MEM 0x70000000..0x7ffffffe -> 0x70000000
[ 0.240601] aspeed-pcie 1e6ed200.pcie: PCI host bridge to bus 0000:00
[ 0.240615] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.240625] pci_bus 0000:00: root bus resource [io 0x0000-0xffff] (bus address [0x10000-0x1ffff])
[ 0.240634] pci_bus 0000:00: root bus resource [mem 0x70000000-0x7ffffffe]
[ 0.244693] PCI: bus0: Fast back to back transfers disabled
[ 0.246332] aspeed-kcs-bmc: channel=1 addr=0xca0 idr=0x24 odr=0x30 str=0x3c
[ 0.247024] aspeed-kcs-bmc: channel=2 addr=0xca8 idr=0x28 odr=0x34 str=0x40
[ 0.247519] aspeed-kcs-bmc: channel=3 addr=0xca2 idr=0x2c odr=0x38 str=0x44
[ 0.249831] aspeed_jtag: driver successfully loaded.
[ 0.250549] aspeed_mctp: reset.
[ 0.251512] aspeed_mctp: driver successfully loaded.
[ 0.251843] aspeed_mctp 1e6f9000.mctp: no irq specified
[ 0.251924] aspeed_mctp: reset.
[ 0.252556] aspeed_mctp: driver successfully loaded.
[ 0.253971] Serial: 8250/16550 driver, 17 ports, IRQ sharing enabled
[ 0.259918] rts_gpio: 912
[ 0.260616] 1e783000.serial: ttyS0 at MMIO 0x1e783000 (irq = 55, base_baud = 115384) is a 16550A
[ 0.261593] 1e784000.serial: ttyS4 at MMIO 0x1e784000 (irq = 56, base_baud = 115384) is a 16550A
[ 0.963132] printk: console [ttyS4] enabled
[ 0.968571] rts_gpio: 913
[ 0.971997] 1e78d000.serial: ttyS1 at MMIO 0x1e78d000 (irq = 64, base_baud = 115384) is a 16550A
[ 0.982439] rts_gpio: 914
[ 0.985636] 1e78e000.serial: ttyS2 at MMIO 0x1e78e000 (irq = 65, base_baud = 115384) is a 16550A
[ 0.996096] rts_gpio: 984
[ 0.999323] 1e790000.serial: ttyS5 at MMIO 0x1e790000 (irq = 74, base_baud = 115384) is a 16550A
[ 1.009701] rts_gpio: 985
[ 1.012888] 1e790100.serial: ttyS6 at MMIO 0x1e790100 (irq = 75, base_baud = 115384) is a 16550A
[ 1.023277] rts_gpio: 986
[ 1.026465] 1e790200.serial: ttyS7 at MMIO 0x1e790200 (irq = 76, base_baud = 115384) is a 16550A
[ 1.036908] rts_gpio: 987
[ 1.040107] 1e790300.serial: ttyS8 at MMIO 0x1e790300 (irq = 77, base_baud = 115384) is a 16550A
[ 1.066850] timeriomem_rng 1e6e2524.hwrng: 32bits from 0x(ptrval) # 1us
[ 1.075683] brd: module loaded
[ 1.085457] loop: module loaded
[ 1.102789] aspeed_espi: driver successfully loaded.
[ 1.109342] aspeed espi oob loaded
[ 1.114069] aspeed espi-flash loaded
[ 1.118894] aspeed espi-vw loaded
[ 1.123077] no host mapping address
[ 1.127638] aspeed espi-peripheral loaded
[ 1.133917] Uniform Multi-Platform E-IDE driver
[ 1.139157] ide-gd driver 1.18
[ 1.143380] aspeed-smc 1e620000.spi: bus_width 4, Using 50 MHz SPI frequency
[ 1.151375] aspeed-smc 1e620000.spi: mt25ql02g (262144 Kbytes)
[ 1.157905] aspeed-smc 1e620000.spi: CE0 window [ 0x20000000 - 0x30000000 ] 256MB
[ 1.166274] aspeed-smc 1e620000.spi: CE1 window [ 0x30000000 - 0x30000000 ] 0MB (disabled)
[ 1.175514] aspeed-smc 1e620000.spi: read control register: [406c0641]
[ 1.231003] 2 fixed-partitions partitions found on MTD device bmc
[ 1.237840] Creating 2 MTD partitions on "bmc":
[ 1.242900] 0x000000000000-0x0000000f0000 : "u-boot"
[ 1.249735] 0x0000000f0000-0x000000100000 : "u-boot-env"
[ 1.258061] fmc_spi 1e631000.spi: controller is unqueued, this is deprecated
[ 1.265961] fmc_spi_setup() cs: 0, spi->mode 0 spi->max_speed_hz 10000000 , spi->bits_per_word 8
[ 1.275894] spi_ctrl 1000600
[ 1.279315] fmc_spi 1e631000.spi: fmc_spi : driver loaded
[ 1.285718] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[ 1.295321] libphy: mdio-aspeed: probed
[ 1.317527] libphy: mdio-aspeed: probed
[ 1.337571] libphy: Fixed MDIO Bus: probed
[ 1.342821] CAN device driver interface
[ 1.347342] fmc_spi_setup() cs: 0, spi->mode 0 spi->max_speed_hz 10000000 , spi->bits_per_word 8
[ 1.357277] spi_ctrl 1000600
[ 1.366718] random: fast init done
[ 1.376060] mcp251x spi0.0 can0: MCP2515 successfully initialized.
[ 1.383412] ftgmac100 1e660000.ftgmac: Read MAC address 12:2c:e3:e4:22:c7 from chip
[ 1.706721] Micrel KSZ9031 Gigabit PHY 1e650000.mdio-1:01: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=1e650000.mdio-1:01, irq=POLL)
[ 1.722810] ftgmac100 1e660000.ftgmac eth0: irq 40, mapped at (ptrval)
[ 1.730423] ftgmac100 1e680000.ftgmac: Read MAC address fa:38:94:5e:b7:43 from chip
[ 1.966759] random: crng init done
[ 2.056721] Micrel KSZ9031 Gigabit PHY 1e650008.mdio-1:02: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=1e650008.mdio-1:02, irq=POLL)
[ 2.072798] ftgmac100 1e680000.ftgmac eth1: irq 41, mapped at 5781ec99
[ 2.080378] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 2.087688] ehci-pci: EHCI PCI platform driver
[ 2.092720] ehci-platform: EHCI generic platform driver
[ 2.098831] uhci_hcd: USB Universal Host Controller Interface driver
[ 2.106844] usbcore: registered new interface driver usb-storage
[ 2.114566] aspeed-rtc 1e781000.rtc: registered as rtc0
[ 2.120701] i2c /dev entries driver
[ 2.125785] I2C: i2c-bus [0]: adapter [100 khz]
[ 2.131948] I2C: i2c-bus [1]: adapter [100 khz]
[ 2.138084] I2C: i2c-bus [2]: adapter [100 khz]
[ 2.144187] I2C: i2c-bus [3]: adapter [100 khz]
[ 2.150371] I2C: i2c-bus [4]: adapter [100 khz]
[ 2.156494] I2C: i2c-bus [5]: adapter [100 khz]
[ 2.162623] I2C: i2c-bus [6]: adapter [100 khz]
[ 2.168811] I2C: i2c-bus [7]: adapter [100 khz]
[ 2.175180] dt: /memory node resources: first page r.start=0x80000000, resource_size=0x40000000, PAGE_SHIFT macro=0xc
[ 2.187201] EDAC MC0: Giving out device to module aspeed-edac controller MIC: DEV 1e6e0000.sdram (INTERRUPT)
[ 2.199022] sdhci: Secure Digital Host Controller Interface driver
[ 2.205926] sdhci: Copyright(c) Pierre Ossman
[ 2.210801] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.218349] sdhci-aspeed 1e740100.sdhci: Configuring for slot 0
[ 2.225083] devm_gpio_request pwr fail
[ 2.229396] devm_gpio_request pwr sw fail
[ 2.286744] mmc1: SDHCI controller on 1e740100.sdhci [1e740100.sdhci] using PIO
[ 2.295792] sdhci-aspeed 1e750100.sdhci: Configuring for slot 0
[ 2.356732] mmc0: SDHCI controller on 1e750100.sdhci [1e750100.sdhci] using ADMA
[ 2.383950] ASPEED Crypto Accelerator successfully registered
[ 2.401745] ASPEED RSA Accelerator successfully registered
[ 2.408446] usbcore: registered new interface driver usbhid
[ 2.414669] usbhid: USB HID core driver
[ 2.426826] aspeed_adc: trim 8
[ 2.431344] aspeed_adc: cv 6
[ 2.435474] aspeed_adc: trim 8
[ 2.440023] aspeed_adc: cv 8
[ 2.444788] peci-aspeed 1e78b000.peci-bus: peci bus 0 registered, irq 63
[ 2.453654] NET: Registered protocol family 10
[ 2.459779] Segment Routing with IPv6
[ 2.464342] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 2.471701] NET: Registered protocol family 17
[ 2.476681] can: controller area network core (rev 20170425 abi 9)
[ 2.483668] NET: Registered protocol family 29
[ 2.488654] can: raw protocol (rev 20170425)
[ 2.493416] can: broadcast manager protocol (rev 20170425 t)
[ 2.499747] can: netlink gateway (rev 20170425) max_hops=1
[ 2.505935] 8021q: 802.1Q VLAN Support v1.8
[ 2.510714] Registering SWP/SWPB emulation handler
[ 2.523358] liteon-pmc pmc: added a shelf FRU device
[ 2.583924] mmc0: Tuning failed, falling back to fixed sampling clock
[ 2.591583] mmc0: new HS200 MMC card at address 0001
[ 2.597851] mmcblk0: mmc0:0001 4FPD3R 3.64 GiB
[ 2.603214] mmcblk0boot0: mmc0:0001 4FPD3R partition 1 4.00 MiB
[ 2.610176] mmcblk0boot1: mmc0:0001 4FPD3R partition 2 4.00 MiB
[ 2.617078] mmcblk0rpmb: mmc0:0001 4FPD3R partition 3 512 KiB, chardev (246:0)
[ 2.626207] mmcblk0: p1 p2 p3
[ 2.776758] liteon-pmc pmc: Driver initialized
[ 2.782163] printk: console [netcon0] enabled
[ 2.787065] netconsole: network logging started
[ 2.792396] aspeed-rtc 1e781000.rtc: hctosys: unable to read the hardware clock
[ 2.801284] RAMDISK: gzip image found at block 0
[ 2.921922] uncompression error
[ 2.972435] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
[ 2.980416] VFS: Mounted root (ext4 filesystem) on device 1:0.
[ 2.987294] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 64974
[ 2.999086] EXT4-fs (ram0): Remounting filesystem read-only
[ 3.005312] devtmpfs: error mounting -117
[ 3.012546] Freeing unused kernel memory: 1024K
[ 3.047716] Checked W+X mappings: passed, no W+X pages found
[ 3.054041] Run /sbin/init as init process
[ 3.058946] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 145588
[ 3.070854] Starting init: /sbin/init exists but couldn't execute it (error -117)
[ 3.079216] Run /etc/init as init process
[ 3.083933] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 16411
[ 3.095740] Starting init: /etc/init exists but couldn't execute it (error -117)
[ 3.104009] Run /bin/init as init process
[ 3.108741] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 81107
[ 3.120551] Starting init: /bin/init exists but couldn't execute it (error -117)
[ 3.128827] Run /bin/sh as init process
[ 3.133153] EXT4-fs error (device ram0): ext4_lookup:1576: inode #2: comm swapper/0: deleted inode referenced: 81107
[ 3.144969] Starting init: /bin/sh exists but couldn't execute it (error -117)
[ 3.153044] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 3.168864] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.1.3 #20
[ 3.175465] Hardware name: Generic DT based system
[ 3.180806] Backtrace:
[ 3.183544] [<8010e5fc>] (dump_backtrace) from [<8010e880>] (show_stack+0x20/0x24)
[ 3.191993] r7:809fa93c r6:60000093 r5:00000000 r4:80c6c0a4
[ 3.198311] [<8010e860>] (show_stack) from [<808af8ac>] (dump_stack+0x8c/0xa0)
[ 3.206373] [<808af820>] (dump_stack) from [<80121b78>] (panic+0x124/0x2f0)
[ 3.214139] r7:809fa93c r6:80c11e84 r5:00000000 r4:80c80648
[ 3.220456] [<80121a58>] (panic) from [<808c74b0>] (kernel_init+0x11c/0x124)
[ 3.228320] r3:80c09c48 r2:00000000 r1:3dc34000 r0:809fa93c
[ 3.234628] r7:00000000
[ 3.237452] [<808c7394>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[ 3.245896] Exception stack(0xbe0e5fb0 to 0xbe0e5ff8)
[ 3.251530] 5fa0: 00000000 00000000 00000000 00000000
[ 3.260654] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 3.269778] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 3.277154] r5:808c7394 r4:00000000
[ 3.281145] CPU0: stopping
[ 3.284164] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.1.3 #20
[ 3.290764] Hardware name: Generic DT based system
[ 3.296103] Backtrace:
[ 3.298832] [<8010e5fc>] (dump_backtrace) from [<8010e880>] (show_stack+0x20/0x24)
[ 3.307278] r7:00000000 r6:60000193 r5:00000000 r4:80c6c0a4
[ 3.313593] [<8010e860>] (show_stack) from [<808af8ac>] (dump_stack+0x8c/0xa0)
[ 3.321653] [<808af820>] (dump_stack) from [<80111668>] (handle_IPI+0x340/0x374)
[ 3.329904] r7:00000000 r6:00000000 r5:00000004 r4:80c80508
[ 3.336219] [<80111328>] (handle_IPI) from [<80102230>] (gic_handle_irq+0x84/0x88)
[ 3.344667] r10:80b5da40 r9:80c00000 r8:80c01ed8 r7:c0803000 r6:c0802000 r5:c080200c
[ 3.353401] r4:80c0a304 r3:80109afc
[ 3.357388] [<801021ac>] (gic_handle_irq) from [<80101a6c>] (__irq_svc+0x6c/0x90)
[ 3.365733] Exception stack(0x80c01ed8 to 0x80c01f20)
[ 3.371365] 1ec0: 00000000 000015f0
[ 3.380491] 1ee0: be7b18a0 8011c500 80c00000 00000000 80c09c70 80c09cac 80c71405 80a020d0
[ 3.389616] 1f00: 80b5da40 80c01f34 80c01f38 80c01f28 80109afc 80109b00 60000013 ffffffff
[ 3.398741] r9:80c00000 r8:80c71405 r7:80c01f0c r6:ffffffff r5:60000013 r4:80109b00
[ 3.407385] [<80109ab8>] (arch_cpu_idle) from [<808ceef4>] (default_idle_call+0x30/0x3c)
[ 3.416415] [<808ceec4>] (default_idle_call) from [<80154524>] (do_idle+0xe8/0x168)
[ 3.424960] [<8015443c>] (do_idle) from [<80154870>] (cpu_startup_entry+0x28/0x2c)
[ 3.433407] r9:80c80280 r8:80c09c40 r7:80c80280 r6:ffffffff r5:00000001 r4:000000c9
[ 3.442049] [<80154848>] (cpu_startup_entry) from [<808c738c>] (rest_init+0xb8/0xc0)
[ 3.450691] [<808c72d4>] (rest_init) from [<80b00b94>] (arch_call_rest_init+0x18/0x1c)
[ 3.459521] r5:00000001 r4:80c802d8
[ 3.463509] [<80b00b7c>] (arch_call_rest_init) from [<80b0109c>] (start_kernel+0x4a4/0x4e0)
[ 3.472827] [<80b00bf8>] (start_kernel) from [<00000000>] ( (null))
[ 3.479923] WDT reset called
BP
Root cause of issue:
It looks like ASPEED modified the low level memmove function in /lib/string.c to speed up flash copies. In their code, count is changed to a 4 byte boundary which breaks the back to front copy from memmove_wd.
#ifdef CONFIG_ASPEED_SPI_DMA
if (dest == src)
return dest;
if (
((u32)src >= ASPEED_FMC_CS0_BASE)
&& ((u32)src < (ASPEED_FMC_CS0_BASE + 0x10000000))) {
count = ((count + 3) / 4) * 4;
aspeed_spi_fastcpy((u32)dest, (u32)src, count);
return dest;
}
#endif
I switched memmove_wd() in u-boot/common/image.c to a simpler front to back copy and added the check for CONFIG_WDT and everything works now.
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) || defined(CONFIG_WDT)
{
while (len > 0)
{
size_t chunk = (len > chunksz) ? chunksz : len;
WATCHDOG_RESET();
memmove(to, from, chunk);
to += chunk;
from += chunk;
len -= chunk;
}
Another option would be to disable CONFIG_ASPEED_SPI_DMA.

Linux kernel not able to mount rootfs from USB

I am using Intel Joule 570x board for reference which has 64-bit x86 architecture.
I am using GRUB2 as the bootloader and mainline kernel 4.9. I built the kernel, also busybox rootfs and then tested them on qemu and I can boot to shell.
Now I put the kernel bzImage, GRUB and rootfs onto the USB. I have created first partition as FAT and put bzImage and GRUB files there. I created second partition as ext4 and put rootfs files there. Then I plugged it to the development board.
This is my GRUB menuentry :
menuentry "dev kernel" {
set root=(hd0,msdos2)
linux (hd0,msdos1)/bzImage root=/dev/sda console=ttyS2,115200n8 console=tty0
}
The kernel throws error :
VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
Can anyone please help. My USB is also getting detected and I have built all the filesystems (fat,ext4,etc.) into the kernel. The board also has eMMC inbuilt storage and SD card which are also getting detected.
Here are complete boot logs :
Booting a command list
***** skipped some logs ******
[ 0.000000] Kernel command line: BOOT_IMAGE=(hd0,msdos1)/bzImage root=/dev/sda console=ttyS2,115200n8 console=tty0
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] console [tty0] enabled
[ 0.000000] console [ttyS2] enabled
[ 0.015799] Security Framework initialized
[ 0.016158] SELinux: Initializing.
[ 0.242204] smpboot: Total of 4 processors activated (13546.74 BogoMIPS)
[ 0.246269] devtmpfs: initialized
[ 0.246953] PM: Registering ACPI NVS region [mem 0x6b37f000-0x6b3defff] (393216 bytes)
[ 0.247630] PM: Registering ACPI NVS region [mem 0x79dfb000-0x79dfbfff] (4096 bytes)
[ 0.248388] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.248473] kworker/u8:0 (30) used greatest stack depth: 14152 bytes left
[ 0.249850] xor: measuring software checksum speed
[ 0.259845] prefetch64-sse: 8832.000 MB/sec
[ 0.269872] generic_sse: 7648.000 MB/sec
[ 0.270243] xor: using function: prefetch64-sse (8832.000 MB/sec)
[ 0.271541] NET: Registered protocol family 16
[ 0.277997] cpuidle: using governor menu
[ 0.278437] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[ 0.279093] ACPI: bus type PCI registered
[ 0.279549] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xe0000000-0xe3ffffff] (base 0xe0000000)
[ 0.280348] PCI: MMCONFIG at [mem 0xe0000000-0xe3ffffff] reserved in E820
[ 0.280934] PCI: Using configuration type 1 for base access
[ 0.292840] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 0.310540] raid6: sse2x1 gen() 3921 MB/s
[ 0.327606] raid6: sse2x1 xor() 2253 MB/s
[ 0.344647] raid6: sse2x2 gen() 4289 MB/s
[ 0.361691] raid6: sse2x2 xor() 2619 MB/s
[ 0.378739] raid6: sse2x4 gen() 4894 MB/s
[ 0.395767] raid6: sse2x4 xor() 2271 MB/s
[ 0.396143] raid6: using algorithm sse2x4 gen() 4894 MB/s
[ 0.396610] raid6: .... xor() 2271 MB/s, rmw enabled
[ 0.397042] raid6: using ssse3x2 recovery algorithm
[ 0.397511] ACPI: Added _OSI(Module Device)
[ 0.397880] ACPI: Added _OSI(Processor Device)
[ 0.398282] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 0.398688] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.400181] ACPI: Executed 5 blocks of module-level executable AML code
[ 0.410040] ACPI: Dynamic OEM Table Load:
[ 0.410450] ACPI: SSDT 0xFFFF88017A5E0000 000102 (v02 PmRef Cpu0Cst 00003001 INTL 20150818)
[ 0.411738] ACPI: Dynamic OEM Table Load:
[ 0.412123] ACPI: SSDT 0xFFFF88017A5E0200 00015F (v02 PmRef ApIst 00003000 INTL 20150818)
[ 0.413186] ACPI: Dynamic OEM Table Load:
[ 0.413575] ACPI: SSDT 0xFFFF88017A4A4300 00008D (v02 PmRef ApCst 00003000 INTL 20150818)
[ 0.416052] ACPI: Interpreter enabled
[ 0.416421] ACPI: (supports S0 S4 S5)
[ 0.416744] ACPI: Using IOAPIC for interrupt routing
[ 0.417228] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 0.418946] ACPI: Power Resource [PXP] (on)
[ 0.438938] ACPI: Power Resource [PXP] (on)
[ 0.461403] ACPI: Power Resource [VANA] (off)
[ 0.461852] ACPI: Power Resource [VDIG] (off)
[ 0.462292] ACPI: Power Resource [VAF] (off)
[ 0.462724] ACPI: Power Resource [VIO] (off)
[ 0.463802] ACPI: Power Resource [VANA] (off)
[ 0.464247] ACPI: Power Resource [VDIG] (off)
[ 0.464697] ACPI: Power Resource [VAF] (off)
[ 0.475093] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[ 0.475644] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
[ 0.476959] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 0.477652] acpi PNP0A08:00: FADT indicates ASPM is unsupported, using BIOS configuration
[ 0.478372] acpi PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-3f] only partially covers this bridge
[ 0.479434] PCI host bridge to bus 0000:00
[ 0.479800] pci_bus 0000:00: root bus resource [io 0x0070-0x0077]
[ 0.480337] pci_bus 0000:00: root bus resource [io 0x0000-0x006f window]
[ 0.480906] pci_bus 0000:00: root bus resource [io 0x0078-0x03ff window]
[ 0.481497] pci_bus 0000:00: root bus resource [io 0x0480-0x0cf7 window]
[ 0.482077] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
[ 0.482669] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[ 0.483315] pci_bus 0000:00: root bus resource [mem 0x000c0000-0x000dffff window]
[ 0.483961] pci_bus 0000:00: root bus resource [mem 0x000e0000-0x000fffff window]
[ 0.484602] pci_bus 0000:00: root bus resource [mem 0x7c000001-0x7fffffff window]
[ 0.485249] pci_bus 0000:00: root bus resource [mem 0x80000000-0xcfffffff window]
[ 0.485893] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.488151] pci 0000:00:0e.0: System wakeup disabled by ACPI
[ 0.489539] pci 0000:00:14.0: System wakeup disabled by ACPI
[ 0.490419] pci 0000:00:15.0: System wakeup disabled by ACPI
[ 0.491315] pci 0000:00:15.1: System wakeup disabled by ACPI
[ 0.498775] pci 0000:01:00.0: can't set Max Payload Size to 256; if necessary, use "pci=pcie_bus_safe" and report a bug
[ 0.502772] pci 0000:00:14.0: PCI bridge to [bus 01]
[ 0.507965] vgaarb: setting as boot device: PCI:0000:00:02.0
[ 0.508456] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[ 0.509162] vgaarb: loaded
[ 0.509402] vgaarb: bridge control possible 0000:00:02.0
[ 0.509968] SCSI subsystem initialized
[ 0.510441] ACPI: bus type USB registered
[ 0.510832] usbcore: registered new interface driver usbfs
[ 0.511334] usbcore: registered new interface driver hub
[ 0.511827] usbcore: registered new device driver usb
[ 0.512296] pps_core: LinuxPPS API ver. 1 registered
[ 0.512732] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
[ 0.513514] PTP clock support registered
[ 0.513999] Registered efivars operations
[ 0.523720] Advanced Linux Sound Architecture Driver Initialized.
[ 0.524267] PCI: Using ACPI for IRQ routing
[ 0.532269] NetLabel: Initializing
[ 0.532578] NetLabel: domain hash size = 128
[ 0.532962] NetLabel: protocols = UNLABELED CIPSOv4
[ 0.533415] NetLabel: unlabeled traffic allowed by default
[ 0.534085] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0, 0, 0, 0, 0
[ 0.534762] hpet0: 8 comparators, 64-bit 19.200000 MHz counter
[ 0.537347] clocksource: Switched to clocksource hpet
[ 0.553394] VFS: Disk quotas dquot_6.6.0
[ 0.553771] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.554515] pnp: PnP ACPI init
[ 0.555748] system 00:01: [mem 0xe0000000-0xefffffff] could not be reserved
[ 0.556332] system 00:01: [mem 0xfea00000-0xfeafffff] has been reserved
[ 0.556916] system 00:01: [mem 0xfed01000-0xfed01fff] has been reserved
[ 0.557497] system 00:01: [mem 0xfed03000-0xfed03fff] has been reserved
[ 0.558063] system 00:01: [mem 0xfed06000-0xfed06fff] has been reserved
[ 0.558643] system 00:01: [mem 0xfed08000-0xfed09fff] has been reserved
[ 0.559204] system 00:01: [mem 0xfed80000-0xfedbffff] has been reserved
[ 0.559785] system 00:01: [mem 0xfed1c000-0xfed1cfff] has been reserved
[ 0.560369] system 00:01: [mem 0xfee00000-0xfeefffff] has been reserved
[ 0.561681] pnp: PnP ACPI: found 2 devices
[ 0.569529] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 0.570326] pci 0000:00:14.0: PCI bridge to [bus 01]
[ 0.570783] pci 0000:00:14.0: bridge window [mem 0x92300000-0x923fffff]
[ 0.571552] NET: Registered protocol family 2
[ 0.572212] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.573027] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
[ 0.573840] TCP: Hash tables configured (established 32768 bind 32768)
[ 0.574456] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[ 0.575016] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[ 0.575678] NET: Registered protocol family 1
[ 0.576271] RPC: Registered named UNIX socket transport module.
[ 0.576794] RPC: Registered udp transport module.
[ 0.577198] RPC: Registered tcp transport module.
[ 0.577606] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.578178] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 0.579432] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 0.579993] software IO TLB [mem 0x74c1e000-0x78c1e000] (64MB) mapped at [ffff880074c1e000-ffff880078c1dfff]
[ 0.580989] RAPL PMU: API unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
[ 0.581689] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[ 0.582183] RAPL PMU: hw unit of domain package 2^-14 Joules
[ 0.582677] RAPL PMU: hw unit of domain dram 2^-14 Joules
[ 0.583142] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[ 0.583722] platform rtc_cmos: registered platform RTC device (no PNP device found)
[ 0.585081] Scanning for low memory corruption every 60 seconds
[ 0.585994] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.586557] audit: initializing netlink subsys (disabled)
[ 0.587039] audit: type=2000 audit(1484314800.570:1): initialized
[ 0.588155] workingset: timestamp_bits=56 max_order=20 bucket_order=0
[ 0.592463] NFS: Registering the id_resolver key type
[ 0.592898] Key type id_resolver registered
[ 0.593265] Key type id_legacy registered
[ 0.593644] ntfs: driver 2.1.32 [Flags: R/O].
[ 0.594218] JFS: nTxBlock = 8192, nTxLock = 65536
[ 0.596833] SGI XFS with security attributes, no debug enabled
[ 0.601391] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.602011] io scheduler noop registered
[ 0.602371] io scheduler deadline registered
[ 0.602751] io scheduler cfq registered (default)
[ 0.603678] pcieport 0000:00:14.0: Signaling PME through PCIe PME interrupt
[ 0.604267] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[ 0.604860] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[ 0.605387] efifb: probing for efifb
[ 0.605720] efifb: framebuffer at 0x80000000, using 9024k, total 9024k
[ 0.606275] efifb: mode is 1920x1200x32, linelength=7680, pages=1
[ 0.606810] efifb: scrolling: redraw
[ 0.607127] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[ 0.618555] Console: switching to colour frame buffer device 240x75
[ 0.629275] fb0: EFI VGA frame buffer device
[ 0.632973] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.634649] Non-volatile memory driver v1.3
[ 0.635135] Linux agpgart interface v0.103
[ 0.635802] [drm] Initialized
[ 0.636841] [drm] Memory usable by graphics device = 4096M
[ 0.637386] fb: switching to inteldrmfb from EFI VGA
[ 0.637881] Console: switching to colour dummy device 80x25
[ 0.638524] [drm] Replacing VGA console driver
[ 0.639396] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.639960] [drm] Driver supports precise vblank timestamp query.
[ 0.642553] i915 0000:00:02.0: Direct firmware load for i915/bxt_dmc_ver1_07.bin failed with error -2
[ 0.643336] i915 0000:00:02.0: Failed to load DMC firmware [https://01.org/linuxgraphics/intel-linux-graphics-firmwares], disabling runtime power management.
[ 0.644923] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 1.630958] [drm] failed to retrieve link info, disabling eDP
[ 1.633466] [drm] GuC firmware load skipped
[ 1.646479] tsc: Refined TSC clocksource calibration: 1689.599 MHz
[ 1.647029] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x185ac5ca321, max_idle_ns: 440795231783 ns
[ 1.650989] random: fast init done
[ 1.770721] ACPI: Video Device [GFX0] (multi-head: yes rom: no post: no)
[ 1.772107] acpi device:44: registered as cooling_device4
[ 1.772677] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input0
[ 1.773505] [drm] Initialized i915 1.6.0 20160919 for 0000:00:02.0 on minor 0
[ 1.777433] loop: module loaded
[ 1.781332] dw-apb-uart.8: ttyS0 at MMIO 0x92430000 (irq = 4, base_baud = 460800) is a 16550A
[ 1.782696] dw-apb-uart.9: ttyS1 at MMIO 0x92432000 (irq = 5, base_baud = 460800) is a 16550A
[ 1.784122] console [ttyS2] disabled
[ 1.784477] dw-apb-uart.10: ttyS2 at MMIO 0x92434000 (irq = 6, base_baud = 460800) is a 16550A
[ 2.661355] clocksource: Switched to clocksource tsc
[ 2.741029] [drm] RC6 on
[ 4.303847] console [ttyS2] enabled
[ 4.303914] fbcon: inteldrmfb (fb0) is primary device
[ 4.304411] dw-apb-uart.11: ttyS3 at MMIO 0x92436000 (irq = 7, base_baud = 460800) is a 16550A
[ 4.305851] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[ 4.305851] e100: Copyright(c) 1999-2006 Intel Corporation
[ 4.305874] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[ 4.305875] e1000: Copyright (c) 1999-2006 Intel Corporation.
[ 4.305897] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 4.305898] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 4.305930] sky2: driver version 1.30
[ 4.306203] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 4.306204] ehci-pci: EHCI PCI platform driver
[ 4.306228] ehci-platform: EHCI generic platform driver
[ 4.306271] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 4.306277] ohci-pci: OHCI PCI platform driver
[ 4.306297] ohci-platform: OHCI generic platform driver
[ 4.306319] uhci_hcd: USB Universal Host Controller Interface driver
[ 4.306525] xhci_hcd 0000:00:15.0: xHCI Host Controller
[ 4.306654] xhci_hcd 0000:00:15.0: new USB bus registered, assigned bus number 1
[ 4.307770] xhci_hcd 0000:00:15.0: hcc params 0x200077c1 hci version 0x100 quirks 0x00109810
[ 4.307926] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 4.307929] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.307931] usb usb1: Product: xHCI Host Controller
[ 4.307933] usb usb1: Manufacturer: Linux 4.9.0 xhci-hcd
[ 4.307934] usb usb1: SerialNumber: 0000:00:15.0
[ 4.308296] hub 1-0:1.0: USB hub found
[ 4.308311] hub 1-0:1.0: 4 ports detected
[ 4.308764] xhci_hcd 0000:00:15.0: xHCI Host Controller
[ 4.308974] xhci_hcd 0000:00:15.0: new USB bus registered, assigned bus number 2
[ 4.309029] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[ 4.309031] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.309033] usb usb2: Product: xHCI Host Controller
[ 4.309034] usb usb2: Manufacturer: Linux 4.9.0 xhci-hcd
[ 4.309036] usb usb2: SerialNumber: 0000:00:15.0
[ 4.309285] hub 2-0:1.0: USB hub found
[ 4.309298] hub 2-0:1.0: 4 ports detected
[ 4.309516] usb: port power management may be unreliable
[ 4.309781] usbcore: registered new interface driver usblp
[ 4.309807] usbcore: registered new interface driver usb-storage
[ 4.309820] usbcore: registered new interface driver ums-realtek
[ 4.309830] usbcore: registered new interface driver ums-usbat
[ 4.309868] usbcore: registered new interface driver usbserial
[ 4.309881] usbcore: registered new interface driver usbserial_generic
[ 4.309892] usbserial: USB Serial support registered for generic
[ 4.309904] usbcore: registered new interface driver pl2303
[ 4.309914] usbserial: USB Serial support registered for pl2303
[ 4.309918] usbip_core: USB/IP Core v1.0.0
[ 4.310062] i8042: PNP: No PS/2 controller found. Probing ports directly.
[ 5.408427] i8042: No controller found
[ 5.408691] mousedev: PS/2 mouse device common for all mice
[ 5.408905] ACPI Error: Could not enable RealTimeClock event (20160831/evxfevnt-212)
[ 5.408908] ACPI Warning: Could not enable fixed event - RealTimeClock (4) (20160831/evxface-654)
[ 5.409640] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[ 5.409788] rtc_cmos rtc_cmos: alarms up to one month, y3k, 114 bytes nvram, hpet irqs
[ 5.410003] device-mapper: ioctl: 4.35.0-ioctl (2016-06-23) initialised: dm-devel#redhat.com
[ 5.410018] sdhci: Secure Digital Host Controller Interface driver
[ 5.410019] sdhci: Copyright(c) Pierre Ossman
[ 5.410042] sdhci-pci 0000:00:1b.0: SDHCI controller found [8086:1aca] (rev c)
[ 5.410256] sdhci-pci 0000:00:1b.0: failed to setup card detect gpio
[ 5.416566] mmc0: SDHCI controller on PCI [0000:00:1b.0] using ADMA 64-bit
[ 5.416651] sdhci-pci 0000:00:1c.0: SDHCI controller found [8086:1acc] (rev c)
[ 5.423563] mmc1: SDHCI controller on PCI [0000:00:1c.0] using ADMA 64-bit
[ 5.423788] usbcore: registered new interface driver ushc
[ 5.423790] EFI Variables Facility v0.08 2004-May-17
[ 5.436816] hidraw: raw HID events driver (C) Jiri Kosina
[ 5.437175] usbcore: registered new interface driver usbhid
[ 5.437176] usbhid: USB HID core driver
[ 5.438050] Netfilter messages via NETLINK v0.30.
[ 5.438166] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[ 5.438245] ctnetlink v0.93: registering with nfnetlink.
[ 5.438672] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 5.438701] Initializing XFRM netlink socket
[ 5.438882] NET: Registered protocol family 10
[ 5.439222] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 5.439375] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 5.439591] NET: Registered protocol family 17
[ 5.439622] Key type dns_resolver registered
[ 5.439970] microcode: sig=0x506c2, pf=0x1, revision=0xa
[ 5.440066] microcode: Microcode Update Driver: v2.01 <tigran#aivazian.fsnet.co.uk>, Peter Oruba
[ 5.440268] registered taskstats version 1
[ 5.440823] Btrfs loaded, crc32c=crc32c-generic
[ 5.443436] snd_hda_intel 0000:00:0e.0: bound 0000:00:02.0 (ops 0xffffffff81ca3980)
[ 5.445136] Magic number: 1:456:685
[ 5.445177] misc nvram: hash matches
[ 5.445186] clocksource: hash matches
[ 5.447584] hdaudio hdaudioC0D1: Unable to bind the codec
[ 5.454231] Console: switching to colour frame buffer device 240x75
[ 5.541996] mmc0: new high speed SDHC card at address 1234
[ 5.542391] mmcblk0: mmc0:1234 SA16G 14.4 GiB
[ 5.544015] mmcblk0: p1
[ 5.595442] mmc1: new HS400 MMC card at address 0001
[ 5.595700] mmcblk1: mmc1:0001 016G32 14.7 GiB
[ 5.595787] mmcblk1boot0: mmc1:0001 016G32 partition 1 4.00 MiB
[ 5.595885] mmcblk1boot1: mmc1:0001 016G32 partition 2 4.00 MiB
[ 5.595970] mmcblk1gp0: mmc1:0001 016G32 partition 4 4.00 MiB
[ 5.596058] mmcblk1gp3: mmc1:0001 016G32 partition 7 4.00 MiB
[ 5.596144] mmcblk1rpmb: mmc1:0001 016G32 partition 3 4.00 MiB
[ 5.598227] mmcblk1: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13
[ 5.630221] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd
[ 5.699723] usb 2-2: New USB device found, idVendor=8564, idProduct=4100
[ 5.699726] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 5.699728] usb 2-2: Product: USB3.0 Hub
[ 5.699730] usb 2-2: Manufacturer: Transcend Info
[ 5.768362] hub 2-2:1.0: USB hub found
[ 5.775377] hub 2-2:1.0: 4 ports detected
[ 5.845170] usb 1-2: new high-speed USB device number 2 using xhci_hcd
[ 6.079121] usb 1-2: New USB device found, idVendor=8564, idProduct=4100
[ 6.079123] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 6.079125] usb 1-2: Product: USB2.0 Hub
[ 6.079127] usb 1-2: Manufacturer: Transcend Info
[ 6.102982] hub 1-2:1.0: USB hub found
[ 6.109513] hub 1-2:1.0: 4 ports detected
[ 6.283504] usb 2-2.1: new SuperSpeed USB device number 3 using xhci_hcd
[ 6.341416] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[ 6.342103] usb 2-2.1: New USB device found, idVendor=0781, idProduct=558a
[ 6.342106] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6.342107] usb 2-2.1: Product: Ultra
[ 6.342109] usb 2-2.1: Manufacturer: SanDisk
[ 6.342111] usb 2-2.1: SerialNumber: 4C531003550621112474
[ 6.343651] usb-storage 2-2.1:1.0: USB Mass Storage device detected
[ 6.343924] scsi host0: usb-storage 2-2.1:1.0
[ 6.410171] console [netcon0] enabled
[ 6.416562] netconsole: network logging started
[ 6.425391] ALSA device list:
[ 6.430970] #0: HDA Intel PCH at 0x92418000 irq 123
[ 6.439041] ttyS2 - failed to request DMA
[ 6.445806] md: Waiting for all devices to be available before autodetect
[ 6.455660] md: If you don't use raid, use raid=noautodetect
[ 6.465021] md: Autodetecting RAID arrays.
[ 6.471909] md: Scanned 0 and added 0 devices.
[ 6.479114] md: autorun ...
[ 6.484438] md: ... autorun DONE.
[ 6.487454] usb 1-3: new full-speed USB device number 3 using xhci_hcd
[ 6.499997] VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
[ 6.510294] Please append a correct "root=" boot option; here are the available partitions:
[ 6.521895] b300 15126528 mmcblk0 [ 6.526210] driver: mmcblk
[ 6.531575] b301 15125504 mmcblk0p1 00000000-01[ 6.537358]
[ 6.541264] b308 15380480 mmcblk1 [ 6.545579] driver: mmcblk
[ 6.550953] b309 61440 mmcblk1p1 fb5f2fd1-926e-4824-9bd3-d7cdfc5a9484[ 6.559176]
[ 6.563100] b30a 60417 mmcblk1p2 51237339-1727-41c2-9dfe-3a48de708967[ 6.571321]
[ 6.575246] b30b 29697 mmcblk1p3 e26cbdbe-958c-4813-813e-a580aab236cc[ 6.583468]
[ 6.587399] b30c 29698 mmcblk1p4 d1b1361a-54eb-4cc5-8584-09e3dd161317[ 6.595613]
[ 6.599554] b30d 2 mmcblk1p5 ea2de08a-21d6-422a-b333-bbeb01074d91[ 6.607778]
[ 6.611719] b30e 15363 mmcblk1p6 a85e7cf4-b662-4448-aa75-6aaae46c4457[ 6.619962]
[ 6.623925] b30f 3668995 mmcblk1p7 fcca825b-7dcb-41d2-81d9-b430ae829b12[ 6.632149]
[ 6.636100] 103:00000 101380 mmcblk1p8 ba14eaf1-4002-412e-a21c-5d75901ac87c[ 6.644322]
[ 6.648287] 103:00001 4 mmcblk1p9 4c4a2cac-4fdb-4428-8b8c-4a4a21533a6e[ 6.656501]
[ 6.660461] 103:00002 1534981 mmcblk1p10 7f9c6212-42e8-4037-af65-63fa74ad54f5[ 6.668783]
[ 6.672747] 103:00003 7173 mmcblk1p11 b8a54634-b3ff-4383-87fc-ec234e30cc23[ 6.681059]
[ 6.685009] 103:00004 9222 mmcblk1p12 0f9c8abc-bfbd-4d70-866b-0d2a646d35c9[ 6.693329]
[ 6.697300] 103:00005 9848815 mmcblk1p13 0c0de561-b34b-4244-aff6-3b445acd6ded[ 6.705621]
[ 6.709552] b330 4096 mmcblk1rpmb [ 6.714259] (driver?)
[ 6.719197] b328 4096 mmcblk1gp3 [ 6.723806] (driver?)
[ 6.728745] b320 4096 mmcblk1gp0 [ 6.733355] (driver?)
[ 6.738279] b318 4096 mmcblk1boot1 [ 6.743082] (driver?)
[ 6.747996] b310 4096 mmcblk1boot0 [ 6.752799] (driver?)
[ 6.757685] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 6.769245] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.0 #6
[ 6.778067] Hardware name: Intel Corp. Joule DVT2/SDS, BIOS GTPP181A.X64.0143.B30.1701132137 01/13/2017
[ 6.790929] ffffc90000653dd8 ffffffff814c97df 0000000000008000 ffffffff81dd8f78
[ 6.801611] ffffc90000653e50 ffffffff81123cfb ffff880100000010 ffffc90000653e60
[ 6.812325] ffffc90000653e00 62316b6c62636d6d ffffc90000653e68 0000000000000001
[ 6.823005] Call Trace:
[ 6.828132] [<ffffffff814c97df>] dump_stack+0x4d/0x6e
[ 6.836281] [<ffffffff81123cfb>] panic+0xd0/0x20e
[ 6.844032] [<ffffffff8218a4ac>] mount_block_root+0x182/0x23c
[ 6.852976] [<ffffffff8218a66b>] mount_root+0x105/0x10e
[ 6.861297] [<ffffffff8218a7b0>] prepare_namespace+0x13c/0x174
[ 6.870323] [<ffffffff8218a1de>] kernel_init_freeable+0x1ce/0x1e1
[ 6.879617] [<ffffffff82189933>] ? set_debug_rodata+0x12/0x12
[ 6.888526] [<ffffffff81ae56b0>] ? rest_init+0x80/0x80
[ 6.896736] [<ffffffff81ae56b9>] kernel_init+0x9/0x100
[ 6.904956] [<ffffffff81aeb192>] ret_from_fork+0x22/0x30
[ 6.913423] Kernel Offset: disabled
[ 6.919701] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 6.932266] ------------[ cut here ]------------
[ 6.939850] WARNING: CPU: 3 PID: 1 at arch/x86/kernel/smp.c:127 native_smp_send_reschedule+0x3a/0x40
[ 6.952542] Modules linked in:
[ 6.958438] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.0 #6
[ 6.967461] Hardware name: Intel Corp. Joule DVT2/SDS, BIOS GTPP181A.X64.0143.B30.1701132137 01/13/2017
[ 6.980529] ffff88017fd83e10 ffffffff814c97df 0000000000000000 0000000000000000
[ 6.991430] ffff88017fd83e50 ffffffff81058f4c 0000007f7fd97820 0000000000000000
[ 7.002301] 0000000000000003 00000000fffb8712 ffff88017ab58000 ffff88017fd911e8
[ 7.013163] Call Trace:
[ 7.018427] <IRQ> [ 7.020578] [<ffffffff814c97df>] dump_stack+0x4d/0x6e
[ 7.028889] [<ffffffff81058f4c>] __warn+0xcc/0xf0
[ 7.036832] [<ffffffff81059028>] warn_slowpath_null+0x18/0x20
[ 7.045953] [<ffffffff8103b37a>] native_smp_send_reschedule+0x3a/0x40
[ 7.055865] [<ffffffff8108e9d4>] trigger_load_balance+0x104/0x1a0
[ 7.065380] [<ffffffff81080bd7>] scheduler_tick+0x97/0xc0
[ 7.074105] [<ffffffff810c4210>] ? tick_sched_do_timer+0x30/0x30
[ 7.083519] [<ffffffff810b5792>] update_process_times+0x42/0x50
[ 7.092833] [<ffffffff810c3c71>] tick_sched_handle.isra.13+0x31/0x40
[ 7.102642] [<ffffffff810c4248>] tick_sched_timer+0x38/0x70
[ 7.111524] [<ffffffff810b638a>] __hrtimer_run_queues+0xda/0x250
[ 7.120932] [<ffffffff810b67d3>] hrtimer_interrupt+0xa3/0x190
[ 7.130032] [<ffffffff8103d650>] local_apic_timer_interrupt+0x30/0x60
[ 7.139903] [<ffffffff8103e138>] smp_apic_timer_interrupt+0x38/0x50
[ 7.149575] [<ffffffff81aebb2f>] apic_timer_interrupt+0x7f/0x90
[ 7.158861] <EOI> [ 7.161023] [<ffffffff81123e00>] ? panic+0x1d5/0x20e
[ 7.169257] [<ffffffff81123dfc>] ? panic+0x1d1/0x20e
[ 7.177497] [<ffffffff8218a4ac>] mount_block_root+0x182/0x23c
[ 7.186601] [<ffffffff8218a66b>] mount_root+0x105/0x10e
[ 7.195091] [<ffffffff8218a7b0>] prepare_namespace+0x13c/0x174
[ 7.204259] [<ffffffff8218a1de>] kernel_init_freeable+0x1ce/0x1e1
[ 7.213699] [<ffffffff82189933>] ? set_debug_rodata+0x12/0x12
[ 7.222734] [<ffffffff81ae56b0>] ? rest_init+0x80/0x80
[ 7.231073] [<ffffffff81ae56b9>] kernel_init+0x9/0x100
[ 7.239378] [<ffffffff81aeb192>] ret_from_fork+0x22/0x30
[ 7.247868] ---[ end trace 9dc963ca26f1cf14 ]---
EDIT
One strage behaviour I have noticed, if I pass kernel parameter from GRUB2 as /dev/sdb, then the kernel shows sda1 and sda2 as the available partitions, with same error.
Kernel Config file : https://pastebin.com/twi9Deis
The solution is to add "rootwait" to the kernel commandline. The USB pendrive needs a little time to be recognized so the kernel need to wait for it.

Custom Linux Build on NanoPi Neo Board

I am a noob to building custom linux OSes for embedded boards - so please ignore my ignorance.
I have a board called NanoPi NEO that has custom Debian linux. Now the board comes with a .img file that can be flashed on to an SD card and plugged into the slot and the board boots from the card.
Now I am trying to build my own Custom linux and flash to the SD card. I have been through the forums and manuals and managed to get this far.
Problem
I understand that there are three components to a custom linux build
boot0 - The thing that loads the BootLoader
U-Boot - One of the many BootLoaders. (The project uses this).
Rootfs - The filesystem and everything else.
The board manufacturer's website gave these instructions for building custom os. I followed those instructions and did everything including proper partitioning of the SD card (with free space in front for boot0, boot partition with uImage and Script.bin, and partition for rootfs)
The problem is that the board loads the Kernel on boot but doesn't mount the filesystem and prove a user prompt.
This is the Dmesg output.
HELLO! BOOT0 is starting!
boot0 version : 4.0.0
boot0 commit : 9d0a4ce0ba7756bc0de2e0efe7ec15900a4aa947
fel_flag = 0x00000000
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x00000000
rtc[4] value = 0x00000000
rtc[5] value = 0x00000000
rtc[6] value = 0x00000000
rtc[7] value = 0x00000000
DRAM DRIVE INFO: V1.3
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
READ DQS LCDL = 00242524
DRAM Type = 3 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
DRAM CLK = 576 MHz
DRAM zq value: 003b3bfb
DRAM dram para1: 10e20100
DRAM dram para2: 00000001
DRAM workmode1: 000009f4
DRAM SIZE =256 M
odt delay
dram size =256
card boot number = 0
card no is 0
sdcard 0 line count 4
[mmc]: mmc driver ver 2015-04-13 16:07:39
[mmc]: ***Try SD card 0***
[mmc]: SD/MMC Card: 4bit, capacity: 3812MB
[mmc]: vendor: Man 00845446 Snr 0000200b
[mmc]: product: SD[mmc]: revision: 0.0
[mmc]: ***SD/MMC 0 init OK!!!***
sdcard 0 init ok
The size of uboot is 000e4000.
sum=5b02f845
src_sum=5b02f845
Succeed in loading uboot from sdmmc flash.
Ready to disable icache.
Jump to secend Boot.
SUNXI_NORMAL_MODE
[ 0.380]e mode
U-Boot 2011.09-rc1-00000-g9d0a4ce-dirty (Aug 18 2016 - 15:53:02) Allwinner Technology
[ 0.390]version: 1.1.0
[ 0.392]uboot commit : 9d0a4ce0ba7756bc0de2e0efe7ec15900a4aa947
normal mode
[ 0.403]pmbus: ready
not set main pmu id
axp_probe error
gpio value=0x20000
[ 0.441]PMU: pll1 1008 Mhz,PLL6=600 Mhz
AXI=336 Mhz,AHB=200 Mhz, APB1=100 Mhz
sid read already
fel key new mode
run key detect
no key found
no key input
dram_para_set start
dram_para_set end
normal mode
[ 0.472]DRAM: 256 MiB
relocation Offset is: 05af2000
[box standby] read rtc = 0x0
[box_start_os] mag be start_type no use
user_gpio config
user_gpio ok
gic: normal or no secure os mode
workmode = 0
MMC: 0
[ 0.552][mmc]: mmc driver ver 2015-04-13 14:50:00
[ 0.557][mmc]: get sdc_phy_wipe fail.
[ 0.561][mmc]: get sdc0 sdc_erase fail.
[ 0.565][mmc]: get sdc_f_max fail,use default 50000000Hz
[ 0.570][mmc]: get sdc_ex_dly_used fail,use default dly
[ 0.576][mmc]: SUNXI SD/MMC: 0
[ 0.589][mmc]: *Try SD card 0*
[ 0.622][mmc]: CID 0x84544653 0x44000000 0x20 0xb01014f
[ 0.627][mmc]: mmc clk 50000000
[ 0.630][mmc]: SD/MMC Card: 4bit, capacity: 3812MB
[ 0.635][mmc]: boot0 capacity: 0KB,boot1 capacity: 0KB
[ 0.640][mmc]: ***SD/MMC 0 init OK!!!***
[ 0.645][mmc]: erase_grp_size:0x1WrBlk * 0x200 = 0x200 Byte
[ 0.651][mmc]: secure_feature 0x0
[ 0.654][mmc]: secure_removal_type 0x0
[ 0.658]sunxi flash init ok
script config pll_de to 864 Mhz
Not Found clk pll_video1 in script
script config pll_video to 297 Mhz
script config pll_periph0 to 600 Mhz
unable to find regulator vcc-hdmi-18 from [pmu1_regu] or [pmu2_regu]
enable power vcc-hdmi-18, ret=-1
DRV_DISP_Init end
[disk_read_fs] no the partition
error: open tv_vdid.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
boot_disp.auto_hpd=1
auto hpd check has 100 times!
auto check no any connected, the output_type is 4
[ 2.032]finally, output_type=0x4, output_mode=0x4, screen_id=0x0, disp_para=0x0
try to read logic blk 0 without env partition
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
--------fastboot partitions--------
mbr not exist
base bootcmd=run setargs_mmc boot_normal
bootcmd set setargs_mmc
key 0
cant find rcvy value
cant find fstbt value
no misc partition is found
to be run cmd=run setargs_mmc boot_normal
[ 2.080][mmc]: MMC Device 2 not found
[ 2.084][mmc]: Can not find mmc dev
[ 2.087][mmc]: read first backup failed in fun sdmmc_secure_storage_read line 1854
sunxi_secstorage_read fail
get secure storage map err
check user data form private
the private part isn't exist
WORK_MODE_BOOT
adver not need show
sunxi_bmp_logo_display
[disk_read_fs] no the partition
error: open bootlogo.bmp, maybe it is not exist
sunxi bmp info error : unable to open logo file bootlogo.bmp
[ 2.123]Hit any key to stop autoboot: 0
[ 4.300][mmc]: blkcnt should not be 0
## Booting kernel from Legacy Image at 40007800 ...
Image Name: Linux-3.4.39-h3
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4522784 Bytes = 4.3 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
[ 4.603][mmc]: MMC Device 2 not found
[ 4.607][mmc]: mmc not find,so not exit
[ 4.611]
Starting kernel ...
[sun8i_fixup]: From boot, get meminfo:
Start: 0x40000000
Size: 256MB
ion_carveout reserve: 160m#0 256m#0 130m#1 200m#1
ion_reserve_select: ion chipid [0x2c00081!
ion_reserve_common: ion reserve: [0x46000000, 0x50000000]!
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.4.39-h3 (azmath#azPC) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #1 SMP PREEMPT Thu Aug 18 15:52:21 IST 2016
[ 0.000000] cma: CMA: reserved 160 MiB at 46000000
[ 0.000000] PERCPU: Embedded 8 pages/cpu #c0c91000 s11840 r8192 d12736 u32768
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] allocated 524288 bytes of page_cgroup
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 256MB = 256MB total
[ 0.000000] Memory: 84012k/84012k available, 178132k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc089dfd4 (8792 kB)
[ 0.000000] .init : 0xc089e000 - 0xc08eee40 ( 324 kB)
[ 0.000000] .data : 0xc08f0000 - 0xc096a878 ( 491 kB)
[ 0.000000] .bss : 0xc096b02c - 0xc0a3fc88 ( 852 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] NR_IRQS:544
[ 0.000000] Architected local timer running at 24.00MHz.
[ 0.000000] Switching to timer-based delay loop
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [tty0] enabled
[ 0.001029] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[ 0.001097] pid_max: default: 32768 minimum: 301
[ 0.001458] Mount-cache hash table entries: 512
[ 0.002521] Initializing cgroup subsys cpuacct
[ 0.002561] Initializing cgroup subsys memory
[ 0.002631] Initializing cgroup subsys devices
[ 0.002663] Initializing cgroup subsys freezer
[ 0.002692] Initializing cgroup subsys blkio
[ 0.002736] Initializing cgroup subsys perf_event
[ 0.002813] CPU: Testing write buffer coherency: ok
[ 0.002890] ftrace: allocating 24150 entries in 71 pages
[ 0.030315] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.030365] [sunxi_smp_prepare_cpus] enter
[ 0.030417] Setting up static identity map for 0x4061f8e0 - 0x4061f938
[ 0.031457] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.031592] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.031592] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.040210] Brought up 4 CPUs
[ 0.040292] SMP: Total of 4 processors activated (19200.00 BogoMIPS).
[ 0.041034] devtmpfs: initialized
[ 0.043817] wakeup src cnt is : 2.
[ 0.043914] sunxi pm init
[ 0.044064] pinctrl core: initialized pinctrl subsystem
[ 0.054192] NET: Registered protocol family 16
[ 0.054986] DMA: preallocated 2048 KiB pool for atomic coherent allocations
[ 0.054986] script_sysfs_init success
[ 0.054986] gpiochip_add: registered GPIOs 0 to 383 on device: sunxi-pinctrl
[ 0.054986] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[ 0.054986] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.054986] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.055148] script config pll_video to 297 Mhz
[ 0.055180] script config pll_de to 864 Mhz
[ 0.055205] script config pll_ve to 402 Mhz
[ 0.061950] bio: create slab <bio-0> at 0
[ 0.061950] [ARISC] :sunxi-arisc driver v1.04
[ 0.076943] [ARISC] :arisc version: [v0.1.58]
[ 0.163654] [ARISC] :sunxi-arisc driver v1.04 startup succeeded
[ 0.163781] pwm module init!
[ 0.171646] SCSI subsystem initialized
[ 0.171646] usbcore: registered new interface driver usbfs
[ 0.171646] usbcore: registered new interface driver hub
[ 0.171646] usbcore: registered new device driver usb
[ 0.171646] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[ 0.171646] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[ 0.171646] twi_chan_cfg()340 - [twi2] has no twi_regulator.
[ 0.171646] Linux video capture interface: v2.00
[ 0.171718] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.172304] Bluetooth: Core ver 2.16
[ 0.172369] NET: Registered protocol family 31
[ 0.172393] Bluetooth: HCI device and connection manager initialized
[ 0.172422] Bluetooth: HCI socket layer initialized
[ 0.172445] Bluetooth: L2CAP socket layer initialized
[ 0.172479] Bluetooth: SCO socket layer initialized
[ 0.172586] Switching to clocksource arch_sys_counter
[ 0.183438] FS-Cache: Loaded
[ 0.183767] CacheFiles: Loaded
[ 0.195670] NET: Registered protocol family 2
[ 0.195984] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.196546] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.196714] TCP bind hash table entries: 8192 (order: 4, 98304 bytes)
[ 0.196858] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.196886] TCP: reno registered
[ 0.196908] UDP hash table entries: 128 (order: 0, 4096 bytes)
[ 0.196953] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
[ 0.197265] NET: Registered protocol family 1
[ 0.197667] RPC: Registered named UNIX socket transport module.
[ 0.197701] RPC: Registered udp transport module.
[ 0.197722] RPC: Registered tcp transport module.
[ 0.197743] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.198224] hw perfevents: enabled with ARMv7 Cortex_A7 PMU driver, 5 counters available
[ 0.198362] sunxi_reg_init enter
[ 0.199096] audit: initializing netlink socket (disabled)
[ 0.199161] type=2000 audit(0.190:1): initialized
[ 0.201581] NTFS driver 2.1.30 [Flags: R/W].
[ 0.201895] fuse init (API version 7.18)
[ 0.202256] msgmni has been set to 484
[ 0.203709] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.203759] io scheduler noop registered
[ 0.203779] io scheduler deadline registered
[ 0.203851] io scheduler cfq registered (default)
[ 0.204325] [DISP]disp_module_init
[ 0.204656] cmdline,init_disp=
[ 0.204696] cmdline,disp=
[ 0.214840] [DISP] Fb_map_kernel_logo,line:926:Fb_map_kernel_logo failed!
[ 0.230039] Console: switching to colour frame buffer device 160x45
[ 0.246402] [DISP]disp_module_init finish
[ 0.246750] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[ 0.246930] sw_uart_get_devinfo()1503 - uart1 has no uart_regulator.
[ 0.247103] sw_uart_get_devinfo()1503 - uart2 has no uart_regulator.
[ 0.247276] sw_uart_get_devinfo()1503 - uart3 has no uart_regulator.
[ 0.248031] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[ 0.248209] sw_uart_pm()890 - uart0 clk is already enable
[ 0.248364] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[ 0.360189] console [ttyS0] enabled
[ 0.530429] uart1: ttyS1 at MMIO 0x1c28400 (irq = 33) is a SUNXI
[ 0.530691] uart2: ttyS2 at MMIO 0x1c28800 (irq = 34) is a SUNXI
[ 0.530955] uart3: ttyS3 at MMIO 0x1c28c00 (irq = 35) is a SUNXI
[ 0.531802] [drm] Initialized drm 1.1.0 20060810
[ 0.535869] loop: module loaded
[ 0.659319] sunxi_spi_chan_cfg()1383 - [spi-0] has no spi_regulator.
[ 0.840684] sunxi_spi_chan_cfg()1383 - [spi-1] has no spi_regulator.
[ 0.965661] spi spi0: master is unqueued, this is deprecated
[ 1.150380] tun: Universal TUN/TAP device driver, 1.6
[ 1.150388] tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
[ 1.151363] PPP generic driver version 2.4.2
[ 1.151552] PPP BSD Compression module registered
[ 1.151560] PPP Deflate Compression module registered
[ 1.152440] PPP MPPE Compression module registered
[ 1.152451] NET: Registered protocol family 24
[ 1.152493] PPTP driver version 0.8.5
[ 1.152743] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.172877] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.172912] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[ 1.296094] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[ 1.480038] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[ 1.632720] hub 1-0:1.0: USB hub found
[ 1.685669] hub 1-0:1.0: 1 port detected
[ 1.714667] sunxi-ehci sunxi-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.727974] sunxi-ehci sunxi-ehci.2: new USB bus registered, assigned bus number 2
[ 1.741191] sunxi-ehci sunxi-ehci.2: irq 106, io mem 0xf1c1b000
[ 1.770036] sunxi-ehci sunxi-ehci.2: USB 0.0 started, EHCI 1.00
[ 1.781512] hub 2-0:1.0: USB hub found
[ 1.789904] hub 2-0:1.0: 1 port detected
[ 1.818952] sunxi-ehci sunxi-ehci.3: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.832323] sunxi-ehci sunxi-ehci.3: new USB bus registered, assigned bus number 3
[ 1.845590] sunxi-ehci sunxi-ehci.3: irq 108, io mem 0xf1c1c000
[ 1.870043] sunxi-ehci sunxi-ehci.3: USB 0.0 started, EHCI 1.00
[ 1.881664] hub 3-0:1.0: USB hub found
[ 1.890302] hub 3-0:1.0: 1 port detected
[ 1.919344] sunxi-ehci sunxi-ehci.4: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.932740] sunxi-ehci sunxi-ehci.4: new USB bus registered, assigned bus number 4
[ 1.945967] sunxi-ehci sunxi-ehci.4: irq 110, io mem 0xf1c1d000
[ 1.970042] sunxi-ehci sunxi-ehci.4: USB 0.0 started, EHCI 1.00
[ 1.981680] hub 4-0:1.0: USB hub found
[ 1.990489] hub 4-0:1.0: 1 port detected
[ 1.999718] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 2.031228] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.044385] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 5
[ 2.057397] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[ 2.124576] hub 5-0:1.0: USB hub found
[ 2.133311] hub 5-0:1.0: 1 port detected
[ 2.162621] sunxi-ohci sunxi-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.175860] sunxi-ohci sunxi-ohci.2: new USB bus registered, assigned bus number 6
[ 2.189035] sunxi-ohci sunxi-ohci.2: irq 107, io mem 0xf1c1b400
[ 2.264561] hub 6-0:1.0: USB hub found
[ 2.273445] hub 6-0:1.0: 1 port detected
[ 2.302798] sunxi-ohci sunxi-ohci.3: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.316105] sunxi-ohci sunxi-ohci.3: new USB bus registered, assigned bus number 7
[ 2.329298] sunxi-ohci sunxi-ohci.3: irq 109, io mem 0xf1c1c400
[ 2.404584] hub 7-0:1.0: USB hub found
[ 2.413449] hub 7-0:1.0: 1 port detected
[ 2.442827] sunxi-ohci sunxi-ohci.4: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.456174] sunxi-ohci sunxi-ohci.4: new USB bus registered, assigned bus number 8
[ 2.469459] sunxi-ohci sunxi-ohci.4: irq 111, io mem 0xf1c1d400
[ 2.544586] hub 8-0:1.0: USB hub found
[ 2.553518] hub 8-0:1.0: 1 port detected
[ 2.562915] Initializing USB Mass Storage driver...
[ 2.573211] usbcore: registered new interface driver usb-storage
[ 2.584572] USB Mass Storage support registered.
[ 2.594457] usbcore: registered new interface driver ums-alauda
[ 2.605819] usbcore: registered new interface driver ums-cypress
[ 2.617280] usbcore: registered new interface driver ums-datafab
[ 2.628608] usbcore: registered new interface driver ums_eneub6250
[ 2.640060] usbcore: registered new interface driver ums-freecom
[ 2.651238] usbcore: registered new interface driver ums-isd200
[ 2.662342] usbcore: registered new interface driver ums-jumpshot
[ 2.673509] usbcore: registered new interface driver ums-karma
[ 2.684357] usbcore: registered new interface driver ums-onetouch
[ 2.695402] usbcore: registered new interface driver ums-realtek
[ 2.706252] usbcore: registered new interface driver ums-sddr09
[ 2.716948] usbcore: registered new interface driver ums-sddr55
[ 2.727582] usbcore: registered new interface driver ums-usbat
[ 2.738113] usbcore: registered new interface driver usbserial
[ 2.748503] usbserial: USB Serial Driver core
[ 2.757202] usbcore: registered new interface driver option
[ 2.767257] USB Serial support registered for GSM modem (1-port)
[ 2.778459] file system registered
[ 2.787739] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 2.799369] android_usb gadget: Number of LUNs=3
[ 2.808438] lun0: LUN: removable file: (no medium)
[ 2.817768] lun1: LUN: removable file: (no medium)
[ 2.826963] lun2: LUN: removable file: (no medium)
[ 2.836406] android_usb gadget: android_usb ready
[ 2.846187] mousedev: PS/2 mouse device common for all mice
[ 2.857107] ls_fetch_sysconfig_para: ls_unused.
[ 2.866277] [RTC] WARNING: Rtc time will be wrong!!
[ 2.875373] [RTC] WARNING: use *internal OSC* as clock source
[ 2.885690] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[ 2.896812] i2c /dev entries driver
[ 2.904919] IR RC5(x) protocol handler initialized
[ 2.914167] tscdev_init: tsc driver is disabled
[ 2.923307] Driver for 1-wire Dallas network protocol.
[ 2.932808] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[ 2.943662] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[ 2.955143] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[ 2.970118] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[ 2.980326] timeout_to_interv, line 167
[ 2.988404] interv_to_timeout, line 189
[ 2.996449] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[ 3.009669] device-mapper: uevent: version 1.0.3
[ 3.019024] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel#redhat.com
[ 3.032580] Bluetooth: HCI UART driver ver 2.2
[ 3.041598] Bluetooth: HCI H4 protocol initialized
[ 3.050941] Bluetooth: HCI BCSP protocol initialized
[ 3.060436] Bluetooth: HCILL protocol initialized
[ 3.069638] Bluetooth: HCIATH3K protocol initialized
[ 3.079317] Bluetooth: MSM Sleep Mode Driver Ver 1.2
[ 3.088976] Bluetooth: init no bt used in configuration
[ 3.088982]
[ 3.104775] [cpu_freq] ERR:get cpu extremity frequency from sysconfig failed, use max_freq
[ 3.120910] no red_led, ignore it!
[ 3.131197] usbcore: registered new interface driver usbhid
[ 3.141947] usbhid: USB HID core driver
[ 3.152119] script_get_item audio_pa_ctrl not found
[ 3.167806] asoc: sndcodec <-> sunxi-codec mapping ok
[ 3.183410] asoc: sndhdmi <-> sunxi-hdmiaudio.0 mapping ok
[ 3.195521] oprofile: using arm/armv7-ca7
[ 3.205005] u32 classifier
[ 3.212837] Actions configured
[ 3.220990] Netfilter messages via NETLINK v0.30.
[ 3.230635] nf_conntrack version 0.5.0 (3872 buckets, 15488 max)
[ 3.242335] ctnetlink v0.93: registering with nfnetlink.
[ 3.252669] NF_TPROXY: Transparent proxy support initialized, version 4.1.0
[ 3.264844] NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
[ 3.275528] mmc0: new SDHC card at address 0001
[ 3.275741] xt_time: kernel timezone is -0000
[ 3.275908] IPv4 over IPv4 tunneling driver
[ 3.276373] gre: GRE over IPv4 demultiplexor driver
[ 3.276382] ip_gre: GRE over IPv4 tunneling driver
[ 3.277016] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 3.277210] arp_tables: (C) 2002 David S. Miller
[ 3.277287] TCP: cubic registered
[ 3.277294] Initializing XFRM netlink socket
[ 3.357187] NET: Registered protocol family 10
[ 3.366318] mmcblk0: mmc0:0001 SD 3.72 GiB
[ 3.375839] Mobile IPv6
[ 3.382646] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 3.382684] mmcblk0: p1 p2
[ 3.383449] *******************sd init ok*******************
[ 3.409962] IPv6 over IPv4 tunneling driver
[ 3.419556] NET: Registered protocol family 17
[ 3.428376] NET: Registered protocol family 15
[ 3.437283] Bluetooth: RFCOMM TTY layer initialized
[ 3.446478] Bluetooth: RFCOMM socket layer initialized
[ 3.455844] Bluetooth: RFCOMM ver 1.11
[ 3.463574] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 3.473004] Bluetooth: BNEP filters: protocol multicast
[ 3.482329] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.492549] L2TP core driver, V2.0
[ 3.499872] PPPoL2TP kernel driver, V2.0
[ 3.507783] L2TP IP encapsulation support (L2TPv3)
[ 3.516771] L2TP netlink interface
[ 3.524201] L2TP ethernet pseudowire support (L2TPv3)
[ 3.533588] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 3.545743] ThumbEE CPU extension supported.
[ 3.554047] Registering SWP/SWPB emulation handler
[ 3.563802] cmdline,disp=
[ 3.601355] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 00:00:08 UTC (8)
[ 3.613650] ths_fetch_sysconfig_para: type err device_used = 1.
[ 3.625339] CPU Budget:Register notifier
[ 3.633378] CPU Budget:register Success
[ 3.641218] sunxi-budget-cooling sunxi-budget-cooling: Cooling device registered: thermal-budget-0
[ 3.657864] ALSA device list:
[ 3.664997] #0: audiocodec
[ 3.671931] #1: sndhdmi
[ 3.701347] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 3.714240] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 3.725065] Freeing init memory: 320K
[ 4.210107] [DISP] disp_device_attached_and_enable,line:159:attched ok, mgr0<-->device0, type=4, mode=5
I have compared with the Dmesg of the image they provided and it is same (no extra errors). The only difference is that it doesn't stop at the last message and above and continues with more message like this
[ 3.740859] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 3.751773] Freeing init memory: 320K
[ 3.994008] systemd[1]: Failed to insert module 'kdbus': Function not implemented
[ 4.480527] systemd[1]: systemd 225 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
[ 4.522559] systemd[1]: Detected architecture arm.
[ 4.556652] systemd[1]: Set hostname to <FriendlyARM>.
[ 4.813095] systemd[1]: display-manager.service: Cannot add dependency job, ignoring: Unit display-manager.service failed to load: No such file or directory.
[ 4.835364] systemd[1]: Reached target Swap.
[ 4.849758] systemd[1]: Reached target Encrypted Volumes.
[ 4.865289] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 4.883786] systemd[1]: Reached target Remote File Systems (Pre).
[ 4.900430] systemd[1]: Created slice Root Slice.
[ 4.915916] systemd[1]: Created slice System Slice.
[ 4.931753] systemd[1]: Created slice User and Session Slice.
[ 4.948846] systemd[1]: Created slice system-getty.slice.
[ 4.965667] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 4.983471] systemd[1]: Listening on udev Control Socket.
[ 5.000354] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 5.019741] systemd[1]: Reached target Paths.
[ 5.035599] systemd[1]: Listening on Journal Socket.
[ 5.200617] systemd[1]: Mounting Debug File System...
[ 5.290705] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 5.390688] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[ 5.415235] systemd[1]: Listening on Journal Audit Socket.
[ 5.434841] systemd[1]: Reached target Slices.
[ 5.453278] systemd[1]: Listening on udev Kernel Socket.
[ 5.580939] systemd[1]: Starting udev Coldplug all Devices...
[ 5.608874] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 5.770898] systemd[1]: Starting Load Kernel Modules...
[ 5.789989] systemd[1]: Listening on Journal Socket (/dev/log).
[ 5.890778] systemd[1]: Starting Journal Service...
[ 6.027527] systemd[1]: Mounted Debug File System.
[ 6.160197] systemd[1]: Started Remount Root and Kernel File Systems.
[ 6.330140] systemd[1]: Started Create list of required static device nodes for the current kernel.
[ 6.750244] systemd[1]: Started Load Kernel Modules.
[ 6.920156] systemd[1]: Started udev Coldplug all Devices.
[ 6.942933] systemd[1]: Started Journal Service.
So I guess the issue is with the rootfs not being detected and mounted correctly. Please guide me on this.
I'm pretty sure the problem is that the linux doesn't activate a console on uart.
Take a look at kernel log:
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init
As noted in http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-kernel.html:
When multiple consoles are listed output is sent to all consoles and input is taken from the last listed console. The last console is the one Linux uses as the /dev/console device.
So try making console=ttyS0,115200 being the last (or the only) console option by tuning bootargs u-boot environment variable.
To check this suggestion, just "Hit any key to stop autoboot", then use printenv to inspect default bootargs content, run setenv bootargs ... ... ... and finally, run bootd. However, be sure to inspect bootcmd and what does it call, because one of those things may invoke setenv bootargs during bootcmd execution and overwrite your manual option.
P.S. init=/sbin/init may be omitted.

PCI driver (request_mem_region fail)

I am trying to get memory resource but for any reason, I cannot. My code is the following:
mmio_base0 = pci_resource_start (dev,0);
mmio_length0 =pci_resource_len(dev,0);
if(!mmio_base0 || ((pci_resource_flags (dev,0) & IORESOURCE_MEM)== 0))
{
dev_err(&(dev->dev), "no mem resource at PCI #0\n");
}
else
{
printk(KERN_ALERT "There is memory at BAR0\n");
if(request_mem_region(mmio_base0,mmio_length0,"driver")==0){
printk(KERN_ALERT "Impossible to get memory\n");
}
}
I always get "Impossible to get memory". So, there are memory but I cannot request it.
cat /proc/iomem
c20000000-c2fffffff : /pcie#ffe250000
c20000000-c2fffffff : PCI Bus 0001:01
c20000000-c200fffff : 0001:01:00.0 //these two memories I want to request
c20100000-c201fffff : 0001:01:00.0
c40000000-c4fffffff : /pcie#ffe270000
c40000000-c4fffffff : PCI Bus 0002:01
There are memories there, but I cannot request them. It always fail! But my uboot detect my device.
PCIe2: Root Complex, x2 gen2, regs # 0xfe250000
02:00.0 - 1957:0808 - Processor
And there is not driver loaded which take these memories:
0001:01:00.0 Power PC: Freescale Semiconductor Inc Device 0808 (rev 10) (prog-if 01)
Flags: bus master, fast devsel, latency 0, IRQ 41
Memory at c20000000 (32-bit, non-prefetchable) [size=1M]
Memory at c20100000 (32-bit, prefetchable) [size=1M]
Capabilities: [44] Power Management version 3
Capabilities: [4c] Express Endpoint, MSI 00
Capabilities: [88] MSI: Enable- Count=1/16 Maskable- 64bit+
Capabilities: [100] Advanced Error Reporting
Any idea what is going on?
BR
I have already solved this problem. I have changed the following:
printk(KERN_ALERT "There is memory at BAR0\n");
if(request_mem_region(mmio_base0,mmio_length0,"driver")==0){
printk(KERN_ALERT "Impossible to get memory\n");
}
to
printk(KERN_ALERT "There is memory at BAR0\n");
if(pci_request_region(dev,0,"mydriver")==0){
printk(KERN_ALERT "Memory reserved properly\n");
}
When the function return 0, the memory is reserved properly. So, you can find in /proc/iomem the memory with a associated name ("mydriver").
Best regards

Why is the probe function in my kernel module not being called?

While following, among others, this tutorial (1) and reading certain chapters in the Linux Device Drivers book, I cannot get the pr_debug() statements in the probe function to show any output in dmesg.
Here's my code:
#include <linux/module.h> /*included for all kernel modules*/
#include <linux/kernel.h> /*included for KERN_DEBUG*/
#include <linux/init.h> /*included for __init and __exit macros*/
#include <linux/usb.h>
#include <linux/usb/input.h>
#include <linux/hid.h>
#define VENDOR_ID 0x0930
#define DEVICE_ID 0x6545
MODULE_LICENSE("GPL");
MODULE_AUTHOR("dev");
MODULE_DESCRIPTION("eusb driver");
static struct usb_device_id eusb_table[] = {
{ USB_DEVICE(VENDOR_ID, DEVICE_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, eusb_table);
static int eusb_probe(struct usb_interface *interface, const struct usb_device_id *id)
{
pr_debug("USB probe function called\n");
return 0;
}
static void eusb_disconnect(struct usb_interface *interface)
{
pr_debug("USB disconnect function called\n");
}
static struct usb_driver eusb_driver = {
//.owner = THIS_MODULE,
.name = "eusb",
.probe = eusb_probe,
.disconnect = eusb_disconnect,
.id_table = eusb_table
};
static int __init eusb_init(void)
{
int result = 0;
pr_debug("Hello world!\n");
result = usb_register(&eusb_driver);
if(result){
pr_debug("error %d while registering usb\n", result);}
else{pr_debug("no error while registering usb\n");}
return 0;
}
static void __exit eusb_exit(void)
{
usb_deregister(&eusb_driver);
pr_debug("Exiting module\n");
}
module_init(eusb_init);
module_exit(eusb_exit);
and Makefile:
obj-m := eusb.o
CFLAGS_eusb.o := -DDEBUG
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
Make finishes without errors, after insmod I can see the module listed in lsmod and the pr_debug() in the init and exit functions show output in dmesg.
When inserting the device however the probe function seems to not get called (or the pr_debug() statements do not show any output in dmesg).
Dmesg output:
[ 7777.521236] Hello world!
[ 7777.521264] usbcore: registered new interface driver eusb
[ 7777.521266] no error while registering usb
[ 7780.597087] usb 1-6: USB disconnect, device number 9
[ 7797.686970] usb 1-6: new high-speed USB device number 10 using xhci_hcd
[ 7797.857324] usb 1-6: New USB device found, idVendor=0930, idProduct=6545
[ 7797.857328] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7797.857330] usb 1-6: Product: DataTraveler 2.0
[ 7797.857331] usb 1-6: Manufacturer: Kingston
[ 7797.857333] usb 1-6: SerialNumber: 08606E6D407FED10571E5067
[ 7797.858787] usb-storage 1-6:1.0: USB Mass Storage device detected
[ 7797.858902] scsi host11: usb-storage 1-6:1.0
[ 7798.931417] scsi 11:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 4
[ 7798.931824] sd 11:0:0:0: Attached scsi generic sg3 type 0
[ 7800.184749] sd 11:0:0:0: [sdc] 60964864 512-byte logical blocks: (31.2 GB/29.0 GiB)
[ 7800.186338] sd 11:0:0:0: [sdc] Write Protect is off
[ 7800.186343] sd 11:0:0:0: [sdc] Mode Sense: 23 00 00 00
[ 7800.187948] sd 11:0:0:0: [sdc] No Caching mode page found
[ 7800.187952] sd 11:0:0:0: [sdc] Assuming drive cache: write through
[ 7800.220477] sdc: sdc1 sdc2 sdc3
[ 7800.225068] sd 11:0:0:0: [sdc] Attached SCSI removable disk
[ 7802.798403] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 7802.799507] ISO 9660 Extensions: RRIP_1991A
I have tried with another device, tried with printk() instead of pr_debug(). I found several questions on SO with the same problem, but my code is as far as I can tell almost/completely the same as the code in the answers.
I have also tried with:
USB_INTERFACE_INFO(
USB_INTERFACE_CLASS_HID,
USB_INTERFACE_SUBCLASS_BOOT,
USB_INTERFACE_PROTOCOL_KEYBOARD)
instead of USB_DEVICE() (the other device was a keyboard).
I noticed that some answers talk about platform_driver instead of usb_driver, but I think this is not relevant for me, as it is never mentioned in the tutorials.
Where am I going wrong?
Is your purpose just educational? Otherwise the driver is already there and it's called usb-storage. Seems even that driver enumerates your device first. Try to disable usb-storage and load your driver again. Or better use the virtual machine (KVM / Qemu) to try your drivers.
As you can see your Hello world! was printed which implies the module was loaded successfully. Often all the modules claiming to handle the device via usb_device_id* table are loaded. See 9.3.2.3. Module Loading.
Now, the probe function is called only for the driver the device was bound to. In the case where there is no priority set and two drivers are capable of binding, any of them might get the first opportunity.
I have written a blog post which might clear things further (if not, do comment here).
Further, you might want to go through these two relevant mailing list threads
https://lists.kernelnewbies.org/pipermail/kernelnewbies/2011-October/003639.html
https://marc.info/?l=linux-usb&m=162123892329464&w=2

Resources