UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor calcius00
Visitor
1,450 Views
Registered: ‎10-03-2017

Zynq AMP Petalinux - Baremetal

Hi, I am trying to use Zynq in AMP configuration. I use Vivado 2015.4 and based my setup on XAPP1078 under Zybo board with Digilent´s Petalinux BSP, using the XAPP1078 modified BSP 5.19 and xupsh´s github repository (https://github.com/xupsh/Amp-zynq).

 

CPU1 is working with a baremetal application that blinks led via AXI_GPIO and print debug message  to UART0. The CPU1_bsp extra compiler flags are "-g -DUSE_AMP=1".

CPU0 boot petalinux (Based on Digilent´s Petalinux BSP) with UART1 as default output.(I removed UART0 from device tree)

 

I can boot Petalinux and CPU1 baremetal application from linux with two methods:

 1. Like XAPP1078 method, linux boot first and enable CPU1 via "./devmem 0xfffffff0 w 0x18000000".

 2. With a modified FSBL that loads CPU1 .elf in FsblHookBeforeHandoff.

 

If I use method 1, The led start blinking but I can not see UART0 messages.

If I use method 2, CPU1 start blinking and sending UART0 messages but UART stop when linux is under boot process (led still blinking).

 

This is my linux boot output with method 2. I try to stop it when the CPU1 UART stop.

 

Booting Linux on physical CPU 0x0
Linux version 4.0.0-xilinx-dirty () (gcc version 4.9.2 (Sourcery Code7
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Digilent-Zybo-Linux-BD-v2015.4
bootconsole [earlycon0] enabled
cma: Reserved 40 MiB at 0x15800000
Memory policy: Data cache writealloc
PERCPU: Embedded 11 pages/cpu @d54bf000 s12672 r8192 d24192 u45056
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 97536
Kernel command line: console=ttyPS1,115200 earlyprintk maxcpus=1 mem=384M
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 331012K/393216K available (4767K kernel code, 223K rwdata, 1724K rodata, 10544K)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xd8800000 - 0xff000000   ( 616 MB)
    lowmem  : 0xc0000000 - 0xd8000000   ( 384 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc065f0dc   (6493 kB)
      .init : 0xc0660000 - 0xc10ac000   (10544 kB)
      .data : 0xc10ac000 - 0xc10e3f60   ( 224 kB)
       .bss : 0xc10e3f60 - 0xc11182f4   ( 209 kB)
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
slcr mapped to d8804000
zynq_clock_init: clkc starts at d8804100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 3383112499200ns
timer #0 at d8808000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop... 1292.69 BogoMIPS (lpj=6463488)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x4836d8 - 0x483730
Brought up 1 CPUs
SMP: Total of 1 processors activated (1292.69 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xd8880000
GPIO IRQ not connected
XGpio: /amba_pl/gpio@41210000: registered, base is 902
XGpio: /amba_pl/gpio@41230000: registered, base is 901
GPIO IRQ not connected
XGpio: /amba_pl/gpio@41200000: registered, base is 897
GPIO IRQ not connected
XGpio: /amba_pl/gpio@41220000: registered, base is 893
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usb_phy@0 supply vcc not found, using dummy regulator
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
xilinx-vdma 43000000.dma: Xilinx AXI VDMA Engine Driver Probed!!
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 145, base_baud = 6250000) is a xuartps
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to d881a000
[drm] Initialized drm 1.1.0 20060810
[drm] load() is defered & will be called again
platform amba_pl:xilinx_drm: Driver xilinx-drm requests probe deferral
brd: module loaded
loop: module loaded
m25p80 spi0.0: found s25fl128s, expected m25p80
m25p80 spi0.0: s25fl128s (16384 Kbytes)
4 ofpart partitions found on MTD device spi0.0
Creating 4 MTD partitions on "spi0.0":
0x000000000000-0x000000300000 : "boot"
0x000000300000-0x000000320000 : "bootenv"
0x000000320000-0x000000da0000 : "kernel"
0x000000da0000-0x000001000000 : "spare"
CAN device driver interface
libphy: MACB_mii_bus: probed
mdio_bus e000b000.etherne: /amba/ethernet@e000b000/mdio has invalid PHY address
mdio_bus e000b000.etherne: scan phy mdio at address 0
mdio_bus e000b000.etherne: scan phy mdio at address 1
mdio_bus e000b000.etherne: scan phy mdio at address 2
mdio_bus e000b000.etherne: scan phy mdio at address 3
mdio_bus e000b000.etherne: scan phy mdio at address 4
mdio_bus e000b000.etherne: scan phy mdio at address 5
mdio_bus e000b000.etherne: scan phy mdio at address 6
mdio_bus e000b000.etherne: scan phy mdio at address 7
mdio_bus e000b000.etherne: scan phy mdio at address 8
mdio_bus e000b000.etherne: scan phy mdio at address 9
mdio_bus e000b000.etherne: scan phy mdio at address 10
mdio_bus e000b000.etherne: scan phy mdio at address 11
mdio_bus e000b000.etherne: scan phy mdio at address 12
mdio_bus e000b000.etherne: scan phy mdio at address 13
mdio_bus e000b000.etherne: scan phy mdio at address 14
mdio_bus e000b000.etherne: scan phy mdio at address 15
mdio_bus e000b000.etherne: scan phy mdio at address 16
mdio_bus e000b000.etherne: scan phy mdio at address 17
mdio_bus e000b000.etherne: scan phy mdio at address 18
mdio_bus e000b000.etherne: scan phy mdio at address 19
mdio_bus e000b000.etherne: scan phy mdio at address 20
mdio_bus e000b000.etherne: scan phy mdio at address 21
mdio_bus e000b000.etherne: scan phy mdio at address 22
mdio_bus e000b000.etherne: scan phy mdio at address 23
mdio_bus e000b000.etherne: scan phy mdio at address 24
mdio_bus e000b000.etherne: scan phy mdio at address 25
mdio_bus e000b000.etherne: scan phy mdio at address 26
mdio_bus e000b000.etherne: scan phy mdio at address 27
mdio_bus e000b000.etherne: scan phy mdio at address 28
mdio_bus e000b000.etherne: scan phy mdio at address 29
mdio_bus e000b000.etherne: scan phy mdio at address 30
mdio_bus e000b000.etherne: scan phy mdio at address 31
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 147 (d8:80:39)
macb e000b000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000b0)
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse dev+---------------------------------------+
i2c /dev entries driver |                                       |
at24 0-0050: 256 byte 24|    |
cdns-i2c e0004000.i2c: 4|                                       |
cdns-i2c e0005000.i2c: 4+---------------------------------------+
Xilinx Zynq CpuIdle Driver started
Driver 'mmcblk' needs updating - please use bus_type methods
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan e0100000.sdhci: No vmmc regulator found
sdhci-arasan e0100000.sdhci: No vqmmc regulator found
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
platform amba_pl:sound: Driver asoc-simple-card requests probe deferral
TCP: cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
bootconsole [earlycon0] disabled

Can anyone tell me if any further changes are needed?

 

Best regards

0 Kudos
4 Replies
Moderator
Moderator
1,391 Views
Registered: ‎10-06-2016

Re: Zynq AMP Petalinux - Baremetal

Hi @calcius00,

 

Taking a look to your log the issue sems to be in the bootargs:

Kernel command line: console=ttyPS1,115200 earlyprintk maxcpus=1 mem=384M


So once your earlyconsole is finished it tries to use ttyP1 for console output, but you only have ttyP0 (UART1).


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Adventurer
Adventurer
1,374 Views
Registered: ‎05-01-2017

Re: Zynq AMP Petalinux - Baremetal

Hi calcius00,

It is out of the topic. Would you mind informing me how did you get UART0?

I am working on zedboard with UART1 default to a usb port, while UART0 has no default definition. Are you working on a customized board with dual UART outputs, or use PMOD RS232 sort device to facilitate UART0?

Please advise, thanks in advance.

Mike
0 Kudos
Visitor calcius00
Visitor
1,318 Views
Registered: ‎10-03-2017

Re: Zynq AMP Petalinux - Baremetal

Dear ibaie, 

 

Thanks in advance for your answer. I change bootargs to console=ttyPS0 with the same effect.

 

I am trying some configurations and I have some advances:

 

1. When linux start near to console output "INIT: Entering runlevel: 5", CPU1 UART0 and led blink stops. But if I use sysfs for example "echo 913 > /sys/class/gpio/export " the led start blinking (UART0 remain without output).

 

2. I read about issues with kernel SWP/SWPB emulation that stops the CPU1. If I change function do_initcalls(void) in "petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/init/main.c"

From:

static void __init do_initcalls(void)
{
	int level;

	for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++)
		do_initcall_level(level);
}

To:

static void __init do_initcalls(void)
{
        int level;
        for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++)
        {
                if (level != 7)
                        do_initcall_level(level);
        }
}

The CPU1 UART0 works fine and led start blinking when use sysfs for example "echo 913 > /sys/class/gpio/export ". Whith this configuration the problem is I can not use NFS for rootfs.

 

 

exds75: I connect UART0 to EMIO and send it to PMOD connector and use 232ttl to usb converter (FTDI).

0 Kudos
Adventurer
Adventurer
1,308 Views
Registered: ‎05-01-2017

Re: Zynq AMP Petalinux - Baremetal

Thank you for the info. Best wish ~~

0 Kudos