Commit 303a24435f3e4b39a6b526ca2a32cd0452713153

Authored by Albert ARIBAUD \(3ADEV\)
Committed by Stefano Babic
1 parent 083e4fd401

pcm052: add 'm4go' command

Add the 'm4go' command to pcm052-based targets.
It loads scatter file images.

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>

Showing 1 changed file with 38 additions and 0 deletions Side-by-side Diff

board/phytec/pcm052/pcm052.c
... ... @@ -513,4 +513,42 @@
513 513  
514 514 return 0;
515 515 }
  516 +
  517 +static int do_m4go(cmd_tbl_t *cmdtp, int flag, int argc,
  518 + char * const argv[])
  519 +{
  520 + ulong addr;
  521 +
  522 + /* Consume 'm4go' */
  523 + argc--; argv++;
  524 +
  525 + /*
  526 + * Parse provided address - default to load_addr in case not provided.
  527 + */
  528 +
  529 + if (argc)
  530 + addr = simple_strtoul(argv[0], NULL, 16);
  531 + else
  532 + addr = load_addr;
  533 +
  534 + /*
  535 + * Write boot address in PERSISTENT_ENTRY1[31:0] aka SRC_GPR2[31:0]
  536 + */
  537 + writel(addr + 0x401, 0x4006E028);
  538 +
  539 + /*
  540 + * Start secondary processor by enabling its clock
  541 + */
  542 + writel(0x15a5a, 0x4006B08C);
  543 +
  544 + return 1;
  545 +}
  546 +
  547 +U_BOOT_CMD(
  548 + m4go, 2 /* one arg max */, 1 /* repeatable */, do_m4go,
  549 + "start the secondary Cortex-M4 from scatter file image",
  550 + "[<addr>]\n"
  551 + " - start secondary Cortex-M4 core using a scatter file image\n"
  552 + "The argument needs to be a scatter file\n"
  553 +);