cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
247 Views
Registered: ‎05-01-2017

microzed AMP ( Petalinux - Baremetal ) sd card setup

Hi Xilinx,

               vivado/sdk/petalinux 2017.4, microzed(7020)

asked on other board, didn't get answer. https://forums.xilinx.com/t5/%E5%B5%8C%E5%85%A5%E5%BC%8F%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91/amp-petalinux-bare-metal-%E9%97%AE%E9%A2%98/td-p/989856

I am working on microzed AMP (Petalinux - Baremetal). SDK app (on ps7_cortexa9_1) will read/write files on sd card, the file system in use is borrowed from UCOS.

I am using QSPI boot, so Petalinux does not need SD card setup at all.

Constructed my own fsbl project which load/start SDK app to 0x3000_0000 after LoadBootImage();

#define sev() __asm__("sev")
#define CPU1STARTADR 0xFFFFFFF0
#define CPU1STARTMEM 0x30000000

void StartCpu1(void)
{
#if 1
fsbl_printf(DEBUG_GENERAL,"FSBL: Write the address of the application for CPU 1 to 0xFFFFFFF0\n\r");
Xil_Out32(CPU1STARTADR, CPU1STARTMEM);
dmb(); //waits until write has finished
fsbl_printf(DEBUG_GENERAL,"FSBL: Execute the SEV instruction to cause CPU 1 to wake up and jump to the application\n\r");
sev();
#endif
}

HandoffAddress = LoadBootImage();

fsbl_printf(DEBUG_INFO,"Handoff Address: 0x%08lx\r\n",HandoffAddress);
StartCpu1();

SDK app lscript.ld is modified as 

ps7_ddr_0 : ORIGIN = 0x30000000, LENGTH = 0x10000000

--------------------------------------------------test 1--------------------------------------------------------

after linux boot, cpu1 will wake up,However the app is hung on "Initializing SDCard"

cpu1:

UCOS - uC/OS Init Started.
UCOS - STDIN/STDOUT Device Initialized.
UCOS - Initializing uC/FS.
UCOS - uC/FS initialization successful.
UCOS - Initializing SDCard.

at same time,  cpu0 (linux):

root@MYPROJECT:~# mmc0: Got command interrupt 0x00000001 even though no command operation was in progress.
sdhci: =========== REGISTER DUMP (mmc0)===========
sdhci: Sys addr: 0x00000000 | Version: 0x00008901
sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000
sdhci: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci: Present: 0x01ff0000 | Host ctl: 0x000000c0
sdhci: Power: 0x00000001 | Blk gap: 0x00000000
sdhci: Wake-up: 0x00000000 | Clock: 0x00007c07
sdhci: Timeout: 0x00000008 | Int stat: 0x00000000
sdhci: Int enab: 0x107f000b | Sig enab: 0x000f0001
sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
sdhci: Caps: 0x69ec0080 | Caps_1: 0x00000000
sdhci: Cmd: 0x00000000 | Max curr: 0x00000001
sdhci: Host ctl2: 0x00000000
sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000
sdhci: ===========================================

root@MYPROJECT:~#

------------------------------------------------test 2-----------------------------------------------------------------

Then I found plnx_arm-system.dts, and delete the following 2 sdhci nodes

sdhci@e0100000 {
compatible = "arasan,sdhci-8.9a";
status = "okay";
clock-names = "clk_xin", "clk_ahb";
clocks = <0x1 0x15 0x1 0x20>;
interrupt-parent = <0x4>;
interrupts = <0x0 0x18 0x4>;
reg = <0xe0100000 0x1000>;
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x1>;
};

sdhci@e0101000 {
compatible = "arasan,sdhci-8.9a";
status = "disabled";
clock-names = "clk_xin", "clk_ahb";
clocks = <0x1 0x16 0x1 0x21>;
interrupt-parent = <0x4>;
interrupts = <0x0 0x2f 0x4>;
reg = <0xe0101000 0x1000>;
};

re-build plnx_arm-system.dtb,and then re-genrate image.ub

after linux boot, cpu1 will wake up,However the app is hung on the same place "Initializing SDCard"

cpu1:

UCOS - uC/OS Init Started.
UCOS - STDIN/STDOUT Device Initialized.
UCOS - Initializing uC/FS.
UCOS - uC/FS initialization successful.
UCOS - Initializing SDCard.

at the same time, cpu0 (linux):

root@MYPROJECT:~# unexpected IRQ trap at vector 00

root@MYPROJECT:~#

-----------------------------------------------------------------------------------------------

In summary,

test 1,  both Linux device tree and SDK bsp system.mss contains sd card setting, however, when cpu1 starts SDK app,REGISTER DUMP (mmc0) in linux, and SDK app hung.

test 2, delete sdhci nodes from Linux device tree ,however, when cpu1 starts SDK app,unexpected IRQ trap at vector 00 in linux, and SDK app hung. 

Please advise, thanks in advance,

Mike

0 Kudos
1 Reply
Highlighted
Explorer
Explorer
216 Views
Registered: ‎05-01-2017

Re: microzed AMP ( Petalinux - Baremetal ) sd card setup

found answer XScuGic_InterruptMaptoCpu(GicInstancePtr, 1, GpioIntrId); to connect interrupt to cpu1 rather than cpu0.

 

However, ucos has re-writed interrupt; system.mss selects ucos_scugic rather than XScuGic. Anyone has such experience. Please share here

Thanks in advance.

0 Kudos