Other Parts Discussed in Thread: DRA752
Tool/software: Linux
Hello, I've been working with an AM5728-based design, and one of our primary changes over the AM57x EVM is that we're using only 256MB of RAM (address range 0x80000000 to 0x90000000), instead of 2GB. As such, we've disabled ARM LPAE in our PSDK4 kernel config. I've gotten the board to boot to the Linux terminal with a minimal image (the arago filesys in PSDK4), and I'm working on bringing up the rest of the on chip peripherals that we plan to use, starting with the IPU (for the IVA-HD decoder). Since our planned application is multi-media intensive, I intend to use the same amount of memory space that the EVM does (if this is too much already, I'd appreciate the heads up). However I'm running into the error
incorrect alignment of CMA region
I've noticed from https://stackoverflow.com/questions/4888067/how-to-get-linux-kernel-page-size-programmatically that the page size can be found by dividing "/proc/meminfo: Mapped" by "/proc/vmstat: nr_mapped" which in my case results in
root@am57xx-evm:~# cat /proc/meminfo | grep Mapped
Mapped: 9520 kB
root@am57xx-evm:~# cat /proc/vmstat | grep nr_mapped
nr_mapped 2371
9520kB / 2371 = 4kB
which matches what ARM specifies for a valid non-LPAE page size for ARMv7:
My .config file also specifies that the CONFIG_CMA_ALIGNMENT value = 8, which means 256 page alignment, ie 4kB * 256 = 1MB memory alignment.
My strategy for bringing up the IPU was to place the start of the CMA buffers at a space divisible by 1MB, then use the same buffer lengths as the EVM. My positioning strategy is similar to the EVM, where I put it near the top of my RAM, below where U-Boot places the device tree (in my case, this means my CMA buffer must end below 0x8def4000).
My CMA buffers are:
ipu2_cma_pool: ipu2_cma@8a600000 { compatible = "shared-dma-pool"; reg = <0x0 0x8a600000 0x0 0x3800000>; reusable; status = "okay"; }; ipu1_cma_pool: ipu1_cma@88600000 { compatible = "shared-dma-pool"; reg = <0x0 0x88600000 0x0 0x2000000>; reusable; status = "okay"; };
compared to the EVM's
ipu2_cma_pool: ipu2_cma@95800000 { compatible = "shared-dma-pool"; reg = <0x0 0x95800000 0x0 0x3800000>; reusable; status = "okay"; }; dsp1_cma_pool: dsp1_cma@99000000 { compatible = "shared-dma-pool"; reg = <0x0 0x99000000 0x0 0x4000000>; reusable; status = "okay"; }; ipu1_cma_pool: ipu1_cma@9d000000 { compatible = "shared-dma-pool"; reg = <0x0 0x9d000000 0x0 0x2000000>; reusable; status = "okay"; }; dsp2_cma_pool: dsp2_cma@9f000000 { compatible = "shared-dma-pool"; reg = <0x0 0x9f000000 0x0 0x800000>; reusable; status = "okay"; }; };
However, when I try booting, I get the error that I mentioned above. Pertinent log section is below:
## Current stack ends at 0x8df11a00 * kernel: cmdline image address = 0x82000000
## Skipping init Ramdisk
## No init Ramdisk
ramdisk start = 0x00000000, ramdisk end = 0x00000000
* fdt: cmdline image address = 0x88000000
## Checking for 'FDT'/'FDT Image' at 88000000
Wrong FIT format: no description
* fdt: raw FDT blob
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
of_flat_tree at 0x88000000 size 0x00018dbe
Initial value for argc=3
Final value for argc=3
## FIT configuration was not specified
using: FDT
## initrd_high = 0x90000000, copy_to_ram = 1
ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
## device tree at 88000000 ... 88018dbd (len=114110 [0x1BDBE])
Loading Device Tree to 8def4000, end 8df0fdbd ... OK
Initial value for argc=3
Final value for argc=3
Updating property '/ocp/ethernet@48484000/slave@48480200/mac-address' = d4 36 39 fc 4b 3e
Updating property '/ocp/ethernet@48484000/slave@48480200/local-mac-address' = d4 36 39 fc 4b 3e
Updating property '/ocp/ethernet@48484000/slave@48480300/mac-address' = d4 36 39 fc 4b 3f
Updating property '/ocp/ethernet@48484000/slave@48480300/local-mac-address' = d4 36 39 fc 4b 3f
## Transferring control to Linux (at address 82000000)...Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.28-geed43d1050 (tom@tom-ThinkPad-P50s) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #5 SMP PREEMPT Mon Oct 16 18:08:23 EDT 2017
[ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] OF: fdt:Machine model: tom's customboard
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: incorrect alignment of CMA region
[ 0.000000] Reserved memory: incorrect alignment of CMA region
[ 0.000000] cma: Reserved 24 MiB at 0x8e400000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] OMAP4: Map 0x8fe00000 to fe600000 for dram barrier
[ 0.000000] DRA752 ES2.0
[ 0.000000] percpu: Embedded 13 pages/cpu @cfd80000 s22092 r8192 d22964 u53248
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 60352
[ 0.000000] Kernel command line: console=ttyO2,115200n8 debug earlyprintk=ttyO2,115200n8,keep loglevel=7 log_buf_len=16000 initcall_debug time root=PARTUUID=79bceccd-02 rw rootfstype=ext4 rootwait
[ 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] Memory: 114168K/243712K available (7168K kernel code, 312K rwdata, 2412K rodata, 1024K init, 292K bss, 104968K reserved, 24576K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff800000 ( 752 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 - 0xc0800000 (8160 kB)
[ 0.000000] .init : 0xc0b00000 - 0xc0c00000 (1024 kB)
[ 0.000000] .data : 0xc0c00000 - 0xc0c4e360 ( 313 kB)
[ 0.000000] .bss : 0xc0c50000 - 0xc0c992b0 ( 293 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] OMAP clockevent source: timer1 at 32786 Hz
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 6.14MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x16af5adb9, max_idle_ns: 440795202250 ns
[ 0.000006] sched_clock: 56 bits at 6MHz, resolution 162ns, wraps every 4398046511023ns
[ 0.008308] Switching to timer-based delay loop, resolution 162ns
[ 0.014950] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
[ 0.025212] OMAP clocksource: 32k_counter at 32768 Hz
[ 0.030992] Console: colour dummy device 80x30
[ 0.035662] WARNING: Your 'console=ttyO2' has been replaced by 'ttyS2'
[ 0.042457] This ensures that you still see kernel messages. Please
[ 0.048974] update your kernel commandline.
[ 0.053373] Calibrating delay loop (skipped), value calculated using timer frequency.. 12.29 BogoMIPS (lpj=61475)
[ 0.064012] pid_max: default: 32768 minimum: 301
[ 0.068957] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.075844] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.084026] CPU: Testing write buffer coherency: ok